summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-08-09 12:15:37 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-08-09 12:15:37 -0400
commita34d7071753867b9aba3bca2f3436ed4a980c895 (patch)
tree20e7e3658bec5eb220b7330695c74b8a9034df52 /libs/ardour/session_state.cc
parentda7451991178ad224acac55d177011e32204cac7 (diff)
split up session code that uses parts of the JACK API (timebase + session event handling) and connect it directly to the jack audiobackend
i've made the audiobackend call the session directly so that only one object (ARDOUR::Session) has a need for the JACK types and only one .cc file (session_jack.cc) needs jack.h. having ARDOUR::AudioEngine act as an intermediary would be cleaner conceptually but would end up causing two different ARDOUR objects to have jack types in their own API.
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r--libs/ardour/session_state.cc66
1 files changed, 1 insertions, 65 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index c4522f76e7..50905ef434 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1999-2002 Paul Davis
+ Copyright (C) 1999-2013 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -689,70 +689,6 @@ Session::remove_state (string snapshot_name)
}
}
-#ifdef HAVE_JACK_SESSION
-void
-Session::jack_session_event (jack_session_event_t * event)
-{
- char timebuf[128], *tmp;
- time_t n;
- struct tm local_time;
-
- time (&n);
- 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 )) {
- event->flags = JackSessionSaveError;
- } else {
- string cmd ("ardour3 -P -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 {
- std::string xml_path (_session_dir->root_path());
- std::string legalized_filename = legalize_for_path (timebuf) + statefile_suffix;
- xml_path = Glib::build_filename (xml_path, legalized_filename);
-
- string cmd ("ardour3 -P -U ");
- cmd += event->client_uuid;
- cmd += " \"";
- cmd += xml_path;
- cmd += '\"';
-
- event->command_line = strdup (cmd.c_str());
- }
- }
-
- /* 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 */
- }
-
- jack_session_event_free( event );
-}
-#endif
-
/** @param snapshot_name Name to save under, without .ardour / .pending prefix */
int
Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot)