aboutsummaryrefslogtreecommitdiffstats
path: root/gui/wxmain_mrun.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2021-05-23 13:19:09 -0400
committerClyne Sullivan <clyne@bitgloo.com>2021-05-23 13:19:09 -0400
commitf1773b634eb6cf4e1312379dcc7bcbab7291c60b (patch)
tree2fe10536100230e7e6a3b597147f51ba4ddc32d8 /gui/wxmain_mrun.cpp
parentd2f50fb9259a3142fa6b319a7a735a0e19355d01 (diff)
2nd pot; some doc; smooth WAV playback
Diffstat (limited to 'gui/wxmain_mrun.cpp')
-rw-r--r--gui/wxmain_mrun.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/gui/wxmain_mrun.cpp b/gui/wxmain_mrun.cpp
index 58b1873..e12d068 100644
--- a/gui/wxmain_mrun.cpp
+++ b/gui/wxmain_mrun.cpp
@@ -48,18 +48,16 @@ void MainFrame::onRunStart(wxCommandEvent& ce)
m_device->continuous_start_measure();
m_timer_performance->StartOnce(1000);
} else {
- if (m_device->is_siggening() && m_wav_clip) {
- // TODO Confirm need for factor of 500
- m_timer_wavclip->Start(m_device->get_buffer_size() * 500 /
- srateNums[m_rate_select->GetSelection()]);
- } else if (m_conv_result_log) {
- m_timer_record->Start(m_device->get_buffer_size() /
- srateNums[m_rate_select->GetSelection()] *
- 800 / 1000);
- } else if (m_run_draw_samples->IsChecked()) {
- m_timer_record->Start(m_device->get_buffer_size() /
- srateNums[m_rate_select->GetSelection()]);
- }
+ auto reqSpeedExact =
+ m_device->get_buffer_size()
+ / static_cast<float>(srateNums[m_rate_select->GetSelection()])
+ * 1000.f * 0.5f;
+ int reqSpeed = reqSpeedExact;
+
+ if (m_device->is_siggening() && m_wav_clip)
+ m_timer_wavclip->Start(reqSpeed);
+ if (m_conv_result_log || m_run_draw_samples->IsChecked())
+ m_timer_record->Start(reqSpeed);
m_device->continuous_start();
}