13
0

move some DEBUG::Graph traces to DEBUG::ProcessThreads ; remove Diskstream::rename_write_sources() which is no longer relevant (sources are not created on disk until needed); fixup calling Diskstream::non_realtime_input_change() when calling Diskstream::set_track() with a track that doesn't yet have any I/O (i.e. typical case)

git-svn-id: svn://localhost/ardour2/branches/3.0@9281 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2011-04-04 16:41:20 +00:00
parent 1052bc39bf
commit 040e016137
10 changed files with 25 additions and 60 deletions

View File

@ -157,7 +157,6 @@ class AudioDiskstream : public Diskstream
void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources ();
std::list<boost::shared_ptr<Source> > steal_write_sources();
void reset_write_sources (bool, bool force = false);
void non_realtime_input_change ();

View File

@ -173,7 +173,6 @@ class Diskstream : public SessionObject, public PublicDiskstream
virtual int overwrite_existing_buffers () = 0;
virtual int internal_playback_seek (framecnt_t distance) = 0;
virtual int can_internal_playback_seek (framecnt_t distance) = 0;
virtual int rename_write_sources () = 0;
virtual void reset_write_sources (bool, bool force = false) = 0;
virtual void non_realtime_input_change () = 0;

View File

@ -127,7 +127,6 @@ class MidiDiskstream : public Diskstream
void set_block_size (pframes_t);
int internal_playback_seek (framecnt_t distance);
int can_internal_playback_seek (framecnt_t distance);
int rename_write_sources ();
std::list<boost::shared_ptr<Source> > steal_write_sources();
void reset_write_sources (bool, bool force = false);
void non_realtime_input_change ();

View File

@ -1909,23 +1909,6 @@ AudioDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
}
}
int
AudioDiskstream::rename_write_sources ()
{
ChannelList::iterator chan;
boost::shared_ptr<ChannelList> c = channels.reader();
uint32_t n;
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
if ((*chan)->write_source != 0) {
(*chan)->write_source->set_source_name (_name.val(), destructive());
/* XXX what to do if one of them fails ? */
}
}
return 0;
}
void
AudioDiskstream::set_block_size (pframes_t /*nframes*/)
{

View File

@ -38,6 +38,7 @@
#include "pbd/basename.h"
#include "pbd/memento_command.h"
#include "pbd/xml++.h"
#include "pbd/stacktrace.h"
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
@ -180,8 +181,10 @@ Diskstream::set_track (Track* t)
ic_connection.disconnect();
_io->changed.connect_same_thread (ic_connection, boost::bind (&Diskstream::handle_input_change, this, _1, _2));
input_change_pending.type = IOChange::Type (IOChange::ConfigurationChanged|IOChange::ConnectionsChanged);
non_realtime_input_change ();
if (_io->n_ports() != ChanCount::ZERO) {
input_change_pending.type = IOChange::Type (IOChange::ConfigurationChanged|IOChange::ConnectionsChanged);
non_realtime_input_change ();
}
_track->Destroyed.connect_same_thread (*this, boost::bind (&Diskstream::route_going_away, this));
}
@ -454,18 +457,9 @@ Diskstream::set_name (const string& str)
if (_name != str) {
assert(playlist());
playlist()->set_name (str);
SessionObject::set_name(str);
if (!in_set_state && recordable()) {
/* rename existing capture files so that they have the correct name */
return rename_write_sources ();
} else {
return false;
}
}
return true;
return true;
}
XMLNode&

View File

@ -460,7 +460,7 @@ Graph::main_thread()
again:
_callback_start_sem.wait ();
DEBUG_TRACE(DEBUG::Graph, "main thread is awake\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread is awake\n");
if (_quit_threads) {
return;
@ -470,12 +470,12 @@ Graph::main_thread()
if (_graph_empty && !_quit_threads) {
_callback_done_sem.signal ();
DEBUG_TRACE(DEBUG::Graph, "main thread sees graph done, goes back to slee\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread sees graph done, goes back to slee\n");
goto again;
}
while (1) {
DEBUG_TRACE(DEBUG::Graph, "main thread runs one graph node\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "main thread runs one graph node\n");
if (run_one()) {
break;
}
@ -527,7 +527,7 @@ Graph::silent_process_routes (pframes_t nframes, framepos_t start_frame, framepo
_process_need_butler = false;
if (!_graph_empty) {
DEBUG_TRACE(DEBUG::Graph, "wake graph for silent process\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "wake graph for silent process\n");
_callback_start_sem.signal ();
_callback_done_sem.wait ();
}
@ -541,7 +541,7 @@ int
Graph::process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& need_butler)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
_process_nframes = nframes;
_process_start_frame = start_frame;
@ -555,11 +555,11 @@ Graph::process_routes (pframes_t nframes, framepos_t start_frame, framepos_t end
_process_retval = 0;
_process_need_butler = false;
DEBUG_TRACE(DEBUG::Graph, "wake graph for non-silent process\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "wake graph for non-silent process\n");
_callback_start_sem.signal ();
_callback_done_sem.wait ();
DEBUG_TRACE (DEBUG::Graph, "graph execution complete\n");
DEBUG_TRACE (DEBUG::ProcessThreads, "graph execution complete\n");
need_butler = _process_need_butler;
@ -570,7 +570,7 @@ int
Graph::routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool non_rt_pending, bool can_record, int declick)
{
DEBUG_TRACE (DEBUG::Graph, string_compose ("no-roll graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("no-roll graph execution from %1 to %2 = %3\n", start_frame, end_frame, nframes));
_process_nframes = nframes;
_process_start_frame = start_frame;
@ -584,7 +584,7 @@ Graph::routes_no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end
_process_retval = 0;
_process_need_butler = false;
DEBUG_TRACE(DEBUG::Graph, "wake graph for no-roll process\n");
DEBUG_TRACE(DEBUG::ProcessThreads, "wake graph for no-roll process\n");
_callback_start_sem.signal ();
_callback_done_sem.wait ();

View File

@ -443,13 +443,15 @@ write_midi_data_to_new_files (Evoral::SMF* source, ImportStatus& status,
if (status.cancel) {
break;
}
} else {
warning << string_compose (_("Track %1 of %2 contained no usable MIDI data"), i, source->file_path()) << endmsg;
}
++s; // next source
}
} catch (...) {
error << "Corrupt MIDI file " << source->file_path() << endmsg;
error << string_compose (_("MIDI file %1 was not readable (no reason available"), source->file_path()) << endmsg;
}
if (buf) {

View File

@ -36,7 +36,6 @@
#include "pbd/memento_command.h"
#include "pbd/enumwriter.h"
#include "pbd/stateful_diff_command.h"
#include "pbd/stacktrace.h"
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
@ -164,8 +163,10 @@ MidiDiskstream::non_realtime_input_change ()
if (input_change_pending.type & IOChange::ConfigurationChanged) {
if (_io->n_ports().n_midi() != _n_channels.n_midi()) {
error << "Can not feed " << _io->n_ports()
<< " ports to " << _n_channels << " channels"
error << string_compose (_("%1: I/O configuration change %4 requested to use %2, but channel setup is %3"),
name(),
_io->n_ports(),
_n_channels, input_change_pending.type)
<< endmsg;
}
}
@ -1354,16 +1355,6 @@ MidiDiskstream::reset_write_sources (bool mark_write_complete, bool /*force*/)
use_new_write_source (0);
}
int
MidiDiskstream::rename_write_sources ()
{
if (_write_source != 0) {
_write_source->set_source_name (_name.val(), destructive());
/* XXX what to do if this fails ? */
}
return 0;
}
void
MidiDiskstream::set_block_size (pframes_t /*nframes*/)
{

View File

@ -108,7 +108,7 @@ Session::no_roll (pframes_t nframes)
}
if (route_graph->threads_in_use() > 0) {
DEBUG_TRACE(DEBUG::Graph,"calling graph/no-roll\n");
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
route_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), actively_recording(), declick);
} else {
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
@ -154,7 +154,7 @@ Session::process_routes (pframes_t nframes, bool& need_butler)
tracks, the graph never gets updated.
*/
if (1 || route_graph->threads_in_use() > 0) {
DEBUG_TRACE(DEBUG::Graph,"calling graph/process-routes\n");
DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/process-routes\n");
route_graph->process_routes( nframes, start_frame, end_frame, declick, record_active, rec_monitors, need_butler);
} else {

View File

@ -180,9 +180,7 @@ Track::set_name (const string& str)
return false;
}
if (_diskstream->set_name (str)) {
return false;
}
_diskstream->set_name (str);
/* save state so that the statefile fully reflects any filename changes */