Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
sampler.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 // Sampler
22 //=============================================================================
23 
24 #ifndef SAMPLER_H
25 #define SAMPLER_H
26 
27 #include "audio/audiogenerator.h"
28 #include "instrument/wave.h"
29 #include "instrument/voice.h"
30 
31 class SoundGenerator;
32 class Tone;
33 class Tuner;
34 
56 
57 class Sampler : public AudioGenerator
58 {
59 public:
60  Sampler();
61  void init (SoundGenerator *soundgenerator);
62  void exit(){}
63 
64 private:
65  size_t generateSound (char* charbuffer, size_t maxSize) override final;
66 
68  QList<Tone> *pTones;
69 
70  QVector<qint32> mLeft,mRight;
71 };
72 
73 #endif // SAMPLER_H
Class managing the generation of sound.
SoundGenerator * pSoundGenerator
Pointer to the SoundGenerator.
Definition: sampler.h:67
QVector< qint32 > mRight
Audio signal to be constructed.
Definition: sampler.h:70
Virtual base class for audio-generating modules.
Class describing a tone that is currently being played.
Definition: tone.h:45
Sampler()
Constructor of the Sampler without functionality.
Definition: sampler.cpp:37
size_t generateSound(char *charbuffer, size_t maxSize) override final
Essential sound-generating function of the sampler.
Definition: sampler.cpp:81
void init(SoundGenerator *soundgenerator)
Initialization of the sampler.
Definition: sampler.cpp:56
This is the main class of the tuner module to be included by the user.
Definition: tuner.h:48
Sound-generating module which plays the tones held by the SoundGenerator.
Definition: sampler.h:57
void exit()
Definition: sampler.h:62
QList< Tone > * pTones
Pointer to the list of tones held by SoundGenerator.
Definition: sampler.h:68
QVector< qint32 > mLeft
Definition: sampler.h:70