diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-25 14:37:20 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-11-25 14:37:20 +0000 |
commit | 926f53244df3d0f43f647f93ee091378ebe101d6 (patch) | |
tree | 4849d5a55869ea3242af40eadd39a053c89c2543 /libs/ardour | |
parent | f41f07832338a52d7c6ac8f6e7bbe4971f6c0bd3 (diff) |
carl's wondrous DnD VBox patch - processor boxes are now vboxes and not listviews - which included a couple of minor marker/time axis view patches for opaqueness etc.
git-svn-id: svn://localhost/ardour2/branches/3.0@6174 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 7 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 5 | ||||
-rw-r--r-- | libs/ardour/audiofilesource.cc | 5 | ||||
-rw-r--r-- | libs/ardour/audiosource.cc | 2 | ||||
-rw-r--r-- | libs/ardour/diskstream.cc | 2 | ||||
-rw-r--r-- | libs/ardour/file_source.cc | 4 | ||||
-rw-r--r-- | libs/ardour/region.cc | 2 | ||||
-rw-r--r-- | libs/ardour/send.cc | 1 | ||||
-rw-r--r-- | libs/ardour/session.cc | 85 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 8 | ||||
-rw-r--r-- | libs/ardour/source.cc | 2 | ||||
-rw-r--r-- | libs/ardour/source_factory.cc | 43 |
12 files changed, 109 insertions, 57 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 3248cd9b2d..faa4684745 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -122,6 +122,8 @@ AudioDiskstream::init (Diskstream::Flag f) AudioDiskstream::~AudioDiskstream () { + cerr << "AD going away\n"; + notify_callbacks (); { @@ -1915,6 +1917,11 @@ AudioDiskstream::use_new_write_source (uint32_t n) /* 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 (); + cerr << "New write source " << chan->write_source->path() << " flags " << enum_2_string (chan->write_source->flags()) << endl; return 0; } diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index e2101479fe..1a92cd5459 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -23,6 +23,7 @@ #include "pbd/error.h" #include "pbd/enumwriter.h" +#include "pbd/boost_debug.h" #include "evoral/Curve.hpp" @@ -83,8 +84,8 @@ AudioTrack::use_new_diskstream () dflags = AudioDiskstream::Flag(dflags | AudioDiskstream::NonLayered); } - - boost::shared_ptr<AudioDiskstream> ds (new AudioDiskstream (_session, name(), dflags)); + AudioDiskstream* dsp (new AudioDiskstream (_session, name(), dflags)); + boost::shared_ptr<AudioDiskstream> ds (dsp); _session.add_diskstream (ds); diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc index 8de786eb0e..e9eb3641da 100644 --- a/libs/ardour/audiofilesource.cc +++ b/libs/ardour/audiofilesource.cc @@ -99,6 +99,7 @@ AudioFileSource::AudioFileSource (Session& s, const ustring& path, bool embedded if (init (path, true)) { throw failed_constructor (); } + cerr << "AFS1 created, " << path << endl; } /** Constructor used for new internal-to-session files. */ @@ -113,6 +114,7 @@ AudioFileSource::AudioFileSource (Session& s, const ustring& path, bool embedded if (init (path, false)) { throw failed_constructor (); } + cerr << "AFS2 created, " << path << endl; } /** Constructor used for existing internal-to-session files. File must exist. */ @@ -128,11 +130,14 @@ AudioFileSource::AudioFileSource (Session& s, const XMLNode& node, bool must_exi if (init (_name, must_exist)) { throw failed_constructor (); } + cerr << "AFS3 created, " << path() << endl; } AudioFileSource::~AudioFileSource () { + cerr << "AFS " << _name << " destructor, path = " << path() << endl; if (removable()) { + cerr << "\tremoving file\n"; unlink (_path.c_str()); unlink (peakpath.c_str()); } diff --git a/libs/ardour/audiosource.cc b/libs/ardour/audiosource.cc index 883bc0b41b..f7d6088aec 100644 --- a/libs/ardour/audiosource.cc +++ b/libs/ardour/audiosource.cc @@ -276,6 +276,8 @@ nframes_t AudioSource::write (Sample *dst, nframes_t cnt) { Glib::Mutex::Lock lm (_lock); + /* any write makes the fill not removable */ + _flags = Flag (_flags & ~Removable); return write_unlocked (dst, cnt); } diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index 0d27cb508a..b6cc9d6a04 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -41,6 +41,7 @@ #include "ardour/ardour.h" #include "ardour/audioengine.h" +#include "ardour/debug.h" #include "ardour/diskstream.h" #include "ardour/utils.h" #include "ardour/configuration.h" @@ -130,6 +131,7 @@ Diskstream::~Diskstream () { if (_playlist) _playlist->release (); + DEBUG_TRACE (DEBUG::Destruction, string_compose ("Diskstream %1 deleted\n", _name)); } void diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index e5232f2384..6ebbf0b523 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -77,8 +77,8 @@ bool FileSource::removable () const { return (_flags & Removable) - && ( (_flags & RemoveAtDestroy) - || ((_flags & RemovableIfEmpty) && length(timeline_position()) == 0)); + && ((_flags & RemoveAtDestroy) || + ((_flags & RemovableIfEmpty) && length(timeline_position()) == 0)); } int diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 20c87fb1de..c59a5bb562 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -31,6 +31,7 @@ #include "pbd/stacktrace.h" #include "pbd/enumwriter.h" +#include "ardour/debug.h" #include "ardour/region.h" #include "ardour/playlist.h" #include "ardour/session.h" @@ -340,6 +341,7 @@ Region::~Region () { notify_callbacks (); GoingAway (); /* EMIT SIGNAL */ + DEBUG_TRACE (DEBUG::Destruction, string_compose ("Region %1 deleted\n", _name)); } void diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 3039a7fc3b..91e6827e61 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -163,6 +163,7 @@ Send::set_state (const XMLNode& node, int version) _bitslot = _session.next_send_id(); } else { sscanf (prop->value().c_str(), "%" PRIu32, &_bitslot); + cerr << this << " scanned " << prop->value() << " to get " << _bitslot << endl; _session.mark_send_id (_bitslot); } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index ce1fbca846..febaf6ed11 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -37,6 +37,7 @@ #include "pbd/error.h" #include <glibmm/thread.h> +#include "pbd/boost_debug.h" #include "pbd/pathscanner.h" #include "pbd/stl_delete.h" #include "pbd/basename.h" @@ -62,6 +63,7 @@ #include "ardour/crossfade.h" #include "ardour/cycle_timer.h" #include "ardour/data_type.h" +#include "ardour/debug.h" #include "ardour/filename_extensions.h" #include "ardour/internal_send.h" #include "ardour/io_processor.h" @@ -329,6 +331,8 @@ Session::~Session () void Session::destroy () { + vector<void*> debug_pointers; + /* if we got to here, leaving pending capture state around is a mistake. */ @@ -378,10 +382,7 @@ Session::destroy () Route::SyncOrderKeys.clear(); -#undef TRACK_DESTRUCTION -#ifdef TRACK_DESTRUCTION - cerr << "delete named selections\n"; -#endif /* TRACK_DESTRUCTION */ + DEBUG_TRACE (DEBUG::Destruction, "delete named selections\n"); for (NamedSelectionList::iterator i = named_selections.begin(); i != named_selections.end(); ) { NamedSelectionList::iterator tmp; @@ -392,16 +393,16 @@ Session::destroy () i = tmp; } -#ifdef TRACK_DESTRUCTION - cerr << "delete playlists\n"; -#endif /* TRACK_DESTRUCTION */ + DEBUG_TRACE (DEBUG::Destruction, "delete playlists\n"); for (PlaylistList::iterator i = playlists.begin(); i != playlists.end(); ) { PlaylistList::iterator tmp; tmp = i; ++tmp; + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for used playlist %1 ; pre-ref = %2\n", (*i)->name(), (*i).use_count())); (*i)->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("post-ref = %1\n", (*i).use_count())); i = tmp; } @@ -412,7 +413,9 @@ Session::destroy () tmp = i; ++tmp; + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for unused playlist %1 ; pre-ref = %2\n", (*i)->name(), (*i).use_count())); (*i)->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("post-ref = %2\n", (*i).use_count())); i = tmp; } @@ -420,70 +423,68 @@ Session::destroy () playlists.clear (); unused_playlists.clear (); -#ifdef TRACK_DESTRUCTION - cerr << "delete regions\n"; -#endif /* TRACK_DESTRUCTION */ - + DEBUG_TRACE (DEBUG::Destruction, "delete regions\n"); for (RegionList::iterator i = regions.begin(); i != regions.end(); ) { RegionList::iterator tmp; tmp = i; ++tmp; - + + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for region %1 ; pre-ref = %2\n", i->second->name(), i->second.use_count())); i->second->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("\tpost-ref%2\n", i->second.use_count())); i = tmp; } regions.clear (); -#ifdef TRACK_DESTRUCTION - cerr << "delete routes\n"; -#endif /* TRACK_DESTRUCTION */ + DEBUG_TRACE (DEBUG::Destruction, "delete routes\n"); { RCUWriter<RouteList> writer (routes); boost::shared_ptr<RouteList> r = writer.get_copy (); for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for route %1 ; pre-ref = %2\n", (*i)->name(), (*i).use_count())); (*i)->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("post-ref = %1\n", (*i).use_count())); + debug_pointers.push_back ((*i).get()); } r->clear (); /* writer goes out of scope and updates master */ } - routes.flush (); -#ifdef TRACK_DESTRUCTION - cerr << "delete diskstreams\n"; -#endif /* TRACK_DESTRUCTION */ - { - RCUWriter<DiskstreamList> dwriter (diskstreams); - boost::shared_ptr<DiskstreamList> dsl = dwriter.get_copy(); - for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) { - (*i)->drop_references (); - } - dsl->clear (); - } - diskstreams.flush (); - -#ifdef TRACK_DESTRUCTION - cerr << "delete audio sources\n"; -#endif /* TRACK_DESTRUCTION */ + DEBUG_TRACE (DEBUG::Destruction, "delete diskstreams\n"); + { + RCUWriter<DiskstreamList> dwriter (diskstreams); + boost::shared_ptr<DiskstreamList> dsl = dwriter.get_copy(); + for (DiskstreamList::iterator i = dsl->begin(); i != dsl->end(); ++i) { + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for diskstream %1 ; pre-ref = %2\n", (*i)->name(), (*i).use_count())); + (*i)->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("post-ref = %1\n", (*i).use_count())); + } + dsl->clear (); + } + diskstreams.flush (); + + DEBUG_TRACE (DEBUG::Destruction, "delete sources\n"); for (SourceMap::iterator i = sources.begin(); i != sources.end(); ) { SourceMap::iterator tmp; tmp = i; ++tmp; + DEBUG_TRACE(DEBUG::Destruction, string_compose ("Dropping for source %1 ; pre-ref = %2\n", i->second->path(), i->second.use_count())); i->second->drop_references (); + DEBUG_TRACE(DEBUG::Destruction, string_compose ("\tpost-ref%1\n", i->second.use_count())); i = tmp; } + cerr << "Pre source clear, we have " << sources.size() << endl; sources.clear (); + cerr << "Post source clear, we have " << sources.size() << endl; - -#ifdef TRACK_DESTRUCTION - cerr << "delete route groups\n"; -#endif /* TRACK_DESTRUCTION */ + DEBUG_TRACE (DEBUG::Destruction, "delete route groups\n"); for (list<RouteGroup *>::iterator i = _route_groups.begin(); i != _route_groups.end(); ++i) { delete *i; } @@ -491,6 +492,10 @@ Session::destroy () Crossfade::set_buffer_size (0); delete mmc; + + for (vector<void*>::iterator x = debug_pointers.begin(); x != debug_pointers.end(); ++x) { + boost_debug_shared_ptr_show (cerr, *x); + } } void @@ -1769,7 +1774,9 @@ Session::new_audio_track (int input_channels, int output_channels, TrackMode mod shared_ptr<AudioTrack> track; try { - track = boost::shared_ptr<AudioTrack>((new AudioTrack (*this, track_name, Route::Flag (0), mode))); + AudioTrack* at = new AudioTrack (*this, track_name, Route::Flag (0), mode); + boost_debug_shared_ptr_mark_interesting (at, typeid (at).name()); + track = boost::shared_ptr<AudioTrack>(at); if (track->input()->ensure_io (ChanCount(DataType::AUDIO, input_channels), false, this)) { error << string_compose (_("cannot configure %1 in/%2 out configuration for new audio track"), @@ -3330,9 +3337,9 @@ Session::create_audio_source_for_session (AudioDiskstream& ds, uint32_t chan, bo const size_t n_chans = ds.n_channels().n_audio(); const string name = new_audio_source_name (ds.name(), n_chans, chan, destructive); const string path = new_source_path_from_name(DataType::AUDIO, name); + return boost::dynamic_pointer_cast<AudioFileSource> ( - SourceFactory::createWritable ( - DataType::AUDIO, *this, path, true, destructive, frame_rate())); + SourceFactory::createWritable (DataType::AUDIO, *this, path, true, destructive, frame_rate())); } /** Return a unique name based on \a base for a new internal MIDI source */ diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 2e564b7eee..f53dd7106e 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -57,6 +57,7 @@ #include "midi++/mmc.h" #include "midi++/port.h" +#include "pbd/boost_debug.h" #include "pbd/error.h" #include "pbd/pathscanner.h" #include "pbd/pthread_utils.h" @@ -567,7 +568,8 @@ Session::load_diskstreams (const XMLNode& node) try { /* diskstreams added automatically by DiskstreamCreated handler */ if ((*citer)->name() == "AudioDiskstream" || (*citer)->name() == "DiskStream") { - boost::shared_ptr<AudioDiskstream> dstream (new AudioDiskstream (*this, **citer)); + AudioDiskstream* dsp (new AudioDiskstream (*this, **citer)); + boost::shared_ptr<AudioDiskstream> dstream (dsp); add_diskstream (dstream); } else if ((*citer)->name() == "MidiDiskstream") { boost::shared_ptr<MidiDiskstream> dstream (new MidiDiskstream (*this, **citer)); @@ -1402,7 +1404,9 @@ Session::XMLRouteFactory (const XMLNode& node, int version) if (has_diskstream) { if (type == DataType::AUDIO) { - boost::shared_ptr<Route> ret (new AudioTrack (*this, node, version)); + AudioTrack* at = new AudioTrack (*this, node, version); + boost_debug_shared_ptr_mark_interesting (at, typeid (at).name()); + boost::shared_ptr<Route> ret (at); return ret; } else { boost::shared_ptr<Route> ret (new MidiTrack (*this, node, version)); diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc index 394d4b39af..10b7ead270 100644 --- a/libs/ardour/source.cc +++ b/libs/ardour/source.cc @@ -36,6 +36,7 @@ #include "pbd/pthread_utils.h" #include "pbd/enumwriter.h" +#include "ardour/debug.h" #include "ardour/session.h" #include "ardour/source.h" #include "ardour/transient_detector.h" @@ -75,6 +76,7 @@ Source::Source (Session& s, const XMLNode& node) Source::~Source () { notify_callbacks (); + DEBUG_TRACE (DEBUG::Destruction, string_compose ("Source %1 deleted\n", _name)); } diff --git a/libs/ardour/source_factory.cc b/libs/ardour/source_factory.cc index 198a429c5d..999ae667dd 100644 --- a/libs/ardour/source_factory.cc +++ b/libs/ardour/source_factory.cc @@ -22,6 +22,7 @@ #include "libardour-config.h" #endif +#include "pbd/boost_debug.h" #include "pbd/error.h" #include "pbd/convert.h" #include "pbd/pthread_utils.h" @@ -122,7 +123,9 @@ SourceFactory::setup_peakfile (boost::shared_ptr<Source> s, bool async) boost::shared_ptr<Source> SourceFactory::createSilent (Session& s, const XMLNode& node, nframes_t nframes, float sr) { - boost::shared_ptr<Source> ret (new SilentFileSource (s, node, nframes, sr)); + Source* src = new SilentFileSource (s, node, nframes, sr); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); // no analysis data - the file is non-existent SourceCreated (ret); return ret; @@ -142,7 +145,9 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) try { - boost::shared_ptr<Source> ret (new SndFileSource (s, node)); + Source* src = new SndFileSource (s, node); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); if (setup_peakfile (ret, defer_peaks)) { return boost::shared_ptr<Source>(); } @@ -157,7 +162,9 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) /* this is allowed to throw */ - boost::shared_ptr<Source> ret (new CoreAudioSource (s, node)); + Source *s = new CoreAudioSource (s, node); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); if (setup_peakfile (ret, defer_peaks)) { return boost::shared_ptr<Source>(); @@ -172,7 +179,9 @@ SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks) } } else if (type == DataType::MIDI) { - boost::shared_ptr<Source> ret (new SMFSource (s, node)); + Source* src = new SMFSource (s, node); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); ret->check_for_analysis_data_on_disk (); SourceCreated (ret); return ret; @@ -191,8 +200,10 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo try { - boost::shared_ptr<Source> ret (new SndFileSource (s, path, embedded, chn, flags)); - + Source* src = new SndFileSource (s, path, embedded, chn, flags); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); + if (setup_peakfile (ret, defer_peaks)) { return boost::shared_ptr<Source>(); } @@ -207,7 +218,9 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo catch (failed_constructor& err) { #ifdef USE_COREAUDIO_FOR_FILES - boost::shared_ptr<Source> ret (new CoreAudioSource (s, path, embedded, chn, flags)); + Source* src = new CoreAudioSource (s, path, embedded, chn, flags); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); if (setup_peakfile (ret, defer_peaks)) { return boost::shared_ptr<Source>(); } @@ -227,8 +240,10 @@ SourceFactory::createReadable (DataType type, Session& s, const string& path, bo } } else if (type == DataType::MIDI) { - - boost::shared_ptr<Source> ret (new SMFSource (s, path, embedded, SMFSource::Flag(0))); + + Source* src = new SMFSource (s, path, embedded, SMFSource::Flag(0)); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); if (announce) { SourceCreated (ret); @@ -248,13 +263,15 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat /* this might throw failed_constructor(), which is OK */ if (type == DataType::AUDIO) { - boost::shared_ptr<Source> ret (new SndFileSource (s, path, embedded, + Source* src = new SndFileSource (s, path, embedded, s.config.get_native_file_data_format(), s.config.get_native_file_header_format(), rate, (destructive ? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive) - : SndFileSource::default_writable_flags))); + : SndFileSource::default_writable_flags)); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); if (setup_peakfile (ret, defer_peaks)) { return boost::shared_ptr<Source>(); @@ -269,7 +286,9 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat } else if (type == DataType::MIDI) { - boost::shared_ptr<Source> ret (new SMFSource (s, path, embedded, Source::Flag(0))); + Source* src = new SMFSource (s, path, embedded, Source::Flag(0)); + // boost_debug_shared_ptr_mark_interesting (src, typeid(src).name()); + boost::shared_ptr<Source> ret (src); // no analysis data - this is a new file |