prevent MIDI tracks from ever being in MonitoringSilence state, allows use of piano roll whether rolling or not
git-svn-id: svn://localhost/ardour2/branches/3.0@13679 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
844ce9f359
commit
99c848455a
|
@ -102,6 +102,7 @@ public:
|
||||||
boost::shared_ptr<MidiBuffer> get_gui_feed_buffer () const;
|
boost::shared_ptr<MidiBuffer> get_gui_feed_buffer () const;
|
||||||
|
|
||||||
void set_monitoring (MonitorChoice);
|
void set_monitoring (MonitorChoice);
|
||||||
|
MonitorState monitoring_state () const;
|
||||||
|
|
||||||
void set_input_active (bool);
|
void set_input_active (bool);
|
||||||
bool input_active () const;
|
bool input_active () const;
|
||||||
|
|
|
@ -527,6 +527,8 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
||||||
boost::shared_ptr<Amp> _amp;
|
boost::shared_ptr<Amp> _amp;
|
||||||
boost::shared_ptr<PeakMeter> _meter;
|
boost::shared_ptr<PeakMeter> _meter;
|
||||||
|
|
||||||
|
boost::shared_ptr<Processor> the_instrument_unlocked() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int set_state_2X (const XMLNode&, int);
|
int set_state_2X (const XMLNode&, int);
|
||||||
void set_processor_state_2X (XMLNodeList const &, int);
|
void set_processor_state_2X (XMLNodeList const &, int);
|
||||||
|
|
|
@ -51,7 +51,7 @@ class Track : public Route, public PublicDiskstream
|
||||||
|
|
||||||
virtual void set_monitoring (MonitorChoice);
|
virtual void set_monitoring (MonitorChoice);
|
||||||
MonitorChoice monitoring_choice() const { return _monitoring; }
|
MonitorChoice monitoring_choice() const { return _monitoring; }
|
||||||
MonitorState monitoring_state () const;
|
MonitorState monitoring_state () const;
|
||||||
PBD::Signal0<void> MonitoringChanged;
|
PBD::Signal0<void> MonitoringChanged;
|
||||||
|
|
||||||
MeterState metering_state () const;
|
MeterState metering_state () const;
|
||||||
|
|
|
@ -352,7 +352,9 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
|
||||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||||
MidiBuffer& mbuf (bufs.get_midi (0));
|
MidiBuffer& mbuf (bufs.get_midi (0));
|
||||||
|
|
||||||
/* we are a MIDI track, so we always start the chain with a single-channel diskstream */
|
/* we are a MIDI track, so we always start the chain with a
|
||||||
|
* single-MIDI-channel diskstream
|
||||||
|
*/
|
||||||
ChanCount c;
|
ChanCount c;
|
||||||
c.set_audio (0);
|
c.set_audio (0);
|
||||||
c.set_midi (1);
|
c.set_midi (1);
|
||||||
|
@ -772,3 +774,12 @@ MidiTrack::set_monitoring (MonitorChoice mc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MonitorState
|
||||||
|
MidiTrack::monitoring_state () const
|
||||||
|
{
|
||||||
|
MonitorState ms = Track::monitoring_state();
|
||||||
|
if (ms == MonitoringSilence) {
|
||||||
|
return MonitoringInput;
|
||||||
|
}
|
||||||
|
return ms;
|
||||||
|
}
|
||||||
|
|
|
@ -4114,6 +4114,12 @@ boost::shared_ptr<Processor>
|
||||||
Route::the_instrument () const
|
Route::the_instrument () const
|
||||||
{
|
{
|
||||||
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
|
Glib::Threads::RWLock::WriterLock lm (_processor_lock);
|
||||||
|
return the_instrument_unlocked ();
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr<Processor>
|
||||||
|
Route::the_instrument_unlocked () const
|
||||||
|
{
|
||||||
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
|
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
|
||||||
if (boost::dynamic_pointer_cast<PluginInsert>(*i)) {
|
if (boost::dynamic_pointer_cast<PluginInsert>(*i)) {
|
||||||
if ((*i)->input_streams().n_midi() > 0 &&
|
if ((*i)->input_streams().n_midi() > 0 &&
|
||||||
|
@ -4125,6 +4131,8 @@ Route::the_instrument () const
|
||||||
return boost::shared_ptr<Processor>();
|
return boost::shared_ptr<Processor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Route::non_realtime_locate (framepos_t pos)
|
Route::non_realtime_locate (framepos_t pos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -370,19 +370,34 @@ Track::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
|
||||||
into the route.
|
into the route.
|
||||||
*/
|
*/
|
||||||
be_silent = true;
|
be_silent = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
MonitorState const s = monitoring_state ();
|
MonitorState const s = monitoring_state ();
|
||||||
/* we are not rolling, so be silent even if we are monitoring disk, as there
|
/* we are not rolling, so be silent even if we are monitoring disk, as there
|
||||||
will be no disk data coming in.
|
will be no disk data coming in.
|
||||||
*/
|
*/
|
||||||
be_silent = (s == MonitoringSilence || s == MonitoringDisk);
|
switch (s) {
|
||||||
|
case MonitoringSilence:
|
||||||
|
/* if there is an instrument, be_silent should always
|
||||||
|
be false
|
||||||
|
*/
|
||||||
|
be_silent = (the_instrument_unlocked() == 0);
|
||||||
|
break;
|
||||||
|
case MonitoringDisk:
|
||||||
|
be_silent = true;
|
||||||
|
break;
|
||||||
|
case MonitoringInput:
|
||||||
|
be_silent = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_have_internal_generator && metering_state() == MeteringInput) {
|
if (!_have_internal_generator && metering_state() == MeteringInput) {
|
||||||
_input->process_input (_meter, start_frame, end_frame, nframes);
|
_input->process_input (_meter, start_frame, end_frame, nframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
_amp->apply_gain_automation(false);
|
_amp->apply_gain_automation (false);
|
||||||
|
|
||||||
/* if have_internal_generator, or .. */
|
/* if have_internal_generator, or .. */
|
||||||
//_input->process_input (_meter, start_frame, end_frame, nframes);
|
//_input->process_input (_meter, start_frame, end_frame, nframes);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user