2 Copyright (C) 2002 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <sigc++/bind.h>
27 #include <ardour/param_id.h>
28 #include <ardour/automation_event.h>
29 #include <ardour/curve.h>
30 #include <pbd/stacktrace.h>
35 using namespace ARDOUR;
39 sigc::signal<void,AutomationList *> AutomationList::AutomationListCreated;
41 static bool sort_events_by_time (ControlEvent* a, ControlEvent* b)
43 return a->when < b->when;
47 static void dumpit (const AutomationList& al, string prefix = "")
49 cerr << prefix << &al << endl;
50 for (AutomationList::const_iterator i = al.const_begin(); i != al.const_end(); ++i) {
51 cerr << prefix << '\t' << (*i)->when << ',' << (*i)->value << endl;
57 AutomationList::AutomationList (ParamID id, double min_val, double max_val, double default_val)
59 , _curve(new Curve(*this))
63 _changed_when_thawed = false;
69 _max_xval = 0; // means "no limit"
70 _default_value = default_val;
71 _rt_insertion_point = _events.end();
72 _lookup_cache.left = -1;
73 _lookup_cache.range.first = _events.end();
74 _sort_pending = false;
77 AutomationListCreated(this);
80 AutomationList::AutomationList (const AutomationList& other)
81 : _param_id(other._param_id)
82 , _curve(new Curve(*this))
85 _changed_when_thawed = false;
86 _style = other._style;
87 _min_yval = other._min_yval;
88 _max_yval = other._max_yval;
89 _max_xval = other._max_xval;
90 _default_value = other._default_value;
91 _state = other._state;
92 _touching = other._touching;
93 _rt_insertion_point = _events.end();
94 _lookup_cache.left = -1;
95 _lookup_cache.range.first = _events.end();
96 _sort_pending = false;
98 for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) {
99 _events.push_back (new ControlEvent (**i));
103 AutomationListCreated(this);
106 AutomationList::AutomationList (const AutomationList& other, double start, double end)
107 : _param_id(other._param_id)
108 , _curve(new Curve(*this))
111 _changed_when_thawed = false;
112 _style = other._style;
113 _min_yval = other._min_yval;
114 _max_yval = other._max_yval;
115 _max_xval = other._max_xval;
116 _default_value = other._default_value;
117 _state = other._state;
118 _touching = other._touching;
119 _rt_insertion_point = _events.end();
120 _lookup_cache.left = -1;
121 _lookup_cache.range.first = _events.end();
122 _sort_pending = false;
124 /* now grab the relevant points, and shift them back if necessary */
126 AutomationList* section = const_cast<AutomationList*>(&other)->copy (start, end);
128 if (!section->empty()) {
129 for (AutomationList::iterator i = section->begin(); i != section->end(); ++i) {
130 _events.push_back (new ControlEvent ((*i)->when, (*i)->value));
138 AutomationListCreated(this);
141 /** \a id is used for legacy sessions where the type is not present
142 * in or below the <AutomationList> node. It is used if \a id is non-null.
144 AutomationList::AutomationList (const XMLNode& node, ParamID id)
145 : _curve(new Curve(*this))
148 _changed_when_thawed = false;
152 _max_xval = 0; // means "no limit"
155 _rt_insertion_point = _events.end();
156 _lookup_cache.left = -1;
157 _lookup_cache.range.first = _events.end();
158 _sort_pending = false;
165 AutomationListCreated(this);
168 AutomationList::~AutomationList()
172 for (EventList::iterator x = _events.begin(); x != _events.end(); ++x) {
178 AutomationList::operator== (const AutomationList& other)
180 return _events == other._events;
184 AutomationList::operator= (const AutomationList& other)
186 if (this != &other) {
190 for (const_iterator i = other._events.begin(); i != other._events.end(); ++i) {
191 _events.push_back (new ControlEvent (**i));
194 _min_yval = other._min_yval;
195 _max_yval = other._max_yval;
196 _max_xval = other._max_xval;
197 _default_value = other._default_value;
200 maybe_signal_changed ();
207 AutomationList::maybe_signal_changed ()
212 _changed_when_thawed = true;
219 AutomationList::set_automation_state (AutoState s)
223 automation_state_changed (); /* EMIT SIGNAL */
228 AutomationList::set_automation_style (AutoStyle s)
232 automation_style_changed (); /* EMIT SIGNAL */
237 AutomationList::start_touch ()
244 AutomationList::stop_touch ()
251 AutomationList::clear ()
254 Glib::Mutex::Lock lm (_lock);
259 maybe_signal_changed ();
263 AutomationList::x_scale (double factor)
265 Glib::Mutex::Lock lm (_lock);
270 AutomationList::extend_to (double when)
272 Glib::Mutex::Lock lm (_lock);
273 if (_events.empty() || _events.back()->when == when) {
276 double factor = when / _events.back()->when;
281 void AutomationList::_x_scale (double factor)
283 for (AutomationList::iterator i = _events.begin(); i != _events.end(); ++i) {
284 (*i)->when = floor ((*i)->when * factor);
291 AutomationList::reposition_for_rt_add (double when)
293 _rt_insertion_point = _events.end();
297 AutomationList::rt_add (double when, double value)
299 /* this is for automation recording */
301 if ((_state & Touch) && !_touching) {
305 // cerr << "RT: alist @ " << this << " add " << value << " @ " << when << endl;
308 Glib::Mutex::Lock lm (_lock);
312 ControlEvent cp (when, 0.0);
315 if ((_rt_insertion_point != _events.end()) && ((*_rt_insertion_point)->when < when) ) {
317 /* we have a previous insertion point, so we should delete
318 everything between it and the position where we are going
319 to insert this point.
322 iterator after = _rt_insertion_point;
324 if (++after != _events.end()) {
325 iterator far = after;
327 while (far != _events.end()) {
328 if ((*far)->when > when) {
336 _rt_insertion_point = where;
338 if((*where)->when == when) {
339 (*where)->value = value;
343 where = _events.erase (after, far);
352 iterator previous = _rt_insertion_point;
355 if (_rt_insertion_point != _events.begin() && (*_rt_insertion_point)->value == value && (*previous)->value == value) {
356 (*_rt_insertion_point)->when = when;
363 where = lower_bound (_events.begin(), _events.end(), &cp, cmp);
365 if (where != _events.end()) {
366 if ((*where)->when == when) {
367 (*where)->value = value;
374 _rt_insertion_point = _events.insert (where, new ControlEvent (when, value));
381 maybe_signal_changed ();
385 AutomationList::fast_simple_add (double when, double value)
387 /* to be used only for loading pre-sorted data from saved state */
388 _events.insert (_events.end(), new ControlEvent (when, value));
392 AutomationList::add (double when, double value)
394 /* this is for graphical editing */
397 Glib::Mutex::Lock lm (_lock);
399 ControlEvent cp (when, 0.0f);
401 iterator insertion_point;
403 for (insertion_point = lower_bound (_events.begin(), _events.end(), &cp, cmp); insertion_point != _events.end(); ++insertion_point) {
405 /* only one point allowed per time point */
407 if ((*insertion_point)->when == when) {
408 (*insertion_point)->value = value;
413 if ((*insertion_point)->when >= when) {
420 _events.insert (insertion_point, new ControlEvent (when, value));
421 reposition_for_rt_add (0);
428 maybe_signal_changed ();
432 AutomationList::erase (AutomationList::iterator i)
435 Glib::Mutex::Lock lm (_lock);
437 reposition_for_rt_add (0);
440 maybe_signal_changed ();
444 AutomationList::erase (AutomationList::iterator start, AutomationList::iterator end)
447 Glib::Mutex::Lock lm (_lock);
448 _events.erase (start, end);
449 reposition_for_rt_add (0);
452 maybe_signal_changed ();
456 AutomationList::reset_range (double start, double endt)
461 Glib::Mutex::Lock lm (_lock);
463 ControlEvent cp (start, 0.0f);
467 if ((s = lower_bound (_events.begin(), _events.end(), &cp, cmp)) != _events.end()) {
470 e = upper_bound (_events.begin(), _events.end(), &cp, cmp);
472 for (iterator i = s; i != e; ++i) {
473 (*i)->value = _default_value;
483 maybe_signal_changed ();
488 AutomationList::erase_range (double start, double endt)
493 Glib::Mutex::Lock lm (_lock);
495 ControlEvent cp (start, 0.0f);
499 if ((s = lower_bound (_events.begin(), _events.end(), &cp, cmp)) != _events.end()) {
501 e = upper_bound (_events.begin(), _events.end(), &cp, cmp);
502 _events.erase (s, e);
503 reposition_for_rt_add (0);
511 maybe_signal_changed ();
516 AutomationList::move_range (iterator start, iterator end, double xdelta, double ydelta)
518 /* note: we assume higher level logic is in place to avoid this
519 reordering the time-order of control events in the list. ie. all
520 points after end are later than (end)->when.
524 Glib::Mutex::Lock lm (_lock);
526 while (start != end) {
527 (*start)->when += xdelta;
528 (*start)->value += ydelta;
529 if (isnan ((*start)->value)) {
536 _events.sort (sort_events_by_time);
538 _sort_pending = true;
544 maybe_signal_changed ();
548 AutomationList::slide (iterator before, double distance)
551 Glib::Mutex::Lock lm (_lock);
553 if (before == _events.end()) {
557 while (before != _events.end()) {
558 (*before)->when += distance;
563 maybe_signal_changed ();
567 AutomationList::modify (iterator iter, double when, double val)
569 /* note: we assume higher level logic is in place to avoid this
570 reordering the time-order of control events in the list. ie. all
571 points after *iter are later than when.
575 Glib::Mutex::Lock lm (_lock);
577 (*iter)->when = when;
578 (*iter)->value = val;
585 _events.sort (sort_events_by_time);
587 _sort_pending = true;
593 maybe_signal_changed ();
596 std::pair<AutomationList::iterator,AutomationList::iterator>
597 AutomationList::control_points_adjacent (double xval)
599 Glib::Mutex::Lock lm (_lock);
602 ControlEvent cp (xval, 0.0f);
603 std::pair<iterator,iterator> ret;
605 ret.first = _events.end();
606 ret.second = _events.end();
608 for (i = lower_bound (_events.begin(), _events.end(), &cp, cmp); i != _events.end(); ++i) {
610 if (ret.first == _events.end()) {
611 if ((*i)->when >= xval) {
612 if (i != _events.begin()) {
621 if ((*i)->when > xval) {
631 AutomationList::freeze ()
637 AutomationList::thaw ()
640 PBD::stacktrace (cerr);
641 fatal << string_compose (_("programming error: %1"), X_("AutomationList::thaw() called while not frozen")) << endmsg;
650 Glib::Mutex::Lock lm (_lock);
653 _events.sort (sort_events_by_time);
654 _sort_pending = false;
658 if (_changed_when_thawed) {
659 StateChanged(); /* EMIT SIGNAL */
664 AutomationList::set_max_xval (double x)
670 AutomationList::mark_dirty ()
672 _lookup_cache.left = -1;
673 Dirty (); /* EMIT SIGNAL */
677 AutomationList::truncate_end (double last_coordinate)
680 Glib::Mutex::Lock lm (_lock);
681 ControlEvent cp (last_coordinate, 0);
682 list<ControlEvent*>::reverse_iterator i;
685 if (_events.empty()) {
689 if (last_coordinate == _events.back()->when) {
693 if (last_coordinate > _events.back()->when) {
698 iterator foo = _events.begin();
701 if (foo == _events.end()) {
703 } else if (++foo == _events.end()) {
710 /* less than 2 points: add a new point */
711 _events.push_back (new ControlEvent (last_coordinate, _events.back()->value));
714 /* more than 2 points: check to see if the last 2 values
715 are equal. if so, just move the position of the
716 last point. otherwise, add a new point.
719 iterator penultimate = _events.end();
720 --penultimate; /* points at last point */
721 --penultimate; /* points at the penultimate point */
723 if (_events.back()->value == (*penultimate)->value) {
724 _events.back()->when = last_coordinate;
726 _events.push_back (new ControlEvent (last_coordinate, _events.back()->value));
734 last_val = unlocked_eval (last_coordinate);
735 last_val = max ((double) _min_yval, last_val);
736 last_val = min ((double) _max_yval, last_val);
738 i = _events.rbegin();
740 /* make i point to the last control point */
744 /* now go backwards, removing control points that are
745 beyond the new last coordinate.
748 uint32_t sz = _events.size();
750 while (i != _events.rend() && sz > 2) {
751 list<ControlEvent*>::reverse_iterator tmp;
756 if ((*i)->when < last_coordinate) {
760 _events.erase (i.base());
766 _events.back()->when = last_coordinate;
767 _events.back()->value = last_val;
770 reposition_for_rt_add (0);
774 maybe_signal_changed ();
778 AutomationList::truncate_start (double overall_length)
781 Glib::Mutex::Lock lm (_lock);
782 AutomationList::iterator i;
783 double first_legal_value;
784 double first_legal_coordinate;
786 if (_events.empty()) {
787 fatal << _("programming error:")
788 << "AutomationList::truncate_start() called on an empty list"
794 if (overall_length == _events.back()->when) {
795 /* no change in overall length */
799 if (overall_length > _events.back()->when) {
801 /* growing at front: duplicate first point. shift all others */
803 double shift = overall_length - _events.back()->when;
806 for (np = 0, i = _events.begin(); i != _events.end(); ++i, ++np) {
812 /* less than 2 points: add a new point */
813 _events.push_front (new ControlEvent (0, _events.front()->value));
817 /* more than 2 points: check to see if the first 2 values
818 are equal. if so, just move the position of the
819 first point. otherwise, add a new point.
822 iterator second = _events.begin();
823 ++second; /* points at the second point */
825 if (_events.front()->value == (*second)->value) {
826 /* first segment is flat, just move start point back to zero */
827 _events.front()->when = 0;
829 /* leave non-flat segment in place, add a new leading point. */
830 _events.push_front (new ControlEvent (0, _events.front()->value));
836 /* shrinking at front */
838 first_legal_coordinate = _events.back()->when - overall_length;
839 first_legal_value = unlocked_eval (first_legal_coordinate);
840 first_legal_value = max (_min_yval, first_legal_value);
841 first_legal_value = min (_max_yval, first_legal_value);
843 /* remove all events earlier than the new "front" */
847 while (i != _events.end() && !_events.empty()) {
848 list<ControlEvent*>::iterator tmp;
853 if ((*i)->when > first_legal_coordinate) {
863 /* shift all remaining points left to keep their same
867 for (i = _events.begin(); i != _events.end(); ++i) {
868 (*i)->when -= first_legal_coordinate;
871 /* add a new point for the interpolated new value */
873 _events.push_front (new ControlEvent (0, first_legal_value));
876 reposition_for_rt_add (0);
881 maybe_signal_changed ();
885 AutomationList::unlocked_eval (double x) const
887 pair<EventList::iterator,EventList::iterator> range;
893 npoints = _events.size();
897 return _default_value;
900 if (x >= _events.front()->when) {
901 return _events.front()->value;
903 // return _default_value;
904 return _events.front()->value;
908 if (x >= _events.back()->when) {
909 return _events.back()->value;
910 } else if (x == _events.front()->when) {
911 return _events.front()->value;
912 } else if (x < _events.front()->when) {
913 // return _default_value;
914 return _events.front()->value;
917 lpos = _events.front()->when;
918 lval = _events.front()->value;
919 upos = _events.back()->when;
920 uval = _events.back()->value;
922 /* linear interpolation betweeen the two points
925 fraction = (double) (x - lpos) / (double) (upos - lpos);
926 return lval + (fraction * (uval - lval));
930 if (x >= _events.back()->when) {
931 return _events.back()->value;
932 } else if (x == _events.front()->when) {
933 return _events.front()->value;
934 } else if (x < _events.front()->when) {
935 // return _default_value;
936 return _events.front()->value;
939 return multipoint_eval (x);
945 AutomationList::multipoint_eval (double x) const
947 pair<AutomationList::const_iterator,AutomationList::const_iterator> range;
952 /* only do the range lookup if x is in a different range than last time
953 this was called (or if the lookup cache has been marked "dirty" (left<0)
956 if ((_lookup_cache.left < 0) ||
957 ((_lookup_cache.left > x) ||
958 (_lookup_cache.range.first == _events.end()) ||
959 ((*_lookup_cache.range.second)->when < x))) {
961 ControlEvent cp (x, 0);
964 _lookup_cache.range = equal_range (_events.begin(), _events.end(), &cp, cmp);
967 range = _lookup_cache.range;
969 if (range.first == range.second) {
971 /* x does not exist within the list as a control point */
973 _lookup_cache.left = x;
975 if (range.first != _events.begin()) {
977 lpos = (*range.first)->when;
978 lval = (*range.first)->value;
980 /* we're before the first point */
981 // return _default_value;
982 return _events.front()->value;
985 if (range.second == _events.end()) {
986 /* we're after the last point */
987 return _events.back()->value;
990 upos = (*range.second)->when;
991 uval = (*range.second)->value;
993 /* linear interpolation betweeen the two points
997 fraction = (double) (x - lpos) / (double) (upos - lpos);
998 return lval + (fraction * (uval - lval));
1002 /* x is a control point in the data */
1003 _lookup_cache.left = -1;
1004 return (*range.first)->value;
1008 AutomationList::cut (iterator start, iterator end)
1010 AutomationList* nal = new AutomationList (_param_id, _min_yval, _max_yval, _default_value);
1013 Glib::Mutex::Lock lm (_lock);
1015 for (iterator x = start; x != end; ) {
1021 nal->_events.push_back (new ControlEvent (**x));
1024 reposition_for_rt_add (0);
1032 maybe_signal_changed ();
1038 AutomationList::cut_copy_clear (double start, double end, int op)
1040 AutomationList* nal = new AutomationList (_param_id, _min_yval, _max_yval, _default_value);
1042 ControlEvent cp (start, 0.0);
1044 bool changed = false;
1047 Glib::Mutex::Lock lm (_lock);
1049 if ((s = lower_bound (_events.begin(), _events.end(), &cp, cmp)) == _events.end()) {
1054 e = upper_bound (_events.begin(), _events.end(), &cp, cmp);
1056 if (op != 2 && (*s)->when != start) {
1057 nal->_events.push_back (new ControlEvent (0, unlocked_eval (start)));
1060 for (iterator x = s; x != e; ) {
1068 /* adjust new points to be relative to start, which
1069 has been set to zero.
1073 nal->_events.push_back (new ControlEvent ((*x)->when - start, (*x)->value));
1083 if (op != 2 && nal->_events.back()->when != end - start) {
1084 nal->_events.push_back (new ControlEvent (end - start, unlocked_eval (end)));
1088 reposition_for_rt_add (0);
1094 maybe_signal_changed ();
1101 AutomationList::copy (iterator start, iterator end)
1103 AutomationList* nal = new AutomationList (_param_id, _min_yval, _max_yval, _default_value);
1106 Glib::Mutex::Lock lm (_lock);
1108 for (iterator x = start; x != end; ) {
1114 nal->_events.push_back (new ControlEvent (**x));
1124 AutomationList::cut (double start, double end)
1126 return cut_copy_clear (start, end, 0);
1130 AutomationList::copy (double start, double end)
1132 return cut_copy_clear (start, end, 1);
1136 AutomationList::clear (double start, double end)
1138 (void) cut_copy_clear (start, end, 2);
1142 AutomationList::paste (AutomationList& alist, double pos, float times)
1144 if (alist._events.empty()) {
1149 Glib::Mutex::Lock lm (_lock);
1153 ControlEvent cp (pos, 0.0);
1156 where = upper_bound (_events.begin(), _events.end(), &cp, cmp);
1158 for (iterator i = alist.begin();i != alist.end(); ++i) {
1159 _events.insert (where, new ControlEvent( (*i)->when+pos,( *i)->value));
1160 end = (*i)->when + pos;
1164 /* move all points after the insertion along the timeline by
1168 while (where != _events.end()) {
1170 if ((*where)->when <= end) {
1173 _events.erase(where);
1181 reposition_for_rt_add (0);
1185 maybe_signal_changed ();
1190 AutomationList::get_state ()
1192 return state (true);
1196 AutomationList::state (bool full)
1198 cerr << _param_id.to_string() << "->state()" << endl;
1200 XMLNode* root = new XMLNode (X_("AutomationList"));
1202 LocaleGuard lg (X_("POSIX"));
1204 root->add_property ("automation-id", _param_id.to_string());
1206 root->add_property ("id", _id.to_s());
1208 snprintf (buf, sizeof (buf), "%.12g", _default_value);
1209 root->add_property ("default", buf);
1210 snprintf (buf, sizeof (buf), "%.12g", _min_yval);
1211 root->add_property ("_min_yval", buf);
1212 snprintf (buf, sizeof (buf), "%.12g", _max_yval);
1213 root->add_property ("_max_yval", buf);
1214 snprintf (buf, sizeof (buf), "%.12g", _max_xval);
1215 root->add_property ("_max_xval", buf);
1218 root->add_property ("state", auto_state_to_string (_state));
1220 /* never save anything but Off for automation state to a template */
1221 root->add_property ("state", auto_state_to_string (Off));
1224 root->add_property ("style", auto_style_to_string (_style));
1226 if (!_events.empty()) {
1227 root->add_child_nocopy (serialize_events());
1234 AutomationList::serialize_events ()
1236 XMLNode* node = new XMLNode (X_("events"));
1239 for (iterator xx = _events.begin(); xx != _events.end(); ++xx) {
1240 str << (double) (*xx)->when;
1242 str <<(double) (*xx)->value;
1246 /* XML is a bit wierd */
1248 XMLNode* content_node = new XMLNode (X_("foo")); /* it gets renamed by libxml when we set content */
1249 content_node->set_content (str.str());
1251 node->add_child_nocopy (*content_node);
1257 AutomationList::deserialize_events (const XMLNode& node)
1259 if (node.children().empty()) {
1263 XMLNode* content_node = node.children().front();
1265 if (content_node->content().empty()) {
1272 stringstream str (content_node->content());
1288 fast_simple_add (x, y);
1293 error << _("automation list: cannot load coordinates from XML, all points ignored") << endmsg;
1296 reposition_for_rt_add (0);
1297 maybe_signal_changed ();
1306 AutomationList::set_state (const XMLNode& node)
1308 XMLNodeList nlist = node.children();
1310 XMLNodeIterator niter;
1311 const XMLProperty* prop;
1313 if (node.name() == X_("events")) {
1314 /* partial state setting*/
1315 return deserialize_events (node);
1318 if (node.name() == X_("Envelope") || node.name() == X_("FadeOut") || node.name() == X_("FadeIn")) {
1320 if ((nsos = node.child (X_("AutomationList")))) {
1321 /* new school in old school clothing */
1322 return set_state (*nsos);
1327 const XMLNodeList& elist = node.children();
1328 XMLNodeConstIterator i;
1336 for (i = elist.begin(); i != elist.end(); ++i) {
1338 if ((prop = (*i)->property ("x")) == 0) {
1339 error << _("automation list: no x-coordinate stored for control point (point ignored)") << endmsg;
1342 x = atoi (prop->value().c_str());
1344 if ((prop = (*i)->property ("y")) == 0) {
1345 error << _("automation list: no y-coordinate stored for control point (point ignored)") << endmsg;
1348 y = atof (prop->value().c_str());
1350 fast_simple_add (x, y);
1358 if (node.name() != X_("AutomationList") ) {
1359 error << string_compose (_("AutomationList: passed XML node called %1, not \"AutomationList\" - ignored"), node.name()) << endmsg;
1363 if ((prop = node.property ("id")) != 0) {
1364 _id = prop->value ();
1365 /* update session AL list */
1366 AutomationListCreated(this);
1369 if ((prop = node.property (X_("automation-id"))) != 0){
1370 _param_id = ParamID(prop->value());
1372 warning << "Legacy session: automation list has no automation-id property.";
1375 if ((prop = node.property (X_("default"))) != 0){
1376 _default_value = atof (prop->value());
1378 _default_value = 0.0;
1381 if ((prop = node.property (X_("style"))) != 0) {
1382 _style = string_to_auto_style (prop->value());
1387 if ((prop = node.property (X_("state"))) != 0) {
1388 _state = string_to_auto_state (prop->value());
1393 if ((prop = node.property (X_("_min_yval"))) != 0) {
1394 _min_yval = atof (prop->value ());
1396 _min_yval = FLT_MIN;
1399 if ((prop = node.property (X_("_max_yval"))) != 0) {
1400 _max_yval = atof (prop->value ());
1402 _max_yval = FLT_MAX;
1405 if ((prop = node.property (X_("_max_xval"))) != 0) {
1406 _max_xval = atof (prop->value ());
1408 _max_xval = 0; // means "no limit ;
1411 for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
1412 if ((*niter)->name() == X_("events")) {
1413 deserialize_events (*(*niter));