using namespace std;
using namespace ARDOUR;
using namespace sigc;
+using namespace PBD;
+
+sigc::signal<void,AutomationList *> AutomationList::AutomationListCreated;
#if 0
static void dumpit (const AutomationList& al, string prefix = "")
if (!no_state) {
save_state (_("initial"));
}
+
+ AutomationListCreated(this);
}
AutomationList::AutomationList (const AutomationList& other)
}
mark_dirty ();
+ AutomationListCreated(this);
}
AutomationList::AutomationList (const AutomationList& other, double start, double end)
delete section;
mark_dirty ();
+ AutomationListCreated(this);
}
AutomationList::~AutomationList()
std::set<ControlEvent*> all_events;
AutomationList::State* asp;
+ GoingAway ();
+
for (AutomationEventList::iterator x = events.begin(); x != events.end(); ++x) {
all_events.insert (*x);
}
AutomationList::clear ()
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
events.clear ();
if (!no_state) {
save_state (_("cleared"));
void
AutomationList::x_scale (double factor)
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
_x_scale (factor);
}
bool
AutomationList::extend_to (double when)
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
if (events.empty() || events.back()->when == when) {
return false;
}
// cerr << "RT: alist @ " << this << " add " << value << " @ " << when << endl;
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
iterator where;
TimeComparator cmp;
/* this is for graphical editing and loading data from storage */
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
TimeComparator cmp;
ControlEvent cp (when, 0.0f);
bool insert = true;
AutomationList::erase (AutomationList::iterator i)
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
events.erase (i);
reposition_for_rt_add (0);
if (!no_state) {
AutomationList::erase (AutomationList::iterator start, AutomationList::iterator end)
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
events.erase (start, end);
reposition_for_rt_add (0);
if (!no_state) {
bool reset = false;
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
TimeComparator cmp;
ControlEvent cp (start, 0.0f);
iterator s;
bool erased = false;
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
TimeComparator cmp;
ControlEvent cp (start, 0.0f);
iterator s;
*/
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
while (start != end) {
(*start)->when += xdelta;
*/
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
(*iter)->when = when;
(*iter)->value = val;
if (!no_state) {
std::pair<AutomationList::iterator,AutomationList::iterator>
AutomationList::control_points_adjacent (double xval)
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
iterator i;
TimeComparator cmp;
ControlEvent cp (xval, 0.0f);
AutomationList::restore_state (StateManager::State& state)
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
State* lstate = dynamic_cast<State*> (&state);
events.clear ();
AutomationList::truncate_end (double last_coordinate)
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
ControlEvent cp (last_coordinate, 0);
list<ControlEvent*>::reverse_iterator i;
double last_val;
AutomationList::truncate_start (double overall_length)
{
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
AutomationList::iterator i;
double first_legal_value;
double first_legal_coordinate;
AutomationList* nal = new AutomationList (default_value);
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
for (iterator x = start; x != end; ) {
iterator tmp;
bool changed = false;
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
if ((s = lower_bound (events.begin(), events.end(), &cp, cmp)) == events.end()) {
return nal;
AutomationList* nal = new AutomationList (default_value);
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
for (iterator x = start; x != end; ) {
iterator tmp;
}
{
- LockMonitor lm (lock, __LINE__, __FILE__);
+ Glib::Mutex::Lock lm (lock);
iterator where;
iterator prev;
double end = 0;
XMLNode *pointnode = new XMLNode ("point");
- snprintf (buf, sizeof (buf), "%" PRIu32, (jack_nframes_t) floor ((*i)->when));
+ snprintf (buf, sizeof (buf), "%" PRIu32, (nframes_t) floor ((*i)->when));
pointnode->add_property ("x", buf);
- snprintf (buf, sizeof (buf), "%f", (*i)->value);
+ snprintf (buf, sizeof (buf), "%.12g", (*i)->value);
pointnode->add_property ("y", buf);
node.add_child_nocopy (*pointnode);
const XMLNodeList& elist = node.children();
XMLNodeConstIterator i;
XMLProperty* prop;
- jack_nframes_t x;
+ nframes_t x;
double y;
clear ();
add (x, y);
}
}
+
+XMLNode &AutomationList::get_state ()
+{
+ XMLNode *node = new XMLNode("AutomationList");
+ store_state(*node);
+ return *node;
+}
+
+int AutomationList::set_state(const XMLNode &s)
+{
+ load_state(s);
+ return 0;
+}
+