summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-09-19 14:38:46 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-09-19 14:38:46 +0000
commit6f8cd634501efd70711b148b4ac0e0ce2aa5cc95 (patch)
tree07df4b771792ec9a0b8ba7c8c01db0234f1efe22 /libs/ardour
parent60f588f21d6ad62335d72e8dc682abf8859107ea (diff)
chris goddard's region list patch; port 2.X marker drag/move changes to 3.0; compilation fixes-post-evoral
git-svn-id: svn://localhost/ardour2/branches/3.0@3760 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/automation_control.h4
-rw-r--r--libs/ardour/ardour/location.h19
-rw-r--r--libs/ardour/ardour/region.h1
-rw-r--r--libs/ardour/audioanalyser.cc2
-rw-r--r--libs/ardour/location.cc13
-rw-r--r--libs/ardour/region.cc16
-rw-r--r--libs/ardour/utils.cc1
7 files changed, 45 insertions, 11 deletions
diff --git a/libs/ardour/ardour/automation_control.h b/libs/ardour/ardour/automation_control.h
index 24d1db3eec..78f4553d87 100644
--- a/libs/ardour/ardour/automation_control.h
+++ b/libs/ardour/ardour/automation_control.h
@@ -43,7 +43,7 @@ public:
boost::shared_ptr<ARDOUR::AutomationList>,
std::string name="unnamed controllable");
- boost::shared_ptr<AutomationList> alist() { return boost::dynamic_pointer_cast<AutomationList>(_list); }
+ boost::shared_ptr<AutomationList> alist() const { return boost::dynamic_pointer_cast<AutomationList>(_list); }
void set_list(boost::shared_ptr<Evoral::ControlList>);
@@ -55,7 +55,7 @@ public:
return ((ARDOUR::AutomationList*)_list.get())->automation_write();
}
- inline AutoState automation_state() {
+ inline AutoState automation_state() const {
return ((ARDOUR::AutomationList*)_list.get())->automation_state();
}
diff --git a/libs/ardour/ardour/location.h b/libs/ardour/ardour/location.h
index 53d9489823..d5b672a89d 100644
--- a/libs/ardour/ardour/location.h
+++ b/libs/ardour/ardour/location.h
@@ -100,14 +100,15 @@ class Location : public PBD::StatefulDestructible
void set_is_end (bool yn, void* src);
void set_is_start (bool yn, void* src);
- bool is_auto_punch () { return _flags & IsAutoPunch; }
- bool is_auto_loop () { return _flags & IsAutoLoop; }
- bool is_mark () { return _flags & IsMark; }
- bool is_hidden () { return _flags & IsHidden; }
- bool is_cd_marker () { return _flags & IsCDMarker; }
- bool is_end() { return _flags & IsEnd; }
- bool is_start() { return _flags & IsStart; }
- bool is_range_marker() { return _flags & IsRangeMarker; }
+ bool is_auto_punch () const { return _flags & IsAutoPunch; }
+ bool is_auto_loop () const { return _flags & IsAutoLoop; }
+ bool is_mark () const { return _flags & IsMark; }
+ bool is_hidden () const { return _flags & IsHidden; }
+ bool is_cd_marker () const { return _flags & IsCDMarker; }
+ bool is_end() const { return _flags & IsEnd; }
+ bool is_start() const { return _flags & IsStart; }
+ bool is_range_marker() const { return _flags & IsRangeMarker; }
+ bool matches (Flags f) const { return _flags & f; }
sigc::signal<void,Location*> name_changed;
sigc::signal<void,Location*> end_changed;
@@ -175,6 +176,8 @@ class Locations : public PBD::StatefulDestructible
nframes_t first_mark_before (nframes_t, bool include_special_ranges = false);
nframes_t first_mark_after (nframes_t, bool include_special_ranges = false);
+ void find_all_between (nframes64_t start, nframes64_t, LocationList&, Location::Flags);
+
sigc::signal<void,Location*> current_changed;
sigc::signal<void> changed;
sigc::signal<void,Location*> added;
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 32f47d42d7..dc81de6374 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -90,6 +90,7 @@ class Region : public Automatable, public boost::enable_shared_from_this<Region>
static Change HiddenChanged;
sigc::signal<void,Change> StateChanged;
+ static sigc::signal<void,boost::shared_ptr<ARDOUR::Region> > RegionPropertyChanged;
virtual ~Region();
diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc
index 98c4206301..ab3691d8d1 100644
--- a/libs/ardour/audioanalyser.cc
+++ b/libs/ardour/audioanalyser.cc
@@ -10,6 +10,8 @@
#include <ardour/readable.h>
#include <ardour/readable.h>
+#include <cstring>
+
#include "i18n.h"
using namespace std;
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 3654e03a9d..8dd4bbc636 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -924,3 +924,16 @@ Locations::get_location_by_id(PBD::ID id)
return 0;
}
+
+void
+Locations::find_all_between (nframes64_t start, nframes64_t end, LocationList& ll, Location::Flags flags)
+{
+ Glib::Mutex::Lock lm (lock);
+
+ for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
+ if ((flags == 0 || (*i)->matches (flags)) &&
+ ((*i)->start() >= start && (*i)->end() < end)) {
+ ll.push_back (*i);
+ }
+ }
+}
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 42564a8b5e..25435024b3 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -53,6 +53,7 @@ Change Region::LockChanged = ARDOUR::new_change ();
Change Region::LayerChanged = ARDOUR::new_change ();
Change Region::HiddenChanged = ARDOUR::new_change ();
+sigc::signal<void,boost::shared_ptr<ARDOUR::Region> > Region::RegionPropertyChanged;
/* derived-from-derived constructor (no sources in constructor) */
Region::Region (Session& s, nframes_t start, nframes_t length, const string& name, DataType type, layer_t layer, Region::Flag flags)
@@ -1350,6 +1351,21 @@ Region::send_change (Change what_changed)
}
StateChanged (what_changed);
+
+ if (!(_flags & DoNotSaveState)) {
+
+ /* Try and send a shared_pointer unless this is part of the constructor.
+ If so, do nothing.
+ */
+
+ try {
+ boost::shared_ptr<Region> rptr = shared_from_this();
+ RegionPropertyChanged (rptr);
+ } catch (...) {
+ /* no shared_ptr available, relax; */
+ }
+ }
+
}
void
diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc
index 1906d92b88..c598a3d279 100644
--- a/libs/ardour/utils.cc
+++ b/libs/ardour/utils.cc
@@ -24,7 +24,6 @@
#include <cstring>
#include <cmath>
#include <cctype>
-#include <string>
#include <cstring>
#include <cerrno>
#include <iostream>