Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
instrument.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2016-2017 Karolin Stange, Christoph Wick, and Haye Hinrichsen
3  *
4  * This file is part of JustIntonation.
5  *
6  * JustIntonation is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * JustIntonation is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with JustIntonation. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 //=============================================================================
21 // Class describing an instrument
22 //=============================================================================
23 
24 #ifndef INSTRUMENT_H
25 #define INSTRUMENT_H
26 
27 #include <QVariant>
28 
29 #include "voice.h"
31 
35 
36 class Instrument : public ThreadBase
37 {
38  Q_OBJECT
39 public:
40  Instrument();
41  bool stop() override final;
42 
43  bool isLoading() { return mLoading; }
44  bool hasLoaded() { return mLoaded; }
45 
46  Voice* getVoice() { return &mVoice; }
47 
48 public slots:
49  void loadInstrument (QString path);
50  void cancelLoading() { mVoice.cancel(); }
51 
52 signals:
53  void showProgressBar (QVariant);
54  void hideProgressBar ();
55  void signalLoadingFinished (bool);
56 
57 protected:
59  QString mFileName;
60  bool mLoading;
61  bool mLoaded;
62 };
63 
64 #endif // INSTRUMENT_H
void cancel()
Definition: voice.cpp:172
Universal base class for threaded modules.
Definition: threadbase.h:60
Voice - a set of scales, keeping the acoustic data of an instrument.
Definition: voice.h:39
bool mLoaded
Flag indicating that an instrument has been loaded.
Definition: instrument.h:61
Voice * getVoice()
Definition: instrument.h:46
Class describing an instrument.
Definition: instrument.h:36
void hideProgressBar()
void cancelLoading()
Definition: instrument.h:50
bool stop() override final
Stop the instrument thread.
Definition: instrument.cpp:54
void loadInstrument(QString path)
Load or generate an instrument (voice)
Definition: instrument.cpp:72
bool isLoading()
Definition: instrument.h:43
bool mLoading
Flag indicating that an instrument is being loaded.
Definition: instrument.h:60
void showProgressBar(QVariant)
QString mFileName
The file name from where the file is loaded.
Definition: instrument.h:59
void signalLoadingFinished(bool)
bool hasLoaded()
Definition: instrument.h:44
Voice mVoice
The set of all samples.
Definition: instrument.h:58