Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
audiooutputdevice.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 // Audio output device
22 //=============================================================================
23 
24 #ifndef AUDIOOUPUTDEVICE_H
25 #define AUDIOOUPUTDEVICE_H
26 
27 #include <QtMultimedia/QAudioOutput>
28 
29 #include "audiobase.h"
30 
31 class AudioOutput;
32 
39 
40 class AudioOutputDevice : public QIODevice, public Log
41 {
42 public:
43  AudioOutputDevice (AudioOutput* audiooutput);
44 
45  bool connect (const AudioParameters &parameters);
46  void disconnect();
47 
48  void setVolume(double volume);
49 
50 private:
51  qint64 readData (char * data, qint64 maxSize) override final;
52  qint64 writeData (const char * data, qint64 maxSize) override final;
53 
54  int mSampleSize;
56  QAudioOutput* pQtAudioOutputStream;
57 };
58 
59 #endif // AUDIOOUPUTDEVICE_H
void disconnect()
Stop the audio output device.
AudioOutputDevice(AudioOutput *audioplayerthread)
Constructor, resetting the member variables.
qint64 writeData(const char *data, qint64 maxSize) override final
Empty implementation for writing without functionality.
QAudioOutput * pQtAudioOutputStream
Pointer to System-Qt audio driver.
bool connect(const AudioDeviceParameters &parameters)
Structure holding the parameters and status of an audio device.
qint64 readData(char *data, qint64 maxSize) override final
Read PCM data.
Audio Output Device, supporting 16 and 24 bit signed integer PCM.
int mSampleSize
Sample size in bits (16/24)
Class for audio output.
Definition: audiooutput.h:45
void setVolume(double volume)
Set the global volume.
Base class for managing log messages.
Definition: log.h:83
AudioOutput * pAudioOutput
Pointer back to AudioOutputThread.