mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-13 00:09:43 -05:00
Create audio recording thread in the right place.
Was always creating, finding a timing issue when switching baseband modes, would freeze, probably due to a dangling pointer. TODO: Make stream recording setup synchronous.
This commit is contained in:
parent
56e448d355
commit
b3e2e89e51
@ -135,8 +135,6 @@ AnalogAudioView::AnalogAudioView(
|
|||||||
audio::output::start();
|
audio::output::start();
|
||||||
|
|
||||||
update_modulation(static_cast<ReceiverModel::Mode>(modulation));
|
update_modulation(static_cast<ReceiverModel::Mode>(modulation));
|
||||||
|
|
||||||
audio_thread = std::make_unique<AudioThread>("audio.s16");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalogAudioView::~AnalogAudioView() {
|
AnalogAudioView::~AnalogAudioView() {
|
||||||
@ -281,6 +279,7 @@ void AnalogAudioView::on_headphone_volume_changed(int32_t v) {
|
|||||||
|
|
||||||
void AnalogAudioView::update_modulation(const ReceiverModel::Mode modulation) {
|
void AnalogAudioView::update_modulation(const ReceiverModel::Mode modulation) {
|
||||||
audio::output::mute();
|
audio::output::mute();
|
||||||
|
audio_thread.reset();
|
||||||
|
|
||||||
const auto is_wideband_spectrum_mode = (modulation == ReceiverModel::Mode::SpectrumAnalysis);
|
const auto is_wideband_spectrum_mode = (modulation == ReceiverModel::Mode::SpectrumAnalysis);
|
||||||
receiver_model.set_baseband_configuration({
|
receiver_model.set_baseband_configuration({
|
||||||
@ -292,6 +291,7 @@ void AnalogAudioView::update_modulation(const ReceiverModel::Mode modulation) {
|
|||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
||||||
if( !is_wideband_spectrum_mode ) {
|
if( !is_wideband_spectrum_mode ) {
|
||||||
|
audio_thread = std::make_unique<AudioThread>("audio.s16");
|
||||||
audio::output::unmute();
|
audio::output::unmute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user