add template support to jack-session code. and also generate timestamped name
git-svn-id: svn://localhost/ardour2/branches/3.0@7209 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
ef505452a2
commit
f27c481af1
|
@ -684,20 +684,44 @@ Session::remove_state (string snapshot_name)
|
||||||
void
|
void
|
||||||
Session::jack_session_event (jack_session_event_t * event)
|
Session::jack_session_event (jack_session_event_t * event)
|
||||||
{
|
{
|
||||||
if (save_state ("jacksession_snap")) {
|
char timebuf[128];
|
||||||
event->flags = JackSessionSaveError;
|
time_t n;
|
||||||
} else {
|
struct tm local_time;
|
||||||
sys::path xml_path (_session_dir->root_path());
|
|
||||||
xml_path /= legalize_for_path ("jacksession_snap") + statefile_suffix;
|
time (&n);
|
||||||
|
localtime_r (&n, &local_time);
|
||||||
string cmd ("PROG_NAME -U ");
|
strftime (timebuf, sizeof(timebuf), "JS_%FT%T", &local_time);
|
||||||
cmd += event->client_uuid;
|
|
||||||
cmd += " \"";
|
if (event->type == JackSessionSaveTemplate)
|
||||||
cmd += xml_path.to_string();
|
{
|
||||||
cmd += '\"';
|
if (save_template( timebuf )) {
|
||||||
|
event->flags = JackSessionSaveError;
|
||||||
event->command_line = strdup (cmd.c_str());
|
} else {
|
||||||
}
|
string cmd ("ardour3 -U ");
|
||||||
|
cmd += event->client_uuid;
|
||||||
|
cmd += " -T ";
|
||||||
|
cmd += timebuf;
|
||||||
|
|
||||||
|
event->command_line = strdup (cmd.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (save_state (timebuf)) {
|
||||||
|
event->flags = JackSessionSaveError;
|
||||||
|
} else {
|
||||||
|
sys::path xml_path (_session_dir->root_path());
|
||||||
|
xml_path /= legalize_for_path (timebuf) + statefile_suffix;
|
||||||
|
|
||||||
|
string cmd ("ardour3 -U ");
|
||||||
|
cmd += event->client_uuid;
|
||||||
|
cmd += " \"";
|
||||||
|
cmd += xml_path.to_string();
|
||||||
|
cmd += '\"';
|
||||||
|
|
||||||
|
event->command_line = strdup (cmd.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
jack_session_reply (_engine.jack(), event);
|
jack_session_reply (_engine.jack(), event);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user