#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;
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;
/* there is pending state from a crashed capture attempt */
if (AskAboutPendingState()) {
- cerr << "use pending state\n";
state_was_pending = true;
- } else {
- cerr << "do not use pending state\n";
- }
+ }
}
if (!state_was_pending) {
}
}
+ 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");
}
string
-Session::template_path ()
+Session::suffixed_search_path (string suffix, bool data)
{
string path;
if (path[path.length()-1] != ':') {
path += ':';
}
- path += 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);
}
}
}
Session::set_dirty ()
{
bool was_dirty = dirty();
-
+
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
if (!was_dirty) {