Just Intonation  Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
Instrument Class Reference

Class describing an instrument. More...

#include <instrument.h>

Inheritance diagram for Instrument:
Inheritance graph
Collaboration diagram for Instrument:
Collaboration graph

Public Slots

void loadInstrument (QString path)
 Load or generate an instrument (voice) More...
 
void cancelLoading ()
 

Signals

void showProgressBar (QVariant)
 
void hideProgressBar ()
 
void signalLoadingFinished (bool)
 

Public Member Functions

 Instrument ()
 
bool stop () override final
 Stop the instrument thread. More...
 
bool isLoading ()
 
bool hasLoaded ()
 
VoicegetVoice ()
 
virtual bool init ()
 Virtual initialization function (no functionality here) More...
 
virtual bool exit ()
 Virtual exit function (no functionality here) More...
 
virtual bool start ()
 Start the thread. More...
 
virtual void suspend ()
 Mark the thread as suspended. More...
 
virtual void resume ()
 Resume from the suspend mode. More...
 
bool isActive () const
 Return true if thread is running and not suspended. More...
 
void setVerbosity (int verbosity)
 Set verbosity level of messages. More...
 
int getVerbosity ()
 Get verbosity level. More...
 
QString getThreadName () const
 Get thread name. More...
 

Protected Member Functions

virtual void initiallyCalledWorker ()
 Virtual worker function called when the thread is starting. More...
 
virtual void finallyCalledWorker ()
 Virtual worker function called when the thread stops. More...
 
virtual void periodicallyCalledWorker ()
 Virtual worker function called periodically from the timer. More...
 
void setPriority (const QThread::Priority p)
 Set thread priority. More...
 
void setTimerInterval (const int msec, const int firstMsec=0)
 Set timer interval for the periodically called worker. More...
 
void setThreadName (const QString name)
 Set thread name (Linux only) More...
 
bool isInterruptionRequested () const
 Return true if the thread was requested to interrupt or terminate. More...
 

Protected Attributes

Voice mVoice
 The set of all samples. More...
 
QString mFileName
 The file name from where the file is loaded. More...
 
bool mLoading
 Flag indicating that an instrument is being loaded. More...
 
bool mLoaded
 Flag indicating that an instrument has been loaded. More...
 

Detailed Description

Class describing an instrument.

Definition at line 36 of file instrument.h.

Constructor & Destructor Documentation

Instrument::Instrument ( )

Definition at line 35 of file instrument.cpp.

Here is the call graph for this function:

Member Function Documentation

void Instrument::cancelLoading ( )
inlineslot

Definition at line 50 of file instrument.h.

Here is the call graph for this function:

virtual bool ThreadBase::exit ( )
inlinevirtualinherited

Virtual exit function (no functionality here)

Reimplemented in AudioOutput.

Definition at line 71 of file threadbase.h.

Here is the call graph for this function:

virtual void ThreadBase::finallyCalledWorker ( )
inlineprotectedvirtualinherited

Virtual worker function called when the thread stops.

Reimplemented in Tuner, and AudioOutput.

Definition at line 87 of file threadbase.h.

QString ThreadBase::getThreadName ( ) const
inherited

Get thread name.

Definition at line 132 of file threadbase.cpp.

Here is the call graph for this function:

int ThreadBase::getVerbosity ( )
inlineinherited

Get verbosity level.

Definition at line 80 of file threadbase.h.

Here is the call graph for this function:

Voice* Instrument::getVoice ( )
inline

Definition at line 46 of file instrument.h.

Here is the call graph for this function:

bool Instrument::hasLoaded ( )
inline

Definition at line 44 of file instrument.h.

void Instrument::hideProgressBar ( )
signal
virtual bool ThreadBase::init ( )
inlinevirtualinherited

Virtual initialization function (no functionality here)

Reimplemented in Tuner, AudioOutput, and SoundGenerator.

Definition at line 70 of file threadbase.h.

virtual void ThreadBase::initiallyCalledWorker ( )
inlineprotectedvirtualinherited

Virtual worker function called when the thread is starting.

Reimplemented in Tuner, and AudioOutput.

Definition at line 85 of file threadbase.h.

bool ThreadBase::isActive ( ) const
inherited

Return true if thread is running and not suspended.

Definition at line 136 of file threadbase.cpp.

bool ThreadBase::isInterruptionRequested ( ) const
protectedinherited

Return true if the thread was requested to interrupt or terminate.

Definition at line 128 of file threadbase.cpp.

bool Instrument::isLoading ( )
inline

Definition at line 43 of file instrument.h.

void Instrument::loadInstrument ( QString  path)
slot

Load or generate an instrument (voice)

This function loads an instrument file by starting the corresponding thread. If the path is empty an artificial sound is generated instead.

Parameters
path: Path to the instrument file, empty for artificial sound

Definition at line 72 of file instrument.cpp.

Here is the call graph for this function:

virtual void ThreadBase::periodicallyCalledWorker ( )
inlineprotectedvirtualinherited

Virtual worker function called periodically from the timer.

Reimplemented in Tuner, and AudioDeviceGuard.

Definition at line 89 of file threadbase.h.

Here is the call graph for this function:

void ThreadBase::resume ( )
virtualinherited

Resume from the suspend mode.

Restart the timer and clear the mSuspended flag

Reimplemented in MidiPlayer.

Definition at line 99 of file threadbase.cpp.

void ThreadBase::setPriority ( const QThread::Priority  p)
protectedinherited

Set thread priority.

Definition at line 109 of file threadbase.cpp.

Here is the call graph for this function:

void ThreadBase::setThreadName ( const QString  name)
protectedinherited

Set thread name (Linux only)

Definition at line 121 of file threadbase.cpp.

Here is the call graph for this function:

void ThreadBase::setTimerInterval ( const int  msec,
const int  firstMsec = 0 
)
protectedinherited

Set timer interval for the periodically called worker.

Definition at line 117 of file threadbase.cpp.

Here is the call graph for this function:

void ThreadBase::setVerbosity ( int  verbosity)
inherited

Set verbosity level of messages.

Definition at line 113 of file threadbase.cpp.

Here is the call graph for this function:

void Instrument::showProgressBar ( QVariant  )
signal
void Instrument::signalLoadingFinished ( bool  )
signal
bool ThreadBase::start ( )
virtualinherited

Start the thread.

Starts the thread. If the thread is suspended it will resume. If the thread is already started the function does nothing.

Returns
True on succes

Reimplemented in Tuner, and AudioOutput.

Definition at line 64 of file threadbase.cpp.

Here is the call graph for this function:

bool Instrument::stop ( )
finaloverridevirtual

Stop the instrument thread.

Returns
true if thread exited normally

Reimplemented from ThreadBase.

Definition at line 54 of file instrument.cpp.

Here is the call graph for this function:

void ThreadBase::suspend ( )
virtualinherited

Mark the thread as suspended.

Calling this function tells the thread that it has to wait in some sort of standby. Note that the thread itself is not terminated and that the event loop is still active. Calling this function stops the timer so that the periodicallyCalledWorker() is not active any more. In addition the mSuspended flag is set.

Reimplemented in MidiPlayer, and SoundGenerator.

Definition at line 84 of file threadbase.cpp.

Member Data Documentation

QString Instrument::mFileName
protected

The file name from where the file is loaded.

Definition at line 59 of file instrument.h.

bool Instrument::mLoaded
protected

Flag indicating that an instrument has been loaded.

Definition at line 61 of file instrument.h.

bool Instrument::mLoading
protected

Flag indicating that an instrument is being loaded.

Definition at line 60 of file instrument.h.

Voice Instrument::mVoice
protected

The set of all samples.

Definition at line 58 of file instrument.h.


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