summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-10 22:22:29 +0000
committerDavid Robillard <d@drobilla.net>2008-01-10 22:22:29 +0000
commit8a2e30816ee392b871c5918f769f68cc0196a893 (patch)
treeeb85739049c0adc6186eea635aaaf65ef03f038f /libs
parentbb457bb960c5bd7ed538f9d31477293415739f68 (diff)
Merge with 2.0-ongoing R2883.
git-svn-id: svn://localhost/ardour2/trunk@2885 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/configuration_vars.h1
-rw-r--r--libs/ardour/ardour/osc.h1
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/ardour/types.h3
-rw-r--r--libs/ardour/audio_diskstream.cc4
-rw-r--r--libs/ardour/audioregion.cc37
-rw-r--r--libs/ardour/osc.cc24
-rw-r--r--libs/ardour/plugin_manager.cc4
-rw-r--r--libs/ardour/rb_effect.cc6
-rw-r--r--libs/ardour/session.cc25
-rw-r--r--libs/ardour/session_butler.cc3
-rw-r--r--libs/ardour/session_process.cc4
-rw-r--r--libs/ardour/session_state.cc41
-rw-r--r--libs/ardour/session_transport.cc2
14 files changed, 109 insertions, 48 deletions
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index aa27a3ef24..99776929a4 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -152,6 +152,7 @@ CONFIG_VARIABLE (bool, sync_all_route_ordering, "sync-all-route-ordering", true)
CONFIG_VARIABLE (bool, only_copy_imported_files, "only-copy-imported-files", true)
CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
CONFIG_VARIABLE (std::string, default_bindings, "default-bindings", "ardour")
+CONFIG_VARIABLE (bool, default_narrow_ms, "default-narrow_ms", false)
/* denormal management */
diff --git a/libs/ardour/ardour/osc.h b/libs/ardour/ardour/osc.h
index ca2f4488dd..3f1ce03445 100644
--- a/libs/ardour/ardour/osc.h
+++ b/libs/ardour/ardour/osc.h
@@ -54,6 +54,7 @@ class OSC : public BasicUI, public sigc::trackable
lo_server _osc_server;
lo_server _osc_unix_server;
std::string _osc_unix_socket_path;
+ std::string _osc_url_file;
pthread_t _osc_thread;
int _request_pipe[2];
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 90a9563ad1..c6b913b979 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1427,7 +1427,7 @@ class Session : public PBD::StatefulDestructible
SerializedRCUManager<RouteList> routes;
- void add_routes (RouteList&, bool save = true);
+ void add_routes (RouteList&, bool save);
uint32_t destructive_index;
int load_routes (const XMLNode&);
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index d7961babbd..48b41cbd96 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -382,8 +382,11 @@ namespace ARDOUR {
struct TimeFXRequest : public InterThreadInfo {
float time_fraction;
float pitch_fraction;
+ /* SoundTouch */
bool quick_seek;
bool antialias;
+ /* RubberBand */
+ int opts; // really RubberBandStretcher::Options
};
} // namespace ARDOUR
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index bc4a352c45..c36c9de184 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -264,7 +264,7 @@ AudioDiskstream::use_new_playlist ()
{
string newname;
boost::shared_ptr<AudioPlaylist> playlist;
-
+
if (!in_set_state && destructive()) {
return 0;
}
@@ -1998,8 +1998,6 @@ AudioDiskstream::set_state (const XMLNode& node)
up of the IO that owns this DS (::non_realtime_input_change())
*/
- in_set_state = false;
-
return 0;
}
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 301351fe71..f1534827fd 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -548,7 +548,7 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
Region::set_live_state (node, what_changed, false);
uint32_t old_flags = _flags;
-
+
if ((prop = node.property ("flags")) != 0) {
_flags = Flag (string_2_enum (prop->value(), _flags));
@@ -599,17 +599,44 @@ AudioRegion::set_live_state (const XMLNode& node, Change& what_changed, bool sen
_fade_in->clear ();
- if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0 || _fade_in->set_state (*child)) {
+ if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
set_default_fade_in ();
- }
+ } else {
+ XMLNode* grandchild = child->child ("AutomationList");
+ if (grandchild) {
+ _fade_in->set_state (*grandchild);
+ }
+ }
+
+ if ((prop = child->property ("active")) != 0) {
+ if (prop->value() == "yes") {
+ set_fade_in_active (true);
+ } else {
+ set_fade_in_active (true);
+ }
+ }
} else if (child->name() == "FadeOut") {
_fade_out->clear ();
- if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0 || _fade_out->set_state (*child)) {
+ if ((prop = child->property ("default")) != 0 || (prop = child->property ("steepness")) != 0) {
set_default_fade_out ();
- }
+ } else {
+ XMLNode* grandchild = child->child ("AutomationList");
+ if (grandchild) {
+ _fade_out->set_state (*grandchild);
+ }
+ }
+
+ if ((prop = child->property ("active")) != 0) {
+ if (prop->value() == "yes") {
+ set_fade_out_active (true);
+ } else {
+ set_fade_out_active (false);
+ }
+ }
+
}
}
diff --git a/libs/ardour/osc.cc b/libs/ardour/osc.cc
index 8903c3781a..b0bd35b8c6 100644
--- a/libs/ardour/osc.cc
+++ b/libs/ardour/osc.cc
@@ -18,6 +18,7 @@
*/
#include <iostream>
+#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cerrno>
@@ -28,11 +29,13 @@
#include <fcntl.h>
#include <pbd/pthread_utils.h>
+#include <pbd/file_utils.h>
#include <ardour/osc.h>
#include <ardour/session.h>
#include <ardour/route.h>
#include <ardour/audio_track.h>
+#include <ardour/filesystem_paths.h>
#include "i18n.h"
@@ -101,6 +104,24 @@ OSC::start ()
#endif
cerr << "OSC @ " << get_server_url () << endl;
+
+ sys::path url_file;
+
+ if (find_file_in_search_path (ardour_search_path() + system_config_search_path(),
+ "osc_url", url_file)) {
+ _osc_url_file = url_file.to_string();
+ ofstream urlfile;
+ urlfile.open(_osc_url_file.c_str(), ios::trunc);
+ if ( urlfile )
+ {
+ urlfile << get_server_url () << endl;
+ urlfile.close();
+ }
+ else
+ {
+ cerr << "Couldn't write '" << _osc_url_file << "'" <<endl;
+ }
+ }
register_callbacks();
@@ -131,6 +152,9 @@ OSC::stop ()
unlink(_osc_unix_socket_path.c_str());
}
+ if (! _osc_url_file.empty() ) {
+ unlink(_osc_url_file.c_str() );
+ }
return 0;
}
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index d866a0d49f..f0465d0ad5 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -324,7 +324,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
lrdf_statement* matches1 = lrdf_matches (&pattern);
if (!matches1) {
- return _("");
+ return "";
}
pattern.subject = matches1->object;
@@ -336,7 +336,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
lrdf_free_statements(matches1);
if (!matches2) {
- return _("");
+ return ("");
}
string label = matches2->object;
diff --git a/libs/ardour/rb_effect.cc b/libs/ardour/rb_effect.cc
index 0de5a5bf4a..7a948f6004 100644
--- a/libs/ardour/rb_effect.cc
+++ b/libs/ardour/rb_effect.cc
@@ -75,7 +75,7 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
int avail = 0;
RubberBandStretcher stretcher (session.frame_rate(), region->n_channels(),
- RubberBandStretcher::DefaultOptions,
+ (RubberBandStretcher::Options) tsr.opts,
tsr.time_fraction, tsr.pitch_fraction);
stretcher.setExpectedInputDuration(region->length());
@@ -155,7 +155,7 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
pos += this_read;
done += this_read;
- tsr.progress = ((float) done / duration) * 0.75;
+ tsr.progress = ((float) done / duration) * 0.25;
stretcher.study(buffers, this_read, pos == duration);
}
@@ -193,7 +193,7 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
pos += this_read;
done += this_read;
- tsr.progress = 0.75 + ((float) done / duration) * 0.25;
+ tsr.progress = 0.25 + ((float) done / duration) * 0.75;
stretcher.process(buffers, this_read, pos == duration);
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index a7f85a5c84..cef5c7df48 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -151,7 +151,6 @@ Session::Session (AudioEngine &eng,
new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
if (new_session) {
if (create (new_session, mix_template, compute_initial_length())) {
- cerr << "create failed\n";
destroy ();
throw failed_constructor ();
}
@@ -257,7 +256,7 @@ Session::Session (AudioEngine &eng,
}
if (!rl.empty()) {
- add_routes (rl);
+ add_routes (rl, false);
}
}
@@ -270,17 +269,12 @@ Session::Session (AudioEngine &eng,
throw failed_constructor ();
}
- store_recent_sessions(_name, _path);
+ store_recent_sessions (_name, _path);
- bool was_dirty = dirty ();
-
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
- Config->ParameterChanged.connect (mem_fun (*this, &Session::config_changed));
- if (was_dirty) {
- DirtyChanged (); /* EMIT SIGNAL */
- }
+ Config->ParameterChanged.connect (mem_fun (*this, &Session::config_changed));
}
Session::~Session ()
@@ -298,6 +292,7 @@ Session::destroy ()
remove_pending_capture_state ();
_state_of_the_state = StateOfTheState (CannotSave|Deletion);
+
_engine.remove_session ();
GoingAway (); /* EMIT SIGNAL */
@@ -706,6 +701,7 @@ Session::when_engine_running ()
_state_of_the_state = StateOfTheState (_state_of_the_state & ~(CannotSave|Dirty));
+
/* hook us up to the engine */
_engine.set_session (this);
@@ -716,9 +712,6 @@ Session::when_engine_running ()
osc->set_session (*this);
#endif
- _state_of_the_state = Clean;
-
- DirtyChanged (); /* EMIT SIGNAL */
}
void
@@ -730,6 +723,7 @@ Session::hookup_io ()
_state_of_the_state = StateOfTheState (_state_of_the_state | InitialConnecting);
+
if (auditioner == 0) {
/* we delay creating the auditioner till now because
@@ -805,6 +799,7 @@ Session::hookup_io ()
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InitialConnecting);
+
/* now handle the whole enchilada as if it was one
graph reorder event.
*/
@@ -1803,8 +1798,7 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod
failed:
if (!new_routes.empty()) {
- add_routes (new_routes, false);
- save_state (_current_snapshot_name);
+ add_routes (new_routes, true);
}
return ret;
@@ -1938,8 +1932,7 @@ Session::new_audio_route (int input_channels, int output_channels, uint32_t how_
failure:
if (!ret.empty()) {
- add_routes (ret, false);
- save_state (_current_snapshot_name);
+ add_routes (ret, true);
}
return ret;
diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc
index 148ff92739..ccbc08248d 100644
--- a/libs/ardour/session_butler.cc
+++ b/libs/ardour/session_butler.cc
@@ -257,8 +257,7 @@ Session::butler_thread_work ()
/*IO* io = ds->io();
- if (ds->io() && !ds->io()->active()) {
- cerr << "Skip inactive diskstream " << ds->io()->name() << endl;
+ if (io && !io->active()) {
continue;
}*/
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 6476ab30f7..40a70c6862 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -268,10 +268,10 @@ Session::process_with_events (nframes_t nframes)
nframes_t this_nframes;
nframes_t end_frame;
nframes_t offset;
+ bool session_needs_butler = false;
nframes_t stop_limit;
long frames_moved;
- bool session_needs_butler = false;
-
+
/* make sure the auditioner is silent */
if (auditioner) {
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index fa4b103958..a08d09d949 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -47,12 +47,12 @@
#endif
#include <glibmm.h>
+#include <glibmm/thread.h>
#include <midi++/mmc.h>
#include <midi++/port.h>
-#include <pbd/error.h>
-#include <glibmm/thread.h>
+#include <pbd/error.h>
#include <pbd/pathscanner.h>
#include <pbd/pthread_utils.h>
#include <pbd/search_path.h>
@@ -178,7 +178,8 @@ Session::first_stage_init (string fullpath, string snapshot_name)
_worst_output_latency = 0;
_worst_input_latency = 0;
_worst_track_latency = 0;
- _state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading|Deletion);
+ _state_of_the_state = StateOfTheState(CannotSave|InitialConnecting|Loading);
+
_slave = 0;
butler_mixdown_buffer = 0;
butler_gain_buffer = 0;
@@ -301,6 +302,7 @@ Session::second_stage_init (bool new_session)
// set_state() will call setup_raid_path(), but if it's a new session we need
// to call setup_raid_path() here.
+
if (state_tree) {
if (set_state (*state_tree->root())) {
return -1;
@@ -321,7 +323,7 @@ Session::second_stage_init (bool new_session)
_state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave|Loading);
- // set_auto_input (true);
+
_locations.changed.connect (mem_fun (this, &Session::locations_changed));
_locations.added.connect (mem_fun (this, &Session::locations_added));
setup_click_sounds (0);
@@ -360,6 +362,17 @@ Session::second_stage_init (bool new_session)
} else {
_end_location_is_free = false;
}
+
+ _state_of_the_state = Clean;
+
+
+ DirtyChanged (); /* EMIT SIGNAL */
+
+ if (state_was_pending) {
+ save_state (_current_snapshot_name);
+ remove_pending_capture_state ();
+ state_was_pending = false;
+ }
return 0;
}
@@ -1119,6 +1132,7 @@ Session::set_state (const XMLNode& node)
int ret = -1;
_state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave);
+
if (node.name() != X_("Session")){
fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg;
@@ -1307,14 +1321,6 @@ Session::set_state (const XMLNode& node)
StateReady (); /* EMIT SIGNAL */
- _state_of_the_state = Clean;
-
- if (state_was_pending) {
- save_state (_current_snapshot_name);
- remove_pending_capture_state ();
- state_was_pending = false;
- }
-
return 0;
out:
@@ -1344,7 +1350,7 @@ Session::load_routes (const XMLNode& node)
new_routes.push_back (route);
}
- add_routes (new_routes);
+ add_routes (new_routes, false);
return 0;
}
@@ -2120,6 +2126,10 @@ Session::commit_reversible_command (Command *cmd)
current_trans->add_command (cmd);
}
+ if (current_trans->empty()) {
+ return;
+ }
+
gettimeofday (&now, 0);
current_trans->set_timestamp (now);
@@ -2363,6 +2373,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
int ret = -1;
_state_of_the_state = (StateOfTheState) (_state_of_the_state | InCleanup);
+
/* step 1: consider deleting all unused playlists */
@@ -2602,6 +2613,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
out:
_state_of_the_state = (StateOfTheState) (_state_of_the_state & ~InCleanup);
+
return ret;
}
@@ -2675,6 +2687,7 @@ Session::set_dirty ()
_state_of_the_state = StateOfTheState (_state_of_the_state | Dirty);
+
if (!was_dirty) {
DirtyChanged(); /* EMIT SIGNAL */
}
@@ -2688,6 +2701,7 @@ Session::set_clean ()
_state_of_the_state = Clean;
+
if (was_dirty) {
DirtyChanged(); /* EMIT SIGNAL */
}
@@ -2697,6 +2711,7 @@ void
Session::set_deletion_in_progress ()
{
_state_of_the_state = StateOfTheState (_state_of_the_state | Deletion);
+
}
void
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 1398872b36..d422698f30 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -55,7 +55,7 @@ Session::request_input_change_handling ()
if (!(_state_of_the_state & (InitialConnecting|Deletion))) {
Event* ev = new Event (Event::InputConfigurationChange, Event::Add, Event::Immediate, 0, 0.0);
queue_event (ev);
- }
+ }
}
void