*/
+
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
#define __STDC_FORMAT_MACROS 1
#include <stdint.h>
_non_soloed_outs_muted = false;
+ _listen_cnt = 0;
g_atomic_int_set (&processing_prohibited, 0);
- insert_cnt = 0;
_transport_speed = 0;
_last_transport_speed = 0;
_target_transport_speed = 0;
{
sys::path pending_state_file_path(_session_dir->root_path());
- pending_state_file_path /= _current_snapshot_name + pending_suffix;
+ pending_state_file_path /= legalize_for_path (_current_snapshot_name) + pending_suffix;
try
{
return;
}
- const string old_xml_filename = old_name + statefile_suffix;
- const string new_xml_filename = new_name + statefile_suffix;
+ const string old_xml_filename = legalize_for_path (old_name) + statefile_suffix;
+ const string new_xml_filename = legalize_for_path (new_name) + statefile_suffix;
const sys::path old_xml_path = _session_dir->root_path() / old_xml_filename;
const sys::path new_xml_path = _session_dir->root_path() / new_xml_filename;
sys::path xml_path(_session_dir->root_path());
- xml_path /= snapshot_name + statefile_suffix;
+ xml_path /= legalize_for_path (snapshot_name) + statefile_suffix;
if (!create_backup_file (xml_path)) {
// don't remove it if a backup can't be made
/* proper save: use statefile_suffix (.ardour in English) */
- xml_path /= snapshot_name + statefile_suffix;
+ xml_path /= legalize_for_path (snapshot_name) + statefile_suffix;
/* make a backup copy of the old file */
} else {
/* pending save: use pending_suffix (.pending in English) */
- xml_path /= snapshot_name + pending_suffix;
+ xml_path /= legalize_for_path (snapshot_name) + pending_suffix;
}
sys::path tmp_path(_session_dir->root_path());
- tmp_path /= snapshot_name + temp_suffix;
+ tmp_path /= legalize_for_path (snapshot_name) + temp_suffix;
// cerr << "actually writing state to " << xml_path.to_string() << endl;
/* check for leftover pending state from a crashed capture attempt */
sys::path xmlpath(_session_dir->root_path());
- xmlpath /= snapshot_name + pending_suffix;
+ xmlpath /= legalize_for_path (snapshot_name) + pending_suffix;
if (sys::exists (xmlpath)) {
if (!state_was_pending) {
xmlpath = _session_dir->root_path();
- xmlpath /= snapshot_name + statefile_suffix;
+ xmlpath /= legalize_for_path (snapshot_name) + statefile_suffix;
}
if (!sys::exists (xmlpath)) {
sys::path backup_path(_session_dir->root_path());
- backup_path /= snapshot_name + "-1" + statefile_suffix;
+ backup_path /= legalize_for_path (snapshot_name) + "-1" + statefile_suffix;
// only create a backup once
if (sys::exists (backup_path)) {
}
- child = node->add_child ("EditGroups");
- for (list<RouteGroup *>::iterator i = edit_groups.begin(); i != edit_groups.end(); ++i) {
- child->add_child_nocopy ((*i)->get_state());
- }
-
- child = node->add_child ("MixGroups");
- for (list<RouteGroup *>::iterator i = mix_groups.begin(); i != mix_groups.end(); ++i) {
+ child = node->add_child ("RouteGroups");
+ for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) {
child->add_child_nocopy ((*i)->get_state());
}
AudioDiskstreams
Connections
Routes
- EditGroups
+ RouteGroups
MixGroups
Click
ControlProtocols
_bundle_xml_node = new XMLNode (*child);
}
- if ((child = find_named_node (node, "EditGroups")) == 0) {
- error << _("Session: XML state has no edit groups section") << endmsg;
- goto out;
- } else if (load_edit_groups (*child)) {
- goto out;
- }
-
- if ((child = find_named_node (node, "MixGroups")) == 0) {
- error << _("Session: XML state has no mix groups section") << endmsg;
+ if ((child = find_named_node (node, "RouteGroups")) == 0) {
+ error << _("Session: XML state has no route groups section") << endmsg;
goto out;
- } else if (load_mix_groups (*child)) {
+ } else if (load_route_groups (*child)) {
goto out;
}
}
}
- for (uint32_t n=1; n < nchans; ++n) {
+ for (uint32_t n = 0; n < nchans; ++n) {
snprintf (buf, sizeof(buf), X_("master-source-%d"), n);
if ((prop = node.property (buf)) != 0) {
}
if (!master_sources.empty()) {
- if (master_sources.size() == nchans) {
+ if (master_sources.size() != nchans) {
error << _("Session: XMLNode describing an AudioRegion is missing some master sources; ignored") << endmsg;
} else {
region->set_master_sources (master_sources);
}
int
-Session::load_edit_groups (const XMLNode& node)
-{
- return load_route_groups (node, true);
-}
-
-int
-Session::load_mix_groups (const XMLNode& node)
-{
- return load_route_groups (node, false);
-}
-
-int
-Session::load_route_groups (const XMLNode& node, bool edit)
+Session::load_route_groups (const XMLNode& node)
{
XMLNodeList nlist = node.children();
XMLNodeConstIterator niter;
- RouteGroup* rg;
- set_dirty();
+ set_dirty ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "RouteGroup") {
- if (edit) {
- rg = add_edit_group ("");
- rg->set_state (**niter);
- } else {
- rg = add_mix_group ("");
- rg->set_state (**niter);
- }
+ RouteGroup* rg = new RouteGroup (*this, "");
+ add_route_group (rg);
+ rg->set_state (**niter);
}
}
return possible_states(_path);
}
-RouteGroup *
-Session::add_edit_group (string name)
-{
- RouteGroup* rg = new RouteGroup (*this, name);
- edit_groups.push_back (rg);
- edit_group_added (rg); /* EMIT SIGNAL */
- set_dirty();
- return rg;
-}
-
-RouteGroup *
-Session::add_mix_group (string name)
-{
- RouteGroup* rg = new RouteGroup (*this, name, RouteGroup::Relative);
- mix_groups.push_back (rg);
- mix_group_added (rg); /* EMIT SIGNAL */
- set_dirty();
- return rg;
-}
-
void
-Session::remove_edit_group (RouteGroup& rg)
+Session::add_route_group (RouteGroup* g)
{
- list<RouteGroup*>::iterator i;
-
- if ((i = find (edit_groups.begin(), edit_groups.end(), &rg)) != edit_groups.end()) {
- (*i)->apply (&Route::drop_edit_group, this);
- edit_groups.erase (i);
- edit_group_removed (); /* EMIT SIGNAL */
- }
-
- delete &rg;
+ _route_groups.push_back (g);
+ route_group_added (g); /* EMIT SIGNAL */
+ set_dirty ();
}
void
-Session::remove_mix_group (RouteGroup& rg)
+Session::remove_route_group (RouteGroup& rg)
{
list<RouteGroup*>::iterator i;
- if ((i = find (mix_groups.begin(), mix_groups.end(), &rg)) != mix_groups.end()) {
- (*i)->apply (&Route::drop_mix_group, this);
- mix_groups.erase (i);
- mix_group_removed (); /* EMIT SIGNAL */
+ if ((i = find (_route_groups.begin(), _route_groups.end(), &rg)) != _route_groups.end()) {
+ (*i)->apply (&Route::drop_route_group, this);
+ _route_groups.erase (i);
+ route_group_removed (); /* EMIT SIGNAL */
}
delete &rg;
}
-RouteGroup *
-Session::mix_group_by_name (string name)
-{
- list<RouteGroup *>::iterator i;
-
- for (i = mix_groups.begin(); i != mix_groups.end(); ++i) {
- if ((*i)->name() == name) {
- return* i;
- }
- }
- return 0;
-}
RouteGroup *
-Session::edit_group_by_name (string name)
+Session::route_group_by_name (string name)
{
list<RouteGroup *>::iterator i;
- for (i = edit_groups.begin(); i != edit_groups.end(); ++i) {
+ for (i = _route_groups.begin(); i != _route_groups.end(); ++i) {
if ((*i)->name() == name) {
return* i;
}
XMLProperty* prop;
+ if ((prop = (*niter)->property (X_("type"))) == 0) {
+ continue;
+ }
+
+ DataType type (prop->value());
+
if ((prop = (*niter)->property (X_("name"))) == 0) {
continue;
}
/* external file, ignore */
continue;
}
+
+ Glib::ustring found_path;
+ bool is_new;
+ uint16_t chan;
- sys::path source_path = _session_dir->sound_path ();
-
- source_path /= prop->value ();
-
- result.insert (source_path.to_string ());
+ if (FileSource::find (type, prop->value(), true, is_new, chan, found_path)) {
+ result.insert (found_path);
+ }
}
return 0;
}
this_snapshot_path = _path;
- this_snapshot_path += _current_snapshot_name;
+ this_snapshot_path += legalize_for_path (_current_snapshot_name);
this_snapshot_path += statefile_suffix;
for (vector<string*>::iterator i = state_files->begin(); i != state_files->end(); ++i) {
snapshot_name = _current_snapshot_name;
}
- const string history_filename = snapshot_name + history_suffix;
+ const string history_filename = legalize_for_path (snapshot_name) + history_suffix;
const string backup_filename = history_filename + backup_suffix;
const sys::path xml_path = _session_dir->root_path() / history_filename;
const sys::path backup_path = _session_dir->root_path() / backup_filename;
if (snapshot_name.empty()) {
snapshot_name = _current_snapshot_name;
}
-
- const string xml_filename = snapshot_name + history_suffix;
+
+ const string xml_filename = legalize_for_path (snapshot_name) + history_suffix;
const sys::path xml_path = _session_dir->root_path() / xml_filename;
-
- cerr << "Loading history from " << xml_path.to_string() << endmsg;
+
+ cerr << "Loading history from " << xml_path.to_string() << endmsg;
if (!sys::exists (xml_path)) {
info << string_compose (_("%1: no history file \"%2\" for this session."),
}
} else if (p == "solo-mute-override") {
// catch_up_on_solo_mute_override ();
+ } else if (p == "listen-position") {
+ listen_position_changed ();
+ } else if (p == "solo-control-is-listen-control") {
+ solo_control_mode_changed ();
}
+
set_dirty ();
}