Merge with trunk R2920.
git-svn-id: svn://localhost/ardour2/trunk@2921 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b2e3b18dab
commit
ac1a255706
|
@ -239,7 +239,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
||||||
/* lets get this party started */
|
/* lets get this party started */
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization);
|
if (ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization)) {
|
||||||
|
throw failed_constructor ();
|
||||||
|
}
|
||||||
|
|
||||||
setup_gtk_ardour_enums ();
|
setup_gtk_ardour_enums ();
|
||||||
Config->set_current_owner (ConfigVariableBase::Interface);
|
Config->set_current_owner (ConfigVariableBase::Interface);
|
||||||
setup_profile ();
|
setup_profile ();
|
||||||
|
@ -247,7 +250,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
||||||
} catch (failed_constructor& err) {
|
} catch (failed_constructor& err) {
|
||||||
error << _("could not initialize Ardour.") << endmsg;
|
error << _("could not initialize Ardour.") << endmsg;
|
||||||
// pass it on up
|
// pass it on up
|
||||||
throw err;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we like keyboards */
|
/* we like keyboards */
|
||||||
|
|
|
@ -133,7 +133,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_SCROLL_LEFT:
|
case GDK_SCROLL_LEFT:
|
||||||
xdelta = (current_page_frames() / 2);
|
xdelta = (current_page_frames() / 8);
|
||||||
if (leftmost_frame > xdelta) {
|
if (leftmost_frame > xdelta) {
|
||||||
reset_x_origin (leftmost_frame - xdelta);
|
reset_x_origin (leftmost_frame - xdelta);
|
||||||
} else {
|
} else {
|
||||||
|
@ -142,7 +142,7 @@ Editor::track_canvas_scroll (GdkEventScroll* ev)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_SCROLL_RIGHT:
|
case GDK_SCROLL_RIGHT:
|
||||||
xdelta = (current_page_frames() / 2);
|
xdelta = (current_page_frames() / 8);
|
||||||
if (max_frames - xdelta > leftmost_frame) {
|
if (max_frames - xdelta > leftmost_frame) {
|
||||||
reset_x_origin (leftmost_frame + xdelta);
|
reset_x_origin (leftmost_frame + xdelta);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3072,7 +3072,7 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
|
||||||
/* reset selection to new regionviews */
|
/* reset selection to new regionviews */
|
||||||
|
|
||||||
selection->set (new_regionviews);
|
selection->set (new_regionviews);
|
||||||
|
|
||||||
/* reset drag_info data to reflect the fact that we are dragging the copies */
|
/* reset drag_info data to reflect the fact that we are dragging the copies */
|
||||||
|
|
||||||
drag_info.data = new_regionviews.front();
|
drag_info.data = new_regionviews.front();
|
||||||
|
@ -3471,7 +3471,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
||||||
|
|
||||||
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
|
pair<set<boost::shared_ptr<Playlist> >::iterator,bool> insert_result;
|
||||||
const list<RegionView*>& layered_regions = selection->regions.by_layer();
|
const list<RegionView*>& layered_regions = selection->regions.by_layer();
|
||||||
|
|
||||||
for (list<RegionView*>::const_iterator i = layered_regions.begin(); i != layered_regions.end(); ++i) {
|
for (list<RegionView*>::const_iterator i = layered_regions.begin(); i != layered_regions.end(); ++i) {
|
||||||
|
|
||||||
RegionView* rv = (*i);
|
RegionView* rv = (*i);
|
||||||
|
@ -3866,7 +3866,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
|
||||||
sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
|
sigc::connection c = rtv->view()->RegionViewAdded.connect (mem_fun(*this, &Editor::collect_new_region_view));
|
||||||
to_playlist->add_region (newregion, (nframes_t) (where * rtv->get_diskstream()->speed()));
|
to_playlist->add_region (newregion, (nframes_t) (where * rtv->get_diskstream()->speed()));
|
||||||
c.disconnect ();
|
c.disconnect ();
|
||||||
|
|
||||||
if (!latest_regionviews.empty()) {
|
if (!latest_regionviews.empty()) {
|
||||||
// XXX why just the first one ? we only expect one
|
// XXX why just the first one ? we only expect one
|
||||||
rtv->reveal_dependent_views (*latest_regionviews.front());
|
rtv->reveal_dependent_views (*latest_regionviews.front());
|
||||||
|
|
|
@ -1515,6 +1515,12 @@ Editor::temporal_zoom (gdouble fpu)
|
||||||
double nfpu;
|
double nfpu;
|
||||||
double l;
|
double l;
|
||||||
|
|
||||||
|
/* XXX this limit is also in ::set_frames_per_unit() */
|
||||||
|
|
||||||
|
if (frames_per_unit <= 2.0 && fpu <= frames_per_unit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
nfpu = fpu;
|
nfpu = fpu;
|
||||||
|
|
||||||
new_page_size = (nframes_t) floor (canvas_width * nfpu);
|
new_page_size = (nframes_t) floor (canvas_width * nfpu);
|
||||||
|
@ -1549,7 +1555,7 @@ Editor::temporal_zoom (gdouble fpu)
|
||||||
where = playhead_cursor->current_frame;
|
where = playhead_cursor->current_frame;
|
||||||
|
|
||||||
l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
l = - ((new_page_size * ((where - current_leftmost)/(double)current_page)) - where);
|
||||||
|
|
||||||
if (l < 0) {
|
if (l < 0) {
|
||||||
leftmost_after_zoom = 0;
|
leftmost_after_zoom = 0;
|
||||||
} else if (l > max_frames) {
|
} else if (l > max_frames) {
|
||||||
|
|
|
@ -122,9 +122,6 @@ EngineControl::EngineControl ()
|
||||||
set_popdown_strings (driver_combo, strings);
|
set_popdown_strings (driver_combo, strings);
|
||||||
driver_combo.set_active_text (strings.front());
|
driver_combo.set_active_text (strings.front());
|
||||||
|
|
||||||
/* figure out available devices and set up interface_combo */
|
|
||||||
|
|
||||||
enumerate_devices ();
|
|
||||||
driver_combo.signal_changed().connect (mem_fun (*this, &EngineControl::driver_changed));
|
driver_combo.signal_changed().connect (mem_fun (*this, &EngineControl::driver_changed));
|
||||||
driver_changed ();
|
driver_changed ();
|
||||||
|
|
||||||
|
@ -428,10 +425,20 @@ EngineControl::build_command_line (vector<string>& cmd)
|
||||||
cmd.push_back ("netjack");
|
cmd.push_back ("netjack");
|
||||||
} else if (driver == X_("FFADO")) {
|
} else if (driver == X_("FFADO")) {
|
||||||
using_ffado = true;
|
using_ffado = true;
|
||||||
cmd.push_back ("ffado");
|
|
||||||
|
/* do this until FFADO becomes the standard */
|
||||||
|
|
||||||
|
char* hack = getenv ("ARDOUR_FIREWIRE_DRIVER_NAME");
|
||||||
|
|
||||||
|
if (hack) {
|
||||||
|
cmd.push_back (hack);
|
||||||
|
} else {
|
||||||
|
cmd.push_back ("freebob");
|
||||||
|
}
|
||||||
|
|
||||||
} else if ( driver == X_("Dummy")) {
|
} else if ( driver == X_("Dummy")) {
|
||||||
using_dummy = true;
|
using_dummy = true;
|
||||||
cmd.push_back ("dummy");
|
cmd.push_back ("dummy");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* driver arguments */
|
/* driver arguments */
|
||||||
|
@ -456,10 +463,10 @@ EngineControl::build_command_line (vector<string>& cmd)
|
||||||
cmd.push_back ("-C");
|
cmd.push_back ("-C");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! using_dummy ) {
|
if (! using_dummy ) {
|
||||||
cmd.push_back ("-n");
|
cmd.push_back ("-n");
|
||||||
cmd.push_back (to_string ((uint32_t) floor (periods_spinner.get_value()), std::dec));
|
cmd.push_back (to_string ((uint32_t) floor (periods_spinner.get_value()), std::dec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.push_back ("-r");
|
cmd.push_back ("-r");
|
||||||
|
@ -567,18 +574,29 @@ EngineControl::realtime_changed ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::enumerate_devices ()
|
EngineControl::enumerate_devices (const string& driver)
|
||||||
{
|
{
|
||||||
/* note: case matters for the map keys */
|
/* note: case matters for the map keys */
|
||||||
|
|
||||||
#ifdef __APPLE__
|
if (driver == "CoreAudio") {
|
||||||
devices["CoreAudio"] = enumerate_coreaudio_devices ();
|
#ifdef __APPLE__
|
||||||
|
devices[driver] = enumerate_coreaudio_devices ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
|
} else if (driver == "ALSA") {
|
||||||
|
devices[driver] = enumerate_alsa_devices ();
|
||||||
|
} else if (driver == "FFADO") {
|
||||||
|
devices[driver] = enumerate_ffado_devices ();
|
||||||
|
} else if (driver == "OSS") {
|
||||||
|
devices[driver] = enumerate_oss_devices ();
|
||||||
|
} else if (driver == "Dummy") {
|
||||||
|
devices[driver] = enumerate_dummy_devices ();
|
||||||
|
} else if (driver == "NetJACK") {
|
||||||
|
devices[driver] = enumerate_netjack_devices ();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
devices["ALSA"] = enumerate_alsa_devices ();
|
}
|
||||||
devices["FFADO"] = enumerate_ffado_devices ();
|
|
||||||
devices["OSS"] = enumerate_oss_devices ();
|
|
||||||
devices["Dummy"] = enumerate_dummy_devices ();
|
|
||||||
devices["NetJACK"] = enumerate_netjack_devices ();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,6 +687,7 @@ EngineControl::enumerate_coreaudio_devices ()
|
||||||
delete [] coreDeviceIDs;
|
delete [] coreDeviceIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (devs.size() == 0) {
|
if (devs.size() == 0) {
|
||||||
MessageDialog msg (_("\
|
MessageDialog msg (_("\
|
||||||
You do not have any audio devices capable of\n\
|
You do not have any audio devices capable of\n\
|
||||||
|
@ -689,6 +708,7 @@ Ardour and choose the relevant device then."
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return devs;
|
return devs;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -757,8 +777,10 @@ vector<string>
|
||||||
EngineControl::enumerate_ffado_devices ()
|
EngineControl::enumerate_ffado_devices ()
|
||||||
{
|
{
|
||||||
vector<string> devs;
|
vector<string> devs;
|
||||||
|
backend_devs.clear ();
|
||||||
return devs;
|
return devs;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string>
|
vector<string>
|
||||||
EngineControl::enumerate_freebob_devices ()
|
EngineControl::enumerate_freebob_devices ()
|
||||||
{
|
{
|
||||||
|
@ -789,11 +811,19 @@ void
|
||||||
EngineControl::driver_changed ()
|
EngineControl::driver_changed ()
|
||||||
{
|
{
|
||||||
string driver = driver_combo.get_active_text();
|
string driver = driver_combo.get_active_text();
|
||||||
vector<string>& strings = devices[driver];
|
|
||||||
string::size_type maxlen = 0;
|
string::size_type maxlen = 0;
|
||||||
int maxindex = -1;
|
int maxindex = -1;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
|
enumerate_devices (driver);
|
||||||
|
|
||||||
|
vector<string>& strings = devices[driver];
|
||||||
|
|
||||||
|
if (strings.empty()) {
|
||||||
|
error << string_compose (_("No devices found for driver \"%1\""), driver) << endmsg;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (vector<string>::iterator i = strings.begin(); i != strings.end(); ++i, ++n) {
|
for (vector<string>::iterator i = strings.begin(); i != strings.end(); ++i, ++n) {
|
||||||
if ((*i).length() > maxlen) {
|
if ((*i).length() > maxlen) {
|
||||||
maxlen = (*i).length();
|
maxlen = (*i).length();
|
||||||
|
@ -1067,19 +1097,18 @@ EngineControl::set_state (const XMLNode& root)
|
||||||
XMLNodeConstIterator citer;
|
XMLNodeConstIterator citer;
|
||||||
XMLNode* child;
|
XMLNode* child;
|
||||||
XMLProperty* prop;
|
XMLProperty* prop;
|
||||||
|
bool using_dummy = false;
|
||||||
bool using_dummy = false;
|
|
||||||
|
|
||||||
int val;
|
int val;
|
||||||
string strval;
|
string strval;
|
||||||
|
|
||||||
if ( (child = root.child("driver"))){
|
if ( (child = root.child ("driver"))){
|
||||||
prop = child->property("val");
|
prop = child->property("val");
|
||||||
if (prop && (prop->value() == "Dummy") ) {
|
if (prop && (prop->value() == "Dummy") ) {
|
||||||
using_dummy = true;
|
using_dummy = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clist = root.children();
|
clist = root.children();
|
||||||
|
|
||||||
for (citer = clist.begin(); citer != clist.end(); ++citer) {
|
for (citer = clist.begin(); citer != clist.end(); ++citer) {
|
||||||
|
@ -1089,8 +1118,9 @@ EngineControl::set_state (const XMLNode& root)
|
||||||
prop = child->property ("val");
|
prop = child->property ("val");
|
||||||
|
|
||||||
if (!prop || prop->value().empty()) {
|
if (!prop || prop->value().empty()) {
|
||||||
if ( using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" ))
|
|
||||||
continue;
|
if ( using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" ))
|
||||||
|
continue;
|
||||||
error << string_compose (_("AudioSetup value for %1 is missing data"), child->name()) << endmsg;
|
error << string_compose (_("AudioSetup value for %1 is missing data"), child->name()) << endmsg;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ class EngineControl : public Gtk::VBox {
|
||||||
|
|
||||||
std::map<std::string,std::vector<std::string> > devices;
|
std::map<std::string,std::vector<std::string> > devices;
|
||||||
std::vector<std::string> backend_devs;
|
std::vector<std::string> backend_devs;
|
||||||
void enumerate_devices ();
|
void enumerate_devices (const string& driver);
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
std::vector<std::string> enumerate_coreaudio_devices ();
|
std::vector<std::string> enumerate_coreaudio_devices ();
|
||||||
|
|
|
@ -277,5 +277,10 @@ PlugUIBase::bypass_toggled ()
|
||||||
|
|
||||||
if ((x = bypass_button.get_active()) == insert->active()) {
|
if ((x = bypass_button.get_active()) == insert->active()) {
|
||||||
insert->set_active (!x);
|
insert->set_active (!x);
|
||||||
|
if (insert->active()) {
|
||||||
|
bypass_button.set_label (_("Bypass"));
|
||||||
|
} else {
|
||||||
|
bypass_button.set_label (_("Active"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -295,12 +295,48 @@ Selection::add (TimeAxisView* track)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Selection::add (vector<RegionView*>& v)
|
||||||
|
{
|
||||||
|
/* XXX This method or the add (const RegionSelection&) needs to go
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
|
||||||
|
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
|
||||||
|
changed = regions.add ((*i));
|
||||||
|
if (Config->get_link_region_and_track_selection() && changed) {
|
||||||
|
add (&(*i)->get_trackview());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
RegionsChanged ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Selection::add (const RegionSelection& rs)
|
Selection::add (const RegionSelection& rs)
|
||||||
{
|
{
|
||||||
if (!rs.empty()) {
|
/* XXX This method or the add (const vector<RegionView*>&) needs to go
|
||||||
regions.insert (regions.end(), rs.begin(), rs.end());
|
*/
|
||||||
RegionsChanged(); /* EMIT SIGNAL */
|
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
for (RegionSelection::const_iterator i = rs.begin(); i != rs.end(); ++i) {
|
||||||
|
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
|
||||||
|
changed = regions.add ((*i));
|
||||||
|
if (Config->get_link_region_and_track_selection() && changed) {
|
||||||
|
add (&(*i)->get_trackview());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
select_edit_group_regions ();
|
||||||
|
RegionsChanged ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -316,26 +352,6 @@ Selection::add (RegionView* r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Selection::add (vector<RegionView*>& v)
|
|
||||||
{
|
|
||||||
bool changed = false;
|
|
||||||
|
|
||||||
for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
|
|
||||||
if (find (regions.begin(), regions.end(), (*i)) == regions.end()) {
|
|
||||||
changed = regions.add ((*i));
|
|
||||||
if (Config->get_link_region_and_track_selection() && changed) {
|
|
||||||
add (&(*i)->get_trackview());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed) {
|
|
||||||
select_edit_group_regions ();
|
|
||||||
RegionsChanged ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
long
|
long
|
||||||
Selection::add (nframes_t start, nframes_t end)
|
Selection::add (nframes_t start, nframes_t end)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstdio> /* for snprintf, grrr */
|
#include <cstdio> /* for snprintf, grrr */
|
||||||
|
|
||||||
|
#include <glib.h>
|
||||||
|
#include <glib/gstdio.h> /* for g_stat() */
|
||||||
|
|
||||||
#include <pbd/failed_constructor.h>
|
#include <pbd/failed_constructor.h>
|
||||||
#include <pbd/xml++.h>
|
#include <pbd/xml++.h>
|
||||||
#include <pbd/filesystem.h>
|
#include <pbd/filesystem.h>
|
||||||
|
@ -80,7 +83,8 @@ Configuration::load_state ()
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
sys::path system_rc_file;
|
sys::path system_rc_file;
|
||||||
|
struct stat statbuf;
|
||||||
|
|
||||||
/* load system configuration first */
|
/* load system configuration first */
|
||||||
|
|
||||||
if ( find_file_in_search_path (ardour_search_path() + system_config_search_path(),
|
if ( find_file_in_search_path (ardour_search_path() + system_config_search_path(),
|
||||||
|
@ -91,18 +95,28 @@ Configuration::load_state ()
|
||||||
|
|
||||||
string rcfile = system_rc_file.to_string();
|
string rcfile = system_rc_file.to_string();
|
||||||
|
|
||||||
cerr << string_compose (_("loading system configuration file %1"), rcfile) << endl;
|
/* stupid XML Parser hates empty files */
|
||||||
|
|
||||||
if (!tree.read (rcfile.c_str())) {
|
if (g_stat (rcfile.c_str(), &statbuf)) {
|
||||||
error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_owner = ConfigVariableBase::System;
|
if (statbuf.st_size != 0) {
|
||||||
|
cerr << string_compose (_("loading system configuration file %1"), rcfile) << endl;
|
||||||
if (set_state (*tree.root())) {
|
|
||||||
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
if (!tree.read (rcfile.c_str())) {
|
||||||
return -1;
|
error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_owner = ConfigVariableBase::System;
|
||||||
|
|
||||||
|
if (set_state (*tree.root())) {
|
||||||
|
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error << _("your system Ardour configuration file is empty. This probably means that there as an error installing Ardour") << endmsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,23 +128,32 @@ Configuration::load_state ()
|
||||||
"ardour.rc", user_rc_file))
|
"ardour.rc", user_rc_file))
|
||||||
{
|
{
|
||||||
XMLTree tree;
|
XMLTree tree;
|
||||||
found = true;
|
|
||||||
|
|
||||||
string rcfile = user_rc_file.to_string();
|
string rcfile = user_rc_file.to_string();
|
||||||
|
|
||||||
cerr << string_compose (_("loading user configuration file %1"), rcfile) << endl;
|
/* stupid XML parser hates empty files */
|
||||||
|
|
||||||
if (!tree.read (rcfile)) {
|
if (g_stat (rcfile.c_str(), &statbuf)) {
|
||||||
error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_owner = ConfigVariableBase::Config;
|
if (statbuf.st_size != 0) {
|
||||||
|
cerr << string_compose (_("loading user configuration file %1"), rcfile) << endl;
|
||||||
if (set_state (*tree.root())) {
|
|
||||||
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
if (!tree.read (rcfile)) {
|
||||||
return -1;
|
error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
|
||||||
}
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
current_owner = ConfigVariableBase::Config;
|
||||||
|
|
||||||
|
if (set_state (*tree.root())) {
|
||||||
|
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
warning << _("your Ardour configuration file is empty. This is not normal.") << endmsg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
|
|
|
@ -2542,40 +2542,42 @@ Session::region_name (string& result, string base, bool newlevel) const
|
||||||
void
|
void
|
||||||
Session::add_region (boost::shared_ptr<Region> region)
|
Session::add_region (boost::shared_ptr<Region> region)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Region> other;
|
|
||||||
bool added = false;
|
bool added = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
Glib::Mutex::Lock lm (region_lock);
|
Glib::Mutex::Lock lm (region_lock);
|
||||||
|
|
||||||
RegionList::iterator x;
|
if (region == 0) {
|
||||||
|
error << _("Session::add_region() ignored a null region. Warning: you might have lost a region.") << endmsg;
|
||||||
|
} else {
|
||||||
|
|
||||||
for (x = regions.begin(); x != regions.end(); ++x) {
|
RegionList::iterator x;
|
||||||
|
|
||||||
other = x->second;
|
for (x = regions.begin(); x != regions.end(); ++x) {
|
||||||
|
|
||||||
if (region->region_list_equivalent (other)) {
|
if (region->region_list_equivalent (x->second)) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x == regions.end()) {
|
||||||
|
|
||||||
|
pair<RegionList::key_type,RegionList::mapped_type> entry;
|
||||||
|
|
||||||
|
entry.first = region->id();
|
||||||
|
entry.second = region;
|
||||||
|
|
||||||
|
pair<RegionList::iterator,bool> x = regions.insert (entry);
|
||||||
|
|
||||||
|
|
||||||
|
if (!x.second) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x == regions.end()) {
|
|
||||||
|
|
||||||
pair<RegionList::key_type,RegionList::mapped_type> entry;
|
|
||||||
|
|
||||||
entry.first = region->id();
|
|
||||||
entry.second = region;
|
|
||||||
|
|
||||||
pair<RegionList::iterator,bool> x = regions.insert (entry);
|
|
||||||
|
|
||||||
|
|
||||||
if (!x.second) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
added = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark dirty because something has changed even if we didn't
|
/* mark dirty because something has changed even if we didn't
|
||||||
|
|
|
@ -1398,7 +1398,14 @@ Session::load_regions (const XMLNode& node)
|
||||||
|
|
||||||
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
|
||||||
if ((region = XMLRegionFactory (**niter, false)) == 0) {
|
if ((region = XMLRegionFactory (**niter, false)) == 0) {
|
||||||
error << _("Session: cannot create Region from XML description.") << endmsg;
|
error << _("Session: cannot create Region from XML description.");
|
||||||
|
const XMLProperty *name = (**niter).property("name");
|
||||||
|
|
||||||
|
if (name) {
|
||||||
|
error << " " << string_compose (_("Can not load state for region '%1'"), name->value());
|
||||||
|
}
|
||||||
|
|
||||||
|
error << endmsg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __ardour_svn_revision_h__
|
#ifndef __ardour_svn_revision_h__
|
||||||
#define __ardour_svn_revision_h__
|
#define __ardour_svn_revision_h__
|
||||||
static const char* ardour_svn_revision = "2884";
|
static const char* ardour_svn_revision = "2914";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user