From: Paul Davis Date: Fri, 20 Aug 2010 22:36:35 +0000 (+0000) Subject: 2.X commits up to and including 7519 X-Git-Tag: 3.0-alpha5~1602 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=b2bf4eee3d9ca63a34415c75e877b8c97d6b5f13;p=ardour.git 2.X commits up to and including 7519 git-svn-id: svn://localhost/ardour2/branches/3.0@7661 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 2cf6c8aaae..71644109c3 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -45,6 +45,7 @@ #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" @@ -664,11 +665,17 @@ Please consider the possibilities, and perhaps (re)start JACK.")); 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); } diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index a0d5330e6e..4f1f980751 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -552,7 +552,26 @@ ARDOUR_UI::build_menu_bar () 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(widget)); + } + + if ((widget = ActionManager::get_widget ("/ui/Main/WindowMenu/ToggleOptionsEditor"))) { + app->add_app_menu_item (group, dynamic_cast(widget)); + } + + app->set_menu_bar (*menu_bar); } void diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index c895a0663c..c16bea4109 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -1424,6 +1424,7 @@ AudioRegionView::show_region_editor () } editor->present (); + editor->set_position (Gtk::WIN_POS_MOUSE); editor->show_all(); } diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index c17d39d2a2..ecb1f23716 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -128,6 +128,15 @@ fixup_bundle_environment () */ 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; @@ -143,7 +152,9 @@ fixup_bundle_environment () 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:"; diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 9d569ad42b..a230913abe 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -76,10 +76,10 @@ using namespace Gtk; PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr 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 ("THIS IS THE PLUGIN UI"); @@ -120,6 +120,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptrKeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused)); add (*pu); /* @@ -266,11 +267,11 @@ PluginUIWindow::create_vst_editor(boost::shared_ptr) 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 } @@ -287,8 +288,8 @@ PluginUIWindow::create_audiounit_editor (boost::shared_ptr) #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 ApplicationActivationChanged; ApplicationActivationChanged.connect (sigc::mem_fun (*this, &PluginUIWindow::app_activated)); @@ -341,21 +342,56 @@ PluginUIWindow::create_lv2_editor(boost::shared_ptr insert) 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 @@ -539,12 +575,14 @@ PlugUIBase::focus_toggled (GdkEventButton*) 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; diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index bfd23fab6b..e53e08530b 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -93,6 +93,11 @@ class PlugUIBase : public virtual sigc::trackable 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 KeyboardFocused; + protected: boost::shared_ptr insert; boost::shared_ptr plugin; @@ -268,8 +273,9 @@ class PluginUIWindow : public Gtk::Window 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 (); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 96380f3bff..49eeadeb3a 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -1012,6 +1012,7 @@ SoundFileOmega::reset_options () } if (same_size) { channel_strings.push_back (_("all files in one track")); + channel_strings.push_back (_("merge files")); } } diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index fbf7d4ab47..f8e871f70b 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -682,7 +682,7 @@ ArdourStartup::setup_new_session_page () 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); @@ -934,6 +934,10 @@ ArdourStartup::setup_existing_session_page () 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); diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 992ae7fab2..7212cf8e4c 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -522,7 +522,7 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit, } } - if (!opaque()) { + if (!opaque() && (buf != mixdown_buffer)) { /* gack. the things we do for users. */ diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 234dddcc45..65f7d6fedc 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1404,6 +1404,11 @@ Region::source_equivalent (boost::shared_ptr other) const { 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; diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc index 8d885d686f..bc4ef8decc 100644 --- a/libs/ardour/session_transport.cc +++ b/libs/ardour/session_transport.cc @@ -1135,6 +1135,7 @@ Session::start_transport () if (tr) { tr->realtime_set_speed (tr->speed(), true); } + (*i)->automation_snapshot (_transport_frame, true); } Timecode::Time time; diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index 120f62c351..fd7c4d5fb8 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -41,6 +41,7 @@ UndoTransaction::UndoTransaction (const UndoTransaction& rhs) : Command(rhs._name) , _clearing(false) { + _timestamp = rhs._timestamp; clear (); actions.insert(actions.end(),rhs.actions.begin(),rhs.actions.end()); }