#include "ardour/control_protocol_manager.h"
#include "ardour/data_type.h"
#include "ardour/debug.h"
+#include "ardour/directory_names.h"
#include "ardour/filename_extensions.h"
#include "ardour/graph.h"
#include "ardour/midiport_manager.h"
, _writable (false)
, _was_seamless (Config->get_seamless_loop ())
, _under_nsm_control (false)
+ , _xrun_count (0)
, delta_accumulator_cnt (0)
, average_slave_delta (1800) // !!! why 1800 ???
, average_dir (0)
* of a template.
*/
- if (!mix_template.empty() && load_state (_current_snapshot_name)) {
- throw failed_constructor ();
+ if (!mix_template.empty()) {
+ if (load_state (_current_snapshot_name)) {
+ throw failed_constructor ();
+ }
+ store_recent_templates (mix_template);
}
/* load default session properties - if any */
framepos_t dcp;
framecnt_t dcl;
auto_loop_declick_range (location, dcp, dcl);
- replace_event (SessionEvent::AutoLoopDeclick, dcp, dcl);
if (transport_rolling() && play_loop) {
+ replace_event (SessionEvent::AutoLoopDeclick, dcp, dcl);
// if (_transport_frame > location->end()) {
}
}
+ } else {
+ clear_events (SessionEvent::AutoLoopDeclick);
+ clear_events (SessionEvent::AutoLoop);
}
last_loopend = location->end();
_session_range_location = location;
}
+ if (location->is_mark()) {
+ /* listen for per-location signals that require us to do any * global updates for marks */
+
+ location->StartChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location));
+ location->EndChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location));
+ location->Changed.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location));
+ location->FlagsChanged.connect_same_thread (skip_update_connections, boost::bind (&Session::update_marks, this, location));
+ }
+
if (location->is_skip()) {
/* listen for per-location signals that require us to update skip-locate events */
update_skips (location, true);
}
-
+
set_dirty ();
}
string
Session::peak_path (string base) const
{
+ if (Glib::path_is_absolute (base)) {
+
+ /* rip the session dir from the audiofile source */
+
+ string session_path;
+ string interchange_dir_string = string (interchange_dir_name) + G_DIR_SEPARATOR;
+ bool in_another_session = true;
+
+ if (base.find (interchange_dir_string) != string::npos) {
+
+ session_path = Glib::path_get_dirname (base); /* now ends in audiofiles */
+ session_path = Glib::path_get_dirname (session_path); /* now ends in session name */
+ session_path = Glib::path_get_dirname (session_path); /* now ends in interchange */
+ session_path = Glib::path_get_dirname (session_path); /* now has session path */
+
+ /* see if it is within our session */
+
+ for (vector<space_and_path>::const_iterator i = session_dirs.begin(); i != session_dirs.end(); ++i) {
+ if (i->path == session_path) {
+ in_another_session = false;
+ break;
+ }
+ }
+ } else {
+ in_another_session = false;
+ }
+
+
+ if (in_another_session) {
+ SessionDirectory sd (session_path);
+ return Glib::build_filename (sd.peak_path(), Glib::path_get_basename (base) + peakfile_suffix);
+ }
+ }
+
+ base = Glib::path_get_basename (base);
return Glib::build_filename (_session_dir->peak_path(), base + peakfile_suffix);
}