2.X commits up to and including 7519

git-svn-id: svn://localhost/ardour2/branches/3.0@7661 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-08-20 22:36:35 +00:00
parent c2e491b8fc
commit b2bf4eee3d
12 changed files with 107 additions and 13 deletions

View 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);
}

View 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

View File

@ -1424,6 +1424,7 @@ AudioRegionView::show_region_editor ()
}
editor->present ();
editor->set_position (Gtk::WIN_POS_MOUSE);
editor->show_all();
}

View 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:";

View 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;

View 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 ();

View 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"));
}
}

View 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);

View 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.
*/

View 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;

View 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;

View 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());
}