along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
/* This file contains any ARDOUR_UI methods that require knowledge of
#include <pbd/pathscanner.h>
+#include <glibmm/miscutils.h>
+
+#include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/window_title.h>
+
#include "ardour_ui.h"
#include "public_editor.h"
#include "audio_clock.h"
#include "actions.h"
#include <ardour/session.h>
+#include <ardour/profile.h>
+#include <ardour/audioengine.h>
#include <ardour/control_protocol_manager.h>
#include <control_protocol/control_protocol.h>
#include "i18n.h"
+using namespace std;
using namespace ARDOUR;
using namespace PBD;
-using namespace Gtk;
using namespace Gtkmm2ext;
+using namespace Gtk;
+using namespace Glib;
using namespace sigc;
int
{
try {
- editor = new Editor (*engine);
+ editor = new Editor ();
}
catch (failed_constructor& err) {
ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
ActionManager::register_action (main_actions, X_("Options"), _("Options"));
ActionManager::register_action (main_actions, X_("TransportOptions"), _("Options"));
- ActionManager::register_action (main_actions, X_("Help"), _("Help"));
+ ActionManager::register_action (main_actions, X_("Help"), _("Help"));
ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions"));
ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format"));
ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header"));
ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data"));
ActionManager::register_action (main_actions, X_("ControlSurfaces"), _("Control Surfaces"));
+ ActionManager::register_action (main_actions, X_("Plugins"), _("Plugins"));
ActionManager::register_action (main_actions, X_("Metering"), _("Metering"));
ActionManager::register_action (main_actions, X_("MeteringFallOffRate"), _("Fall off rate"));
ActionManager::register_action (main_actions, X_("MeteringHoldTime"), _("Hold Time"));
/* the real actions */
- act = ActionManager::register_action (main_actions, X_("New"), _("New"), bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
+ act = ActionManager::register_action (main_actions, X_("New"), _("New"), hide_return (bind (mem_fun(*this, &ARDOUR_UI::new_session), string ())));
ActionManager::register_action (main_actions, X_("Open"), _("Open"), mem_fun(*this, &ARDOUR_UI::open_session));
ActionManager::register_action (main_actions, X_("Recent"), _("Recent"), mem_fun(*this, &ARDOUR_UI::open_recent_session));
act = ActionManager::register_action (main_actions, X_("Close"), _("Close"), mem_fun(*this, &ARDOUR_UI::close_session));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"), mem_fun(*this, &ARDOUR_UI::add_route));
+ act = ActionManager::register_action (main_actions, X_("AddTrackBus"), _("Add Track/Bus"),
+ bind (mem_fun(*this, &ARDOUR_UI::add_route), (Gtk::Window*) 0));
ActionManager::session_sensitive_actions.push_back (act);
- /* <CMT Additions> */
+#ifdef WITH_CMT
PathScanner scanner;
vector<string*>* results = scanner (getenv ("PATH"), "AniComp", false, false);
delete results;
}
- /* </CMT Additions> */
+#endif
act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot"), mem_fun(*this, &ARDOUR_UI::snapshot_session));
ActionManager::session_sensitive_actions.push_back (act);
common_actions = ActionGroup::create (X_("Common"));
ActionManager::register_action (main_actions, X_("Windows"), _("Windows"));
- ActionManager::register_action (common_actions, X_("Start-Prefix"), _("start prefix"), mem_fun(*this, &ARDOUR_UI::start_keyboard_prefix));
ActionManager::register_action (common_actions, X_("Quit"), _("Quit"), (mem_fun(*this, &ARDOUR_UI::finish)));
/* windows visibility actions */
ActionManager::register_action (common_actions, X_("goto-editor"), _("Show Editor"), mem_fun(*this, &ARDOUR_UI::goto_editor_window));
ActionManager::register_action (common_actions, X_("goto-mixer"), _("Show Mixer"), mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
- ActionManager::register_toggle_action (common_actions, X_("ToggleSoundFileBrowser"), _("Sound File Browser"), mem_fun(*this, &ARDOUR_UI::toggle_sound_file_browser));
ActionManager::register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Options Editor"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Track/Bus Inspector"), mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (common_actions, X_("ToggleBigClock"), _("Big Clock"), mem_fun(*this, &ARDOUR_UI::toggle_big_clock_window));
ActionManager::session_sensitive_actions.push_back (act);
- ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
- act = ActionManager::register_toggle_action (common_actions, X_("ToggleColorManager"), _("Colors"), mem_fun(*this, &ARDOUR_UI::toggle_color_manager));
-
+ act = ActionManager::register_action (common_actions, X_("About"), _("About"), mem_fun(*this, &ARDOUR_UI::show_splash));
+ act = ActionManager::register_toggle_action (common_actions, X_("ToggleThemeManager"), _("Theme Manager"), mem_fun(*this, &ARDOUR_UI::toggle_theme_manager));
+ ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddAudioTrack"), _("Add Audio Track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_track), 1, 1, ARDOUR::Normal, 1));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("AddAudioBus"), _("Add Audio Bus"), bind (mem_fun(*this, &ARDOUR_UI::session_add_audio_bus), 1, 1, 1));
ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (common_actions, X_("AddMIDITrack"), _("Add MIDI Track"), bind (mem_fun(*this, &ARDOUR_UI::session_add_midi_track), 1));
+ ActionManager::session_sensitive_actions.push_back (act);
+ //act = ActionManager::register_action (common_actions, X_("AddMidiBus"), _("Add Midi Bus"), mem_fun(*this, &ARDOUR_UI::session_add_midi_bus));
+ //ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("Save"), _("Save"), bind (mem_fun(*this, &ARDOUR_UI::save_state), string("")));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (common_actions, X_("RemoveLastCapture"), _("Remove Last Capture"), mem_fun(*this, &ARDOUR_UI::remove_last_capture));
ActionManager::register_action (transport_actions, X_("ToggleRollForgetCapture"), _("Stop + Forget Capture"), bind (mem_fun(*editor, &PublicEditor::toggle_playback), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
+
+ /* these two behave as follows:
+
+ - if transport speed != 1.0 or != -1.0, change speed to 1.0 or -1.0 (respectively)
+ - otherwise do nothing
+ */
+
+ ActionManager::register_action (transport_actions, X_("TransitionToRoll"), _("Transition To Roll"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), true));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::session_sensitive_actions.push_back (act);
+
+ ActionManager::register_action (transport_actions, X_("TransitionToReverse"), _("Transition To Reverse"), bind (mem_fun (*editor, &PublicEditor::transition_to_rolling), false));
+ ActionManager::session_sensitive_actions.push_back (act);
+ ActionManager::session_sensitive_actions.push_back (act);
+
+
act = ActionManager::register_action (transport_actions, X_("Loop"), _("Play Loop Range"), mem_fun(*this, &ARDOUR_UI::toggle_session_auto_loop));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("SendMIDIfeedback"), _("Send MIDI feedback"), mem_fun (*this, &ARDOUR_UI::toggle_send_midi_feedback));
ActionManager::session_sensitive_actions.push_back (act);
- act = ActionManager::register_toggle_action (option_actions, X_("UseMIDIcontrol"), _("Use MIDI control"), mem_fun (*this, &ARDOUR_UI::toggle_use_midi_control));
- ActionManager::session_sensitive_actions.push_back (act);
+
+ act = ActionManager::register_toggle_action (option_actions, X_("UseOSC"), _("Use OSC"), mem_fun (*this, &ARDOUR_UI::toggle_use_osc));
+#ifndef HAVE_LIBLO
+ act->set_sensitive (false);
+#endif
ActionManager::register_toggle_action (option_actions, X_("StopPluginsWithTransport"), _("Stop plugins with transport"), mem_fun (*this, &ARDOUR_UI::toggle_StopPluginsWithTransport));
ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture));
+ ActionManager::register_toggle_action (option_actions, X_("PeriodicSafetyBackups"), _("Make periodic safety backups"), mem_fun (*this, &ARDOUR_UI::toggle_PeriodicSafetyBackups));
ActionManager::register_toggle_action (option_actions, X_("StopRecordingOnXrun"), _("Stop recording on xrun"), mem_fun (*this, &ARDOUR_UI::toggle_StopRecordingOnXrun));
ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession));
ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
ActionManager::register_toggle_action (option_actions, X_("LatchedRecordEnable"), _("Rec-enable stays engaged at stop"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedRecordEnable));
+ ActionManager::register_toggle_action (option_actions, X_("RegionEquivalentsOverlap"), _("Region equivalents overlap"), mem_fun (*this, &ARDOUR_UI::toggle_RegionEquivalentsOverlap));
+ ActionManager::register_toggle_action (option_actions, X_("PrimaryClockDeltaEditCursor"), _("Primary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_PrimaryClockDeltaEditCursor));
+ ActionManager::register_toggle_action (option_actions, X_("SecondaryClockDeltaEditCursor"), _("Secondary Clock delta to edit cursor"), mem_fun (*this, &ARDOUR_UI::toggle_SecondaryClockDeltaEditCursor));
act = ActionManager::register_toggle_action (option_actions, X_("DoNotRunPluginsWhileRecording"), _("Do not run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_DoNotRunPluginsWhileRecording));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_toggle_action (option_actions, X_("ShowSoloMutes"), _("Show solo muting"), mem_fun (*this, &ARDOUR_UI::toggle_ShowSoloMutes));
+ ActionManager::session_sensitive_actions.push_back (act);
+
+ act = ActionManager::register_action (option_actions, X_("DisableAllPlugins"), _("Disable All Plugins"), mem_fun (*this, &ARDOUR_UI::disable_all_plugins));
+ ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (option_actions, X_("ABAllPlugins"), _("A/B All Plugins"), mem_fun (*this, &ARDOUR_UI::ab_all_plugins));
+ ActionManager::session_sensitive_actions.push_back (act);
/* !!! REMEMBER THAT RADIO ACTIONS HAVE TO BE HANDLED WITH MORE FINESSE THAN SIMPLE TOGGLES !!! */
act = ActionManager::register_radio_action (option_actions, output_auto_connect_group, X_("OutputAutoConnectManual"), _("Manually connect outputs"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_output_auto_connect), (AutoConnectOption) 0)));
ActionManager::session_sensitive_actions.push_back (act);
+ RadioAction::Group remote_group;
+
+ act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteUserDefined"), _("Remote ID assigned by User"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), UserOrdered)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteMixerDefined"), _("Remote ID follows order of Mixer"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), MixerOrdered)));
+ ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_radio_action (option_actions, remote_group, X_("RemoteEditorDefined"), _("Remote ID follows order of Editor"), hide_return (bind (mem_fun (*this, &ARDOUR_UI::set_remote_model), EditorOrdered)));
+ ActionManager::session_sensitive_actions.push_back (act);
+
ActionManager::add_action_group (shuttle_actions);
ActionManager::add_action_group (option_actions);
ActionManager::add_action_group (jack_actions);
}
}
+void
+ARDOUR_UI::toggle_control_protocol_feedback (ControlProtocolInfo* cpi, const char* group, string action)
+{
+ if (!session) {
+ /* this happens when we build the menu bar when control protocol support
+ has been used in the past for some given protocol - the item needs
+ to be made active, but there is no session yet.
+ */
+ return;
+ }
+
+ if (cpi->protocol) {
+ Glib::RefPtr<Gtk::Action> act = ActionManager::get_action (group, action.c_str());
+
+ if (act) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ if (tact) {
+ bool x = tact->get_active();
+
+ if (x != cpi->protocol->get_feedback()) {
+ cpi->protocol->set_feedback (x);
+ }
+ }
+ }
+ }
+}
+
+void
+ARDOUR_UI::set_jack_buffer_size (nframes_t nframes)
+{
+ Glib::RefPtr<Action> action;
+ char* action_name = 0;
+
+ switch (nframes) {
+ case 32:
+ action_name = X_("JACKLatency32");
+ break;
+ case 64:
+ action_name = X_("JACKLatency64");
+ break;
+ case 128:
+ action_name = X_("JACKLatency128");
+ break;
+ case 512:
+ action_name = X_("JACKLatency512");
+ break;
+ case 1024:
+ action_name = X_("JACKLatency1024");
+ break;
+ case 2048:
+ action_name = X_("JACKLatency2048");
+ break;
+ case 4096:
+ action_name = X_("JACKLatency4096");
+ break;
+ case 8192:
+ action_name = X_("JACKLatency8192");
+ break;
+ default:
+ /* XXX can we do anything useful ? */
+ break;
+ }
+
+ if (action_name) {
+
+ action = ActionManager::get_action (X_("JACK"), action_name);
+
+ if (action) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic (action);
+
+ if (ract && ract->get_active()) {
+ engine->request_buffer_size (nframes);
+ update_sample_rate (0);
+ }
+ }
+ }
+}
+
void
ARDOUR_UI::build_control_surface_menu ()
{
list<ControlProtocolInfo*>::iterator i;
+ bool with_feedback;
/* !!! this has to match the top level entry from ardour.menus */
(bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol), *i)));
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+
+ with_feedback = false;
if ((*i)->protocol || (*i)->requested) {
tact->set_active ();
ui += "<menuitem action='";
ui += action_name;
ui += "'/>\n";
+
+ if ((*i)->supports_feedback) {
+
+ string submenu_name = action_name;
+
+ submenu_name += "SubMenu";
+
+ ActionManager::register_action (editor->editor_actions, submenu_name.c_str(), _("Controls"));
+
+ action_name += "Feedback";
+
+ Glib::RefPtr<Action> act = ActionManager::register_toggle_action (editor->editor_actions, action_name.c_str(), _("Feedback"),
+ (bind (mem_fun (*this, &ARDOUR_UI::toggle_control_protocol_feedback),
+ *i,
+ "Editor",
+ action_name)));
+
+ ui += "<menu action='";
+ ui += submenu_name;
+ ui += "'>\n<menuitem action='";
+ ui += action_name;
+ ui += "'/>\n</menu>\n";
+
+ if ((*i)->protocol) {
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
+ tact->set_active ((*i)->protocol->get_feedback ());
+ }
+ }
}
}
sample_rate_label.set_name ("SampleRate");
menu_hbox.pack_start (*menu_bar, true, true);
- menu_hbox.pack_end (wall_clock_box, false, false, 10);
- menu_hbox.pack_end (disk_space_box, false, false, 10);
- menu_hbox.pack_end (cpu_load_box, false, false, 10);
- menu_hbox.pack_end (buffer_load_box, false, false, 10);
- menu_hbox.pack_end (sample_rate_box, false, false, 10);
+ if (!Profile->get_small_screen()) {
+ menu_hbox.pack_end (wall_clock_box, false, false, 2);
+ menu_hbox.pack_end (disk_space_box, false, false, 4);
+ }
+ menu_hbox.pack_end (cpu_load_box, false, false, 4);
+ menu_hbox.pack_end (buffer_load_box, false, false, 4);
+ menu_hbox.pack_end (sample_rate_box, false, false, 4);
menu_bar_base.set_name ("MainMenuBar");
menu_bar_base.add (menu_hbox);
}
+
+void
+ARDOUR_UI::setup_clock ()
+{
+ ARDOUR_UI::Clock.connect (bind (mem_fun (big_clock, &AudioClock::set), false));
+
+ big_clock_window = new Window (WINDOW_TOPLEVEL);
+
+ big_clock_window->set_border_width (0);
+ big_clock_window->add (big_clock);
+
+ WindowTitle title(Glib::get_application_name());
+ title += _("Clock");
+ big_clock_window->set_title (title.get_string());
+ big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
+ big_clock_window->signal_realize().connect (bind (sigc::ptr_fun (set_decoration), big_clock_window, (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
+ big_clock_window->signal_unmap().connect (bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleBigClock")));
+
+ if (editor) {
+ editor->ensure_float (*big_clock_window);
+ }
+
+ manage_window (*big_clock_window);
+}