diff --git a/gtk2_ardour/ardour2_ui_sae.conf b/gtk2_ardour/ardour2_ui_sae.conf new file mode 100644 index 0000000000..b9fac38909 --- /dev/null +++ b/gtk2_ardour/ardour2_ui_sae.conf @@ -0,0 +1,95 @@ + + + + + diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index b9b38d650a..7a6a46595d 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -162,10 +162,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) _auto_display_errors = false; #endif - if (getenv ("ARDOUR_DEBUG_UPDATES")) { - gdk_window_set_debug_updates (true); - } - about = 0; splash = 0; diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index b2a327c8c9..7c77a44194 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4371,39 +4371,40 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered) rs.add (entered_regionview); return; } - } - } else { - use_regions_at = false; - } - rs = selection->regions; + } else { - /* consider adding the entered regionview */ + /* no regions selected, so get all regions at the edit point across + all selected tracks. + */ - if (allow_entered && entered_regionview && (mouse_mode == Editing::MouseObject)) { - - /* only add the entered regionview if its not selected OR - (we're not going to use regions at edit point OR its track is not selected) - - this avoids duplicate regions ending up in "rs" - */ - - if (!selection->selected (entered_regionview) && - (!use_regions_at || !selection->selected (&entered_regionview->get_time_axis_view()))) { - rs.add (entered_regionview); - } - } - - if (use_regions_at) { - - /* nothing selected, so get all regions at the edit point across - all selected tracks - */ - - if (!selection->tracks.empty()) { nframes64_t where = get_preferred_edit_position(); get_regions_at (rs, where, selection->tracks); + + /* if the entered regionview wasn't selected and neither was its track + then add it. + */ + + if (!selection->selected (entered_regionview) && + !selection->selected (&entered_regionview->get_time_axis_view())) { + rs.add (entered_regionview); + } } + + } else { + + /* just use the selected regions */ + + rs = selection->regions; + + /* if the entered regionview wasn't selected and we allow this sort of thing, + then add it. + */ + + if (allow_entered && entered_regionview && !selection->selected (entered_regionview)) { + rs.add (entered_regionview); + } + } } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 54e7ca6adf..f6f4188b58 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2062,7 +2062,7 @@ public: void get_regions_at (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; void get_regions_after (RegionSelection&, nframes64_t where, const TrackSelection& ts) const; - void get_regions_for_action (RegionSelection&, bool allowed_entered_regionview = true); + void get_regions_for_action (RegionSelection&, bool allowed_entered_regionview = false); sigc::connection fast_screen_update_connection; gint start_updating (); diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 0611c98e2a..fac1696dcb 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -402,6 +402,7 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr plugin) if (_route->add_redirect (redirect, this, &err_streams)) { weird_plugin_dialog (*plugin, err_streams, _route); } else { + redirect->set_active (true, 0); redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr(redirect))); } } diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 1b0bca2e03..3c5201d43b 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -3,6 +3,7 @@ #include #include +#include "gui_thread.h" #include "splash.h" #include "i18n.h" @@ -50,6 +51,8 @@ Splash::Splash () set_default_size (pixbuf->get_width(), pixbuf->get_height()); the_splash = this; + + ARDOUR::BootMessage.connect (mem_fun (*this, &Splash::boot_message)); } void @@ -93,11 +96,18 @@ Splash::expose (GdkEventExpose* ev) Glib::RefPtr style = darea.get_style(); Glib::RefPtr white = style->get_white_gc(); + cerr << "redraw in expose\n"; window->draw_layout (white, 10, pixbuf->get_height() - 30, layout); return true; } +void +Splash::boot_message (std::string msg) +{ + message (msg); +} + void Splash::message (const string& msg) { @@ -107,5 +117,9 @@ Splash::message (const string& msg) layout->set_markup (str); darea.queue_draw (); - get_window()->process_updates (true); + + Glib::RefPtr win = get_window(); + if (win) { + win->process_updates (true); + } } diff --git a/gtk2_ardour/splash.h b/gtk2_ardour/splash.h index 07532d9344..a034ddad86 100644 --- a/gtk2_ardour/splash.h +++ b/gtk2_ardour/splash.h @@ -50,6 +50,8 @@ class Splash : public Gtk::Window Glib::RefPtr pixbuf; Gtk::DrawingArea darea; Glib::RefPtr layout; + + void boot_message (std::string); }; #endif /* __ardour_gtk_splash_h__ */ diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 78574542d6..600a03df48 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -57,10 +57,19 @@ int UIConfiguration::load_defaults () { int found = 0; - std::string rcfile = find_config_file ("ardour2_ui_default.conf"); - - if (rcfile.length()) - { + std::string rcfile; + const char* ui_conf; + + ui_conf = getenv ("ARDOUR_UI_CONF"); + + if (ui_conf && ui_conf[0] != '\0') { + rcfile = find_config_file (ui_conf); + } else { + rcfile = find_config_file ("ardour2_ui_default.conf"); + } + + if (rcfile.length()) { + XMLTree tree; found = 1; diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index dbc08fff7c..9da1e924e3 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -43,6 +43,7 @@ namespace ARDOUR { extern OSC* osc; static const nframes_t max_frames = JACK_MAX_FRAMES; + extern sigc::signal BootMessage; int init (bool with_vst, bool try_optimization); int cleanup (); diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 0ddd4c1a50..b63aa5ce85 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -52,6 +52,7 @@ struct AUParameterDescriptor : public Plugin::ParameterDescriptor { AudioUnitScope scope; AudioUnitElement element; float default_value; + bool automatable; }; class AUPlugin : public ARDOUR::Plugin @@ -113,7 +114,6 @@ class AUPlugin : public ARDOUR::Plugin private: boost::shared_ptr comp; boost::shared_ptr unit; - AUParamInfo* param_info; AudioStreamBasicDescription streamFormat; bool initialized; @@ -128,6 +128,7 @@ class AUPlugin : public ARDOUR::Plugin int set_input_format (); int set_stream_format (int scope, uint32_t cnt); int _set_block_size (nframes_t nframes); + void discover_parameters (); std::vector > parameter_map; uint32_t current_maxbuf; @@ -135,7 +136,7 @@ class AUPlugin : public ARDOUR::Plugin nframes_t cb_offset; vector* current_buffers; nframes_t frames_processed; - + std::vector descriptors; }; diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 30f97dea96..6640740ad6 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -59,7 +59,6 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptrAU(), false, false, kAudioUnitScope_Global); - - cerr << "discovered " << param_info->NumParams() << " parameters\n"; - - for (uint32_t i = 0; i < param_info->NumParams(); ++i) { - - AUParameterDescriptor d; - - d.id = param_info->ParamID (i); - - const CAAUParameter* param = param_info->GetParamInfo (d.id); - const AudioUnitParameterInfo& info (param->ParamInfo()); - - d.scope = param_info->GetScope (); - d.element = param_info->GetElement (); - - /* info.units to consider */ - /* - kAudioUnitParameterUnit_Generic = 0 - kAudioUnitParameterUnit_Indexed = 1 - kAudioUnitParameterUnit_Boolean = 2 - kAudioUnitParameterUnit_Percent = 3 - kAudioUnitParameterUnit_Seconds = 4 - kAudioUnitParameterUnit_SampleFrames = 5 - kAudioUnitParameterUnit_Phase = 6 - kAudioUnitParameterUnit_Rate = 7 - kAudioUnitParameterUnit_Hertz = 8 - kAudioUnitParameterUnit_Cents = 9 - kAudioUnitParameterUnit_RelativeSemiTones = 10 - kAudioUnitParameterUnit_MIDINoteNumber = 11 - kAudioUnitParameterUnit_MIDIController = 12 - kAudioUnitParameterUnit_Decibels = 13 - kAudioUnitParameterUnit_LinearGain = 14 - kAudioUnitParameterUnit_Degrees = 15 - kAudioUnitParameterUnit_EqualPowerCrossfade = 16 - kAudioUnitParameterUnit_MixerFaderCurve1 = 17 - kAudioUnitParameterUnit_Pan = 18 - kAudioUnitParameterUnit_Meters = 19 - kAudioUnitParameterUnit_AbsoluteCents = 20 - kAudioUnitParameterUnit_Octaves = 21 - kAudioUnitParameterUnit_BPM = 22 - kAudioUnitParameterUnit_Beats = 23 - kAudioUnitParameterUnit_Milliseconds = 24 - kAudioUnitParameterUnit_Ratio = 25 - */ - - /* info.flags to consider */ - - /* - - kAudioUnitParameterFlag_CFNameRelease = (1L << 4) - kAudioUnitParameterFlag_HasClump = (1L << 20) - kAudioUnitParameterFlag_HasName = (1L << 21) - kAudioUnitParameterFlag_DisplayLogarithmic = (1L << 22) - kAudioUnitParameterFlag_IsHighResolution = (1L << 23) - kAudioUnitParameterFlag_NonRealTime = (1L << 24) - kAudioUnitParameterFlag_CanRamp = (1L << 25) - kAudioUnitParameterFlag_ExpertMode = (1L << 26) - kAudioUnitParameterFlag_HasCFNameString = (1L << 27) - kAudioUnitParameterFlag_IsGlobalMeta = (1L << 28) - kAudioUnitParameterFlag_IsElementMeta = (1L << 29) - kAudioUnitParameterFlag_IsReadable = (1L << 30) - kAudioUnitParameterFlag_IsWritable = (1L << 31) - */ - - d.integer_step = false; - d.toggled = false; - d.logarithmic = false; - d.sr_dependent = false; - - const int len = CFStringGetLength (param->GetName());; - char local_buffer[len*2]; - Boolean good = CFStringGetCString(param->GetName(),local_buffer,len*2,kCFStringEncodingMacRoman); - if (!good) { - d.label = "???"; - } else { - d.label = local_buffer; - } - d.lower = info.minValue; - d.upper = info.maxValue; - d.default_value = info.defaultValue; - d.step = 1.0; - d.smallstep = 0.1; - d.largestep = 10.0; - d.min_unbound = d.lower; - d.max_unbound = d.upper; - - descriptors.push_back (d); - } + Plugin::setup_controls (); } AUPlugin::~AUPlugin () @@ -211,15 +120,124 @@ AUPlugin::~AUPlugin () unit->Uninitialize (); } - if (param_info) { - delete param_info; - } - if (buffers) { free (buffers); } } +void +AUPlugin::discover_parameters () +{ + /* discover writable parameters */ + + cerr << "get param info, there are " << global_elements << " global elements\n"; + + AudioUnitScope scopes[] = { + kAudioUnitScope_Global, + kAudioUnitScope_Output, + kAudioUnitScope_Input + }; + + descriptors.clear (); + + for (uint32_t i = 0; i < sizeof (scopes) / sizeof (scopes[0]); ++i) { + + AUParamInfo param_info (unit->AU(), false, false, scopes[i]); + + cerr << "discovered " << param_info.NumParams() << " parameters in scope " << i << endl; + + for (uint32_t i = 0; i < param_info.NumParams(); ++i) { + + AUParameterDescriptor d; + + d.id = param_info.ParamID (i); + + const CAAUParameter* param = param_info.GetParamInfo (d.id); + const AudioUnitParameterInfo& info (param->ParamInfo()); + + d.scope = param_info.GetScope (); + d.element = param_info.GetElement (); + + /* info.units to consider */ + /* + kAudioUnitParameterUnit_Generic = 0 + kAudioUnitParameterUnit_Indexed = 1 + kAudioUnitParameterUnit_Boolean = 2 + kAudioUnitParameterUnit_Percent = 3 + kAudioUnitParameterUnit_Seconds = 4 + kAudioUnitParameterUnit_SampleFrames = 5 + kAudioUnitParameterUnit_Phase = 6 + kAudioUnitParameterUnit_Rate = 7 + kAudioUnitParameterUnit_Hertz = 8 + kAudioUnitParameterUnit_Cents = 9 + kAudioUnitParameterUnit_RelativeSemiTones = 10 + kAudioUnitParameterUnit_MIDINoteNumber = 11 + kAudioUnitParameterUnit_MIDIController = 12 + kAudioUnitParameterUnit_Decibels = 13 + kAudioUnitParameterUnit_LinearGain = 14 + kAudioUnitParameterUnit_Degrees = 15 + kAudioUnitParameterUnit_EqualPowerCrossfade = 16 + kAudioUnitParameterUnit_MixerFaderCurve1 = 17 + kAudioUnitParameterUnit_Pan = 18 + kAudioUnitParameterUnit_Meters = 19 + kAudioUnitParameterUnit_AbsoluteCents = 20 + kAudioUnitParameterUnit_Octaves = 21 + kAudioUnitParameterUnit_BPM = 22 + kAudioUnitParameterUnit_Beats = 23 + kAudioUnitParameterUnit_Milliseconds = 24 + kAudioUnitParameterUnit_Ratio = 25 + */ + + /* info.flags to consider */ + + /* + + kAudioUnitParameterFlag_CFNameRelease = (1L << 4) + kAudioUnitParameterFlag_HasClump = (1L << 20) + kAudioUnitParameterFlag_HasName = (1L << 21) + kAudioUnitParameterFlag_DisplayLogarithmic = (1L << 22) + kAudioUnitParameterFlag_IsHighResolution = (1L << 23) + kAudioUnitParameterFlag_NonRealTime = (1L << 24) + kAudioUnitParameterFlag_CanRamp = (1L << 25) + kAudioUnitParameterFlag_ExpertMode = (1L << 26) + kAudioUnitParameterFlag_HasCFNameString = (1L << 27) + kAudioUnitParameterFlag_IsGlobalMeta = (1L << 28) + kAudioUnitParameterFlag_IsElementMeta = (1L << 29) + kAudioUnitParameterFlag_IsReadable = (1L << 30) + kAudioUnitParameterFlag_IsWritable = (1L << 31) + */ + + d.integer_step = (info.unit & kAudioUnitParameterUnit_Indexed); + d.toggled = (info.unit & kAudioUnitParameterUnit_Boolean); + d.sr_dependent = (info.unit & kAudioUnitParameterUnit_SampleFrames); + + d.automatable = !(info.flags & kAudioUnitParameterFlag_NonRealTime); + d.logarithmic = (info.flags & kAudioUnitParameterFlag_DisplayLogarithmic); + + const int len = CFStringGetLength (param->GetName());; + char local_buffer[len*2]; + Boolean good = CFStringGetCString(param->GetName(),local_buffer,len*2,kCFStringEncodingMacRoman); + if (!good) { + d.label = "???"; + } else { + d.label = local_buffer; + } + + d.lower = info.minValue; + d.upper = info.maxValue; + d.default_value = info.defaultValue; + d.step = 1.0; + d.smallstep = 0.1; + d.largestep = 10.0; + d.min_unbound = 0; // lower is bound + d.max_unbound = 0; // upper is bound + + descriptors.push_back (d); + } + } +} + + string AUPlugin::unique_id () const { @@ -235,7 +253,7 @@ AUPlugin::label () const uint32_t AUPlugin::parameter_count () const { - return param_info->NumParams (); + return descriptors.size(); } float @@ -508,7 +526,9 @@ AUPlugin::automatable() const set automates; for (uint32_t i = 0; i < descriptors.size(); ++i) { - automates.insert (i); + if (descriptors[i].automatable) { + automates.insert (i); + } } return automates; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index fc0b074834..be9a194a62 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -94,6 +94,8 @@ Change ARDOUR::PositionChanged = ARDOUR::new_change (); Change ARDOUR::NameChanged = ARDOUR::new_change (); Change ARDOUR::BoundsChanged = Change (0); // see init(), below +sigc::signal ARDOUR::BootMessage; + #ifdef HAVE_LIBLO static int setup_osc () @@ -105,6 +107,7 @@ setup_osc () osc = new OSC (Config->get_osc_port()); if (Config->get_use_osc ()) { + BootMessage (_("Starting OSC")); return osc->start (); } else { return 0; @@ -120,6 +123,8 @@ setup_midi () return 0; } + BootMessage (_("Configuring MIDI ports")); + for (std::map::iterator i = Config->midi_ports.begin(); i != Config->midi_ports.end(); ++i) { MIDI::Manager::instance()->add_port (i->second); } @@ -294,6 +299,8 @@ ARDOUR::init (bool use_vst, bool try_optimization) lrdf_init(); Library = new AudioLibrary; + BootMessage (_("Loading configuration")); + Config = new Configuration; if (Config->load_state ()) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 0ff6a02799..1b26dd8c7f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -41,6 +41,7 @@ #include #include #include +#include #include "i18n.h" @@ -916,8 +917,8 @@ Route::add_redirect (boost::shared_ptr redirect, void *src, uint32_t* reset_panner (); } - redirects_changed (src); /* EMIT SIGNAL */ + return 0; } diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 168885ea8e..06291991d8 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1380,6 +1380,8 @@ Session::load_routes (const XMLNode& node) return -1; } + BootMessage (string_compose (_("Loaded track/bus %1"), route->name())); + new_routes.push_back (route); } diff --git a/libs/pbd/misc.c b/libs/pbd/misc.c index 797be5de45..34e5888687 100644 --- a/libs/pbd/misc.c +++ b/libs/pbd/misc.c @@ -8,7 +8,7 @@ void disable_screen_updates () { #ifdef GTKOSX - NSDisableScreenUpdates (); + // NSDisableScreenUpdates (); #endif } @@ -16,6 +16,6 @@ void enable_screen_updates () { #ifdef GTKOSX - NSEnableScreenUpdates(); + // NSEnableScreenUpdates(); #endif } diff --git a/svn_revision.h b/svn_revision.h index 7c3bd4879c..592c4ae9a8 100644 --- a/svn_revision.h +++ b/svn_revision.h @@ -1,4 +1,4 @@ #ifndef __ardour_svn_revision_h__ #define __ardour_svn_revision_h__ -static const char* ardour_svn_revision = "3045"; +static const char* ardour_svn_revision = "3046"; #endif diff --git a/tools/osx_packaging/osx_build b/tools/osx_packaging/osx_build index d860e486ae..41d42166a0 100755 --- a/tools/osx_packaging/osx_build +++ b/tools/osx_packaging/osx_build @@ -86,6 +86,7 @@ if test x$SAE != x ; then # current default for SAE version is German keyboard layout # env="$envARDOUR_KEYBOARD_LAYOUTde" + env="$envARDOUR_UI_CONFardour2_ui_sae.conf" fi # @@ -201,6 +202,7 @@ cp ../../gtk2_ardour/ardour-sae-de.bindings $Resources cp ../../gtk2_ardour/ardour.menus $Resources cp ../../gtk2_ardour/ardour-sae.menus $Resources cp ../../ardour_system.rc $Resources +cp ../../gtk2_ardour/ardour2_ui_sae.conf $Resources cp ../../gtk2_ardour/ardour2_ui_default.conf $Resources cp ../../gtk2_ardour/ardour2_ui_light.rc $Resources cp ../../gtk2_ardour/ardour2_ui_dark.rc $Resources