void
AudioTimeAxisView::route_active_changed ()
{
- RouteTimeAxisView::route_active_changed ();
update_control_names ();
}
}
void
-MidiTimeAxisView::show_all_automation ()
+MidiTimeAxisView::show_all_automation (bool apply_to_selection)
{
- if (midi_track()) {
- const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
-
- for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
- create_automation_child(*i, true);
+ if (apply_to_selection) {
+ _editor.get_selection().tracks.foreach_midi_time_axis (boost::bind (&MidiTimeAxisView::show_all_automation, _1, false));
+ } else {
+ if (midi_track()) {
+ const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
+
+ for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
+ create_automation_child(*i, true);
+ }
}
+
+ RouteTimeAxisView::show_all_automation ();
}
-
- RouteTimeAxisView::show_all_automation ();
}
void
-MidiTimeAxisView::show_existing_automation ()
+MidiTimeAxisView::show_existing_automation (bool apply_to_selection)
{
- if (midi_track()) {
- const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
-
- for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
- create_automation_child(*i, true);
+ if (apply_to_selection) {
+ _editor.get_selection().tracks.foreach_midi_time_axis (boost::bind (&MidiTimeAxisView::show_existing_automation, _1, false));
+ } else {
+ if (midi_track()) {
+ const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
+
+ for (set<Evoral::Parameter>::const_iterator i = params.begin(); i != params.end(); ++i) {
+ create_automation_child(*i, true);
+ }
}
+
+ RouteTimeAxisView::show_existing_automation ();
}
-
- RouteTimeAxisView::show_existing_automation ();
}
/** Create an automation track for the given parameter (pitch bend, channel pressure).
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::framepos_t, ARDOUR::framecnt_t, bool);
- void show_all_automation ();
- void show_existing_automation ();
+ void show_all_automation (bool apply_to_selection = false);
+ void show_existing_automation (bool apply_to_selection = false);
void create_automation_child (const Evoral::Parameter& param, bool show);
ARDOUR::NoteMode note_mode() const { return _note_mode; }
{
name_button.modify_bg (STATE_NORMAL, color());
top_event_box.modify_bg (STATE_NORMAL, color());
- route_active_changed ();
+ reset_strip_style ();
}
void
MixerStrip::show_passthru_color ()
{
- route_active_changed ();
+ reset_strip_style ();
}
void
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
rename_menu_item = &items.back();
items.push_back (SeparatorElem());
- items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun (*this, &RouteUI::toggle_route_active)));
- route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
- route_active_menu_item->set_active (_route->active());
+ items.push_back (CheckMenuElem (_("Active")));
+ CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
+ i->set_active (_route->active());
+ i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));
items.push_back (SeparatorElem());
void
MixerStrip::list_route_operations ()
{
- if (route_ops_menu == 0) {
- build_route_ops_menu ();
- }
+ delete route_ops_menu;
+ build_route_ops_menu ();
}
void
}
}
-void
-MixerStrip::route_active_changed ()
-{
- RouteUI::route_active_changed ();
- reset_strip_style ();
-}
-
void
MixerStrip::reset_strip_style ()
{
void show_route_color ();
void show_passthru_color ();
- void route_active_changed ();
-
void name_changed ();
void update_speed_display ();
void map_frozen ();
items.push_back (SeparatorElem());
}
- items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun(*this, &RouteUI::toggle_route_active)));
- route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
- route_active_menu_item->set_active (_route->active());
+ int active = 0;
+ int inactive = 0;
+ TrackSelection const & s = _editor.get_selection().tracks;
+ for (TrackSelection::const_iterator i = s.begin(); i != s.end(); ++i) {
+ RouteTimeAxisView* r = dynamic_cast<RouteTimeAxisView*> (*i);
+ if (!r) {
+ continue;
+ }
+
+ if (r->route()->active()) {
+ ++active;
+ } else {
+ ++inactive;
+ }
+ }
+
+ items.push_back (CheckMenuElem (_("Active")));
+ CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
+ bool click_sets_active = true;
+ if (active > 0 && inactive == 0) {
+ i->set_active (true);
+ click_sets_active = false;
+ } else if (active > 0 && inactive > 0) {
+ i->set_inconsistent (true);
+ }
+ i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), click_sets_active, true));
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, false)));
solo_safe_led = 0;
_solo_release = 0;
_mute_release = 0;
- route_active_menu_item = 0;
denormal_menu_item = 0;
step_edit_item = 0;
multiple_mute_change = false;
xml_node = 0;
}
- route_active_menu_item = 0;
denormal_menu_item = 0;
}
}
void
-RouteUI::toggle_route_active ()
+RouteUI::set_route_active (bool a, bool apply_to_selection)
{
- bool yn;
-
- if (route_active_menu_item) {
- if (route_active_menu_item->get_active() != (yn = _route->active())) {
- _route->set_active (!yn, this);
- }
- }
-}
-
-void
-RouteUI::route_active_changed ()
-{
- if (route_active_menu_item) {
- Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&CheckMenuItem::set_active, route_active_menu_item, _route->active()));
+ if (apply_to_selection) {
+ ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteTimeAxisView::set_route_active, _1, a, false));
+ } else {
+ _route->set_active (a, this);
}
}
-
void
RouteUI::toggle_denormal_protection ()
{
virtual void property_changed (const PBD::PropertyChange&);
void route_removed ();
- Gtk::CheckMenuItem *route_active_menu_item;
- void toggle_route_active ();
- virtual void route_active_changed ();
+ virtual void route_active_changed () {}
+ void set_route_active (bool, bool);
Gtk::Menu* record_menu;
void build_record_menu ();
#include "track_view_list.h"
#include "route_ui.h"
#include "audio_time_axis.h"
+#include "midi_time_axis.h"
class PublicEditor;
void foreach_route_ui (Function f) {
for (iterator i = begin(); i != end(); ++i) {
RouteUI* t = dynamic_cast<RouteUI*> (*i);
- f (t);
+ if (t) {
+ f (t);
+ }
}
}
void foreach_route_time_axis (Function f) {
for (iterator i = begin(); i != end(); ++i) {
RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
- f (t);
+ if (t) {
+ f (t);
+ }
}
}
void foreach_audio_time_axis (Function f) {
for (iterator i = begin(); i != end(); ++i) {
AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
- f (t);
+ if (t) {
+ f (t);
+ }
+ }
+ }
+
+ template <typename Function>
+ void foreach_midi_time_axis (Function f) {
+ for (iterator i = begin(); i != end(); ++i) {
+ MidiTimeAxisView* t = dynamic_cast<MidiTimeAxisView*> (*i);
+ if (t) {
+ f (t);
+ }
}
}