summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-11-14 15:06:41 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-11-14 15:06:41 +0000
commitbb9ab696b1f295f90b9faed0886287a2035ccc3e (patch)
tree8749f19807923a5af68fb4985372eb31e549b852 /libs/ardour
parent4a64b67d931369cbd87ab19d7c51a6e5c9e5b80b (diff)
likely fixes for most remaining issues with data in automation/control lists, but more testing needed
git-svn-id: svn://localhost/ardour2/branches/3.0@13497 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/automation_watch.h6
-rw-r--r--libs/ardour/automation_watch.cc10
2 files changed, 7 insertions, 9 deletions
diff --git a/libs/ardour/ardour/automation_watch.h b/libs/ardour/ardour/automation_watch.h
index 6fd5a0eb65..f3e343468d 100644
--- a/libs/ardour/ardour/automation_watch.h
+++ b/libs/ardour/ardour/automation_watch.h
@@ -17,7 +17,7 @@
*/
-#include <list>
+#include <set>
#include <boost/shared_ptr.hpp>
#include <glibmm/threads.h>
#include <sigc++/signal.h>
@@ -41,7 +41,7 @@ class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr,
gint timer ();
private:
- typedef std::list<boost::shared_ptr<ARDOUR::AutomationControl> > AutomationWatches;
+ typedef std::set<boost::shared_ptr<ARDOUR::AutomationControl> > AutomationWatches;
AutomationWatch ();
~AutomationWatch();
@@ -50,7 +50,7 @@ class AutomationWatch : public sigc::trackable, public ARDOUR::SessionHandlePtr,
Glib::Threads::Thread* _thread;
bool _run_thread;
AutomationWatches automation_watches;
- Glib::Threads::Mutex automation_watch_lock;
+ Glib::Threads::Mutex automation_watch_lock;
PBD::ScopedConnection transport_connection;
void transport_state_change ();
diff --git a/libs/ardour/automation_watch.cc b/libs/ardour/automation_watch.cc
index d3138ee336..7f67bb2c03 100644
--- a/libs/ardour/automation_watch.cc
+++ b/libs/ardour/automation_watch.cc
@@ -28,8 +28,6 @@
using namespace ARDOUR;
using namespace PBD;
-using std::cerr;
-using std::endl;
AutomationWatch* AutomationWatch::_instance = 0;
@@ -65,8 +63,8 @@ void
AutomationWatch::add_automation_watch (boost::shared_ptr<AutomationControl> ac)
{
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
- DEBUG_TRACE (DEBUG::Automation, string_compose ("now watching control %1 for automation\n", ac->name()));
- automation_watches.push_back (ac);
+ DEBUG_TRACE (DEBUG::Automation, string_compose ("now watching control %1 for automation, astate = %2\n", ac->name(), enum_2_string (ac->automation_state())));
+ automation_watches.insert (ac);
/* if an automation control is added here while the transport is
* rolling, make sure that it knows that there is a write pass going
@@ -104,7 +102,7 @@ AutomationWatch::remove_automation_watch (boost::shared_ptr<AutomationControl> a
{
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
DEBUG_TRACE (DEBUG::Automation, string_compose ("remove control %1 from automation watch\n", ac->name()));
- automation_watches.remove (ac);
+ automation_watches.erase (ac);
ac->list()->set_in_write_pass (false);
}
@@ -117,7 +115,7 @@ AutomationWatch::timer ()
{
Glib::Threads::Mutex::Lock lm (automation_watch_lock);
-
+
framepos_t time = _session->audible_frame ();
for (AutomationWatches::iterator aw = automation_watches.begin(); aw != automation_watches.end(); ++aw) {