20 #include <glibmm/threads.h>
54 , _seek_complete (false)
56 , _midi_audition (false)
57 , _synth_added (false)
58 , _synth_changed (false)
59 , _queue_panic (false)
60 , _import_position (0)
92 string plugin_id =
Config->get_midi_audition_synth_uri();
94 if (!plugin_id.empty()) {
100 warning <<
_(
"Falling back to Reasonable Synth for Midi Audition") <<
endmsg;
103 Config->set_midi_audition_synth_uri(
"");
115 if (p ==
"midi-audition-synth-uri") {
123 string left =
Config->get_auditioner_output_left();
124 string right =
Config->get_auditioner_output_right();
126 vector<string> outputs;
131 if (left.empty() || left ==
"default") {
136 if (outputs.size() > 0) {
142 if (right.empty() || right ==
"default") {
147 if (outputs.size() > 1) {
155 if (left.empty() && right.empty()) {
156 if (
_output->n_ports().n_audio() == 0) {
158 warning <<
_(
"no outputs available for auditioner - manual connection required") <<
endmsg;
162 if (
_output->n_ports().n_audio() == 0) {
172 if (right.length()) {
186 oleft->connect (left);
189 oright->connect (right);
231 return roll_midi(nframes, start_frame, end_frame, declick, need_butler);
233 return roll_audio(nframes, start_frame, end_frame, declick, need_butler);
240 Glib::Threads::RWLock::ReaderLock lm (
_processor_lock, Glib::Threads::TRY_LOCK);
259 for (uint8_t chn = 0; chn < 0xf; ++chn) {
261 mbuf.push_back(0, 3, buf);
263 mbuf.push_back(0, 3, buf);
265 mbuf.push_back(0, 3, buf);
289 need_butler = diskstream->
commit (playback_distance);
296 Glib::Threads::RWLock::ReaderLock lm (
_processor_lock, Glib::Threads::TRY_LOCK);
311 _amp->apply_gain_automation(
false);
314 need_butler = diskstream->
commit (playback_distance);
320 need_butler = diskstream->
commit (playback_distance);
370 if (boost::dynamic_pointer_cast<AudioRegion>(region) != 0) {
405 }
else if (boost::dynamic_pointer_cast<MidiRegion>(region)) {
434 error <<
_(
"Failed to load synth for MIDI-Audition.") <<
endmsg;
453 error <<
_(
"Auditioning of regions other than Audio or Midi is not supported.") <<
endmsg;
489 bool need_butler =
false;
545 return need_butler ? 1 : 0;
554 vector<string> connections;
555 vector<string> outputs;
557 if (
_output->nth (0)->get_connections (connections)) {
558 if (outputs.size() > 0) {
561 if (phys != connections[0]) {
562 Config->set_auditioner_output_left (connections[0]);
564 Config->set_auditioner_output_left (
"default");
567 Config->set_auditioner_output_left (
"");
570 connections.clear ();
572 if (
_output->nth (1)->get_connections (connections)) {
573 if (outputs.size() > 1) {
576 if (phys != connections[0]) {
577 Config->set_auditioner_output_right (connections[0]);
579 Config->set_auditioner_output_right (
"default");
582 Config->set_auditioner_output_right (
"");
bool transport_rolling() const
ARDOUR::Session & _session
boost::shared_ptr< Processor > asynth
MidiBuffer & get_midi(size_t i)
boost::shared_ptr< AudioRegion > the_region
boost::shared_ptr< Delivery > _main_outs
PBD::Signal0< void > DiskstreamChanged
boost::shared_ptr< Diskstream > _diskstream_midi
boost::shared_ptr< Amp > _amp
void flush_buffers(framecnt_t nframes)
void set_count(const ChanCount &count)
void audition_region(boost::shared_ptr< Region >)
MonitorState monitoring_state() const
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
void output_changed(IOChange, void *)
bool commit(framecnt_t nframes)
virtual void clear(bool with_signals=true)
virtual ChanCount input_streams() const
LIBPBD_API Transmitter error
LIBPBD_API Transmitter warning
int remove_processor(boost::shared_ptr< Processor >, ProcessorStreams *err=0, bool need_process_lock=true)
ProcessorList _processors
std::ostream & endmsg(std::ostream &ostr)
boost::shared_ptr< AudioDiskstream > audio_diskstream() const
static AudioEngine * instance()
void config_changed(std::string)
int process(BufferSet &, framepos_t transport_frame, pframes_t nframes, framecnt_t &, bool need_disk_signal)
#define MIDI_CTL_RESET_CONTROLLERS
void get_physical_outputs(DataType type, std::vector< std::string > &)
DataType data_type() const
int add_processor(boost::shared_ptr< Processor >, Placement placement, ProcessorStreams *err=0, bool activation_allowed=true)
LIBARDOUR_API RCConfiguration * Config
void set_position(framepos_t)
boost::shared_ptr< IO > _output
enum ARDOUR::IOChange::Type type
framepos_t transport_frame() const
ChanCount n_outputs() const
bool record_enabled() const
frameoffset_t sync_offset(int &dir) const
boost::shared_ptr< Diskstream > _diskstream_audio
int roll_midi(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
Glib::Threads::Mutex lock
int configure_processors(ProcessorStreams *)
PBD::Signal1< void, std::string > ParameterChanged
framepos_t position() const
boost::shared_ptr< Diskstream > create_diskstream()
frameoffset_t _import_position
BufferSet & get_route_buffers(ChanCount count=ChanCount::ZERO, bool silence=true)
bool transport_stopped() const
boost::shared_ptr< MidiDiskstream > midi_diskstream() const
uint32_t n_channels() const
const ChanCount & count() const
PluginPtr find_plugin(ARDOUR::Session &, std::string unique_id, ARDOUR::PluginType)
void set(DataType t, uint32_t count)
void set_diskstream(boost::shared_ptr< Diskstream > ds)
boost::shared_ptr< IO > input() const
ARDOUR::AudioPlaylist & prepare_playlist()
virtual void process_output_buffers(BufferSet &bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick, bool gain_automation_ok)
int play_audition(framecnt_t nframes)
framecnt_t length() const
frameoffset_t _seek_frame
Glib::Threads::RWLock _processor_lock
boost::shared_ptr< Diskstream > _diskstream
static boost::shared_ptr< Region > create(boost::shared_ptr< const Region > other, bool announce=false)
virtual void set_diskstream(boost::shared_ptr< Diskstream >)
#define MIDI_CTL_ALL_NOTES_OFF
int roll_audio(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
void get_playback(MidiBuffer &dst, framecnt_t)
int roll(pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool &need_butler)
boost::shared_ptr< Route > monitor_out() const
ChanCount n_process_buffers()
std::string string_compose(const std::string &fmt, const T1 &o1)
LIBARDOUR_API PBD::PropertyDescriptor< framecnt_t > length
PBD::Signal2< void, ARDOUR::framecnt_t, ARDOUR::framecnt_t > AuditionProgress
boost::shared_ptr< MidiRegion > midi_region