| 
									
										
										
										
											2012-05-22 17:09:48 +00:00
										 |  |  | #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_txOK(false) | 
					
						
							|  |  |  |     ,   m_txMute(false) | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |   void setOutputDevice(qint32 n); | 
					
						
							| 
									
										
										
										
											2012-09-26 00:48:49 +00:00
										 |  |  |   void setPeriod(int ntrperiod, int nsps); | 
					
						
							| 
									
										
										
										
											2012-05-22 17:09:48 +00:00
										 |  |  |   bool quitExecution;           //If true, thread exits gracefully
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Private members
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |   qint32  m_nDevOut;            //Output device number
 | 
					
						
							|  |  |  |   bool    m_txOK;               //Enable Tx audio
 | 
					
						
							|  |  |  |   bool    m_txMute;             //Mute temporarily
 | 
					
						
							| 
									
										
										
										
											2012-09-24 19:11:31 +00:00
										 |  |  |   qint32  m_TRperiod;           //T/R period (30 or 60 s)
 | 
					
						
							| 
									
										
										
										
											2012-09-26 00:48:49 +00:00
										 |  |  |   qint32  m_nsps;               //Samples per symbol (at 12000 Hz)
 | 
					
						
							| 
									
										
										
										
											2012-05-22 17:09:48 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |