#include "pbd/enumwriter.h"
#include "pbd/stacktrace.h"
-#include "ardour/ardour.h"
-#include "ardour/audioengine.h"
#include "ardour/analyser.h"
+#include "ardour/ardour.h"
+#include "ardour/audio_buffer.h"
#include "ardour/audio_diskstream.h"
-#include "ardour/utils.h"
-#include "ardour/configuration.h"
+#include "ardour/audio_port.h"
+#include "ardour/audioengine.h"
#include "ardour/audiofilesource.h"
-#include "ardour/send.h"
-#include "ardour/region_factory.h"
+
#include "ardour/audioplaylist.h"
-#include "ardour/playlist_factory.h"
-#include "ardour/cycle_timer.h"
#include "ardour/audioregion.h"
-#include "ardour/audio_port.h"
-#include "ardour/source_factory.h"
-#include "ardour/audio_buffer.h"
-#include "ardour/session.h"
+#include "ardour/butler.h"
+#include "ardour/configuration.h"
+#include "ardour/cycle_timer.h"
+#include "ardour/debug.h"
#include "ardour/io.h"
+#include "ardour/playlist_factory.h"
+#include "ardour/region_factory.h"
+#include "ardour/send.h"
+#include "ardour/session.h"
+#include "ardour/source_factory.h"
+#include "ardour/utils.h"
+#include "ardour/session_playlists.h"
#include "i18n.h"
#include <locale.h>
AudioDiskstream::~AudioDiskstream ()
{
- notify_callbacks ();
+ DEBUG_TRACE (DEBUG::Destruction, string_compose ("Audio Diskstream %1 destructor\n", _name));
{
RCUWriter<ChannelList> writer (channels);
{
boost::shared_ptr<AudioPlaylist> playlist;
- if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist> (_session.playlist_by_name (name))) == 0) {
+ if ((playlist = boost::dynamic_pointer_cast<AudioPlaylist> (_session.playlists->by_name (name))) == 0) {
playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (DataType::AUDIO, _session, name));
}
nframes_t total = chaninfo->playback_vector.len[0] + chaninfo->playback_vector.len[1];
if (necessary_samples > total) {
+ cerr << _name << " Need " << necessary_samples << " total = " << total << endl;
cerr << "underrun for " << _name << endl;
DiskUnderrun ();
goto out;
if (s) {
srcs.push_back (s);
s->update_header (capture_info.front()->start, when, twhen);
- s->set_captured_for (_name);
+ s->set_captured_for (_name.get());
s->mark_immutable ();
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (s, true);
process. this problem is deferred to the UI.
*/
- _playlist->Modified();
+ _playlist->LayeringChanged(); // XXX this may not get the UI to do the right thing
} else {
continue; /* XXX is this OK? */
}
- region->GoingAway.connect (bind (mem_fun (*this, &Diskstream::remove_region_from_last_capture), boost::weak_ptr<Region>(region)));
+ region->DropReferences.connect_same_thread (*this, boost::bind (&Diskstream::remove_region_from_last_capture, this, boost::weak_ptr<Region>(region)));
_last_capture_regions.push_back (region);
return;
}
- if (yn && channels.reader()->front()->source == 0) {
-
- /* pick up connections not initiated *from* the IO object
- we're associated with.
- */
-
- get_input_sources ();
- }
-
/* yes, i know that this not proof against race conditions, but its
good enough. i think.
*/
if (_session.config.get_punch_in() && ((pi = _session.locations()->auto_punch_location()) != 0)) {
snprintf (buf, sizeof (buf), "%" PRId64, pi->start());
} else {
- snprintf (buf, sizeof (buf), "%" PRIu32, _session.transport_frame());
+ snprintf (buf, sizeof (buf), "%" PRId64, _session.transport_frame());
}
cs_child->add_property (X_("at"), buf);
/* do not remove destructive files even if they are empty */
chan->write_source->set_allow_remove_if_empty (!destructive());
+
+ /* until we write, this file is considered removable */
+
+ chan->write_source->mark_for_remove ();
return 0;
}
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
if ((*chan)->write_source != 0) {
- (*chan)->write_source->set_source_name (_name, destructive());
+ (*chan)->write_source->set_source_name (_name.get(), destructive());
/* XXX what to do if one of them fails ? */
}
}
{
/* make sure the wrap buffer is at least large enough to deal
with the speeds up to 1.2, to allow for micro-variation
- when slaving to MTC, SMPTE etc.
+ when slaving to MTC, Timecode etc.
*/
double sp = max (fabsf (_actual_speed), 1.2f);
int
AudioDiskstream::add_channel_to (boost::shared_ptr<ChannelList> c, uint32_t how_many)
{
-
while (how_many--) {
- c->push_back (new ChannelInfo(_session.audio_diskstream_buffer_size(), speed_buffer_size, wrap_buffer_size));
- interpolation.add_channel_to (_session.audio_diskstream_buffer_size(), speed_buffer_size);
+ c->push_back (new ChannelInfo(_session.butler()->audio_diskstream_buffer_size(), speed_buffer_size, wrap_buffer_size));
+ interpolation.add_channel_to (_session.butler()->audio_diskstream_buffer_size(), speed_buffer_size);
}
_n_channels.set(DataType::AUDIO, c->size());
try {
fs = boost::dynamic_pointer_cast<AudioFileSource> (
SourceFactory::createWritable (DataType::AUDIO, _session,
- prop->value(), true,
- false, _session.frame_rate()));
+ prop->value(), false, _session.frame_rate()));
}
catch (failed_constructor& err) {
first_fs = fs;
}
- fs->set_captured_for (_name);
+ fs->set_captured_for (_name.get());
}
}
assert (afirst);
- if (afirst->source()->used() > 1) {
+ if (_session.playlists->source_use_count (afirst->source()) > 1) {
requires_bounce = true;
return false;
}