kopia lustrzana https://github.com/f4exb/sdrangel
				
				
				
			AM Modulator: implemented channel mute
							rodzic
							
								
									f1bfe8962a
								
							
						
					
					
						commit
						77549e74ca
					
				|  | @ -93,6 +93,13 @@ void AMMod::configure(MessageQueue* messageQueue, | ||||||
| 
 | 
 | ||||||
| void AMMod::pull(Sample& sample) | void AMMod::pull(Sample& sample) | ||||||
| { | { | ||||||
|  | 	if (m_running.m_channelMute) | ||||||
|  | 	{ | ||||||
|  | 		sample.m_real = 0.0f; | ||||||
|  | 		sample.m_imag = 0.0f; | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	Complex ci; | 	Complex ci; | ||||||
| 
 | 
 | ||||||
| 	m_settingsMutex.lock(); | 	m_settingsMutex.lock(); | ||||||
|  | @ -266,7 +273,7 @@ bool AMMod::handleMessage(const Message& cmd) | ||||||
| 		m_config.m_modFactor = cfg.getModFactor(); | 		m_config.m_modFactor = cfg.getModFactor(); | ||||||
| 		m_config.m_toneFrequency = cfg.getToneFrequency(); | 		m_config.m_toneFrequency = cfg.getToneFrequency(); | ||||||
| 		m_config.m_volumeFactor = cfg.getVolumeFactor(); | 		m_config.m_volumeFactor = cfg.getVolumeFactor(); | ||||||
| 		m_config.m_audioMute = cfg.getAudioMute(); | 		m_config.m_channelMute = cfg.getChannelMute(); | ||||||
| 		m_config.m_playLoop = cfg.getPlayLoop(); | 		m_config.m_playLoop = cfg.getPlayLoop(); | ||||||
| 
 | 
 | ||||||
| 		apply(); | 		apply(); | ||||||
|  | @ -276,7 +283,7 @@ bool AMMod::handleMessage(const Message& cmd) | ||||||
| 				<< " m_modFactor: " << m_config.m_modFactor | 				<< " m_modFactor: " << m_config.m_modFactor | ||||||
|                 << " m_toneFrequency: " << m_config.m_toneFrequency |                 << " m_toneFrequency: " << m_config.m_toneFrequency | ||||||
|                 << " m_volumeFactor: " << m_config.m_volumeFactor |                 << " m_volumeFactor: " << m_config.m_volumeFactor | ||||||
| 				<< " m_audioMute: " << m_config.m_audioMute | 				<< " m_audioMute: " << m_config.m_channelMute | ||||||
| 				<< " m_playLoop: " << m_config.m_playLoop; | 				<< " m_playLoop: " << m_config.m_playLoop; | ||||||
| 
 | 
 | ||||||
| 		return true; | 		return true; | ||||||
|  | @ -369,7 +376,7 @@ void AMMod::apply() | ||||||
| 	m_running.m_toneFrequency = m_config.m_toneFrequency; | 	m_running.m_toneFrequency = m_config.m_toneFrequency; | ||||||
|     m_running.m_volumeFactor = m_config.m_volumeFactor; |     m_running.m_volumeFactor = m_config.m_volumeFactor; | ||||||
| 	m_running.m_audioSampleRate = m_config.m_audioSampleRate; | 	m_running.m_audioSampleRate = m_config.m_audioSampleRate; | ||||||
| 	m_running.m_audioMute = m_config.m_audioMute; | 	m_running.m_channelMute = m_config.m_channelMute; | ||||||
| 	m_running.m_playLoop = m_config.m_playLoop; | 	m_running.m_playLoop = m_config.m_playLoop; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -181,7 +181,7 @@ public: | ||||||
|             float modFactor, |             float modFactor, | ||||||
|             float toneFrequency, |             float toneFrequency, | ||||||
| 			float volumeFactor, | 			float volumeFactor, | ||||||
|             bool audioMute, |             bool channelMute, | ||||||
|             bool playLoop); |             bool playLoop); | ||||||
| 
 | 
 | ||||||
|     virtual void pull(Sample& sample); |     virtual void pull(Sample& sample); | ||||||
|  | @ -213,12 +213,12 @@ private: | ||||||
|         float getModFactor() const { return m_modFactor; } |         float getModFactor() const { return m_modFactor; } | ||||||
|         float getToneFrequency() const { return m_toneFrequency; } |         float getToneFrequency() const { return m_toneFrequency; } | ||||||
|         float getVolumeFactor() const { return m_volumeFactor; } |         float getVolumeFactor() const { return m_volumeFactor; } | ||||||
|         bool getAudioMute() const { return m_audioMute; } |         bool getChannelMute() const { return m_channelMute; } | ||||||
|         bool getPlayLoop() const { return m_playLoop; } |         bool getPlayLoop() const { return m_playLoop; } | ||||||
| 
 | 
 | ||||||
|         static MsgConfigureAMMod* create(Real rfBandwidth, float modFactor, float toneFreqeuncy, float volumeFactor, bool audioMute, bool playLoop) |         static MsgConfigureAMMod* create(Real rfBandwidth, float modFactor, float toneFreqeuncy, float volumeFactor, bool channelMute, bool playLoop) | ||||||
|         { |         { | ||||||
|             return new MsgConfigureAMMod(rfBandwidth, modFactor, toneFreqeuncy, volumeFactor, audioMute, playLoop); |             return new MsgConfigureAMMod(rfBandwidth, modFactor, toneFreqeuncy, volumeFactor, channelMute, playLoop); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|     private: |     private: | ||||||
|  | @ -226,16 +226,16 @@ private: | ||||||
|         float m_modFactor; |         float m_modFactor; | ||||||
|         float m_toneFrequency; |         float m_toneFrequency; | ||||||
|         float m_volumeFactor; |         float m_volumeFactor; | ||||||
|         bool m_audioMute; |         bool m_channelMute; | ||||||
|         bool m_playLoop; |         bool m_playLoop; | ||||||
| 
 | 
 | ||||||
|         MsgConfigureAMMod(Real rfBandwidth, float modFactor, float toneFrequency, float volumeFactor, bool audioMute, bool playLoop) : |         MsgConfigureAMMod(Real rfBandwidth, float modFactor, float toneFrequency, float volumeFactor, bool channelMute, bool playLoop) : | ||||||
|             Message(), |             Message(), | ||||||
|             m_rfBandwidth(rfBandwidth), |             m_rfBandwidth(rfBandwidth), | ||||||
|             m_modFactor(modFactor), |             m_modFactor(modFactor), | ||||||
|             m_toneFrequency(toneFrequency), |             m_toneFrequency(toneFrequency), | ||||||
|             m_volumeFactor(volumeFactor), |             m_volumeFactor(volumeFactor), | ||||||
|             m_audioMute(audioMute), |             m_channelMute(channelMute), | ||||||
| 			m_playLoop(playLoop) | 			m_playLoop(playLoop) | ||||||
|         { } |         { } | ||||||
|     }; |     }; | ||||||
|  | @ -261,7 +261,7 @@ private: | ||||||
|         float m_toneFrequency; |         float m_toneFrequency; | ||||||
|         float m_volumeFactor; |         float m_volumeFactor; | ||||||
|         quint32 m_audioSampleRate; |         quint32 m_audioSampleRate; | ||||||
|         bool m_audioMute; |         bool m_channelMute; | ||||||
|         bool m_playLoop; |         bool m_playLoop; | ||||||
| 
 | 
 | ||||||
|         Config() : |         Config() : | ||||||
|  | @ -272,7 +272,7 @@ private: | ||||||
|             m_toneFrequency(100), |             m_toneFrequency(100), | ||||||
|             m_volumeFactor(1.0f), |             m_volumeFactor(1.0f), | ||||||
|             m_audioSampleRate(0), |             m_audioSampleRate(0), | ||||||
|             m_audioMute(false), |             m_channelMute(false), | ||||||
| 			m_playLoop(false) | 			m_playLoop(false) | ||||||
|         { } |         { } | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|  | @ -233,7 +233,7 @@ void AMModGUI::on_toneFrequency_valueChanged(int value) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| void AMModGUI::on_audioMute_toggled(bool checked) | void AMModGUI::on_channelMute_toggled(bool checked) | ||||||
| { | { | ||||||
| 	applySettings(); | 	applySettings(); | ||||||
| } | } | ||||||
|  | @ -423,7 +423,7 @@ void AMModGUI::applySettings() | ||||||
| 			ui->modPercent->value() / 100.0f, | 			ui->modPercent->value() / 100.0f, | ||||||
| 			ui->toneFrequency->value() * 10.0f, | 			ui->toneFrequency->value() * 10.0f, | ||||||
| 			ui->volume->value() / 10.0f , | 			ui->volume->value() / 10.0f , | ||||||
| 			ui->audioMute->isChecked(), | 			ui->channelMute->isChecked(), | ||||||
| 			ui->playLoop->isChecked()); | 			ui->playLoop->isChecked()); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -63,7 +63,7 @@ private slots: | ||||||
|     void on_rfBW_valueChanged(int value); |     void on_rfBW_valueChanged(int value); | ||||||
|     void on_modPercent_valueChanged(int value); |     void on_modPercent_valueChanged(int value); | ||||||
|     void on_volume_valueChanged(int value); |     void on_volume_valueChanged(int value); | ||||||
|     void on_audioMute_toggled(bool checked); |     void on_channelMute_toggled(bool checked); | ||||||
|     void on_tone_toggled(bool checked); |     void on_tone_toggled(bool checked); | ||||||
|     void on_toneFrequency_valueChanged(int value); |     void on_toneFrequency_valueChanged(int value); | ||||||
|     void on_mic_toggled(bool checked); |     void on_mic_toggled(bool checked); | ||||||
|  |  | ||||||
|  | @ -56,7 +56,16 @@ | ||||||
|     <property name="spacing"> |     <property name="spacing"> | ||||||
|      <number>3</number> |      <number>3</number> | ||||||
|     </property> |     </property> | ||||||
|     <property name="margin"> |     <property name="leftMargin"> | ||||||
|  |      <number>2</number> | ||||||
|  |     </property> | ||||||
|  |     <property name="topMargin"> | ||||||
|  |      <number>2</number> | ||||||
|  |     </property> | ||||||
|  |     <property name="rightMargin"> | ||||||
|  |      <number>2</number> | ||||||
|  |     </property> | ||||||
|  |     <property name="bottomMargin"> | ||||||
|      <number>2</number> |      <number>2</number> | ||||||
|     </property> |     </property> | ||||||
|     <item> |     <item> | ||||||
|  | @ -158,7 +167,7 @@ | ||||||
|          </widget> |          </widget> | ||||||
|         </item> |         </item> | ||||||
|         <item> |         <item> | ||||||
|          <widget class="QToolButton" name="audioMute"> |          <widget class="QToolButton" name="channelMute"> | ||||||
|           <property name="toolTip"> |           <property name="toolTip"> | ||||||
|            <string>Mute/Unmute audio</string> |            <string>Mute/Unmute audio</string> | ||||||
|           </property> |           </property> | ||||||
|  | @ -655,11 +664,6 @@ | ||||||
|   </widget> |   </widget> | ||||||
|  </widget> |  </widget> | ||||||
|  <customwidgets> |  <customwidgets> | ||||||
|   <customwidget> |  | ||||||
|    <class>ButtonSwitch</class> |  | ||||||
|    <extends>QToolButton</extends> |  | ||||||
|    <header>gui/buttonswitch.h</header> |  | ||||||
|   </customwidget> |  | ||||||
|   <customwidget> |   <customwidget> | ||||||
|    <class>RollupWidget</class> |    <class>RollupWidget</class> | ||||||
|    <extends>QWidget</extends> |    <extends>QWidget</extends> | ||||||
|  | @ -678,6 +682,11 @@ | ||||||
|    <header>gui/levelmeter.h</header> |    <header>gui/levelmeter.h</header> | ||||||
|    <container>1</container> |    <container>1</container> | ||||||
|   </customwidget> |   </customwidget> | ||||||
|  |   <customwidget> | ||||||
|  |    <class>ButtonSwitch</class> | ||||||
|  |    <extends>QToolButton</extends> | ||||||
|  |    <header>gui/buttonswitch.h</header> | ||||||
|  |   </customwidget> | ||||||
|   <customwidget> |   <customwidget> | ||||||
|    <class>CWKeyerGUI</class> |    <class>CWKeyerGUI</class> | ||||||
|    <extends>QWidget</extends> |    <extends>QWidget</extends> | ||||||
|  | @ -687,6 +696,28 @@ | ||||||
|  </customwidgets> |  </customwidgets> | ||||||
|  <resources> |  <resources> | ||||||
|   <include location="../../../sdrbase/resources/res.qrc"/> |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  |   <include location="../../../sdrbase/resources/res.qrc"/> | ||||||
|  </resources> |  </resources> | ||||||
|  <connections/> |  <connections/> | ||||||
| </ui> | </ui> | ||||||
|  |  | ||||||
|  | @ -20,9 +20,9 @@ Use the wheels to adjust the frequency shift in Hz from the center frequency of | ||||||
| 
 | 
 | ||||||
| Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | ||||||
| 
 | 
 | ||||||
| <h3>4: Audio mute</h3> | <h3>4: Channel mute</h3> | ||||||
| 
 | 
 | ||||||
| Use this button to toggle audio mute for this channel. | Use this button to toggle mute for this channel. | ||||||
| 
 | 
 | ||||||
| <h3>5: RF bandwidth</h3> | <h3>5: RF bandwidth</h3> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -20,9 +20,9 @@ Use the wheels to adjust the frequency shift in Hz from the center frequency of | ||||||
| 
 | 
 | ||||||
| Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | ||||||
| 
 | 
 | ||||||
| <h3>4: Audio mute</h3> | <h3>4: Channel mute</h3> | ||||||
| 
 | 
 | ||||||
| Use this button to toggle audio mute for this channel. | Use this button to toggle mute for this channel. | ||||||
| 
 | 
 | ||||||
| <h3>5: RF bandwidth</h3> | <h3>5: RF bandwidth</h3> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -20,9 +20,9 @@ Use the wheels to adjust the frequency shift in Hz from the center frequency of | ||||||
| 
 | 
 | ||||||
| Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | Average total power in dB relative to a +/- 1.0 amplitude signal generated in the pass band. | ||||||
| 
 | 
 | ||||||
| <h3>4: Audio mute</h3> | <h3>4: Channel mute</h3> | ||||||
| 
 | 
 | ||||||
| Use this button to toggle audio mute for this channel. | Use this button to toggle mute for this channel. | ||||||
| 
 | 
 | ||||||
| <h3>5: RF bandwidth</h3> | <h3>5: RF bandwidth</h3> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 f4exb
						f4exb