From faefa809ad37e5e4c9e729dd52723c7a15aa7237 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 16 Jul 2010 19:37:46 +0000 Subject: [PATCH] Remove unused full parameter to Region::state git-svn-id: svn://localhost/ardour2/branches/3.0@7428 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/audioregion.h | 2 +- libs/ardour/ardour/midi_region.h | 2 +- libs/ardour/ardour/region.h | 2 +- libs/ardour/audioregion.cc | 43 +++++++++++++------------------- libs/ardour/midi_region.cc | 4 +-- libs/ardour/region.cc | 6 ++--- libs/ardour/session_state.cc | 2 +- 7 files changed, 27 insertions(+), 34 deletions(-) diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h index 6a91790e97..d1238cb43c 100644 --- a/libs/ardour/ardour/audioregion.h +++ b/libs/ardour/ardour/audioregion.h @@ -121,7 +121,7 @@ class AudioRegion : public Region virtual framecnt_t read_raw_internal (Sample*, framepos_t, framecnt_t, int channel) const; - XMLNode& state (bool); + XMLNode& state (); int set_state (const XMLNode&, int version); static void set_default_fade (float steepness, framecnt_t len); diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index ac65b86fc3..0b62809fc3 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -71,7 +71,7 @@ class MidiRegion : public Region uint32_t chan_n = 0, NoteMode mode = Sustained) const; - XMLNode& state (bool); + XMLNode& state (); int set_state (const XMLNode&, int version); int separate_by_channel (ARDOUR::Session&, std::vector< boost::shared_ptr >&) const; diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 3dab0f46de..089ca97eb2 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -236,7 +236,7 @@ class Region /* serialization */ XMLNode& get_state (); - virtual XMLNode& state (bool); + virtual XMLNode& state (); virtual int set_state (const XMLNode&, int version); virtual boost::shared_ptr get_parent() const; diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 5f8b35256b..6f349fed05 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -517,9 +517,9 @@ AudioRegion::_read_at (const SourceList& /*srcs*/, framecnt_t limit, } XMLNode& -AudioRegion::state (bool full) +AudioRegion::state () { - XMLNode& node (Region::state (full)); + XMLNode& node (Region::state ()); XMLNode *child; char buf[64]; LocaleGuard lg (X_("POSIX")); @@ -527,34 +527,27 @@ AudioRegion::state (bool full) snprintf (buf, sizeof (buf), "%u", (uint32_t) _sources.size()); node.add_property ("channels", buf); - if (full) { - Stateful::add_properties (node); - } + Stateful::add_properties (node); child = node.add_child ("Envelope"); - if (full) { - bool default_env = false; - - // If there are only two points, the points are in the start of the region and the end of the region - // so, if they are both at 1.0f, that means the default region. - - if (_envelope->size() == 2 && - _envelope->front()->value == 1.0f && - _envelope->back()->value==1.0f) { - if (_envelope->front()->when == 0 && _envelope->back()->when == _length) { - default_env = true; - } + bool default_env = false; + + // If there are only two points, the points are in the start of the region and the end of the region + // so, if they are both at 1.0f, that means the default region. + + if (_envelope->size() == 2 && + _envelope->front()->value == 1.0f && + _envelope->back()->value==1.0f) { + if (_envelope->front()->when == 0 && _envelope->back()->when == _length) { + default_env = true; } - - if (default_env) { - child->add_property ("default", "yes"); - } else { - child->add_child_nocopy (_envelope->get_state ()); - } - - } else { + } + + if (default_env) { child->add_property ("default", "yes"); + } else { + child->add_child_nocopy (_envelope->get_state ()); } return node; diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index c65758b01e..c76b6a859e 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -195,9 +195,9 @@ MidiRegion::_read_at (const SourceList& /*srcs*/, Evoral::EventSink& } XMLNode& -MidiRegion::state (bool full) +MidiRegion::state () { - return Region::state (full); + return Region::state (); } int diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index a4de9fc8b7..6dc090ce3c 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -1140,7 +1140,7 @@ Region::set_layer (layer_t l) } XMLNode& -Region::state (bool full) +Region::state () { XMLNode *node = new XMLNode ("Region"); char buf[64]; @@ -1191,7 +1191,7 @@ Region::state (bool full) node->add_property (buf2, buf); } - if (full && _extra_xml) { + if (_extra_xml) { node->add_child_copy (*_extra_xml); } @@ -1201,7 +1201,7 @@ Region::state (bool full) XMLNode& Region::get_state () { - return state (true); + return state (); } int diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 8bb3fa1ff0..8ad239280c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1082,7 +1082,7 @@ Session::state(bool full_state) boost::shared_ptr r = i->second; /* only store regions not attached to playlists */ if (r->playlist() == 0) { - child->add_child_nocopy (r->state (true)); + child->add_child_nocopy (r->state ()); } } }