#include "editor.h"
#include "actions.h"
#include "meterbridge.h"
+#include "luawindow.h"
#include "mixer_ui.h"
#include "startup.h"
#include "window_manager.h"
#include "global_port_matrix.h"
#include "location_ui.h"
#include "main_clock.h"
+#include "rc_option_editor.h"
#include <gtkmm2ext/application.h>
return -1;
}
- editor->signal_event().connect (sigc::bind (sigc::ptr_fun (&Keyboard::catch_user_event_for_pre_dialog_focus), editor));
+ // editor->signal_event().connect (sigc::bind (sigc::ptr_fun (&Keyboard::catch_user_event_for_pre_dialog_focus), editor));
+
+ return 0;
+}
+
+int
+ARDOUR_UI::create_luawindow ()
+
+{
+ try {
+ luawindow = LuaWindow::instance ();
+ }
+ catch (failed_constructor& err) {
+ return -1;
+ }
return 0;
}
global_actions.register_action (main_menu_actions, X_("PrefsMenu"), _("Preferences"));
global_actions.register_action (main_menu_actions, X_("DetachMenu"), _("Detach"));
global_actions.register_action (main_menu_actions, X_("Help"), _("Help"));
- global_actions.register_action (main_menu_actions, X_("KeyMouseActions"), _("Misc. Shortcuts"));
+ global_actions.register_action (main_menu_actions, X_("KeyMouseActions"), _("Misc. Shortcuts"));
global_actions.register_action (main_menu_actions, X_("AudioFileFormat"), _("Audio File Format"));
global_actions.register_action (main_menu_actions, X_("AudioFileFormatHeader"), _("File Type"));
global_actions.register_action (main_menu_actions, X_("AudioFileFormatData"), _("Sample Format"));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
- act = ActionManager::register_action (main_actions, X_("duplicate-routes"), _("Duplicate Tracks/Busses..."),
+ act = global_actions.register_action (main_actions, X_("duplicate-routes"), _("Duplicate Tracks/Busses..."),
sigc::mem_fun(*this, &ARDOUR_UI::start_duplicate_routes));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
- act = global_actions.register_action (main_actions, X_("OpenVideo"), _("Open Video"),
+ act = global_actions.register_action (main_actions, X_("Scripting"), S_("Session|Scripting"));
+ ActionManager::session_sensitive_actions.push_back (act);
+
+ act = global_actions.register_action (main_actions, X_("AddLuaScript"), _("Add Lua Script..."),
+ sigc::mem_fun (*this, &ARDOUR_UI::add_lua_script));
+ ActionManager::session_sensitive_actions.push_back (act);
+
+ act = global_actions.register_action (main_actions, X_("RemoveLuaScript"), _("Remove Lua Script"),
+ sigc::mem_fun (*this, &ARDOUR_UI::remove_lua_script));
+ ActionManager::session_sensitive_actions.push_back (act);
+
+ act = global_actions.register_action (main_actions, X_("OpenVideo"), _("Open Video..."),
sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::add_video), (Gtk::Window*) 0));
ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("CloseVideo"), _("Remove Video"),
sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
act->set_sensitive (false);
-
- act = global_actions.register_action (main_actions, X_("ExportVideo"), _("Export to Video File"),
+ act = global_actions.register_action (main_actions, X_("ExportVideo"), _("Export to Video File..."),
hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::export_video), false)));
ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("SnapshotStay"), _("Snapshot (& keep working on current version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::write_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("SnapshotSwitch"), _("Snapshot (& switch to new version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), true));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::write_sensitive_actions.push_back (act);
- act = ActionManager::register_action (main_actions, X_("QuickSnapshotStay"), _("Quick Snapshot (& keep working on current version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::quick_snapshot_session), false));
+ act = global_actions.register_action (main_actions, X_("QuickSnapshotStay"), _("Quick Snapshot (& keep working on current version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::quick_snapshot_session), false));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::write_sensitive_actions.push_back (act);
- act = global_actions::register_action (main_actions, X_("QuickSnapshotSwitch"), _("Quick Snapshot (& switch to new version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::quick_snapshot_session), true));
+ act = global_actions.register_action (main_actions, X_("QuickSnapshotSwitch"), _("Quick Snapshot (& switch to new version) ..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::quick_snapshot_session), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("SaveAs"), _("Save As..."), sigc::mem_fun(*this, &ARDOUR_UI::save_session_as));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::write_sensitive_actions.push_back (act);
act = global_actions.register_action (main_actions, X_("Rename"), _("Rename..."), sigc::mem_fun(*this, &ARDOUR_UI::rename_session));
ActionManager::session_sensitive_actions.push_back (act);
global_actions.register_action (common_actions, X_("show-editor"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), editor));
global_actions.register_action (common_actions, X_("show-mixer"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), mixer));
global_actions.register_action (common_actions, X_("show-preferences"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor));
+ global_actions.register_action (common_actions, X_("menu-show-preferences"), _("Preferences"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor));
global_actions.register_action (common_actions, X_("hide-editor"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), editor));
global_actions.register_action (common_actions, X_("hide-mixer"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), mixer));
global_actions.register_action (common_actions, X_("hide-preferences"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), rc_option_editor));
-
+
global_actions.register_action (common_actions, X_("attach-editor"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), editor));
global_actions.register_action (common_actions, X_("attach-mixer"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), mixer));
global_actions.register_action (common_actions, X_("attach-preferences"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), rc_option_editor));
-
+
global_actions.register_action (common_actions, X_("detach-editor"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), editor));
global_actions.register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer));
global_actions.register_action (common_actions, X_("detach-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor));
+ /* These "change" actions are not intended to be used inside menus, but
+ are for the tab/window control buttons, which have somewhat odd
+ semantics.
+ */
+ global_actions.register_action (common_actions, X_("change-editor-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), editor));
+ global_actions.register_action (common_actions, X_("change-mixer-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), mixer));
+ global_actions.register_action (common_actions, X_("change-preferences-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), rc_option_editor));
+
+ /* These "change" actions are not intended to be used inside menus, but
+ are for the tab/window control key bindings, which have somewhat odd
+ semantics.
+ */
+ global_actions.register_action (common_actions, X_("key-change-editor-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), editor));
+ global_actions.register_action (common_actions, X_("key-change-mixer-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), mixer));
+ global_actions.register_action (common_actions, X_("key-change-preferences-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), rc_option_editor));
+
+ global_actions.register_action (common_actions, X_("previous-tab"), _("Previous Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_up_through_tabs));
+ global_actions.register_action (common_actions, X_("next-tab"), _("Next Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_down_through_tabs));
+
+ global_actions.register_action (common_actions, X_("toggle-editor-and-mixer"), _("Toggle Editor & Mixer"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editor_and_mixer));
+
/* windows visibility actions */
global_actions.register_toggle_action (common_actions, X_("ToggleMaximalEditor"), _("Maximise Editor Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_editing_space));
global_actions.register_toggle_action (common_actions, X_("ToggleMaximalMixer"), _("Maximise Mixer Space"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_space));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_toggle_action (common_actions, X_("ToggleMixerList"), _("Toggle Mixer List"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_list));
+ act = global_actions.register_toggle_action (common_actions, X_("ToggleMixerList"), _("Toggle Mixer List"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_mixer_list));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_toggle_action (common_actions, X_("ToggleMonitorSection"), _("Toggle Monitor Section Visibility"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_monitor_section_visibility));
+ act = global_actions.register_toggle_action (common_actions, X_("ToggleMonitorSection"), _("Toggle Monitor Section Visibility"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_monitor_section_visibility));
act->set_sensitive (false);
-if (Profile->get_mixbus())
- global_actions.register_action (common_actions, X_("show-ui-prefs"), _("Show more UI preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_ui_prefs));
+ if (Profile->get_mixbus()) {
+ global_actions.register_action (common_actions, X_("show-ui-prefs"), _("Show more UI preferences"), sigc::mem_fun (*this, &ARDOUR_UI::show_ui_prefs));
+ }
+ global_actions.register_action (common_actions, X_("toggle-luawindow"), S_("Window|Scripting"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_luawindow));
global_actions.register_action (common_actions, X_("toggle-meterbridge"), S_("Window|Meterbridge"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_meterbridge));
act = global_actions.register_action (common_actions, X_("NewMIDITracer"), _("MIDI Tracer"), sigc::mem_fun(*this, &ARDOUR_UI::new_midi_tracer_window));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("primary-clock-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Timecode));
+ act = global_actions.register_action (transport_actions, X_("primary-clock-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Timecode, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("primary-clock-bbt"), _("Bars & Beats"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::BBT));
+ act = global_actions.register_action (transport_actions, X_("primary-clock-bbt"), _("Bars & Beats"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::BBT, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("primary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::MinSec));
+ act = global_actions.register_action (transport_actions, X_("primary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::MinSec, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Frames));
+ act = global_actions.register_action (transport_actions, X_("primary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(primary_clock, &AudioClock::set_mode), AudioClock::Frames, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("secondary-clock-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Timecode));
+ act = global_actions.register_action (transport_actions, X_("secondary-clock-timecode"), _("Timecode"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Timecode, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("secondary-clock-bbt"), _("Bars & Beats"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::BBT));
+ act = global_actions.register_action (transport_actions, X_("secondary-clock-bbt"), _("Bars & Beats"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::BBT, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("secondary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::MinSec));
+ act = global_actions.register_action (transport_actions, X_("secondary-clock-minsec"), _("Minutes & Seconds"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::MinSec, false));
ActionManager::session_sensitive_actions.push_back (act);
- act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames));
+ act = global_actions.register_action (transport_actions, X_("secondary-clock-samples"), _("Samples"), sigc::bind (sigc::mem_fun(secondary_clock, &AudioClock::set_mode), AudioClock::Frames, false));
ActionManager::session_sensitive_actions.push_back (act);
act = global_actions.register_toggle_action (transport_actions, X_("TogglePunchIn"), _("Punch In"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_punch_in));
shuttle_actions->add (Action::create (X_("SetShuttleUnitsPercentage"), _("Percentage")), hide_return (sigc::bind (sigc::mem_fun (*Config, &RCConfiguration::set_shuttle_units), Percentage)));
shuttle_actions->add (Action::create (X_("SetShuttleUnitsSemitones"), _("Semitones")), hide_return (sigc::bind (sigc::mem_fun (*Config, &RCConfiguration::set_shuttle_units), Semitones)));
- Glib::RefPtr<ActionGroup> option_actions = global_actions.create_action_group ("options");
+ Glib::RefPtr<ActionGroup> option_actions = global_actions.create_action_group ("Options");
act = global_actions.register_toggle_action (option_actions, X_("SendMTC"), _("Send MTC"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_send_mtc));
ActionManager::session_sensitive_actions.push_back (act);
Glib::RefPtr<ActionGroup> midi_actions = global_actions.create_action_group (X_("MIDI"));
global_actions.register_action (midi_actions, X_("panic"), _("Panic"), sigc::mem_fun(*this, &ARDOUR_UI::midi_panic));
-
- global_actions.install_action_group (shuttle_actions);
- global_actions.install_action_group (option_actions);
- global_actions.install_action_group (transport_actions);
- global_actions.install_action_group (main_actions);
- global_actions.install_action_group (main_menu_actions);
- global_actions.install_action_group (common_actions);
- global_actions.install_action_group (midi_actions);
}
void
format_label.set_use_markup ();
#ifndef TOP_MENUBAR
- menu_hbox.pack_start (*menu_bar, false, false);
+ menu_hbox.pack_start (*menu_bar, false, false);
#else
use_menubar_as_top_menubar ();
#endif
bool wall_clock = false;
bool disk_space = false;
- if (!Profile->get_small_screen()) {
-#ifndef GTKOSX
+ if (!Profile->get_small_screen()) {
+#ifndef __APPLE__
// OSX provides its own wallclock, thank you very much
wall_clock = true;
#endif
disk_space = true;
}
+
hbox->pack_end (error_alert_button, false, false, 2);
hbox->pack_end (wall_clock_label, false, false, 2);
menu_bar_base.set_name ("MainMenuBar");
menu_bar_base.add (menu_hbox);
-#ifndef GTKOSX
+#ifndef __APPLE__
_status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
#endif
_status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
}
- if ((widget = ActionManager::get_widget ("/ui/Main/Session/toggle-rc-options-editor"))) {
+ if ((widget = ActionManager::get_widget ("/ui/Main/Edit/menu-show-preferences"))) {
app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
}
string current_tab;
int current_page_number = _tabs.get_current_page ();
- if (editor && (current_page_number == _tabs.page_num (editor->contents()))) {
+ if (current_page_number == _tabs.page_num (editor->contents())) {
current_tab = "editor";
- } else if (mixer && (current_page_number == _tabs.page_num (mixer->contents()))) {
+ } else if (current_page_number == _tabs.page_num (mixer->contents())) {
current_tab = "mixer";
- } else if (rc_option_editor && (current_page_number == _tabs.page_num (rc_option_editor->contents()))) {
+ } else if (current_page_number == _tabs.page_num (rc_option_editor->contents())) {
current_tab == "preferences";
}
main_window_node.add_property (X_("current-tab"), current_tab);
-
+
/* Windows */
WM::Manager::instance().add_state (*window_node);
{
return _tabs;
}
+
+bool
+ARDOUR_UI::tabbable_visibility_button_press (GdkEventButton* ev, string const& tabbable_name)
+{
+ if (ev->button != 3) {
+ return false;
+ }
+
+ /* context menu is defined in *.menus.in
+ */
+
+ string menu_name = string ("/ui/") + tabbable_name + X_("TabbableButtonMenu");
+ Gtk::Menu* menu = dynamic_cast<Gtk::Menu*> (ActionManager::get_widget (menu_name.c_str()));
+ if (menu) {
+ menu->popup (3, ev->time);
+ }
+ return true;
+}