From 79f91c7a205d981d2b8cc15e32a6da02d8423065 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 15 Oct 2009 00:57:55 +0000 Subject: 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 --- gtk2_ardour/ardour_ui.cc | 4 ++++ gtk2_ardour/automation_line.cc | 4 ++-- gtk2_ardour/automation_line.h | 2 +- gtk2_ardour/automation_time_axis.cc | 2 +- gtk2_ardour/automation_time_axis.h | 3 +-- gtk2_ardour/editor.cc | 2 +- gtk2_ardour/editor.h | 2 +- gtk2_ardour/keyboard.cc | 4 ++-- gtk2_ardour/keyboard.h | 2 +- gtk2_ardour/opts.cc | 13 +++++++++---- gtk2_ardour/opts.h | 1 + gtk2_ardour/panner_ui.cc | 2 +- gtk2_ardour/route_time_axis.cc | 2 +- gtk2_ardour/route_time_axis.h | 6 +++--- gtk2_ardour/time_axis_view.cc | 2 +- gtk2_ardour/time_axis_view.h | 2 +- gtk2_ardour/ui_config.cc | 2 +- gtk2_ardour/ui_config.h | 2 +- 18 files changed, 33 insertions(+), 24 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 423f9de14a..875228da9f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -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); + } } } diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 61687c79dd..73727ca987 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -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); diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index a171be1512..817f66c1d2 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -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); diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 00bba2ba1b..1fffe564fb 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -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); diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index f676034237..f6239314ab 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -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 (); diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index a68f51af49..fec836210c 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -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; diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index bd092d2640..f2779d353c 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -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); diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index a368b6a8de..9333f15b51 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -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; diff --git a/gtk2_ardour/keyboard.h b/gtk2_ardour/keyboard.h index db55b08b5e..9f354f38e3 100644 --- a/gtk2_ardour/keyboard.h +++ b/gtk2_ardour/keyboard.h @@ -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 State; typedef uint32_t ModifierMask; diff --git a/gtk2_ardour/opts.cc b/gtk2_ardour/opts.cc index 4f702f6486..5d95c4e8a9 100644 --- a/gtk2_ardour/opts.cc +++ b/gtk2_ardour/opts.cc @@ -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 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 Load the specified session, save it to 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; } diff --git a/gtk2_ardour/opts.h b/gtk2_ardour/opts.h index 3b3f08816f..826fc53880 100644 --- a/gtk2_ardour/opts.h +++ b/gtk2_ardour/opts.h @@ -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[]); diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 8b4830f484..31403220fe 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -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; } diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 954841a163..52eceb2058 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -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); diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 5970c31226..7ca88aefd4 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -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; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 3d747b33d4..21c5bd9f11 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -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; diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index e32913dbb2..1597e32a55 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -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; } diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc index 0602b07a0e..1f1f25f239 100644 --- a/gtk2_ardour/ui_config.cc +++ b/gtk2_ardour/ui_config.cc @@ -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; diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h index 4a099fbc8d..857df3f7e3 100644 --- a/gtk2_ardour/ui_config.h +++ b/gtk2_ardour/ui_config.h @@ -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&); -- cgit v1.2.3