#include <ardour/location.h>
#include <ardour/audioregion.h>
#include <ardour/crossfade.h>
+#include <ardour/control_protocol_manager.h>
#include "i18n.h"
#include <locale.h>
state_was_pending = false;
set_next_event ();
outbound_mtc_smpte_frame = 0;
- next_quarter_frame_to_send = -1;
+ next_quarter_frame_to_send = 0;
current_block_size = 0;
_solo_latched = true;
_solo_model = InverseMute;
solo_update_disabled = false;
currently_soloing = false;
+ _have_captured = false;
_worst_output_latency = 0;
_worst_input_latency = 0;
_worst_track_latency = 0;
butler_gain_buffer = 0;
auditioner = 0;
mmc_control = false;
- midi_feedback = false;
midi_control = true;
mmc = 0;
post_transport_work = PostTransportWork (0);
_master_out = 0;
input_auto_connect = AutoConnectOption (0);
output_auto_connect = AutoConnectOption (0);
- _have_captured = false;
waiting_to_start = false;
_exporting = false;
_gain_automation_buffer = 0;
pending_abort = false;
layer_model = MoveAddHigher;
xfade_model = ShortCrossfade;
+ destructive_index = 0;
/* allocate conversion buffers */
_conversion_buffers[ButlerContext] = new char[DiskStream::disk_io_frames() * 4];
return -1;
}
+ /* FIXME
if (start_midi_thread ()) {
return -1;
}
-
- if (init_feedback ()) {
- return -1;
- }
+ */
if (state_tree) {
if (set_state (*state_tree->root())) {
first_time_running = _engine.Running.connect (mem_fun (*this, &Session::when_engine_running));
}
- send_full_time_code ();
+ // FIXME
+ //send_full_time_code ();
_engine.transport_locate (0);
- deliver_mmc (MIDI::MachineControl::cmdMmcReset, 0);
- deliver_mmc (MIDI::MachineControl::cmdLocate, 0);
- send_all_midi_feedback();
+ //deliver_mmc (MIDI::MachineControl::cmdMmcReset, 0);
+ //deliver_mmc (MIDI::MachineControl::cmdLocate, 0);
+
+ ControlProtocolManager::instance().set_session (*this);
if (new_session) {
_end_location_is_free = true;
if (colons == 0) {
- /* no multiple search path, just one directory (common case) */
+ /* no multiple search path, just one location (common case) */
sp.path = path;
sp.blocks = 0;
session_dirs.push_back (sp);
+
+ string fspath;
+
+ /* sounds dir */
+
+ fspath += sp.path;
+ if (fspath[fspath.length()-1] != '/') {
+ fspath += '/';
+ }
+ fspath += sound_dir_name;
+ fspath += ':';
+
+ /* tape dir */
+
+ fspath += sp.path;
+ if (fspath[fspath.length()-1] != '/') {
+ fspath += '/';
+ }
+ fspath += tape_dir_name;
- FileSource::set_search_path (path + sound_dir_name);
+ FileSource::set_search_path (fspath);
return;
}
sp.blocks = 0;
sp.path = remaining.substr (0, colon);
+ session_dirs.push_back (sp);
+
+ /* add sounds to file search path */
fspath += sp.path;
if (fspath[fspath.length()-1] != '/') {
fspath += sound_dir_name;
fspath += ':';
- session_dirs.push_back (sp);
+ /* add tape dir to file search path */
+
+ fspath += sp.path;
+ if (fspath[fspath.length()-1] != '/') {
+ fspath += '/';
+ }
+ fspath += tape_dir_name;
+ fspath += ':';
remaining = remaining.substr (colon+1);
}
sp.blocks = 0;
sp.path = remaining;
+ fspath += ':';
fspath += sp.path;
if (fspath[fspath.length()-1] != '/') {
fspath += '/';
}
fspath += sound_dir_name;
+ fspath += ':';
+
+ fspath += sp.path;
+ if (fspath[fspath.length()-1] != '/') {
+ fspath += '/';
+ }
+ fspath += tape_dir_name;
session_dirs.push_back (sp);
}
if (!pending) {
bool was_dirty = dirty();
-
+
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
if (was_dirty) {
}
}
+ if ((child = find_named_node (node, "end-marker-is-free")) != 0) {
+ if ((prop = child->property ("val")) != 0) {
+ _end_location_is_free = (prop->value() == "yes");
+ }
+ }
+
if ((child = find_named_node (node, "layer-model")) != 0) {
if ((prop = child->property ("val")) != 0) {
if (prop->value() == X_("LaterHigher")) {
child->add_property ("val", get_crossfades_active () ? "yes" : "no");
child = opthead->add_child ("audible-click");
child->add_property ("val", get_clicking () ? "yes" : "no");
+ child = opthead->add_child ("end-marker-is-free");
+ child->add_property ("val", _end_location_is_free ? "yes" : "no");
if (click_sound.length()) {
child = opthead->add_child ("click-sound");
sources in their state node.
*/
- disable_record ();
+ disable_record (false);
return state(false);
}
/* Don't save information about FileSources that are empty */
FileSource* fs;
-
+
if ((fs = dynamic_cast<FileSource*> ((*siter).second)) != 0) {
- if (fs->length() == 0) {
- continue;
+ DestructiveFileSource* dfs = dynamic_cast<DestructiveFileSource*> (fs);
+
+ /* destructive file sources are OK if they are empty, because
+ we will re-use them every time.
+ */
+
+ if (!dfs) {
+ if (fs->length() == 0) {
+ continue;
+ }
}
}
string
Session::tape_dir () const
{
- string res = Config->get_tape_dir();
-
- if (!res.empty()) {
- return res;
- }
-
- res = _path;
+ string res = _path;
res += tape_dir_name;
res += '/';
return res;
string
Session::template_dir ()
{
- string path = Config->get_user_ardour_path();
+ string path = get_user_ardour_path();
path += "templates/";
return path;
}
string
-Session::template_path ()
+Session::suffixed_search_path (string suffix, bool data)
{
string path;
- path += Config->get_user_ardour_path();
+ path += get_user_ardour_path();
if (path[path.length()-1] != ':') {
path += ':';
}
- path += Config->get_system_ardour_path();
+
+ if (data) {
+ path += get_system_data_path();
+ } else {
+ path += get_system_module_path();
+ }
vector<string> split_path;
for (vector<string>::iterator i = split_path.begin(); i != split_path.end(); ++i) {
path += *i;
- path += "templates/";
+ path += suffix;
+ path += '/';
if (distance (i, split_path.end()) != 1) {
path += ':';
return path;
}
+string
+Session::template_path ()
+{
+ return suffixed_search_path (X_("templates"), true);
+}
+
+string
+Session::control_protocol_path ()
+{
+ return suffixed_search_path (X_("surfaces"), false);
+}
+
int
Session::load_connections (const XMLNode& node)
{
{
XMLNodeList nlist = node.children();
XMLNodeConstIterator niter;
- RouteGroup* route;
+ RouteGroup* rg;
set_dirty();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "RouteGroup") {
if (edit) {
- route = add_edit_group ("");
- route->set_state (**niter);
+ rg = add_edit_group ("");
+ rg->set_state (**niter);
} else {
- route = add_mix_group ("");
- route->set_state (**niter);
+ rg = add_mix_group ("");
+ rg->set_state (**niter);
}
}
}
int
Session::read_favorite_dirs (FavoriteDirs & favs)
{
- string path = Config->get_user_ardour_path();
+ string path = get_user_ardour_path();
path += "/favorite_dirs";
ifstream fav (path.c_str());
int
Session::write_favorite_dirs (FavoriteDirs & favs)
{
- string path = Config->get_user_ardour_path();
+ string path = get_user_ardour_path();
path += "/favorite_dirs";
ofstream fav (path.c_str());
Session::set_dirty ()
{
bool was_dirty = dirty();
-
+
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
if (!was_dirty) {