}
XMLNode&
-Amp::state (bool full_state)
+Amp::state ()
{
- XMLNode& node (Processor::state (full_state));
+ XMLNode& node (Processor::state ());
node.set_property("type", _gain_control->parameter().type() == GainAutomation ? "amp" : "trim");
node.add_child_nocopy (_gain_control->get_state());
void setup_gain_automation (samplepos_t start_sample, samplepos_t end_sample, samplecnt_t nframes);
- XMLNode& state (bool full);
+ XMLNode& state ();
int set_state (const XMLNode&, int version);
static gain_t apply_gain (BufferSet& bufs, samplecnt_t sample_rate, samplecnt_t nframes, gain_t initial, gain_t target, bool midi_amp = true);
boost::shared_ptr<AudioFileSource> write_source (uint32_t n = 0);
protected:
- XMLNode& state (bool full);
+ XMLNode& state (bool save_template);
private:
int deprecated_use_diskstream_connections ();
virtual ~Automatable();
+ static bool skip_saving_automation; // to be used only by session-state
+
boost::shared_ptr<Evoral::Control> control_factory(const Evoral::Parameter& id);
boost::shared_ptr<AutomationControl> automation_control (PBD::ID const & id) const;
void create_curve_if_necessary ();
int deserialize_events (const XMLNode&);
- XMLNode& state (bool full, bool need_lock);
+ XMLNode& state (bool save_auto_state, bool need_lock);
XMLNode& serialize_events (bool need_lock);
void maybe_signal_changed ();
class LIBARDOUR_API CapturingProcessor : public Processor
{
- public:
+public:
CapturingProcessor (Session & session, samplecnt_t latency);
~CapturingProcessor();
- public: // main interface
+public: // main interface
BufferSet const & get_capture_buffers() const { return capture_buffers; }
- public: // Processor overrides
+public: // Processor overrides
bool display_to_user() const { return false; }
int set_block_size (pframes_t nframes);
void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool result_required);
bool configure_io (ChanCount in, ChanCount out);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
- virtual XMLNode& state (bool);
- private:
+protected:
+ XMLNode& state ();
+private:
void realloc_buffers();
samplecnt_t block_size;
bool set_name (const std::string& str);
- XMLNode& state (bool full);
+protected:
+ XMLNode& state ();
private:
void allocate_pending_buffers (samplecnt_t);
PBD::Signal0<void> MuteChange;
- XMLNode& state (bool full);
int set_state (const XMLNode&, int version);
/* Panning */
uint32_t pans_required() const { return _configured_input.n_audio(); }
virtual uint32_t pan_outs() const;
- protected:
+protected:
+ XMLNode& state ();
+
Role _role;
BufferSet* _output_buffers;
gain_t _current_gain;
gain_t target_gain ();
- private:
+private:
bool _no_outs_cuz_we_no_monitor;
boost::shared_ptr<MuteMaster> _mute_master;
class LIBARDOUR_API DiskReader : public DiskIOProcessor
{
- public:
+public:
DiskReader (Session&, std::string const & name, DiskIOProcessor::Flag f = DiskIOProcessor::Flag (0));
~DiskReader ();
int overwrite_existing_buffers ();
void set_pending_overwrite (bool yn);
- virtual XMLNode& state (bool full);
int set_state (const XMLNode&, int version);
PBD::Signal0<void> AlignmentStyleChanged;
static void set_no_disk_output (bool yn);
static bool no_disk_output() { return _no_disk_output; }
- protected:
+protected:
friend class Track;
friend class MidiTrack;
+ XMLNode& state ();
+
void resolve_tracker (Evoral::EventSink<samplepos_t>& buffer, samplepos_t time);
void playlist_changed (const PBD::PropertyChange&);
int use_playlist (DataType, boost::shared_ptr<Playlist>);
void playlist_ranges_moved (std::list< Evoral::RangeMove<samplepos_t> > const &, bool);
- private:
+private:
/** The number of samples by which this diskstream's output should be delayed
with respect to the transport sample. This is used for latency compensation.
*/
void non_realtime_locate (samplepos_t);
void realtime_handle_transport_stopped ();
- virtual XMLNode& state (bool full);
int set_state (const XMLNode&, int version);
virtual bool set_write_source_name (const std::string& str);
protected:
friend class Track;
+
+ virtual XMLNode& state ();
+
int do_flush (RunContext context, bool force = false);
void get_input_sources ();
class LIBARDOUR_API InternalReturn : public Return
{
- public:
+public:
InternalReturn (Session&);
- XMLNode& state (bool full);
- XMLNode& get_state ();
-
void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
bool configure_io (ChanCount, ChanCount);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
void set_playback_offset (samplecnt_t cnt);
- private:
+protected:
+ XMLNode& state ();
+
+private:
/** sends that we are receiving data from */
std::list<InternalSend*> _sends;
/** mutex to protect _sends */
class LIBARDOUR_API InternalSend : public Send
{
- public:
+public:
InternalSend (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_from, boost::shared_ptr<Route> send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false);
virtual ~InternalSend ();
bool set_name (const std::string&);
bool visible() const;
- XMLNode& state(bool full);
- XMLNode& get_state(void);
int set_state(const XMLNode& node, int version);
void cycle_start (pframes_t);
static PBD::Signal1<void, pframes_t> CycleStart;
- private:
+protected:
+ XMLNode& state();
+
+private:
BufferSet mixbufs;
boost::shared_ptr<Route> _send_from;
boost::shared_ptr<Route> _send_to;
*/
class LIBARDOUR_API IO : public SessionObject, public Latent
{
- public:
+public:
static const std::string state_node_name;
enum Direction {
*/
PBD::Signal2<void, IOChange, void *> changed;
- virtual XMLNode& state (bool full);
XMLNode& get_state (void);
+
int set_state (const XMLNode&, int version);
int set_state_2X (const XMLNode&, int, bool);
static void prepare_for_reset (XMLNode&, const std::string&);
int set_ports (const std::string& str);
- private:
- mutable Glib::Threads::Mutex io_lock;
+protected:
+ virtual XMLNode& state ();
- protected:
PortSet _ports;
Direction _direction;
DataType _default_type;
bool _active;
bool _sendish;
- private:
+private:
+ mutable Glib::Threads::Mutex io_lock;
int connecting_became_legal ();
PBD::ScopedConnection connection_legal_c;
PBD::Signal2<void,IOProcessor*,bool> AutomationPlaybackChanged;
PBD::Signal2<void,IOProcessor*,uint32_t> AutomationChanged;
- XMLNode& state (bool full_state);
+ XMLNode& state ();
int set_state (const XMLNode&, int version);
static void prepare_for_reset (XMLNode& state, const std::string& name);
LV2Plugin (const LV2Plugin &);
~LV2Plugin ();
- static bool force_state_save;
+ static bool force_state_save; // to be used only by session-state
std::string unique_id () const;
const char* uri () const;
void set_type(MeterType t);
MeterType get_type() { return _meter_type; }
- XMLNode& state (bool full);
PBD::Signal1<void, MeterType> TypeChanged;
+protected:
+ XMLNode& state ();
+
private:
friend class IO;
PBD::Signal0<void> InputActiveChanged;
protected:
- XMLNode& state (bool full);
+
+ XMLNode& state (bool save_template);
void act_on_mute ();
void monitoring_changed (bool, PBD::Controllable::GroupControlDisposition);
void run (BufferSet& /*bufs*/, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double /*speed*/, pframes_t /*nframes*/, bool /*result_required*/);
- XMLNode& state (bool full);
+ XMLNode& state ();
int set_state (const XMLNode&, int /* version */);
bool configure_io (ChanCount in, ChanCount out);
class LIBARDOUR_API Pannable : public PBD::Stateful, public Automatable, public SessionHandleRef
{
- public:
+public:
Pannable (Session& s);
~Pannable ();
bool touch_enabled() const { return _auto_state & (Touch | Latch); }
XMLNode& get_state ();
- XMLNode& state (bool full_state);
int set_state (const XMLNode&, int version);
bool has_state() const { return _has_state; }
- protected:
+protected:
+ virtual XMLNode& state ();
+
boost::weak_ptr<Panner> _panner;
AutoState _auto_state;
gint _touching;
void control_auto_state_changed (AutoState);
- private:
+private:
void value_changed ();
};
*/
class LIBARDOUR_API PluginInsert : public Processor
{
- public:
+public:
PluginInsert (Session&, boost::shared_ptr<Plugin> = boost::shared_ptr<Plugin>());
~PluginInsert ();
static const std::string port_automation_node_name;
- XMLNode& state(bool);
- XMLNode& get_state(void);
int set_state(const XMLNode&, int version);
void update_id (PBD::ID);
void set_owner (SessionObject*);
double get_value (void) const;
XMLNode& get_state();
- protected:
+ protected:
void actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
private:
bool custom_cfg; ///< custom config (if not strict)
};
- private:
+protected:
+ XMLNode& state ();
+
+private:
/* disallow copy construction */
PluginInsert (const PluginInsert&);
*/
class LIBARDOUR_API PortInsert : public IOProcessor
{
- public:
+public:
PortInsert (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster> mm);
~PortInsert ();
- XMLNode& state(bool full);
- XMLNode& get_state(void);
int set_state (const XMLNode&, int version);
void run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, double speed, pframes_t nframes, bool);
static std::string name_and_id_new_insert (Session&, uint32_t&);
- private:
+protected:
+ XMLNode& state ();
+private:
/* disallow copy construction */
PortInsert (const PortInsert&);
smoothly.
*/
- virtual XMLNode& state (bool full);
- XMLNode& get_state (void);
+ XMLNode& get_state ();
int set_state (const XMLNode&, int version);
virtual void set_pre_fader (bool);
SessionObject* owner() const;
protected:
+ virtual XMLNode& state ();
virtual int set_state_2X (const XMLNode&, int version);
int _pending_active;
, public Trimmable
, public Movable
{
- public:
+public:
typedef std::vector<boost::shared_ptr<Source> > SourceList;
static void make_property_quarks ();
/* serialization */
XMLNode& get_state ();
- virtual XMLNode& state ();
virtual int set_state (const XMLNode&, int version);
virtual boost::shared_ptr<Region> get_parent() const;
void drop_sources ();
- protected:
+protected:
+ virtual XMLNode& state ();
+
friend class RegionFactory;
/** Construct a region from multiple sources*/
return false;
}
- protected:
+protected:
void send_change (const PBD::PropertyChange&);
virtual int _set_state (const XMLNode&, int version, PBD::PropertyChange& what_changed, bool send_signal);
samplepos_t _transient_analysis_start;
samplepos_t _transient_analysis_end;
- private:
+private:
void mid_thaw (const PBD::PropertyChange&);
virtual void trim_to_internal (samplepos_t position, samplecnt_t length, const int32_t sub_num);
bool metering() const { return _metering; }
void set_metering (bool yn) { _metering = yn; }
- XMLNode& state(bool full);
- XMLNode& get_state(void);
int set_state(const XMLNode&, int version);
uint32_t pans_required() const { return _configured_input.n_audio(); }
static uint32_t how_many_returns();
static std::string name_and_id_new_return (Session&, uint32_t&);
- protected:
+protected:
+ XMLNode& state();
+
bool _metering;
boost::shared_ptr<GainControl> _gain_control;
boost::shared_ptr<Amp> _amp;
PBD::Signal0<void> io_changed;
/* stateful */
-
XMLNode& get_state();
+ XMLNode& get_template();
virtual int set_state (const XMLNode&, int version);
- virtual XMLNode& get_template();
XMLNode& get_processor_state ();
void set_processor_state (const XMLNode&);
virtual ChanCount input_streams () const;
- virtual XMLNode& state(bool);
+ virtual XMLNode& state (bool save_template);
int configure_processors (ProcessorStreams*);
class LIBARDOUR_API Send : public Delivery
{
- public:
+public:
Send (Session&, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send, bool ignore_bitslot = false);
virtual ~Send ();
bool metering() const { return _metering; }
void set_metering (bool yn) { _metering = yn; }
- XMLNode& state (bool full);
- XMLNode& get_state ();
int set_state(const XMLNode&, int version);
PBD::Signal0<void> SelfDestruct;
static uint32_t how_many_sends();
static std::string name_and_id_new_send (Session&, Delivery::Role r, uint32_t&, bool);
- protected:
+protected:
+ XMLNode& state ();
+
bool _metering;
boost::shared_ptr<GainControl> _gain_control;
boost::shared_ptr<Amp> _amp;
boost::shared_ptr<DelayLine> _send_delay;
boost::shared_ptr<DelayLine> _thru_delay;
- private:
+private:
/* disallow copy construction */
Send (const Send&);
std::vector<std::string> possible_states() const;
static std::vector<std::string> possible_states (std::string path);
- XMLNode& get_state();
- int set_state(const XMLNode& node, int version); // not idempotent
- XMLNode& get_template();
- bool export_track_state (boost::shared_ptr<RouteList> rl, const std::string& path);
+ bool export_track_state (boost::shared_ptr<RouteList> rl, const std::string& path);
/// The instant xml file is written to the session directory
void add_instant_xml (XMLNode&, bool write_to_config = true);
SwitchToSnapshot
};
- XMLNode& state(bool, snapshot_t snapshot_type = NormalSave);
+ XMLNode& state (bool save_template, snapshot_t snapshot_type = NormalSave);
+
+ XMLNode& get_state ();
+ int set_state (const XMLNode& node, int version); // not idempotent
+ XMLNode& get_template ();
/* click track */
typedef std::list<Click*> Clicks;
void find_equivalent_playlist_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >& result);
void update_after_tempo_map_change ();
- void add_state (XMLNode *, bool);
+ void add_state (XMLNode*, bool save_template, bool include_unused);
bool maybe_delete_unused (boost::function<int(boost::shared_ptr<Playlist>)>);
int load (Session &, const XMLNode&);
int load_unused (Session &, const XMLNode&);
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
bool configure_io (ChanCount in, ChanCount out);
- XMLNode& state(bool full);
- int set_state(const XMLNode&, int version);
+ int set_state(const XMLNode&, int version);
+
+protected:
+ XMLNode& state ();
private:
/* disallow copy construction */
*/
class LIBARDOUR_API Track : public Route, public Recordable
{
- public:
+public:
Track (Session&, std::string name, PresentationInfo::Flag f = PresentationInfo::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO);
virtual ~Track ();
virtual int export_stuff (BufferSet& bufs, samplepos_t start_sample, samplecnt_t nframes,
boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) = 0;
- XMLNode& get_state();
- XMLNode& get_template();
virtual int set_state (const XMLNode&, int version);
static void zero_diskstream_id_in_xml (XMLNode&);
PBD::Signal0<void> SpeedChanged;
PBD::Signal0<void> AlignmentStyleChanged;
- protected:
- XMLNode& state (bool full);
+protected:
+ XMLNode& state (bool save_template);
boost::shared_ptr<Playlist> _playlists[DataType::num_types];
bool can_support_io_configuration (const ChanCount &, ChanCount &);
void run (BufferSet& /*bufs*/, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double /*speed*/, pframes_t /*nframes*/, bool /*result_required*/);
- XMLNode & state (bool);
+protected:
+ XMLNode& state ();
private:
XMLNode _state;
}
XMLNode&
-AudioTrack::state (bool full_state)
+AudioTrack::state (bool save_template)
{
- XMLNode& root (Track::state(full_state));
+ XMLNode& root (Track::state (save_template));
XMLNode* freeze_node;
if (_freeze_record.playlist) {
using namespace ARDOUR;
using namespace PBD;
+/* used for templates (previously: !full_state) */
+bool Automatable::skip_saving_automation = false;
+
const string Automatable::xml_node_name = X_("Automation");
Automatable::Automatable(Session& session)
}
XMLNode&
-AutomationList::state (bool full, bool need_lock)
+AutomationList::state (bool save_auto_state, bool need_lock)
{
XMLNode* root = new XMLNode (X_("AutomationList"));
root->set_property ("id", id());
root->set_property ("interpolation-style", _interpolation);
- if (full) {
+ if (save_auto_state) {
/* never serialize state with Write enabled - too dangerous
for the user's data
*/
}
XMLNode &
-CapturingProcessor::state (bool full)
+CapturingProcessor::state ()
{
- XMLNode& node = Processor::state (full);
+ XMLNode& node = Processor::state ();
node.set_property (X_("type"), X_("capture"));
return node;
}
XMLNode&
-DelayLine::state (bool full_state)
+DelayLine::state ()
{
- XMLNode& node (Processor::state (full_state));
+ XMLNode& node (Processor::state ());
node.set_property("type", "delay");
return node;
}
}
XMLNode&
-Delivery::state (bool full_state)
+Delivery::state ()
{
- XMLNode& node (IOProcessor::state (full_state));
+ XMLNode& node (IOProcessor::state ());
if (_role & Main) {
node.set_property("type", "main-outs");
}
XMLNode&
-DiskReader::state (bool full)
+DiskReader::state ()
{
- XMLNode& node (DiskIOProcessor::state (full));
+ XMLNode& node (DiskIOProcessor::state ());
node.set_property(X_("type"), X_("diskreader"));
return node;
}
}
XMLNode&
-DiskWriter::state (bool full)
+DiskWriter::state ()
{
- XMLNode& node (DiskIOProcessor::state (full));
+ XMLNode& node (DiskIOProcessor::state ());
node.set_property (X_("type"), X_("diskwriter"));
node.set_property (X_("record-safe"), (_record_safe ? X_("yes" : "no")));
return node;
}
XMLNode&
-InternalReturn::state (bool full)
+InternalReturn::state ()
{
- XMLNode& node (Return::state (full));
+ XMLNode& node (Return::state ());
/* override type */
node.set_property("type", "intreturn");
return node;
}
-XMLNode&
-InternalReturn::get_state()
-{
- return state (true);
-}
-
bool
InternalReturn::can_support_io_configuration (const ChanCount& in, ChanCount& out)
{
}
XMLNode&
-InternalSend::state (bool full)
+InternalSend::state ()
{
- XMLNode& node (Send::state (full));
+ XMLNode& node (Send::state ());
/* this replaces any existing "type" property */
return node;
}
-XMLNode&
-InternalSend::get_state()
-{
- return state (true);
-}
-
int
InternalSend::set_state (const XMLNode& node, int version)
{
XMLNode&
IO::get_state ()
{
- return state (true);
+ return state ();
}
XMLNode&
-IO::state (bool /*full_state*/)
+IO::state ()
{
XMLNode* node = new XMLNode (state_node_name);
int n;
}
XMLNode&
-IOProcessor::state (bool full_state)
+IOProcessor::state ()
{
- XMLNode& node (Processor::state (full_state));
+ XMLNode& node (Processor::state ());
node.set_property ("own-input", _own_input);
if (_input) {
if (_own_input) {
- XMLNode& i (_input->state (full_state));
+ XMLNode& i (_input->get_state ());
// i.name() = X_("output");
node.add_child_nocopy (i);
} else {
if (_output) {
if (_own_output) {
- XMLNode& o (_output->state (full_state));
+ XMLNode& o (_output->get_state ());
node.add_child_nocopy (o);
} else {
node.set_property ("output", _output->name ());
}
XMLNode&
-PeakMeter::state (bool full_state)
+PeakMeter::state ()
{
- XMLNode& node (Processor::state (full_state));
+ XMLNode& node (Processor::state ());
node.set_property("type", "meter");
return node;
}
}
XMLNode&
-MidiTrack::state(bool full_state)
+MidiTrack::state(bool save_template)
{
- XMLNode& root (Track::state(full_state));
+ XMLNode& root (Track::state (save_template));
XMLNode* freeze_node;
char buf[64];
}
XMLNode&
-MonitorProcessor::state (bool full)
+MonitorProcessor::state ()
{
- XMLNode& node(Processor::state(full));
+ XMLNode& node(Processor::state ());
/* this replaces any existing "type" property */
XMLNode&
Pannable::get_state ()
{
- return state (true);
+ return state ();
}
XMLNode&
-Pannable::state (bool /*full*/)
+Pannable::state ()
{
XMLNode* node = new XMLNode (X_("Pannable"));
XMLNode&
-PluginInsert::get_state ()
+PluginInsert::state ()
{
- return state (true);
-}
-
-XMLNode&
-PluginInsert::state (bool full)
-{
- XMLNode& node = Processor::state (full);
+ XMLNode& node = Processor::state ();
node.set_property("type", _plugins[0]->state_node_name());
node.set_property("unique-id", _plugins[0]->unique_id());
node.add_child_nocopy (* _thru_map.state ("ThruMap"));
if (_sidechain) {
- node.add_child_nocopy (_sidechain->state (full));
+ node.add_child_nocopy (_sidechain->get_state ());
}
_plugins[0]->set_insert_id(this->id());
}
XMLNode&
-PortInsert::get_state(void)
+PortInsert::state ()
{
- return state (true);
-}
-
-XMLNode&
-PortInsert::state (bool full)
-{
- XMLNode& node = IOProcessor::state(full);
+ XMLNode& node = IOProcessor::state ();
node.set_property ("type", "port");
node.set_property ("bitslot", _bitslot);
node.set_property ("latency", _measured_latency);
XMLNode&
Processor::get_state (void)
{
- return state (true);
+ return state ();
}
/* NODE STRUCTURE
*/
XMLNode&
-Processor::state (bool full_state)
+Processor::state ()
{
XMLNode* node = new XMLNode (state_node_name);
node->add_child_copy (*_extra_xml);
}
- if (full_state) {
+ if (!skip_saving_automation) {
XMLNode& automation = Automatable::get_automation_xml_state();
if (!automation.children().empty() || !automation.properties().empty()) {
node->add_child_nocopy (automation);
}
XMLNode&
-Return::get_state(void)
+Return::state()
{
- return state (true);
-}
-
-XMLNode&
-Return::state(bool full)
-{
- XMLNode& node = IOProcessor::state(full);
+ XMLNode& node = IOProcessor::state ();
node.set_property ("type", "return");
node.set_property ("bitslot", _bitslot);
XMLNode&
Route::get_state()
{
- return state(true);
+ return state (false);
}
XMLNode&
Route::get_template()
{
- return state(false);
+ return state (true);
}
XMLNode&
-Route::state(bool full_state)
+Route::state (bool save_template)
{
if (!_session._template_state_dir.empty()) {
foreach_processor (sigc::bind (sigc::mem_fun (*this, &Route::set_plugin_state_dir), _session._template_state_dir));
node->add_child_nocopy (_solo_isolate_control->get_state ());
node->add_child_nocopy (_solo_safe_control->get_state ());
- node->add_child_nocopy (_input->state (full_state));
- node->add_child_nocopy (_output->state (full_state));
+ node->add_child_nocopy (_input->get_state ());
+ node->add_child_nocopy (_output->get_state ());
node->add_child_nocopy (_mute_master->get_state ());
node->add_child_nocopy (_mute_control->get_state ());
node->add_child_nocopy (_phase_control->get_state ());
- if (full_state) {
+ if (!skip_saving_automation) {
node->add_child_nocopy (Automatable::get_automation_xml_state ());
}
}
if (_pannable) {
- node->add_child_nocopy (_pannable->state (full_state));
+ node->add_child_nocopy (_pannable->get_state ());
}
{
if (*i == _delayline) {
continue;
}
- if (!full_state) {
+ if (save_template) {
/* template save: do not include internal sends functioning as
aux sends because the chance of the target ID
in the session where this template is used
}
}
}
- node->add_child_nocopy((*i)->state (full_state));
+ node->add_child_nocopy((*i)->get_state ());
}
}
{
XMLNode* root = new XMLNode (X_("redirects"));
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
- root->add_child_nocopy ((*i)->state (true));
+ root->add_child_nocopy ((*i)->get_state ());
}
return *root;
}
XMLNode&
-Send::get_state(void)
+Send::state ()
{
- return state (true);
-}
-
-XMLNode&
-Send::state (bool full)
-{
- XMLNode& node = Delivery::state(full);
+ XMLNode& node = Delivery::state ();
node.set_property ("type", "send");
node.set_property ("selfdestruct", _remove_on_disconnect);
- node.add_child_nocopy (_amp->state (full));
+ node.add_child_nocopy (_amp->get_state ());
return node;
}
} // anonymous namespace
void
-SessionPlaylists::add_state (XMLNode* node, bool full_state)
+SessionPlaylists::add_state (XMLNode* node, bool save_template, bool include_unused)
{
XMLNode* child = node->add_child ("Playlists");
for (IDSortedList::iterator i = id_sorted_playlists.begin (); i != id_sorted_playlists.end (); ++i) {
if (!(*i)->hidden ()) {
- if (full_state) {
- child->add_child_nocopy ((*i)->get_state ());
- } else {
+ if (save_template) {
child->add_child_nocopy ((*i)->get_template ());
+ } else {
+ child->add_child_nocopy ((*i)->get_state ());
}
}
}
+ if (!include_unused) {
+ return;
+ }
+
child = node->add_child ("UnusedPlaylists");
IDSortedList id_sorted_unused_playlists;
i != id_sorted_unused_playlists.end (); ++i) {
if (!(*i)->hidden()) {
if (!(*i)->empty()) {
- if (full_state) {
- child->add_child_nocopy ((*i)->get_state());
- } else {
+ if (save_template) {
child->add_child_nocopy ((*i)->get_template());
+ } else {
+ child->add_child_nocopy ((*i)->get_state());
}
}
}
mark_as_clean = false;
tree.set_root (&get_template());
} else {
- tree.set_root (&state (true, fork_state));
+ tree.set_root (&state (false, fork_state));
}
if (snapshot_name.empty()) {
}
XMLNode&
-Session::get_state()
+Session::get_state ()
{
- return state(true);
+ /* this is not directly called, but required by PBD::Stateful */
+ assert (0);
+ return state (false, NormalSave);
}
XMLNode&
-Session::get_template()
+Session::get_template ()
{
/* if we don't disable rec-enable, diskstreams
will believe they need to store their capture
disable_record (false);
- return state(false);
+ return state (true, NormalSave);
}
typedef std::set<boost::shared_ptr<Playlist> > PlaylistSet;
} // anon namespace
XMLNode&
-Session::state (bool full_state, snapshot_t snapshot_type)
+Session::state (bool save_template, snapshot_t snapshot_type)
{
LocaleGuard lg;
XMLNode* node = new XMLNode("Session");
XMLNode* child;
+ PBD::Unwinder<bool> uw (Automatable::skip_saving_automation, save_template);
+
node->set_property("version", CURRENT_SESSION_FILE_VERSION);
child = node->add_child ("ProgramVersion");
/* store configuration settings */
- if (full_state) {
+ if (!save_template) {
node->set_property ("name", _name);
node->set_property ("sample-rate", _base_sample_rate);
}
XMLNode& cfgxml (config.get_variables ());
- if (!full_state) {
+ if (save_template) {
/* exclude search-paths from template */
cfgxml.remove_nodes_and_delete ("name", "audio-search-path");
cfgxml.remove_nodes_and_delete ("name", "midi-search-path");
child = node->add_child ("Sources");
- if (full_state) {
+ if (!save_template) {
Glib::Threads::Mutex::Lock sl (source_lock);
for (SourceMap::iterator siter = sources.begin(); siter != sources.end(); ++siter) {
child = node->add_child ("Regions");
- if (full_state) {
+ if (!save_template) {
Glib::Threads::Mutex::Lock rl (region_lock);
const RegionFactory::RegionMap& region_map (RegionFactory::all_regions());
for (RegionFactory::RegionMap::const_iterator i = region_map.begin(); i != region_map.end(); ++i) {
}
}
- if (full_state) {
+ if (!save_template) {
node->add_child_nocopy (_selection->get_state());
for (RouteList::const_iterator i = xml_node_order.begin(); i != xml_node_order.end(); ++i) {
if (!(*i)->is_auditioner()) {
- if (full_state) {
- child->add_child_nocopy ((*i)->get_state());
- } else {
+ if (save_template) {
child->add_child_nocopy ((*i)->get_template());
+ } else {
+ child->add_child_nocopy ((*i)->get_state());
}
}
}
}
- playlists->add_state (node, full_state);
+ playlists->add_state (node, save_template, /* include unused*/ true);
child = node->add_child ("RouteGroups");
for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
if (_click_io) {
XMLNode* gain_child = node->add_child ("Click");
- gain_child->add_child_nocopy (_click_io->state (full_state));
- gain_child->add_child_nocopy (_click_gain->state (full_state));
+ gain_child->add_child_nocopy (_click_io->get_state ());
+ gain_child->add_child_nocopy (_click_gain->get_state ());
}
if (_ltc_input) {
XMLNode* ltc_input_child = node->add_child ("LTC-In");
- ltc_input_child->add_child_nocopy (_ltc_input->state (full_state));
+ ltc_input_child->add_child_nocopy (_ltc_input->get_state ());
}
if (_ltc_input) {
XMLNode* ltc_output_child = node->add_child ("LTC-Out");
- ltc_output_child->add_child_nocopy (_ltc_output->state (full_state));
+ ltc_output_child->add_child_nocopy (_ltc_output->get_state ());
}
node->add_child_nocopy (_speakers->get_state());
}
XMLNode&
-SideChain::state (bool full)
+SideChain::state ()
{
- XMLNode& node = IOProcessor::state (full);
+ XMLNode& node = IOProcessor::state ();
node.set_property ("type", "sidechain");
return node;
}
}
XMLNode&
-Track::get_state ()
+Track::state (bool save_template)
{
- return state (true);
-}
-
-XMLNode&
-Track::state (bool full)
-{
- XMLNode& root (Route::state (full));
+ XMLNode& root (Route::state (save_template));
if (_playlists[DataType::AUDIO]) {
root.set_property (X_("audio-playlist"), _playlists[DataType::AUDIO]->id().to_s());
return 0;
}
-XMLNode&
-Track::get_template ()
-{
- return state (false);
-}
-
Track::FreezeRecord::~FreezeRecord ()
{
for (vector<FreezeRecordProcessorInfo*>::iterator i = processor_info.begin(); i != processor_info.end(); ++i) {
}
XMLNode &
-UnknownProcessor::state (bool)
+UnknownProcessor::state ()
{
return *(new XMLNode (_state));
}