mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
Introduce "Transpose..." also in the context menu of selected notes.
This commit is contained in:
parent
bd02a7f817
commit
e807fe2b28
3 changed files with 29 additions and 26 deletions
|
|
@ -5959,6 +5959,8 @@ Editor::popup_note_context_menu (ArdourCanvas::Item* item, GdkEvent* event)
|
||||||
sigc::mem_fun(mrv, &MidiRegionView::delete_selection)));
|
sigc::mem_fun(mrv, &MidiRegionView::delete_selection)));
|
||||||
items.push_back(MenuElem(_("Edit..."),
|
items.push_back(MenuElem(_("Edit..."),
|
||||||
sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv)));
|
sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv)));
|
||||||
|
items.push_back(MenuElem(_("Transpose..."),
|
||||||
|
sigc::bind(sigc::mem_fun(*this, &Editor::transpose_regions), rs)));
|
||||||
items.push_back(MenuElem(_("Legatize"),
|
items.push_back(MenuElem(_("Legatize"),
|
||||||
sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false)));
|
sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false)));
|
||||||
items.push_back(MenuElem(_("Quantize..."),
|
items.push_back(MenuElem(_("Quantize..."),
|
||||||
|
|
|
||||||
|
|
@ -1258,6 +1258,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
void legatize_regions (const RegionSelection& rs, bool shrink_only);
|
void legatize_regions (const RegionSelection& rs, bool shrink_only);
|
||||||
void transform_region ();
|
void transform_region ();
|
||||||
void transform_regions (const RegionSelection& rs);
|
void transform_regions (const RegionSelection& rs);
|
||||||
|
void transpose_region ();
|
||||||
|
void transpose_regions (const RegionSelection& rs);
|
||||||
void insert_patch_change (bool from_context);
|
void insert_patch_change (bool from_context);
|
||||||
void fork_region ();
|
void fork_region ();
|
||||||
|
|
||||||
|
|
@ -2029,8 +2031,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
int pitch_shift (RegionSelection&, float cents);
|
int pitch_shift (RegionSelection&, float cents);
|
||||||
void pitch_shift_region ();
|
void pitch_shift_region ();
|
||||||
|
|
||||||
void transpose_region ();
|
|
||||||
|
|
||||||
/* editor-mixer strip */
|
/* editor-mixer strip */
|
||||||
|
|
||||||
MixerStrip *current_mixer_strip;
|
MixerStrip *current_mixer_strip;
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
#include "ardour/session_playlists.h"
|
#include "ardour/session_playlists.h"
|
||||||
#include "ardour/strip_silence.h"
|
#include "ardour/strip_silence.h"
|
||||||
#include "ardour/transient_detector.h"
|
#include "ardour/transient_detector.h"
|
||||||
|
#include "ardour/transpose.h"
|
||||||
|
|
||||||
#include "canvas/canvas.h"
|
#include "canvas/canvas.h"
|
||||||
|
|
||||||
|
|
@ -5353,6 +5354,30 @@ Editor::transform_regions (const RegionSelection& rs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::transpose_region ()
|
||||||
|
{
|
||||||
|
if (_session) {
|
||||||
|
transpose_regions(get_regions_from_selection_and_entered ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::transpose_regions (const RegionSelection& rs)
|
||||||
|
{
|
||||||
|
if (rs.n_midi_regions() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TransposeDialog d;
|
||||||
|
int const r = d.run ();
|
||||||
|
|
||||||
|
if (r == RESPONSE_ACCEPT) {
|
||||||
|
Transpose transpose(d.semitones ());
|
||||||
|
apply_midi_note_edit_op (transpose, rs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::insert_patch_change (bool from_context)
|
Editor::insert_patch_change (bool from_context)
|
||||||
{
|
{
|
||||||
|
|
@ -6425,30 +6450,6 @@ Editor::pitch_shift_region ()
|
||||||
pitch_shift (audio_rs, 1.2);
|
pitch_shift (audio_rs, 1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::transpose_region ()
|
|
||||||
{
|
|
||||||
RegionSelection rs = get_regions_from_selection_and_entered ();
|
|
||||||
|
|
||||||
list<MidiRegionView*> midi_region_views;
|
|
||||||
for (RegionSelection::iterator i = rs.begin(); i != rs.end(); ++i) {
|
|
||||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*i);
|
|
||||||
if (mrv) {
|
|
||||||
midi_region_views.push_back (mrv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TransposeDialog d;
|
|
||||||
int const r = d.run ();
|
|
||||||
if (r != RESPONSE_ACCEPT) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (list<MidiRegionView*>::iterator i = midi_region_views.begin(); i != midi_region_views.end(); ++i) {
|
|
||||||
(*i)->midi_region()->transpose (d.semitones ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::set_tempo_from_region ()
|
Editor::set_tempo_from_region ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue