remove concept of "note-mode" from Evoral::Sequence (and thus ARDOUR::MidiModel)
This note-mode had no effect on anything at all, at least as far back as 5.12. There is a note-mode in the GUI which affects the duration of notes added using the GUI, and that remains in place. It is not clear if the _percussive member of Evoral::Sequence ever had any effect on the actual MIDI event stream the Sequence could generate.
This commit is contained in:
parent
ae3548c1da
commit
3454353aa3
@ -897,9 +897,6 @@ DiskWriter::set_note_mode (NoteMode m)
|
||||
if (mp) {
|
||||
mp->set_note_mode (m);
|
||||
}
|
||||
|
||||
if (_midi_write_source && _midi_write_source->model())
|
||||
_midi_write_source->model()->set_note_mode(m);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1229,17 +1229,15 @@ MidiModel::write_to (boost::shared_ptr<MidiSource> source,
|
||||
{
|
||||
ReadLock lock(read_lock());
|
||||
|
||||
const bool old_percussive = percussive();
|
||||
set_percussive(false);
|
||||
|
||||
source->drop_model(source_lock);
|
||||
source->mark_streaming_midi_write_started (source_lock, note_mode());
|
||||
/* as of March 2022 or long before , the note mode argument does nothing */
|
||||
source->mark_streaming_midi_write_started (source_lock, Sustained);
|
||||
|
||||
for (Evoral::Sequence<TimeType>::const_iterator i = begin(TimeType(), true); i != end(); ++i) {
|
||||
source->append_event_beats(source_lock, *i);
|
||||
}
|
||||
|
||||
set_percussive(old_percussive);
|
||||
source->mark_streaming_write_completed(source_lock);
|
||||
|
||||
set_edited(false);
|
||||
@ -1257,9 +1255,6 @@ MidiModel::sync_to_source (const Glib::Threads::Mutex::Lock& source_lock)
|
||||
{
|
||||
ReadLock lock(read_lock());
|
||||
|
||||
const bool old_percussive = percussive();
|
||||
set_percussive(false);
|
||||
|
||||
boost::shared_ptr<MidiSource> ms = _midi_source.lock ();
|
||||
if (!ms) {
|
||||
error << "MIDI model has no source to sync to" << endmsg;
|
||||
@ -1270,13 +1265,13 @@ MidiModel::sync_to_source (const Glib::Threads::Mutex::Lock& source_lock)
|
||||
on the next roll if time progresses linearly. */
|
||||
ms->invalidate(source_lock);
|
||||
|
||||
ms->mark_streaming_midi_write_started (source_lock, note_mode());
|
||||
/* as of March 2022 or long before , the note mode argument does nothing */
|
||||
_midi_source.mark_streaming_midi_write_started (source_lock, Sustained);
|
||||
|
||||
for (Evoral::Sequence<TimeType>::const_iterator i = begin(TimeType(), true); i != end(); ++i) {
|
||||
ms->append_event_beats(source_lock, *i);
|
||||
}
|
||||
|
||||
set_percussive (old_percussive);
|
||||
ms->mark_streaming_write_completed (source_lock);
|
||||
|
||||
set_edited (false);
|
||||
@ -1301,11 +1296,9 @@ MidiModel::write_section_to (boost::shared_ptr<MidiSource> source,
|
||||
ReadLock lock(read_lock());
|
||||
MidiNoteTracker mst;
|
||||
|
||||
const bool old_percussive = percussive();
|
||||
set_percussive(false);
|
||||
|
||||
source->drop_model(source_lock);
|
||||
source->mark_streaming_midi_write_started (source_lock, note_mode());
|
||||
/* as of March 2022 or long before , the note mode argument does nothing */
|
||||
source->mark_streaming_midi_write_started (source_lock, Sustained);
|
||||
|
||||
for (Evoral::Sequence<TimeType>::const_iterator i = begin(TimeType(), true); i != end(); ++i) {
|
||||
if (i->time() >= begin_time && i->time() < end_time) {
|
||||
@ -1343,7 +1336,6 @@ MidiModel::write_section_to (boost::shared_ptr<MidiSource> source,
|
||||
}
|
||||
mst.resolve_notes (*source, source_lock, end_time);
|
||||
|
||||
set_percussive(old_percussive);
|
||||
source->mark_streaming_write_completed(source_lock);
|
||||
|
||||
set_edited(false);
|
||||
|
@ -242,7 +242,6 @@ MidiRegion::_read_at (const SourceList& /*srcs*/,
|
||||
|
||||
Glib::Threads::Mutex::Lock lm(src->mutex());
|
||||
|
||||
src->set_note_mode(lm, mode);
|
||||
|
||||
#if 0
|
||||
cerr << "MR " << name () << " read @ " << pos << " + " << to_read
|
||||
@ -306,7 +305,6 @@ MidiRegion::render_range (Evoral::EventSink<samplepos_t>& dst,
|
||||
|
||||
Glib::Threads::Mutex::Lock lm(src->mutex());
|
||||
|
||||
src->set_note_mode(lm, mode);
|
||||
|
||||
#if 0
|
||||
cerr << "MR " << name () << " render "
|
||||
|
@ -314,7 +314,7 @@ void
|
||||
MidiSource::mark_streaming_midi_write_started (const Lock& lock, NoteMode mode)
|
||||
{
|
||||
if (_model) {
|
||||
_model->set_note_mode (mode);
|
||||
/* XXX do something with note mode? */
|
||||
_model->start_write ();
|
||||
}
|
||||
|
||||
@ -350,8 +350,8 @@ MidiSource::mark_write_starting_now (timepos_t const & position, samplecnt_t cap
|
||||
void
|
||||
MidiSource::mark_streaming_write_started (const Lock& lock)
|
||||
{
|
||||
NoteMode note_mode = _model ? _model->note_mode() : Sustained;
|
||||
mark_streaming_midi_write_started (lock, note_mode);
|
||||
/* as of March 2022 or long before , the note mode argument does nothing */
|
||||
mark_streaming_midi_write_started (lock, Sustained);
|
||||
}
|
||||
|
||||
void
|
||||
@ -466,14 +466,6 @@ MidiSource::session_saved()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiSource::set_note_mode(const Lock& lock, NoteMode mode)
|
||||
{
|
||||
if (_model) {
|
||||
_model->set_note_mode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiSource::drop_model (const Lock& lock)
|
||||
{
|
||||
|
@ -480,7 +480,6 @@ Sequence<Time>::Sequence(const TypeMap& type_map)
|
||||
, _writing(false)
|
||||
, _type_map(type_map)
|
||||
, _end_iter(*this, std::numeric_limits<Time>::max(), false, std::set<Evoral::Parameter> ())
|
||||
, _percussive(false)
|
||||
, _lowest_note(127)
|
||||
, _highest_note(0)
|
||||
{
|
||||
@ -502,7 +501,6 @@ Sequence<Time>::Sequence(const Sequence<Time>& other)
|
||||
, _writing(false)
|
||||
, _type_map(other._type_map)
|
||||
, _end_iter(*this, std::numeric_limits<Time>::max(), false, std::set<Evoral::Parameter> ())
|
||||
, _percussive(other._percussive)
|
||||
, _lowest_note(other._lowest_note)
|
||||
, _highest_note(other._highest_note)
|
||||
{
|
||||
@ -641,7 +639,6 @@ template<typename Time>
|
||||
void
|
||||
Sequence<Time>::start_write()
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 : start_write (percussive = %2)\n", this, _percussive));
|
||||
WriteLock lock(write_lock());
|
||||
_writing = true;
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
|
@ -97,9 +97,6 @@ public:
|
||||
|
||||
void clear();
|
||||
|
||||
bool percussive() const { return _percussive; }
|
||||
void set_percussive(bool p) { _percussive = p; }
|
||||
|
||||
void start_write();
|
||||
bool writing() const { return _writing; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user