diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-06 19:00:57 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-12-06 19:00:57 +0000 |
commit | 4566992139ba5242cd4a0670f85c51367340d3ff (patch) | |
tree | b766630c543540ff6ae6f093d15346dfcac35deb | |
parent | 79e8659a1b8ea341f45a0431772e56526a2c7c61 (diff) |
miscellaneous stuff, SVN IS TEMPORARILY BROKEN. FIX WITHIN 18 HOURS
git-svn-id: svn://localhost/ardour2/trunk@1192 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | DOCUMENTATION/AUTHORS | 3 | ||||
-rw-r--r-- | SConstruct | 69 | ||||
-rw-r--r-- | gtk2_ardour/about.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/io_selector.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/redirect_box.cc | 89 | ||||
-rw-r--r-- | gtk2_ardour/redirect_box.h | 16 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/send.h | 2 | ||||
-rw-r--r-- | libs/ardour/redirect.cc | 1 | ||||
-rw-r--r-- | libs/ardour/route.cc | 21 | ||||
-rw-r--r-- | libs/ardour/session.cc | 16 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 1 | ||||
-rw-r--r-- | libs/gtkmm2ext/tearoff.cc | 8 |
16 files changed, 221 insertions, 41 deletions
diff --git a/DOCUMENTATION/AUTHORS b/DOCUMENTATION/AUTHORS index a406deac66..027521670b 100644 --- a/DOCUMENTATION/AUTHORS +++ b/DOCUMENTATION/AUTHORS @@ -59,6 +59,8 @@ mantis and some not, fairly continuously for several months. He then moved on to write SSE assembler routines to handle the CPU-hungry metering and mixing routines. +Brian Ahr contributed many small fixes for ardour 2.0. + Smaller (but not necessarily minor) patches were received from the following people: @@ -73,3 +75,4 @@ following people: Rob Holland Joshua Leachman Per Sigmond + Nimal Ratnayake
\ No newline at end of file diff --git a/SConstruct b/SConstruct index 776d2a6241..079d668d53 100644 --- a/SConstruct +++ b/SConstruct @@ -389,6 +389,57 @@ if env['VST']: print "OK, VST support will be enabled" +####################### +# Dependency Checking # +####################### + +deps = \ +{ + 'glib-2.0' : '2.10.1', + 'gthread-2.0' : '2.10.1', + 'gtk+-2.0' : '2.8.1', + 'libxml-2.0' : '2.6.0', + 'samplerate' : '0.1.2', + 'raptor' : '1.4.8', + 'lrdf' : '0.4.0', + 'jack' : '0.101.1', + 'libgnomecanvas-2.0' : '2.0' +} + +def DependenciesRequiredMessage(): + print 'You do not have the necessary dependencies required to build ardour' + print 'Please consult http://ardour.org/building for more information' + +def CheckPKGConfig(context, version): + context.Message( 'Checking for pkg-config version >= %s... ' %version ) + ret = context.TryAction('pkg-config --atleast-pkgconfig-version=%s' % version)[0] + context.Result( ret ) + return ret + +def CheckPKGVersion(context, name, version): + context.Message( 'Checking for %s... ' % name ) + ret = context.TryAction('pkg-config --atleast-version=%s %s' %(version,name) )[0] + context.Result( ret ) + return ret + +conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig, + 'CheckPKGVersion' : CheckPKGVersion }) + +# I think a more recent version is needed on win32 +min_pkg_config_version = '0.8.0' + +if not conf.CheckPKGConfig(min_pkg_config_version): + print 'pkg-config >= %s not found.' % min_pkg_config_version + Exit(1) + +for pkg, version in deps.iteritems(): + if not conf.CheckPKGVersion( pkg, version ): + print '%s >= %s not found.' %(pkg, version) + DependenciesRequiredMessage() + Exit(1) + +env = conf.Finish() + # ---------------------------------------------------------------------- # Construction environment setup # ---------------------------------------------------------------------- @@ -540,6 +591,24 @@ else: env = conf.Finish() if env['SYSLIBS']: + + syslibdeps = \ + { + 'sigc++-2.0' : '2.0', + 'gtkmm-2.4' : '2.8', + 'libgnomecanvasmm-2.6' : '2.12.0' + } + + conf = Configure(env, custom_tests = { 'CheckPKGConfig' : CheckPKGConfig, + 'CheckPKGVersion' : CheckPKGVersion }) + + for pkg, version in syslibdeps.iteritems(): + if not conf.CheckPKGVersion( pkg, version ): + print '%s >= %s not found.' %(pkg, version) + DependenciesRequiredMessage() + Exit(1) + + env = conf.Finish() libraries['sigc2'] = LibraryInfo() libraries['sigc2'].ParseConfig('pkg-config --cflags --libs sigc++-2.0') diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc index 959830725e..34bb98199c 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about.cc @@ -145,6 +145,8 @@ static const char* authors[] = { N_("Stefan Kersten"), N_("Christopher George"), N_("Robert Jordens"), + N_("Brian Ahr"), + N_("Nimal Ratnayake"), 0 }; diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index a79546f58f..74eb36a814 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -444,6 +444,7 @@ ARDOUR_UI::ask_about_saving_session (const string & what) save_the_session = 0; + window.set_keep_above (true); window.present (); ResponseType r = (ResponseType) window.run(); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index fd135f1538..ed059efbb7 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -685,6 +685,27 @@ Editor::Editor (AudioEngine& eng) fade_context_menu.set_name ("ArdourContextMenu"); + /* icons, titles, WM stuff */ + + list<Glib::RefPtr<Gdk::Pixbuf> > window_icons; + Glib::RefPtr<Gdk::Pixbuf> icon; + + if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + window_icons.push_back (icon); + } + if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + window_icons.push_back (icon); + } + if (!window_icons.empty()) { + set_icon_list (window_icons); + set_default_icon_list (window_icons); + } set_title (_("ardour: editor")); set_wmclass (_("ardour_editor"), "Ardour"); @@ -1860,6 +1881,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items) items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Select all in range"), mem_fun(*this, &Editor::select_all_selectables_using_time_selection))); items.push_back (SeparatorElem()); + items.push_back (MenuElem (_("Add Range Markers"), mem_fun (*this, &Editor::add_location_from_selection))); items.push_back (MenuElem (_("Set range to loop range"), mem_fun(*this, &Editor::set_selection_from_loop))); items.push_back (MenuElem (_("Set range to punch range"), mem_fun(*this, &Editor::set_selection_from_punch))); items.push_back (SeparatorElem()); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index d55180d82b..00faa2f21d 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1208,7 +1208,7 @@ Editor::add_location_from_selection () nframes_t start = selection->time[clicked_selection].start; nframes_t end = selection->time[clicked_selection].end; - Location *location = new Location (start, end, "selection"); + Location *location = new Location (start, end, "selection", Location::IsRangeMarker); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); @@ -1242,7 +1242,7 @@ Editor::add_location_from_audio_region () RegionView* rv = *(selection->regions.begin()); boost::shared_ptr<Region> region = rv->region(); - Location *location = new Location (region->position(), region->last_frame(), region->name()); + Location *location = new Location (region->position(), region->last_frame(), region->name(), Location::IsRangeMarker); session->begin_reversible_command (_("add marker")); XMLNode &before = session->locations()->get_state(); session->locations()->add (location, true); diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index 5e56bf8173..ac1028c0c4 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -417,7 +417,7 @@ IOSelector::display_ports () really_short_name = port->short_name(); really_short_name = really_short_name.substr (really_short_name.find ('/') + 1); - + tview = manage (new TreeView()); RefPtr<ListStore> port_model = ListStore::create (port_display_columns); @@ -437,7 +437,6 @@ IOSelector::display_ports () /* now fill the clist with the current connections */ - const char **connections = port->get_connections (); if (connections) { @@ -446,7 +445,7 @@ IOSelector::display_ports () row[port_display_columns.displayed_name] = connections[c]; row[port_display_columns.full_name] = connections[c]; } - } + } if (for_input) { diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc index d0aa7500e4..12be8a9d80 100644 --- a/gtk2_ardour/redirect_box.cc +++ b/gtk2_ardour/redirect_box.cc @@ -19,6 +19,7 @@ */ #include <cmath> +#include <iostream> #include <sigc++/bind.h> @@ -285,7 +286,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev) if (redirect && Keyboard::is_delete_event (ev)) { - Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), redirect)); + Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), boost::weak_ptr<Redirect>(redirect))); ret = true; } else if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) { @@ -362,7 +363,7 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin) boost::shared_ptr<Redirect> redirect (new PluginInsert (_session, plugin, _placement)); - redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active)); + redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect), (void*) 0)); uint32_t err_streams; @@ -440,7 +441,7 @@ void RedirectBox::choose_insert () { boost::shared_ptr<Redirect> redirect (new PortInsert (_session, _placement)); - redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active)); + redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect))); _route->add_redirect (redirect, this); } @@ -456,15 +457,24 @@ RedirectBox::choose_send () IOSelectorWindow *ios = new IOSelectorWindow (_session, send, false, true); ios->show_all (); - ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::static_pointer_cast<Redirect>(send), ios)); + + boost::shared_ptr<Redirect> r = boost::static_pointer_cast<Redirect>(send); + + ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::weak_ptr<Redirect>(r), ios)); } void -RedirectBox::send_io_finished (IOSelector::Result r, boost::shared_ptr<Redirect> redirect, IOSelectorWindow* ios) +RedirectBox::send_io_finished (IOSelector::Result r, boost::weak_ptr<Redirect> weak_redirect, IOSelectorWindow* ios) { + boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + + if (!redirect) { + return; + } + switch (r) { case IOSelector::Cancelled: - // delete redirect; XXX SHAREDPTR HOW TO DESTROY THE REDIRECT ? do we even need to think about it? + // redirect will go away when all shared_ptrs to it vanish break; case IOSelector::Accepted: @@ -481,9 +491,10 @@ RedirectBox::redisplay_redirects (void *src) ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redisplay_redirects), src)); if (no_redirect_redisplay) { + cerr << "redisplay redirects skipped, no redisplay set\n"; return; } - + ignore_delete = true; model->clear (); ignore_delete = false; @@ -514,16 +525,22 @@ RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect) Gtk::TreeModel::Row row = *(model->append()); row[columns.text] = redirect_name (redirect); row[columns.redirect] = redirect; - - show_redirect_active (redirect.get(), this); - redirect_active_connections.push_back (redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active))); - redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), redirect))); + show_redirect_active (redirect, this); + + redirect_active_connections.push_back (redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect)))); + redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), boost::weak_ptr<Redirect>(redirect)))); } string -RedirectBox::redirect_name (boost::shared_ptr<Redirect> redirect) +RedirectBox::redirect_name (boost::weak_ptr<Redirect> weak_redirect) { + boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + + if (!redirect) { + return string(); + } + boost::shared_ptr<Send> send; string name_display; @@ -585,16 +602,22 @@ RedirectBox::build_redirect_tooltip (EventBox& box, string start) } void -RedirectBox::show_redirect_name (void* src, boost::shared_ptr<Redirect> redirect) +RedirectBox::show_redirect_name (void* src, boost::weak_ptr<Redirect> redirect) { ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_name), src, redirect)); - show_redirect_active (redirect.get(), src); + show_redirect_active (redirect, src); } void -RedirectBox::show_redirect_active (Redirect* redirect, void *src) +RedirectBox::show_redirect_active (void *src, boost::weak_ptr<Redirect> weak_redirect) { - ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), redirect, src)); + ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), weak_redirect, src)); + + boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + + if (!redirect) { + return; + } Gtk::TreeModel::Children children = model->children(); Gtk::TreeModel::Children::iterator iter = children.begin(); @@ -603,7 +626,7 @@ RedirectBox::show_redirect_active (Redirect* redirect, void *src) boost::shared_ptr<Redirect> r = (*iter)[columns.redirect]; - if (r.get() == redirect) { + if (r == redirect) { (*iter)[columns.text] = redirect_name (r); if (redirect->active()) { @@ -698,6 +721,7 @@ RedirectBox::cut_redirects () _rr_selection.set (to_be_removed); + no_redirect_redisplay = true; for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) { void* gui = (*i)->get_gui (); @@ -712,6 +736,8 @@ RedirectBox::cut_redirects () } } + no_redirect_redisplay = false; + redisplay_redirects (this); } void @@ -734,12 +760,22 @@ RedirectBox::copy_redirects () } gint -RedirectBox::idle_delete_redirect (boost::shared_ptr<Redirect> redirect) +RedirectBox::idle_delete_redirect (boost::weak_ptr<Redirect> weak_redirect) { + boost::shared_ptr<Redirect> redirect (weak_redirect.lock()); + + if (!redirect) { + return false; + } + /* NOT copied to _mixer.selection() */ + no_redirect_redisplay = true; _route->remove_redirect (redirect, this); - return FALSE; + no_redirect_redisplay = false; + redisplay_redirects (this); + + return false; } void @@ -783,9 +819,12 @@ RedirectBox::cut_redirect (boost::shared_ptr<Redirect> redirect) static_cast<Gtk::Widget*>(gui)->hide (); } + no_redirect_redisplay = true; if (_route->remove_redirect (redirect, this)) { _rr_selection.remove (redirect); } + no_redirect_redisplay = false; + redisplay_redirects (this); } void @@ -979,7 +1018,7 @@ RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect) plugin_insert->set_gui (plugin_ui); // change window title when route name is changed - _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, plugin_insert)); + _route->name_changed.connect (bind (mem_fun(*this, &RedirectBox::route_name_changed), plugin_ui, boost::weak_ptr<PluginInsert> (plugin_insert))); } else { @@ -1238,11 +1277,13 @@ RedirectBox::rb_edit () } void -RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<PluginInsert> pi) +RedirectBox::route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<PluginInsert> wpi) { - ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, pi)); - - plugin_ui->set_title (generate_redirect_title (pi)); + ENSURE_GUI_THREAD(bind (mem_fun (*this, &RedirectBox::route_name_changed), src, plugin_ui, wpi)); + boost::shared_ptr<PluginInsert> pi (wpi.lock()); + if (pi) { + plugin_ui->set_title (generate_redirect_title (pi)); + } } string diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h index 27ba950899..4b872ed0bf 100644 --- a/gtk2_ardour/redirect_box.h +++ b/gtk2_ardour/redirect_box.h @@ -97,7 +97,9 @@ class RedirectBox : public Gtk::HBox PluginSelector & _plugin_selector; RouteRedirectSelection & _rr_selection; - + + void route_going_away (); + struct ModelColumns : public Gtk::TreeModel::ColumnRecord { ModelColumns () { add (text); @@ -140,7 +142,7 @@ class RedirectBox : public Gtk::HBox void show_redirect_menu (gint arg); void choose_send (); - void send_io_finished (IOSelector::Result, boost::shared_ptr<ARDOUR::Redirect>, IOSelectorWindow*); + void send_io_finished (IOSelector::Result, boost::weak_ptr<ARDOUR::Redirect>, IOSelectorWindow*); void choose_insert (); void choose_plugin (); void insert_plugin_chosen (boost::shared_ptr<ARDOUR::Plugin>); @@ -152,15 +154,15 @@ class RedirectBox : public Gtk::HBox void redisplay_redirects (void* src); void add_redirect_to_display (boost::shared_ptr<ARDOUR::Redirect>); void row_deleted (const Gtk::TreeModel::Path& path); - void show_redirect_name (void*, boost::shared_ptr<ARDOUR::Redirect>); + void show_redirect_name (void*, boost::weak_ptr<ARDOUR::Redirect>); /* these are handlers for Redirect signals, so they take Redirect* directly, rather than shared_ptr<Redirect> */ - void show_redirect_active (ARDOUR::Redirect*, void *); + void show_redirect_active (boost::weak_ptr<ARDOUR::Redirect>, void *); - string redirect_name (boost::shared_ptr<ARDOUR::Redirect>); + string redirect_name (boost::weak_ptr<ARDOUR::Redirect>); void remove_redirect_gui (boost::shared_ptr<ARDOUR::Redirect>); @@ -195,7 +197,7 @@ class RedirectBox : public Gtk::HBox void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect>); void rename_redirect (boost::shared_ptr<ARDOUR::Redirect>); - gint idle_delete_redirect (boost::shared_ptr<ARDOUR::Redirect>); + gint idle_delete_redirect (boost::weak_ptr<ARDOUR::Redirect>); void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, boost::shared_ptr<ARDOUR::IO> io); @@ -219,7 +221,7 @@ class RedirectBox : public Gtk::HBox static void rb_deactivate_all (); static void rb_edit (); - void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::shared_ptr<ARDOUR::PluginInsert> pi); + void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr<ARDOUR::PluginInsert> pi); std::string generate_redirect_title (boost::shared_ptr<ARDOUR::PluginInsert> pi); }; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 21638e64c2..12ef57858b 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -173,6 +173,8 @@ class Route : public IO void all_redirects_flip(); void all_redirects_active (bool state); + uint32_t count_sends (); + virtual nframes_t update_total_latency(); nframes_t signal_latency() const { return _own_latency; } virtual void set_latency_delay (nframes_t); diff --git a/libs/ardour/ardour/send.h b/libs/ardour/ardour/send.h index 1a9a892f33..d22d483a8f 100644 --- a/libs/ardour/ardour/send.h +++ b/libs/ardour/ardour/send.h @@ -53,6 +53,8 @@ class Send : public Redirect { uint32_t pans_required() const { return expected_inputs; } void expect_inputs (uint32_t); + static uint32_t how_many_sends(); + private: bool _metering; uint32_t expected_inputs; diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc index 0f3e9adce3..ba81252511 100644 --- a/libs/ardour/redirect.cc +++ b/libs/ardour/redirect.cc @@ -58,6 +58,7 @@ Redirect::Redirect (Session& s, const string& name, Placement p, Redirect::~Redirect () { + notify_callbacks (); } boost::shared_ptr<Redirect> diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 01b60527f8..38cd7ad37d 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -780,6 +780,21 @@ Route::set_mute (bool yn, void *src) } } +uint32_t +Route::count_sends () +{ + uint32_t cnt = 0; + Glib::RWLock::ReaderLock lm (redirect_lock); + + for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) { + if (boost::dynamic_pointer_cast<Send> (*i)) { + ++cnt; + } + } + + return cnt; +} + int Route::add_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_t* err_streams) { @@ -923,6 +938,10 @@ Route::clear_redirects (void *src) { Glib::RWLock::WriterLock lm (redirect_lock); + RedirectList::iterator i; + for (i = _redirects.begin(); i != _redirects.end(); ++i) { + (*i)->drop_references (); + } _redirects.clear (); } @@ -1019,6 +1038,8 @@ Route::remove_redirect (boost::shared_ptr<Redirect> redirect, void *src, uint32_ reset_panner (); } + redirect->drop_references (); + redirects_changed (src); /* EMIT SIGNAL */ return 0; } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 0cc00bc754..4169361c14 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -3313,6 +3313,8 @@ Session::remove_redirect (Redirect* redirect) PortInsert* port_insert; PluginInsert* plugin_insert; + cerr << "Removing a redirect!\n"; + if ((insert = dynamic_cast<Insert *> (redirect)) != 0) { if ((port_insert = dynamic_cast<PortInsert *> (insert)) != 0) { _port_inserts.remove (port_insert); @@ -3323,7 +3325,9 @@ Session::remove_redirect (Redirect* redirect) /*NOTREACHED*/ } } else if ((send = dynamic_cast<Send *> (redirect)) != 0) { + cerr << "Remove send, used to have " << _sends.size() << endl; _sends.remove (send); + cerr << "post removal, have " << _sends.size() << endl; } else { fatal << _("programming error: unknown type of Redirect deleted!") << endmsg; /*NOTREACHED*/ @@ -3451,9 +3455,15 @@ Session::ensure_passthru_buffers (uint32_t howmany) string Session::next_send_name () { - char buf[32]; - snprintf (buf, sizeof (buf), "send %" PRIu32, ++send_cnt); - return buf; + uint32_t cnt = 0; + + shared_ptr<RouteList> r = routes.reader (); + + for (RouteList::const_iterator i = r->begin(); i != r->end(); ++i) { + cnt += (*i)->count_sends (); + } + + return string_compose (_("send %1"), ++cnt); } string diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 92f95d0463..b9daa66bc8 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -123,7 +123,6 @@ Session::first_stage_init (string fullpath, string snapshot_name) _tempo_map->StateChanged.connect (mem_fun (*this, &Session::tempo_map_changed)); g_atomic_int_set (&processing_prohibited, 0); - send_cnt = 0; insert_cnt = 0; _transport_speed = 0; _last_transport_speed = 0; diff --git a/libs/gtkmm2ext/tearoff.cc b/libs/gtkmm2ext/tearoff.cc index 6e8111152f..3df70ad54b 100644 --- a/libs/gtkmm2ext/tearoff.cc +++ b/libs/gtkmm2ext/tearoff.cc @@ -127,7 +127,7 @@ TearOff::close_click (GdkEventButton* ev) gint TearOff::window_button_press (GdkEventButton* ev) { - if (dragging) { + if (dragging || ev->button != 1) { dragging = false; own_window.remove_modal_grab(); return true; @@ -172,6 +172,12 @@ TearOff::window_motion (GdkEventMotion* ev) return true; } + if (!(ev->state & GDK_BUTTON1_MASK)) { + dragging = false; + own_window.remove_modal_grab(); + return true; + } + x_delta = ev->x_root - drag_x; y_delta = ev->y_root - drag_y; |