X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fauditioner.h;h=ffc0ddb331a7edef3aee805f05d4e9818d61f712;hb=a7431e21db0cfd570eb77cec021e7ef1d1e7115d;hp=bdd04fcc66d72f02bb4df3f62d038af00a797968;hpb=3cd8138a419cb165f56070ace0b21a1e63ec5a43;p=ardour.git diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h index bdd04fcc66..ffc0ddb331 100644 --- a/libs/ardour/ardour/auditioner.h +++ b/libs/ardour/ardour/auditioner.h @@ -25,25 +25,30 @@ #include #include "ardour/ardour.h" -#include "ardour/audio_track.h" +#include "ardour/track.h" namespace ARDOUR { class Session; +class AudioDiskstream; class AudioRegion; class AudioPlaylist; +class MidiDiskstream; +class MidiRegion; -class Auditioner : public AudioTrack +class LIBARDOUR_API Auditioner : public Track { public: Auditioner (Session&); ~Auditioner (); int init (); + int connect (); void audition_region (boost::shared_ptr); - ARDOUR::AudioPlaylist& prepare_playlist (); + void seek_to_frame (frameoffset_t pos) { if (_seek_frame < 0 && !_seeking) { _seek_frame = pos; }} + void seek_to_percent (float const pos) { if (_seek_frame < 0 && !_seeking) { _seek_frame = floorf(length * pos / 100.0); }} int play_audition (framecnt_t nframes); @@ -58,18 +63,62 @@ class Auditioner : public AudioTrack virtual ChanCount input_streams () const; + frameoffset_t seek_frame() const { return _seeking ? _seek_frame : -1;} + void seek_response(frameoffset_t pos) { + _seek_complete = true; + if (_seeking) { current_frame = pos; _seek_complete = true;} + } + + PBD::Signal2 AuditionProgress; + + /* Track */ + int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler); + DataType data_type () const; + + int roll_audio (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler); + int roll_midi (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler); + + /* fake track */ + void set_state_part_two () {} + int set_state (const XMLNode&, int) { return 0; } + bool bounceable (boost::shared_ptr, bool) const { return false; } + void freeze_me (InterThreadInfo&) {} + void unfreeze () {} + + boost::shared_ptr bounce (InterThreadInfo&) + { return boost::shared_ptr (); } + + boost::shared_ptr bounce_range (framepos_t, framepos_t, InterThreadInfo&, boost::shared_ptr, bool) + { return boost::shared_ptr (); } + + int export_stuff (BufferSet&, framepos_t, framecnt_t, boost::shared_ptr, bool, bool, bool) + { return -1; } + private: boost::shared_ptr the_region; + boost::shared_ptr midi_region; framepos_t current_frame; mutable gint _auditioning; Glib::Threads::Mutex lock; framecnt_t length; + frameoffset_t _seek_frame; + bool _seeking; + bool _seek_complete; bool via_monitor; + bool _midi_audition; + bool _synth_added; + bool _synth_changed; + bool _queue_panic; + + boost::shared_ptr asynth; void drop_ports (); + void lookup_synth (); + void config_changed (std::string); static void *_drop_ports (void *); void actually_drop_ports (); void output_changed (IOChange, void*); + frameoffset_t _import_position; }; }; /* namespace ARDOUR */