mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 20:55:48 +01:00
fix for erroneous use of a menu group; remove lots of cerr cruft; no playlist ops for destructive tracks
git-svn-id: svn://localhost/trunk/ardour2@359 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0d2c8771a7
commit
10976e9a3b
10 changed files with 45 additions and 99 deletions
|
|
@ -511,17 +511,15 @@ class Session : public sigc::trackable, public Stateful
|
|||
sigc::signal<void,RouteGroup*> edit_group_added;
|
||||
sigc::signal<void,RouteGroup*> mix_group_added;
|
||||
|
||||
template<class T> void foreach_edit_group (T *obj, void (T::*func)(RouteGroup *)) {
|
||||
list<RouteGroup *>::iterator i;
|
||||
for (i = edit_groups.begin(); i != edit_groups.end(); i++) {
|
||||
(obj->*func)(*i);
|
||||
void foreach_edit_group (sigc::slot<void,RouteGroup*> sl) {
|
||||
for (list<RouteGroup *>::iterator i = edit_groups.begin(); i != edit_groups.end(); i++) {
|
||||
sl (*i);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T> void foreach_mix_group (T *obj, void (T::*func)(RouteGroup *)) {
|
||||
list<RouteGroup *>::iterator i;
|
||||
for (i = mix_groups.begin(); i != mix_groups.end(); i++) {
|
||||
(obj->*func)(*i);
|
||||
void foreach_mix_group (sigc::slot<void,RouteGroup*> sl) {
|
||||
for (list<RouteGroup *>::iterator i = mix_groups.begin(); i != mix_groups.end(); i++) {
|
||||
sl (*i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,6 @@ AudioTrack::AudioTrack (Session& sess, string name, Route::Flag flag, TrackMode
|
|||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -406,6 +406,10 @@ DiskStream::use_new_playlist ()
|
|||
string newname;
|
||||
AudioPlaylist* playlist;
|
||||
|
||||
if (!in_set_state && destructive()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_playlist) {
|
||||
newname = Playlist::bump_name (_playlist->name(), _session);
|
||||
} else {
|
||||
|
|
@ -423,6 +427,10 @@ DiskStream::use_new_playlist ()
|
|||
int
|
||||
DiskStream::use_copy_playlist ()
|
||||
{
|
||||
if (destructive()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_playlist == 0) {
|
||||
error << string_compose(_("DiskStream %1: there is no existing playlist to make a copy of!"), _name) << endmsg;
|
||||
return -1;
|
||||
|
|
@ -663,8 +671,6 @@ DiskStream::check_record_status (jack_nframes_t transport_frame, jack_nframes_t
|
|||
}
|
||||
|
||||
if (_flags & Recordable) {
|
||||
cerr << "START RECORD @ " << capture_start_frame << endl;
|
||||
|
||||
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
|
||||
|
||||
RingBufferNPT<CaptureTransition>::rw_vector transvec;
|
||||
|
|
@ -677,7 +683,8 @@ DiskStream::check_record_status (jack_nframes_t transport_frame, jack_nframes_t
|
|||
}
|
||||
else {
|
||||
// bad!
|
||||
cerr << "capture_transition_buf is full on rec start! inconceivable!" << endl;
|
||||
fatal << X_("programming error: capture_transition_buf is full on rec start! inconceivable!")
|
||||
<< endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1562,10 +1569,8 @@ DiskStream::do_flush (char * workbuf, bool force_flush)
|
|||
|
||||
if (captrans.type == CaptureStart) {
|
||||
// by definition, the first data we got above represents the given capture pos
|
||||
cerr << "DS " << name() << " got CaptureStart at " << captrans.capture_val << endl;
|
||||
|
||||
(*chan).write_source->mark_capture_start (captrans.capture_val);
|
||||
|
||||
(*chan).curr_capture_cnt = 0;
|
||||
|
||||
have_start = true;
|
||||
|
|
@ -1576,18 +1581,8 @@ DiskStream::do_flush (char * workbuf, bool force_flush)
|
|||
|
||||
if (captrans.capture_val <= (*chan).curr_capture_cnt + to_write) {
|
||||
|
||||
cerr << "DS " << name() << " got CaptureEnd with " << captrans.capture_val << endl;
|
||||
// shorten to make the write a perfect fit
|
||||
uint32_t nto_write = (captrans.capture_val - (*chan).curr_capture_cnt);
|
||||
if (have_start) {
|
||||
// starts and ends within same chunk we're processing
|
||||
cerr << "Starts and ends within same chunk: adjusting to_write from: "
|
||||
<< to_write << " to: " << nto_write << endl;
|
||||
}
|
||||
else {
|
||||
cerr << "Ends within chunk: adjusting to_write to: "
|
||||
<< to_write << " to: " << nto_write << endl;
|
||||
}
|
||||
|
||||
if (nto_write < to_write) {
|
||||
ret = 1; // should we?
|
||||
|
|
@ -1602,8 +1597,6 @@ DiskStream::do_flush (char * workbuf, bool force_flush)
|
|||
}
|
||||
else {
|
||||
// actually ends just beyond this chunk, so force more work
|
||||
cerr << "DS " << name() << " got CaptureEnd beyond our chunk, cnt of: "
|
||||
<< captrans.capture_val << " leaving on queue" << endl;
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1856,8 +1849,7 @@ DiskStream::finish_capture (bool rec_monitors_input)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((_flags & Recordable) && destructive()) {
|
||||
cerr << "RECORD END @ " << capture_start_frame + capture_captured << endl;
|
||||
if (recordable() && destructive()) {
|
||||
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
|
||||
|
||||
RingBufferNPT<CaptureTransition>::rw_vector transvec;
|
||||
|
|
@ -1971,10 +1963,6 @@ DiskStream::get_state ()
|
|||
char buf[64];
|
||||
LocaleGuard lg (X_("POSIX"));
|
||||
|
||||
if (destructive()) {
|
||||
node->add_property ("destructive", "true");
|
||||
}
|
||||
|
||||
snprintf (buf, sizeof(buf), "%zd", channels.size());
|
||||
node->add_property ("channels", buf);
|
||||
|
||||
|
|
@ -2049,12 +2037,6 @@ DiskStream::set_state (const XMLNode& node)
|
|||
_name = prop->value();
|
||||
}
|
||||
|
||||
if ((prop = node.property ("destructive")) != 0) {
|
||||
if (prop->value() == "true") {
|
||||
_flags |= Destructive;
|
||||
}
|
||||
}
|
||||
|
||||
if (deprecated_io_node) {
|
||||
if ((prop = deprecated_io_node->property ("id")) != 0) {
|
||||
sscanf (prop->value().c_str(), "%" PRIu64, &_id);
|
||||
|
|
@ -2129,17 +2111,14 @@ DiskStream::set_state (const XMLNode& node)
|
|||
|
||||
in_set_state = false;
|
||||
|
||||
/* now that we're all done with playlist+channel set up,
|
||||
go ahead and create write sources.
|
||||
*/
|
||||
|
||||
/* make sure this is clear before we do anything else */
|
||||
|
||||
capturing_sources.clear ();
|
||||
|
||||
if (recordable() && !destructive()) {
|
||||
/* destructive diskstreams get their sources set up elsewhere */
|
||||
reset_write_sources (false);
|
||||
}
|
||||
/* write sources are handled elsewhere;
|
||||
for destructive tracks: in {setup,use}_destructive_playlist()
|
||||
for non-destructive: when we handle the input set up of the IO that owns this DS
|
||||
*/
|
||||
|
||||
in_set_state = false;
|
||||
|
||||
|
|
@ -2184,8 +2163,6 @@ DiskStream::use_new_write_source (uint32_t n)
|
|||
return -1;
|
||||
}
|
||||
|
||||
cerr << _name << " using a new source " << chan.write_source << " for channel " << n << endl;
|
||||
|
||||
chan.write_source->use ();
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue