diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index 10881a0fb0..0279384fb5 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -506,7 +506,7 @@ - + diff --git a/gtk2_ardour/ardour_dialog.cc b/gtk2_ardour/ardour_dialog.cc index c0e1708781..6775a70953 100644 --- a/gtk2_ardour/ardour_dialog.cc +++ b/gtk2_ardour/ardour_dialog.cc @@ -34,12 +34,14 @@ sigc::signal ArdourDialog::CloseAllDialogs; ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator) : Dialog (title, modal, use_seperator) + , _splash_pushed (false) { init (); } ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool use_seperator) : Dialog (title, parent, modal, use_seperator) + , _splash_pushed (false) { init (); set_position (Gtk::WIN_POS_CENTER_ON_PARENT); @@ -47,6 +49,13 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool ArdourDialog::~ArdourDialog () { + if (_splash_pushed) { + Splash* spl = Splash::instance(); + + if (spl) { + spl->pop_front(); + } + } } bool @@ -73,15 +82,16 @@ ArdourDialog::on_unmap () void ArdourDialog::on_show () { + Dialog::on_show (); + // never allow the splash screen to obscure any dialog Splash* spl = Splash::instance(); - if (spl) { + if (spl && spl->is_visible()) { spl->pop_back_for (*this); + _splash_pushed = true; } - - Dialog::on_show (); } void diff --git a/gtk2_ardour/ardour_dialog.h b/gtk2_ardour/ardour_dialog.h index 4f53662c23..1008f63000 100644 --- a/gtk2_ardour/ardour_dialog.h +++ b/gtk2_ardour/ardour_dialog.h @@ -46,6 +46,7 @@ class ArdourDialog : public Gtk::Dialog, public ARDOUR::SessionHandlePtr static void close_all_dialogs () { CloseAllDialogs(); } private: + bool _splash_pushed; void init (); static sigc::signal CloseAllDialogs; diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 34fb109bc7..36484bde38 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -3779,12 +3779,14 @@ audio may be played at the wrong sample rate.\n"), desired, PROGRAM_NAME, actual image->show(); hbox->show(); - switch (dialog.run ()) { + switch (dialog.run()) { case RESPONSE_ACCEPT: return 0; default: - return 1; + break; } + + return 1; } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 6300a352d5..a326669ec3 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -310,7 +310,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void goto_editor_window (); void goto_mixer_window (); void toggle_mixer_window (); - void toggle_mixer_on_top (); + void toggle_editor_mixer (); int setup_windows (); void setup_transport (); diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index b9b0cdb6a2..7438fab9f0 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -150,21 +150,49 @@ ARDOUR_UI::toggle_mixer_window () } void -ARDOUR_UI::toggle_mixer_on_top () +ARDOUR_UI::toggle_editor_mixer () { + if (editor && mixer) { - if (gtk_window_is_active(Mixer_UI::instance()->gobj())) { + if (editor->get_screen() != mixer->get_screen()) { + // different screens, so don't do anything + return; + } + + /* See if they are obscuring each other */ + + gint ex, ey, ew, eh; + gint mx, my, mw, mh; + + editor->get_position (ex, ey); + editor->get_size (ew, eh); + + mixer->get_position (mx, my); + mixer->get_size (mw, mh); + + GdkRectangle e; + GdkRectangle m; + GdkRectangle r; + + e.x = ex; + e.y = ey; + e.width = ew; + e.height = eh; + + m.x = mx; + m.y = my; + m.width = mw; + m.height = mh; + + if (!gdk_rectangle_intersect (&e, &m, &r)) { + /* they do not intersect so do not toggle */ + return; + } + } + + if (mixer && mixer->fully_visible()) { goto_editor_window (); } else { - Glib::RefPtr act = ActionManager::get_action (X_("Common"), X_("toggle-mixer")); - if (act) { - Glib::RefPtr tact = Glib::RefPtr::cast_dynamic (act); - - /* Toggle the mixer to `visible' if required */ - if (!tact->get_active ()) { - tact->set_active (true); - } - } goto_mixer_window (); } } diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 2d279385ae..66335bb55b 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -239,7 +239,7 @@ ARDOUR_UI::install_actions () ActionManager::session_sensitive_actions.push_back (act); ActionManager::register_toggle_action (common_actions, X_("toggle-mixer"), S_("Window|Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_window)); - ActionManager::register_action (common_actions, X_("toggle-mixer-on-top"), _("Mixer on Top"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_mixer_on_top)); + ActionManager::register_action (common_actions, X_("toggle-editor-mixer"), _("Toggle Editor+Mixer"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_editor_mixer)); ActionManager::register_toggle_action (common_actions, X_("ToggleRCOptionsEditor"), _("Preferences"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_rc_options_window)); ActionManager::register_toggle_action (common_actions, X_("ToggleSessionOptionsEditor"), _("Properties"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_session_options_window)); act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Tracks and Busses"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_route_params_window)); diff --git a/gtk2_ardour/au_pluginui.h b/gtk2_ardour/au_pluginui.h index 6f90480457..cbf83d5d92 100644 --- a/gtk2_ardour/au_pluginui.h +++ b/gtk2_ardour/au_pluginui.h @@ -93,7 +93,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox int prefwidth; Gtk::HBox top_box; - Gtk::EventBox low_box; + Gtk::HBox low_box; Gtk::VBox vpacker; Gtk::Label automation_mode_label; Gtk::ComboBoxText automation_mode_selector; diff --git a/gtk2_ardour/au_pluginui.mm b/gtk2_ardour/au_pluginui.mm index f394e305c8..16d4e7e6fc 100644 --- a/gtk2_ardour/au_pluginui.mm +++ b/gtk2_ardour/au_pluginui.mm @@ -1,5 +1,3 @@ -#include - #undef Marker #define Marker FuckYouAppleAndYourLackOfNameSpaces @@ -170,13 +168,16 @@ AUPluginUI::AUPluginUI (boost::shared_ptr insert) top_box.show (); low_box.show (); - _activating_from_app = false; cocoa_parent = 0; - _notify = 0; cocoa_window = 0; - carbon_window = 0; + +#ifdef WITH_CARBBON + _activating_from_app = false; + _notify = 0; au_view = 0; editView = 0; + carbon_window = 0; +#endif /* prefer cocoa, fall back to cocoa, but use carbon if its there */ @@ -227,6 +228,7 @@ AUPluginUI::~AUPluginUI () bool AUPluginUI::test_carbon_view_support () { +#ifdef WITH_CARBON bool ret = false; carbon_descriptor.componentType = kAudioUnitCarbonViewComponentType; @@ -253,6 +255,9 @@ AUPluginUI::test_carbon_view_support () } return ret; +#else + return false; +#endif } bool @@ -282,7 +287,7 @@ AUPluginUI::plugin_class_valid (Class pluginClass) int AUPluginUI::create_cocoa_view () { - BOOL wasAbleToLoadCustomView = NO; + bool wasAbleToLoadCustomView = false; AudioUnitCocoaViewInfo* cocoaViewInfo = NULL; UInt32 numberOfClasses = 0; UInt32 dataSize; @@ -380,7 +385,7 @@ AUPluginUI::create_cocoa_view () free (cocoaViewInfo); } - wasAbleToLoadCustomView = YES; + wasAbleToLoadCustomView = true; } } @@ -390,14 +395,16 @@ AUPluginUI::create_cocoa_view () au->get_au())); au_view = [[AUGenericView alloc] initWithAudioUnit:*au->get_au()]; DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("view created @ %1\n", au_view)); - [(AUGenericView *)au_view setShowsExpertParameters:YES]; + [(AUGenericView *)au_view setShowsExpertParameters:1]; } // Get the initial size of the new AU View's frame NSRect rect = [au_view frame]; + prefheight = rect.size.height; + prefwidth = rect.size.width; low_box.set_size_request (rect.size.width, rect.size.height); - + return 0; } @@ -409,7 +416,7 @@ AUPluginUI::cocoa_view_resized () NSSize oldContentSize= [window contentRectForFrameRect:[window frame]].size; NSSize newContentSize= [au_view frame].size; NSRect windowFrame= [window frame]; - + oldContentSize.height -= topsize.height; float dy = oldContentSize.height - newContentSize.height; @@ -427,7 +434,7 @@ AUPluginUI::cocoa_view_resized () NSUInteger old_auto_resize = [au_view autoresizingMask]; [au_view setAutoresizingMask:NSViewNotSizable]; - [window setFrame:windowFrame display:YES]; + [window setFrame:windowFrame display:1]; [au_view setAutoresizingMask:old_auto_resize]; [[NSNotificationCenter defaultCenter] addObserver:_notify @@ -603,7 +610,7 @@ AUPluginUI::parent_cocoa_window () return -1; } - [win setAutodisplay:YES]; // turn of GTK stuff for this window + [win setAutodisplay:1]; // turn of GTK stuff for this window Gtk::Container* toplevel = get_toplevel(); @@ -620,7 +627,7 @@ AUPluginUI::parent_cocoa_window () NSPoint origin = { 0, a.height }; [au_view setFrameOrigin:origin]; - [view addSubview:au_view positioned:NSWindowBelow relativeTo:nil]; + [view addSubview:au_view positioned:NSWindowBelow relativeTo:nil]; // watch for size changes of the view @@ -681,7 +688,7 @@ AUPluginUI::on_realize () NSWindow* win = get_nswindow (); if (win) { - [win setShowsResizeIndicator:NO]; + [win setShowsResizeIndicator:0]; } } diff --git a/gtk2_ardour/automation_controller.h b/gtk2_ardour/automation_controller.h index 88e6d87e01..29635c8488 100644 --- a/gtk2_ardour/automation_controller.h +++ b/gtk2_ardour/automation_controller.h @@ -21,6 +21,13 @@ #ifndef __ardour_gtk_automation_controller_h__ #define __ardour_gtk_automation_controller_h__ +#ifdef YES +#undef YES +#endif +#ifdef NO +#undef NO +#endif + #include #include diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index b7cc7b9f27..280f401fdf 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -233,7 +233,8 @@ pane_size_watcher (Paned* pane) } Editor::Editor () - : _join_object_range_state (JOIN_OBJECT_RANGE_NONE) + : VisibilityTracker (*((Gtk::Window*) this)) + , _join_object_range_state (JOIN_OBJECT_RANGE_NONE) /* time display buttons */ , minsec_label (_("Mins:Secs")) diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 910df94c26..1c246a3f3b 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -43,6 +43,7 @@ #include "gtkmm2ext/dndtreeview.h" #include "gtkmm2ext/stateful_button.h" #include "gtkmm2ext/bindings.h" +#include "gtkmm2ext/visibility_tracker.h" #include "pbd/stateful.h" #include "pbd/signals.h" @@ -146,7 +147,7 @@ class ImageFrameSocketHandler ; class TimeAxisViewItem ; /* */ -class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr +class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public Gtkmm2ext::VisibilityTracker { public: Editor (); diff --git a/gtk2_ardour/editor_canvas_events.cc b/gtk2_ardour/editor_canvas_events.cc index 4c49dd1a9b..fd44ed3f2e 100644 --- a/gtk2_ardour/editor_canvas_events.cc +++ b/gtk2_ardour/editor_canvas_events.cc @@ -73,10 +73,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) temporal_zoom_step (false); zoom_focus = temp_focus; return true; - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { direction = GDK_SCROLL_LEFT; goto retry; - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { if (!current_stepping_trackview) { step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500); std::pair const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize); @@ -102,10 +102,10 @@ Editor::track_canvas_scroll (GdkEventScroll* ev) temporal_zoom_step (true); zoom_focus = temp_focus; return true; - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { direction = GDK_SCROLL_RIGHT; goto retry; - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) { + } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { if (!current_stepping_trackview) { step_timeout = Glib::signal_timeout().connect (sigc::mem_fun(*this, &Editor::track_height_step_timeout), 500); std::pair const p = trackview_by_y_position (ev->y + vertical_adjustment.get_value() - canvas_timebars_vsize); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 070ce4bc6e..3bca0ad935 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -17,7 +17,6 @@ */ -#include #include #include diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 74556c8eda..e3a97daa6f 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -83,6 +83,7 @@ Mixer_UI::instance () Mixer_UI::Mixer_UI () : Window (Gtk::WINDOW_TOPLEVEL) + , VisibilityTracker (*((Gtk::Window*) this)) , _visible (false) , no_track_list_redisplay (false) , in_group_row_change (false) diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h index 2946d0ae59..8a293f7f9f 100644 --- a/gtk2_ardour/mixer_ui.h +++ b/gtk2_ardour/mixer_ui.h @@ -40,6 +40,8 @@ #include "ardour/types.h" #include "ardour/session_handle.h" +#include "gtkmm2ext/visibility_tracker.h" + #include "enums.h" #include "mixer_actor.h" @@ -53,7 +55,7 @@ class PluginSelector; class MixerGroupTabs; class MonitorSection; -class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public MixerActor +class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public MixerActor, public Gtkmm2ext::VisibilityTracker { public: static Mixer_UI* instance(); diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in index 0f0415c983..ef596478fc 100644 --- a/gtk2_ardour/mnemonic-us.bindings.in +++ b/gtk2_ardour/mnemonic-us.bindings.in @@ -219,7 +219,7 @@ This mode provides many different operations on both regions and control points, @sess|Main/AddTrackBus|<@PRIMARY@><@TERTIARY@>n|add track(s) or bus(ses) @sess|Main/New|<@PRIMARY@>n|open a new session @rop|Region/toggle-region-mute|<@PRIMARY@>m|mute/unmute -@wvis|Common/toggle-mixer-on-top|<@WINDOW@>m|rotate editor \& mixer window +@wvis|Common/toggle-editor-mixer|<@WINDOW@>m|rotate editor \& mixer window ;; arrow keys, navigation etc. diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 2dd8741a13..5b281f33ab 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -226,6 +226,12 @@ PluginUIWindow::on_show () } if (_pluginui) { +#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX) + if (pre_deactivate_x >= 0) { + move (pre_deactivate_x, pre_deactivate_y); + } +#endif + if (_pluginui->on_window_show (_title)) { Window::on_show (); } @@ -239,6 +245,10 @@ PluginUIWindow::on_show () void PluginUIWindow::on_hide () { +#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX) + get_position (pre_deactivate_x, pre_deactivate_y); +#endif + Window::on_hide (); if (_pluginui) { diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 0922ec75ba..99adff68e9 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -25,6 +25,10 @@ #include "ardour/ardour.h" #include "ardour/filesystem_paths.h" +#ifdef check +#undef check +#endif + #include "gui_thread.h" #include "splash.h" @@ -96,15 +100,33 @@ Splash::~Splash () void Splash::pop_back_for (Gtk::Window& win) { +#ifdef __APPLE__ + /* April 2013: window layering on OS X is a bit different to X Window. at present, + the "restack()" functionality in GDK will only operate on windows in the same + "level" (e.g. two normal top level windows, or two utility windows) and will not + work across them. The splashscreen is on its own "StatusWindowLevel" so restacking + is not going to work. + + So for OS X, we just hide ourselves. + */ + hide(); +#else set_keep_above (false); get_window()->restack (win.get_window(), false); - win.signal_hide().connect (sigc::mem_fun (*this, &Splash::pop_front)); +#endif } void Splash::pop_front () { + +#ifdef __APPLE__ + if (get_window()) { + show (); + } +#else set_keep_above (true); +#endif } void diff --git a/gtk2_ardour/system_exec.cc b/gtk2_ardour/system_exec.cc index 1f178a6c68..566c87dfbb 100644 --- a/gtk2_ardour/system_exec.cc +++ b/gtk2_ardour/system_exec.cc @@ -38,6 +38,8 @@ using namespace std; void * interposer_thread (void *arg); +static void close_fd (int* fd) { if (!fd) return; if (*fd >= 0) ::close (*fd); *fd = -1; } + SystemExec::SystemExec (std::string c, std::string a) : cmd(c) { @@ -483,18 +485,18 @@ SystemExec::start (int stderr_mode) pid=r; /* check if execve was successful. */ - ::close(pok[1]); + close_fd(&pok[1]); char buf; for ( ;; ) { ssize_t n = ::read(pok[0], &buf, 1 ); if ( n==1 ) { /* child process returned from execve */ pid=0; - ::close(pok[0]); - ::close(pin[1]); - ::close(pin[0]); - ::close(pout[1]); - ::close(pout[0]); + close_fd(&pok[0]); + close_fd(&pin[1]); + close_fd(&pin[0]); + close_fd(&pout[1]); + close_fd(&pout[0]); pin[1] = -1; return -3; } else if ( n==-1 ) { @@ -503,7 +505,7 @@ SystemExec::start (int stderr_mode) } break; } - ::close(pok[0]); + close_fd(&pok[0]); /* child started successfully */ #if 0 @@ -519,17 +521,17 @@ SystemExec::start (int stderr_mode) } if (r == 0) { /* 2nd child process - catch stdout */ - ::close(pin[1]); - ::close(pout[1]); + close_fd(&pin[1]); + close_fd(&pout[1]); output_interposer(); exit(0); } - ::close(pout[1]); - ::close(pin[0]); - ::close(pout[0]); + close_fd(&pout[1]); + close_fd(&pin[0]); + close_fd(&pout[0]); #else /* use pthread */ - ::close(pout[1]); - ::close(pin[0]); + close_fd(&pout[1]); + close_fd(&pin[0]); int rv = pthread_create(&thread_id_tt, NULL, interposer_thread, this); thread_active=true; @@ -543,15 +545,15 @@ SystemExec::start (int stderr_mode) } /* child process - exec external process */ - ::close(pok[0]); + close_fd(&pok[0]); ::fcntl(pok[1], F_SETFD, FD_CLOEXEC); - ::close(pin[1]); + close_fd(&pin[1]); if (pin[0] != STDIN_FILENO) { ::dup2(pin[0], STDIN_FILENO); } - ::close(pin[0]); - ::close(pout[0]); + close_fd(&pin[0]); + close_fd(&pout[0]); if (pout[1] != STDOUT_FILENO) { ::dup2(pout[1], STDOUT_FILENO); } @@ -569,7 +571,7 @@ SystemExec::start (int stderr_mode) } if (pout[1] != STDOUT_FILENO && pout[1] != STDERR_FILENO) { - ::close(pout[1]); + close_fd(&pout[1]); } if (nicelevel !=0) { @@ -596,7 +598,7 @@ SystemExec::start (int stderr_mode) /* if we reach here something went wrong.. */ char buf = 0; (void) ::write(pok[1], &buf, 1 ); - (void) ::close(pok[1]); + close_fd(&pok[1]); exit(-1); return -1; } @@ -631,11 +633,10 @@ void SystemExec::close_stdin() { if (pin[1]<0) return; - ::close(pin[0]); - ::close(pin[1]); - ::close(pout[0]); - ::close(pout[1]); - pin[1] = - 1; // mark as closed + close_fd(&pin[0]); + close_fd(&pin[1]); + close_fd(&pout[0]); + close_fd(&pout[1]); } int diff --git a/libs/ardour/ardour/vst_plugin.h b/libs/ardour/ardour/vst_plugin.h index d9cfd87bad..7ca973cbb7 100644 --- a/libs/ardour/ardour/vst_plugin.h +++ b/libs/ardour/ardour/vst_plugin.h @@ -73,7 +73,6 @@ public: AEffect * plugin () const { return _plugin; } VSTState * state () const { return _state; } - void set_state (VSTState* s) { _state = s; } int set_state (XMLNode const &, int); diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc index 9106d69009..99251f08e4 100644 --- a/libs/ardour/linux_vst_support.cc +++ b/libs/ardour/linux_vst_support.cc @@ -34,8 +34,6 @@ #include #include "ardour/linux_vst_support.h" -#include "ardour/vst_plugin.h" - #include "pbd/basename.h" #include "pbd/error.h" @@ -295,43 +293,36 @@ vstfx_unload (VSTHandle* fhandle) return 0; } -/** - Instantiates a VST plugin and also set _state of its plugin argument - */ +/*This instantiates a plugin*/ -VSTState* -vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void *ptr) +VSTState * +vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr) { VSTState* vstfx = vstfx_new (); - ARDOUR::VSTPlugin* plugin = reinterpret_cast (ptr); - if (fhandle == 0) { + if(fhandle == 0) + { vstfx_error( "** ERROR ** VSTFX : The handle was 0\n" ); return 0; } - if ((vstfx->plugin = fhandle->main_entry (amc)) == 0) { + if ((vstfx->plugin = fhandle->main_entry (amc)) == 0) + { vstfx_error ("** ERROR ** VSTFX : %s could not be instantiated :(\n", fhandle->name); free (vstfx); return 0; } vstfx->handle = fhandle; - vstfx->plugin->user = plugin; + vstfx->plugin->user = userptr; - if (vstfx->plugin->magic != kEffectMagic) { + if (vstfx->plugin->magic != kEffectMagic) + { vstfx_error ("** ERROR ** VSTFX : %s is not a VST plugin\n", fhandle->name); free (vstfx); return 0; } - - /* need to set this here because some plugins make audioMaster - * callbacks from within effOpen, and _state must be set for - * that to work. - */ - plugin->set_state (vstfx); - vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0); /*May or May not need to 'switch the plugin on' here - unlikely diff --git a/libs/ardour/lxvst_plugin.cc b/libs/ardour/lxvst_plugin.cc index 80e6b9c286..6e30e0c443 100755 --- a/libs/ardour/lxvst_plugin.cc +++ b/libs/ardour/lxvst_plugin.cc @@ -32,7 +32,7 @@ LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h) { /* Instantiate the plugin and return a VSTState* */ - if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) { + if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) { throw failed_constructor(); } @@ -44,7 +44,7 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other) { _handle = other._handle; - if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) { + if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) { throw failed_constructor(); } _plugin = _state->plugin; diff --git a/libs/gtkmm2ext/gtkmm2ext/visibility_tracker.h b/libs/gtkmm2ext/gtkmm2ext/visibility_tracker.h index 6415dd6d2b..f4ed62bb21 100644 --- a/libs/gtkmm2ext/gtkmm2ext/visibility_tracker.h +++ b/libs/gtkmm2ext/gtkmm2ext/visibility_tracker.h @@ -35,6 +35,10 @@ class VisibilityTracker { void cycle_visibility (); + bool fully_visible() const; + bool not_visible() const; + bool partially_visible() const; + private: Gtk::Window& window; GdkVisibilityState _visibility; diff --git a/libs/gtkmm2ext/visibility_tracker.cc b/libs/gtkmm2ext/visibility_tracker.cc index c0aabdfca6..d5a020d370 100644 --- a/libs/gtkmm2ext/visibility_tracker.cc +++ b/libs/gtkmm2ext/visibility_tracker.cc @@ -41,10 +41,27 @@ VisibilityTracker::handle_visibility_notify_event (GdkEventVisibility* ev) void VisibilityTracker::cycle_visibility () { - if (window.is_mapped() && (_visibility == GDK_VISIBILITY_UNOBSCURED)) { + if (fully_visible ()) { window.hide (); } else { window.present (); } } +bool +VisibilityTracker::fully_visible () const +{ + return window.is_mapped() && (_visibility == GDK_VISIBILITY_UNOBSCURED); +} + +bool +VisibilityTracker::not_visible () const +{ + return !window.is_mapped() || (_visibility == GDK_VISIBILITY_FULLY_OBSCURED); +} + +bool +VisibilityTracker::partially_visible () const +{ + return window.is_mapped() && (_visibility == GDK_VISIBILITY_PARTIAL); +} diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc index ca614509a5..805b9a2e84 100644 --- a/libs/pbd/stacktrace.cc +++ b/libs/pbd/stacktrace.cc @@ -85,7 +85,6 @@ PBD::stacktrace (std::ostream& out, int levels) for (i = 0; i < size && (levels == 0 || i < size_t(levels)); i++) { out << " " << demangle (strings[i]) << std::endl; - std::cerr << " " << demangle (strings[i]) << std::endl; } free (strings); diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index b332365407..9f70f95eb2 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -530,9 +530,13 @@ done if test x$WITH_HARVID != x ; then cd $APPBIN - HARVID_VERSION=$(curl http://ardour.org/files/video-tools/latest_version_numer.txt) + HARVID_VERSION=$(curl http://ardour.org/files/video-tools/harvid_version.txt) curl -L http://ardour.org/files/video-tools/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz \ | tar -x -z --exclude=README --exclude=harvid.1 --strip-components=1 || exit 1 + XJADEO_VERSION=$(curl http://ardour.org/files/video-tools/xjadeo_version.txt) + curl -L http://ardour.org/files/video-tools/xjadeo-${MULTIARCH}-${XJADEO_VERSION}.tgz \ + | tar -x -z --exclude=README --exclude=xjadeo.1 --strip-components=1 || exit 1 + mv xjadeo xjremote cd - fi diff --git a/tools/osx_packaging/osx_build b/tools/osx_packaging/osx_build index d750674d36..af582ff3bf 100755 --- a/tools/osx_packaging/osx_build +++ b/tools/osx_packaging/osx_build @@ -62,9 +62,13 @@ while [ $# -gt 0 ] ; do esac done -#release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d' ' -f 3 | sed "s/'//g"` -release_version=3.0 -revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d' ' -f 8 | sed 's/[^0-9]//g'` +if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then + echo "application or product-name was not specified" + exit 1 +fi + +release_version=`grep -m 1 '[^A-Za-z_]OSX_VERSION = ' ../../wscript | cut -d"'" -f2` +revision=`grep -m 1 'revision =' ../../libs/ardour/revision.cc | cut -d'"' -f 2 | sed 's/^.*-//g'` echo "Version is $release_version / $revision" info_string="$release_version/$revision built on `hostname` by `whoami` on `date`" echo "Info string is $info_string" diff --git a/tools/videotimeline/install_video_tools.sh b/tools/videotimeline/install_video_tools.sh new file mode 100755 index 0000000000..8ad900a99e --- /dev/null +++ b/tools/videotimeline/install_video_tools.sh @@ -0,0 +1,146 @@ +#!/bin/sh +TARGETDIR="$1" + +if test -z "$(which curl)"; then + echo "This script requires 'curl' - please install it" >&2 + exit 1 +fi + +############################################################################### +### look-up architecture + +case $(uname -m) in + i[3456789]86|x86|i86pc) + echo "Architecture is x86" + MULTIARCH="i386" + ;; + x86_64|amd64|AMD64) + echo "Architecture is x86_64" + MULTIARCH="x86_64" + ;; + *) + echo + echo "ERROR: Unknown architecture `uname -m`" >&2 + exit 1 + ;; +esac + +case $(uname) in + Linux|linux) + MULTIARCH="${MULTIARCH}-linux-gnu" + ;; + *) + echo + echo "ERROR: Platform `uname` is not supported by this script" >&2 + exit 1 + ;; +esac + +echo "Multiarch triplet is '$MULTIARCH'" + + +############################################################################### +### install target directory + +checkdir () { + DUT="$1" + CHECKPATH="${2:-yes}" + ECHO="${3:-echo}" + + if test -z "$DUT"; then + echo "-1" + return + fi + + if test ! -d "$DUT"; then + $ECHO "ERROR: '$DUT' is not a directory'"; >&2 + echo "-1" + return + fi + + if test ! -w "$DUT"; then + $ECHO "ERROR: no write permissions for '$DUT'" >&2 + echo "-1" + return + fi + + echo $PATH | grep -q "$DUT" + if test $? != 0; then + if test "$CHECKPATH" != "yes"; then + $ECHO "WARNING: '$DUT' is not in \$PATH" >&2 + else + $ECHO "ERROR: '$DUT' is not in \$PATH" >&2 + echo "-1" + return + fi + fi + + echo 0 +} + +while test $(checkdir "$TARGETDIR" no) != 0 ; do + + ARDOUR=$(ls -td /opt/Ardour* 2>/dev/null | head -n 1) + if test -n "${ARDOUR}" -a $(checkdir "${ARDOUR}/bin" no true) = 0; then + echo -n "found ardour installation in '${ARDOUR}/bin'. Install there? [Y|n] " + read a; + if test "$a" != "n" -a "$a" != "N"; then + TARGETDIR="${ARDOUR}/bin" + continue + fi + fi + + if test $(checkdir "/usr/bin" yes true) = 0; then + echo -n "Can write to '/usr/bin' Install there? [Y|n] " + read a; + if test "$a" != "n" -a "$a" != "N"; then + TARGETDIR="/usr/bin" + continue + fi + fi + + if test $(checkdir "${HOME}/bin" yes true) = 0; then + echo -n "Found '${HOME}/bin' in PATH. Install there? [Y|n] " + read a; + if test "$a" != "n" -a "$a" != "N"; then + TARGETDIR="${HOME}/bin" + continue + fi + fi + + if test $(checkdir "/usr/local/bin" yes true) = 0; then + echo -n "Can write to '/usr/local/bin' Install there? [Y|n] " + read a; + if test "$a" != "n" -a "$a" != "N"; then + TARGETDIR="/usr/local/bin" + continue + fi + fi + + echo + echo "ERROR: Cannot find a suitable installation directory" >&2 + echo "run: $0 /install/path/bin" >&2 + echo "'/install/path/bin' must be an existing directory and should be in \$PATH" >&2 + exit 1 +done + +############################################################################### +### actual install procedure + +echo "installing video-tools to '${TARGETDIR}'." +cd "$TARGETDIR" || exit 1 + +HARVID_VERSION=$(curl -s http://ardour.org/files/video-tools/harvid_version.txt) +echo "Downloading harvid-${MULTIARCH}-${HARVID_VERSION}." +curl -L --progress-bar \ + http://ardour.org/files/video-tools/harvid-${MULTIARCH}-${HARVID_VERSION}.tgz \ + | tar -x -z --exclude=README --exclude=harvid.1 --strip-components=1 || exit 1 + +XJADEO_VERSION=$(curl -s http://ardour.org/files/video-tools/xjadeo_version.txt) +echo "Downloading xjadeo-${MULTIARCH}-${XJADEO_VERSION}." +curl -L --progress-bar \ + http://ardour.org/files/video-tools/xjadeo-${MULTIARCH}-${XJADEO_VERSION}.tgz \ + | tar -x -z --exclude=README --exclude=xjadeo.1 --strip-components=1 || exit 1 +mv xjadeo xjremote + +echo "ardour video tools installed successfully."