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 /libs | |
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
Diffstat (limited to 'libs')
-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 |
7 files changed, 46 insertions, 5 deletions
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; |