From b03cfa24207b8076f2ee9dbadb23df0d0326bf39 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 28 Dec 2020 13:49:12 -0700 Subject: [PATCH] rely on exceptions when parsing Beats from AudioClock, not strspn(3) --- gtk2_ardour/midi_list_editor.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/midi_list_editor.cc b/gtk2_ardour/midi_list_editor.cc index e2c0ccfa0e..b1d223ae09 100644 --- a/gtk2_ardour/midi_list_editor.cc +++ b/gtk2_ardour/midi_list_editor.cc @@ -633,14 +633,11 @@ MidiListEditor::edited (const std::string& path, const std::string& text) case 5: // length -#warning NUTEMPO should likely use just Beats::operator>> and exceptions here - - if (strspn (text.c_str(), "0123456789:") == text.length()) { - + try { stringstream ss (text); ss >> bval; - } else { + } catch (...) { /* assume its text from the combo. look for the map * entry for the actual note ticks