2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2000 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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_mixer_ui_h__
|
|
|
|
#define __ardour_mixer_ui_h__
|
|
|
|
|
|
|
|
#include <list>
|
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/scrolledwindow.h>
|
|
|
|
#include <gtkmm/eventbox.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/frame.h>
|
|
|
|
#include <gtkmm/paned.h>
|
|
|
|
#include <gtkmm/menu.h>
|
|
|
|
#include <gtkmm/treeview.h>
|
2010-05-31 11:55:30 -04:00
|
|
|
#include <gtkmm/liststore.h>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/stateful.h"
|
2009-12-19 15:26:31 -05:00
|
|
|
#include "pbd/signals.h"
|
2006-07-07 19:51:30 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/ardour.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2007-06-27 16:23:48 -04:00
|
|
|
#include "route_processor_selection.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "enums.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
|
|
|
class RouteGroup;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MixerStrip;
|
|
|
|
class PluginSelector;
|
2009-06-20 13:15:33 -04:00
|
|
|
class MixerGroupTabs;
|
2010-03-10 12:31:16 -05:00
|
|
|
class MonitorSection;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
2007-03-13 12:17:29 -04:00
|
|
|
Mixer_UI ();
|
2005-09-25 14:42:24 -04:00
|
|
|
~Mixer_UI();
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-10-22 21:00:13 -04:00
|
|
|
PluginSelector* plugin_selector();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void set_strip_width (Width);
|
|
|
|
Width get_strip_width () const { return _strip_width; }
|
|
|
|
|
|
|
|
void unselect_strip_in_display (MixerStrip*);
|
|
|
|
void select_strip_in_display (MixerStrip*);
|
|
|
|
|
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& );
|
|
|
|
|
|
|
|
void show_window ();
|
2006-08-30 16:48:16 -04:00
|
|
|
bool hide_window (GdkEventAny *ev);
|
2006-01-11 22:43:52 -05:00
|
|
|
void show_strip (MixerStrip *);
|
|
|
|
void hide_strip (MixerStrip *);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void ensure_float (Gtk::Window&);
|
2008-04-11 10:06:50 -04:00
|
|
|
void toggle_auto_rebinding ();
|
|
|
|
void set_auto_rebinding(bool);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
RouteRedirectSelection& selection() { return _selection; }
|
2010-03-18 22:49:01 -04:00
|
|
|
MonitorSection* monitor_section() const { return _monitor_section; }
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
2007-07-10 15:11:59 -04:00
|
|
|
bool _visible;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-07-10 15:11:59 -04:00
|
|
|
Gtk::HBox global_hpacker;
|
|
|
|
Gtk::VBox global_vpacker;
|
|
|
|
Gtk::ScrolledWindow scroller;
|
|
|
|
Gtk::EventBox scroller_base;
|
|
|
|
Gtk::HBox scroller_hpacker;
|
|
|
|
Gtk::VBox mixer_scroller_vpacker;
|
|
|
|
Gtk::VBox list_vpacker;
|
|
|
|
Gtk::Label group_display_button_label;
|
|
|
|
Gtk::Button group_display_button;
|
|
|
|
Gtk::ScrolledWindow track_display_scroller;
|
|
|
|
Gtk::ScrolledWindow group_display_scroller;
|
|
|
|
Gtk::VBox group_display_vbox;
|
|
|
|
Gtk::Frame track_display_frame;
|
|
|
|
Gtk::Frame group_display_frame;
|
|
|
|
Gtk::VPaned rhs_pane1;
|
|
|
|
Gtk::HBox strip_packer;
|
|
|
|
Gtk::HBox out_packer;
|
|
|
|
Gtk::HPaned list_hpane;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
MixerGroupTabs* _group_tabs;
|
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
// for restoring window geometry.
|
|
|
|
int m_root_x, m_root_y, m_width, m_height;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-07-17 22:27:07 -04:00
|
|
|
void set_window_pos_and_size ();
|
|
|
|
void get_window_pos_and_size ();
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
2009-07-13 19:09:16 -04:00
|
|
|
bool on_key_release_event (GdkEventKey*);
|
2009-10-28 17:36:40 -04:00
|
|
|
bool on_scroll_event (GdkEventScroll*);
|
2006-03-09 18:44:39 -05:00
|
|
|
|
2005-10-05 09:48:09 -04:00
|
|
|
void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-05-12 13:03:42 -04:00
|
|
|
std::list<MixerStrip *> strips;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
bool strip_scroller_button_release (GdkEventButton*);
|
2009-10-28 17:36:40 -04:00
|
|
|
void scroll_left ();
|
|
|
|
void scroll_right ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-01-30 02:40:13 -05:00
|
|
|
void add_strip (ARDOUR::RouteList&);
|
2005-09-25 14:42:24 -04:00
|
|
|
void remove_strip (MixerStrip *);
|
|
|
|
|
|
|
|
void hide_all_strips (bool with_select);
|
|
|
|
void unselect_all_strips();
|
|
|
|
void select_all_strips ();
|
|
|
|
void unselect_all_audiotrack_strips ();
|
|
|
|
void select_all_audiotrack_strips ();
|
|
|
|
void unselect_all_audiobus_strips ();
|
|
|
|
void select_all_audiobus_strips ();
|
|
|
|
|
2008-04-11 10:06:50 -04:00
|
|
|
void auto_rebind_midi_controls ();
|
|
|
|
bool auto_rebinding;
|
|
|
|
|
2005-10-05 09:48:09 -04:00
|
|
|
void strip_select_op (bool audiotrack, bool select);
|
|
|
|
void select_strip_op (MixerStrip*, bool select);
|
2005-10-01 12:29:37 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void follow_strip_selection ();
|
|
|
|
|
|
|
|
gint start_updating ();
|
|
|
|
gint stop_updating ();
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void session_going_away ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
sigc::connection fast_screen_update_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
void fast_update_strips ();
|
|
|
|
|
2005-11-29 17:48:54 -05:00
|
|
|
void track_name_changed (MixerStrip *);
|
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
void redisplay_track_list ();
|
|
|
|
bool no_track_list_redisplay;
|
|
|
|
bool track_display_button_press (GdkEventButton*);
|
2009-06-23 19:05:14 -04:00
|
|
|
void strip_width_changed ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
void track_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
|
|
|
|
void track_list_delete (const Gtk::TreeModel::Path&);
|
2007-10-11 18:07:47 -04:00
|
|
|
void track_list_reorder (const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter, int* new_order);
|
2006-01-11 22:43:52 -05:00
|
|
|
|
|
|
|
void initial_track_display ();
|
|
|
|
void show_track_list_menu ();
|
|
|
|
|
|
|
|
void set_all_strips_visibility (bool yn);
|
|
|
|
void set_all_audio_visibility (int tracks, bool yn);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2006-01-11 22:43:52 -05:00
|
|
|
void hide_all_routes ();
|
|
|
|
void show_all_routes ();
|
|
|
|
void show_all_audiobus ();
|
|
|
|
void hide_all_audiobus ();
|
|
|
|
void show_all_audiotracks();
|
|
|
|
void hide_all_audiotracks ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
bool in_group_row_change;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void group_selected (gint row, gint col, GdkEvent *ev);
|
|
|
|
void group_unselected (gint row, gint col, GdkEvent *ev);
|
2005-10-01 12:29:37 -04:00
|
|
|
void group_display_active_clicked();
|
2009-06-21 15:59:56 -04:00
|
|
|
void new_route_group ();
|
|
|
|
void remove_selected_route_group ();
|
|
|
|
void activate_all_route_groups ();
|
|
|
|
void disable_all_route_groups ();
|
|
|
|
void add_route_group (ARDOUR::RouteGroup *);
|
|
|
|
void route_groups_changed ();
|
2010-09-14 12:51:02 -04:00
|
|
|
void route_group_name_edit (const std::string&, const std::string&);
|
2009-06-21 15:59:56 -04:00
|
|
|
void route_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter);
|
2011-04-19 11:46:47 -04:00
|
|
|
void route_group_row_deleted (Gtk::TreeModel::Path const &);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Menu *track_menu;
|
|
|
|
void track_column_click (gint);
|
|
|
|
void build_track_menu ();
|
|
|
|
|
2010-03-18 22:49:01 -04:00
|
|
|
MonitorSection* _monitor_section;
|
2005-09-25 14:42:24 -04:00
|
|
|
PluginSelector *_plugin_selector;
|
|
|
|
|
2010-02-19 13:09:08 -05:00
|
|
|
void strip_property_changed (const PBD::PropertyChange&, MixerStrip *);
|
2010-04-01 20:21:08 -04:00
|
|
|
void route_group_property_changed (ARDOUR::RouteGroup *, const PBD::PropertyChange &);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
/* various treeviews */
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2005-10-01 12:29:37 -04:00
|
|
|
struct TrackDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
2006-01-11 22:43:52 -05:00
|
|
|
TrackDisplayModelColumns () {
|
2005-10-01 12:29:37 -04:00
|
|
|
add (text);
|
2006-01-11 22:43:52 -05:00
|
|
|
add (visible);
|
2005-10-05 09:48:09 -04:00
|
|
|
add (route);
|
|
|
|
add (strip);
|
2005-10-01 12:29:37 -04:00
|
|
|
}
|
2006-01-11 22:43:52 -05:00
|
|
|
Gtk::TreeModelColumn<bool> visible;
|
2010-09-14 12:51:02 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> text;
|
2006-07-27 12:52:14 -04:00
|
|
|
Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
|
2005-10-05 09:48:09 -04:00
|
|
|
Gtk::TreeModelColumn<MixerStrip*> strip;
|
2005-10-01 12:29:37 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GroupDisplayModelColumns : public Gtk::TreeModel::ColumnRecord {
|
2009-10-14 12:10:01 -04:00
|
|
|
GroupDisplayModelColumns() {
|
2006-01-11 22:43:52 -05:00
|
|
|
add (visible);
|
2005-09-28 12:22:43 -04:00
|
|
|
add (text);
|
2005-10-05 09:48:09 -04:00
|
|
|
add (group);
|
2005-09-28 12:22:43 -04:00
|
|
|
}
|
2007-07-10 15:11:59 -04:00
|
|
|
Gtk::TreeModelColumn<bool> visible;
|
2010-09-14 12:51:02 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> text;
|
2007-07-10 15:11:59 -04:00
|
|
|
Gtk::TreeModelColumn<ARDOUR::RouteGroup*> group;
|
2005-09-28 12:22:43 -04:00
|
|
|
};
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
TrackDisplayModelColumns track_columns;
|
|
|
|
GroupDisplayModelColumns group_columns;
|
2005-09-28 12:22:43 -04:00
|
|
|
|
|
|
|
Gtk::TreeView track_display;
|
|
|
|
Gtk::TreeView group_display;
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
Glib::RefPtr<Gtk::ListStore> track_model;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> group_model;
|
2005-09-28 12:22:43 -04:00
|
|
|
|
|
|
|
bool group_display_button_press (GdkEventButton*);
|
|
|
|
void group_display_selection_changed ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
bool strip_button_release_event (GdkEventButton*, MixerStrip*);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
RouteRedirectSelection _selection;
|
|
|
|
|
|
|
|
Width _strip_width;
|
|
|
|
|
2009-07-04 08:40:26 -04:00
|
|
|
void sync_order_keys (std::string const &);
|
2008-12-08 13:16:12 -05:00
|
|
|
bool strip_redisplay_does_not_reset_order_keys;
|
|
|
|
bool strip_redisplay_does_not_sync_order_keys;
|
2007-10-11 18:07:47 -04:00
|
|
|
bool ignore_sync;
|
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
void parameter_changed (std::string const &);
|
2009-06-21 15:59:56 -04:00
|
|
|
void set_route_group_activation (ARDOUR::RouteGroup *, bool);
|
2009-06-20 13:15:33 -04:00
|
|
|
|
2011-01-09 14:09:49 -05:00
|
|
|
void setup_track_display ();
|
2011-01-09 14:09:56 -05:00
|
|
|
void new_track_or_bus ();
|
2011-01-09 14:09:49 -05:00
|
|
|
|
2006-05-19 13:29:05 -04:00
|
|
|
static const int32_t default_width = 478;
|
2005-09-25 14:42:24 -04:00
|
|
|
static const int32_t default_height = 765;
|
2009-06-20 13:15:33 -04:00
|
|
|
|
2011-04-19 21:24:40 -04:00
|
|
|
/** true if we are rebuilding the route group list, or clearing
|
|
|
|
it during a session teardown.
|
|
|
|
*/
|
|
|
|
bool _in_group_rebuild_or_clear;
|
2011-04-19 11:46:47 -04:00
|
|
|
|
2011-09-07 11:07:02 -04:00
|
|
|
void update_title ();
|
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
friend class MixerGroupTabs;
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_mixer_ui_h__ */
|
|
|
|
|
|
|
|
|