X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui.h;h=59a3c963e5f417062b3e07c2e5da9e72c7da08a8;hb=c8c6bca6587450ff64303dbc994a4cd28d6ce7aa;hp=33e4174b504fa413539e43f5d7255b091e491267;hpb=3a08ac5e1faede83db0f7b5db43bb982f00d5a1d;p=ardour.git diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 33e4174b50..59a3c963e5 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -53,10 +53,13 @@ #include #include #include -#include -#include -#include -#include + +#include "gtkmm2ext/gtk_ui.h" +#include "gtkmm2ext/click_box.h" +#include "gtkmm2ext/stateful_button.h" +#include "gtkmm2ext/bindable_button.h" +#include "gtkmm2ext/bindings.h" +#include "gtkmm2ext/visibility_tracker.h" #include "ardour/ardour.h" #include "ardour/types.h" @@ -86,6 +89,7 @@ #include "global_port_matrix.h" #include "keyeditor.h" #include "location_ui.h" +#include "lua_script_manager.h" #include "rc_option_editor.h" #include "route_params_ui.h" #include "session_option_editor.h" @@ -100,6 +104,7 @@ class EngineControl; class ExportVideoDialog; class KeyEditor; class LocationUIWindow; +class LuaScriptManager; class RCOptionEditor; class RouteParams_UI; class SessionOptionEditor; @@ -119,11 +124,12 @@ class ArdourPrompter; class PublicEditor; class SaveAsDialog; class SessionDialog; -class SessionOptionEditor; +class SessionOptionEditorWindow; class ShuttleControl; class Splash; class TimeInfoBox; class Meterbridge; +class LuaWindow; class MidiTracer; class NSM_Client; class LevelMeterHBox; @@ -139,17 +145,17 @@ namespace ARDOUR { class ProcessThread; } -namespace Gtkmm2ext { - class TearOff; -} - namespace Gtk { class ProgressBar; } +namespace Gtkmm2ext { + class Tabbable; +} + class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr { - public: +public: ARDOUR_UI (int *argcp, char **argvp[], const char* localedir); ~ARDOUR_UI(); @@ -184,7 +190,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool get_smart_mode () const; int get_session_parameters (bool quit_on_cancel, bool should_be_new = false, std::string load_template = ""); - int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path); + int build_session_from_dialog (SessionDialog&, const std::string& session_name, const std::string& session_path); bool ask_about_loading_existing_session (const std::string& session_path); /// @return true if session was successfully unloaded. @@ -196,6 +202,12 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr static ARDOUR_UI *instance () { return theArdourUI; } + /* signal emitted when escape key is pressed. All UI components that + need to respond to Escape in some way (e.g. break drag, clear + selection, etc) should connect to and handle this. + */ + PBD::Signal0 Escape; + PublicEditor& the_editor() { return *editor;} Mixer_UI* the_mixer() { return mixer; } @@ -216,9 +228,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr static sigc::signal Clock; static void close_all_dialogs () { CloseAllDialogs(); } - static sigc::signal CloseAllDialogs; + static sigc::signal CloseAllDialogs; + XMLNode* main_window_settings() const; XMLNode* editor_settings() const; + XMLNode* preferences_settings() const; XMLNode* mixer_settings () const; XMLNode* keyboard_settings () const; XMLNode* tearoff_settings (const char*) const; @@ -247,12 +261,17 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void synchronize_sync_source_and_video_pullup (); - void add_route (Gtk::Window* float_window); - void add_routes_part_two (); - void add_routes_thread (); + void add_route (); + void add_route_dialog_finished (int); + + void add_routes_part_two (); + void add_routes_thread (); void start_duplicate_routes (); + void add_lua_script (); + void remove_lua_script (); + void add_video (Gtk::Window* float_window); void remove_video (); void start_video_server_menu (Gtk::Window* float_window); @@ -261,36 +280,57 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void flush_videotimeline_cache (bool localcacheonly=false); void export_video (bool range = false); + void session_add_vca (std::string const &, uint32_t); + + void session_add_audio_route (bool, int32_t, int32_t, ARDOUR::TrackMode, ARDOUR::RouteGroup *, uint32_t, std::string const &, bool, ARDOUR::PresentationInfo::order_t order); void session_add_audio_track ( int input_channels, int32_t output_channels, ARDOUR::TrackMode mode, ARDOUR::RouteGroup* route_group, uint32_t how_many, - std::string const & name_template + std::string const & name_template, + bool strict_io, + ARDOUR::PresentationInfo::order_t order ) { - - session_add_audio_route (true, input_channels, output_channels, mode, route_group, how_many, name_template); + session_add_audio_route (true, input_channels, output_channels, mode, route_group, how_many, name_template, strict_io, order); } - void session_add_audio_bus (int input_channels, int32_t output_channels, ARDOUR::RouteGroup* route_group, - uint32_t how_many, std::string const & name_template) { - session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, route_group, how_many, name_template); + void session_add_audio_bus ( + int input_channels, + int32_t output_channels, + ARDOUR::RouteGroup* route_group, + uint32_t how_many, + std::string const & name_template, + bool strict_io, + ARDOUR::PresentationInfo::order_t order + ) { + session_add_audio_route (false, input_channels, output_channels, ARDOUR::Normal, route_group, how_many, name_template, strict_io, order); } - void session_add_midi_track (ARDOUR::RouteGroup* route_group, uint32_t how_many, std::string const & name_template, - ARDOUR::PluginInfoPtr instrument) { - session_add_midi_route (true, route_group, how_many, name_template, instrument); + void session_add_midi_track ( + ARDOUR::RouteGroup* route_group, + uint32_t how_many, + std::string const & name_template, + bool strict_io, + ARDOUR::PluginInfoPtr instrument, + ARDOUR::Plugin::PresetRecord* preset, + ARDOUR::PresentationInfo::order_t order + ) { + session_add_midi_route (true, route_group, how_many, name_template, strict_io, instrument, preset, order); } - void session_add_mixed_track (const ARDOUR::ChanCount& input, const ARDOUR::ChanCount& output, ARDOUR::RouteGroup* route_group, uint32_t how_many, std::string const & name_template, - ARDOUR::PluginInfoPtr instrument); - - /*void session_add_midi_bus () { - session_add_midi_route (false); - }*/ - - void attach_to_engine (); + void session_add_mixed_track (const ARDOUR::ChanCount&, const ARDOUR::ChanCount&, ARDOUR::RouteGroup*, uint32_t, std::string const &, bool, + ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord* pset, + ARDOUR::PresentationInfo::order_t order); + void session_add_midi_bus (ARDOUR::RouteGroup*, uint32_t, std::string const &, bool, ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord* pset, + ARDOUR::PresentationInfo::order_t order); + void session_add_midi_route (bool, ARDOUR::RouteGroup *, uint32_t, std::string const &, bool, + ARDOUR::PluginInfoPtr, ARDOUR::Plugin::PresetRecord*, + ARDOUR::PresentationInfo::order_t order); + void display_insufficient_ports_message (); + + void attach_to_engine (); void post_engine (); gint exit_on_main_window_close (GdkEventAny *); @@ -302,8 +342,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool check_audioengine(Gtk::Window&); - void update_tearoff_visibility (); - void setup_profile (); void setup_tooltips (); @@ -316,11 +354,29 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void reset_route_peak_display (ARDOUR::Route*); void reset_group_peak_display (ARDOUR::RouteGroup*); - const std::string& announce_string() const { return _announce_string; } + const std::string& announce_string() const { return _announce_string; } void hide_application (); - protected: + Gtk::Notebook& tabs(); + Gtk::Window& main_window () { return _main_window; } + + void setup_toplevel_window (Gtk::Window&, const std::string& name, void* owner); + + /* called from a static C function */ + + GtkNotebook* tab_window_root_drop (GtkNotebook* src, + GtkWidget* w, + gint x, + gint y, + gpointer user_data); + + bool tabbed_window_state_event_handler (GdkEventWindowState*, void* object); + bool key_event_handler (GdkEventKey*, Gtk::Window* window); + + Gtkmm2ext::ActionMap global_actions; + +protected: friend class PublicEditor; void toggle_auto_play (); @@ -334,25 +390,38 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void reenable_hide_loop_punch_ruler_if_appropriate (); void toggle_auto_return (); void toggle_click (); - void toggle_audio_midi_setup (); + void toggle_audio_midi_setup (); void toggle_session_auto_loop (); void toggle_rc_options_window (); void toggle_session_options_window (); - private: - PublicEditor* editor; - Mixer_UI* mixer; - NSM_Client* nsm; - bool _was_dirty; - bool _mixer_on_top; - bool _initial_verbose_plugin_scan; - bool first_time_engine_run; - - void goto_editor_window (); - void goto_mixer_window (); - void toggle_mixer_window (); +private: + Gtk::Window _main_window; + Gtkmm2ext::VisibilityTracker* main_window_visibility; + Gtk::VBox main_vpacker; + Gtk::HBox status_bar_hpacker; + Gtk::Notebook _tabs; + PublicEditor* editor; + Mixer_UI* mixer; + Gtk::Tooltips _tooltips; + NSM_Client* nsm; + bool _was_dirty; + bool _mixer_on_top; + bool _initial_verbose_plugin_scan; + bool first_time_engine_run; + + void show_tabbable (Gtkmm2ext::Tabbable*); + void hide_tabbable (Gtkmm2ext::Tabbable*); + void detach_tabbable (Gtkmm2ext::Tabbable*); + void attach_tabbable (Gtkmm2ext::Tabbable*); + void button_change_tabbable_visibility (Gtkmm2ext::Tabbable*); + void key_change_tabbable_visibility (Gtkmm2ext::Tabbable*); + void toggle_editor_and_mixer (); + + void tabbable_state_change (Gtkmm2ext::Tabbable&); + void toggle_meterbridge (); - void toggle_editor_mixer (); + void toggle_luawindow (); int setup_windows (); void setup_transport (); @@ -361,7 +430,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr static ARDOUR_UI *theArdourUI; SessionDialog *_session_dialog; - int starting (); + int starting (); int ask_about_saving_session (const std::vector& actions); @@ -371,6 +440,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void update_autosave(); sigc::connection _autosave_connection; + void session_dirty_changed (); + void update_title (); + void map_transport_state (); int32_t do_engine_start (); @@ -389,22 +461,14 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void start_clocking (); void stop_clocking (); - bool main_window_state_event_handler (GdkEventWindowState*, bool window_was_editor); - void update_transport_clocks (framepos_t pos); void record_state_changed (); std::list _midi_tracer_windows; - void detach_tearoff (Gtk::Box* parent, Gtk::Widget* contents); - void reattach_tearoff (Gtk::Box* parent, Gtk::Widget* contents, int32_t order); - void reattach_all_tearoffs (); - /* Transport Control */ - Gtkmm2ext::TearOff* transport_tearoff; Gtk::Frame transport_frame; - Gtk::HBox transport_tearoff_hbox; Gtk::HBox transport_hbox; Gtk::Fixed transport_base; Gtk::Fixed transport_button_base; @@ -475,6 +539,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr ArdourButton feedback_alert_button; ArdourButton error_alert_button; + ArdourButton action_script_call_btn[10]; + Gtk::Table action_script_table; + Gtk::VBox alert_box; Gtk::VBox meter_box; LevelMeterHBox * editor_meter; @@ -568,9 +635,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void edit_metadata (); void import_metadata (); - void session_add_audio_route (bool, int32_t, int32_t, ARDOUR::TrackMode, ARDOUR::RouteGroup *, uint32_t, std::string const &); - void session_add_midi_route (bool, ARDOUR::RouteGroup *, uint32_t, std::string const &, ARDOUR::PluginInfoPtr); - void set_transport_sensitivity (bool); //stuff for ProTools-style numpad @@ -616,41 +680,49 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool save_as_progress_update (float fraction, int64_t cnt, int64_t total, Gtk::Label* label, Gtk::ProgressBar* bar); void save_session_as (); void rename_session (); - void setup_order_hint (AddRouteDialog::InsertAt); + ARDOUR::PresentationInfo::order_t translate_order (AddRouteDialog::InsertAt); int create_mixer (); int create_editor (); + int create_meterbridge (); + int create_luawindow (); + int create_masters (); Meterbridge *meterbridge; - int create_meterbridge (); - /* Dialogs that can be created via new */ - - WM::Proxy speaker_config_window; - WM::Proxy key_editor; - WM::Proxy rc_option_editor; - WM::Proxy add_route_dialog; - WM::Proxy about; - WM::Proxy location_ui; - WM::Proxy route_params; - WM::Proxy audio_midi_setup; - WM::Proxy export_video_dialog; - - /* Windows/Dialogs that require a creator method */ - - WM::ProxyWithConstructor session_option_editor; - WM::ProxyWithConstructor add_video_dialog; - WM::ProxyWithConstructor bundle_manager; - WM::ProxyWithConstructor big_clock_window; - WM::ProxyWithConstructor audio_port_matrix; - WM::ProxyWithConstructor midi_port_matrix; - - /* creator methods */ - - SessionOptionEditor* create_session_option_editor (); - BundleManager* create_bundle_manager (); - AddVideoDialog* create_add_video_dialog (); - BigClockWindow* create_big_clock_window(); - GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType); + LuaWindow *luawindow; + + /* Dialogs that can be created via new */ + + RCOptionEditor* rc_option_editor; + Gtk::HBox rc_option_editor_placeholder; + + WM::Proxy speaker_config_window; + WM::Proxy add_route_dialog; + WM::Proxy about; + WM::Proxy location_ui; + WM::Proxy route_params; + WM::Proxy audio_midi_setup; + WM::Proxy export_video_dialog; + WM::Proxy lua_script_window; + + /* Windows/Dialogs that require a creator method */ + + WM::ProxyWithConstructor session_option_editor; + WM::ProxyWithConstructor add_video_dialog; + WM::ProxyWithConstructor bundle_manager; + WM::ProxyWithConstructor big_clock_window; + WM::ProxyWithConstructor audio_port_matrix; + WM::ProxyWithConstructor midi_port_matrix; + WM::ProxyWithConstructor key_editor; + + /* creator methods */ + + SessionOptionEditor* create_session_option_editor (); + BundleManager* create_bundle_manager (); + AddVideoDialog* create_add_video_dialog (); + BigClockWindow* create_big_clock_window(); + GlobalPortMatrixWindow* create_global_port_matrix (ARDOUR::DataType); + KeyEditor* create_key_editor (); ARDOUR::SystemExec *video_server_process; @@ -664,7 +736,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void install_actions (); - void toggle_record_enable (uint32_t); + void toggle_record_enable (uint16_t); uint32_t rec_enabled_streams; void count_recenabled_streams (ARDOUR::Route&); @@ -700,11 +772,12 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void plugin_scan_dialog (std::string type, std::string plugin, bool); void plugin_scan_timeout (int); - void session_format_mismatch (std::string, std::string); + void session_format_mismatch (std::string, std::string); void session_dialog (std::string); int pending_state_dialog (); int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t); + void sr_mismatch_message (ARDOUR::framecnt_t, ARDOUR::framecnt_t); Gtk::MenuItem* jack_disconnect_item; Gtk::MenuItem* jack_reconnect_item; @@ -737,26 +810,22 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr Glib::RefPtr ptag, Glib::RefPtr mtag, const char *msg); Gtk::Label status_bar_label; - bool status_bar_button_press (GdkEventButton*); + bool status_bar_button_press (GdkEventButton*); void loading_message (const std::string& msg); PBD::ScopedConnectionList forever_connections; - PBD::ScopedConnection halt_connection; + PBD::ScopedConnection halt_connection; - void step_edit_status_change (bool); + void step_edit_status_change (bool); - void platform_specific (); - void platform_setup (); - - /* these are used only in response to a platform-specific "ShouldQuit" signal - */ + /* these are used only in response to a platform-specific "ShouldQuit" signal */ bool idle_finish (); void queue_finish (); void fontconfig_dialog (); - int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type); - int ambiguous_file (std::string file, std::vector hits); + int missing_file (ARDOUR::Session*s, std::string str, ARDOUR::DataType type); + int ambiguous_file (std::string file, std::vector hits); bool click_button_clicked (GdkEventButton *); @@ -788,15 +857,37 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr bool xrun_button_release (GdkEventButton* ev); - std::string _announce_string; - void check_announcements (); + std::string _announce_string; + void check_announcements (); - int do_audio_midi_setup (uint32_t); + int do_audio_midi_setup (uint32_t); void audioengine_became_silent (); DuplicateRouteDialog* duplicate_routes_dialog; void grab_focus_after_dialog (); + + void tabs_switch (GtkNotebookPage*, guint page_number); + void tabs_page_added (Gtk::Widget*, guint); + void tabs_page_removed (Gtk::Widget*, guint); + ArdourButton editor_visibility_button; + ArdourButton mixer_visibility_button; + ArdourButton prefs_visibility_button; + + bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev, Gtkmm2ext::Bindings*); + bool try_gtk_accel_binding (GtkWindow* win, GdkEventKey* ev, bool translate, GdkModifierType modifier); + + bool main_window_delete_event (GdkEventAny*); + bool idle_ask_about_quit (); + + void load_bindings (); + bool tabbable_visibility_button_press (GdkEventButton* ev, std::string const& tabbable_name); + + void step_up_through_tabs (); + void step_down_through_tabs (); + + void escape (); + void pre_release_dialog (); }; #endif /* __ardour_gui_h__ */