mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05:00 
			
		
		
		
	Merge branch 'release-2.3.0' into develop
This commit is contained in:
		
						commit
						b8f9708eac
					
				@ -88,17 +88,16 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi
 | 
			
		||||
  //qDebug () << "SoundIn default buffer size (bytes):" << m_stream->bufferSize () << "period size:" << m_stream->periodSize ();
 | 
			
		||||
  // the Windows MME version of QAudioInput uses 1/5 of the buffer
 | 
			
		||||
  // size for period size other platforms seem to optimize themselves
 | 
			
		||||
#if defined (Q_OS_WIN)
 | 
			
		||||
  m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer * 5));
 | 
			
		||||
#else
 | 
			
		||||
  Q_UNUSED (framesPerBuffer);
 | 
			
		||||
#endif
 | 
			
		||||
  if (framesPerBuffer > 0)
 | 
			
		||||
    {
 | 
			
		||||
      m_stream->setBufferSize (m_stream->format ().bytesForFrames (framesPerBuffer));
 | 
			
		||||
    }
 | 
			
		||||
  if (m_sink->initialize (QIODevice::WriteOnly, channel))
 | 
			
		||||
    {
 | 
			
		||||
      m_stream->start (sink);
 | 
			
		||||
      checkStream ();
 | 
			
		||||
      cummulative_lost_usec_ = -1;
 | 
			
		||||
      //qDebug () << "SoundIn selected buffer size (bytes):" << m_stream->bufferSize () << "peirod size:" << m_stream->periodSize ();
 | 
			
		||||
      LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,7 @@ void SoundOutput::restart (QIODevice * source)
 | 
			
		||||
    }
 | 
			
		||||
  m_stream->setCategory ("production");
 | 
			
		||||
  m_stream->start (source);
 | 
			
		||||
  LOG_INFO ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
 | 
			
		||||
  LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void SoundOutput::suspend ()
 | 
			
		||||
 | 
			
		||||
@ -211,7 +211,7 @@ namespace
 | 
			
		||||
  QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"};
 | 
			
		||||
  auto quint32_max = std::numeric_limits<quint32>::max ();
 | 
			
		||||
  constexpr int N_WIDGETS {36};
 | 
			
		||||
  constexpr int rx_chunk_size {3456}; // audio samples at 12000 Hz
 | 
			
		||||
  constexpr int default_rx_audio_buffer_frames {-1}; // lets Qt decide
 | 
			
		||||
  constexpr int default_tx_audio_buffer_frames {-1}; // lets Qt decide
 | 
			
		||||
 | 
			
		||||
  bool message_is_73 (int type, QStringList const& msg_parts)
 | 
			
		||||
@ -265,6 +265,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
 | 
			
		||||
  m_soundInput {new SoundInput},
 | 
			
		||||
  m_modulator {new Modulator {TX_SAMPLE_RATE, NTMAX}},
 | 
			
		||||
  m_soundOutput {new SoundOutput},
 | 
			
		||||
  m_rx_audio_buffer_frames {0},
 | 
			
		||||
  m_tx_audio_buffer_frames {0},
 | 
			
		||||
  m_msErase {0},
 | 
			
		||||
  m_secBandChanged {0},
 | 
			
		||||
@ -457,7 +458,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
 | 
			
		||||
  m_soundInput->moveToThread (&m_audioThread);
 | 
			
		||||
  m_detector->moveToThread (&m_audioThread);
 | 
			
		||||
  bool ok;
 | 
			
		||||
  auto buffer_size = env.value ("WSJT_TX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok);
 | 
			
		||||
  auto buffer_size = env.value ("WSJT_RX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok);
 | 
			
		||||
  m_rx_audio_buffer_frames = ok && buffer_size ? buffer_size : default_rx_audio_buffer_frames;
 | 
			
		||||
  buffer_size = env.value ("WSJT_TX_AUDIO_BUFFER_FRAMES", "0").toInt (&ok);
 | 
			
		||||
  m_tx_audio_buffer_frames = ok && buffer_size ? buffer_size : default_tx_audio_buffer_frames;
 | 
			
		||||
 | 
			
		||||
  // hook up sound output stream slots & signals and disposal
 | 
			
		||||
@ -939,7 +942,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
 | 
			
		||||
  if (!m_config.audio_input_device ().isNull ())
 | 
			
		||||
    {
 | 
			
		||||
      Q_EMIT startAudioInputStream (m_config.audio_input_device ()
 | 
			
		||||
                                    , rx_chunk_size * m_downSampleFactor
 | 
			
		||||
                                    , m_rx_audio_buffer_frames
 | 
			
		||||
                                    , m_detector, m_downSampleFactor, m_config.audio_input_channel ());
 | 
			
		||||
    }
 | 
			
		||||
  if (!m_config.audio_output_device ().isNull ())
 | 
			
		||||
@ -1851,7 +1854,7 @@ void MainWindow::on_actionSettings_triggered()               //Setup Dialog
 | 
			
		||||
 | 
			
		||||
    if(m_config.restart_audio_input () && !m_config.audio_input_device ().isNull ()) {
 | 
			
		||||
      Q_EMIT startAudioInputStream (m_config.audio_input_device ()
 | 
			
		||||
                                    , rx_chunk_size * m_downSampleFactor
 | 
			
		||||
                                    , m_rx_audio_buffer_frames
 | 
			
		||||
                                    , m_detector, m_downSampleFactor
 | 
			
		||||
                                    , m_config.audio_input_channel ());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -404,6 +404,7 @@ private:
 | 
			
		||||
  SoundInput * m_soundInput;
 | 
			
		||||
  Modulator * m_modulator;
 | 
			
		||||
  SoundOutput * m_soundOutput;
 | 
			
		||||
  int m_rx_audio_buffer_frames;
 | 
			
		||||
  int m_tx_audio_buffer_frames;
 | 
			
		||||
  QThread m_audioThread;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user