From 4400489f152083227a090de586ef914bd884ef3f Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 17 Sep 2010 20:43:38 +0000 Subject: [PATCH] patch from Johan Mattson to make -I/-O options in engine dialog actually work (fixes #2975 git-svn-id: svn://localhost/ardour2/branches/3.0@7795 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/engine_dialog.cc | 30 ++++++++++++++++++++++++++++++ gtk2_ardour/engine_dialog.h | 2 ++ 2 files changed, 32 insertions(+) diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index ef2fa67ce7..30940a1276 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -65,6 +65,10 @@ EngineControl::EngineControl () priority_spinner (priority_adjustment), ports_adjustment (128, 8, 1024, 1, 16), ports_spinner (ports_adjustment), + input_latency_adjustment (0, 0, 99999, 1), + input_latency (input_latency_adjustment), + output_latency_adjustment (0, 0, 99999, 1), + output_latency (output_latency_adjustment), realtime_button (_("Realtime")), no_memory_lock_button (_("Do not lock memory")), unlock_memory_button (_("Unlock memory")), @@ -584,6 +588,19 @@ EngineControl::build_command_line (vector& cmd) cmd.push_back ("-X raw"); } + double val = input_latency_adjustment.get_value(); + + if (val) { + cmd.push_back ("-I"); + cmd.push_back (to_string ((uint32_t) val, std::dec)); + } + + val = output_latency_adjustment.get_value(); + if (val) { + cmd.push_back ("-O"); + cmd.push_back (to_string ((uint32_t) val, std::dec)); + } + } else if (using_coreaudio) { #ifdef __APPLE__ @@ -597,6 +614,19 @@ EngineControl::build_command_line (vector& cmd) cmd.push_back ("-d"); cmd.push_back (device); + + double val = input_latency_adjustment.get_value(); + + if (val) { + cmd.push_back ("-I"); + cmd.push_back (to_string ((uint32_t) val, std::dec)); + } + + double val = output_latency_adjustment.get_value(); + if (val) { + cmd.push_back ("-O"); + cmd.push_back (to_string ((uint32_t) val, std::dec)); + } #endif } else if (using_oss) { diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h index 1a3d95e636..56a0722118 100644 --- a/gtk2_ardour/engine_dialog.h +++ b/gtk2_ardour/engine_dialog.h @@ -55,7 +55,9 @@ class EngineControl : public Gtk::VBox { Gtk::SpinButton ports_spinner; Gtk::SpinButton input_channels; Gtk::SpinButton output_channels; + Gtk::Adjustment input_latency_adjustment; Gtk::SpinButton input_latency; + Gtk::Adjustment output_latency_adjustment; Gtk::SpinButton output_latency; Gtk::Label latency_label;