X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fmidi_playlist_source.cc;h=68e0a478dff7c95f98a1052b08002a8c396136df;hb=ef0c4ed0e6907ff7cc0c9f139495619a9f242ff5;hp=713aadf5b1f0eb77dd647bf34834972122ab5032;hpb=489d2ba1a76c64a935808591571ca63a053172c8;p=ardour.git diff --git a/libs/ardour/midi_playlist_source.cc b/libs/ardour/midi_playlist_source.cc index 713aadf5b1..68e0a478df 100644 --- a/libs/ardour/midi_playlist_source.cc +++ b/libs/ardour/midi_playlist_source.cc @@ -20,25 +20,10 @@ #include "libardour-config.h" #endif -#include -#include - -#include -#include - #include "pbd/error.h" -#include "pbd/convert.h" -#include "pbd/enumwriter.h" #include "ardour/midi_playlist.h" #include "ardour/midi_playlist_source.h" -#include "ardour/midi_region.h" -#include "ardour/debug.h" -#include "ardour/filename_extensions.h" -#include "ardour/session.h" -#include "ardour/session_directory.h" -#include "ardour/session_playlists.h" -#include "ardour/source_factory.h" #include "i18n.h" @@ -46,11 +31,33 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -MidiPlaylistSource::MidiPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr p, - uint32_t chn, frameoffset_t begin, framecnt_t len, Source::Flag flags) - : Source (s, DataType::AUDIO, name) +namespace ARDOUR { +class MidiStateTracker; +class Session; +template class MidiRingBuffer; +} + +namespace Evoral { +template class EventSink; +template class Event; +} + +/******************************************************************************* +As of May 2011, it appears too complex to support compound regions for MIDI +because of the need to be able to edit the data represented by the region. It +seems that it would be a better idea to render the consituent regions into a +new MIDI file and create a new region based on that, an operation we have been +calling "consolidate" + +This code has been in place as a stub in case anyone gets any brilliant ideas +on other ways to approach this issue. +********************************************************************************/ + +MidiPlaylistSource::MidiPlaylistSource (Session& s, const ID& orig, const std::string& name, boost::shared_ptr p, + uint32_t /*chn*/, frameoffset_t begin, framecnt_t len, Source::Flag flags) + : Source (s, DataType::MIDI, name) , MidiSource (s, name, flags) - , PlaylistSource (s, orig, name, p, DataType::AUDIO, begin, len, flags) + , PlaylistSource (s, orig, name, p, DataType::MIDI, begin, len, flags) { } @@ -65,7 +72,7 @@ MidiPlaylistSource::MidiPlaylistSource (Session& s, const XMLNode& node) /* ancestors have already called ::set_state() in their XML-based constructors. */ - + if (set_state (node, Stateful::loading_state_version, false)) { throw failed_constructor (); } @@ -87,18 +94,17 @@ MidiPlaylistSource::get_state () return node; } - int -MidiPlaylistSource::set_state (const XMLNode& node, int version) +MidiPlaylistSource::set_state (const XMLNode& node, int version) { return set_state (node, version, true); } int -MidiPlaylistSource::set_state (const XMLNode& node, int version, bool with_descendants) +MidiPlaylistSource::set_state (const XMLNode& node, int version, bool with_descendants) { if (with_descendants) { - if (Source::set_state (node, version) || + if (Source::set_state (node, version) || MidiSource::set_state (node, version) || PlaylistSource::set_state (node, version)) { return -1; @@ -115,11 +121,11 @@ MidiPlaylistSource::length (framepos_t) const return extent.second - extent.first; } -framepos_t +framecnt_t MidiPlaylistSource::read_unlocked (Evoral::EventSink& dst, - framepos_t position, + framepos_t /*position*/, framepos_t start, framecnt_t cnt, - MidiStateTracker* tracker) const + MidiStateTracker*) const { boost::shared_ptr mp = boost::dynamic_pointer_cast (_playlist); @@ -130,42 +136,40 @@ MidiPlaylistSource::read_unlocked (Evoral::EventSink& dst, return mp->read (dst, start, cnt); } -framepos_t -MidiPlaylistSource::write_unlocked (MidiRingBuffer& dst, - framepos_t position, - framecnt_t cnt) +framecnt_t +MidiPlaylistSource::write_unlocked (MidiRingBuffer&, + framepos_t, + framecnt_t) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::write_unlocked() called - should be impossible") << endmsg; /*NOTREACHED*/ return 0; } -void +void MidiPlaylistSource::append_event_unlocked_beats(const Evoral::Event& /*ev*/) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_beats() called - should be impossible") << endmsg; /*NOTREACHED*/ } -void -MidiPlaylistSource::append_event_unlocked_frames(const Evoral::Event& ev, framepos_t source_start) +void +MidiPlaylistSource::append_event_unlocked_frames(const Evoral::Event& /* ev */, framepos_t /*source_start*/) { fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_frames() called - should be impossible") << endmsg; /*NOTREACHED*/ } void -MidiPlaylistSource::load_model (bool, bool) +MidiPlaylistSource::load_model (bool, bool) { - fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::load_model() called - should be impossible") << endmsg; - /*NOTREACHED*/ + /* nothing to do */ } void -MidiPlaylistSource::destroy_model () +MidiPlaylistSource::destroy_model () { - fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::destroy_model() called - should be impossible") << endmsg; - /*NOTREACHED*/ + /* nothing to do */ } void