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"
|
2012-06-25 08:46:13 -04:00
|
|
|
#include "ardour/types.h"
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "enums.h"
|
2011-11-04 13:53:21 -04:00
|
|
|
#include "mixer_actor.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public MixerActor
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
2011-11-15 14:33:09 -05:00
|
|
|
static Mixer_UI* instance();
|
2005-09-25 14:42:24 -04:00
|
|
|
~Mixer_UI();
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2011-11-15 14:33:09 -05:00
|
|
|
void track_editor_selection ();
|
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&);
|
|
|
|
|
2010-03-18 22:49:01 -04:00
|
|
|
MonitorSection* monitor_section() const { return _monitor_section; }
|
2007-10-11 18:07:47 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
protected:
|
|
|
|
void set_route_targets_for_operation ();
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
private:
|
2011-11-15 14:33:09 -05:00
|
|
|
Mixer_UI ();
|
|
|
|
static Mixer_UI* _instance;
|
|
|
|
|
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
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
void add_strips (ARDOUR::RouteList&);
|
2005-09-25 14:42:24 -04:00
|
|
|
void remove_strip (MixerStrip *);
|
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
MixerStrip* strip_by_route (boost::shared_ptr<ARDOUR::Route>);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
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 ();
|
|
|
|
|
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
|
|
|
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_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
|
|
|
|
|
|
|
Width _strip_width;
|
|
|
|
|
2012-06-27 18:57:06 -04:00
|
|
|
void sync_order_keys_from_model ();
|
|
|
|
void sync_model_from_order_keys (ARDOUR::RouteSortOrderKey);
|
|
|
|
bool ignore_reorder;
|
2007-10-11 18:07:47 -04:00
|
|
|
|
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 ();
|
2011-11-04 13:53:21 -04:00
|
|
|
MixerStrip* strip_by_x (int x);
|
2011-09-07 11:07:02 -04:00
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
friend class MixerGroupTabs;
|
2011-11-15 14:33:09 -05:00
|
|
|
|
|
|
|
void follow_editor_selection ();
|
|
|
|
bool _following_editor_selection;
|
2012-01-17 20:30:44 -05:00
|
|
|
|
|
|
|
void monitor_section_going_away ();
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_mixer_ui_h__ */
|
|
|
|
|
|
|
|
|