#include "pbd/openuri.h"
#include "pbd/file_utils.h"
+#include "gtkmm2ext/application.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/click_box.h"
void
ARDOUR_UI::startup ()
{
+ Application* app = Application::instance ();
+
+ app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
+ app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
#ifdef PHONE_HOME
call_the_mothership (VERSIONSTRING);
#endif
+ app->ready ();
+
if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
exit (1);
}
void
ARDOUR_UI::use_menubar_as_top_menubar ()
{
- gtk_application_set_menu_bar ((GtkMenuShell*) menu_bar->gobj());
+ Gtk::Widget* widget;
+ Application* app = Application::instance ();
+
+ /* Quit will be taken of separately */
+
+ if ((widget = ActionManager::get_widget ("/ui/Main/Session/Quit"))) {
+ widget->hide ();
+ }
+
+ GtkApplicationMenuGroup* group = app->add_app_menu_group ();
+
+ if ((widget = ActionManager::get_widget ("/ui/Main/Help/About"))) {
+ app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
+ }
+
+ if ((widget = ActionManager::get_widget ("/ui/Main/WindowMenu/ToggleOptionsEditor"))) {
+ app->add_app_menu_item (group, dynamic_cast<MenuItem*>(widget));
+ }
+
+ app->set_menu_bar (*menu_bar);
}
void
}
editor->present ();
+ editor->set_position (Gtk::WIN_POS_MOUSE);
editor->show_all();
}
*/
path = dir_path;
+
+ /* JACK is often in /usr/local/bin and since Info.plist refuses to
+ set PATH, we have to force this in order to discover a running
+ instance of JACK ...
+ */
+
+ path += ':';
+ path += "/usr/local/bin";
+
if (cstr) {
path += ':';
path += cstr;
setenv ("ARDOUR_MODULE_PATH", path.c_str(), 1);
- path = dir_path;
+ path = user_config_directory.to_string();
+ path += ':';
+ path += dir_path;
path += "/../Resources/icons:";
path += dir_path;
path += "/../Resources/pixmaps:";
PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert> insert, bool scrollable)
: parent (win)
+ , was_visible (false)
+ , _keyboard_focused (false)
{
bool have_gui = false;
- non_gtk_gui = false;
- was_visible = false;
Label* label = manage (new Label());
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
GenericPluginUI* pu = new GenericPluginUI (insert, scrollable);
_pluginui = pu;
+ _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
add (*pu);
/*
VSTPluginUI* vpu = new VSTPluginUI (insert, vp);
_pluginui = vpu;
+ _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
add (*vpu);
vpu->package (*this);
}
- non_gtk_gui = true;
return true;
#endif
}
#else
VBox* box;
_pluginui = create_au_gui (insert, &box);
+ _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
add (*box);
- non_gtk_gui = true;
extern sigc::signal<void,bool> ApplicationActivationChanged;
ApplicationActivationChanged.connect (sigc::mem_fun (*this, &PluginUIWindow::app_activated));
lpu->package (*this);
}
- non_gtk_gui = false;
return true;
#endif
}
+void
+PluginUIWindow::keyboard_focused (bool yn)
+{
+ _keyboard_focused = yn;
+}
+
bool
PluginUIWindow::on_key_press_event (GdkEventKey* event)
{
- return relay_key_press (event, this);
+ if (_keyboard_focused) {
+ if (_pluginui) {
+ if (_pluginui->non_gtk_gui()) {
+ _pluginui->forward_key_event (event);
+ } else {
+ return relay_key_press (event, this);
+ }
+ }
+ return true;
+ } else {
+ if (_pluginui->non_gtk_gui()) {
+ /* pass editor window as the window for the event
+ to be handled in, not this one, because there are
+ no widgets in this window that we want to have
+ key focus.
+ */
+ return relay_key_press (event, &PublicEditor::instance());
+ } else {
+ return relay_key_press (event, this);
+ }
+ }
}
bool
-PluginUIWindow::on_key_release_event (GdkEventKey *)
+PluginUIWindow::on_key_release_event (GdkEventKey *event)
{
- return true;
+ if (_keyboard_focused) {
+ if (_pluginui) {
+ if (_pluginui->non_gtk_gui()) {
+ _pluginui->forward_key_event (event);
+ }
+ return true;
+ }
+ return false;
+ } else {
+ return true;
+ }
}
void
focus_button.add (*focus_out_image);
focus_out_image->show ();
ARDOUR_UI::instance()->set_tip (focus_button, string_compose (_("Click to allow the plugin to receive keyboard events that %1 would normally use as a shortcut"), PROGRAM_NAME));
+ KeyboardFocused (false);
} else {
Keyboard::the_keyboard().magic_widget_grab_focus();
focus_button.remove ();
focus_button.add (*focus_in_image);
focus_in_image->show ();
ARDOUR_UI::instance()->set_tip (focus_button, string_compose (_("Click to allow normal use of %1 keyboard shortcuts"), PROGRAM_NAME));
+ KeyboardFocused (true);
}
return true;
virtual bool on_window_show(const Glib::ustring& /*title*/) { return true; }
virtual void on_window_hide() {}
+ virtual void forward_key_event (GdkEventKey*) {}
+ virtual bool non_gtk_gui() const { return false; }
+
+ sigc::signal<void,bool> KeyboardFocused;
+
protected:
boost::shared_ptr<ARDOUR::PluginInsert> insert;
boost::shared_ptr<ARDOUR::Plugin> plugin;
PBD::ScopedConnection death_connection;
Gtk::Window* parent;
Gtk::VBox vbox;
- bool non_gtk_gui;
bool was_visible;
+ bool _keyboard_focused;
+ void keyboard_focused (bool yn);
void app_activated (bool);
void plugin_going_away ();
}
if (same_size) {
channel_strings.push_back (_("all files in one track"));
+ channel_strings.push_back (_("merge files"));
}
}
new_folder_chooser.set_title (_("Select folder for session"));
#ifdef GTKOSX
- new_folder_chooser->add_shortcut_folder_uri("file:///Volumes");
+ new_folder_chooser->add_shortcut_folder ("/Volumes");
#endif
vbox1->pack_start (*hbox2, false, false);
existing_session_chooser.set_title (_("Select session file"));
existing_session_chooser.signal_file_set().connect (sigc::mem_fun (*this, &ArdourStartup::existing_session_selected));
+#ifdef GTKOSX
+ existing_session_chooser->add_shortcut_folder ("/Volumes");
+#endif
+
HBox* hbox = manage (new HBox);
hbox->set_spacing (4);
hbox->pack_start (*manage (new Label (_("Browse:"))), PACK_SHRINK);
}
}
- if (!opaque()) {
+ if (!opaque() && (buf != mixdown_buffer)) {
/* gack. the things we do for users.
*/
{
if (!other)
return false;
+
+ if ((_sources.size() != other->_sources.size()) ||
+ (_master_sources.size() != other->_master_sources.size())) {
+ return false;
+ }
SourceList::const_iterator i;
SourceList::const_iterator io;
if (tr) {
tr->realtime_set_speed (tr->speed(), true);
}
+ (*i)->automation_snapshot (_transport_frame, true);
}
Timecode::Time time;
: Command(rhs._name)
, _clearing(false)
{
+ _timestamp = rhs._timestamp;
clear ();
actions.insert(actions.end(),rhs.actions.begin(),rhs.actions.end());
}