#include <ardour/panner.h>
#include <ardour/utils.h>
-
-
#include "i18n.h"
using namespace std;
-//using namespace sigc;
using namespace ARDOUR;
AudioTrack::AudioTrack (Session& sess, string name, Route::Flag flag, TrackMode mode)
if (mode == Destructive) {
dflags = DiskStream::Flag (dflags | DiskStream::Destructive);
- }
+ cerr << "Creating a new audio track, destructive mode\n";
+ } else {
+ cerr << "Creating a new audio track, NOT destructive mode\n";
+ }
DiskStream* ds = new DiskStream (_session, name, dflags);
(*chan).capture_buf->reset ();
if (destructive()) {
DestructiveFileSource* dfs = dynamic_cast<DestructiveFileSource*> ((*chan).write_source);
- dfs->seek (frame);
+ if (dfs) {
+ dfs->seek (frame);
+ }
}
}
}
if (!force && destructive()) {
- return;
+
+ /* make sure we always have enough sources for the current channel count */
+
+ for (chan = channels.begin(), n = 0; chan != channels.end(); ++chan, ++n) {
+ if ((*chan).write_source == 0) {
+ break;
+ }
+ }
+
+ if (chan == channels.end()) {
+ return;
+ }
+
+ /* some channels do not have a write source */
}
capturing_sources.clear ();
case ErrorMessage:
process_error_message (req->chn, req->msg);
free (const_cast<char*>(req->msg)); /* it was strdup'ed */
+ req->msg = 0; /* don't free it again in the destructor */
break;
case Quit:
abort ();
}
- // cerr << "thread " << pthread_self() << " sent request " << req << " type = " << req->type << endl;
+ cerr << "thread " << pthread_self() << " sent request " << req << " type = " << req->type << endl;
rbuf->increment_write_ptr (1);
write (signal_pipe[1], &c, 1);
}