2.X commits up to and including 7519
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 20 Aug 2010 22:36:35 +0000 (22:36 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 20 Aug 2010 22:36:35 +0000 (22:36 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7661 d708f5d6-7413-0410-9779-e7cbd77b26cf

12 files changed:
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui_ed.cc
gtk2_ardour/audio_region_view.cc
gtk2_ardour/main.cc
gtk2_ardour/plugin_ui.cc
gtk2_ardour/plugin_ui.h
gtk2_ardour/sfdb_ui.cc
gtk2_ardour/startup.cc
libs/ardour/audioregion.cc
libs/ardour/region.cc
libs/ardour/session_transport.cc
libs/pbd/undo.cc

index 2cf6c8aaae0cf1c696950906afbb3d6b0e0be014..71644109c300f8511d677eec950f3ef1197d0cc8 100644 (file)
@@ -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);
        }
index a0d5330e6eb56cf1e6100dc198e4dd6945545014..4f1f98075110ba641f946e71d68e1b784cdacb31 100644 (file)
@@ -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<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
index c895a0663cdeca6a2e247ca2562a2dcea9eaa80d..c16bea41095022fa9ec035e5f3c03e41701b42af 100644 (file)
@@ -1424,6 +1424,7 @@ AudioRegionView::show_region_editor ()
        }
 
        editor->present ();
+       editor->set_position (Gtk::WIN_POS_MOUSE);
        editor->show_all();
 }
 
index c17d39d2a2a609f7df082417615b45b8f2bec507..ecb1f23716f92d2c6665daf6caee5f66a86d3798 100644 (file)
@@ -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:";
index 9d569ad42b6d5ae17b3e5c95e7791e7df5eacae3..a230913abe1cb50f7fc450776b3d9de56f736252 100644 (file)
@@ -76,10 +76,10 @@ using namespace Gtk;
 
 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>");
@@ -120,6 +120,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
                GenericPluginUI*  pu  = new GenericPluginUI (insert, scrollable);
 
                _pluginui = pu;
+               _pluginui->KeyboardFocused.connect (sigc::mem_fun (*this, &PluginUIWindow::keyboard_focused));
                add (*pu);
 
                /*
@@ -266,11 +267,11 @@ PluginUIWindow::create_vst_editor(boost::shared_ptr<PluginInsert>)
                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<PluginInsert>)
 #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));
@@ -341,21 +342,56 @@ PluginUIWindow::create_lv2_editor(boost::shared_ptr<PluginInsert> 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;
index bfd23fab6b91965a2f0988dc78605fc7ad3495d9..e53e08530b32f500b34958523878013b86966b62 100644 (file)
@@ -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<void,bool> KeyboardFocused;
+
   protected:
        boost::shared_ptr<ARDOUR::PluginInsert> insert;
        boost::shared_ptr<ARDOUR::Plugin> 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 ();
index 96380f3bff2257b66b3da32cb85cb6c49de36954..49eeadeb3a0ea2961889c337f7bc66ce95d90084 100644 (file)
@@ -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"));
                        }
 
                }
index fbf7d4ab47f795fb441dbdd564ee96042fe232c1..f8e871f70bbae44ee22413f6905352e259f32b77 100644 (file)
@@ -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);
index 992ae7fab28269a08850f680e30e31868cb6053a..7212cf8e4cb62d85098913782e7cd1bfa4deb218 100644 (file)
@@ -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.
                 */
index 234dddcc45bef1fa7ecca300df020cd15e303f11..65f7d6fedc01110bb13777beef8d707346aefbe6 100644 (file)
@@ -1404,6 +1404,11 @@ Region::source_equivalent (boost::shared_ptr<const Region> 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;
index 8d885d686f49a478e5cbff4550466a00beca11cb..bc4ef8decc3282739c0af9bfa4154a1339c75f46 100644 (file)
@@ -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;
index 120f62c3512c78d263ae48a3aa6e9990b6eea30b..fd7c4d5fb85f6f052be32ae29bca7db9c039e592 100644 (file)
@@ -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());
 }