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 {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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,7 +425,17 @@ 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");
|
||||||
|
@ -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 */
|
||||||
|
|
||||||
|
if (driver == "CoreAudio") {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
devices["CoreAudio"] = enumerate_coreaudio_devices ();
|
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,13 +1097,12 @@ 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;
|
||||||
|
@ -1089,6 +1118,7 @@ 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" ))
|
if ( using_dummy && ( child->name() == "interface" || child->name() == "inputdevice" || child->name() == "outputdevice" ))
|
||||||
continue;
|
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;
|
||||||
|
|
|
@ -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,30 +295,12 @@ Selection::add (TimeAxisView* track)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Selection::add (const RegionSelection& rs)
|
|
||||||
{
|
|
||||||
if (!rs.empty()) {
|
|
||||||
regions.insert (regions.end(), rs.begin(), rs.end());
|
|
||||||
RegionsChanged(); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Selection::add (RegionView* r)
|
|
||||||
{
|
|
||||||
if (find (regions.begin(), regions.end(), r) == regions.end()) {
|
|
||||||
regions.add (r);
|
|
||||||
if (Config->get_link_region_and_track_selection()) {
|
|
||||||
add (&r->get_trackview());
|
|
||||||
}
|
|
||||||
RegionsChanged ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Selection::add (vector<RegionView*>& v)
|
Selection::add (vector<RegionView*>& v)
|
||||||
{
|
{
|
||||||
|
/* XXX This method or the add (const RegionSelection&) needs to go
|
||||||
|
*/
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
|
for (vector<RegionView*>::iterator i = v.begin(); i != v.end(); ++i) {
|
||||||
|
@ -330,12 +312,46 @@ Selection::add (vector<RegionView*>& v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
RegionsChanged ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Selection::add (const RegionSelection& rs)
|
||||||
|
{
|
||||||
|
/* XXX This method or the add (const vector<RegionView*>&) needs to go
|
||||||
|
*/
|
||||||
|
|
||||||
|
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) {
|
if (changed) {
|
||||||
select_edit_group_regions ();
|
select_edit_group_regions ();
|
||||||
RegionsChanged ();
|
RegionsChanged ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Selection::add (RegionView* r)
|
||||||
|
{
|
||||||
|
if (find (regions.begin(), regions.end(), r) == regions.end()) {
|
||||||
|
regions.add (r);
|
||||||
|
if (Config->get_link_region_and_track_selection()) {
|
||||||
|
add (&r->get_trackview());
|
||||||
|
}
|
||||||
|
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,6 +83,7 @@ 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 */
|
||||||
|
|
||||||
|
@ -91,6 +95,13 @@ Configuration::load_state ()
|
||||||
|
|
||||||
string rcfile = system_rc_file.to_string();
|
string rcfile = system_rc_file.to_string();
|
||||||
|
|
||||||
|
/* stupid XML Parser hates empty files */
|
||||||
|
|
||||||
|
if (g_stat (rcfile.c_str(), &statbuf)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statbuf.st_size != 0) {
|
||||||
cerr << string_compose (_("loading system configuration file %1"), rcfile) << endl;
|
cerr << string_compose (_("loading system configuration file %1"), rcfile) << endl;
|
||||||
|
|
||||||
if (!tree.read (rcfile.c_str())) {
|
if (!tree.read (rcfile.c_str())) {
|
||||||
|
@ -104,6 +115,9 @@ Configuration::load_state ()
|
||||||
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
error << string_compose(_("Ardour: system configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
error << _("your system Ardour configuration file is empty. This probably means that there as an error installing Ardour") << endmsg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now load configuration file for user */
|
/* now load configuration file for user */
|
||||||
|
@ -114,10 +128,16 @@ 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();
|
||||||
|
|
||||||
|
/* stupid XML parser hates empty files */
|
||||||
|
|
||||||
|
if (g_stat (rcfile.c_str(), &statbuf)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statbuf.st_size != 0) {
|
||||||
cerr << string_compose (_("loading user configuration file %1"), rcfile) << endl;
|
cerr << string_compose (_("loading user configuration file %1"), rcfile) << endl;
|
||||||
|
|
||||||
if (!tree.read (rcfile)) {
|
if (!tree.read (rcfile)) {
|
||||||
|
@ -131,6 +151,9 @@ Configuration::load_state ()
|
||||||
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
error << string_compose(_("Ardour: user configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warning << _("your Ardour configuration file is empty. This is not normal.") << endmsg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
|
|
|
@ -2542,19 +2542,20 @@ 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);
|
||||||
|
|
||||||
|
if (region == 0) {
|
||||||
|
error << _("Session::add_region() ignored a null region. Warning: you might have lost a region.") << endmsg;
|
||||||
|
} else {
|
||||||
|
|
||||||
RegionList::iterator x;
|
RegionList::iterator x;
|
||||||
|
|
||||||
for (x = regions.begin(); x != regions.end(); ++x) {
|
for (x = regions.begin(); x != regions.end(); ++x) {
|
||||||
|
|
||||||
other = x->second;
|
if (region->region_list_equivalent (x->second)) {
|
||||||
|
|
||||||
if (region->region_list_equivalent (other)) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2577,6 +2578,7 @@ Session::add_region (boost::shared_ptr<Region> region)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* mark dirty because something has changed even if we didn't
|
/* mark dirty because something has changed even if we didn't
|
||||||
add the region to the region list.
|
add the region to the region list.
|
||||||
|
|
|
@ -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