summaryrefslogtreecommitdiff
path: root/map65/soundout.h
blob: 294c6fa5f31d3ab8383f59a1f915c3dc25f4b3a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SOUNDOUT_H
#define SOUNDOUT_H
#include <QtCore>
#include <QDebug>

// An instance of this thread sends audio data to a specified soundcard.
// Output can be muted while underway, preserving waveform timing when
// transmission is resumed.

class SoundOutThread : public QThread
{
  Q_OBJECT

protected:
  virtual void run();

public:
// Constructs (but does not start) a SoundOutThread
  SoundOutThread()
    :   quitExecution(false)           // Initialize some private members
    ,   m_rate(0)
    ,   m_nwave(48*11025)
    ,   m_txOK(false)
    ,   m_txMute(false)
  {
  }

public:
  void setOutputDevice(qint32 n);
  void setPeriod(int n);
  bool quitExecution;           //If true, thread exits gracefully


// Private members
private:
  double  m_rate;               //Sample rate
  qint32  m_nDevOut;            //Output device number
  qint32  m_nwave;              //Length of wave file
  qint32  m_TRperiod;           //T/R period (30 or 60 s)
  bool    m_txOK;               //Enable Tx audio
  bool    m_txMute;             //Mute temporarily
};

#endif