Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
audiogenerator.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 #ifndef AUDIOGENERATOR_H
21 #define AUDIOGENERATOR_H
22 
23 #include "audiobase.h"
24 #include "audiodeviceguard.h"
25 
26 //=============================================================================
27 // Virtual base class for a sound-generating module
28 //=============================================================================
29 
41 
42 class AudioGenerator : public Log
43 {
44 public:
45  AudioGenerator();
47 
48  void setParameters (const AudioParameters &parameters);
49  void setMaxPacketSize (int n) { mMaxNumberOfFrames = n; }
50  size_t getMaxPacketSize() { return mMaxNumberOfFrames; }
51 
52  // -------- Reimplement this function in the derived class: ----------
53  virtual size_t generateSound (char* data, size_t maxSize);
54 
56 
57 protected:
60 };
61 
62 #endif // AUDIOGENERATOR_H
AudioGenerator()
Constructor.
void setMaxPacketSize(int n)
AudioParameters mParameters
Local copy of the audio parameters.
size_t getMaxPacketSize()
Virtual base class for audio-generating modules.
Structure holding the parameters and status of an audio device.
virtual size_t generateSound(char *data, size_t maxSize)
Virtual function for sound generation. This function generates an A440 on the right and an A220 on th...
~AudioGenerator()
Destructor without functionality.
int sampleRate
Actual sample rate.
void setParameters(const AudioParameters &parameters)
Set audio device parameters.
size_t mMaxNumberOfFrames
Maximal number of frames per buffer.
Base class for managing log messages.
Definition: log.h:83