diff options
author | David Robillard <d@drobilla.net> | 2015-03-05 18:48:33 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-03-05 18:48:33 -0500 |
commit | 408090adce65f6a23e1e4b7afbd26f0cd6177e88 (patch) | |
tree | 44672dd6e46e1a0f2ba07e8abf37f193ab140dd6 | |
parent | a8aae56d92699e4545b5f8a69742f9a1c75ad238 (diff) |
Add MIDI readahead to options editor.
-rw-r--r-- | gtk2_ardour/option_editor.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 10 | ||||
-rw-r--r-- | libs/ardour/butler.cc | 18 |
3 files changed, 24 insertions, 9 deletions
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h index a91c2404fc..ac768383ee 100644 --- a/gtk2_ardour/option_editor.h +++ b/gtk2_ardour/option_editor.h @@ -506,6 +506,7 @@ public: * @param page Page step for the spin button. * @param unit Unit name. * @param scale Scaling factor (such that for a value x in the spinbutton, x * scale is written to the config) + * @param digits Number of decimal digits to show. */ SpinOption ( std::string const & i, @@ -517,7 +518,8 @@ public: T step, T page, std::string const & unit = "", - float scale = 1 + float scale = 1, + unsigned digits = 0 ) : Option (i, n), _get (g), @@ -530,6 +532,7 @@ public: _spin = Gtk::manage (new Gtk::SpinButton); _spin->set_range (min, max); _spin->set_increments (step, page); + _spin->set_digits(digits); _box = Gtk::manage (new Gtk::HBox); _box->pack_start (*_spin, true, true); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index ef3c66153e..f9b9b37840 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -2067,6 +2067,16 @@ RCOptionEditor::RCOptionEditor () )); add_option (_("MIDI"), + new SpinOption<float> ( + "midi-readahead", + _("MIDI read-ahead time (seconds)"), + sigc::mem_fun (*_rc_config, &RCConfiguration::get_midi_readahead), + sigc::mem_fun (*_rc_config, &RCConfiguration::set_midi_readahead), + 0.1, 10, 0.1, 1, + "", 1.0, 1 + )); + + add_option (_("MIDI"), new BoolOption ( "send-midi-clock", _("Send MIDI Clock"), diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index a89e8295d2..01c21b45d0 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -65,14 +65,16 @@ Butler::~Butler() void Butler::config_changed (std::string p) { - if (p == "playback-buffer-seconds") { - /* size is in Samples, not bytes */ - audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.frame_rate()); - _session.adjust_playback_buffering (); - } else if (p == "capture-buffer-seconds") { - audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.frame_rate()); - _session.adjust_capture_buffering (); - } + if (p == "playback-buffer-seconds") { + /* size is in Samples, not bytes */ + audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.frame_rate()); + _session.adjust_playback_buffering (); + } else if (p == "capture-buffer-seconds") { + audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.frame_rate()); + _session.adjust_capture_buffering (); + } else if (p == "midi-readahead") { + MidiDiskstream::set_readahead_frames ((framecnt_t) (Config->get_midi_readahead() * _session.frame_rate())); + } } int |