more changes flowing from a persistent MonitorSection object
[ardour.git] / gtk2_ardour / mixer_strip.cc
index 6d127262b3a14a4e76daeca8dc7ad0a1bea6c340..1e7c94f9069406d13406877f46340c9e0001265c 100644 (file)
@@ -504,7 +504,7 @@ MixerStrip::trim_start_touch ()
 {
        assert (_route && _session);
        if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) {
-               route()->trim()->gain_control ()->start_touch (_session->transport_frame());
+               route()->trim()->gain_control ()->start_touch (_session->transport_sample());
        }
 }
 
@@ -513,7 +513,7 @@ MixerStrip::trim_end_touch ()
 {
        assert (_route && _session);
        if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) {
-               route()->trim()->gain_control ()->stop_touch (_session->transport_frame());
+               route()->trim()->gain_control ()->stop_touch (_session->transport_sample());
        }
 }
 
@@ -581,7 +581,7 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
                solo_iso_table.set_sensitive(false);
                control_slave_ui.set_sensitive(false);
                if (monitor_section_button == 0) {
-                       Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
+                       Glib::RefPtr<Action> act = ActionManager::get_action ("Mixer", "ToggleMonitorSection");
                        _session->MonitorChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::monitor_changed, this), gui_context());
 
                        monitor_section_button = manage (new ArdourButton);
@@ -692,10 +692,6 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
                _route->panner_shell()->Changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::connect_to_pan, this), gui_context());
        }
 
-       if (is_audio_track()) {
-               audio_track()->DiskstreamChanged.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::diskstream_changed, this), gui_context());
-       }
-
        _route->comment_changed.connect (route_connections, invalidator (*this), boost::bind (&MixerStrip::setup_comment_button, this), gui_context());
 
        set_stuff_from_route ();
@@ -877,9 +873,7 @@ gint
 MixerStrip::output_press (GdkEventButton *ev)
 {
        using namespace Menu_Helpers;
-       if (!_session->engine().connected()) {
-               MessageDialog msg (_("Not connected to audio engine - no I/O changes are possible"));
-               msg.run ();
+       if (!ARDOUR_UI_UTILS::engine_is_running ()) {
                return true;
        }
 
@@ -914,8 +908,7 @@ MixerStrip::output_press (GdkEventButton *ev)
                }
 
                /* then other routes inputs */
-               boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes ();
-               RouteList copy = *routes;
+               RouteList copy = _session->get_routelist ();
                copy.sort (RouteCompareByName ());
                for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) {
                        maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current, intended_type);
@@ -994,9 +987,7 @@ MixerStrip::input_press (GdkEventButton *ev)
        input_menu.set_name ("ArdourContextMenu");
        citems.clear();
 
-       if (!_session->engine().connected()) {
-               MessageDialog msg (_("Not connected to audio engine - no I/O changes are possible"));
-               msg.run ();
+       if (!ARDOUR_UI_UTILS::engine_is_running ()) {
                return true;
        }
 
@@ -1260,7 +1251,6 @@ MixerStrip::guess_main_type(bool for_input, bool favor_connected) const
 
 /*
  * Output port labelling
- * =====================
  *
  * Case 1: Each output has one connection, all connections are to system:playback_%i
  *   out 1 -> system:playback_1
@@ -1284,8 +1274,9 @@ MixerStrip::guess_main_type(bool for_input, bool favor_connected) const
  * Default case (unusual routing):
  *   Display as: *number of connections*
  *
+ *
  * Tooltips
- * ========
+ *
  * .-----------------------------------------------.
  * | Mixdown                                       |
  * | out 1 -> ardour:master/in 1, jamin:input/in 1 |
@@ -1731,6 +1722,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) {
@@ -1860,7 +1863,7 @@ MixerStrip::name_changed ()
                        break;
        }
 
-       set_tooltip (name_button, _route->name());
+       set_tooltip (name_button, Gtkmm2ext::markup_escape_text(_route->name()));
 
        if (_session->config.get_track_name_number()) {
                const int64_t track_number = _route->track_number ();
@@ -2165,6 +2168,11 @@ MixerStrip::drop_send ()
        monitor_input_button->set_sensitive (true);
        monitor_disk_button->set_sensitive (true);
        _comment_button.set_sensitive (true);
+       trim_control.set_sensitive (true);
+       if (midi_input_enable_button) {
+               midi_input_enable_button->set_sensitive (true);
+       }
+       control_slave_ui.set_sensitive (true);
        RouteUI::check_rec_enable_sensitivity ();
        set_button_names (); // update solo button visual state
 }
@@ -2213,6 +2221,11 @@ MixerStrip::show_send (boost::shared_ptr<Send> send)
        monitor_input_button->set_sensitive (false);
        monitor_disk_button->set_sensitive (false);
        _comment_button.set_sensitive (false);
+       trim_control.set_sensitive (false);
+       if (midi_input_enable_button) {
+               midi_input_enable_button->set_sensitive (false);
+       }
+       control_slave_ui.set_sensitive (false);
 
        if (boost::dynamic_pointer_cast<InternalSend>(send)) {
                output_button.set_sensitive (false);
@@ -2380,6 +2393,7 @@ MixerStrip::parameter_changed (string p)
                _visibility.set_state (UIConfiguration::instance().get_mixer_strip_visibility ());
        } else if (p == "track-name-number") {
                name_changed ();
+               update_track_number_visibility();
        } else if (p == "use-monitor-bus") {
                if (monitor_section_button) {
                        if (mute_button->get_parent()) {
@@ -2398,8 +2412,6 @@ MixerStrip::parameter_changed (string p)
                                mute_button->show();
                        }
                }
-       } else if (p == "track-name-number") {
-               update_track_number_visibility();
        }
 }