diff options
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 15 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer_set.h | 1 | ||||
-rw-r--r-- | libs/ardour/io.cc | 22 | ||||
-rw-r--r-- | libs/ardour/route.cc | 30 | ||||
-rw-r--r-- | libs/ardour/session.cc | 55 | ||||
-rw-r--r-- | svn_revision.h | 2 | ||||
-rwxr-xr-x | tools/osx_packaging/script | 21 |
8 files changed, 109 insertions, 43 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 96b1ab591e..6a449b35f4 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -3244,7 +3244,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event motion handler. */ - if (drag_info.first_move) { + if (drag_info.first_move && !(drag_info.copy && drag_info.x_constrained)) { /* just a click */ goto out; } @@ -3320,7 +3320,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event boost::shared_ptr<Playlist> from_playlist = rv->region()->playlist(); boost::shared_ptr<Playlist> to_playlist = rtv2->playlist(); - + where = (nframes_t) (unit_to_frame (ix1) * speed); boost::shared_ptr<Region> new_region (RegionFactory::create (rv->region())); @@ -3455,7 +3455,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event } /* add it */ - + latest_regionview = 0; sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view)); to_playlist->add_region (newregion, (nframes_t) (where * rtv->get_diskstream()->speed())); diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index 1c881c4838..d98e51ca2c 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -294,7 +294,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev) } - if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) { + if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) { if (_session.engine().connected()) { /* XXX giving an error message here is hard, because we may be in the midst of a button press */ @@ -339,7 +339,7 @@ RedirectBox::redirect_button_release_event (GdkEventButton *ev) show_redirect_menu(ev->time); ret = true; - } else if (redirect && ev->button == 2 && ev->state == GDK_BUTTON2_MASK) { + } else if (redirect && ev->button == 2 && Keyboard::modifier_state_equals (ev->state, Gdk::BUTTON2_MASK)) { redirect->set_active (!redirect->active(), this); ret = true; @@ -1071,6 +1071,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) send_ui->get_window()->raise (); } else { send_ui->show_all (); + send_ui->present (); } } else { @@ -1115,6 +1116,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) plugin_ui->get_window()->raise (); } else { plugin_ui->show_all (); + plugin_ui->present (); } #ifdef HAVE_AUDIOUNIT } else if (type == ARDOUR::AudioUnit) { @@ -1125,7 +1127,12 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) plugin_ui = reinterpret_cast<AUPluginUI*> (plugin_insert->get_gui()); } - // raise window, somehow + if (plugin_ui->is_visible()) { + plugin_ui->get_window()->raise (); + } else { + plugin_ui->show_all (); + plugin_ui->present (); + } #endif } else { warning << "Unsupported plugin sent to RedirectBox::edit_redirect()" << endmsg; @@ -1153,7 +1160,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) if (io_selector->is_visible()) { io_selector->get_window()->raise (); } else { - io_selector->show_all (); + io_selector->present (); } } } diff --git a/libs/ardour/ardour/buffer_set.h b/libs/ardour/ardour/buffer_set.h index 03b0b193d4..3520f95eb3 100644 --- a/libs/ardour/ardour/buffer_set.h +++ b/libs/ardour/ardour/buffer_set.h @@ -120,6 +120,7 @@ public: iterator& operator++() { ++_index; return *this; } // yes, prefix only bool operator==(const iterator& other) { return (_index == other._index); } bool operator!=(const iterator& other) { return (_index != other._index); } + iterator operator=(const iterator& other) { _set = other._set; _type = other._type; _index = other._index; return *this; } private: friend class BufferSet; diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index b3dc2a89c9..184077b5f1 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -255,18 +255,30 @@ IO::deliver_output (BufferSet& bufs, nframes_t start_frame, nframes_t end_frame, // Use the panner to distribute audio to output port buffers if (_panner && !_panner->empty() && !_panner->bypassed()) { - _panner->distribute(bufs, output_buffers(), start_frame, end_frame, nframes, offset); + _panner->distribute (bufs, output_buffers(), start_frame, end_frame, nframes, offset); } else { const DataType type = DataType::AUDIO; - + // Copy any audio 1:1 to outputs - assert(bufs.count().get(DataType::AUDIO) == output_buffers().count().get(DataType::AUDIO)); + BufferSet::iterator o = output_buffers().begin(type); - for (BufferSet::iterator i = bufs.begin(type); i != bufs.end(type); ++i, ++o) { + BufferSet::iterator i = bufs.begin(type); + BufferSet::iterator prev = i; + + while (i != bufs.end(type) && o != output_buffers().end (type)) { o->read_from(*i, nframes, offset); + prev = i; + ++i; + ++o; } - } + /* extra outputs get a copy of the last buffer */ + + while (o != output_buffers().end(type)) { + o->read_from(*prev, nframes, offset); + ++o; + } + } /* ********** MIDI ********** */ diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index e78706b71a..d361386324 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -431,7 +431,6 @@ Route::process_output_buffers (BufferSet& bufs, } else { co->deliver_output (bufs, start_frame, end_frame, nframes, offset); - } } @@ -588,7 +587,7 @@ Route::process_output_buffers (BufferSet& bufs, (no_monitor && record_enabled() && (!Config->get_auto_input() || _session.actively_recording())) ) { - + co->silence (nframes, offset); } else { @@ -645,7 +644,7 @@ Route::process_output_buffers (BufferSet& bufs, if (_meter_point == MeterPostFader) { peak_meter().reset(); } - + IO::silence (nframes, offset); } else { @@ -1763,11 +1762,17 @@ Route::set_control_outs (const vector<string>& ports) { Glib::Mutex::Lock lm (control_outs_lock); vector<string>::const_iterator i; - + size_t limit; + if (_control_outs) { delete _control_outs; _control_outs = 0; } + + if (control() || master()) { + /* no control outs for these two special busses */ + return 0; + } if (ports.empty()) { return 0; @@ -1781,8 +1786,23 @@ Route::set_control_outs (const vector<string>& ports) /* our control outs need as many outputs as we have audio outputs. we track the changes in ::output_change_handler(). */ + + // XXX its stupid that we have to get this value twice - _control_outs->ensure_io (ChanCount::ZERO, ChanCount(DataType::AUDIO, n_outputs().get(DataType::AUDIO)), true, this); + limit = n_outputs().get(DataType::AUDIO); + + if (_control_outs->ensure_io (ChanCount::ZERO, ChanCount (DataType::AUDIO, n_outputs().get (DataType::AUDIO)), true, this)) { + return -1; + } + + /* now connect to the named ports */ + + for (size_t n = 0; n < limit; ++n) { + if (_control_outs->connect_output (_control_outs->output (n), ports[n], this)) { + error << string_compose (_("could not connect %1 to %2"), _control_outs->output(n)->name(), ports[n]) << endmsg; + return -1; + } + } return 0; } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ff549f9896..d29795904e 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -913,6 +913,7 @@ Session::hookup_io () if (_control_out) { uint32_t n; + vector<string> cports; while (_control_out->n_inputs().get(DataType::AUDIO) < _control_out->input_maximum().get(DataType::AUDIO)) { if (_control_out->add_input_port ("", this)) { @@ -930,7 +931,20 @@ Session::hookup_io () } n++; } - } + + + uint32_t ni = _control_out->n_inputs().get (DataType::AUDIO); + + for (n = 0; n < ni; ++n) { + cports.push_back (_control_out->input(n)->name()); + } + + boost::shared_ptr<RouteList> r = routes.reader (); + + for (RouteList::iterator x = r->begin(); x != r->end(); ++x) { + (*x)->set_control_outs (cports); + } + } /* Tell all IO objects to connect themselves together */ @@ -1793,19 +1807,6 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod channels_used += track->n_inputs ().get(DataType::AUDIO); - if (_control_out) { - vector<string> cports; - uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); - - for (n = 0; n < ni; ++n) { - cports.push_back (_control_out->input(n)->name()); - } - - track->set_control_outs (cports); - } - - // assert (current_thread != RT_thread) - track->audio_diskstream()->non_realtime_input_change(); track->DiskstreamChanged.connect (mem_fun (this, &Session::resort_routes)); @@ -1968,16 +1969,6 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_ } } - if (_control_out) { - vector<string> cports; - uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); - - for (uint32_t n = 0; n < ni; ++n) { - cports.push_back (_control_out->input(n)->name()); - } - bus->set_control_outs (cports); - } - bus->set_remote_control_id (control_id); ++control_id; @@ -2034,9 +2025,23 @@ Session::add_routes (RouteList& new_routes, bool save) if ((*x)->control()) { _control_out = (*x); - } + } } + if (_control_out && IO::connecting_legal) { + + vector<string> cports; + uint32_t ni = _control_out->n_inputs().get(DataType::AUDIO); + + for (uint32_t n = 0; n < ni; ++n) { + cports.push_back (_control_out->input(n)->name()); + } + + for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) { + (*x)->set_control_outs (cports); + } + } + set_dirty(); if (save) { diff --git a/svn_revision.h b/svn_revision.h index 06531d2966..4bfd4f2ac0 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 = "1745"; +static const char* ardour_svn_revision = "1801"; #endif diff --git a/tools/osx_packaging/script b/tools/osx_packaging/script index ec6ad4feec..faf92eded8 100755 --- a/tools/osx_packaging/script +++ b/tools/osx_packaging/script @@ -2,6 +2,27 @@ # # Author: Aaron Voisine <aaron@voisine.org> +if [ ! -x /Applications/Utilities/X11.app ] ; then + if [ -f /usr/include/X11/X.h ] ; then + osascript -e 'tell application "Ardour2" +display dialog "You have installed the X11 SDK, but not X11 itself.\ +Please install X11 before running Ardour" buttons["OK"] +end tell' + else + osascript -e 'tell application "Ardour2" +display dialog "Please install X11 before running Ardour" buttons["OK"] +end tell' + fi + exit 1 +fi + +if [ ! -x /usr/local/bin/jackd -a ! -x /usr/bin/jackd ] ; then + osascript -e 'tell application "Ardour2" +display dialog "You do not appear to have JACK installed.\nPlease install it before running Ardour" buttons["OK"] +end tell' + exit 1 +fi + CWD="`dirname \"$0\"`" TMP=/tmp/$UID/TemporaryItems |