mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Simplify MainWindows to Modulator communications.
No longer any need to have a mute mechanism since the TX shutdown mechanism is sufficient. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4012 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									1e107e7e1e
								
							
						
					
					
						commit
						4c687cd8a6
					
				@ -35,7 +35,6 @@ Modulator::Modulator (unsigned frameRate, unsigned periodLengthInSeconds, QObjec
 | 
			
		||||
  , m_period {periodLengthInSeconds}
 | 
			
		||||
  , m_state {Idle}
 | 
			
		||||
  , m_tuning {false}
 | 
			
		||||
  , m_muted {false}
 | 
			
		||||
  , m_cwLevel {false}
 | 
			
		||||
{
 | 
			
		||||
  qsrand (QDateTime::currentMSecsSinceEpoch()); // Initialize random
 | 
			
		||||
@ -280,9 +279,7 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
 | 
			
		||||
 | 
			
		||||
qint16 Modulator::postProcessSample (qint16 sample) const
 | 
			
		||||
{
 | 
			
		||||
  if (m_muted) {  // silent frame
 | 
			
		||||
    sample = 0;
 | 
			
		||||
  } else if (m_addNoise) {  // Test frame, we'll add noise
 | 
			
		||||
  if (m_addNoise) {  // Test frame, we'll add noise
 | 
			
		||||
    qint32 s = m_fac * (gran () + sample * m_snr / 32768.0);
 | 
			
		||||
    if (s > std::numeric_limits<qint16>::max ()) {
 | 
			
		||||
      s = std::numeric_limits<qint16>::max ();
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,6 @@ public:
 | 
			
		||||
  void close () override;
 | 
			
		||||
 | 
			
		||||
  bool isTuning () const {return m_tuning;}
 | 
			
		||||
  bool isMuted () const {return m_muted;}
 | 
			
		||||
  unsigned frequency () const {return m_frequency;}
 | 
			
		||||
  bool isActive () const {return m_state != Idle;}
 | 
			
		||||
  void setSpread(double s) {m_fSpread=s;}
 | 
			
		||||
@ -35,7 +34,6 @@ public:
 | 
			
		||||
  Q_SLOT void start (unsigned symbolsLength, double framesPerSymbol, unsigned frequency, double toneSpacing, SoundOutput *, Channel = Mono, bool synchronize = true, double dBSNR = 99.);
 | 
			
		||||
  Q_SLOT void stop (bool quick = false);
 | 
			
		||||
  Q_SLOT void tune (bool newState = true);
 | 
			
		||||
  Q_SLOT void mute (bool newState = true) {m_muted = newState;}
 | 
			
		||||
  Q_SLOT void setFrequency (unsigned newFrequency) {m_frequency = newFrequency;}
 | 
			
		||||
  Q_SIGNAL void stateChanged (ModulatorState) const;
 | 
			
		||||
 | 
			
		||||
@ -74,7 +72,6 @@ private:
 | 
			
		||||
  ModulatorState volatile m_state;
 | 
			
		||||
 | 
			
		||||
  bool volatile m_tuning;
 | 
			
		||||
  bool volatile m_muted;
 | 
			
		||||
  bool m_addNoise;
 | 
			
		||||
 | 
			
		||||
  bool m_cwLevel;
 | 
			
		||||
 | 
			
		||||
@ -138,7 +138,6 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
 | 
			
		||||
  connect (this, &MainWindow::outAttenuationChanged, &m_soundOutput, &SoundOutput::setAttenuation);
 | 
			
		||||
 | 
			
		||||
  // hook up Modulator slots
 | 
			
		||||
  connect (this, &MainWindow::muteAudioOutput, &m_modulator, &Modulator::mute);
 | 
			
		||||
  connect (this, &MainWindow::transmitFrequency, &m_modulator, &Modulator::setFrequency);
 | 
			
		||||
  connect (this, &MainWindow::endTransmitMessage, &m_modulator, &Modulator::stop);
 | 
			
		||||
  connect (this, &MainWindow::tune, &m_modulator, &Modulator::tune);
 | 
			
		||||
@ -293,7 +292,6 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
 | 
			
		||||
  m_auto=false;
 | 
			
		||||
  m_waterfallAvg = 1;
 | 
			
		||||
  m_txFirst=false;
 | 
			
		||||
  Q_EMIT muteAudioOutput (false);
 | 
			
		||||
  m_btxMute=false;
 | 
			
		||||
  m_btxok=false;
 | 
			
		||||
  m_restart=false;
 | 
			
		||||
@ -414,7 +412,6 @@ MainWindow::MainWindow(bool multiple, QSettings * settings, QSharedMemory *shdme
 | 
			
		||||
  Q_EMIT initializeAudioOutputStream (m_config.audio_output_device (), AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2, m_msAudioOutputBuffered);
 | 
			
		||||
 | 
			
		||||
  Q_EMIT transmitFrequency (m_txFreq - m_XIT);
 | 
			
		||||
  Q_EMIT muteAudioOutput (false);
 | 
			
		||||
 | 
			
		||||
  auto t = "UTC   dB   DT Freq   Message";
 | 
			
		||||
  ui->decodedTextLabel->setText(t);
 | 
			
		||||
@ -670,6 +667,9 @@ void MainWindow::on_monitorButton_clicked (bool checked)
 | 
			
		||||
  // make sure we have the current rig state
 | 
			
		||||
  //  Q_EMIT m_config.sync_transceiver (true);
 | 
			
		||||
 | 
			
		||||
  qDebug () <<  "MainWindow::on_monitorButton_clicked: checked:" << checked;
 | 
			
		||||
  qDebug () <<  "MainWindow::on_monitorButton_clicked: m_monitoring:" << m_monitoring << "m_transmitting:" << m_transmitting;
 | 
			
		||||
 | 
			
		||||
  if (!m_transmitting)
 | 
			
		||||
    {
 | 
			
		||||
      m_monitoring = checked;
 | 
			
		||||
@ -713,7 +713,6 @@ void MainWindow::on_autoButton_clicked (bool checked)
 | 
			
		||||
  if (!m_auto)
 | 
			
		||||
    {
 | 
			
		||||
      m_btxok = false;
 | 
			
		||||
      Q_EMIT muteAudioOutput ();
 | 
			
		||||
      monitor (true);
 | 
			
		||||
      m_repeatMsg = 0;
 | 
			
		||||
    }
 | 
			
		||||
@ -1460,7 +1459,6 @@ void MainWindow::guiUpdate()
 | 
			
		||||
    }
 | 
			
		||||
    if(!bTxTime || m_btxMute) {
 | 
			
		||||
      m_btxok=false;
 | 
			
		||||
      Q_EMIT muteAudioOutput ();
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -1578,7 +1576,6 @@ void MainWindow::guiUpdate()
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    m_btxok=true;
 | 
			
		||||
    Q_EMIT muteAudioOutput (false);
 | 
			
		||||
    m_transmitting=true;
 | 
			
		||||
    ui->pbTxMode->setEnabled(false);
 | 
			
		||||
    if(!m_tune) {
 | 
			
		||||
@ -1677,7 +1674,6 @@ void MainWindow::startTx2()
 | 
			
		||||
    monitor (false);
 | 
			
		||||
 | 
			
		||||
    m_btxok=true;
 | 
			
		||||
    Q_EMIT muteAudioOutput (false);
 | 
			
		||||
    m_transmitting=true;
 | 
			
		||||
    ui->pbTxMode->setEnabled(false);
 | 
			
		||||
  }
 | 
			
		||||
@ -2682,7 +2678,6 @@ void MainWindow::on_stopTxButton_clicked()                    //Stop Tx
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  m_btxok=false;
 | 
			
		||||
  Q_EMIT muteAudioOutput ();
 | 
			
		||||
  m_repeatMsg=0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -2809,7 +2804,6 @@ void MainWindow::handle_transceiver_failure (QString reason)
 | 
			
		||||
                              "border-width: 0px; border-radius: 5px;}");
 | 
			
		||||
 | 
			
		||||
  m_btxok=false;
 | 
			
		||||
  Q_EMIT muteAudioOutput ();
 | 
			
		||||
  m_repeatMsg=0;
 | 
			
		||||
 | 
			
		||||
  rigFailure ("Rig Control Error", reason);
 | 
			
		||||
 | 
			
		||||
@ -188,7 +188,6 @@ private:
 | 
			
		||||
  Q_SIGNAL void detectorClose () const;
 | 
			
		||||
 | 
			
		||||
  Q_SIGNAL void finished () const;
 | 
			
		||||
  Q_SIGNAL void muteAudioOutput (bool = true) const;
 | 
			
		||||
  Q_SIGNAL void transmitFrequency (unsigned) const;
 | 
			
		||||
  Q_SIGNAL void endTransmitMessage (bool quick = false) const;
 | 
			
		||||
  Q_SIGNAL void tune (bool = true) const;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user