Part 1 of loading 2.X sessions; some things work, some things don't, hacks a-plenty.

LOADING 2.X SESSIONS WITH THIS COMMIT IN PLACE WILL (PROBABLY) CORRUPT THE .ardour FILE,
MAKING THE SESSION UNLOADABLE ON 2.X AND LOSING INFORMATION.

So don't do that unless you make a backup of the session file first.



git-svn-id: svn://localhost/ardour2/branches/3.0@5786 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-10-15 00:57:55 +00:00
parent 09efd82c6a
commit 79f91c7a20
131 changed files with 907 additions and 270 deletions

View file

@ -2356,6 +2356,10 @@ ARDOUR_UI::get_session_parameters (bool should_be_new)
} else {
ret = load_session (session_path, session_name, template_name);
if (!ARDOUR_COMMAND_LINE::immediate_save.empty()) {
session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false);
exit (1);
}
}
}

View file

@ -1260,8 +1260,8 @@ AutomationLine::get_state (void)
return alist->get_state();
}
int
AutomationLine::set_state (const XMLNode &node)
int
AutomationLine::set_state (const XMLNode &node, int version)
{
/* function as a proxy for the model */
return alist->set_state (node);

View file

@ -125,7 +125,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
bool is_first_point (ControlPoint &);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void set_colors();
void modify_point_y (ControlPoint&, double);

View file

@ -865,7 +865,7 @@ AutomationTimeAxisView::color_handler ()
}
int
AutomationTimeAxisView::set_state (const XMLNode& node)
AutomationTimeAxisView::set_state (const XMLNode& node, int version)
{
TimeAxisView::set_state (node);

View file

@ -90,8 +90,7 @@ class AutomationTimeAxisView : public TimeAxisView {
bool paste (nframes_t, float times, Selection&, size_t nth);
void reset_objects (PointSelection&);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
guint32 show_at (double y, int& nth, Gtk::VBox *parent);
void hide ();

View file

@ -2226,7 +2226,7 @@ Editor::set_edit_point_preference (EditPoint ep, bool force)
}
int
Editor::set_state (const XMLNode& node)
Editor::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
XMLNode* geometry;

View file

@ -180,7 +180,7 @@ class Editor : public PublicEditor
void redo (uint32_t n = 1);
XMLNode& get_state ();
int set_state (const XMLNode& );
int set_state (const XMLNode&, int version = 3000);
void set_mouse_mode (Editing::MouseMode, bool force=true);
void step_mouse_mode (bool next);

View file

@ -157,8 +157,8 @@ Keyboard::get_state (void)
return *node;
}
int
Keyboard::set_state (const XMLNode& node)
int
Keyboard::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -40,7 +40,7 @@ class Keyboard : public sigc::trackable, PBD::Stateful
~Keyboard ();
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
typedef std::vector<uint32_t> State;
typedef uint32_t ModifierMask;

View file

@ -41,6 +41,7 @@ bool ARDOUR_COMMAND_LINE::try_hw_optimization = true;
string ARDOUR_COMMAND_LINE::keybindings_path = ""; /* empty means use builtin default */
Glib::ustring ARDOUR_COMMAND_LINE::menus_file = "ardour.menus";
bool ARDOUR_COMMAND_LINE::finder_invoked_ardour = false;
string ARDOUR_COMMAND_LINE::immediate_save;
using namespace ARDOUR_COMMAND_LINE;
@ -51,7 +52,7 @@ print_help (const char *execname)
<< _(" -v, --version Show version information\n")
<< _(" -h, --help Print this message\n")
<< _(" -b, --bindings Print all possible keyboard binding names\n")
<< _(" -c, --name name Use a specific jack client name, default is ardour\n")
<< _(" -c, --name <name> Use a specific jack client name, default is ardour\n")
<< _(" -d, --disable-plugins Disable all plugins in an existing session\n")
<< _(" -n, --show-splash Show splash screen\n")
<< _(" -m, --menus file Use \"file\" for Ardour menus\n")
@ -61,6 +62,7 @@ print_help (const char *execname)
#ifdef VST_SUPPORT
<< _(" -V, --novst Do not use VST support\n")
#endif
<< _(" -E, --save <file> Load the specified session, save it to <file> and then quit\n")
<< _(" [session-name] Name of session to load\n")
<< _(" -C, --curvetest filename Curve algorithm debugger\n")
<< _(" -k, --keybindings filename Name of key bindings to load (default is ~/.ardour3/ardour.bindings)\n")
@ -71,9 +73,8 @@ print_help (const char *execname)
int
ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{
const char *optstring = "U:hSbvVnOdc:C:m:N:k:p:";
const char *optstring = "U:hSbvVnOdc:C:m:N:k:p:E:";
const char *execname = strrchr (argv[0], '/');
if (getenv ("ARDOUR_SAE")) {
@ -99,6 +100,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
{ "no-hw-optimizations", 0, 0, 'O' },
{ "sync", 0, 0, 'S' },
{ "curvetest", 1, 0, 'C' },
{ "save", 1, 0, 'E' },
{ 0, 0, 0, 0 }
};
@ -176,6 +178,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
keybindings_path = optarg;
break;
case 'E':
immediate_save = optarg;
break;
default:
return print_help(execname);
}
@ -189,7 +195,6 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
session_name = argv[optind++];
}
return 0;
}

View file

@ -38,6 +38,7 @@ extern bool use_gtk_theme;
extern std::string keybindings_path;
extern Glib::ustring menus_file;
extern bool finder_invoked_ardour;
extern std::string immediate_save;
extern int32_t parse_opts (int argc, char *argv[]);

View file

@ -344,7 +344,7 @@ PannerUI::setup_pan ()
uint32_t const nouts = _panner->nouts();
uint32_t const npans = _panner->npanners();
if (int32_t (nouts) == _current_nouts && npans == _current_npans) {
if (int32_t (nouts) == _current_nouts && int32_t (npans) == _current_npans) {
return;
}

View file

@ -383,7 +383,7 @@ RouteTimeAxisView::automation_click ()
}
int
RouteTimeAxisView::set_state (const XMLNode& node)
RouteTimeAxisView::set_state (const XMLNode& node, int version)
{
TimeAxisView::set_state (node);

View file

@ -113,9 +113,9 @@ public:
void add_underlay (StreamView*, bool update_xml = true);
void remove_underlay (StreamView*);
void build_underlay_menu(Gtk::Menu*);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
/* This is a bit nasty to expose :/ */
struct RouteAutomationNode {
Evoral::Parameter param;

View file

@ -1001,7 +1001,7 @@ TimeAxisView::get_state ()
}
int
TimeAxisView::set_state (const XMLNode& node)
TimeAxisView::set_state (const XMLNode& node, int version)
{
const XMLProperty *prop;

View file

@ -93,7 +93,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
virtual ~TimeAxisView ();
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
/** @return index of this TimeAxisView within its parent */
int order () const { return _order; }

View file

@ -221,7 +221,7 @@ UIConfiguration::get_variables (std::string which_node)
}
int
UIConfiguration::set_state (const XMLNode& root)
UIConfiguration::set_state (const XMLNode& root, int version)
{
if (root.name() != "Ardour") {
return -1;

View file

@ -80,7 +80,7 @@ class UIConfiguration : public PBD::Stateful
int save_state ();
int load_defaults ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_state (void);
XMLNode& get_variables (std::string);
void set_variables (const XMLNode&);

View file

@ -335,7 +335,7 @@ Amp::state (bool full_state)
}
int
Amp::set_state (const XMLNode& node)
Amp::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -55,7 +55,7 @@ public:
void apply_gain_automation(bool yn) { _apply_gain_automation = yn; }
XMLNode& state (bool full);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
static void apply_gain (BufferSet& bufs, nframes_t nframes, gain_t initial, gain_t target);
static void apply_simple_gain(BufferSet& bufs, nframes_t nframes, gain_t target);

View file

@ -126,7 +126,7 @@ class AudioDiskstream : public Diskstream
/* stateful */
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode& node, int version = 3000);
void monitor_input (bool);

View file

@ -33,7 +33,7 @@ class AudioTrack : public Track
{
public:
AudioTrack (Session&, std::string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
AudioTrack (Session&, const XMLNode&);
AudioTrack (Session&, const XMLNode&, int);
~AudioTrack ();
int set_mode (TrackMode m);
@ -55,12 +55,12 @@ class AudioTrack : public Track
boost::shared_ptr<Region> bounce (InterThreadInfo&);
boost::shared_ptr<Region> bounce_range (nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
protected:
XMLNode& state (bool full);
int _set_state (const XMLNode&, bool call_base);
int _set_state (const XMLNode&, int, bool call_base);
private:
int set_diskstream (boost::shared_ptr<AudioDiskstream>, void *);

View file

@ -72,7 +72,7 @@ public:
int setup_peakfile ();
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
bool can_truncate_peaks() const { return !destructive(); }
bool can_be_analysed() const { return _length > 0; }

View file

@ -50,7 +50,7 @@ class AudioPlaylist : public ARDOUR::Playlist
nframes_t read (Sample *dst, Sample *mixdown, float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n=0);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
sigc::signal<void,boost::shared_ptr<Crossfade> > NewCrossfade;

View file

@ -107,7 +107,7 @@ class AudioRegion : public Region
virtual nframes_t read_raw_internal (Sample*, sframes_t, nframes_t, int channel) const;
XMLNode& state (bool);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
static void set_default_fade (float steepness, nframes_t len);
bool fade_in_is_default () const;

View file

@ -79,7 +79,7 @@ class AudioSource : virtual public Source,
mutable sigc::signal<void,nframes_t,nframes_t> PeakRangeReady;
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
int rename_peakfile (Glib::ustring newpath);
void touch_peakfile ();

View file

@ -79,8 +79,8 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
void stop_touch ();
bool touching() const { return _touching; }
XMLNode& get_state(void);
int set_state (const XMLNode &s);
XMLNode& get_state ();
int set_state (const XMLNode &, int version = 3000);
XMLNode& state (bool full);
XMLNode& serialize_events ();

View file

@ -34,7 +34,7 @@ class Configuration : public PBD::Stateful
virtual ~Configuration();
virtual void map_parameters (sigc::slot<void, std::string> s) = 0;
virtual int set_state (XMLNode const &) = 0;
virtual int set_state (XMLNode const &, int) = 0;
virtual XMLNode & get_state () = 0;
virtual XMLNode & get_variables () = 0;
virtual void set_variables (XMLNode const &) = 0;

View file

@ -70,7 +70,7 @@ struct ControlProtocolInfo {
void set_protocol_states (const XMLNode&);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_state (void);
private:

View file

@ -75,7 +75,7 @@ class Crossfade : public ARDOUR::AudioRegion
bool operator== (const ARDOUR::Crossfade&);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
boost::shared_ptr<ARDOUR::AudioRegion> in() const { return _in; }
boost::shared_ptr<ARDOUR::AudioRegion> out() const { return _out; }

View file

@ -89,7 +89,7 @@ public:
static sigc::signal<void,nframes_t> CycleStart;
XMLNode& state (bool full);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
/* Panning */

View file

@ -130,8 +130,8 @@ class Diskstream : public SessionObject, public boost::noncopyable
/* Stateful */
virtual XMLNode& get_state(void) = 0;
virtual int set_state(const XMLNode& node) = 0;
virtual int set_state(const XMLNode&, int version = 3000) = 0;
virtual void monitor_input (bool) {}
nframes_t capture_offset() const { return _capture_offset; }

View file

@ -46,7 +46,7 @@ public:
bool is_embedded () const { return _is_embedded; }
uint16_t channel() const { return _channel; }
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
int set_source_name (const Glib::ustring& newname, bool destructive);

View file

@ -38,7 +38,7 @@ class InternalReturn : public Return
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
bool configure_io (ChanCount in, ChanCount out);

View file

@ -38,8 +38,8 @@ class InternalSend : public Send
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode& node, int version = 3000);
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
bool feeds (boost::shared_ptr<Route> other) const;
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;

View file

@ -137,7 +137,8 @@ class IO : public SessionObject, public Latent
virtual XMLNode& state (bool full);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
int set_state_2X (const XMLNode&, int, bool);
static int disable_connecting (void);
static int enable_connecting (void);
@ -156,6 +157,8 @@ class IO : public SessionObject, public Latent
static bool connecting_legal;
XMLNode *pending_state_node;
int pending_state_node_version;
bool pending_state_node_in;
/* three utility functions - this just seems to be simplest place to put them */
@ -203,9 +206,11 @@ class IO : public SessionObject, public Latent
void bundle_changed (Bundle::Change);
int get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle>& c);
int create_ports (const XMLNode&);
int make_connections (const XMLNode&);
int get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c);
int get_port_counts_2X (const XMLNode& node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c);
int create_ports (const XMLNode&, int version);
int make_connections (const XMLNode&, int, bool);
int make_connections_2X (const XMLNode &, int, bool);
boost::shared_ptr<Bundle> find_possible_bundle (const std::string &desired_name);

View file

@ -72,8 +72,8 @@ class IOProcessor : public Processor
sigc::signal<void,IOProcessor*,uint32_t> AutomationChanged;
XMLNode& state (bool full_state);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
protected:
boost::shared_ptr<IO> _input;
boost::shared_ptr<IO> _output;

View file

@ -99,7 +99,7 @@ class LadspaPlugin : public ARDOUR::Plugin
bool parameter_is_toggled(uint32_t) const;
XMLNode& get_state();
int set_state(const XMLNode& node);
int set_state (const XMLNode&, int version = 3000);
bool save_preset(std::string name);
bool has_editor() const { return false; }
@ -133,6 +133,7 @@ class LadspaPlugin : public ARDOUR::Plugin
void init (void *mod, uint32_t index, nframes_t rate);
void run_in_place (nframes_t nsamples);
void latency_compute_run ();
int set_state_2X (const XMLNode&, int version = 3000);
};
class LadspaPluginInfo : public PluginInfo {

View file

@ -71,7 +71,7 @@ class Location : public PBD::StatefulDestructible
}
Location (const Location& other);
Location (const XMLNode&);
Location (const XMLNode&, int version = 3000);
Location* operator= (const Location& other);
bool locked() const { return _locked; }
@ -125,7 +125,7 @@ class Location : public PBD::StatefulDestructible
XMLNode& cd_info_node (const std::string &, const std::string &);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
private:
std::string _name;
@ -155,7 +155,7 @@ class Locations : public PBD::StatefulDestructible
void clear_ranges ();
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
Location *get_location_by_id(PBD::ID);
Location* auto_loop_location () const;

View file

@ -75,7 +75,7 @@ class MidiDiskstream : public Diskstream
/* stateful */
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
void monitor_input (bool);

View file

@ -69,8 +69,8 @@ public:
void operator()();
void undo();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_state ();
void add(const boost::shared_ptr< Evoral::Note<TimeType> > note);
@ -113,8 +113,8 @@ public:
void operator()();
void undo();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_state ();
void change (const boost::shared_ptr<Evoral::Note<TimeType> > note,

View file

@ -50,7 +50,7 @@ public:
nframes_t read (MidiRingBuffer<nframes_t>& buf,
nframes_t start, nframes_t cnt, uint32_t chan_n=0);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
bool destroy_region (boost::shared_ptr<Region>);

View file

@ -68,7 +68,7 @@ class MidiRegion : public Region
NoteMode mode = Sustained) const;
XMLNode& state (bool);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
int separate_by_channel (ARDOUR::Session&, std::vector< boost::shared_ptr<Region> >&) const;

View file

@ -91,7 +91,7 @@ class MidiSource : virtual public Source
mutable sigc::signal<void,sframes_t,nframes_t> ViewDataRangeReady;
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
bool length_mutable() const { return true; }

View file

@ -35,7 +35,7 @@ class MidiTrack : public Track
{
public:
MidiTrack (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal);
MidiTrack (Session&, const XMLNode&);
MidiTrack (Session&, const XMLNode&, int);
~MidiTrack ();
int roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame,
@ -59,7 +59,7 @@ public:
boost::shared_ptr<Region> bounce_range (
nframes_t start, nframes_t end, InterThreadInfo&, bool enable_processing);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
void midi_panic(void);
bool write_immediate_event(size_t size, const uint8_t* buf);
@ -92,8 +92,8 @@ public:
protected:
XMLNode& state (bool full);
int _set_state (const XMLNode&, bool call_base);
int _set_state (const XMLNode&, int, bool call_base);
private:
void write_out_of_band_data (

View file

@ -65,7 +65,7 @@ class MuteMaster : public AutomationControl
sigc::signal<void> MutePointChanged;
XMLNode& get_state();
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
private:
AutomationList* _automation;

View file

@ -44,7 +44,7 @@ struct NamedSelection : public PBD::Stateful
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
static sigc::signal<void,NamedSelection*> NamedSelectionCreated;
};

View file

@ -36,7 +36,6 @@
namespace ARDOUR {
class Route;
class Session;
class Panner;
class BufferSet;
@ -74,7 +73,7 @@ class StreamPanner : public sigc::trackable, public PBD::Stateful
sigc::signal<void> Changed; /* for position */
sigc::signal<void> StateChanged; /* for mute */
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
virtual XMLNode& state (bool full_state) = 0;
Panner & get_parent() { return parent; }
@ -149,9 +148,9 @@ class EqualPowerStereoPanner : public BaseStereoPanner
static StreamPanner* factory (Panner&, Evoral::Parameter param);
static std::string name;
XMLNode& state (bool full_state);
XMLNode& get_state (void);
int set_state (const XMLNode&);
XMLNode& state (bool full_state);
XMLNode& get_state (void);
int set_state (const XMLNode&, int version = 3000);
private:
void update ();
@ -172,7 +171,7 @@ class Multi2dPanner : public StreamPanner
XMLNode& state (bool full_state);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
/* old school automation loading */
@ -229,7 +228,7 @@ public:
XMLNode& get_state (void);
XMLNode& state (bool full);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
static bool equivalent (pan_t a, pan_t b) {
return fabsf (a - b) < 0.002; // about 1 degree of arc for a stereo panner

View file

@ -124,7 +124,7 @@ class Playlist : public SessionObject,
void foreach_region (sigc::slot<void, boost::shared_ptr<Region> >);
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_template ();
sigc::signal<void,bool> InUse;

View file

@ -45,14 +45,14 @@ class PluginInsert : public Processor
{
public:
PluginInsert (Session&, boost::shared_ptr<Plugin>);
PluginInsert (Session&, const XMLNode&);
PluginInsert (Session&, const XMLNode&, int version = 3000);
~PluginInsert ();
static const std::string port_automation_node_name;
XMLNode& state(bool);
XMLNode& get_state(void);
int set_state(const XMLNode&);
int set_state(const XMLNode&, int version = 3000);
void run (BufferSet& in, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);
void silence (nframes_t nframes);

View file

@ -44,12 +44,12 @@ class PortInsert : public IOProcessor
{
public:
PortInsert (Session&, boost::shared_ptr<MuteMaster> mm);
PortInsert (Session&, boost::shared_ptr<MuteMaster> mm, const XMLNode&);
PortInsert (Session&, boost::shared_ptr<MuteMaster> mm, const XMLNode&, int version = 3000);
~PortInsert ();
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes);

View file

@ -91,8 +91,8 @@ class Processor : public SessionObject, public AutomatableControls, public Laten
virtual XMLNode& state (bool full);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void *get_gui () const { return _gui; }
void set_gui (void *p) { _gui = p; }
@ -109,6 +109,9 @@ protected:
ChanCount _configured_input;
ChanCount _configured_output;
void* _gui; /* generic, we don't know or care what this is */
private:
int set_state_2X (const XMLNode&, int version);
};
} // namespace ARDOUR

View file

@ -37,7 +37,7 @@ class RCConfiguration : public Configuration
RCConfiguration();
void map_parameters (sigc::slot<void, std::string>);
int set_state (XMLNode const &);
int set_state (XMLNode const &, int version = 3000);
XMLNode& get_state ();
XMLNode& get_variables ();
void set_variables (XMLNode const &);

View file

@ -241,7 +241,7 @@ class Region
XMLNode& get_state ();
virtual XMLNode& state (bool);
virtual int set_state (const XMLNode&);
virtual int set_state (const XMLNode&, int version = 3000);
virtual int set_live_state (const XMLNode&, Change&, bool send);
virtual boost::shared_ptr<Region> get_parent() const;

View file

@ -54,7 +54,7 @@ public:
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
uint32_t pans_required() const { return _configured_input.n_audio(); }

View file

@ -68,7 +68,7 @@ class Route : public SessionObject, public AutomatableControls
Route (Session&, std::string name, Flag flags = Flag(0),
DataType default_type = DataType::AUDIO);
Route (Session&, const XMLNode&, DataType default_type = DataType::AUDIO);
Route (Session&, const XMLNode&, int, DataType default_type = DataType::AUDIO);
virtual ~Route();
boost::shared_ptr<IO> input() const { return _input; }
@ -251,7 +251,7 @@ class Route : public SessionObject, public AutomatableControls
/* stateful */
XMLNode& get_state();
int set_state(const XMLNode& node);
int set_state (const XMLNode&, int version = 3000);
virtual XMLNode& get_template();
XMLNode& get_processor_state ();
@ -384,8 +384,8 @@ class Route : public SessionObject, public AutomatableControls
uint32_t pans_required() const;
ChanCount n_process_buffers ();
virtual int _set_state (const XMLNode&, bool call_base);
virtual int _set_state (const XMLNode&, int, bool call_base);
boost::shared_ptr<Amp> _amp;
boost::shared_ptr<PeakMeter> _meter;
@ -393,6 +393,8 @@ class Route : public SessionObject, public AutomatableControls
private:
void init ();
int _set_state_2X (const XMLNode&, int);
void set_processor_state_2X (XMLNodeList const &, int);
static uint32_t order_key_cnt;
@ -407,7 +409,8 @@ class Route : public SessionObject, public AutomatableControls
int configure_processors (ProcessorStreams*);
int configure_processors_unlocked (ProcessorStreams*);
bool add_processor_from_xml (const XMLNode&, ProcessorList::iterator iter);
bool add_processor_from_xml (const XMLNode&, ProcessorList::iterator iter);
bool add_processor_from_xml_2X (const XMLNode&, int, ProcessorList::iterator iter);
void placement_range (Placement p, ProcessorList::iterator& start, ProcessorList::iterator& end);
};

View file

@ -130,9 +130,9 @@ public:
sigc::signal<void,void*> FlagsChanged;
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
private:
Session& _session;
std::list<Route *> routes;
@ -142,6 +142,7 @@ private:
Property _properties;
void remove_when_going_away (Route*);
int set_state_2X (const XMLNode&, int);
};
} /* namespace */

View file

@ -38,7 +38,7 @@ class Send : public Delivery
{
public:
Send (Session&, boost::shared_ptr<MuteMaster>, Delivery::Role r = Delivery::Send);
Send (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&, Delivery::Role r = Delivery::Send);
Send (Session&, boost::shared_ptr<MuteMaster>, const XMLNode&, int version = 3000, Delivery::Role r = Delivery::Send);
virtual ~Send ();
uint32_t bit_slot() const { return _bitslot; }
@ -53,7 +53,7 @@ class Send : public Delivery
XMLNode& state(bool full);
XMLNode& get_state(void);
int set_state(const XMLNode& node);
int set_state(const XMLNode&, int version = 3000);
uint32_t pans_required() const { return _configured_input.n_audio(); }

View file

@ -305,7 +305,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
typedef std::list<boost::shared_ptr<Diskstream> > DiskstreamList;
int load_routes (const XMLNode&);
int load_routes (const XMLNode&, int);
boost::shared_ptr<RouteList> get_routes() const {
return routes.reader ();
}
@ -468,7 +468,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
static std::vector<std::string*>* possible_states (std::string path);
XMLNode& get_state();
int set_state(const XMLNode& node); // not idempotent
int set_state(const XMLNode& node, int version = 3000); // not idempotent
XMLNode& get_template();
/// The instant xml file is written to the session directory
@ -849,7 +849,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
public:
GlobalRouteStateCommand (Session&, void*);
GlobalRouteStateCommand (Session&, const XMLNode& node);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
XMLNode& get_state ();
protected:
@ -899,7 +899,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void operator()();
void undo();
XMLNode &get_state();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void mark();
protected:
@ -1439,7 +1439,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
/* edit/mix groups */
int load_route_groups (const XMLNode&);
int load_route_groups (const XMLNode&, int);
std::list<RouteGroup *> _route_groups;
@ -1458,7 +1458,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void add_routes (RouteList&, bool save);
uint32_t destructive_index;
boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&);
boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);
/* mixer stuff */

View file

@ -30,7 +30,7 @@ public:
SessionConfiguration ();
void map_parameters (sigc::slot<void, std::string>);
int set_state (XMLNode const &);
int set_state (XMLNode const &, int version = 3000);
XMLNode& get_state ();
XMLNode& get_variables ();
void set_variables (XMLNode const &);

View file

@ -107,7 +107,7 @@ class SessionMetadata : public PBD::StatefulDestructible
/*** Serialization ***/
XMLNode & get_state ();
int set_state (const XMLNode &);
int set_state (const XMLNode &, int version = 3000);
private:

View file

@ -58,7 +58,7 @@ public:
void mark_streaming_write_completed ();
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void load_model (bool lock=true, bool force_reload=false);
void destroy_model ();

View file

@ -76,8 +76,8 @@ class Source : public SessionObject, public boost::noncopyable
virtual void session_saved() {}
XMLNode& get_state ();
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
bool destructive() const { return (_flags & Destructive); }
bool writable () const { return (_flags & Writable); }
virtual bool set_destructive (bool /*yn*/) { return false; }

View file

@ -212,7 +212,7 @@ class TempoMap : public PBD::StatefulDestructible
void set_length (nframes_t frames);
XMLNode& get_state (void);
int set_state (const XMLNode&);
int set_state (const XMLNode&, int version = 3000);
void dump (std::ostream&) const;
void clear ();

View file

@ -82,7 +82,7 @@ class Track : public Route
XMLNode& get_state();
XMLNode& get_template();
virtual int set_state(const XMLNode& node) = 0;
virtual int set_state (const XMLNode&, int version = 3000) = 0;
static void zero_diskstream_id_in_xml (XMLNode&);
boost::shared_ptr<PBD::Controllable> rec_enable_control() { return _rec_enable_control; }
@ -96,7 +96,7 @@ class Track : public Route
sigc::signal<void> FreezeChange;
protected:
Track (Session& sess, const XMLNode& node, DataType default_type = DataType::AUDIO);
Track (Session& sess, const XMLNode& node, int, DataType default_type = DataType::AUDIO);
virtual XMLNode& state (bool full) = 0;

View file

@ -38,7 +38,7 @@ class UserBundle : public Bundle, public PBD::Stateful {
XMLNode& get_state ();
private:
int set_state (XMLNode const &);
int set_state (XMLNode const &, int version = 3000);
};
}

View file

@ -1909,7 +1909,7 @@ AudioDiskstream::get_state ()
}
int
AudioDiskstream::set_state (const XMLNode& node)
AudioDiskstream::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
XMLNodeList nlist = node.children();

View file

@ -558,7 +558,7 @@ AudioPlaylist::crossfade_invalidated (boost::shared_ptr<Region> r)
}
int
AudioPlaylist::set_state (const XMLNode& node)
AudioPlaylist::set_state (const XMLNode& node, int version)
{
XMLNode *child;
XMLNodeList nlist;

View file

@ -56,10 +56,10 @@ AudioTrack::AudioTrack (Session& sess, string name, Route::Flag flag, TrackMode
use_new_diskstream ();
}
AudioTrack::AudioTrack (Session& sess, const XMLNode& node)
: Track (sess, node)
AudioTrack::AudioTrack (Session& sess, const XMLNode& node, int version)
: Track (sess, node, version)
{
_set_state (node, false);
_set_state (node, version, false);
}
AudioTrack::~AudioTrack ()
@ -233,19 +233,19 @@ AudioTrack::audio_diskstream() const
}
int
AudioTrack::set_state (const XMLNode& node)
AudioTrack::set_state (const XMLNode& node, int version)
{
return _set_state (node, true);
return _set_state (node, version, true);
}
int
AudioTrack::_set_state (const XMLNode& node, bool call_base)
AudioTrack::_set_state (const XMLNode& node, int version, bool call_base)
{
const XMLProperty *prop;
XMLNodeConstIterator iter;
if (call_base) {
if (Route::_set_state (node, call_base)) {
if (Route::_set_state (node, version, call_base)) {
return -1;
}
}

View file

@ -290,7 +290,7 @@ AudioTrackImporter::_move ()
XMLNode routes ("Routes");
routes.add_child_copy (xml_track);
session.load_routes (routes);
session.load_routes (routes, 3000);
}
bool

View file

@ -258,7 +258,7 @@ AudioFileSource::get_state ()
}
int
AudioFileSource::set_state (const XMLNode& node)
AudioFileSource::set_state (const XMLNode& node, int version)
{
if (Source::set_state (node)) {
return -1;

View file

@ -751,7 +751,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
}
int
AudioRegion::set_state (const XMLNode& node)
AudioRegion::set_state (const XMLNode& node, int version)
{
/* Region::set_state() calls the virtual set_live_state(),
which will get us back to AudioRegion::set_live_state()

View file

@ -118,7 +118,7 @@ AudioSource::get_state ()
}
int
AudioSource::set_state (const XMLNode& node)
AudioSource::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -352,7 +352,7 @@ AutomationList::deserialize_events (const XMLNode& node)
}
int
AutomationList::set_state (const XMLNode& node)
AutomationList::set_state (const XMLNode& node, int version)
{
XMLNodeList nlist = node.children();
XMLNode* nsos;

View file

@ -288,7 +288,7 @@ ControlProtocolManager::cpi_by_name (string name)
}
int
ControlProtocolManager::set_state (const XMLNode& node)
ControlProtocolManager::set_state (const XMLNode& node, int version)
{
XMLNodeList clist;
XMLNodeConstIterator citer;

View file

@ -720,7 +720,7 @@ Crossfade::get_state ()
}
int
Crossfade::set_state (const XMLNode& node)
Crossfade::set_state (const XMLNode& node, int version)
{
XMLNodeConstIterator i;
XMLNodeList children;

View file

@ -372,7 +372,7 @@ Delivery::state (bool full_state)
}
int
Delivery::set_state (const XMLNode& node)
Delivery::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -104,7 +104,7 @@ FileSource::init (const ustring& pathstr, bool must_exist)
}
int
FileSource::set_state (const XMLNode& node)
FileSource::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -131,7 +131,7 @@ InternalReturn::get_state()
}
int
InternalReturn::set_state (const XMLNode& node)
InternalReturn::set_state (const XMLNode& node, int version)
{
return Return::set_state (node);
}

View file

@ -171,7 +171,7 @@ InternalSend::get_state()
}
int
InternalSend::set_state (const XMLNode& node)
InternalSend::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -515,8 +515,14 @@ IO::state (bool /*full_state*/)
}
int
IO::set_state (const XMLNode& node)
IO::set_state (const XMLNode& node, int version)
{
/* callers for version < 3000 need to call set_state_2X directly, as A3 IOs
* are input OR output, not both, so the direction needs to be specified
* by the caller.
*/
assert (version >= 3000);
const XMLProperty* prop;
XMLNodeConstIterator iter;
LocaleGuard lg (X_("POSIX"));
@ -547,19 +553,21 @@ IO::set_state (const XMLNode& node)
_direction = (Direction) string_2_enum (prop->value(), _direction);
}
if (create_ports (node)) {
if (create_ports (node, version)) {
return -1;
}
if (connecting_legal) {
if (make_connections (node)) {
if (make_connections (node, version, false)) {
return -1;
}
} else {
pending_state_node = new XMLNode (node);
pending_state_node_version = version;
pending_state_node_in = false;
connection_legal_c = ConnectingLegal.connect (mem_fun (*this, &IO::connecting_became_legal));
}
@ -567,6 +575,58 @@ IO::set_state (const XMLNode& node)
return 0;
}
int
IO::set_state_2X (const XMLNode& node, int version, bool in)
{
const XMLProperty* prop;
XMLNodeConstIterator iter;
LocaleGuard lg (X_("POSIX"));
/* force use of non-localized representation of decimal point,
since we use it a lot in XML files and so forth.
*/
if (node.name() != state_node_name) {
error << string_compose(_("incorrect XML node \"%1\" passed to IO object"), node.name()) << endmsg;
return -1;
}
if ((prop = node.property ("name")) != 0) {
set_name (prop->value());
}
if ((prop = node.property (X_("default-type"))) != 0) {
_default_type = DataType(prop->value());
assert(_default_type != DataType::NIL);
}
if ((prop = node.property ("id")) != 0) {
_id = prop->value ();
}
_direction = in ? Input : Output;
if (create_ports (node, version)) {
return -1;
}
if (connecting_legal) {
if (make_connections_2X (node, version, in)) {
return -1;
}
} else {
pending_state_node = new XMLNode (node);
pending_state_node_version = version;
pending_state_node_in = in;
connection_legal_c = ConnectingLegal.connect (mem_fun (*this, &IO::connecting_became_legal));
}
return 0;
}
int
IO::connecting_became_legal ()
{
@ -576,7 +636,7 @@ IO::connecting_became_legal ()
connection_legal_c.disconnect ();
ret = make_connections (*pending_state_node);
ret = make_connections (*pending_state_node, pending_state_node_version, pending_state_node_in);
delete pending_state_node;
pending_state_node = 0;
@ -679,8 +739,36 @@ IO::find_possible_bundle (const string &desired_name)
}
int
IO::get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle>& c)
IO::get_port_counts_2X (XMLNode const & node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c)
{
XMLProperty const * prop;
XMLNodeList children = node.children ();
uint32_t n_audio = 0;
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
if ((prop = node.property ("inputs")) != 0 && _direction == Input) {
n_audio = count (prop->value().begin(), prop->value().end(), '{');
} else if ((prop = node.property ("outputs")) != 0 && _direction == Output) {
n_audio = count (prop->value().begin(), prop->value().end(), '{');
}
}
ChanCount cnt;
cnt.set_audio (n_audio);
n = ChanCount::max (n, cnt);
return 0;
}
int
IO::get_port_counts (const XMLNode& node, int version, ChanCount& n, boost::shared_ptr<Bundle>& c)
{
if (version < 3000) {
return get_port_counts_2X (node, version, n, c);
}
XMLProperty const * prop;
XMLNodeConstIterator iter;
uint32_t n_audio = 0;
@ -728,13 +816,13 @@ IO::get_port_counts (const XMLNode& node, ChanCount& n, boost::shared_ptr<Bundle
}
int
IO::create_ports (const XMLNode& node)
IO::create_ports (const XMLNode& node, int version)
{
ChanCount n;
boost::shared_ptr<Bundle> c;
get_port_counts (node, n, c);
get_port_counts (node, version, n, c);
if (ensure_ports (n, true, true, this)) {
error << string_compose(_("%1: cannot create I/O ports"), _name) << endmsg;
return -1;
@ -746,8 +834,12 @@ IO::create_ports (const XMLNode& node)
}
int
IO::make_connections (const XMLNode& node)
IO::make_connections (const XMLNode& node, int version, bool in)
{
if (version < 3000) {
return make_connections_2X (node, version, in);
}
const XMLProperty* prop;
for (XMLNodeConstIterator i = node.children().begin(); i != node.children().end(); ++i) {
@ -798,6 +890,101 @@ IO::make_connections (const XMLNode& node)
return 0;
}
int
IO::make_connections_2X (const XMLNode& node, int version, bool in)
{
const XMLProperty* prop;
/* XXX: bundles ("connections" as was) */
if ((prop = node.property ("inputs")) != 0 && in) {
string::size_type ostart = 0;
string::size_type start = 0;
string::size_type end = 0;
int i = 0;
int n;
vector<string> ports;
string const str = prop->value ();
while ((start = str.find_first_of ('{', ostart)) != string::npos) {
start += 1;
if ((end = str.find_first_of ('}', start)) == string::npos) {
error << string_compose(_("IO: badly formed string in XML node for inputs \"%1\""), str) << endmsg;
return -1;
}
if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
error << string_compose(_("bad input string in XML node \"%1\""), str) << endmsg;
return -1;
} else if (n > 0) {
for (int x = 0; x < n; ++x) {
/* XXX: this is a bit of a hack; need to check if it's always valid */
string::size_type const p = ports[x].find ("/out");
if (p != string::npos) {
ports[x].replace (p, 4, "/audio_out");
}
nth(i)->connect (ports[x]);
}
}
ostart = end+1;
i++;
}
}
if ((prop = node.property ("outputs")) != 0 && !in) {
string::size_type ostart = 0;
string::size_type start = 0;
string::size_type end = 0;
int i = 0;
int n;
vector<string> ports;
string const str = prop->value ();
while ((start = str.find_first_of ('{', ostart)) != string::npos) {
start += 1;
if ((end = str.find_first_of ('}', start)) == string::npos) {
error << string_compose(_("IO: badly formed string in XML node for outputs \"%1\""), str) << endmsg;
return -1;
}
if ((n = parse_io_string (str.substr (start, end - start), ports)) < 0) {
error << string_compose(_("IO: bad output string in XML node \"%1\""), str) << endmsg;
return -1;
} else if (n > 0) {
for (int x = 0; x < n; ++x) {
/* XXX: this is a bit of a hack; need to check if it's always valid */
string::size_type const p = ports[x].find ("/in");
if (p != string::npos) {
ports[x].replace (p, 3, "/audio_in");
}
nth(i)->connect (ports[x]);
}
}
ostart = end+1;
i++;
}
}
return 0;
}
int
IO::set_ports (const string& str)
{

View file

@ -147,7 +147,7 @@ IOProcessor::state (bool full_state)
}
int
IOProcessor::set_state (const XMLNode& node)
IOProcessor::set_state (const XMLNode& node, int version)
{
const XMLProperty *prop;
const XMLNode *io_node = 0;

View file

@ -378,7 +378,59 @@ LadspaPlugin::save_preset (string name)
}
int
LadspaPlugin::set_state(const XMLNode& node)
LadspaPlugin::set_state (const XMLNode& node, int version)
{
if (version < 3000) {
return set_state_2X (node, version);
}
XMLNodeList nodes;
XMLProperty *prop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *port;
const char *data;
uint32_t port_id;
LocaleGuard lg (X_("POSIX"));
cout << "LADSPA Plugin set state " << version << "\n";
cout << "- node " << node.name() << "\n";
if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
return -1;
}
nodes = node.children ("Port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){
child = *iter;
if ((prop = child->property("number")) != 0) {
port = prop->value().c_str();
} else {
warning << _("LADSPA: no ladspa port number") << endmsg;
continue;
}
if ((prop = child->property("value")) != 0) {
data = prop->value().c_str();
} else {
warning << _("LADSPA: no ladspa port data") << endmsg;
continue;
}
sscanf (port, "%" PRIu32, &port_id);
set_parameter (port_id, atof(data));
}
latency_compute_run ();
return 0;
}
int
LadspaPlugin::set_state_2X (const XMLNode& node, int version)
{
XMLNodeList nodes;
XMLProperty *prop;
@ -389,12 +441,15 @@ LadspaPlugin::set_state(const XMLNode& node)
uint32_t port_id;
LocaleGuard lg (X_("POSIX"));
cout << "LADSPA Plugin set state " << version << "\n";
cout << "- node " << node.name() << "\n";
if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
return -1;
}
nodes = node.children ("Port");
nodes = node.children ("port");
for(iter = nodes.begin(); iter != nodes.end(); ++iter){

View file

@ -59,7 +59,7 @@ Location::Location (const Location& other)
_locked = false;
}
Location::Location (const XMLNode& node)
Location::Location (const XMLNode& node, int version)
{
if (set_state (node)) {
throw failed_constructor ();
@ -347,7 +347,7 @@ Location::get_state (void)
}
int
Location::set_state (const XMLNode& node)
Location::set_state (const XMLNode& node, int version)
{
const XMLProperty *prop;
@ -674,7 +674,7 @@ Locations::get_state ()
}
int
Locations::set_state (const XMLNode& node)
Locations::set_state (const XMLNode& node, int version)
{
XMLNodeList nlist;
XMLNodeConstIterator niter;

View file

@ -1381,7 +1381,7 @@ MidiDiskstream::get_state ()
}
int
MidiDiskstream::set_state (const XMLNode& node)
MidiDiskstream::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
XMLNodeList nlist = node.children();

View file

@ -260,7 +260,7 @@ MidiModel::DeltaCommand::unmarshal_note(XMLNode *xml_note)
#define DELTA_COMMAND_ELEMENT "DeltaCommand"
int
MidiModel::DeltaCommand::set_state(const XMLNode& delta_command)
MidiModel::DeltaCommand::set_state (const XMLNode& delta_command, int version)
{
if (delta_command.name() != string(DELTA_COMMAND_ELEMENT)) {
return 1;
@ -646,7 +646,7 @@ MidiModel::DiffCommand::unmarshal_change(XMLNode *xml_change)
}
int
MidiModel::DiffCommand::set_state(const XMLNode& diff_command)
MidiModel::DiffCommand::set_state(const XMLNode& diff_command, int version)
{
if (diff_command.name() != string(DIFF_COMMAND_ELEMENT)) {
return 1;

View file

@ -187,7 +187,7 @@ MidiPlaylist::check_dependents (boost::shared_ptr<Region> /*r*/, bool /*norefres
int
MidiPlaylist::set_state (const XMLNode& node)
MidiPlaylist::set_state (const XMLNode& node, int version)
{
in_set_state++;
freeze ();

View file

@ -285,7 +285,7 @@ MidiRegion::set_live_state (const XMLNode& node, Change& what_changed, bool send
}
int
MidiRegion::set_state (const XMLNode& node)
MidiRegion::set_state (const XMLNode& node, int version)
{
/* Region::set_state() calls the virtual set_live_state(),
which will get us back to AudioRegion::set_live_state()

View file

@ -94,7 +94,7 @@ MidiSource::get_state ()
}
int
MidiSource::set_state (const XMLNode& node)
MidiSource::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -66,8 +66,8 @@ MidiTrack::MidiTrack (Session& sess, string name, Route::Flag flag, TrackMode mo
_mode = mode;
}
MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
: Track (sess, node, DataType::MIDI )
MidiTrack::MidiTrack (Session& sess, const XMLNode& node, int version)
: Track (sess, node, version, DataType::MIDI)
, _immediate_events(1024) // FIXME: size?
, _step_edit_ring_buffer(64) // FIXME: size?
, _note_mode(Sustained)
@ -75,7 +75,7 @@ MidiTrack::MidiTrack (Session& sess, const XMLNode& node)
, _default_channel (0)
, _midi_thru (true)
{
_set_state(node, false);
_set_state (node, version, false);
}
MidiTrack::~MidiTrack ()
@ -155,18 +155,18 @@ MidiTrack::midi_diskstream() const
}
int
MidiTrack::set_state (const XMLNode& node)
MidiTrack::set_state (const XMLNode& node, int version)
{
return _set_state (node, true);
return _set_state (node, version, true);
}
int
MidiTrack::_set_state (const XMLNode& node, bool call_base)
MidiTrack::_set_state (const XMLNode& node, int version, bool call_base)
{
const XMLProperty *prop;
XMLNodeConstIterator iter;
if (Route::_set_state (node, call_base)) {
if (Route::_set_state (node, version, call_base)) {
return -1;
}

View file

@ -103,7 +103,7 @@ MuteMaster::get_value () const
}
int
MuteMaster::set_state (const XMLNode& node)
MuteMaster::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;

View file

@ -106,7 +106,7 @@ NamedSelection::~NamedSelection ()
}
int
NamedSelection::set_state (const XMLNode& /*node*/)
NamedSelection::set_state (const XMLNode& /*node*/, int /*version*/)
{
return 0;
}

View file

@ -162,7 +162,7 @@ StreamPanner::set_position (float xpos, float ypos, float zpos, bool link_call)
}
int
StreamPanner::set_state (const XMLNode& node)
StreamPanner::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
XMLNodeConstIterator iter;
@ -485,7 +485,7 @@ EqualPowerStereoPanner::state (bool /*full_state*/)
}
int
EqualPowerStereoPanner::set_state (const XMLNode& node)
EqualPowerStereoPanner::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
float pos;
@ -673,7 +673,7 @@ Multi2dPanner::state (bool /*full_state*/)
}
int
Multi2dPanner::set_state (const XMLNode& node)
Multi2dPanner::set_state (const XMLNode& node, int version)
{
const XMLProperty* prop;
float newx,newy;
@ -830,6 +830,8 @@ Panner::reset (uint32_t nouts, uint32_t npans)
bool changed = false;
bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2));
cout << "Reset panner for " << nouts << " " << npans << "\n";
/* if new and old config don't need panning, or if
the config hasn't changed, we're done.
*/
@ -1085,7 +1087,7 @@ Panner::state (bool full)
}
int
Panner::set_state (const XMLNode& node)
Panner::set_state (const XMLNode& node, int version)
{
XMLNodeList nlist;
XMLNodeConstIterator niter;

View file

@ -1789,7 +1789,7 @@ Playlist::mark_session_dirty ()
}
int
Playlist::set_state (const XMLNode& node)
Playlist::set_state (const XMLNode& node, int version)
{
XMLNode *child;
XMLNodeList nlist;

View file

@ -81,12 +81,12 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
ProcessorCreated (this); /* EMIT SIGNAL */
}
PluginInsert::PluginInsert (Session& s, const XMLNode& node)
PluginInsert::PluginInsert (Session& s, const XMLNode& node, int version)
: Processor (s, "unnamed plugin insert"),
_signal_analysis_collected_nframes(0),
_signal_analysis_collect_nframes_max(0)
{
if (set_state (node)) {
if (set_state (node, version)) {
throw failed_constructor();
}
@ -716,7 +716,7 @@ PluginInsert::state (bool full)
}
int
PluginInsert::set_state(const XMLNode& node)
PluginInsert::set_state(const XMLNode& node, int version)
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
@ -730,6 +730,7 @@ PluginInsert::set_state(const XMLNode& node)
}
if (prop->value() == X_("ladspa") || prop->value() == X_("Ladspa")) { /* handle old school sessions */
cout << "- LADSPA\n";
type = ARDOUR::LADSPA;
} else if (prop->value() == X_("lv2")) {
type = ARDOUR::LV2;
@ -743,6 +744,7 @@ PluginInsert::set_state(const XMLNode& node)
}
prop = node.property ("unique-id");
cout << "- ID " << prop->value() << "\n";
if (prop == 0) {
error << _("Plugin has no unique ID field") << endmsg;
return -1;
@ -777,7 +779,7 @@ PluginInsert::set_state(const XMLNode& node)
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == plugin->state_node_name()) {
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
(*i)->set_state (**niter);
(*i)->set_state (**niter, version);
}
break;
}
@ -792,8 +794,8 @@ PluginInsert::set_state(const XMLNode& node)
break;
}
}
Processor::set_state (*insert_node);
Processor::set_state (*insert_node, version);
/* look for port automation node */

View file

@ -48,12 +48,12 @@ PortInsert::PortInsert (Session& s, boost::shared_ptr<MuteMaster> mm)
ProcessorCreated (this); /* EMIT SIGNAL */
}
PortInsert::PortInsert (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node)
PortInsert::PortInsert (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node, int version)
: IOProcessor (s, true, true, "unnamed port insert")
, _out (new Delivery (s, _output, mm, _name, Delivery::Insert))
{
if (set_state (node)) {
if (set_state (node, version)) {
throw failed_constructor();
}
@ -104,7 +104,7 @@ PortInsert::state (bool full)
}
int
PortInsert::set_state(const XMLNode& node)
PortInsert::set_state (const XMLNode& node, int version)
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;

View file

@ -145,8 +145,43 @@ Processor::state (bool full_state)
}
int
Processor::set_state (const XMLNode& node)
Processor::set_state_2X (const XMLNode & node, int version)
{
XMLProperty const * prop;
XMLNodeList children = node.children ();
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("IO")) {
if ((prop = (*i)->property ("name")) != 0) {
set_name (prop->value ());
}
if ((prop = (*i)->property ("id")) != 0) {
_id = prop->value ();
}
if ((prop = (*i)->property ("active")) != 0) {
if (_active != string_is_affirmative (prop->value())) {
_active = !_active;
ActiveChanged (); /* EMIT_SIGNAL */
}
}
}
}
return 0;
}
int
Processor::set_state (const XMLNode& node, int version)
{
if (version < 3000) {
return set_state_2X (node, version);
}
const XMLProperty *prop;
const XMLProperty *legacy_active = 0;

View file

@ -240,7 +240,7 @@ RCConfiguration::get_variables ()
}
int
RCConfiguration::set_state (const XMLNode& root)
RCConfiguration::set_state (const XMLNode& root, int version)
{
if (root.name() != "Ardour") {
return -1;

View file

@ -1339,7 +1339,7 @@ Region::set_live_state (const XMLNode& node, Change& what_changed, bool send)
}
int
Region::set_state (const XMLNode& node)
Region::set_state (const XMLNode& node, int version)
{
const XMLProperty *prop;
Change what_changed = Change (0);

View file

@ -89,7 +89,7 @@ Return::state(bool full)
}
int
Return::set_state(const XMLNode& node)
Return::set_state (const XMLNode& node, int version)
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;

Some files were not shown because too many files have changed in this diff Show more