13
0

basic GUI framework for setting Disk I/O options

This commit is contained in:
Paul Davis 2017-07-21 17:03:41 -04:00
parent 4bfc5ddf71
commit e6064b286e
6 changed files with 62 additions and 1 deletions

View File

@ -664,6 +664,12 @@
<menuitem action='controls'/>
<menuitem action='send_options'/>
<separator/>
<menu action="disk-io-menu">
<menuitem action='disk-io-prefader'/>
<menuitem action='disk-io-postfader'/>
<menuitem action='disk-io-custom'/>
</menu>
<separator/>
<menuitem action='clear'/>
<menuitem action='clear_pre'/>
<menuitem action='clear_post'/>

View File

@ -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) {

View File

@ -113,6 +113,7 @@ RefPtr<Action> ProcessorBox::rename_action;
RefPtr<Action> ProcessorBox::delete_action;
RefPtr<Action> ProcessorBox::backspace_action;
RefPtr<Action> ProcessorBox::manage_pins_action;
RefPtr<Action> ProcessorBox::disk_io_action;
RefPtr<Action> ProcessorBox::edit_action;
RefPtr<Action> ProcessorBox::edit_generic_action;
RefPtr<ActionGroup> 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<Track>(_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<Track> t = boost::dynamic_pointer_cast<Track> (_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 ()
{

View File

@ -552,6 +552,8 @@ private:
void for_selected_processors (void (ProcessorBox::*pmf)(boost::shared_ptr<ARDOUR::Processor>));
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<Gtk::Action> delete_action;
static Glib::RefPtr<Gtk::Action> backspace_action;
static Glib::RefPtr<Gtk::Action> manage_pins_action;
static Glib::RefPtr<Gtk::Action> disk_io_action;
static Glib::RefPtr<Gtk::Action> edit_action;
static Glib::RefPtr<Gtk::Action> edit_generic_action;
void paste_processor_state (const XMLNodeList&, boost::shared_ptr<ARDOUR::Processor>);
@ -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 ();

View File

@ -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);
}
}

View File

@ -271,6 +271,8 @@ public:
void comment_edited ();
bool ignore_comment_edit;
void set_disk_io_point (ARDOUR::DiskIOPoint);
protected:
ArdourWindow* comment_window;