mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Make Active apply to the selection.
git-svn-id: svn://localhost/ardour2/branches/3.0@9089 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
92a5e4da48
commit
8f45604f27
9 changed files with 87 additions and 63 deletions
|
|
@ -409,7 +409,6 @@ AudioTimeAxisView::reveal_dependent_views (TimeAxisViewItem& tavi)
|
||||||
void
|
void
|
||||||
AudioTimeAxisView::route_active_changed ()
|
AudioTimeAxisView::route_active_changed ()
|
||||||
{
|
{
|
||||||
RouteTimeAxisView::route_active_changed ();
|
|
||||||
update_control_names ();
|
update_control_names ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -820,8 +820,11 @@ MidiTimeAxisView::update_range()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiTimeAxisView::show_all_automation ()
|
MidiTimeAxisView::show_all_automation (bool apply_to_selection)
|
||||||
{
|
{
|
||||||
|
if (apply_to_selection) {
|
||||||
|
_editor.get_selection().tracks.foreach_midi_time_axis (boost::bind (&MidiTimeAxisView::show_all_automation, _1, false));
|
||||||
|
} else {
|
||||||
if (midi_track()) {
|
if (midi_track()) {
|
||||||
const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
|
const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
|
||||||
|
|
||||||
|
|
@ -832,10 +835,14 @@ MidiTimeAxisView::show_all_automation ()
|
||||||
|
|
||||||
RouteTimeAxisView::show_all_automation ();
|
RouteTimeAxisView::show_all_automation ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MidiTimeAxisView::show_existing_automation ()
|
MidiTimeAxisView::show_existing_automation (bool apply_to_selection)
|
||||||
{
|
{
|
||||||
|
if (apply_to_selection) {
|
||||||
|
_editor.get_selection().tracks.foreach_midi_time_axis (boost::bind (&MidiTimeAxisView::show_existing_automation, _1, false));
|
||||||
|
} else {
|
||||||
if (midi_track()) {
|
if (midi_track()) {
|
||||||
const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
|
const set<Evoral::Parameter> params = midi_track()->midi_playlist()->contained_automation();
|
||||||
|
|
||||||
|
|
@ -846,6 +853,7 @@ MidiTimeAxisView::show_existing_automation ()
|
||||||
|
|
||||||
RouteTimeAxisView::show_existing_automation ();
|
RouteTimeAxisView::show_existing_automation ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Create an automation track for the given parameter (pitch bend, channel pressure).
|
/** Create an automation track for the given parameter (pitch bend, channel pressure).
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,8 @@ class MidiTimeAxisView : public RouteTimeAxisView
|
||||||
|
|
||||||
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::framepos_t, ARDOUR::framecnt_t, bool);
|
boost::shared_ptr<ARDOUR::MidiRegion> add_region (ARDOUR::framepos_t, ARDOUR::framecnt_t, bool);
|
||||||
|
|
||||||
void show_all_automation ();
|
void show_all_automation (bool apply_to_selection = false);
|
||||||
void show_existing_automation ();
|
void show_existing_automation (bool apply_to_selection = false);
|
||||||
void create_automation_child (const Evoral::Parameter& param, bool show);
|
void create_automation_child (const Evoral::Parameter& param, bool show);
|
||||||
|
|
||||||
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
||||||
|
|
|
||||||
|
|
@ -1321,13 +1321,13 @@ MixerStrip::show_route_color ()
|
||||||
{
|
{
|
||||||
name_button.modify_bg (STATE_NORMAL, color());
|
name_button.modify_bg (STATE_NORMAL, color());
|
||||||
top_event_box.modify_bg (STATE_NORMAL, color());
|
top_event_box.modify_bg (STATE_NORMAL, color());
|
||||||
route_active_changed ();
|
reset_strip_style ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MixerStrip::show_passthru_color ()
|
MixerStrip::show_passthru_color ()
|
||||||
{
|
{
|
||||||
route_active_changed ();
|
reset_strip_style ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1345,9 +1345,10 @@ MixerStrip::build_route_ops_menu ()
|
||||||
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
|
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
|
||||||
rename_menu_item = &items.back();
|
rename_menu_item = &items.back();
|
||||||
items.push_back (SeparatorElem());
|
items.push_back (SeparatorElem());
|
||||||
items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun (*this, &RouteUI::toggle_route_active)));
|
items.push_back (CheckMenuElem (_("Active")));
|
||||||
route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
|
CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
|
||||||
route_active_menu_item->set_active (_route->active());
|
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());
|
items.push_back (SeparatorElem());
|
||||||
|
|
||||||
|
|
@ -1387,10 +1388,9 @@ MixerStrip::name_button_button_press (GdkEventButton* ev)
|
||||||
void
|
void
|
||||||
MixerStrip::list_route_operations ()
|
MixerStrip::list_route_operations ()
|
||||||
{
|
{
|
||||||
if (route_ops_menu == 0) {
|
delete route_ops_menu;
|
||||||
build_route_ops_menu ();
|
build_route_ops_menu ();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MixerStrip::set_selected (bool yn)
|
MixerStrip::set_selected (bool yn)
|
||||||
|
|
@ -1496,13 +1496,6 @@ MixerStrip::hide_processor_editor (boost::weak_ptr<Processor> p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
MixerStrip::route_active_changed ()
|
|
||||||
{
|
|
||||||
RouteUI::route_active_changed ();
|
|
||||||
reset_strip_style ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MixerStrip::reset_strip_style ()
|
MixerStrip::reset_strip_style ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -260,8 +260,6 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
|
||||||
void show_route_color ();
|
void show_route_color ();
|
||||||
void show_passthru_color ();
|
void show_passthru_color ();
|
||||||
|
|
||||||
void route_active_changed ();
|
|
||||||
|
|
||||||
void name_changed ();
|
void name_changed ();
|
||||||
void update_speed_display ();
|
void update_speed_display ();
|
||||||
void map_frozen ();
|
void map_frozen ();
|
||||||
|
|
|
||||||
|
|
@ -621,9 +621,32 @@ RouteTimeAxisView::build_display_menu ()
|
||||||
items.push_back (SeparatorElem());
|
items.push_back (SeparatorElem());
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push_back (CheckMenuElem (_("Active"), sigc::mem_fun(*this, &RouteUI::toggle_route_active)));
|
int active = 0;
|
||||||
route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
|
int inactive = 0;
|
||||||
route_active_menu_item->set_active (_route->active());
|
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 (SeparatorElem());
|
||||||
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, false)));
|
items.push_back (MenuElem (_("Hide"), sigc::bind (sigc::mem_fun(_editor, &PublicEditor::hide_track_in_display), this, false)));
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,6 @@ RouteUI::init ()
|
||||||
solo_safe_led = 0;
|
solo_safe_led = 0;
|
||||||
_solo_release = 0;
|
_solo_release = 0;
|
||||||
_mute_release = 0;
|
_mute_release = 0;
|
||||||
route_active_menu_item = 0;
|
|
||||||
denormal_menu_item = 0;
|
denormal_menu_item = 0;
|
||||||
step_edit_item = 0;
|
step_edit_item = 0;
|
||||||
multiple_mute_change = false;
|
multiple_mute_change = false;
|
||||||
|
|
@ -179,7 +178,6 @@ RouteUI::reset ()
|
||||||
xml_node = 0;
|
xml_node = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
route_active_menu_item = 0;
|
|
||||||
denormal_menu_item = 0;
|
denormal_menu_item = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1467,25 +1465,14 @@ RouteUI::property_changed (const PropertyChange& what_changed)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteUI::toggle_route_active ()
|
RouteUI::set_route_active (bool a, bool apply_to_selection)
|
||||||
{
|
{
|
||||||
bool yn;
|
if (apply_to_selection) {
|
||||||
|
ARDOUR_UI::instance()->the_editor().get_selection().tracks.foreach_route_ui (boost::bind (&RouteTimeAxisView::set_route_active, _1, a, false));
|
||||||
if (route_active_menu_item) {
|
} else {
|
||||||
if (route_active_menu_item->get_active() != (yn = _route->active())) {
|
_route->set_active (a, this);
|
||||||
_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()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteUI::toggle_denormal_protection ()
|
RouteUI::toggle_denormal_protection ()
|
||||||
|
|
|
||||||
|
|
@ -175,9 +175,8 @@ class RouteUI : public virtual AxisView
|
||||||
virtual void property_changed (const PBD::PropertyChange&);
|
virtual void property_changed (const PBD::PropertyChange&);
|
||||||
void route_removed ();
|
void route_removed ();
|
||||||
|
|
||||||
Gtk::CheckMenuItem *route_active_menu_item;
|
virtual void route_active_changed () {}
|
||||||
void toggle_route_active ();
|
void set_route_active (bool, bool);
|
||||||
virtual void route_active_changed ();
|
|
||||||
|
|
||||||
Gtk::Menu* record_menu;
|
Gtk::Menu* record_menu;
|
||||||
void build_record_menu ();
|
void build_record_menu ();
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include "track_view_list.h"
|
#include "track_view_list.h"
|
||||||
#include "route_ui.h"
|
#include "route_ui.h"
|
||||||
#include "audio_time_axis.h"
|
#include "audio_time_axis.h"
|
||||||
|
#include "midi_time_axis.h"
|
||||||
|
|
||||||
class PublicEditor;
|
class PublicEditor;
|
||||||
|
|
||||||
|
|
@ -47,25 +48,41 @@ public:
|
||||||
void foreach_route_ui (Function f) {
|
void foreach_route_ui (Function f) {
|
||||||
for (iterator i = begin(); i != end(); ++i) {
|
for (iterator i = begin(); i != end(); ++i) {
|
||||||
RouteUI* t = dynamic_cast<RouteUI*> (*i);
|
RouteUI* t = dynamic_cast<RouteUI*> (*i);
|
||||||
|
if (t) {
|
||||||
f (t);
|
f (t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Function>
|
template <typename Function>
|
||||||
void foreach_route_time_axis (Function f) {
|
void foreach_route_time_axis (Function f) {
|
||||||
for (iterator i = begin(); i != end(); ++i) {
|
for (iterator i = begin(); i != end(); ++i) {
|
||||||
RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
|
RouteTimeAxisView* t = dynamic_cast<RouteTimeAxisView*> (*i);
|
||||||
|
if (t) {
|
||||||
f (t);
|
f (t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Function>
|
template <typename Function>
|
||||||
void foreach_audio_time_axis (Function f) {
|
void foreach_audio_time_axis (Function f) {
|
||||||
for (iterator i = begin(); i != end(); ++i) {
|
for (iterator i = begin(); i != end(); ++i) {
|
||||||
AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
|
AudioTimeAxisView* t = dynamic_cast<AudioTimeAxisView*> (*i);
|
||||||
|
if (t) {
|
||||||
f (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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PublicEditor const * _editor;
|
PublicEditor const * _editor;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue