Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
Application Class Reference

Main application. More...

#include <application.h>

Inheritance diagram for Application:
Inheritance graph
Collaboration diagram for Application:
Collaboration graph

Public Slots

void onClosedMidiLoopDetected ()
 Slot: Closed Midi feedback loop discovered, inhibit converter. More...
 
void onInputOutputStatusChanged ()
 I/O configuration changed, cancel converter inhibition. More...
 

Signals

void setQmlLocale (QVariant string)
 
void showDownloadDialog ()
 
void getSettingsFromQml ()
 
void sendMobileMessage (QVariant string)
 
void setQmlInstrumentNames (QVariant stringlist)
 
void setQmlSelectedInstrument (QVariant index)
 
void startLoadingInstrument (QString name)
 
void setAudioDeviceName (QVariant name)
 
void setAudioDeviceList (QVariant list, QVariant index)
 
void setAudioSampleRates (QVariant list, QVariant index)
 
void setAudioBufferSizes (QVariant buffer, QVariant packet)
 
void connectAudioDevice (bool active)
 
void signalCircularGauge (QVariant progression)
 
void setSelectedExample (QVariant number)
 

Public Member Functions

 Application (QApplication &app)
 Application constructor. More...
 
void init (QQmlApplicationEngine &engine)
 Initialization of the application. More...
 
void start ()
 Start the application and its components. More...
 
void stop ()
 Stop the application and its components. More...
 
void exit ()
 Exit from the application and all its components. More...
 
void suspend ()
 Suspend the application This function suspends the application and all modules. This is essential e.g. on mobile devices, when the application is sent to the background. More...
 
void resume ()
 resume More...
 
void installTranslations ()
 Install existing translations. More...
 
bool restartRequested ()
 
DownloadergetDownloader ()
 
bool loadMidiFile (QString filename)
 Load a Midi file. More...
 
void mobileMessage (QString msg)
 Show error message on mobile phone while it is connected to a keyboard. More...
 
void setVerbosity (int verbosity)
 Set the verbosity level of the class-specific messages. More...
 
int getVerbosity ()
 Get the actual verbosity level. More...
 

Private Slots

void handleApplicationStates (Qt::ApplicationState state)
 Function executed when application state changes (platform-dependent) Takes action if the state of the application changes. Needed for Android. More...
 
void restartApplication ()
 Restart the application by force. More...
 
void changeLocale (QString locale)
 Slot: Change the language. More...
 
void cancelLoading ()
 Private slot: Cancel the loading process. More...
 
void loadingFinished (bool success)
 Private slot: Loading finished. More...
 
void loadInstrument (int selectedindex)
 Private slot: Load an instrument. More...
 
void newInstrumentDownloaded (QString localpath)
 Private slot: New instrument downloaded. More...
 
void startDownload (bool forced=false)
 Private slot: Start download. More...
 
void selectAudioParameters (int devIndex, int srIndex, int buffersize, int packetsize)
 Private slot: Select audio parameters. More...
 
void resetAudioParameters ()
 Reset audio parameters. More...
 
void onAudioDevicesAdded (QStringList list)
 Private slot: New audio device added (test) More...
 
void onAudioDevicesRemoved (QStringList list)
 Private slot: An audio device has been removed (test) More...
 
void onChangeOfAvailableAudioDevices (QStringList list)
 Private slot: The list of availabel devices has changed (test) More...
 
void onCurrentDeviceParametersChanged ()
 Private slot: on current audio device parameters changed. More...
 
void onConnectionSuccessfullyEstablished (bool success)
 Private slot: on audio connection established. More...
 
void hearExample (int number)
 Private slot: Hear a Midi example. More...
 
void emitAveragePitchProgression (double pitchProgression)
 Emit the newly calculated average pitch progression. More...
 
void disableScreenSaver ()
 
void enableScreenSaver ()
 

Private Member Functions

void setInstrumentSelector (int index=0)
 Set the content of the instrument selector. More...
 
QStringList updateShownInstrumentNames ()
 Update the list of instruments in the Qml Combo box. More...
 
QString shorten (const QString &device, int truncation=30) const
 Shorten very long device names. More...
 

Private Attributes

QApplication * pApplication
 
StartupSound mStartupSound
 
bool mStarted
 
QSettings mSettings
 
QString mLocale
 
bool mRestartRequest
 
QTranslator mQtTranslator
 
QTranslator mAppTranslator
 
Downloader mDownloader
 
FileOpenDialog mFileOpenDialog
 
MidiPlayer mMidiPlayer
 
Midi mMidi
 
MidiMicrotonal mMidiMicrotonalConverter
 
AudioOutput mAudioOutput
 
int mNumberOfExample
 
Instrument mInstrument
 
SoundGenerator mSoundGenerator
 
MidiHandler mMidiHandler
 
Tuner mTuner
 
LogFile mTuningLog
 
TouchscreenKeyboard mKeyboard
 
QStringList mAvailableMidiDevices
 
QStringList mAvailableMidiOutputDevices
 
QString mCurrentMidiDevice
 
bool mMidiAutomaticRecognition
 
bool mMidiPlayerWasPlaying
 
bool mSuspended
 
double mLastEmittedPitchProgression
 

Detailed Description

Main application.

This class represents the main application which is the base QObject in the code. It manages the flow of init-start-supend-resume-stop-exit as well as certain system-related features. Moreover, it holds the instances of various modules. All signal-slot connections are channeled through this class.

Definition at line 60 of file application.h.

Constructor & Destructor Documentation

Application::Application ( QApplication &  app)

Application constructor.

Definition at line 47 of file application.cpp.

Here is the call graph for this function:

Member Function Documentation

void Application::cancelLoading ( )
privateslot

Private slot: Cancel the loading process.

Definition at line 695 of file application.cpp.

Here is the call graph for this function:

void Application::changeLocale ( QString  locale)
privateslot

Slot: Change the language.

Parameters
locale: Locale (e.g. en_US) of the selected language

Changing the language at runtime is a difficult task. Therefore, this function simply terminates and restarts the application with the new locale.

Definition at line 506 of file application.cpp.

Here is the call graph for this function:

void Application::connectAudioDevice ( bool  active)
signal
void Application::disableScreenSaver ( )
inlineprivateslot

Definition at line 113 of file application.h.

Here is the call graph for this function:

void Application::emitAveragePitchProgression ( double  pitchProgression)
privateslot

Emit the newly calculated average pitch progression.

This function restricted the displayed range of the pitch progression according to the range of the circular gauge

Parameters
pitchProgression: Value of the pitch progression in cents

Definition at line 576 of file application.cpp.

void Application::enableScreenSaver ( )
inlineprivateslot

Definition at line 114 of file application.h.

Here is the call graph for this function:

void Application::exit ( )

Exit from the application and all its components.

Definition at line 364 of file application.cpp.

Here is the call graph for this function:

Downloader* Application::getDownloader ( )
inline

Definition at line 77 of file application.h.

Here is the call graph for this function:

void Application::getSettingsFromQml ( )
signal
int Log::getVerbosity ( )
inherited

Get the actual verbosity level.

Returns
: Verbosity level (1...4)

Definition at line 118 of file log.cpp.

void Application::handleApplicationStates ( Qt::ApplicationState  state)
privateslot

Function executed when application state changes (platform-dependent) Takes action if the state of the application changes. Needed for Android.

Definition at line 439 of file application.cpp.

Here is the call graph for this function:

void Application::hearExample ( int  number)
privateslot

Private slot: Hear a Midi example.

Parameters
number: number of the Midi example to be played

Definition at line 538 of file application.cpp.

Here is the call graph for this function:

void Application::init ( QQmlApplicationEngine &  engine)

Initialization of the application.

This function initializes the application but it does not yet start the components. Moreover, the application is "wired" from here: For easy reference all signal-slot connections can be found here.

Parameters
engine: Reference to the QML application engine which handels the GUI

Definition at line 103 of file application.cpp.

Here is the call graph for this function:

void Application::installTranslations ( )

Install existing translations.

This function installs the translation files for the application and for Qt.

Definition at line 462 of file application.cpp.

void Application::loadingFinished ( bool  success)
privateslot

Private slot: Loading finished.

Definition at line 712 of file application.cpp.

Here is the call graph for this function:

void Application::loadInstrument ( int  selectedindex)
privateslot

Private slot: Load an instrument.

Definition at line 642 of file application.cpp.

Here is the call graph for this function:

bool Application::loadMidiFile ( QString  filename)

Load a Midi file.

Parameters
filename: Name of the Midi file

Definition at line 923 of file application.cpp.

Here is the call graph for this function:

void Application::mobileMessage ( QString  msg)

Show error message on mobile phone while it is connected to a keyboard.

Parameters
msg: Message

Definition at line 949 of file application.cpp.

void Application::newInstrumentDownloaded ( QString  localpath)
privateslot

Private slot: New instrument downloaded.

Definition at line 728 of file application.cpp.

Here is the call graph for this function:

void Application::onAudioDevicesAdded ( QStringList  list)
privateslot

Private slot: New audio device added (test)

Parameters
list: List of strings of the newly connected audio devices

Definition at line 831 of file application.cpp.

void Application::onAudioDevicesRemoved ( QStringList  list)
privateslot

Private slot: An audio device has been removed (test)

Parameters
list: List of strings of the removed audio devices

Definition at line 845 of file application.cpp.

void Application::onChangeOfAvailableAudioDevices ( QStringList  list)
privateslot

Private slot: The list of availabel devices has changed (test)

Parameters
list: List of strings of the available audio devices

Definition at line 860 of file application.cpp.

Here is the call graph for this function:

void Application::onClosedMidiLoopDetected ( )
slot

Slot: Closed Midi feedback loop discovered, inhibit converter.

Definition at line 963 of file application.cpp.

Here is the call graph for this function:

void Application::onConnectionSuccessfullyEstablished ( bool  success)
privateslot

Private slot: on audio connection established.

Parameters
success: True if connection was established successfully

Definition at line 904 of file application.cpp.

Here is the call graph for this function:

void Application::onCurrentDeviceParametersChanged ( )
privateslot

Private slot: on current audio device parameters changed.

Definition at line 884 of file application.cpp.

Here is the call graph for this function:

void Application::onInputOutputStatusChanged ( )
slot

I/O configuration changed, cancel converter inhibition.

Definition at line 978 of file application.cpp.

Here is the call graph for this function:

void Application::resetAudioParameters ( )
privateslot

Reset audio parameters.

Definition at line 991 of file application.cpp.

Here is the call graph for this function:

void Application::restartApplication ( )
privateslot

Restart the application by force.

Definition at line 487 of file application.cpp.

bool Application::restartRequested ( )
inline

Definition at line 74 of file application.h.

void Application::resume ( )

resume

Definition at line 411 of file application.cpp.

Here is the call graph for this function:

void Application::selectAudioParameters ( int  devIndex,
int  srIndex,
int  buffersize,
int  packetsize 
)
privateslot

Private slot: Select audio parameters.

Parameters
devIndex
srIndex
buffersize
packetsize

Definition at line 788 of file application.cpp.

Here is the call graph for this function:

void Application::sendMobileMessage ( QVariant  string)
signal
void Application::setAudioBufferSizes ( QVariant  buffer,
QVariant  packet 
)
signal
void Application::setAudioDeviceList ( QVariant  list,
QVariant  index 
)
signal
void Application::setAudioDeviceName ( QVariant  name)
signal
void Application::setAudioSampleRates ( QVariant  list,
QVariant  index 
)
signal
void Application::setInstrumentSelector ( int  index = 0)
private

Set the content of the instrument selector.

Definition at line 625 of file application.cpp.

Here is the call graph for this function:

void Application::setQmlInstrumentNames ( QVariant  stringlist)
signal
void Application::setQmlLocale ( QVariant  string)
signal
void Application::setQmlSelectedInstrument ( QVariant  index)
signal
void Application::setSelectedExample ( QVariant  number)
signal
void Log::setVerbosity ( int  verbosity)
inherited

Set the verbosity level of the class-specific messages.

Parameters
verbosity: Verbosity level (1...4)

Definition at line 107 of file log.cpp.

QString Application::shorten ( const QString &  device,
int  truncation = 30 
) const
private

Shorten very long device names.

Parameters
device: String of the device name
truncation: Maximal number of characters
Returns
Shortened device name

Definition at line 753 of file application.cpp.

void Application::showDownloadDialog ( )
signal
void Application::signalCircularGauge ( QVariant  progression)
signal
void Application::start ( )

Start the application and its components.

Definition at line 303 of file application.cpp.

Here is the call graph for this function:

void Application::startDownload ( bool  forced = false)
privateslot

Private slot: Start download.

Definition at line 522 of file application.cpp.

Here is the call graph for this function:

void Application::startLoadingInstrument ( QString  name)
signal
void Application::stop ( )

Stop the application and its components.

Definition at line 337 of file application.cpp.

Here is the call graph for this function:

void Application::suspend ( )

Suspend the application This function suspends the application and all modules. This is essential e.g. on mobile devices, when the application is sent to the background.

Definition at line 387 of file application.cpp.

Here is the call graph for this function:

QStringList Application::updateShownInstrumentNames ( )
private

Update the list of instruments in the Qml Combo box.

Returns
Number of instruments

Definition at line 594 of file application.cpp.

Here is the call graph for this function:

Member Data Documentation

QTranslator Application::mAppTranslator
private

Definition at line 155 of file application.h.

AudioOutput Application::mAudioOutput
private

Definition at line 162 of file application.h.

QStringList Application::mAvailableMidiDevices
private

Definition at line 170 of file application.h.

QStringList Application::mAvailableMidiOutputDevices
private

Definition at line 171 of file application.h.

QString Application::mCurrentMidiDevice
private

Definition at line 172 of file application.h.

Downloader Application::mDownloader
private

Definition at line 156 of file application.h.

FileOpenDialog Application::mFileOpenDialog
private

Definition at line 157 of file application.h.

Instrument Application::mInstrument
private

Definition at line 164 of file application.h.

TouchscreenKeyboard Application::mKeyboard
private

Definition at line 169 of file application.h.

double Application::mLastEmittedPitchProgression
private

Definition at line 176 of file application.h.

QString Application::mLocale
private

Definition at line 152 of file application.h.

Midi Application::mMidi
private

Definition at line 160 of file application.h.

bool Application::mMidiAutomaticRecognition
private

Definition at line 173 of file application.h.

MidiHandler Application::mMidiHandler
private

Definition at line 166 of file application.h.

MidiMicrotonal Application::mMidiMicrotonalConverter
private

Definition at line 161 of file application.h.

MidiPlayer Application::mMidiPlayer
private

Definition at line 159 of file application.h.

bool Application::mMidiPlayerWasPlaying
private

Definition at line 174 of file application.h.

int Application::mNumberOfExample
private

Definition at line 163 of file application.h.

QTranslator Application::mQtTranslator
private

Definition at line 154 of file application.h.

bool Application::mRestartRequest
private

Definition at line 153 of file application.h.

QSettings Application::mSettings
private

Definition at line 151 of file application.h.

SoundGenerator Application::mSoundGenerator
private

Definition at line 165 of file application.h.

bool Application::mStarted
private

Definition at line 150 of file application.h.

StartupSound Application::mStartupSound
private

Definition at line 149 of file application.h.

bool Application::mSuspended
private

Definition at line 175 of file application.h.

Tuner Application::mTuner
private

Definition at line 167 of file application.h.

LogFile Application::mTuningLog
private

Definition at line 168 of file application.h.

QApplication* Application::pApplication
private

Definition at line 148 of file application.h.


The documentation for this class was generated from the following files: