From a958770abd3e73d3465f914e06b45a1dca80d778 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Nusser?= Date: Thu, 15 Oct 2015 15:49:41 +0200 Subject: [PATCH 1/1] Remove all the now unused functions in the MidiModel class. --- libs/ardour/ardour/midi_model.h | 1 - libs/ardour/ardour/midi_region.h | 1 - libs/ardour/midi_model.cc | 31 ------------------------------- libs/ardour/midi_region.cc | 8 -------- 4 files changed, 41 deletions(-) diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h index 80ae71f206..21c67c2b32 100644 --- a/libs/ardour/ardour/midi_model.h +++ b/libs/ardour/ardour/midi_model.h @@ -288,7 +288,6 @@ public: void insert_silence_at_start (TimeType); void transpose (NoteDiffCommand *, const NotePtr, int); - void transpose (TimeType, TimeType, int); std::set& active_notes() { return _active_notes; } diff --git a/libs/ardour/ardour/midi_region.h b/libs/ardour/ardour/midi_region.h index 87e89c695b..250a58aa70 100644 --- a/libs/ardour/ardour/midi_region.h +++ b/libs/ardour/ardour/midi_region.h @@ -101,7 +101,6 @@ class LIBARDOUR_API MidiRegion : public Region boost::shared_ptr model() const; void fix_negative_start (); - void transpose (int); protected: diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc index 5997c5b548..d9f6e802cf 100644 --- a/libs/ardour/midi_model.cc +++ b/libs/ardour/midi_model.cc @@ -1997,37 +1997,6 @@ MidiModel::transpose (NoteDiffCommand* c, const NotePtr note_ptr, int semitones) c->change (note_ptr, NoteDiffCommand::NoteNumber, (uint8_t) new_note); } -/** Transpose notes in a time range by a given number of semitones. Notes - * will be clamped at 0 and 127 if the transposition would make them exceed - * that range. - * - * @param from Start time. - * @param end End time. - * @param semitones Number of semitones to transpose by (+ve is higher, -ve is lower). - */ -void -MidiModel::transpose (TimeType from, TimeType to, int semitones) -{ - boost::shared_ptr s = midi_source (); - - NoteDiffCommand* c = new_note_diff_command (_("transpose")); - - for (Notes::iterator i = notes().begin(); i != notes().end(); ++i) { - - if ((*i)->time() >= to) { - - /* finished */ - break; - - } else if ((*i)->time() >= from) { - - transpose (c, *i, semitones); - } - } - - apply_command (s->session (), c); -} - void MidiModel::control_list_marked_dirty () { diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 3e4a656ebe..56472e4ba8 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -458,14 +458,6 @@ MidiRegion::fix_negative_start () _start_beats = Evoral::Beats(); } -/** Transpose the notes in this region by a given number of semitones */ -void -MidiRegion::transpose (int semitones) -{ - BeatsFramesConverter c (_session.tempo_map(), _start); - model()->transpose (c.from (_start), c.from (_start + _length), semitones); -} - void MidiRegion::set_start_internal (framecnt_t s) { -- 2.30.2