2005-09-25 14:42:24 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000 Paul Davis
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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>
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-07 19:51:30 -04:00
|
|
|
#include <pbd/stateful.h>
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <ardour/ardour.h>
|
|
|
|
#include <ardour/io.h>
|
|
|
|
|
|
|
|
#include "keyboard_target.h"
|
|
|
|
#include "route_redirect_selection.h"
|
|
|
|
#include "enums.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
|
|
|
class RouteGroup;
|
|
|
|
class Session;
|
2006-06-14 17:17:32 -04:00
|
|
|
class AudioDiskstream;
|
2005-09-25 14:42:24 -04:00
|
|
|
class AudioEngine;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MixerStrip;
|
|
|
|
class PluginSelector;
|
|
|
|
|
2005-11-17 16:31:37 -05:00
|
|
|
class Mixer_UI : public Gtk::Window
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Mixer_UI (ARDOUR::AudioEngine&);
|
|
|
|
~Mixer_UI();
|
|
|
|
|
|
|
|
void connect_to_session (ARDOUR::Session *);
|
|
|
|
|
|
|
|
PluginSelector& plugin_selector() { return *_plugin_selector; }
|
|
|
|
|
|
|
|
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-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&);
|
|
|
|
|
|
|
|
RouteRedirectSelection& selection() { return _selection; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
ARDOUR::AudioEngine& engine;
|
|
|
|
ARDOUR::Session *session;
|
|
|
|
|
|
|
|
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;
|
2005-10-01 12:29:37 -04:00
|
|
|
Gtk::Label group_display_button_label;
|
|
|
|
Gtk::Button group_display_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::ScrolledWindow track_display_scroller;
|
2005-10-01 12:29:37 -04:00
|
|
|
Gtk::ScrolledWindow group_display_scroller;
|
|
|
|
Gtk::VBox group_display_vbox;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::Frame track_display_frame;
|
2005-10-01 12:29:37 -04:00
|
|
|
Gtk::Frame group_display_frame;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::VPaned rhs_pane1;
|
|
|
|
Gtk::HBox strip_packer;
|
|
|
|
Gtk::HBox out_packer;
|
|
|
|
Gtk::HPaned list_hpane;
|
|
|
|
|
2006-03-09 18:44:39 -05:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
|
|
|
|
2005-10-05 09:48:09 -04:00
|
|
|
void pane_allocation_handler (Gtk::Allocation&, Gtk::Paned*);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
list<MixerStrip *> strips;
|
|
|
|
|
2006-01-04 22:18:44 -05:00
|
|
|
bool strip_scroller_button_release (GdkEventButton*);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-27 12:52:14 -04:00
|
|
|
void add_strip (boost::shared_ptr<ARDOUR::Route>);
|
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 ();
|
|
|
|
|
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 ();
|
|
|
|
|
|
|
|
void disconnect_from_session ();
|
|
|
|
|
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*);
|
|
|
|
|
|
|
|
void track_list_change (const Gtk::TreeModel::Path&,const Gtk::TreeModel::iterator&);
|
|
|
|
void track_list_delete (const Gtk::TreeModel::Path&);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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
|
|
|
Gtk::Menu* mix_group_context_menu;
|
|
|
|
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();
|
2005-09-25 14:42:24 -04:00
|
|
|
void new_mix_group ();
|
2006-03-09 18:44:39 -05:00
|
|
|
void remove_selected_mix_group ();
|
|
|
|
void build_mix_group_context_menu ();
|
|
|
|
void activate_all_mix_groups ();
|
|
|
|
void disable_all_mix_groups ();
|
2005-09-25 14:42:24 -04:00
|
|
|
void add_mix_group (ARDOUR::RouteGroup *);
|
2006-03-09 18:44:39 -05:00
|
|
|
void mix_groups_changed ();
|
|
|
|
void mix_group_name_edit (const Glib::ustring&, const Glib::ustring&);
|
|
|
|
void mix_group_row_change (const Gtk::TreeModel::Path& path,const Gtk::TreeModel::iterator& iter);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Menu *track_menu;
|
|
|
|
void track_column_click (gint);
|
|
|
|
void build_track_menu ();
|
|
|
|
|
|
|
|
PluginSelector *_plugin_selector;
|
|
|
|
|
|
|
|
void strip_name_changed (void *src, MixerStrip *);
|
|
|
|
|
|
|
|
void group_flags_changed (void *src, ARDOUR::RouteGroup *);
|
|
|
|
|
2005-09-28 12:22:43 -04:00
|
|
|
/* various treeviews */
|
2005-09-25 14:42:24 -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;
|
2005-10-05 09:48:09 -04:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> 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 {
|
|
|
|
GroupDisplayModelColumns() {
|
|
|
|
add (active);
|
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
|
|
|
}
|
2005-10-01 12:29:37 -04:00
|
|
|
Gtk::TreeModelColumn<bool> active;
|
2006-01-11 22:43:52 -05:00
|
|
|
Gtk::TreeModelColumn<bool> visible;
|
2005-10-01 12:29:37 -04:00
|
|
|
Gtk::TreeModelColumn<Glib::ustring> text;
|
2005-10-05 09:48:09 -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;
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_mixer_ui_h__ */
|
|
|
|
|
|
|
|
|