do not offer combine operation for MIDI (see comment in libs/ardour/midi_playlist_sou...
[ardour.git] / libs / ardour / audio_playlist_source.cc
index 09b30ff87a628434b3d752673b0c9fd70159add0..eb71dc449b8f54007c144f4f40330aea94d4cd01 100644 (file)
@@ -49,8 +49,8 @@ using namespace PBD;
 AudioPlaylistSource::AudioPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr<AudioPlaylist> p, 
                                          uint32_t chn, frameoffset_t begin, framecnt_t len, Source::Flag flags)
        : Source (s, DataType::AUDIO, name)
-       , AudioSource (s, name)
        , PlaylistSource (s, orig, name, p, DataType::AUDIO, begin, len, flags)
+       , AudioSource (s, name)
        , _playlist_channel (chn)
 {
        AudioSource::_length = len;
@@ -59,8 +59,8 @@ AudioPlaylistSource::AudioPlaylistSource (Session& s, const ID& orig, const std:
 
 AudioPlaylistSource::AudioPlaylistSource (Session& s, const XMLNode& node)
        : Source (s, node)
-       , AudioSource (s, node)
        , PlaylistSource (s, node)
+       , AudioSource (s, node)
 {
        /* PlaylistSources are never writable, renameable, removable or destructive */
        _flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive));
@@ -93,7 +93,6 @@ AudioPlaylistSource::get_state ()
 
        return node;
 }
-
        
 int
 AudioPlaylistSource::set_state (const XMLNode& node, int version) 
@@ -106,8 +105,8 @@ AudioPlaylistSource::set_state (const XMLNode& node, int version, bool with_desc
 {
        if (with_descendants) {
                if (Source::set_state (node, version) || 
-                   AudioSource::set_state (node, version) ||
-                   PlaylistSource::set_state (node, version)) {
+                   PlaylistSource::set_state (node, version) ||
+                   AudioSource::set_state (node, version)) {
                        return -1;
                }
        }
@@ -130,8 +129,8 @@ AudioPlaylistSource::set_state (const XMLNode& node, int version, bool with_desc
 framecnt_t 
 AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cnt) const
 {
-       Sample* sbuf;
-       gain_t* gbuf;
+       boost::shared_ptr<Sample> sbuf;
+       boost::shared_ptr<gain_t> gbuf;
        framecnt_t to_read;
        framecnt_t to_zero;
        pair<framepos_t,framepos_t> extent = _playlist->get_extent();
@@ -160,7 +159,7 @@ AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cn
                gbuf = _gain_buffers[_level-1];
        }
 
-       boost::dynamic_pointer_cast<AudioPlaylist>(_playlist)->read (dst, sbuf, gbuf, start+_playlist_offset, to_read, _playlist_channel);
+       boost::dynamic_pointer_cast<AudioPlaylist>(_playlist)->read (dst, sbuf.get(), gbuf.get(), start+_playlist_offset, to_read, _playlist_channel);
 
        if (to_zero) {
                memset (dst+to_read, 0, sizeof (Sample) * to_zero);
@@ -226,3 +225,4 @@ AudioPlaylistSource::peak_path (string /*audio_path_IGNORED*/)
        return _peak_path;
 }
 
+