summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/midiedit/drumedit.cpp28
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp28
-rw-r--r--muse2/muse/midieditor.cpp21
-rw-r--r--muse2/muse/midieditor.h2
-rw-r--r--muse2/muse/shortcuts.cpp7
-rw-r--r--muse2/muse/shortcuts.h8
6 files changed, 94 insertions, 0 deletions
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 175287cb..b45c8be4 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -1680,6 +1680,34 @@ void DrumEdit::keyPressEvent(QKeyEvent* event)
else
return;
}
+ else if (key == shortcuts[SHRT_MOVE_PLAY_TO_NOTE].key){
+ movePlayPointerToSelectedEvent();
+ return;
+ }
+ else if (key == shortcuts[SHRT_STEP_RECORD].key) {
+ canvas->setSteprec(!srec->isChecked());
+ srec->setChecked(!srec->isChecked());
+ return;
+ }
+ else if (key == shortcuts[SHRT_MIDI_INPUT].key) {
+ canvas->setMidiin(!midiin->isChecked());
+ midiin->setChecked(!midiin->isChecked());
+ return;
+
+ }
+ else if (key == shortcuts[SHRT_PLAY_EVENTS].key) {
+ canvas->playEvents(!speaker->isChecked());
+ speaker->setChecked(!speaker->isChecked());
+ return;
+ }
+ else if (key == shortcuts[SHRT_INC_VELOCITY].key) {
+ modify_velocity(partlist_to_set(parts()), 1, 100, 1);
+ return;
+ }
+ else if (key == shortcuts[SHRT_DEC_VELOCITY].key) {
+ modify_velocity(partlist_to_set(parts()), 1, 100, -1);
+ return;
+ }
else { //Default:
event->ignore();
return;
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index d0cb3f2a..7f281712 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -1311,6 +1311,34 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
else
return;
}
+ else if (key == shortcuts[SHRT_MOVE_PLAY_TO_NOTE].key){
+ movePlayPointerToSelectedEvent();
+ return;
+ }
+ else if (key == shortcuts[SHRT_STEP_RECORD].key) {
+ canvas->setSteprec(!srec->isChecked());
+ srec->setChecked(!srec->isChecked());
+ return;
+ }
+ else if (key == shortcuts[SHRT_MIDI_INPUT].key) {
+ canvas->setMidiin(!midiin->isChecked());
+ midiin->setChecked(!midiin->isChecked());
+ return;
+
+ }
+ else if (key == shortcuts[SHRT_PLAY_EVENTS].key) {
+ canvas->playEvents(!speaker->isChecked());
+ speaker->setChecked(!speaker->isChecked());
+ return;
+ }
+ else if (key == shortcuts[SHRT_INC_VELOCITY].key) {
+ modify_velocity(partlist_to_set(parts()), 1, 100, 1);
+ return;
+ }
+ else if (key == shortcuts[SHRT_DEC_VELOCITY].key) {
+ modify_velocity(partlist_to_set(parts()), 1, 100, -1);
+ return;
+ }
else { //Default:
event->ignore();
return;
diff --git a/muse2/muse/midieditor.cpp b/muse2/muse/midieditor.cpp
index a4052d90..5b332741 100644
--- a/muse2/muse/midieditor.cpp
+++ b/muse2/muse/midieditor.cpp
@@ -92,6 +92,27 @@ void MidiEditor::genPartlist()
//---------------------------------------------------------
// addPart
//---------------------------------------------------------
+void MidiEditor::movePlayPointerToSelectedEvent()
+{
+ const MusECore::EventList & evl = curCanvasPart()->events();
+ int tickPos = -1;
+ for (MusECore::ciEvent ev=evl.begin(); ev!=evl.end(); ev++) {
+ if (ev->second.selected()) {
+ tickPos = ev->second.tick();
+ printf("found selected event, moving to pos %d\n", tickPos);
+ break;
+ }
+ }
+ if (tickPos > -1)
+ {
+ MusECore::Pos p0(curCanvasPart()->tick() + tickPos, true);
+ MusEGlobal::song->setPos(0, p0);
+ }
+}
+
+//---------------------------------------------------------
+// addPart
+//---------------------------------------------------------
void MidiEditor::addPart(MusECore::Part* p)
{
diff --git a/muse2/muse/midieditor.h b/muse2/muse/midieditor.h
index 39feeedf..76d18d11 100644
--- a/muse2/muse/midieditor.h
+++ b/muse2/muse/midieditor.h
@@ -59,6 +59,7 @@ class MidiEditor : public TopWin {
std::set<int> _parts;
int _curDrumInstrument; // currently selected instrument if drum
// editor
+
protected:
MusEGui::ScrollScale* hscroll;
MusEGui::ScrollScale* vscroll;
@@ -74,6 +75,7 @@ class MidiEditor : public TopWin {
virtual void writeStatus(int, MusECore::Xml&) const;
void writePartList(int, MusECore::Xml&) const;
void genPartlist();
+ void movePlayPointerToSelectedEvent();
private slots:
void addNewParts(const std::map< const MusECore::Part*, std::set<const MusECore::Part*> >&);
diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp
index 83e5541a..d9178ba8 100644
--- a/muse2/muse/shortcuts.cpp
+++ b/muse2/muse/shortcuts.cpp
@@ -196,6 +196,12 @@ void initShortCuts()
defShrt(SHRT_SCROLL_LEFT, Qt::Key_H, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "scroll_left");
defShrt(SHRT_SCROLL_RIGHT, Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "View: Scroll left"), PROLL_SHRT + DEDIT_SHRT + WAVE_SHRT, "scroll_right");
+ defShrt(SHRT_STEP_RECORD, Qt::CTRL + Qt::Key_R, QT_TRANSLATE_NOOP("shortcuts", "Transport: Step record"), PROLL_SHRT + DEDIT_SHRT, "step_record");
+ defShrt(SHRT_MIDI_INPUT, Qt::CTRL + Qt::Key_U, QT_TRANSLATE_NOOP("shortcuts", "Transport: Midi input"), PROLL_SHRT + DEDIT_SHRT, "midi_input");
+ defShrt(SHRT_PLAY_EVENTS, Qt::CTRL + Qt::Key_L, QT_TRANSLATE_NOOP("shortcuts", "Transport: Play events"), PROLL_SHRT + DEDIT_SHRT, "play_events");
+ defShrt(SHRT_INC_VELOCITY, Qt::ALT + Qt::Key_Up, QT_TRANSLATE_NOOP("shortcuts", "Edit: Increase velocity"), PROLL_SHRT + DEDIT_SHRT, "increase_velocity");
+ defShrt(SHRT_DEC_VELOCITY, Qt::ALT + Qt::Key_Down, QT_TRANSLATE_NOOP("shortcuts", "Edit: Decrease velocity"), PROLL_SHRT + DEDIT_SHRT, "decrease_velocity");
+
//-----------------------------------------------------------
//Drum:
//-----------------------------------------------------------
@@ -220,6 +226,7 @@ void initShortCuts()
defShrt(SHRT_DELETE_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Delete Measure"), PROLL_SHRT + DEDIT_SHRT, "midi_delete_measure");
defShrt(SHRT_CREATE_MEASURE, 0, QT_TRANSLATE_NOOP("shortcuts", "Edit: Create Measure"), PROLL_SHRT + DEDIT_SHRT, "midi_create_measure");
defShrt(SHRT_EVENT_COLOR, Qt::Key_E, QT_TRANSLATE_NOOP("shortcuts", "Edit: Change Event Color"), PROLL_SHRT + SCORE_SHRT, "change_event_color");
+ defShrt(SHRT_MOVE_PLAY_TO_NOTE, Qt::CTRL + Qt::Key_M, QT_TRANSLATE_NOOP("shortcuts", "Move: Move to selected note"), PROLL_SHRT + DEDIT_SHRT, "move_to_note");
// Shortcuts for tools
diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h
index 465d479e..c57cfe2c 100644
--- a/muse2/muse/shortcuts.h
+++ b/muse2/muse/shortcuts.h
@@ -218,6 +218,12 @@ enum {
SHRT_DEC_PITCH,
SHRT_INC_POS,
SHRT_DEC_POS,
+
+ SHRT_STEP_RECORD,
+ SHRT_MIDI_INPUT,
+ SHRT_PLAY_EVENTS,
+ SHRT_INC_VELOCITY,
+ SHRT_DEC_VELOCITY,
SHRT_POS_INC_NOSNAP,
SHRT_POS_DEC_NOSNAP,
@@ -299,6 +305,8 @@ enum {
SHRT_EVENT_COLOR, //e
+ SHRT_MOVE_PLAY_TO_NOTE,
+
// Shortcuts for tools
// global
SHRT_TOOL_POINTER, //