full compilation and linking (coding not finished, will not run)
[ardour.git] / libs / ardour / session_state.cc
index b6df5d5cbb431f12b058d960fa4e56deb75aa2af..cae3b9720acf7233030d13206066a4617a45de63 100644 (file)
@@ -136,7 +136,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
 
        char buf[PATH_MAX+1];
        if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) {
-               error << string_compose(_("Could not use path %1 (%s)"), buf, strerror(errno)) << endmsg;
+               error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg;
                destroy ();
                throw failed_constructor();
        }
@@ -155,7 +155,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
 
        set_history_depth (Config->get_history_depth());
 
-       _current_frame_rate = _engine.frame_rate ();
+       _current_frame_rate = _engine.sample_rate ();
        _nominal_frame_rate = _current_frame_rate;
        _base_frame_rate = _current_frame_rate;
 
@@ -694,7 +694,7 @@ Session::remove_state (string snapshot_name)
 void
 Session::jack_session_event (jack_session_event_t * event)
 {
-        char timebuf[128];
+        char timebuf[128], *tmp;
         time_t n;
         struct tm local_time;
 
@@ -702,6 +702,8 @@ Session::jack_session_event (jack_session_event_t * event)
         localtime_r (&n, &local_time);
         strftime (timebuf, sizeof(timebuf), "JS_%FT%T", &local_time);
 
+        while ((tmp = strchr(timebuf, ':'))) { *tmp = '.'; }
+
         if (event->type == JackSessionSaveTemplate)
         {
                 if (save_template( timebuf )) {
@@ -734,7 +736,15 @@ Session::jack_session_event (jack_session_event_t * event)
                 }
         }
 
-       jack_session_reply (_engine.jack(), event);
+       /* this won't be called if the port engine in use is not JACK, so we do 
+          not have to worry about the type of PortEngine::private_handle()
+       */
+
+       jack_client_t* jack_client = (jack_client_t*) AudioEngine::instance()->port_engine().private_handle();
+       
+       if (jack_client) {
+               jack_session_reply (jack_client, event);
+       }
 
        if (event->type == JackSessionSaveAndQuit) {
                Quit (); /* EMIT SIGNAL */
@@ -772,6 +782,8 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
                }
        }
 
+       SaveSession (); /* EMIT SIGNAL */
+
        tree.set_root (&get_state());
 
        if (snapshot_name.empty()) {
@@ -1139,7 +1151,7 @@ Session::state (bool full_state)
                 }
 
                for (RouteList::iterator i = public_order.begin(); i != public_order.end(); ++i) {
-                       if (!(*i)->is_hidden()) {
+                       if (!(*i)->is_auditioner()) {
                                if (full_state) {
                                        child->add_child_nocopy ((*i)->get_state());
                                } else {