2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2000-2004 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2010-11-13 00:14:48 -05:00
|
|
|
#ifdef WAF_BUILD
|
|
|
|
#include "gtk2ardour-config.h"
|
|
|
|
#endif
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <algorithm>
|
2009-10-22 20:05:50 -04:00
|
|
|
#include <map>
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <sigc++/bind.h>
|
|
|
|
|
2005-11-29 17:48:54 -05:00
|
|
|
#include <gtkmm/accelmap.h>
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/convert.h"
|
2012-06-27 18:57:06 -04:00
|
|
|
#include "pbd/unwind.h"
|
|
|
|
|
2012-07-25 13:48:55 -04:00
|
|
|
#include <glibmm/threads.h>
|
2006-04-25 16:23:50 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
#include <gtkmm2ext/gtk_ui.h>
|
|
|
|
#include <gtkmm2ext/utils.h>
|
2010-03-18 22:49:01 -04:00
|
|
|
#include <gtkmm2ext/tearoff.h>
|
2007-04-11 09:07:51 -04:00
|
|
|
#include <gtkmm2ext/window_title.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
#include "ardour/debug.h"
|
2012-11-12 21:19:04 -05:00
|
|
|
#include "ardour/midi_track.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/plugin_manager.h"
|
|
|
|
#include "ardour/route_group.h"
|
2014-06-23 19:36:07 -04:00
|
|
|
#include "ardour/route_sorters.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/session.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-04-11 09:07:51 -04:00
|
|
|
#include "keyboard.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "mixer_ui.h"
|
|
|
|
#include "mixer_strip.h"
|
2010-03-10 12:31:16 -05:00
|
|
|
#include "monitor_section.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "plugin_selector.h"
|
2011-11-15 14:33:09 -05:00
|
|
|
#include "public_editor.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "prompter.h"
|
|
|
|
#include "utils.h"
|
2012-10-26 20:15:45 -04:00
|
|
|
#include "route_sorter.h"
|
2005-11-29 17:48:54 -05:00
|
|
|
#include "actions.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "gui_thread.h"
|
2009-06-20 13:15:33 -04:00
|
|
|
#include "mixer_group_tabs.h"
|
2014-12-25 10:02:00 -05:00
|
|
|
#include "timers.h"
|
2015-01-02 09:44:54 -05:00
|
|
|
#include "ui_config.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "i18n.h"
|
|
|
|
|
|
|
|
using namespace ARDOUR;
|
2014-06-25 15:27:37 -04:00
|
|
|
using namespace ARDOUR_UI_UTILS;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Gtk;
|
2005-11-29 17:48:54 -05:00
|
|
|
using namespace Glib;
|
2005-09-25 16:33:00 -04:00
|
|
|
using namespace Gtkmm2ext;
|
2006-01-17 11:40:57 -05:00
|
|
|
using namespace std;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-04-25 16:23:50 -04:00
|
|
|
using PBD::atoi;
|
2012-06-27 18:57:06 -04:00
|
|
|
using PBD::Unwinder;
|
2006-04-25 16:23:50 -04:00
|
|
|
|
2011-11-15 14:33:09 -05:00
|
|
|
Mixer_UI* Mixer_UI::_instance = 0;
|
|
|
|
|
|
|
|
Mixer_UI*
|
2015-10-04 14:51:05 -04:00
|
|
|
Mixer_UI::instance ()
|
2011-11-15 14:33:09 -05:00
|
|
|
{
|
|
|
|
if (!_instance) {
|
|
|
|
_instance = new Mixer_UI;
|
2015-10-04 14:51:05 -04:00
|
|
|
}
|
2011-11-15 14:33:09 -05:00
|
|
|
|
|
|
|
return _instance;
|
|
|
|
}
|
|
|
|
|
2007-04-11 09:07:51 -04:00
|
|
|
Mixer_UI::Mixer_UI ()
|
|
|
|
: Window (Gtk::WINDOW_TOPLEVEL)
|
2013-04-26 14:12:52 -04:00
|
|
|
, VisibilityTracker (*((Gtk::Window*) this))
|
2012-06-27 18:57:06 -04:00
|
|
|
, _visible (false)
|
|
|
|
, no_track_list_redisplay (false)
|
|
|
|
, in_group_row_change (false)
|
|
|
|
, track_menu (0)
|
|
|
|
, _monitor_section (0)
|
2015-09-12 14:05:46 -04:00
|
|
|
, _plugin_selector (0)
|
2015-01-02 09:44:54 -05:00
|
|
|
, _strip_width (UIConfiguration::instance().get_default_narrow_ms() ? Narrow : Wide)
|
2012-06-27 18:57:06 -04:00
|
|
|
, ignore_reorder (false)
|
2014-06-20 21:51:59 -04:00
|
|
|
, _in_group_rebuild_or_clear (false)
|
|
|
|
, _route_deletion_in_progress (false)
|
2014-06-22 11:41:05 -04:00
|
|
|
, _following_editor_selection (false)
|
2014-06-20 21:51:59 -04:00
|
|
|
, _maximised (false)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-11-04 13:53:21 -04:00
|
|
|
/* allow this window to become the key focus window */
|
|
|
|
set_flags (CAN_FOCUS);
|
|
|
|
|
2013-10-20 09:19:43 -04:00
|
|
|
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::sync_treeview_from_order_keys, this), gui_context());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-12-09 21:03:45 -05:00
|
|
|
scroller.set_can_default (true);
|
|
|
|
set_default (scroller);
|
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
scroller_base.set_flags (Gtk::CAN_FOCUS);
|
2009-10-22 13:17:34 -04:00
|
|
|
scroller_base.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
|
|
|
scroller_base.set_name ("MixerWindow");
|
2009-12-11 18:29:48 -05:00
|
|
|
scroller_base.signal_button_release_event().connect (sigc::mem_fun(*this, &Mixer_UI::strip_scroller_button_release));
|
2005-09-25 14:42:24 -04:00
|
|
|
// add as last item of strip packer
|
|
|
|
strip_packer.pack_end (scroller_base, true, true);
|
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
_group_tabs = new MixerGroupTabs (this);
|
|
|
|
VBox* b = manage (new VBox);
|
|
|
|
b->pack_start (*_group_tabs, PACK_SHRINK);
|
|
|
|
b->pack_start (strip_packer);
|
|
|
|
b->show_all ();
|
|
|
|
|
|
|
|
scroller.add (*b);
|
2014-07-28 13:01:54 -04:00
|
|
|
scroller.set_policy (Gtk::POLICY_ALWAYS, Gtk::POLICY_AUTOMATIC);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-01-09 14:09:49 -05:00
|
|
|
setup_track_display ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
group_model = ListStore::create (group_columns);
|
|
|
|
group_display.set_model (group_model);
|
2006-05-19 13:29:05 -04:00
|
|
|
group_display.append_column (_("Group"), group_columns.text);
|
2006-11-27 14:31:33 -05:00
|
|
|
group_display.append_column (_("Show"), group_columns.visible);
|
2005-10-01 12:29:37 -04:00
|
|
|
group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
|
|
|
group_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
2006-05-21 06:11:59 -04:00
|
|
|
group_display.get_column (0)->set_expand(true);
|
|
|
|
group_display.get_column (1)->set_expand(false);
|
2012-12-07 17:38:49 -05:00
|
|
|
group_display.set_name ("EditGroupList");
|
2006-03-09 18:44:39 -05:00
|
|
|
group_display.get_selection()->set_mode (Gtk::SELECTION_SINGLE);
|
2006-02-14 14:12:35 -05:00
|
|
|
group_display.set_reorderable (true);
|
|
|
|
group_display.set_headers_visible (true);
|
2006-03-09 18:44:39 -05:00
|
|
|
group_display.set_rules_hint (true);
|
2015-09-15 15:21:01 -04:00
|
|
|
group_display.set_can_focus(false);
|
2006-03-09 18:44:39 -05:00
|
|
|
|
|
|
|
/* name is directly editable */
|
|
|
|
|
|
|
|
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(group_display.get_column_cell_renderer (0));
|
|
|
|
name_cell->property_editable() = true;
|
2009-12-11 18:29:48 -05:00
|
|
|
name_cell->signal_edited().connect (sigc::mem_fun (*this, &Mixer_UI::route_group_name_edit));
|
2005-10-01 12:29:37 -04:00
|
|
|
|
|
|
|
/* use checkbox for the active column */
|
|
|
|
|
2006-02-14 14:12:35 -05:00
|
|
|
CellRendererToggle* active_cell = dynamic_cast<CellRendererToggle*>(group_display.get_column_cell_renderer (1));
|
2005-10-01 12:29:37 -04:00
|
|
|
active_cell->property_activatable() = true;
|
|
|
|
active_cell->property_radio() = false;
|
2006-02-14 14:12:35 -05:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
group_model->signal_row_changed().connect (sigc::mem_fun (*this, &Mixer_UI::route_group_row_change));
|
2011-04-19 11:46:47 -04:00
|
|
|
/* We use this to notice drag-and-drop reorders of the group list */
|
|
|
|
group_model->signal_row_deleted().connect (sigc::mem_fun (*this, &Mixer_UI::route_group_row_deleted));
|
2009-12-11 18:29:48 -05:00
|
|
|
group_display.signal_button_press_event().connect (sigc::mem_fun (*this, &Mixer_UI::group_display_button_press), false);
|
2006-02-14 14:12:35 -05:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
group_display_scroller.add (group_display);
|
2005-09-28 12:22:43 -04:00
|
|
|
group_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
HBox* route_group_display_button_box = manage (new HBox());
|
2006-03-09 23:05:11 -05:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
Button* route_group_add_button = manage (new Button ());
|
|
|
|
Button* route_group_remove_button = manage (new Button ());
|
2006-03-09 23:05:11 -05:00
|
|
|
|
|
|
|
Widget* w;
|
|
|
|
|
|
|
|
w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON));
|
|
|
|
w->show();
|
2009-06-21 15:59:56 -04:00
|
|
|
route_group_add_button->add (*w);
|
2006-03-09 23:05:11 -05:00
|
|
|
|
|
|
|
w = manage (new Image (Stock::REMOVE, ICON_SIZE_BUTTON));
|
|
|
|
w->show();
|
2009-06-21 15:59:56 -04:00
|
|
|
route_group_remove_button->add (*w);
|
2006-02-14 14:12:35 -05:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
route_group_display_button_box->set_homogeneous (true);
|
2006-05-19 13:29:05 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
route_group_add_button->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_route_group));
|
|
|
|
route_group_remove_button->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::remove_selected_route_group));
|
2006-03-09 18:44:39 -05:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
route_group_display_button_box->add (*route_group_add_button);
|
2010-07-19 19:26:40 -04:00
|
|
|
route_group_display_button_box->add (*route_group_remove_button);
|
2006-02-14 14:12:35 -05:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
group_display_vbox.pack_start (group_display_scroller, true, true);
|
2009-06-21 15:59:56 -04:00
|
|
|
group_display_vbox.pack_start (*route_group_display_button_box, false, false);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
group_display_frame.set_name ("BaseFrame");
|
|
|
|
group_display_frame.set_shadow_type (Gtk::SHADOW_IN);
|
|
|
|
group_display_frame.add (group_display_vbox);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-05-19 13:29:05 -04:00
|
|
|
rhs_pane1.pack1 (track_display_frame);
|
|
|
|
rhs_pane1.pack2 (group_display_frame);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
list_vpacker.pack_start (rhs_pane1, true, true);
|
|
|
|
|
|
|
|
global_hpacker.pack_start (scroller, true, true);
|
2008-10-22 02:41:51 -04:00
|
|
|
#ifdef GTKOSX
|
|
|
|
/* current gtk-quartz has dirty updates on borders like this one */
|
|
|
|
global_hpacker.pack_start (out_packer, false, false, 0);
|
|
|
|
#else
|
2006-11-16 14:34:57 -05:00
|
|
|
global_hpacker.pack_start (out_packer, false, false, 12);
|
2008-10-22 02:41:51 -04:00
|
|
|
#endif
|
2015-10-14 14:24:17 -04:00
|
|
|
list_hpane.pack1(list_vpacker, false, true);
|
2011-08-16 10:45:19 -04:00
|
|
|
list_hpane.pack2(global_hpacker, true, false);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
rhs_pane1.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::pane_allocation_handler),
|
2005-10-05 09:48:09 -04:00
|
|
|
static_cast<Gtk::Paned*> (&rhs_pane1)));
|
2009-12-11 18:29:48 -05:00
|
|
|
list_hpane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::pane_allocation_handler),
|
2005-10-05 09:48:09 -04:00
|
|
|
static_cast<Gtk::Paned*> (&list_hpane)));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
global_vpacker.pack_start (list_hpane, true, true);
|
|
|
|
|
|
|
|
add (global_vpacker);
|
|
|
|
set_name ("MixerWindow");
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
update_title ();
|
2007-04-11 09:07:51 -04:00
|
|
|
|
2010-08-16 20:28:20 -04:00
|
|
|
set_wmclass (X_("ardour_mixer"), PROGRAM_NAME);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
signal_delete_event().connect (sigc::mem_fun (*this, &Mixer_UI::hide_window));
|
2005-09-25 16:33:00 -04:00
|
|
|
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
signal_configure_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
route_group_display_button_box->show();
|
|
|
|
route_group_add_button->show();
|
|
|
|
route_group_remove_button->show();
|
2007-07-10 15:11:59 -04:00
|
|
|
|
|
|
|
global_hpacker.show();
|
|
|
|
global_vpacker.show();
|
|
|
|
scroller.show();
|
|
|
|
scroller_base.show();
|
|
|
|
scroller_hpacker.show();
|
|
|
|
mixer_scroller_vpacker.show();
|
|
|
|
list_vpacker.show();
|
|
|
|
group_display_button_label.show();
|
|
|
|
group_display_button.show();
|
|
|
|
group_display_scroller.show();
|
|
|
|
group_display_vbox.show();
|
|
|
|
group_display_frame.show();
|
|
|
|
rhs_pane1.show();
|
|
|
|
strip_packer.show();
|
|
|
|
out_packer.show();
|
|
|
|
list_hpane.show();
|
|
|
|
group_display.show();
|
2008-04-11 10:06:50 -04:00
|
|
|
|
2012-04-25 08:58:19 -04:00
|
|
|
MixerStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::remove_strip, this, _1), gui_context());
|
2009-11-15 20:06:33 -05:00
|
|
|
|
2010-02-03 14:00:58 -05:00
|
|
|
#ifndef DEFER_PLUGIN_SELECTOR_LOAD
|
2011-11-14 12:41:29 -05:00
|
|
|
_plugin_selector = new PluginSelector (PluginManager::instance ());
|
2010-02-03 14:00:58 -05:00
|
|
|
#endif
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
Mixer_UI::~Mixer_UI ()
|
|
|
|
{
|
2012-01-17 20:30:44 -05:00
|
|
|
if (_monitor_section) {
|
|
|
|
delete _monitor_section;
|
|
|
|
}
|
2015-09-12 14:05:46 -04:00
|
|
|
delete _plugin_selector;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2011-11-15 14:33:09 -05:00
|
|
|
void
|
|
|
|
Mixer_UI::track_editor_selection ()
|
|
|
|
{
|
|
|
|
PublicEditor::instance().get_selection().TracksChanged.connect (sigc::mem_fun (*this, &Mixer_UI::follow_editor_selection));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::ensure_float (Window& win)
|
|
|
|
{
|
|
|
|
win.set_transient_for (*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::show_window ()
|
|
|
|
{
|
2007-07-10 15:11:59 -04:00
|
|
|
present ();
|
2008-10-19 03:55:42 -04:00
|
|
|
if (!_visible) {
|
|
|
|
set_window_pos_and_size ();
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2011-02-21 19:11:32 -05:00
|
|
|
/* show/hide group tabs as required */
|
|
|
|
parameter_changed ("show-group-tabs");
|
|
|
|
|
2008-10-19 03:55:42 -04:00
|
|
|
/* now reset each strips width so the right widgets are shown */
|
|
|
|
MixerStrip* ms;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-10-19 03:55:42 -04:00
|
|
|
TreeModel::Children rows = track_model->children();
|
|
|
|
TreeModel::Children::iterator ri;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-10-19 03:55:42 -04:00
|
|
|
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
|
|
|
ms = (*ri)[track_columns.strip];
|
2009-06-20 13:15:33 -04:00
|
|
|
ms->set_width_enum (ms->get_width_enum (), ms->width_owner());
|
2011-10-29 16:08:48 -04:00
|
|
|
/* Fix visibility of mixer strip stuff */
|
2014-07-28 16:55:20 -04:00
|
|
|
ms->parameter_changed (X_("mixer-element-visibility"));
|
2008-10-19 03:55:42 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
/* force focus into main area */
|
|
|
|
scroller_base.grab_focus ();
|
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
_visible = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Mixer_UI::hide_window (GdkEventAny *ev)
|
|
|
|
{
|
2007-07-17 22:27:07 -04:00
|
|
|
get_window_pos_and_size ();
|
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
_visible = false;
|
|
|
|
return just_hide_it(ev, static_cast<Gtk::Window *>(this));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2012-06-27 18:57:06 -04:00
|
|
|
Mixer_UI::add_strips (RouteList& routes)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2013-10-23 10:27:13 -04:00
|
|
|
bool from_scratch = track_model->children().size() == 0;
|
|
|
|
Gtk::TreeModel::Children::iterator insert_iter = track_model->children().end();
|
|
|
|
|
|
|
|
for (Gtk::TreeModel::Children::iterator it = track_model->children().begin(); it != track_model->children().end(); ++it) {
|
|
|
|
boost::shared_ptr<Route> r = (*it)[track_columns.route];
|
|
|
|
|
|
|
|
if (r->order_key() == (routes.front()->order_key() + routes.size())) {
|
|
|
|
insert_iter = it;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!from_scratch) {
|
|
|
|
_selection.clear_routes ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
MixerStrip* strip;
|
2005-11-29 17:48:54 -05:00
|
|
|
|
2012-12-04 09:32:28 -05:00
|
|
|
try {
|
|
|
|
no_track_list_redisplay = true;
|
|
|
|
track_display.set_model (Glib::RefPtr<ListStore>());
|
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
for (RouteList::iterator x = routes.begin(); x != routes.end(); ++x) {
|
|
|
|
boost::shared_ptr<Route> route = (*x);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2013-04-06 16:04:02 -04:00
|
|
|
if (route->is_auditioner()) {
|
2012-06-27 18:57:06 -04:00
|
|
|
continue;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (route->is_monitor()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (!_monitor_section) {
|
|
|
|
_monitor_section = new MonitorSection (_session);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
XMLNode* mnode = ARDOUR_UI::instance()->tearoff_settings (X_("monitor-section"));
|
|
|
|
if (mnode) {
|
|
|
|
_monitor_section->tearoff().set_state (*mnode);
|
|
|
|
}
|
2015-10-04 14:51:05 -04:00
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
out_packer.pack_end (_monitor_section->tearoff(), false, false);
|
|
|
|
_monitor_section->set_session (_session);
|
|
|
|
_monitor_section->tearoff().show_all ();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
route->DropReferences.connect (*this, invalidator(*this), boost::bind (&Mixer_UI::monitor_section_going_away, this), gui_context());
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
/* no regular strip shown for control out */
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
continue;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
strip = new MixerStrip (*this, _session, route);
|
|
|
|
strips.push_back (strip);
|
2012-12-04 09:32:28 -05:00
|
|
|
|
2015-01-02 09:44:54 -05:00
|
|
|
UIConfiguration::instance().get_default_narrow_ms() ? _strip_width = Narrow : _strip_width = Wide;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (strip->width_owner() != strip) {
|
|
|
|
strip->set_width_enum (_strip_width, this);
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
show_strip (strip);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2013-10-23 10:27:13 -04:00
|
|
|
TreeModel::Row row = *(track_model->insert(insert_iter));
|
2012-06-27 18:57:06 -04:00
|
|
|
row[track_columns.text] = route->name();
|
|
|
|
row[track_columns.visible] = strip->route()->is_master() ? true : strip->marked_for_display();
|
|
|
|
row[track_columns.route] = route;
|
|
|
|
row[track_columns.strip] = strip;
|
2013-10-23 10:27:13 -04:00
|
|
|
|
|
|
|
if (!from_scratch) {
|
|
|
|
_selection.add (strip);
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
route->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context());
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
strip->WidthChanged.connect (sigc::mem_fun(*this, &Mixer_UI::strip_width_changed));
|
|
|
|
strip->signal_button_release_event().connect (sigc::bind (sigc::mem_fun(*this, &Mixer_UI::strip_button_release_event), strip));
|
2007-04-29 18:39:21 -04:00
|
|
|
}
|
2012-12-04 09:32:28 -05:00
|
|
|
|
|
|
|
} catch (...) {
|
2006-08-16 22:12:20 -04:00
|
|
|
}
|
2008-12-08 13:16:12 -05:00
|
|
|
|
2012-12-04 09:32:28 -05:00
|
|
|
no_track_list_redisplay = false;
|
|
|
|
track_display.set_model (track_model);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
sync_order_keys_from_treeview ();
|
2008-12-08 13:16:12 -05:00
|
|
|
redisplay_track_list ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2014-07-24 23:49:33 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::deselect_all_strip_processors ()
|
|
|
|
{
|
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
(*i)->deselect_all_processors();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-28 12:35:41 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::select_none ()
|
|
|
|
{
|
2014-07-28 16:55:20 -04:00
|
|
|
_selection.clear_routes();
|
2014-07-28 12:35:41 -04:00
|
|
|
deselect_all_strip_processors();
|
|
|
|
}
|
|
|
|
|
2014-07-24 23:49:33 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::delete_processors ()
|
|
|
|
{
|
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
(*i)->delete_processors();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::remove_strip (MixerStrip* strip)
|
|
|
|
{
|
2009-12-25 16:06:52 -05:00
|
|
|
if (_session && _session->deletion_in_progress()) {
|
|
|
|
/* its all being taken care of */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2005-09-28 12:22:43 -04:00
|
|
|
TreeModel::Children::iterator ri;
|
2005-09-25 14:42:24 -04:00
|
|
|
list<MixerStrip *>::iterator i;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
if ((i = find (strips.begin(), strips.end(), strip)) != strips.end()) {
|
|
|
|
strips.erase (i);
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
2006-03-09 18:44:39 -05:00
|
|
|
if ((*ri)[track_columns.strip] == strip) {
|
2014-06-20 21:51:59 -04:00
|
|
|
PBD::Unwinder<bool> uw (_route_deletion_in_progress, true);
|
2006-03-09 18:44:39 -05:00
|
|
|
track_model->erase (ri);
|
2005-09-25 14:42:24 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
void
|
2012-07-19 18:35:43 -04:00
|
|
|
Mixer_UI::reset_remote_control_ids ()
|
|
|
|
{
|
2013-10-20 09:19:43 -04:00
|
|
|
if (Config->get_remote_model() == UserOrdered || !_session || _session->deletion_in_progress()) {
|
2012-07-19 18:35:43 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
TreeModel::Children rows = track_model->children();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
if (rows.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, "mixer resets remote control ids after remote model change\n");
|
|
|
|
|
|
|
|
TreeModel::Children::iterator ri;
|
|
|
|
bool rid_change = false;
|
|
|
|
uint32_t rid = 1;
|
|
|
|
uint32_t invisible_key = UINT32_MAX;
|
|
|
|
|
|
|
|
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
2015-03-16 14:00:09 -04:00
|
|
|
|
|
|
|
/* skip two special values */
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-03-16 14:00:09 -04:00
|
|
|
if (rid == Route::MasterBusRemoteControlID) {
|
|
|
|
rid++;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-03-16 14:00:09 -04:00
|
|
|
if (rid == Route::MonitorBusRemoteControlID) {
|
|
|
|
rid++;
|
|
|
|
}
|
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
|
|
|
bool visible = (*ri)[track_columns.visible];
|
|
|
|
|
|
|
|
if (!route->is_master() && !route->is_monitor()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
uint32_t new_rid = (visible ? rid : invisible_key--);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
if (new_rid != route->remote_control_id()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
route->set_remote_control_id_explicit (new_rid);
|
2012-07-19 18:35:43 -04:00
|
|
|
rid_change = true;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
if (visible) {
|
|
|
|
rid++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rid_change) {
|
|
|
|
/* tell the world that we changed the remote control IDs */
|
|
|
|
_session->notify_remote_id_change ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::sync_order_keys_from_treeview ()
|
2007-10-11 18:07:47 -04:00
|
|
|
{
|
2012-06-27 18:57:06 -04:00
|
|
|
if (ignore_reorder || !_session || _session->deletion_in_progress()) {
|
|
|
|
return;
|
|
|
|
}
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (rows.empty()) {
|
2007-10-11 18:07:47 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync order keys from model\n");
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
TreeModel::Children::iterator ri;
|
2008-12-08 13:16:12 -05:00
|
|
|
bool changed = false;
|
2012-07-19 18:35:43 -04:00
|
|
|
bool rid_change = false;
|
2012-06-27 18:57:06 -04:00
|
|
|
uint32_t order = 0;
|
2012-07-19 18:35:43 -04:00
|
|
|
uint32_t rid = 1;
|
|
|
|
uint32_t invisible_key = UINT32_MAX;
|
2008-12-08 13:16:12 -05:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
for (ri = rows.begin(); ri != rows.end(); ++ri) {
|
2007-10-11 18:07:47 -04:00
|
|
|
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
2012-07-19 18:35:43 -04:00
|
|
|
bool visible = (*ri)[track_columns.visible];
|
|
|
|
|
2013-10-20 09:19:43 -04:00
|
|
|
uint32_t old_key = route->order_key ();
|
2008-12-08 13:16:12 -05:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
if (order != old_key) {
|
2013-10-20 09:19:43 -04:00
|
|
|
route->set_order_key (order);
|
2008-12-08 13:16:12 -05:00
|
|
|
changed = true;
|
|
|
|
}
|
2012-07-19 18:35:43 -04:00
|
|
|
|
|
|
|
if ((Config->get_remote_model() == MixerOrdered) && !route->is_master() && !route->is_monitor()) {
|
|
|
|
|
|
|
|
uint32_t new_rid = (visible ? rid : invisible_key--);
|
|
|
|
|
|
|
|
if (new_rid != route->remote_control_id()) {
|
2015-10-05 10:17:49 -04:00
|
|
|
route->set_remote_control_id_explicit (new_rid);
|
2012-07-19 18:35:43 -04:00
|
|
|
rid_change = true;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
if (visible) {
|
|
|
|
rid++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
++order;
|
2012-06-27 18:57:06 -04:00
|
|
|
}
|
2012-07-19 18:35:43 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (changed) {
|
|
|
|
/* tell everyone that we changed the mixer sort keys */
|
2013-10-20 09:19:43 -04:00
|
|
|
_session->sync_order_keys ();
|
2012-06-27 18:57:06 -04:00
|
|
|
}
|
2012-07-19 18:35:43 -04:00
|
|
|
|
|
|
|
if (rid_change) {
|
|
|
|
/* tell the world that we changed the remote control IDs */
|
|
|
|
_session->notify_remote_id_change ();
|
|
|
|
}
|
2012-06-27 18:57:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-10-20 09:19:43 -04:00
|
|
|
Mixer_UI::sync_treeview_from_order_keys ()
|
2012-06-27 18:57:06 -04:00
|
|
|
{
|
|
|
|
if (!_session || _session->deletion_in_progress()) {
|
|
|
|
return;
|
2007-10-11 18:07:47 -04:00
|
|
|
}
|
2009-11-16 16:07:16 -05:00
|
|
|
|
2013-10-20 09:19:43 -04:00
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync model from order keys.\n");
|
2009-10-22 20:05:50 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
/* we could get here after either a change in the Mixer or Editor sort
|
|
|
|
* order, but either way, the mixer order keys reflect the intended
|
|
|
|
* order for the GUI, so reorder the treeview model to match it.
|
|
|
|
*/
|
|
|
|
|
2009-10-22 20:05:50 -04:00
|
|
|
vector<int> neworder;
|
2012-06-27 18:57:06 -04:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2012-07-19 18:35:43 -04:00
|
|
|
uint32_t old_order = 0;
|
2012-06-28 18:27:37 -04:00
|
|
|
bool changed = false;
|
2012-06-27 18:57:06 -04:00
|
|
|
|
|
|
|
if (rows.empty()) {
|
|
|
|
return;
|
2009-10-22 20:05:50 -04:00
|
|
|
}
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2012-10-26 20:15:45 -04:00
|
|
|
OrderKeySortedRoutes sorted_routes;
|
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
|
2012-06-27 18:57:06 -04:00
|
|
|
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
|
2013-10-20 09:19:43 -04:00
|
|
|
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key ()));
|
2012-10-26 20:15:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SortByNewDisplayOrder cmp;
|
|
|
|
|
|
|
|
sort (sorted_routes.begin(), sorted_routes.end(), cmp);
|
|
|
|
neworder.assign (sorted_routes.size(), 0);
|
|
|
|
|
|
|
|
uint32_t n = 0;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-10-26 20:15:45 -04:00
|
|
|
for (OrderKeySortedRoutes::iterator sr = sorted_routes.begin(); sr != sorted_routes.end(); ++sr, ++n) {
|
2012-06-28 18:27:37 -04:00
|
|
|
|
2012-10-26 20:15:45 -04:00
|
|
|
neworder[n] = sr->old_display_order;
|
2012-06-28 18:27:37 -04:00
|
|
|
|
2012-10-26 20:15:45 -04:00
|
|
|
if (sr->old_display_order != n) {
|
2012-06-28 18:27:37 -04:00
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("MIXER change order for %1 from %2 to %3\n",
|
2012-10-26 20:15:45 -04:00
|
|
|
sr->route->name(), sr->old_display_order, n));
|
2012-06-27 18:57:06 -04:00
|
|
|
}
|
|
|
|
|
2012-06-28 18:27:37 -04:00
|
|
|
if (changed) {
|
2012-06-27 18:57:06 -04:00
|
|
|
Unwinder<bool> uw (ignore_reorder, true);
|
2008-12-08 13:16:12 -05:00
|
|
|
track_model->reorder (neworder);
|
|
|
|
}
|
2012-06-27 18:57:06 -04:00
|
|
|
|
|
|
|
redisplay_track_list ();
|
2007-10-11 18:07:47 -04:00
|
|
|
}
|
|
|
|
|
2011-11-15 14:33:09 -05:00
|
|
|
void
|
|
|
|
Mixer_UI::follow_editor_selection ()
|
|
|
|
{
|
2015-04-13 21:55:17 -04:00
|
|
|
if (_following_editor_selection) {
|
2011-11-15 14:33:09 -05:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
_following_editor_selection = true;
|
|
|
|
_selection.block_routes_changed (true);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-15 14:33:09 -05:00
|
|
|
TrackSelection& s (PublicEditor::instance().get_selection().tracks);
|
|
|
|
|
|
|
|
_selection.clear_routes ();
|
|
|
|
|
|
|
|
for (TrackViewList::iterator i = s.begin(); i != s.end(); ++i) {
|
|
|
|
RouteTimeAxisView* rtav = dynamic_cast<RouteTimeAxisView*> (*i);
|
|
|
|
if (rtav) {
|
|
|
|
MixerStrip* ms = strip_by_route (rtav->route());
|
|
|
|
if (ms) {
|
|
|
|
_selection.add (ms);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_following_editor_selection = false;
|
|
|
|
_selection.block_routes_changed (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
MixerStrip*
|
|
|
|
Mixer_UI::strip_by_route (boost::shared_ptr<Route> r)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
2011-11-04 13:53:21 -04:00
|
|
|
if ((*i)->route() == r) {
|
|
|
|
return (*i);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2011-11-04 13:53:21 -04:00
|
|
|
|
|
|
|
return 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
bool
|
2005-09-25 14:42:24 -04:00
|
|
|
Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
|
|
|
|
{
|
|
|
|
if (ev->button == 1) {
|
2011-11-04 13:53:21 -04:00
|
|
|
if (_selection.selected (strip)) {
|
|
|
|
/* primary-click: toggle selection state of strip */
|
|
|
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
|
|
|
_selection.remove (strip);
|
2015-05-03 15:34:17 -04:00
|
|
|
} else if (_selection.routes.size() > 1) {
|
|
|
|
/* de-select others */
|
|
|
|
_selection.set (strip);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2011-11-04 13:53:21 -04:00
|
|
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
|
|
|
|
_selection.add (strip);
|
|
|
|
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::RangeSelectModifier)) {
|
|
|
|
|
|
|
|
if (!_selection.selected(strip)) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
/* extend selection */
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
vector<MixerStrip*> tmp;
|
|
|
|
bool accumulate = false;
|
2014-11-19 18:27:13 -05:00
|
|
|
bool found_another = false;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
tmp.push_back (strip);
|
|
|
|
|
|
|
|
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
if ((*i) == strip) {
|
2015-10-04 14:51:05 -04:00
|
|
|
/* hit clicked strip, start accumulating till we hit the first
|
2011-11-04 13:53:21 -04:00
|
|
|
selected strip
|
|
|
|
*/
|
|
|
|
if (accumulate) {
|
|
|
|
/* done */
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
accumulate = true;
|
|
|
|
}
|
|
|
|
} else if (_selection.selected (*i)) {
|
|
|
|
/* hit selected strip. if currently accumulating others,
|
|
|
|
we're done. if not accumulating others, start doing so.
|
|
|
|
*/
|
2014-11-19 18:27:13 -05:00
|
|
|
found_another = true;
|
2011-11-04 13:53:21 -04:00
|
|
|
if (accumulate) {
|
|
|
|
/* done */
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
accumulate = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (accumulate) {
|
|
|
|
tmp.push_back (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-19 18:27:13 -05:00
|
|
|
if (found_another) {
|
|
|
|
for (vector<MixerStrip*>::iterator i = tmp.begin(); i != tmp.end(); ++i) {
|
|
|
|
_selection.add (*i);
|
|
|
|
}
|
|
|
|
} else
|
|
|
|
_selection.set (strip); //user wants to start a range selection, but there aren't any others selected yet
|
2011-11-04 13:53:21 -04:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
} else {
|
2011-11-04 13:53:21 -04:00
|
|
|
_selection.set (strip);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
return true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-12-17 13:24:23 -05:00
|
|
|
Mixer_UI::set_session (Session* sess)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
SessionHandlePtr::set_session (sess);
|
|
|
|
|
|
|
|
if (_plugin_selector) {
|
|
|
|
_plugin_selector->set_session (_session);
|
|
|
|
}
|
|
|
|
|
|
|
|
_group_tabs->set_session (sess);
|
|
|
|
|
|
|
|
if (!_session) {
|
|
|
|
return;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
XMLNode* node = ARDOUR_UI::instance()->mixer_settings();
|
|
|
|
set_state (*node);
|
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
update_title ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
initial_track_display ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
_session->RouteAdded.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::add_strips, this, _1), gui_context());
|
2012-04-25 08:58:19 -04:00
|
|
|
_session->route_group_added.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::add_route_group, this, _1), gui_context());
|
2010-03-30 11:18:43 -04:00
|
|
|
_session->route_group_removed.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::route_groups_changed, this), gui_context());
|
2011-04-19 11:46:47 -04:00
|
|
|
_session->route_groups_reordered.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::route_groups_changed, this), gui_context());
|
2012-04-25 08:58:19 -04:00
|
|
|
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::parameter_changed, this, _1), gui_context());
|
2011-09-07 11:07:02 -04:00
|
|
|
_session->DirtyChanged.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::update_title, this), gui_context());
|
2012-04-25 08:58:19 -04:00
|
|
|
_session->StateSaved.connect (_session_connections, invalidator (*this), boost::bind (&Mixer_UI::update_title, this), gui_context());
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-04-25 08:58:19 -04:00
|
|
|
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::parameter_changed, this, _1), gui_context ());
|
2010-05-02 10:28:09 -04:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
route_groups_changed ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
if (_visible) {
|
2010-02-03 14:00:58 -05:00
|
|
|
show_window();
|
2006-08-30 16:48:16 -04:00
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
start_updating ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-12-17 13:24:23 -05:00
|
|
|
Mixer_UI::session_going_away ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2011-04-19 21:24:40 -04:00
|
|
|
ENSURE_GUI_THREAD (*this, &Mixer_UI::session_going_away);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-04-19 21:24:40 -04:00
|
|
|
_in_group_rebuild_or_clear = true;
|
2006-03-09 18:44:39 -05:00
|
|
|
group_model->clear ();
|
2011-04-19 21:24:40 -04:00
|
|
|
_in_group_rebuild_or_clear = false;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2007-04-11 09:07:51 -04:00
|
|
|
_selection.clear ();
|
2009-12-22 15:21:43 -05:00
|
|
|
track_model->clear ();
|
|
|
|
|
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
delete (*i);
|
|
|
|
}
|
2010-03-10 12:31:16 -05:00
|
|
|
|
2010-03-30 13:19:39 -04:00
|
|
|
if (_monitor_section) {
|
|
|
|
_monitor_section->tearoff().hide_visible ();
|
|
|
|
}
|
2010-03-18 22:49:01 -04:00
|
|
|
|
2009-12-23 23:04:01 -05:00
|
|
|
strips.clear ();
|
2007-04-11 09:07:51 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
stop_updating ();
|
2009-12-17 13:24:23 -05:00
|
|
|
|
|
|
|
SessionHandlePtr::session_going_away ();
|
2011-09-07 11:07:02 -04:00
|
|
|
|
|
|
|
_session = 0;
|
|
|
|
update_title ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::track_visibility_changed (std::string const & path)
|
|
|
|
{
|
|
|
|
if (_session && _session->deletion_in_progress()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
TreeIter iter;
|
|
|
|
|
|
|
|
if ((iter = track_model->get_iter (path))) {
|
|
|
|
MixerStrip* strip = (*iter)[track_columns.strip];
|
|
|
|
if (strip) {
|
|
|
|
bool visible = (*iter)[track_columns.visible];
|
|
|
|
|
|
|
|
if (strip->set_marked_for_display (!visible)) {
|
|
|
|
update_track_visibility ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::update_track_visibility ()
|
|
|
|
{
|
|
|
|
TreeModel::Children rows = track_model->children();
|
|
|
|
TreeModel::Children::iterator i;
|
|
|
|
|
|
|
|
{
|
|
|
|
Unwinder<bool> uw (no_track_list_redisplay, true);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
|
|
|
MixerStrip *strip = (*i)[track_columns.strip];
|
|
|
|
(*i)[track_columns.visible] = strip->marked_for_display ();
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
/* force route order keys catch up with visibility changes
|
|
|
|
*/
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-07-19 18:35:43 -04:00
|
|
|
sync_order_keys_from_treeview ();
|
|
|
|
}
|
|
|
|
|
|
|
|
redisplay_track_list ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2006-01-11 22:43:52 -05:00
|
|
|
Mixer_UI::show_strip (MixerStrip* ms)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-11-12 22:49:00 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2005-09-28 12:22:43 -04:00
|
|
|
TreeModel::Children::iterator i;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
MixerStrip* strip = (*i)[track_columns.strip];
|
2006-01-11 22:43:52 -05:00
|
|
|
if (strip == ms) {
|
2006-03-09 18:44:39 -05:00
|
|
|
(*i)[track_columns.visible] = true;
|
2012-07-09 15:26:22 -04:00
|
|
|
redisplay_track_list ();
|
2006-01-11 22:43:52 -05:00
|
|
|
break;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-01-11 22:43:52 -05:00
|
|
|
Mixer_UI::hide_strip (MixerStrip* ms)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-11-12 22:49:00 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2005-09-28 12:22:43 -04:00
|
|
|
TreeModel::Children::iterator i;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
MixerStrip* strip = (*i)[track_columns.strip];
|
2006-01-11 22:43:52 -05:00
|
|
|
if (strip == ms) {
|
2006-03-09 18:44:39 -05:00
|
|
|
(*i)[track_columns.visible] = false;
|
2012-07-09 15:26:22 -04:00
|
|
|
redisplay_track_list ();
|
2006-01-11 22:43:52 -05:00
|
|
|
break;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2006-11-12 22:49:00 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
Mixer_UI::start_updating ()
|
|
|
|
{
|
2014-12-25 10:02:00 -05:00
|
|
|
fast_screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &Mixer_UI::fast_update_strips));
|
2006-11-12 22:49:00 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
Mixer_UI::stop_updating ()
|
|
|
|
{
|
|
|
|
fast_screen_update_connection.disconnect();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::fast_update_strips ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (is_mapped () && _session) {
|
2006-11-12 22:49:00 -05:00
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
(*i)->fast_update ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-11-29 17:48:54 -05:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
void
|
|
|
|
Mixer_UI::set_all_strips_visibility (bool yn)
|
|
|
|
{
|
2006-11-12 22:49:00 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2006-01-11 22:43:52 -05:00
|
|
|
TreeModel::Children::iterator i;
|
2005-11-29 17:48:54 -05:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
{
|
|
|
|
Unwinder<bool> uw (no_track_list_redisplay, true);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
TreeModel::Row row = (*i);
|
|
|
|
MixerStrip* strip = row[track_columns.strip];
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (strip == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (strip->route()->is_master() || strip->route()->is_monitor()) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
(*i)[track_columns.visible] = yn;
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
}
|
2005-11-29 17:48:54 -05:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
redisplay_track_list ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2015-07-10 05:11:44 -04:00
|
|
|
Mixer_UI::set_all_audio_midi_visibility (int tracks, bool yn)
|
2006-01-11 22:43:52 -05:00
|
|
|
{
|
2009-10-22 18:38:53 -04:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2006-01-11 22:43:52 -05:00
|
|
|
TreeModel::Children::iterator i;
|
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
{
|
|
|
|
Unwinder<bool> uw (no_track_list_redisplay, true);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
|
|
|
TreeModel::Row row = (*i);
|
|
|
|
MixerStrip* strip = row[track_columns.strip];
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (strip == 0) {
|
|
|
|
continue;
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
if (strip->route()->is_master() || strip->route()->is_monitor()) {
|
|
|
|
continue;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
boost::shared_ptr<AudioTrack> at = strip->audio_track();
|
2015-07-10 05:11:44 -04:00
|
|
|
boost::shared_ptr<MidiTrack> mt = strip->midi_track();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
switch (tracks) {
|
|
|
|
case 0:
|
2006-03-09 18:44:39 -05:00
|
|
|
(*i)[track_columns.visible] = yn;
|
2012-06-27 18:57:06 -04:00
|
|
|
break;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
case 1:
|
|
|
|
if (at) { /* track */
|
|
|
|
(*i)[track_columns.visible] = yn;
|
|
|
|
}
|
|
|
|
break;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
case 2:
|
2015-07-10 05:11:44 -04:00
|
|
|
if (!at && !mt) { /* bus */
|
|
|
|
(*i)[track_columns.visible] = yn;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
if (mt) { /* midi-track */
|
2012-06-27 18:57:06 -04:00
|
|
|
(*i)[track_columns.visible] = yn;
|
|
|
|
}
|
|
|
|
break;
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
redisplay_track_list ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::hide_all_routes ()
|
|
|
|
{
|
|
|
|
set_all_strips_visibility (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::show_all_routes ()
|
|
|
|
{
|
|
|
|
set_all_strips_visibility (true);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::show_all_audiobus ()
|
|
|
|
{
|
2015-07-10 05:11:44 -04:00
|
|
|
set_all_audio_midi_visibility (2, true);
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
void
|
|
|
|
Mixer_UI::hide_all_audiobus ()
|
|
|
|
{
|
2015-07-10 05:11:44 -04:00
|
|
|
set_all_audio_midi_visibility (2, false);
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::show_all_audiotracks()
|
|
|
|
{
|
2015-07-10 05:11:44 -04:00
|
|
|
set_all_audio_midi_visibility (1, true);
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
void
|
|
|
|
Mixer_UI::hide_all_audiotracks ()
|
|
|
|
{
|
2015-07-10 05:11:44 -04:00
|
|
|
set_all_audio_midi_visibility (1, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::show_all_miditracks()
|
|
|
|
{
|
|
|
|
set_all_audio_midi_visibility (3, true);
|
|
|
|
}
|
|
|
|
void
|
|
|
|
Mixer_UI::hide_all_miditracks ()
|
|
|
|
{
|
|
|
|
set_all_audio_midi_visibility (3, false);
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
|
2015-07-10 05:11:44 -04:00
|
|
|
|
2007-10-11 18:07:47 -04:00
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
Mixer_UI::track_list_reorder (const TreeModel::Path&, const TreeModel::iterator&, int* /*new_order*/)
|
2007-10-11 18:07:47 -04:00
|
|
|
{
|
2012-06-27 18:57:06 -04:00
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview reordered\n");
|
2012-07-19 18:35:43 -04:00
|
|
|
sync_order_keys_from_treeview ();
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
Mixer_UI::track_list_delete (const Gtk::TreeModel::Path&)
|
2006-01-11 22:43:52 -05:00
|
|
|
{
|
2012-06-27 18:57:06 -04:00
|
|
|
/* this happens as the second step of a DnD within the treeview as well
|
|
|
|
as when a row/route is actually deleted.
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2014-06-20 21:51:59 -04:00
|
|
|
if it was a deletion then we have to force a redisplay because
|
|
|
|
order keys may not have changed.
|
2012-06-27 18:57:06 -04:00
|
|
|
*/
|
2014-06-20 21:51:59 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
DEBUG_TRACE (DEBUG::OrderKeys, "mixer UI treeview row deleted\n");
|
2012-07-19 18:35:43 -04:00
|
|
|
sync_order_keys_from_treeview ();
|
2014-06-20 21:51:59 -04:00
|
|
|
|
|
|
|
if (_route_deletion_in_progress) {
|
|
|
|
redisplay_track_list ();
|
|
|
|
}
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::redisplay_track_list ()
|
|
|
|
{
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2006-01-11 22:43:52 -05:00
|
|
|
TreeModel::Children::iterator i;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
if (no_track_list_redisplay) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-06-25 08:46:13 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
MixerStrip* strip = (*i)[track_columns.strip];
|
2006-01-11 22:43:52 -05:00
|
|
|
|
2006-01-17 11:40:57 -05:00
|
|
|
if (strip == 0) {
|
|
|
|
/* we're in the middle of changing a row, don't worry */
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2011-07-12 07:02:12 -04:00
|
|
|
bool const visible = (*i)[track_columns.visible];
|
2006-01-11 22:43:52 -05:00
|
|
|
|
|
|
|
if (visible) {
|
2011-07-11 16:32:33 -04:00
|
|
|
strip->set_gui_property ("visible", true);
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
if (strip->packed()) {
|
|
|
|
|
2010-03-23 08:19:21 -04:00
|
|
|
if (strip->route()->is_master() || strip->route()->is_monitor()) {
|
2006-01-11 22:43:52 -05:00
|
|
|
out_packer.reorder_child (*strip, -1);
|
2012-06-25 08:46:13 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
} else {
|
|
|
|
strip_packer.reorder_child (*strip, -1); /* put at end */
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
2010-03-23 08:19:21 -04:00
|
|
|
if (strip->route()->is_master() || strip->route()->is_monitor()) {
|
2006-01-11 22:43:52 -05:00
|
|
|
out_packer.pack_start (*strip, false, false);
|
|
|
|
} else {
|
|
|
|
strip_packer.pack_start (*strip, false, false);
|
|
|
|
}
|
|
|
|
strip->set_packed (true);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
2011-07-11 16:32:33 -04:00
|
|
|
strip->set_gui_property ("visible", false);
|
2009-06-21 12:58:57 -04:00
|
|
|
|
2010-03-23 08:19:21 -04:00
|
|
|
if (strip->route()->is_master() || strip->route()->is_monitor()) {
|
2006-01-11 22:43:52 -05:00
|
|
|
/* do nothing, these cannot be hidden */
|
|
|
|
} else {
|
2007-04-11 09:07:51 -04:00
|
|
|
if (strip->packed()) {
|
|
|
|
strip_packer.remove (*strip);
|
|
|
|
strip->set_packed (false);
|
|
|
|
}
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
_group_tabs->set_dirty ();
|
2008-04-11 10:06:50 -04:00
|
|
|
}
|
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
void
|
2009-06-23 19:05:14 -04:00
|
|
|
Mixer_UI::strip_width_changed ()
|
2008-12-12 09:43:24 -05:00
|
|
|
{
|
2009-06-23 19:05:14 -04:00
|
|
|
_group_tabs->set_dirty ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-23 19:05:14 -04:00
|
|
|
#ifdef GTKOSX
|
2008-12-12 09:43:24 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
|
|
|
TreeModel::Children::iterator i;
|
|
|
|
long order;
|
|
|
|
|
|
|
|
for (order = 0, i = rows.begin(); i != rows.end(); ++i, ++order) {
|
|
|
|
MixerStrip* strip = (*i)[track_columns.strip];
|
|
|
|
|
|
|
|
if (strip == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool visible = (*i)[track_columns.visible];
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
if (visible) {
|
|
|
|
strip->queue_draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-23 19:05:14 -04:00
|
|
|
}
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
void
|
|
|
|
Mixer_UI::initial_track_display ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
boost::shared_ptr<RouteList> routes = _session->get_routes();
|
2009-01-30 02:40:13 -05:00
|
|
|
RouteList copy (*routes);
|
2014-06-23 19:36:07 -04:00
|
|
|
ARDOUR::SignalOrderRouteSorter sorter;
|
2006-01-11 22:43:52 -05:00
|
|
|
|
2006-07-27 12:52:14 -04:00
|
|
|
copy.sort (sorter);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
{
|
|
|
|
Unwinder<bool> uw1 (no_track_list_redisplay, true);
|
|
|
|
Unwinder<bool> uw2 (ignore_reorder, true);
|
2006-01-11 22:43:52 -05:00
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
track_model->clear ();
|
|
|
|
add_strips (copy);
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2013-10-20 09:19:43 -04:00
|
|
|
_session->sync_order_keys ();
|
2006-01-11 22:43:52 -05:00
|
|
|
|
|
|
|
redisplay_track_list ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2006-01-11 22:43:52 -05:00
|
|
|
Mixer_UI::show_track_list_menu ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
if (track_menu == 0) {
|
|
|
|
build_track_menu ();
|
|
|
|
}
|
|
|
|
|
2006-11-21 19:58:22 -05:00
|
|
|
track_menu->popup (1, gtk_get_current_event_time());
|
2006-01-11 22:43:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Mixer_UI::track_display_button_press (GdkEventButton* ev)
|
|
|
|
{
|
|
|
|
if (Keyboard::is_context_menu_event (ev)) {
|
|
|
|
show_track_list_menu ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::build_track_menu ()
|
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
using namespace Gtk;
|
|
|
|
|
|
|
|
track_menu = new Menu;
|
|
|
|
track_menu->set_name ("ArdourContextMenu");
|
|
|
|
MenuList& items = track_menu->items();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
items.push_back (MenuElem (_("Show All"), sigc::mem_fun(*this, &Mixer_UI::show_all_routes)));
|
|
|
|
items.push_back (MenuElem (_("Hide All"), sigc::mem_fun(*this, &Mixer_UI::hide_all_routes)));
|
|
|
|
items.push_back (MenuElem (_("Show All Audio Tracks"), sigc::mem_fun(*this, &Mixer_UI::show_all_audiotracks)));
|
|
|
|
items.push_back (MenuElem (_("Hide All Audio Tracks"), sigc::mem_fun(*this, &Mixer_UI::hide_all_audiotracks)));
|
|
|
|
items.push_back (MenuElem (_("Show All Audio Busses"), sigc::mem_fun(*this, &Mixer_UI::show_all_audiobus)));
|
|
|
|
items.push_back (MenuElem (_("Hide All Audio Busses"), sigc::mem_fun(*this, &Mixer_UI::hide_all_audiobus)));
|
2015-07-10 05:11:44 -04:00
|
|
|
items.push_back (MenuElem (_("Show All Midi Tracks"), sigc::mem_fun (*this, &Mixer_UI::show_all_miditracks)));
|
|
|
|
items.push_back (MenuElem (_("Hide All Midi Tracks"), sigc::mem_fun (*this, &Mixer_UI::hide_all_miditracks)));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-02-19 13:09:08 -05:00
|
|
|
Mixer_UI::strip_property_changed (const PropertyChange& what_changed, MixerStrip* mx)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2010-02-19 13:09:08 -05:00
|
|
|
if (!what_changed.contains (ARDOUR::Properties::name)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ENSURE_GUI_THREAD (*this, &Mixer_UI::strip_name_changed, what_changed, mx)
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeModel::Children rows = track_model->children();
|
2005-10-01 12:29:37 -04:00
|
|
|
TreeModel::Children::iterator i;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
2006-03-09 18:44:39 -05:00
|
|
|
if ((*i)[track_columns.strip] == mx) {
|
2006-07-27 12:52:14 -04:00
|
|
|
(*i)[track_columns.text] = mx->route()->name();
|
2005-10-01 12:29:37 -04:00
|
|
|
return;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
error << _("track display list item for renamed strip not found!") << endmsg;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
bool
|
|
|
|
Mixer_UI::group_display_button_press (GdkEventButton* ev)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-10-01 12:29:37 -04:00
|
|
|
TreeModel::Path path;
|
|
|
|
TreeViewColumn* column;
|
|
|
|
int cellx;
|
|
|
|
int celly;
|
|
|
|
|
|
|
|
if (!group_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
2015-05-03 17:33:05 -04:00
|
|
|
_group_tabs->get_menu(0)->popup (1, ev->time);
|
|
|
|
return true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2006-03-09 18:44:39 -05:00
|
|
|
|
2010-07-19 19:26:40 -04:00
|
|
|
TreeIter iter = group_model->get_iter (path);
|
|
|
|
if (!iter) {
|
2015-05-03 17:33:05 -04:00
|
|
|
_group_tabs->get_menu(0)->popup (1, ev->time);
|
|
|
|
return true;
|
2010-07-19 19:26:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
RouteGroup* group = (*iter)[group_columns.group];
|
|
|
|
|
|
|
|
if (Keyboard::is_context_menu_event (ev)) {
|
|
|
|
_group_tabs->get_menu(group)->popup (1, ev->time);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2005-10-05 09:48:09 -04:00
|
|
|
switch (GPOINTER_TO_UINT (column->get_data (X_("colnum")))) {
|
2005-10-01 12:29:37 -04:00
|
|
|
case 0:
|
2006-02-14 14:12:35 -05:00
|
|
|
if (Keyboard::is_edit_event (ev)) {
|
2010-07-19 19:26:40 -04:00
|
|
|
if (group) {
|
|
|
|
// edit_route_group (group);
|
2008-12-12 09:43:24 -05:00
|
|
|
#ifdef GTKOSX
|
2010-07-19 19:26:40 -04:00
|
|
|
group_display.queue_draw();
|
2008-12-12 09:43:24 -05:00
|
|
|
#endif
|
2010-07-19 19:26:40 -04:00
|
|
|
return true;
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
}
|
2006-02-14 14:12:35 -05:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
2010-07-19 19:26:40 -04:00
|
|
|
{
|
|
|
|
bool visible = (*iter)[group_columns.visible];
|
|
|
|
(*iter)[group_columns.visible] = !visible;
|
2008-12-12 09:43:24 -05:00
|
|
|
#ifdef GTKOSX
|
2010-07-19 19:26:40 -04:00
|
|
|
group_display.queue_draw();
|
2008-12-12 09:43:24 -05:00
|
|
|
#endif
|
2010-07-19 19:26:40 -04:00
|
|
|
return true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::activate_all_route_groups ()
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->foreach_route_group (sigc::bind (sigc::mem_fun (*this, &Mixer_UI::set_route_group_activation), true));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::disable_all_route_groups ()
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->foreach_route_group (sigc::bind (sigc::mem_fun (*this, &Mixer_UI::set_route_group_activation), false));
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::route_groups_changed ()
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
2011-04-19 11:46:47 -04:00
|
|
|
ENSURE_GUI_THREAD (*this, &Mixer_UI::route_groups_changed);
|
|
|
|
|
2011-04-19 21:24:40 -04:00
|
|
|
_in_group_rebuild_or_clear = true;
|
2006-03-09 18:44:39 -05:00
|
|
|
|
|
|
|
/* just rebuild the while thing */
|
|
|
|
|
|
|
|
group_model->clear ();
|
|
|
|
|
2015-01-14 14:10:34 -05:00
|
|
|
#if 0
|
|
|
|
/* this is currently not used,
|
|
|
|
* Mixer_UI::group_display_button_press() has a case for it,
|
|
|
|
* and a commented edit_route_group() but that's n/a since 2011.
|
|
|
|
*
|
|
|
|
* This code is left as reminder that
|
|
|
|
* row[group_columns.group] = 0 has special meaning.
|
|
|
|
*/
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
|
|
|
TreeModel::Row row;
|
|
|
|
row = *(group_model->append());
|
|
|
|
row[group_columns.visible] = true;
|
|
|
|
row[group_columns.text] = (_("-all-"));
|
|
|
|
row[group_columns.group] = 0;
|
|
|
|
}
|
2015-01-14 14:10:34 -05:00
|
|
|
#endif
|
2006-03-09 18:44:39 -05:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->foreach_route_group (sigc::mem_fun (*this, &Mixer_UI::add_route_group));
|
2010-07-19 19:26:40 -04:00
|
|
|
|
|
|
|
_group_tabs->set_dirty ();
|
2011-04-19 21:24:40 -04:00
|
|
|
_in_group_rebuild_or_clear = false;
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::new_route_group ()
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
2010-07-19 19:26:40 -04:00
|
|
|
RouteList rl;
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-07-19 19:26:40 -04:00
|
|
|
_group_tabs->run_new_group_dialog (rl);
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::remove_selected_route_group ()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-10-05 09:48:09 -04:00
|
|
|
Glib::RefPtr<TreeSelection> selection = group_display.get_selection();
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeView::Selection::ListHandle_Path rows = selection->get_selected_rows ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
if (rows.empty()) {
|
|
|
|
return;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeView::Selection::ListHandle_Path::iterator i = rows.begin();
|
|
|
|
TreeIter iter;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
/* selection mode is single, so rows.begin() is it */
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
if ((iter = group_model->get_iter (*i))) {
|
|
|
|
|
|
|
|
RouteGroup* rg = (*iter)[group_columns.group];
|
|
|
|
|
|
|
|
if (rg) {
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->remove_route_group (*rg);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-04-01 20:21:08 -04:00
|
|
|
Mixer_UI::route_group_property_changed (RouteGroup* group, const PropertyChange& change)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2006-03-09 18:44:39 -05:00
|
|
|
if (in_group_row_change) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-04-11 09:07:51 -04:00
|
|
|
/* force an update of any mixer strips that are using this group,
|
2009-10-14 12:10:01 -04:00
|
|
|
otherwise mix group names don't change in mixer strips
|
2007-04-11 09:07:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
2009-06-21 15:59:56 -04:00
|
|
|
if ((*i)->route_group() == group) {
|
2009-12-09 22:25:32 -05:00
|
|
|
(*i)->route_group_changed();
|
2007-04-11 09:07:51 -04:00
|
|
|
}
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
TreeModel::iterator i;
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeModel::Children rows = group_model->children();
|
2006-01-11 22:43:52 -05:00
|
|
|
Glib::RefPtr<TreeSelection> selection = group_display.get_selection();
|
2006-03-09 18:44:39 -05:00
|
|
|
|
|
|
|
in_group_row_change = true;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
for (i = rows.begin(); i != rows.end(); ++i) {
|
2006-03-09 18:44:39 -05:00
|
|
|
if ((*i)[group_columns.group] == group) {
|
|
|
|
(*i)[group_columns.visible] = !group->is_hidden ();
|
|
|
|
(*i)[group_columns.text] = group->name ();
|
2005-10-01 12:29:37 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-03-09 18:44:39 -05:00
|
|
|
|
|
|
|
in_group_row_change = false;
|
2009-06-20 13:18:41 -04:00
|
|
|
|
2010-04-01 20:21:08 -04:00
|
|
|
if (change.contains (Properties::name)) {
|
|
|
|
_group_tabs->set_dirty ();
|
|
|
|
}
|
2011-04-05 20:36:36 -04:00
|
|
|
|
|
|
|
for (list<MixerStrip*>::iterator j = strips.begin(); j != strips.end(); ++j) {
|
|
|
|
if ((*j)->route_group() == group) {
|
|
|
|
if (group->is_hidden ()) {
|
|
|
|
hide_strip (*j);
|
|
|
|
} else {
|
|
|
|
show_strip (*j);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-09-14 12:51:02 -04:00
|
|
|
Mixer_UI::route_group_name_edit (const std::string& path, const std::string& new_text)
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
|
|
|
RouteGroup* group;
|
|
|
|
TreeIter iter;
|
|
|
|
|
|
|
|
if ((iter = group_model->get_iter (path))) {
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
if ((group = (*iter)[group_columns.group]) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
if (new_text != group->name()) {
|
|
|
|
group->set_name (new_text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
Mixer_UI::route_group_row_change (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator& iter)
|
2006-03-09 18:44:39 -05:00
|
|
|
{
|
|
|
|
RouteGroup* group;
|
|
|
|
|
|
|
|
if (in_group_row_change) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((group = (*iter)[group_columns.group]) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
std::string name = (*iter)[group_columns.text];
|
2006-03-09 18:44:39 -05:00
|
|
|
|
|
|
|
if (name != group->name()) {
|
|
|
|
group->set_name (name);
|
|
|
|
}
|
2008-04-11 10:06:50 -04:00
|
|
|
|
2011-04-05 20:36:36 -04:00
|
|
|
bool hidden = !(*iter)[group_columns.visible];
|
|
|
|
|
|
|
|
if (hidden != group->is_hidden ()) {
|
|
|
|
group->set_hidden (hidden, this);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2011-04-19 11:46:47 -04:00
|
|
|
/** Called when a group model row is deleted, but also when the model is
|
|
|
|
* reordered by a user drag-and-drop; the latter is what we are
|
|
|
|
* interested in here.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
Mixer_UI::route_group_row_deleted (Gtk::TreeModel::Path const &)
|
|
|
|
{
|
2011-04-19 21:24:40 -04:00
|
|
|
if (_in_group_rebuild_or_clear) {
|
2011-04-19 11:46:47 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Re-write the session's route group list so that the new order is preserved */
|
|
|
|
|
|
|
|
list<RouteGroup*> new_list;
|
|
|
|
|
|
|
|
Gtk::TreeModel::Children children = group_model->children();
|
|
|
|
for (Gtk::TreeModel::Children::iterator i = children.begin(); i != children.end(); ++i) {
|
|
|
|
RouteGroup* g = (*i)[group_columns.group];
|
|
|
|
if (g) {
|
|
|
|
new_list.push_back (g);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_session->reorder_route_groups (new_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2009-06-21 15:59:56 -04:00
|
|
|
Mixer_UI::add_route_group (RouteGroup* group)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &Mixer_UI::add_route_group, group)
|
2006-03-09 23:05:11 -05:00
|
|
|
bool focus = false;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-05-18 21:54:00 -04:00
|
|
|
in_group_row_change = true;
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
TreeModel::Row row = *(group_model->append());
|
2011-04-05 20:36:36 -04:00
|
|
|
row[group_columns.visible] = !group->is_hidden ();
|
2006-03-09 18:44:39 -05:00
|
|
|
row[group_columns.group] = group;
|
2006-03-09 23:05:11 -05:00
|
|
|
if (!group->name().empty()) {
|
|
|
|
row[group_columns.text] = group->name();
|
|
|
|
} else {
|
|
|
|
row[group_columns.text] = _("unnamed");
|
|
|
|
focus = true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2012-04-25 08:58:19 -04:00
|
|
|
group->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::route_group_property_changed, this, group, _1), gui_context());
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-03-09 23:05:11 -05:00
|
|
|
if (focus) {
|
2006-03-10 09:35:57 -05:00
|
|
|
TreeViewColumn* col = group_display.get_column (0);
|
|
|
|
CellRendererText* name_cell = dynamic_cast<CellRendererText*>(group_display.get_column_cell_renderer (0));
|
|
|
|
group_display.set_cursor (group_model->get_path (row), *col, *name_cell, true);
|
2006-03-09 23:05:11 -05:00
|
|
|
}
|
2006-05-18 21:54:00 -04:00
|
|
|
|
2010-07-19 17:47:07 -04:00
|
|
|
_group_tabs->set_dirty ();
|
|
|
|
|
2006-05-18 21:54:00 -04:00
|
|
|
in_group_row_change = false;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
bool
|
2005-09-25 14:42:24 -04:00
|
|
|
Mixer_UI::strip_scroller_button_release (GdkEventButton* ev)
|
|
|
|
{
|
|
|
|
using namespace Menu_Helpers;
|
|
|
|
|
|
|
|
if (Keyboard::is_context_menu_event (ev)) {
|
2007-04-11 09:07:51 -04:00
|
|
|
ARDOUR_UI::instance()->add_route (this);
|
2006-01-04 22:18:44 -05:00
|
|
|
return true;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
return false;
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2013-07-10 15:40:42 -04:00
|
|
|
Mixer_UI::set_strip_width (Width w, bool save)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
_strip_width = w;
|
|
|
|
|
|
|
|
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
2013-07-10 15:40:42 -04:00
|
|
|
(*i)->set_width_enum (w, save ? (*i)->width_owner() : this);
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::set_window_pos_and_size ()
|
|
|
|
{
|
|
|
|
resize (m_width, m_height);
|
|
|
|
move (m_root_x, m_root_y);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::get_window_pos_and_size ()
|
|
|
|
{
|
|
|
|
get_position(m_root_x, m_root_y);
|
|
|
|
get_size(m_width, m_height);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
int
|
|
|
|
Mixer_UI::set_state (const XMLNode& node)
|
|
|
|
{
|
|
|
|
const XMLProperty* prop;
|
|
|
|
XMLNode* geometry;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
m_width = default_width;
|
|
|
|
m_height = default_height;
|
|
|
|
m_root_x = 1;
|
|
|
|
m_root_y = 1;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
if ((geometry = find_named_node (node, "geometry")) != 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
XMLProperty* prop;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
if ((prop = geometry->property("x_size")) == 0) {
|
|
|
|
prop = geometry->property ("x-size");
|
|
|
|
}
|
|
|
|
if (prop) {
|
|
|
|
m_width = atoi(prop->value());
|
|
|
|
}
|
|
|
|
if ((prop = geometry->property("y_size")) == 0) {
|
|
|
|
prop = geometry->property ("y-size");
|
|
|
|
}
|
|
|
|
if (prop) {
|
|
|
|
m_height = atoi(prop->value());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
if ((prop = geometry->property ("x_pos")) == 0) {
|
|
|
|
prop = geometry->property ("x-pos");
|
|
|
|
}
|
|
|
|
if (prop) {
|
|
|
|
m_root_x = atoi (prop->value());
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
}
|
|
|
|
if ((prop = geometry->property ("y_pos")) == 0) {
|
|
|
|
prop = geometry->property ("y-pos");
|
|
|
|
}
|
|
|
|
if (prop) {
|
|
|
|
m_root_y = atoi (prop->value());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2006-01-17 11:40:57 -05:00
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
set_window_pos_and_size ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
if ((prop = node.property ("narrow-strips"))) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2005-09-25 14:42:24 -04:00
|
|
|
set_strip_width (Narrow);
|
|
|
|
} else {
|
|
|
|
set_strip_width (Wide);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
if ((prop = node.property ("show-mixer"))) {
|
2009-10-02 16:53:31 -04:00
|
|
|
if (string_is_affirmative (prop->value())) {
|
2006-08-30 16:48:16 -04:00
|
|
|
_visible = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-21 08:45:00 -04:00
|
|
|
if ((prop = node.property ("maximised"))) {
|
|
|
|
bool yn = string_is_affirmative (prop->value());
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleMaximalMixer"));
|
|
|
|
assert (act);
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
|
|
|
bool fs = tact && tact->get_active();
|
|
|
|
if (yn ^ fs) {
|
|
|
|
ActionManager::do_action ("Common",
|
|
|
|
"ToggleMaximalMixer");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLNode&
|
|
|
|
Mixer_UI::get_state (void)
|
|
|
|
{
|
|
|
|
XMLNode* node = new XMLNode ("Mixer");
|
|
|
|
|
|
|
|
if (is_realized()) {
|
2005-10-05 09:48:09 -04:00
|
|
|
Glib::RefPtr<Gdk::Window> win = get_window();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
get_window_pos_and_size ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
XMLNode* geometry = new XMLNode ("geometry");
|
|
|
|
char buf[32];
|
2007-07-17 22:27:07 -04:00
|
|
|
snprintf(buf, sizeof(buf), "%d", m_width);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("x_size"), string(buf));
|
2007-07-17 22:27:07 -04:00
|
|
|
snprintf(buf, sizeof(buf), "%d", m_height);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("y_size"), string(buf));
|
2007-07-17 22:27:07 -04:00
|
|
|
snprintf(buf, sizeof(buf), "%d", m_root_x);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("x_pos"), string(buf));
|
2007-07-17 22:27:07 -04:00
|
|
|
snprintf(buf, sizeof(buf), "%d", m_root_y);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("y_pos"), string(buf));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
// written only for compatibility, they are not used.
|
|
|
|
snprintf(buf, sizeof(buf), "%d", 0);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("x_off"), string(buf));
|
2007-07-17 22:27:07 -04:00
|
|
|
snprintf(buf, sizeof(buf), "%d", 0);
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("y_off"), string(buf));
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&rhs_pane1)->gobj()));
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("mixer_rhs_pane1_pos"), string(buf));
|
2005-09-25 16:33:00 -04:00
|
|
|
snprintf(buf,sizeof(buf), "%d",gtk_paned_get_position (static_cast<Paned*>(&list_hpane)->gobj()));
|
2005-09-25 14:42:24 -04:00
|
|
|
geometry->add_property(X_("mixer_list_hpane_pos"), string(buf));
|
|
|
|
|
|
|
|
node->add_child_nocopy (*geometry);
|
|
|
|
}
|
|
|
|
|
|
|
|
node->add_property ("narrow-strips", _strip_width == Narrow ? "yes" : "no");
|
|
|
|
|
2006-08-30 16:48:16 -04:00
|
|
|
node->add_property ("show-mixer", _visible ? "yes" : "no");
|
|
|
|
|
2014-03-21 08:45:00 -04:00
|
|
|
node->add_property ("maximised", _maximised ? "yes" : "no");
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
return *node;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-10-14 12:10:01 -04:00
|
|
|
void
|
2009-07-21 11:55:17 -04:00
|
|
|
Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
int pos;
|
|
|
|
XMLProperty* prop = 0;
|
|
|
|
char buf[32];
|
|
|
|
XMLNode* node = ARDOUR_UI::instance()->mixer_settings();
|
|
|
|
XMLNode* geometry;
|
2011-07-02 13:16:46 -04:00
|
|
|
int height;
|
2005-09-25 14:42:24 -04:00
|
|
|
static int32_t done[3] = { 0, 0, 0 };
|
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
height = default_height;
|
|
|
|
|
|
|
|
if ((geometry = find_named_node (*node, "geometry")) != 0) {
|
|
|
|
|
|
|
|
if ((prop = geometry->property ("y_size")) == 0) {
|
|
|
|
prop = geometry->property ("y-size");
|
|
|
|
}
|
|
|
|
if (prop) {
|
|
|
|
height = atoi (prop->value());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (which == static_cast<Gtk::Paned*> (&rhs_pane1)) {
|
|
|
|
|
|
|
|
if (done[0]) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-10-05 19:14:48 -04:00
|
|
|
if (!geometry || (prop = geometry->property("mixer-rhs-pane1-pos")) == 0) {
|
2005-09-25 14:42:24 -04:00
|
|
|
pos = height / 3;
|
|
|
|
snprintf (buf, sizeof(buf), "%d", pos);
|
|
|
|
} else {
|
|
|
|
pos = atoi (prop->value());
|
|
|
|
}
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
if ((done[0] = GTK_WIDGET(rhs_pane1.gobj())->allocation.height > pos)) {
|
2005-09-25 14:42:24 -04:00
|
|
|
rhs_pane1.set_position (pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (which == static_cast<Gtk::Paned*> (&list_hpane)) {
|
|
|
|
|
|
|
|
if (done[2]) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-10-14 14:24:17 -04:00
|
|
|
if (!geometry) {
|
|
|
|
pos = 0;
|
2005-09-25 14:42:24 -04:00
|
|
|
snprintf (buf, sizeof(buf), "%d", pos);
|
|
|
|
} else {
|
2015-10-14 14:24:17 -04:00
|
|
|
prop = geometry->property("mixer-list-hpane-pos");
|
2005-09-25 14:42:24 -04:00
|
|
|
pos = atoi (prop->value());
|
|
|
|
}
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
if ((done[2] = GTK_WIDGET(list_hpane.gobj())->allocation.width > pos)) {
|
2005-09-25 14:42:24 -04:00
|
|
|
list_hpane.set_position (pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-10-28 17:36:40 -04:00
|
|
|
void
|
2011-06-01 13:00:29 -04:00
|
|
|
Mixer_UI::scroll_left ()
|
2009-10-28 17:36:40 -04:00
|
|
|
{
|
2013-07-13 08:58:23 -04:00
|
|
|
if (!scroller.get_hscrollbar()) return;
|
2009-10-28 17:36:40 -04:00
|
|
|
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
|
|
|
|
/* stupid GTK: can't rely on clamping across versions */
|
|
|
|
scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::scroll_right ()
|
|
|
|
{
|
2013-07-13 08:58:23 -04:00
|
|
|
if (!scroller.get_hscrollbar()) return;
|
2009-10-28 17:36:40 -04:00
|
|
|
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
|
|
|
|
/* stupid GTK: can't rely on clamping across versions */
|
|
|
|
scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment()));
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
bool
|
|
|
|
Mixer_UI::on_key_press_event (GdkEventKey* ev)
|
|
|
|
{
|
2011-11-04 13:53:21 -04:00
|
|
|
/* focus widget gets first shot, then bindings, otherwise
|
|
|
|
forward to main window
|
|
|
|
*/
|
2009-10-28 17:36:40 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
if (gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
|
2009-10-28 17:36:40 -04:00
|
|
|
return true;
|
|
|
|
}
|
2012-06-27 08:21:23 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
KeyboardKey k (ev->state, ev->keyval);
|
2012-06-13 17:18:00 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
if (bindings.activate (k, Bindings::Press)) {
|
|
|
|
return true;
|
|
|
|
}
|
2012-06-27 08:21:23 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
return forward_key_press (ev);
|
2006-03-09 18:44:39 -05:00
|
|
|
}
|
2009-06-20 13:15:33 -04:00
|
|
|
|
2009-07-13 19:09:16 -04:00
|
|
|
bool
|
|
|
|
Mixer_UI::on_key_release_event (GdkEventKey* ev)
|
|
|
|
{
|
2011-11-04 13:53:21 -04:00
|
|
|
if (gtk_window_propagate_key_event (GTK_WINDOW(gobj()), ev)) {
|
|
|
|
return true;
|
|
|
|
}
|
2009-07-13 19:09:16 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
KeyboardKey k (ev->state, ev->keyval);
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
if (bindings.activate (k, Bindings::Release)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* don't forward releases */
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2009-10-28 17:36:40 -04:00
|
|
|
|
|
|
|
bool
|
|
|
|
Mixer_UI::on_scroll_event (GdkEventScroll* ev)
|
|
|
|
{
|
|
|
|
switch (ev->direction) {
|
|
|
|
case GDK_SCROLL_LEFT:
|
|
|
|
scroll_left ();
|
|
|
|
return true;
|
|
|
|
case GDK_SCROLL_UP:
|
|
|
|
if (ev->state & Keyboard::TertiaryModifier) {
|
|
|
|
scroll_left ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
|
|
|
|
case GDK_SCROLL_RIGHT:
|
|
|
|
scroll_right ();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case GDK_SCROLL_DOWN:
|
|
|
|
if (ev->state & Keyboard::TertiaryModifier) {
|
|
|
|
scroll_right ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::parameter_changed (string const & p)
|
|
|
|
{
|
|
|
|
if (p == "show-group-tabs") {
|
2009-12-17 13:24:23 -05:00
|
|
|
bool const s = _session->config.get_show_group_tabs ();
|
2009-06-20 13:15:33 -04:00
|
|
|
if (s) {
|
|
|
|
_group_tabs->show ();
|
|
|
|
} else {
|
|
|
|
_group_tabs->hide ();
|
|
|
|
}
|
2010-05-02 10:28:09 -04:00
|
|
|
} else if (p == "default-narrow_ms") {
|
2015-01-02 09:44:54 -05:00
|
|
|
bool const s = UIConfiguration::instance().get_default_narrow_ms ();
|
2010-05-02 10:28:09 -04:00
|
|
|
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
(*i)->set_width_enum (s ? Narrow : Wide, this);
|
|
|
|
}
|
2012-07-19 18:35:43 -04:00
|
|
|
} else if (p == "remote-model") {
|
|
|
|
reset_remote_control_ids ();
|
2009-06-20 13:15:33 -04:00
|
|
|
}
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::set_route_group_activation (RouteGroup* g, bool a)
|
|
|
|
{
|
|
|
|
g->set_active (a, this);
|
|
|
|
}
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-10-22 21:00:13 -04:00
|
|
|
PluginSelector*
|
2009-10-22 13:17:34 -04:00
|
|
|
Mixer_UI::plugin_selector()
|
|
|
|
{
|
2010-02-03 14:00:58 -05:00
|
|
|
#ifdef DEFER_PLUGIN_SELECTOR_LOAD
|
|
|
|
if (!_plugin_selector)
|
2011-11-14 12:41:29 -05:00
|
|
|
_plugin_selector = new PluginSelector (PluginManager::instance());
|
2010-02-03 14:00:58 -05:00
|
|
|
#endif
|
|
|
|
|
2009-10-22 21:00:13 -04:00
|
|
|
return _plugin_selector;
|
2009-10-22 13:17:34 -04:00
|
|
|
}
|
2011-01-09 14:09:49 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::setup_track_display ()
|
|
|
|
{
|
|
|
|
track_model = ListStore::create (track_columns);
|
|
|
|
track_display.set_model (track_model);
|
|
|
|
track_display.append_column (_("Strips"), track_columns.text);
|
|
|
|
track_display.append_column (_("Show"), track_columns.visible);
|
|
|
|
track_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
|
|
|
track_display.get_column (1)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
|
|
|
track_display.get_column (0)->set_expand(true);
|
|
|
|
track_display.get_column (1)->set_expand(false);
|
2015-04-05 12:31:52 -04:00
|
|
|
track_display.get_column (0)->set_sizing (Gtk::TREE_VIEW_COLUMN_FIXED);
|
2012-12-07 17:38:49 -05:00
|
|
|
track_display.set_name (X_("EditGroupList"));
|
2011-01-09 14:09:49 -05:00
|
|
|
track_display.get_selection()->set_mode (Gtk::SELECTION_NONE);
|
|
|
|
track_display.set_reorderable (true);
|
|
|
|
track_display.set_headers_visible (true);
|
2015-09-15 15:21:01 -04:00
|
|
|
track_display.set_can_focus(false);
|
2011-01-09 14:09:49 -05:00
|
|
|
|
|
|
|
track_model->signal_row_deleted().connect (sigc::mem_fun (*this, &Mixer_UI::track_list_delete));
|
|
|
|
track_model->signal_rows_reordered().connect (sigc::mem_fun (*this, &Mixer_UI::track_list_reorder));
|
|
|
|
|
|
|
|
CellRendererToggle* track_list_visible_cell = dynamic_cast<CellRendererToggle*>(track_display.get_column_cell_renderer (1));
|
|
|
|
track_list_visible_cell->property_activatable() = true;
|
|
|
|
track_list_visible_cell->property_radio() = false;
|
2012-07-19 18:35:43 -04:00
|
|
|
track_list_visible_cell->signal_toggled().connect (sigc::mem_fun (*this, &Mixer_UI::track_visibility_changed));
|
2011-01-09 14:09:49 -05:00
|
|
|
|
|
|
|
track_display.signal_button_press_event().connect (sigc::mem_fun (*this, &Mixer_UI::track_display_button_press), false);
|
|
|
|
|
|
|
|
track_display_scroller.add (track_display);
|
|
|
|
track_display_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
|
|
|
|
2011-01-09 14:09:56 -05:00
|
|
|
VBox* v = manage (new VBox);
|
|
|
|
v->show ();
|
|
|
|
v->pack_start (track_display_scroller, true, true);
|
|
|
|
|
|
|
|
Button* b = manage (new Button);
|
|
|
|
b->show ();
|
|
|
|
Widget* w = manage (new Image (Stock::ADD, ICON_SIZE_BUTTON));
|
|
|
|
w->show ();
|
|
|
|
b->add (*w);
|
|
|
|
|
|
|
|
b->signal_clicked().connect (sigc::mem_fun (*this, &Mixer_UI::new_track_or_bus));
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-01-09 14:09:56 -05:00
|
|
|
v->pack_start (*b, false, false);
|
|
|
|
|
2011-01-09 14:09:49 -05:00
|
|
|
track_display_frame.set_name("BaseFrame");
|
|
|
|
track_display_frame.set_shadow_type (Gtk::SHADOW_IN);
|
2011-01-09 14:09:56 -05:00
|
|
|
track_display_frame.add (*v);
|
2011-01-09 14:09:49 -05:00
|
|
|
|
|
|
|
track_display_scroller.show();
|
|
|
|
track_display_frame.show();
|
|
|
|
track_display.show();
|
|
|
|
}
|
2011-01-09 14:09:56 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::new_track_or_bus ()
|
|
|
|
{
|
|
|
|
ARDOUR_UI::instance()->add_route (this);
|
|
|
|
}
|
2011-04-19 11:46:47 -04:00
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::update_title ()
|
|
|
|
{
|
|
|
|
if (_session) {
|
|
|
|
string n;
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
if (_session->snap_name() != _session->name()) {
|
|
|
|
n = _session->snap_name ();
|
|
|
|
} else {
|
|
|
|
n = _session->name ();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_session->dirty ()) {
|
|
|
|
n = "*" + n;
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
WindowTitle title (n);
|
2011-11-28 14:46:30 -05:00
|
|
|
title += S_("Window|Mixer");
|
2011-09-07 11:07:02 -04:00
|
|
|
title += Glib::get_application_name ();
|
|
|
|
set_title (title.get_string());
|
|
|
|
|
|
|
|
} else {
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2011-11-28 14:46:30 -05:00
|
|
|
WindowTitle title (S_("Window|Mixer"));
|
2011-09-07 11:07:02 -04:00
|
|
|
title += Glib::get_application_name ();
|
|
|
|
set_title (title.get_string());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
MixerStrip*
|
|
|
|
Mixer_UI::strip_by_x (int x)
|
|
|
|
{
|
|
|
|
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
|
|
|
|
int x1, x2, y;
|
|
|
|
|
|
|
|
(*i)->translate_coordinates (*this, 0, 0, x1, y);
|
|
|
|
x2 = x1 + (*i)->get_width();
|
|
|
|
|
|
|
|
if (x >= x1 && x <= x2) {
|
|
|
|
return (*i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::set_route_targets_for_operation ()
|
|
|
|
{
|
|
|
|
_route_targets.clear ();
|
|
|
|
|
|
|
|
if (!_selection.empty()) {
|
|
|
|
_route_targets = _selection.routes;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-07-24 23:49:33 -04:00
|
|
|
// removed "implicit" selections of strips, after discussion on IRC
|
2014-07-24 13:30:11 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
}
|
2012-01-17 20:30:44 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::monitor_section_going_away ()
|
|
|
|
{
|
|
|
|
if (_monitor_section) {
|
|
|
|
out_packer.remove (_monitor_section->tearoff());
|
|
|
|
_monitor_section->set_session (0);
|
|
|
|
}
|
|
|
|
}
|
2012-11-12 21:19:04 -05:00
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::toggle_midi_input_active (bool flip_others)
|
|
|
|
{
|
|
|
|
boost::shared_ptr<RouteList> rl (new RouteList);
|
2013-07-28 14:32:52 -04:00
|
|
|
bool onoff = false;
|
2012-11-12 21:19:04 -05:00
|
|
|
|
|
|
|
set_route_targets_for_operation ();
|
|
|
|
|
|
|
|
for (RouteUISelection::iterator r = _route_targets.begin(); r != _route_targets.end(); ++r) {
|
|
|
|
boost::shared_ptr<MidiTrack> mt = (*r)->midi_track();
|
|
|
|
|
|
|
|
if (mt) {
|
|
|
|
rl->push_back ((*r)->route());
|
|
|
|
onoff = !mt->input_active();
|
|
|
|
}
|
|
|
|
}
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2012-11-12 21:19:04 -05:00
|
|
|
_session->set_exclusive_input_active (rl, onoff, flip_others);
|
|
|
|
}
|
2012-12-09 21:03:45 -05:00
|
|
|
|
2014-03-21 08:45:00 -04:00
|
|
|
void
|
|
|
|
Mixer_UI::maximise_mixer_space ()
|
|
|
|
{
|
|
|
|
if (_maximised) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fullscreen ();
|
|
|
|
|
|
|
|
_maximised = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Mixer_UI::restore_mixer_space ()
|
|
|
|
{
|
|
|
|
if (!_maximised) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
unfullscreen();
|
|
|
|
|
|
|
|
_maximised = false;
|
|
|
|
}
|