spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 08f651eadab1e74c11f87d51edf3d80699c32abb
parent f073eec154be239a7e279f0d9eb6859e29f3ca06
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Thu, 20 Sep 2012 10:16:51 -0700

Process all pending events before re-starting, fixes #31

Diffstat:
Msrc/spek-spectrogram.cc | 10+++-------
Msrc/spek-spectrogram.hh | 1-
Msrc/spek-window.cc | 2+-
3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -36,7 +36,6 @@ extern "C" { BEGIN_EVENT_TABLE(SpekSpectrogram, wxWindow) EVT_CHAR(SpekSpectrogram::on_char) - EVT_IDLE(SpekSpectrogram::on_idle) EVT_PAINT(SpekSpectrogram::on_paint) EVT_SIZE(SpekSpectrogram::on_size) SPEK_EVT_HAVE_SAMPLE(SpekSpectrogram::on_have_sample) @@ -136,12 +135,6 @@ void SpekSpectrogram::on_char(wxKeyEvent& evt) Refresh(); } -void SpekSpectrogram::on_idle(wxIdleEvent& evt) -{ - // TODO: remove? - Update(); -} - void SpekSpectrogram::on_paint(wxPaintEvent& evt) { wxAutoBufferedPaintDC dc(this); @@ -393,6 +386,9 @@ void SpekSpectrogram::stop() if (this->pipeline) { spek_pipeline_close(this->pipeline); this->pipeline = NULL; + + // Make sure all have_sample events are processed before returning. + wxApp::GetInstance()->ProcessPendingEvents(); } } diff --git a/src/spek-spectrogram.hh b/src/spek-spectrogram.hh @@ -35,7 +35,6 @@ public: private: void on_char(wxKeyEvent& evt); - void on_idle(wxIdleEvent& evt); void on_paint(wxPaintEvent& evt); void on_size(wxSizeEvent& evt); void on_have_sample(SpekHaveSampleEvent& evt); diff --git a/src/spek-window.cc b/src/spek-window.cc @@ -104,7 +104,7 @@ SpekWindow::SpekWindow(const wxString& path) : wxMenu *menu_help = new wxMenu(); wxMenuItem *menu_help_contents = new wxMenuItem( - menu_help, wxID_HELP, _("&Help") + wxT("\tF1")); + menu_help, wxID_HELP, wxString(_("&Help")) + wxT("\tF1")); menu_help->Append(menu_help_contents); wxMenuItem *menu_help_about = new wxMenuItem(menu_help, wxID_ABOUT); menu_help_about->SetItemLabel(menu_help_about->GetItemLabelText() + wxT("\tShift-F1"));