diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 855f5679f4..41354563c6 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -664,6 +664,12 @@ + + + + + + diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index ea3aa72060..c3e9b6e1f2 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1727,6 +1727,18 @@ MixerStrip::build_route_ops_menu () i->signal_activate().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*_route, &Route::set_strict_io), !_route->strict_io()))); } + if (is_track()) { + items.push_back (SeparatorElem()); + + Gtk::Menu* dio_menu = new Menu; + MenuList& dio_items = dio_menu->items(); + dio_items.push_back (MenuElem (_("Record Pre-Fader"), sigc::bind (sigc::mem_fun (*this, &RouteUI::set_disk_io_point), DiskIOPreFader))); + dio_items.push_back (MenuElem (_("Record Post-Fader"), sigc::bind (sigc::mem_fun (*this, &RouteUI::set_disk_io_point), DiskIOPostFader))); + dio_items.push_back (MenuElem (_("Custom Record+Playback Positions"), sigc::bind (sigc::mem_fun (*this, &RouteUI::set_disk_io_point), DiskIOCustom))); + + items.push_back (MenuElem (_("Disk I/O..."), *dio_menu)); + } + _plugin_insert_cnt = 0; _route->foreach_processor (sigc::mem_fun (*this, &MixerStrip::help_count_plugins)); if (_plugin_insert_cnt > 0) { diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index ca1e448b58..e6d9b44cf4 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -113,6 +113,7 @@ RefPtr ProcessorBox::rename_action; RefPtr ProcessorBox::delete_action; RefPtr ProcessorBox::backspace_action; RefPtr ProcessorBox::manage_pins_action; +RefPtr ProcessorBox::disk_io_action; RefPtr ProcessorBox::edit_action; RefPtr ProcessorBox::edit_generic_action; RefPtr ProcessorBox::processor_box_actions; @@ -2105,7 +2106,6 @@ ProcessorBox::show_processor_menu (int arg) /* Sensitise actions as approprioate */ - const bool sensitive = !processor_display.selection().empty() && ! stub_processor_selected (); paste_action->set_sensitive (!_p_selection.processors.empty()); @@ -2123,6 +2123,11 @@ ProcessorBox::show_processor_menu (int arg) } manage_pins_action->set_sensitive (pi != 0); + if (boost::dynamic_pointer_cast(_route)) { + disk_io_action->set_sensitive (true); + } else { + disk_io_action->set_sensitive (false); + } /* allow editing with an Ardour-generated UI for plugin inserts with editors */ edit_action->set_sensitive (pi && pi->plugin()->has_editor ()); @@ -3367,6 +3372,14 @@ ProcessorBox::ab_plugins () ab_direction = !ab_direction; } +void +ProcessorBox::set_disk_io_position (DiskIOPoint diop) +{ + boost::shared_ptr t = boost::dynamic_pointer_cast (_route); + if (t) { + t->set_disk_io_position (diop); + } +} void ProcessorBox::clear_processors () @@ -3647,6 +3660,12 @@ ProcessorBox::register_actions () processor_box_actions, X_("manage-pins"), _("Pin Connections..."), sigc::ptr_fun (ProcessorBox::rb_manage_pins)); + /* Disk IO stuff */ + disk_io_action = myactions.register_action (processor_box_actions, X_("disk-io-menu"), _("Disk I/O ...")); + myactions.register_action (processor_box_actions, X_("disk-io-prefader"), _("Pre-Fader."), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_set_disk_io_position), DiskIOPreFader)); + myactions.register_action (processor_box_actions, X_("disk-io-postfader"), _("Post-Fader."), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_set_disk_io_position), DiskIOPostFader)); + myactions.register_action (processor_box_actions, X_("disk-io-custom"), _("Custom."), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_set_disk_io_position), DiskIOCustom)); + /* show editors */ edit_action = myactions.register_action ( processor_box_actions, X_("edit"), _("Edit..."), @@ -3679,6 +3698,16 @@ ProcessorBox::rb_ab_plugins () _current_processor_box->ab_plugins (); } +void +ProcessorBox::rb_set_disk_io_position (DiskIOPoint diop) +{ + if (_current_processor_box == 0) { + return; + } + + _current_processor_box->set_disk_io_position (diop); +} + void ProcessorBox::rb_manage_pins () { diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 400b9fafc9..cb13f42b43 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -552,6 +552,8 @@ private: void for_selected_processors (void (ProcessorBox::*pmf)(boost::shared_ptr)); void get_selected_processors (ProcSelection&) const; + void set_disk_io_position (ARDOUR::DiskIOPoint); + bool can_cut() const; bool stub_processor_selected() const; @@ -562,6 +564,7 @@ private: static Glib::RefPtr delete_action; static Glib::RefPtr backspace_action; static Glib::RefPtr manage_pins_action; + static Glib::RefPtr disk_io_action; static Glib::RefPtr edit_action; static Glib::RefPtr edit_generic_action; void paste_processor_state (const XMLNodeList&, boost::shared_ptr); @@ -595,6 +598,7 @@ private: static void rb_deactivate_all (); static void rb_ab_plugins (); static void rb_manage_pins (); + static void rb_set_disk_io_position (ARDOUR::DiskIOPoint); static void rb_edit (); static void rb_edit_generic (); diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index 2aa3212a90..0eea9d8d44 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -2426,3 +2426,11 @@ RouteUI::stripable () const { return _route; } + +void +RouteUI::set_disk_io_point (DiskIOPoint diop) +{ + if (_route && is_track()) { + track()->set_disk_io_position (diop); + } +} diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h index d39e8deabf..bac608eed4 100644 --- a/gtk2_ardour/route_ui.h +++ b/gtk2_ardour/route_ui.h @@ -271,6 +271,8 @@ public: void comment_edited (); bool ignore_comment_edit; + void set_disk_io_point (ARDOUR::DiskIOPoint); + protected: ArdourWindow* comment_window;