summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Schweer <ws.seh.de>2006-11-22 16:01:49 +0000
committerWerner Schweer <ws.seh.de>2006-11-22 16:01:49 +0000
commit81b334998132d11b9fb34275cd75ccd6bc2fd4f2 (patch)
tree53834c4897d4db7f2716e3d2cdc24a9098a65af8
parentc3ef23511b3a6324e991554b51d0e3f864368ac4 (diff)
actions & shortcuts update
-rw-r--r--muse/muse/arranger/canvas.cpp14
-rw-r--r--muse/muse/arranger/tlwidget.cpp4
-rw-r--r--muse/muse/ctrl/ctrleditor.cpp4
-rw-r--r--muse/muse/dssihost.cpp1
-rw-r--r--muse/muse/icons.cpp137
-rw-r--r--muse/muse/icons.h27
-rw-r--r--muse/muse/marker/markerview.cpp6
-rw-r--r--muse/muse/midiedit/dcanvas.cpp153
-rw-r--r--muse/muse/midiedit/dcanvas.h9
-rw-r--r--muse/muse/midiedit/drumedit.cpp70
-rw-r--r--muse/muse/midiedit/drumedit.h3
-rw-r--r--muse/muse/midiedit/ecanvas.cpp5
-rw-r--r--muse/muse/midiedit/midieditor.cpp2
-rw-r--r--muse/muse/midiedit/pianoroll.cpp197
-rw-r--r--muse/muse/midiedit/pianoroll.h4
-rw-r--r--muse/muse/midiedit/prcanvas.cpp149
-rw-r--r--muse/muse/midiedit/prcanvas.h16
-rw-r--r--muse/muse/muse.cpp158
-rw-r--r--muse/muse/muse.h1
-rw-r--r--muse/muse/muse.qrc23
-rw-r--r--muse/muse/shortcuts.cpp227
-rw-r--r--muse/muse/song.h4
-rw-r--r--muse/muse/track.cpp7
-rw-r--r--muse/muse/waveedit/waveedit.cpp4
-rw-r--r--muse/muse/widgets/tools.cpp42
-rw-r--r--muse/muse/widgets/tools.h8
-rw-r--r--muse/muse/xpm/edit_score.xpm24
-rw-r--r--muse/muse/xpm/editmuteS.xpm63
-rw-r--r--muse/muse/xpm/piano.xpm (renamed from muse/muse/xpm/pianoS.xpm)0
29 files changed, 538 insertions, 824 deletions
diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp
index 3df1f708..f050c492 100644
--- a/muse/muse/arranger/canvas.cpp
+++ b/muse/muse/arranger/canvas.cpp
@@ -429,11 +429,14 @@ void PartCanvas::contextMenu(const QPoint& pos)
p.fillRect(0, 0, 20, 20, config.partColors[i]);
a->setIcon(QIcon(pm));
}
- a = pop->addAction(*deleteIcon, tr("delete"));
+ a = getAction("delete", this);
+ pop->addAction(a);
a->setData(1);
- a = pop->addAction(*cutIcon, tr("split"));
+ a = getAction("cut", this);
+ pop->addAction(a);
a->setData(2);
- a = pop->addAction(*glueIcon, tr("glue"));
+ a = getAction("glue", this);
+ pop->addAction(a);
a->setData(3);
a = pop->addAction(tr("de-clone"));
a->setData(15);
@@ -450,7 +453,7 @@ void PartCanvas::contextMenu(const QPoint& pos)
a->setData(13);
}
else {
- a = pop->addAction(*pianoIconSet, tr("pianoroll"));
+ a = pop->addAction(QIcon(":/xpm/piano.xpm"), tr("pianoroll"));
a->setData(10);
}
a = pop->addAction(*edit_listIcon, tr("miditracker"));
@@ -535,7 +538,8 @@ void PartCanvas::contextMenu(const QPoint& pos)
for (int i = 0; i < TOOLS; ++i) {
if ((arrangerTools & (1 << i))==0)
continue;
- a = pop->addAction(**toolList[i].icon, tr(toolList[i].tip));
+ a = getAction(toolList[i], this);
+ pop->addAction(a);
int id = 1 << i;
a->setData(id);
a->setCheckable(true);
diff --git a/muse/muse/arranger/tlwidget.cpp b/muse/muse/arranger/tlwidget.cpp
index 409b8c72..ec6cb9e3 100644
--- a/muse/muse/arranger/tlwidget.cpp
+++ b/muse/muse/arranger/tlwidget.cpp
@@ -121,8 +121,8 @@ void TLWidget::mousePressEvent(QMouseEvent* ev)
int button = ev->button();
if (button == Qt::RightButton) {
QMenu* menu = new QMenu(this);
- QAction* a;
- a = menu->addAction(QIcon(*deleteIcon), tr("Delete Track"));
+ QAction* a = getAction("delete", this);
+ menu->addAction(a);
a->setData(CMD_REMOVE_TRACK);
if (_track->type() == Track::MIDI || _track->type() == Track::WAVE) {
a = menu->addAction(tr("Copy Track"));
diff --git a/muse/muse/ctrl/ctrleditor.cpp b/muse/muse/ctrl/ctrleditor.cpp
index 4a6f1e81..624e38e7 100644
--- a/muse/muse/ctrl/ctrleditor.cpp
+++ b/muse/muse/ctrl/ctrleditor.cpp
@@ -222,8 +222,8 @@ void CtrlEditor::mousePress(const QPoint& pos, int button, Qt::KeyboardModifiers
int id = 1 << i;
if ((arrangerTools & id) == 0)
continue;
- a = pop.addAction(**toolList[i].icon, toolList[i].tip);
- a->setData(id);
+ a = getAction(toolList[i], &pop);
+ pop.addAction(a);
a->setCheckable(true);
if (id == (int)tool)
a->setChecked(true);
diff --git a/muse/muse/dssihost.cpp b/muse/muse/dssihost.cpp
index 57d9e38f..579a3642 100644
--- a/muse/muse/dssihost.cpp
+++ b/muse/muse/dssihost.cpp
@@ -264,7 +264,6 @@ void initDSSI()
if (dssiPath == 0)
dssiPath = "/usr/lib/dssi:/usr/local/lib/dssi";
-printf("INIT DSSI <%s>\n", dssiPath);
char* p = dssiPath;
while (*p != '\0') {
char* pe = p;
diff --git a/muse/muse/icons.cpp b/muse/muse/icons.cpp
index a5efb879..2fa62f9a 100644
--- a/muse/muse/icons.cpp
+++ b/muse/muse/icons.cpp
@@ -27,7 +27,6 @@
#include "xpm/edit_midi.xpm"
#include "xpm/midi_edit_instrument.xpm"
#include "xpm/midi_init_instr.xpm"
-// #include "xpm/midi_inputplugins.xpm"
#include "xpm/midi_local_off.xpm"
#include "xpm/midi_reset_instr.xpm"
#include "xpm/settings_appearance_settings.xpm"
@@ -37,15 +36,7 @@
#include "xpm/settings_metronome.xpm"
#include "xpm/settings_midifileexport.xpm"
#include "xpm/settings_midisync.xpm"
-#include "xpm/view_bigtime_window.xpm"
-#include "xpm/view_cliplist.xpm"
-#include "xpm/view_marker.xpm"
-#include "xpm/view_mixer.xpm"
-#include "xpm/view_transport_window.xpm"
-#include "xpm/pointer.xpm"
-#include "xpm/pencil.xpm"
-#include "xpm/delete.xpm"
#include "xpm/play.xpm"
#include "xpm/stick.xpm"
@@ -53,11 +44,7 @@
#include "xpm/cmark.xpm"
#include "xpm/lmark.xpm"
#include "xpm/rmark.xpm"
-#include "xpm/cut.xpm"
#include "xpm/steprec.xpm"
-#include "xpm/glue.xpm"
-#include "xpm/draw.xpm"
-#include "xpm/quant.xpm"
#include "xpm/master.xpm"
#include "xpm/filenewS.xpm"
#include "xpm/home.xpm"
@@ -80,18 +67,13 @@
#include "xpm/flagS.xpm"
#include "xpm/lock.xpm"
#include "xpm/toc.xpm"
-#include "xpm/pianoS.xpm"
-
#include "xpm/editcut.xpm"
#include "xpm/editcopy.xpm"
#include "xpm/editpaste.xpm"
-#include "xpm/editmute.xpm"
-#include "xpm/editmuteS.xpm"
#include "xpm/speaker.xpm"
#include "xpm/buttondown.xpm"
#include "xpm/configure.xpm"
-#include "xpm/panic.xpm"
#include "xpm/mastertrackS.xpm"
#include "xpm/localoffS.xpm"
@@ -99,7 +81,6 @@
#include "xpm/midi_plugS.xpm"
#include "xpm/miditransposeS.xpm"
#include "xpm/mixerS.xpm"
-// #include "xpm/mustangS.xpm"
#include "xpm/resetS.xpm"
#include "xpm/track_add.xpm"
#include "xpm/track_delete.xpm"
@@ -118,8 +99,6 @@
#include "xpm/edit_drumms.xpm"
#include "xpm/edit_list.xpm"
#include "xpm/edit_mastertrack.xpm"
-#include "xpm/edit_pianoroll.xpm"
-#include "xpm/edit_score.xpm"
#include "xpm/edit_track_add.xpm"
#include "xpm/edit_track_del.xpm"
#include "xpm/mastertrack_graphic.xpm"
@@ -127,12 +106,12 @@
#include "xpm/midi_transform.xpm"
#include "xpm/midi_transpose.xpm"
#include "xpm/select.xpm"
-#include "xpm/select_all.xpm"
+// #include "xpm/select_all.xpm"
#include "xpm/select_all_parts_on_track.xpm"
-#include "xpm/select_deselect_all.xpm"
-#include "xpm/select_inside_loop.xpm"
-#include "xpm/select_invert_selection.xpm"
-#include "xpm/select_outside_loop.xpm"
+// #include "xpm/select_deselect_all.xpm"
+// #include "xpm/select_inside_loop.xpm"
+// #include "xpm/select_invert_selection.xpm"
+// #include "xpm/select_outside_loop.xpm"
#include "xpm/muse_icon.xpm"
#include "xpm/config.xpm"
@@ -145,7 +124,6 @@ QPixmap* miditransformSIcon;
QPixmap* midi_plugSIcon;
QPixmap* miditransposeSIcon;
QPixmap* mixerSIcon;
-// QPixmap* mustangSIcon;
QPixmap* resetSIcon;
QPixmap* track_addIcon;
QPixmap* track_deleteIcon;
@@ -155,9 +133,6 @@ QPixmap* cliplistSIcon;
QPixmap* mixerAudioSIcon;
QPixmap* initSIcon;
-QPixmap* pointerIcon;
-QPixmap* pencilIcon;
-QPixmap* deleteIcon;
QPixmap* playIcon;
QPixmap* stopIcon;
@@ -166,11 +141,7 @@ QPixmap* frewindIcon;
QPixmap* stickIcon;
QPixmap* waveIcon;
QPixmap* markIcon[3];
-QPixmap* cutIcon;
QPixmap* steprecIcon;
-QPixmap* glueIcon;
-QPixmap* drawIcon;
-QPixmap* quantIcon;
QPixmap* openIcon;
QPixmap* saveIcon;
QPixmap* masterIcon;
@@ -201,14 +172,7 @@ QPixmap* speakerIcon;
QPixmap* buttondownIcon;
QPixmap* configureIcon;
-QPixmap* editmuteIcon;
-QPixmap* editmuteSIcon;
-QPixmap* panicIcon;
-
-QIcon* pianoIconSet;
-QIcon* scoreIconSet;
QIcon* editcutIconSet;
-QIcon* editmuteIconSet;
QIcon* editcopyIconSet;
QIcon* editpasteIconSet;
QIcon* recordIcon;
@@ -224,8 +188,6 @@ QPixmap* addtrack_wavetrackIcon;
QPixmap* edit_drummsIcon;
QPixmap* edit_listIcon;
QPixmap* edit_mastertrackIcon;
-QPixmap* edit_pianorollIcon;
-QPixmap* edit_scoreIcon;
QPixmap* edit_track_addIcon;
QPixmap* edit_track_delIcon;
QPixmap* mastertrack_graphicIcon;
@@ -233,23 +195,19 @@ QPixmap* mastertrack_listIcon;
QPixmap* midi_transformIcon;
QPixmap* midi_transposeIcon;
QPixmap* selectIcon;
-QPixmap* select_allIcon;
+// QPixmap* select_allIcon;
QPixmap* select_all_parts_on_trackIcon;
-QPixmap* select_deselect_allIcon;
-QPixmap* select_inside_loopIcon;
-QPixmap* select_invert_selectionIcon;
-QPixmap* select_outside_loopIcon;
+// QPixmap* select_deselect_allIcon;
+// QPixmap* select_inside_loopIcon;
+// QPixmap* select_invert_selectionIcon;
+// QPixmap* select_outside_loopIcon;
QPixmap* audio_bounce_to_fileIcon;
QPixmap* audio_bounce_to_trackIcon;
QPixmap* audio_restartaudioIcon;
-// QPixmap* automation_clear_dataIcon;
-// QPixmap* automation_mixerIcon;
-// QPixmap* automation_take_snapshotIcon;
QPixmap* edit_midiIcon;
QPixmap* midi_edit_instrumentIcon;
QPixmap* midi_init_instrIcon;
-// QPixmap* midi_inputpluginsIcon;
QPixmap* midi_local_offIcon;
QPixmap* midi_reset_instrIcon;
QPixmap* settings_appearance_settingsIcon;
@@ -259,11 +217,6 @@ QPixmap* settings_globalsettingsIcon;
QPixmap* settings_metronomeIcon;
QPixmap* settings_midifileexportIcon;
QPixmap* settings_midisyncIcon;
-QPixmap* view_bigtime_windowIcon;
-QPixmap* view_cliplistIcon;
-QPixmap* view_markerIcon;
-QPixmap* view_mixerIcon;
-QPixmap* view_transport_windowIcon;
QPixmap* museIcon;
QPixmap* museIcon64;
@@ -277,9 +230,6 @@ QPixmap* plusIcon;
void initIcons()
{
- pointerIcon = new QPixmap(pointer_xpm);
- pencilIcon = new QPixmap(pencil_xpm);
- deleteIcon = new QPixmap(delete_xpm);
playIcon = new QPixmap(play_xpm);
stickIcon = new QPixmap(stick_xpm);
@@ -287,11 +237,7 @@ void initIcons()
markIcon[0] = new QPixmap(cmark_xpm);
markIcon[1] = new QPixmap(lmark_xpm);
markIcon[2] = new QPixmap(rmark_xpm);
- cutIcon = new QPixmap(cut_xpm);
steprecIcon = new QPixmap(steprec_xpm);
- glueIcon = new QPixmap(glue_xpm);
- drawIcon = new QPixmap(draw_xpm);
- quantIcon = new QPixmap(quant_xpm);
saveIcon = new QPixmap(":/xpm/filesave.png");
openIcon = new QPixmap(":/xpm/fileopen.png");
masterIcon = new QPixmap(master_xpm);
@@ -300,7 +246,6 @@ void initIcons()
homeIcon = new QPixmap(home_xpm);
backIcon = new QPixmap(back_xpm);
forwardIcon = new QPixmap(forward_xpm);
- muteIcon = new QPixmap(editmuteS_xpm);
upIcon = new QPixmap(up_xpm);
downIcon = new QPixmap(down_xpm);
boldIcon = new QPixmap(bold_xpm);
@@ -322,14 +267,9 @@ void initIcons()
buttondownIcon = new QPixmap(buttondown_xpm);
configureIcon = new QPixmap(configure_xpm);
- editmuteIcon = new QPixmap(editmute_xpm);
- editmuteSIcon = new QPixmap(editmuteS_xpm);
- panicIcon = new QPixmap(panic_xpm);
-
editcutIconSet = new QIcon(QPixmap(editcut_xpm));
editcopyIconSet = new QIcon(QPixmap(editcopy_xpm));
editpasteIconSet = new QIcon(QPixmap(editpaste_xpm));
- editmuteIconSet = new QIcon(QPixmap(editmute_xpm));
mastertrackSIcon = new QPixmap(mastertrackS_xpm);
localoffSIcon = new QPixmap(localoffS_xpm);
@@ -337,7 +277,6 @@ void initIcons()
midi_plugSIcon = new QPixmap(midi_plugS_xpm);
miditransposeSIcon = new QPixmap(miditransposeS_xpm);
mixerSIcon = new QPixmap(mixerS_xpm);
-// mustangSIcon = new QPixmap(mustangS_xpm);
resetSIcon = new QPixmap(resetS_xpm);
track_addIcon = new QPixmap(track_add_xpm);
track_deleteIcon = new QPixmap(track_delete_xpm);
@@ -356,8 +295,6 @@ void initIcons()
edit_drummsIcon = new QPixmap(edit_drumms_xpm);
edit_listIcon = new QPixmap(edit_list_xpm);
edit_mastertrackIcon = new QPixmap(edit_mastertrack_xpm);
- edit_pianorollIcon = new QPixmap(edit_pianoroll_xpm);
- edit_scoreIcon = new QPixmap(edit_score_xpm);
edit_track_addIcon = new QPixmap(edit_track_add_xpm);
edit_track_delIcon = new QPixmap(edit_track_del_xpm);
mastertrack_graphicIcon = new QPixmap(mastertrack_graphic_xpm);
@@ -365,44 +302,38 @@ void initIcons()
midi_transformIcon = new QPixmap(midi_transform_xpm);
midi_transposeIcon = new QPixmap(midi_transpose_xpm);
selectIcon = new QPixmap(select_xpm);
- select_allIcon = new QPixmap(select_all_xpm);
+// select_allIcon = new QPixmap(select_all_xpm);
select_all_parts_on_trackIcon = new QPixmap(select_all_parts_on_track_xpm);
- select_deselect_allIcon = new QPixmap(select_deselect_all);
- select_inside_loopIcon = new QPixmap(select_inside_loop_xpm);
- select_invert_selectionIcon = new QPixmap(select_invert_selection);
- select_outside_loopIcon = new QPixmap(select_outside_loop_xpm);
- pianoIconSet = new QIcon(QPixmap(pianoS_xpm));
+// select_deselect_allIcon = new QPixmap(select_deselect_all);
+// select_inside_loopIcon = new QPixmap(select_inside_loop_xpm);
+// select_invert_selectionIcon = new QPixmap(select_invert_selection);
+// select_outside_loopIcon = new QPixmap(select_outside_loop_xpm);
- audio_bounce_to_fileIcon = new QPixmap(audio_bounce_to_file_xpm);
- audio_bounce_to_trackIcon = new QPixmap(audio_bounce_to_track_xpm);
- audio_restartaudioIcon = new QPixmap(audio_restartaudio_xpm);
- edit_midiIcon = new QPixmap(edit_midi_xpm);
- midi_edit_instrumentIcon = new QPixmap(midi_edit_instrument_xpm);
- midi_init_instrIcon = new QPixmap(midi_init_instr_xpm);
-// midi_inputpluginsIcon = new QPixmap(midi_inputplugins_xpm);
- midi_local_offIcon = new QPixmap(midi_local_off_xpm);
- midi_reset_instrIcon = new QPixmap(midi_reset_instr_xpm);
- settings_appearance_settingsIcon = new QPixmap(settings_appearance_settings_xpm);
- settings_configureshortcutsIcon = new QPixmap(settings_configureshortcuts_xpm);
- settings_follow_songIcon = new QPixmap(settings_follow_song_xpm);
- settings_globalsettingsIcon = new QPixmap(settings_globalsettings_xpm);
- settings_metronomeIcon = new QPixmap(settings_metronome_xpm);
- settings_midifileexportIcon = new QPixmap(settings_midifileexport_xpm);
- settings_midisyncIcon = new QPixmap(settings_midisync_xpm);
- view_bigtime_windowIcon = new QPixmap(view_bigtime_window_xpm);
- view_cliplistIcon = new QPixmap(view_cliplist_xpm);
- view_markerIcon = new QPixmap(view_marker_xpm);
- view_mixerIcon = new QPixmap(view_mixer_xpm);
- view_transport_windowIcon = new QPixmap(view_transport_window_xpm);
+ audio_bounce_to_fileIcon = new QPixmap(audio_bounce_to_file_xpm);
+ audio_bounce_to_trackIcon = new QPixmap(audio_bounce_to_track_xpm);
+ audio_restartaudioIcon = new QPixmap(audio_restartaudio_xpm);
+ edit_midiIcon = new QPixmap(edit_midi_xpm);
+ midi_edit_instrumentIcon = new QPixmap(midi_edit_instrument_xpm);
+ midi_init_instrIcon = new QPixmap(midi_init_instr_xpm);
+ midi_local_offIcon = new QPixmap(midi_local_off_xpm);
+ midi_reset_instrIcon = new QPixmap(midi_reset_instr_xpm);
+ settings_appearance_settingsIcon = new QPixmap(settings_appearance_settings_xpm);
+ settings_configureshortcutsIcon = new QPixmap(settings_configureshortcuts_xpm);
+ settings_follow_songIcon = new QPixmap(settings_follow_song_xpm);
+ settings_globalsettingsIcon = new QPixmap(settings_globalsettings_xpm);
+ settings_metronomeIcon = new QPixmap(settings_metronome_xpm);
+ settings_midifileexportIcon = new QPixmap(settings_midifileexport_xpm);
+ settings_midisyncIcon = new QPixmap(settings_midisync_xpm);
- museIcon = new QPixmap(muse_icon_xpm);
+ museIcon = new QPixmap(muse_icon_xpm);
configIcon = new QPixmap(config_xpm);
- minusIcon = new QPixmap(minus_xpm);
- plusIcon = new QPixmap(plus_xpm);
+ minusIcon = new QPixmap(minus_xpm);
+ plusIcon = new QPixmap(plus_xpm);
recordIcon = new QIcon;
recordIcon->addFile(":/xpm/recordOn.svg", ICON_SIZE, QIcon::Normal, QIcon::On);
recordIcon->addFile(":/xpm/recordOff.svg", ICON_SIZE, QIcon::Normal, QIcon::Off);
+
onOffIcon = new QIcon;
onOffIcon->addFile(":/xpm/on.svg", ICON_SIZE, QIcon::Normal, QIcon::On);
onOffIcon->addFile(":/xpm/off.svg", ICON_SIZE, QIcon::Normal, QIcon::Off);
diff --git a/muse/muse/icons.h b/muse/muse/icons.h
index 70d90e39..788f0ad0 100644
--- a/muse/muse/icons.h
+++ b/muse/muse/icons.h
@@ -21,9 +21,6 @@
#ifndef ICONS_H
#define ICONS_H
-extern QPixmap* pointerIcon;
-extern QPixmap* pencilIcon;
-extern QPixmap* deleteIcon;
extern QPixmap* playIcon;
extern QPixmap* stickIcon;
extern QPixmap* waveIcon;
@@ -66,14 +63,7 @@ extern QPixmap* speakerIcon;
extern QPixmap* buttondownIcon;
extern QPixmap* configureIcon;
-extern QPixmap* editmuteIcon;
-extern QPixmap* editmuteSIcon;
-extern QPixmap* panicIcon;
-
-extern QIcon* pianoIconSet;
-extern QIcon* scoreIconSet;
extern QIcon* editcutIconSet;
-extern QIcon* editmuteIconSet;
extern QIcon* editcopyIconSet;
extern QIcon* editpasteIconSet;
@@ -103,8 +93,6 @@ extern QPixmap* addtrack_wavetrackIcon;
extern QPixmap* edit_drummsIcon;
extern QPixmap* edit_listIcon;
extern QPixmap* edit_mastertrackIcon;
-extern QPixmap* edit_pianorollIcon;
-extern QPixmap* edit_scoreIcon;
extern QPixmap* edit_track_addIcon;
extern QPixmap* edit_track_delIcon;
extern QPixmap* mastertrack_graphicIcon;
@@ -112,12 +100,12 @@ extern QPixmap* mastertrack_listIcon;
extern QPixmap* midi_transformIcon;
extern QPixmap* midi_transposeIcon;
extern QPixmap* selectIcon;
-extern QPixmap* select_allIcon;
+// extern QPixmap* select_allIcon;
extern QPixmap* select_all_parts_on_trackIcon;
-extern QPixmap* select_deselect_allIcon;
-extern QPixmap* select_inside_loopIcon;
-extern QPixmap* select_invert_selectionIcon;
-extern QPixmap* select_outside_loopIcon;
+// extern QPixmap* select_deselect_allIcon;
+// extern QPixmap* select_inside_loopIcon;
+// extern QPixmap* select_invert_selectionIcon;
+// extern QPixmap* select_outside_loopIcon;
extern QPixmap* audio_bounce_to_fileIcon;
extern QPixmap* audio_bounce_to_trackIcon;
@@ -134,11 +122,6 @@ extern QPixmap* settings_globalsettingsIcon;
extern QPixmap* settings_metronomeIcon;
extern QPixmap* settings_midifileexportIcon;
extern QPixmap* settings_midisyncIcon;
-extern QPixmap* view_bigtime_windowIcon;
-extern QPixmap* view_cliplistIcon;
-extern QPixmap* view_markerIcon;
-extern QPixmap* view_mixerIcon;
-extern QPixmap* view_transport_windowIcon;
extern QPixmap* museIcon;
extern QPixmap* configIcon;
diff --git a/muse/muse/marker/markerview.cpp b/muse/muse/marker/markerview.cpp
index a237b90b..7cab2d02 100644
--- a/muse/muse/marker/markerview.cpp
+++ b/muse/muse/marker/markerview.cpp
@@ -29,6 +29,7 @@
#include "al/sig.h"
#include "al/tempo.h"
#include "al/marker.h"
+#include "shortcuts.h"
enum { COL_TICK = 0, COL_SMPTE, COL_LOCK, COL_NAME };
@@ -129,8 +130,7 @@ MarkerView::MarkerView()
markerAdd->setToolTip(tr("Add Marker"));
connect(markerAdd, SIGNAL(triggered()), SLOT(addMarker()));
- QAction* markerDelete = new QAction(QIcon(*deleteIcon), tr("delete marker"), this);
- markerDelete->setToolTip(tr("Delete Marker"));
+ QAction* markerDelete = getAction("delete", this);
connect(markerDelete, SIGNAL(triggered()), SLOT(deleteMarker()));
//---------Pulldown Menu----------------------------
@@ -310,10 +310,12 @@ void MarkerView::currentChanged(QTreeWidgetItem* i)
void MarkerView::selectionChanged()
{
+#if 0
QList<QTreeWidgetItem*> sel = table->selectedItems();
if (!sel.empty()) {
MarkerItem* item = (MarkerItem*)(sel[0]);
}
+#endif
}
//---------------------------------------------------------
diff --git a/muse/muse/midiedit/dcanvas.cpp b/muse/muse/midiedit/dcanvas.cpp
index dcf24c9a..9f367683 100644
--- a/muse/muse/midiedit/dcanvas.cpp
+++ b/muse/muse/midiedit/dcanvas.cpp
@@ -266,68 +266,63 @@ bool DrumCanvas::deleteItem(CItem* item)
// cmd
//---------------------------------------------------------
-void DrumCanvas::cmd(int cmd)
+void DrumCanvas::cmd(QAction* a)
{
- switch(cmd) {
- case -1:
- return;
- case CMD_PASTE:
- paste();
- break;
- case CMD_SELECT_ALL: // select all
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- if (!k->second->isSelected())
- selectItem(k->second, true);
- }
- break;
- case CMD_SELECT_NONE: // select none
- deselectAll();
- break;
- case CMD_SELECT_INVERT: // invert selection
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- selectItem(k->second, !k->second->isSelected());
- }
- break;
- case CMD_SELECT_ILOOP: // select inside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- CItem* nevent = k->second;
- Part* part = nevent->part;
- Event event = nevent->event;
- unsigned tick = event.tick() + part->tick();
- if (tick < song->lpos() || tick >= song->rpos())
- selectItem(k->second, false);
- else
- selectItem(k->second, true);
- }
- break;
- case CMD_SELECT_OLOOP: // select outside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- CItem* nevent = k->second;
- Part* part = nevent->part;
- Event event = nevent->event;
- unsigned tick = event.tick() + part->tick();
- if (tick < song->lpos() || tick >= song->rpos())
- selectItem(k->second, true);
- else
- selectItem(k->second, false);
- }
- break;
- case CMD_DEL:
- if (selectionSize()) {
- song->startUndo();
- for (iCItem i = items.begin(); i != items.end(); ++i) {
- if (!i->second->isSelected())
- continue;
- Event ev = i->second->event;
- audio->msgDeleteEvent(ev, i->second->part, false);
- }
- song->endUndo(SC_EVENT_REMOVED);
+ QString cmd(a->data().toString());
+
+ if (cmd == "paste")
+ paste();
+ else if (cmd == "sel_all") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ if (!k->second->isSelected())
+ selectItem(k->second, true);
+ }
+ }
+ else if (cmd == "sel_none")
+ deselectAll();
+ else if (cmd == "sel_inv") {
+ for (iCItem k = items.begin(); k != items.end(); ++k)
+ selectItem(k->second, !k->second->isSelected());
+ }
+ else if (cmd == "sel_ins_loc") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ CItem* nevent = k->second;
+ Part* part = nevent->part;
+ Event event = nevent->event;
+ unsigned tick = event.tick() + part->tick();
+ if (tick < song->lpos() || tick >= song->rpos())
+ selectItem(k->second, false);
+ else
+ selectItem(k->second, true);
+ }
+ }
+ else if (cmd == "sel_out_loc") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ CItem* nevent = k->second;
+ Part* part = nevent->part;
+ Event event = nevent->event;
+ unsigned tick = event.tick() + part->tick();
+ if (tick < song->lpos() || tick >= song->rpos())
+ selectItem(k->second, true);
+ else
+ selectItem(k->second, false);
+ }
+ }
+ else if (cmd == "delete") {
+ if (selectionSize()) {
+ song->startUndo();
+ for (iCItem i = items.begin(); i != items.end(); ++i) {
+ if (!i->second->isSelected())
+ continue;
+ Event ev = i->second->event;
+ audio->msgDeleteEvent(ev, i->second->part, false);
}
- return;
-
- case CMD_FIXED_LEN: //Set notes to the length specified in the drummap
- if (!selectionSize())
- break;
+ song->endUndo(SC_EVENT_REMOVED);
+ }
+ return;
+ }
+ else if (cmd == "midi_fixed_len") {
+ if (selectionSize()) {
song->startUndo();
for (iCItem k = items.begin(); k != items.end(); ++k) {
if (k->second->isSelected()) {
@@ -339,28 +334,23 @@ void DrumCanvas::cmd(int cmd)
}
}
song->endUndo(SC_EVENT_MODIFIED);
- break;
- case CMD_LEFT:
- {
- int frames = pos[0].tick() - editor->rasterStep(pos[0].tick());
- if (frames < 0)
- frames = 0;
- Pos p(frames, AL::TICKS);
- song->setPos(0, p, true, true, true);
}
- break;
- case CMD_RIGHT:
- {
- Pos p(pos[0].tick() + editor->rasterStep(pos[0].tick()), AL::TICKS);
- song->setPos(0, p, true, true, true);
- }
- break;
- case CMD_MODIFY_VELOCITY:
- {
- Velocity w(this);
- w.setRange(editor->applyTo());
- if (!w.exec())
- break;
+ }
+ else if (cmd == "goto_left") {
+ int frames = pos[0].tick() - editor->rasterStep(pos[0].tick());
+ if (frames < 0)
+ frames = 0;
+ Pos p(frames, AL::TICKS);
+ song->setPos(0, p, true, true, true);
+ }
+ else if (cmd == "goto_right") {
+ Pos p(pos[0].tick() + editor->rasterStep(pos[0].tick()), AL::TICKS);
+ song->setPos(0, p, true, true, true);
+ }
+ else if (cmd == "mid_mod_velo") {
+ Velocity w(this);
+ w.setRange(editor->applyTo());
+ if (w.exec()) {
editor->setApplyTo(w.range());
int rate = w.rateVal();
int offset = w.offsetVal();
@@ -399,7 +389,6 @@ void DrumCanvas::cmd(int cmd)
}
song->endUndo(SC_EVENT_MODIFIED);
}
- break;
}
widget()->update();
}
diff --git a/muse/muse/midiedit/dcanvas.h b/muse/muse/midiedit/dcanvas.h
index 4390aa2f..9d4ab754 100644
--- a/muse/muse/midiedit/dcanvas.h
+++ b/muse/muse/midiedit/dcanvas.h
@@ -69,15 +69,8 @@ class DrumCanvas : public EventCanvas {
void keyReleased(int, bool);
public:
- enum {
- CMD_CUT, CMD_COPY, CMD_PASTE,
- CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT,
- CMD_SELECT_ILOOP, CMD_SELECT_OLOOP, CMD_DEL,
- CMD_FIXED_LEN, CMD_RIGHT, CMD_LEFT, CMD_MODIFY_VELOCITY,
- CMD_COMMANDS
- };
DrumCanvas(MidiEditor*);
- void cmd(int);
+ void cmd(QAction*);
virtual void modifySelected(NoteInfo::ValType type, int delta);
};
#endif
diff --git a/muse/muse/midiedit/drumedit.cpp b/muse/muse/midiedit/drumedit.cpp
index 7d783245..f4370e36 100644
--- a/muse/muse/midiedit/drumedit.cpp
+++ b/muse/muse/midiedit/drumedit.cpp
@@ -51,47 +51,33 @@ DrumEdit::DrumEdit(PartList* pl, bool init)
deltaMode = false;
drumMap = &noDrumMap;
+#if 0 //TODOB
+ cutAction->setShortcut(shortcuts[SHRT_CUT].key);
+ copyAction->setShortcut(shortcuts[SHRT_COPY].key);
+ pasteAction->setShortcut(shortcuts[SHRT_PASTE].key);
+#endif
+
//---------Pulldown Menu----------------------------
QMenuBar* mb = menuBar();
menuEdit->addSeparator();
- cmdActions[DrumCanvas::CMD_DEL] = menuEdit->addAction(tr("Delete Events"));
- cmdActions[DrumCanvas::CMD_DEL]->setData(DrumCanvas::CMD_DEL);
- cmdActions[DrumCanvas::CMD_DEL]->setIcon(*deleteIcon);
+ menuEdit->addAction(getAction("delete", this));
// Functions
menuFunctions = mb->addMenu(tr("&Functions"));
- cmdActions[DrumCanvas::CMD_FIXED_LEN] = menuFunctions->addAction(tr("Set fixed length"));
- cmdActions[DrumCanvas::CMD_FIXED_LEN]->setData(DrumCanvas::CMD_FIXED_LEN);
-
- cmdActions[DrumCanvas::CMD_MODIFY_VELOCITY] = menuFunctions->addAction(tr("Modify Velocity..."));
- cmdActions[DrumCanvas::CMD_MODIFY_VELOCITY]->setData(DrumCanvas::CMD_MODIFY_VELOCITY);
+ menuFunctions->addAction(getAction("midi_fixed_len", this));
+ menuFunctions->addAction(getAction("midi_mod_velo", this));
menuSelect = menuEdit->addMenu(tr("&Select"));
menuSelect->setIcon(QIcon(*selectIcon));
- cmdActions[DrumCanvas::CMD_SELECT_ALL] = menuSelect->addAction(tr("Select All"));
- cmdActions[DrumCanvas::CMD_SELECT_ALL]->setIcon(QIcon(*select_allIcon));
- cmdActions[DrumCanvas::CMD_SELECT_ALL]->setData(DrumCanvas::CMD_SELECT_ALL);
-
- cmdActions[DrumCanvas::CMD_SELECT_NONE] = menuSelect->addAction(tr("Select None"));
- cmdActions[DrumCanvas::CMD_SELECT_NONE]->setIcon(QIcon(*select_deselect_allIcon));
- cmdActions[DrumCanvas::CMD_SELECT_NONE]->setData(DrumCanvas::CMD_SELECT_NONE);
-
- cmdActions[DrumCanvas::CMD_SELECT_INVERT] = menuSelect->addAction(tr("Invert"));
- cmdActions[DrumCanvas::CMD_SELECT_INVERT]->setIcon(QIcon(*select_invert_selectionIcon));
- cmdActions[DrumCanvas::CMD_SELECT_INVERT]->setData(DrumCanvas::CMD_SELECT_INVERT);
-
+ menuSelect->addAction(getAction("sel_all", this));
+ menuSelect->addAction(getAction("sel_none", this));
+ menuSelect->addAction(getAction("sel_inv", this));
menuSelect->addSeparator();
-
- cmdActions[DrumCanvas::CMD_SELECT_ILOOP] = menuSelect->addAction(tr("Inside Loop"));
- cmdActions[DrumCanvas::CMD_SELECT_ILOOP]->setIcon(QIcon(*select_inside_loopIcon));
- cmdActions[DrumCanvas::CMD_SELECT_ILOOP]->setData(DrumCanvas::CMD_SELECT_ILOOP);
-
- cmdActions[DrumCanvas::CMD_SELECT_OLOOP] = menuSelect->addAction(tr("Outside Loop"));
- cmdActions[DrumCanvas::CMD_SELECT_OLOOP]->setIcon(QIcon(*select_outside_loopIcon));
- cmdActions[DrumCanvas::CMD_SELECT_OLOOP]->setData(DrumCanvas::CMD_SELECT_OLOOP);
+ menuSelect->addAction(getAction("sel_ins_loc", this));
+ menuSelect->addAction(getAction("sel_out_loc", this));
connect(menuSelect, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*)));
connect(menuFunctions, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*)));
@@ -123,7 +109,7 @@ DrumEdit::DrumEdit(PartList* pl, bool init)
QToolBar* transport = addToolBar(tr("Transport"));
muse->setupTransportToolbar(transport);
- // dont´ow pitch value in toolbar
+ // dont´ch value in toolbar
addToolBarBreak();
toolbar = new Toolbar1(initRaster, initQuant, false);
addToolBar(toolbar);
@@ -164,7 +150,6 @@ DrumEdit::DrumEdit(PartList* pl, bool init)
clipboardChanged(); // enable/disable "Paste"
selectionChanged(); // enable/disable "Copy" & "Paste"
- initShortcuts();
canvas()->selectFirst();
//
@@ -329,7 +314,7 @@ void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val)
void DrumEdit::cmd(QAction* a)
{
- canvas()->cmd(a->data().toInt());
+ canvas()->cmd(a);
}
//---------------------------------------------------------
@@ -338,7 +323,6 @@ void DrumEdit::cmd(QAction* a)
void DrumEdit::configChanged()
{
- initShortcuts();
}
#if 0
@@ -440,28 +424,6 @@ void DrumEdit::keyPressEvent(QKeyEvent* event)
}
//---------------------------------------------------------
-// initShortcuts
-//---------------------------------------------------------
-
-void DrumEdit::initShortcuts()
- {
-#if 0 //TODOB
- cutAction->setShortcut(shortcuts[SHRT_CUT].key);
- copyAction->setShortcut(shortcuts[SHRT_COPY].key);
- pasteAction->setShortcut(shortcuts[SHRT_PASTE].key);
-
- cmdActions[DrumCanvas::CMD_DEL]->setShortcut(shortcuts[SHRT_DELETE].key);
- cmdActions[DrumCanvas::CMD_FIXED_LEN]->setShortcut(shortcuts[SHRT_FIXED_LEN].key);
- cmdActions[DrumCanvas::CMD_MODIFY_VELOCITY]->setShortcut(shortcuts[SHRT_MODIFY_VELOCITY].key);
- cmdActions[DrumCanvas::CMD_SELECT_ALL]->setShortcut(shortcuts[SHRT_SELECT_ALL].key);
- cmdActions[DrumCanvas::CMD_SELECT_NONE]->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
- cmdActions[DrumCanvas::CMD_SELECT_INVERT]->setShortcut(shortcuts[SHRT_SELECT_INVERT].key);
- cmdActions[DrumCanvas::CMD_SELECT_ILOOP]->setShortcut(shortcuts[SHRT_SELECT_ILOOP].key);
- cmdActions[DrumCanvas::CMD_SELECT_OLOOP]->setShortcut(shortcuts[SHRT_SELECT_OLOOP].key);
-#endif
- }
-
-//---------------------------------------------------------
// writeConfiguration
//---------------------------------------------------------
diff --git a/muse/muse/midiedit/drumedit.h b/muse/muse/midiedit/drumedit.h
index 1e6d0bb1..0283f508 100644
--- a/muse/muse/midiedit/drumedit.h
+++ b/muse/muse/midiedit/drumedit.h
@@ -53,9 +53,6 @@ class DrumEdit : public MidiEditor {
int veloOffOffset;
bool deltaMode;
- QAction* cmdActions[DrumCanvas::CMD_COMMANDS];
-
- void initShortcuts();
virtual void closeEvent(QCloseEvent*);
QWidget* genToolbar(QWidget* parent);
virtual void keyPressEvent(QKeyEvent*);
diff --git a/muse/muse/midiedit/ecanvas.cpp b/muse/muse/midiedit/ecanvas.cpp
index 8a855ef3..96df17cf 100644
--- a/muse/muse/midiedit/ecanvas.cpp
+++ b/muse/muse/midiedit/ecanvas.cpp
@@ -708,15 +708,16 @@ QMenu* EventCanvas::genCanvasPopup()
return 0;
QMenu* canvasPopup = new QMenu(this);
- for (int i = 0; i < 9; ++i) {
+ for (int i = 0; i < TOOLS; ++i) {
int data = 1 << i;
if ((canvasTools & data) == 0)
continue;
- QAction* a = canvasPopup->addAction(**toolList[i].icon, tr(toolList[i].tip));
+ QAction* a = getAction(toolList[i], this);
a->setData(data);
a->setCheckable(true);
if (data == int(_tool))
a->setChecked(true);
+ canvasPopup->addAction(a);
}
return canvasPopup;
}
diff --git a/muse/muse/midiedit/midieditor.cpp b/muse/muse/midiedit/midieditor.cpp
index f212e2d6..7cdab03e 100644
--- a/muse/muse/midiedit/midieditor.cpp
+++ b/muse/muse/midiedit/midieditor.cpp
@@ -42,7 +42,7 @@ MidiEditor::MidiEditor(PartList* pl)
QMenuBar* mb = menuBar();
- //---------Menü-------------------------------
+ //---------Menu-------------------------------
menuEdit = new QMenu(tr("&Edit"));
mb->addMenu(menuEdit);
diff --git a/muse/muse/midiedit/pianoroll.cpp b/muse/muse/midiedit/pianoroll.cpp
index f7adad32..649c4955 100644
--- a/muse/muse/midiedit/pianoroll.cpp
+++ b/muse/muse/midiedit/pianoroll.cpp
@@ -64,33 +64,25 @@ PianoRoll::PianoRoll(PartList* pl, bool init)
tcanvas = new PianoCanvas(this);
QMenuBar* mb = menuBar();
+ menu_ids[CMD_EVENT_COLOR] = getAction("change_event_color", this);
+ menu_ids[CMD_CONFIG_QUANT] = getAction("config_quant", this);
+
//---------Menu----------------------------------
menuEdit->addSeparator();
- QAction* a;
- a = menuEdit->addAction(tr("Delete Events"));
- a->setIcon(*deleteIcon);
- a->setData(PianoCanvas::CMD_DEL);
- a->setShortcut(Qt::Key_Delete);
+ QAction* a = getAction("delete", this);
+ menuEdit->addAction(a);
+//TD? a->setData(PianoCanvas::CMD_DEL);
menuEdit->addSeparator();
menuSelect = menuEdit->addMenu(QIcon(*selectIcon),tr("&Select"));
- cmdActions[PianoCanvas::CMD_SELECT_ALL] = menuSelect->addAction(QIcon(*select_allIcon), tr("Select &All"));
- cmdActions[PianoCanvas::CMD_SELECT_ALL]->setData(PianoCanvas::CMD_SELECT_ALL);
-
- cmdActions[PianoCanvas::CMD_SELECT_NONE] = menuSelect->addAction(QIcon(*select_deselect_allIcon), tr("&Deselect All"));
- cmdActions[PianoCanvas::CMD_SELECT_NONE]->setData(PianoCanvas::CMD_SELECT_NONE);
-
- cmdActions[PianoCanvas::CMD_SELECT_INVERT] = menuSelect->addAction(QIcon(*select_invert_selectionIcon), tr("Invert &Selection"));
- cmdActions[PianoCanvas::CMD_SELECT_INVERT]->setData(PianoCanvas::CMD_SELECT_INVERT);
-
- cmdActions[PianoCanvas::CMD_SELECT_ILOOP] = menuSelect->addAction(QIcon(*select_inside_loopIcon), tr("&Inside Loop"));
- cmdActions[PianoCanvas::CMD_SELECT_ILOOP]->setData(PianoCanvas::CMD_SELECT_ILOOP);
-
- cmdActions[PianoCanvas::CMD_SELECT_OLOOP] = menuSelect->addAction(QIcon(*select_outside_loopIcon), tr("&Outside Loop"));
- cmdActions[PianoCanvas::CMD_SELECT_OLOOP]->setData(PianoCanvas::CMD_SELECT_OLOOP);
+ menuSelect->addAction(getAction("sel_all", this));
+ menuSelect->addAction(getAction("sel_none", this));
+ menuSelect->addAction(getAction("sel_inv", this));
+ menuSelect->addAction(getAction("sel_ins_loc", this));
+ menuSelect->addAction(getAction("sel_out_loc", this));
menuConfig = mb->addMenu(tr("&Config"));
eventColor = menuConfig->addMenu(tr("event color"));
@@ -108,14 +100,11 @@ PianoRoll::PianoRoll(PartList* pl, bool init)
connect(eventColor, SIGNAL(triggered(QAction*)), SLOT(setEventColorMode(QAction*)));
menuFunctions = mb->addMenu(tr("&Functions"));
- cmdActions[PianoCanvas::CMD_OVER_QUANTIZE] = menuFunctions->addAction(tr("Over Quantize"));
- cmdActions[PianoCanvas::CMD_OVER_QUANTIZE]->setData(PianoCanvas::CMD_OVER_QUANTIZE);
- cmdActions[PianoCanvas::CMD_ON_QUANTIZE] = menuFunctions->addAction(tr("Note On Quantize"));
- cmdActions[PianoCanvas::CMD_ON_QUANTIZE]->setData(PianoCanvas::CMD_ON_QUANTIZE);
- cmdActions[PianoCanvas::CMD_ONOFF_QUANTIZE] = menuFunctions->addAction(tr("Note On/Off Quantize"));
- cmdActions[PianoCanvas::CMD_ONOFF_QUANTIZE]->setData(PianoCanvas::CMD_ONOFF_QUANTIZE);
- cmdActions[PianoCanvas::CMD_ITERATIVE_QUANTIZE] = menuFunctions->addAction(tr("Iterative Quantize"));
- cmdActions[PianoCanvas::CMD_ITERATIVE_QUANTIZE]->setData(PianoCanvas::CMD_ITERATIVE_QUANTIZE);
+
+ menuFunctions->addAction(getAction("midi_over_quant", this));
+ menuFunctions->addAction(getAction("midi_quant_noteon", this));
+ menuFunctions->addAction(getAction("midi_quant_noteoff", this));
+ menuFunctions->addAction(getAction("midi_quant_iterative", this));
menuFunctions->addSeparator();
@@ -124,51 +113,21 @@ PianoRoll::PianoRoll(PartList* pl, bool init)
menuFunctions->addSeparator();
- cmdActions[PianoCanvas::CMD_MODIFY_GATE_TIME] = menuFunctions->addAction(tr("Modify Gate Time"));
- cmdActions[PianoCanvas::CMD_MODIFY_GATE_TIME]->setData(PianoCanvas::CMD_MODIFY_GATE_TIME);
-
- cmdActions[PianoCanvas::CMD_MODIFY_VELOCITY] = menuFunctions->addAction(tr("Modify Velocity"));
- cmdActions[PianoCanvas::CMD_MODIFY_VELOCITY]->setData(PianoCanvas::CMD_MODIFY_VELOCITY);
-
- cmdActions[PianoCanvas::CMD_CRESCENDO] = menuFunctions->addAction(tr("Crescendo"));
- cmdActions[PianoCanvas::CMD_CRESCENDO]->setData(PianoCanvas::CMD_CRESCENDO);
- cmdActions[PianoCanvas::CMD_CRESCENDO]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_TRANSPOSE] = menuFunctions->addAction(tr("Transpose"));
- cmdActions[PianoCanvas::CMD_TRANSPOSE]->setData(PianoCanvas::CMD_TRANSPOSE);
- cmdActions[PianoCanvas::CMD_TRANSPOSE]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_THIN_OUT] = menuFunctions->addAction(tr("Thin Out"));
- cmdActions[PianoCanvas::CMD_THIN_OUT]->setData(PianoCanvas::CMD_THIN_OUT);
- cmdActions[PianoCanvas::CMD_THIN_OUT]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_ERASE_EVENT] = menuFunctions->addAction(tr("Erase Event"));
- cmdActions[PianoCanvas::CMD_ERASE_EVENT]->setData(PianoCanvas::CMD_ERASE_EVENT);
- cmdActions[PianoCanvas::CMD_ERASE_EVENT]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_NOTE_SHIFT] = menuFunctions->addAction(tr("Note Shift"));
- cmdActions[PianoCanvas::CMD_NOTE_SHIFT]->setData(PianoCanvas::CMD_NOTE_SHIFT);
- cmdActions[PianoCanvas::CMD_NOTE_SHIFT]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_MOVE_CLOCK] = menuFunctions->addAction(tr("Move Clock"));
- cmdActions[PianoCanvas::CMD_MOVE_CLOCK]->setData(PianoCanvas::CMD_MOVE_CLOCK);
- cmdActions[PianoCanvas::CMD_MOVE_CLOCK]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_COPY_MEASURE] = menuFunctions->addAction(tr("Copy Measure"));
- cmdActions[PianoCanvas::CMD_COPY_MEASURE]->setData(PianoCanvas::CMD_COPY_MEASURE);
- cmdActions[PianoCanvas::CMD_COPY_MEASURE]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_ERASE_MEASURE] = menuFunctions->addAction(tr("Erase Measure"));
- cmdActions[PianoCanvas::CMD_ERASE_MEASURE]->setData(PianoCanvas::CMD_ERASE_MEASURE);
- cmdActions[PianoCanvas::CMD_ERASE_MEASURE]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_DELETE_MEASURE] = menuFunctions->addAction(tr("Delete Measure"));
- cmdActions[PianoCanvas::CMD_DELETE_MEASURE]->setData(PianoCanvas::CMD_DELETE_MEASURE);
- cmdActions[PianoCanvas::CMD_DELETE_MEASURE]->setEnabled(false);
-
- cmdActions[PianoCanvas::CMD_CREATE_MEASURE] = menuFunctions->addAction(tr("Create Measure"));
- cmdActions[PianoCanvas::CMD_CREATE_MEASURE]->setData(PianoCanvas::CMD_CREATE_MEASURE);
- cmdActions[PianoCanvas::CMD_CREATE_MEASURE]->setEnabled(false);
+ menuFunctions->addAction(getAction("midi_mod_gate_time", this));
+ menuFunctions->addAction(getAction("midi_mod_velo", this));
+
+#if 0 // TODO
+ menuFunctions->addAction(getAction("midi_crescendo", this));
+ menuFunctions->addAction(getAction("midi_transpose", this));
+ menuFunctions->addAction(getAction("midi_thin_out", this));
+ menuFunctions->addAction(getAction("midi_erase_event", this));
+ menuFunctions->addAction(getAction("midi_note_shift", this));
+ menuFunctions->addAction(getAction("midi_move_clock", this));
+ menuFunctions->addAction(getAction("midi_copy_measure", this));
+ menuFunctions->addAction(getAction("midi_erase_measure", this));
+ menuFunctions->addAction(getAction("midi_delete_measure", this));
+ menuFunctions->addAction(getAction("midi_create_measure", this));
+#endif
connect(menuSelect, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*)));
connect(menuFunctions, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*)));
@@ -247,26 +206,25 @@ PianoRoll::PianoRoll(PartList* pl, bool init)
clipboardChanged(); // enable/disable "Paste"
selectionChanged(); // enable/disable "Copy" & "Paste"
- initShortcuts(); // initialize shortcuts
//
// install misc shortcuts
//
-#if 0 //TODOB
- QShortcut* sc;
- sc = new QShortcut(shortcuts[SHRT_POS_INC].key, this);
- sc->setContext(Qt::WindowShortcut);
- connect(sc, SIGNAL(activated()), SLOT(cmdRight()));
-
- sc = new QShortcut(shortcuts[SHRT_POS_DEC].key, this);
- sc->setContext(Qt::WindowShortcut);
- connect(sc, SIGNAL(activated()), SLOT(cmdLeft()));
-
- sc = new QShortcut(Qt::Key_Escape, this);
+
+ a = getAction("curpos_increase", this);
+ a->setShortcutContext(Qt::WindowShortcut);
+ addAction(a);
+ connect(a, SIGNAL(triggered()), SLOT(cmdRight()));
+
+ a = getAction("curpos_decrease", this);
+ a->setShortcutContext(Qt::WindowShortcut);
+ addAction(a);
+ connect(a, SIGNAL(triggered()), SLOT(cmdLeft()));
+
+ QShortcut* sc = new QShortcut(Qt::Key_Escape, this);
sc->setContext(Qt::WindowShortcut);
connect(sc, SIGNAL(activated()), SLOT(close()));
-#endif
connect(song, SIGNAL(songChanged(int)), canvas(), SLOT(songChanged(int)));
connect(followSongAction, SIGNAL(toggled(bool)), canvas(), SLOT(setFollow(bool)));
@@ -308,7 +266,6 @@ void PianoRoll::cmdRight()
void PianoRoll::configChanged()
{
- initShortcuts();
}
//---------------------------------------------------------
@@ -318,8 +275,7 @@ void PianoRoll::configChanged()
void PianoRoll::cmd(QAction* a)
{
- int cmd = a->data().toInt();
- canvas()->cmd(cmd, _quantStrength, _quantLimit, _quantLen);
+ canvas()->cmd(a, _quantStrength, _quantLimit, _quantLen);
}
//---------------------------------------------------------
@@ -474,30 +430,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
PianoCanvas* pc = canvas();
int key = event->key();
- if (event->modifiers() & Qt::ShiftModifier)
- key += Qt::SHIFT;
- if (event->modifiers() & Qt::AltModifier)
- key += Qt::ALT;
- if (event->modifiers() & Qt::ControlModifier)
- key+= Qt::CTRL;
-
- if (key == shortcuts[SHRT_TOOL_POINTER].key) {
- tools2->set(PointerTool);
- return;
- }
- else if (key == shortcuts[SHRT_TOOL_PENCIL].key) {
- tools2->set(PencilTool);
- return;
- }
- else if (key == shortcuts[SHRT_TOOL_RUBBER].key) {
- tools2->set(RubberTool);
- return;
- }
- else if (key == shortcuts[SHRT_TOOL_LINEDRAW].key) {
- tools2->set(DrawTool);
- return;
- }
- else if (key == shortcuts[SHRT_INSERT_AT_LOCATION].key) {
+ if (key == shortcuts[SHRT_INSERT_AT_LOCATION].key) {
pc->pianoCmd(MCMD_INSERT);
return;
}
@@ -521,6 +454,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
val = rasterTable[2 + off];
else if (key == shortcuts[SHRT_TOGGLE_TRIOL].key)
val = rasterTable[index + ((off == 0) ? 9 : 0)];
+
else if (key == shortcuts[SHRT_EVENT_COLOR].key) {
_colorMode = (_colorMode + 1) % 3;
setEventColorMode(_colorMode);
@@ -529,7 +463,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
else if (key == shortcuts[SHRT_TOGGLE_PUNCT].key)
val = rasterTable[index + ((off == 18) ? 9 : 18)];
- else if (key == shortcuts[SHRT_TOGGLE_PUNCT2].key) {//CDW
+ else if (key == shortcuts[SHRT_TOGGLE_PUNCT2].key) {
if ((off == 18) && (index > 2)) {
val = rasterTable[index + 9 - 1];
}
@@ -584,42 +518,6 @@ void PianoRoll::setEventColorMode(int mode)
}
//---------------------------------------------------------
-// initShortcuts
-//---------------------------------------------------------
-
-void PianoRoll::initShortcuts()
- {
-#if 0 //TODOB
- cmdActions[PianoCanvas::CMD_SELECT_NONE]->setShortcut(shortcuts[SHRT_SELECT_ALL].key);
- cmdActions[PianoCanvas::CMD_SELECT_NONE]->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
- cmdActions[PianoCanvas::CMD_SELECT_INVERT]->setShortcut(shortcuts[SHRT_SELECT_INVERT].key);
- cmdActions[PianoCanvas::CMD_SELECT_ILOOP]->setShortcut(shortcuts[SHRT_SELECT_ILOOP].key);
- cmdActions[PianoCanvas::CMD_SELECT_OLOOP]->setShortcut(shortcuts[SHRT_SELECT_OLOOP].key);
-
- menu_ids[CMD_EVENT_COLOR]->setShortcut(shortcuts[SHRT_EVENT_COLOR].key);
-
- cmdActions[PianoCanvas::CMD_OVER_QUANTIZE]->setShortcut(shortcuts[SHRT_OVER_QUANTIZE].key);
- cmdActions[PianoCanvas::CMD_ON_QUANTIZE]->setShortcut(shortcuts[SHRT_ON_QUANTIZE].key);
- cmdActions[PianoCanvas::CMD_ONOFF_QUANTIZE]->setShortcut(shortcuts[SHRT_ONOFF_QUANTIZE].key);
- cmdActions[PianoCanvas::CMD_ITERATIVE_QUANTIZE]->setShortcut(shortcuts[SHRT_ITERATIVE_QUANTIZE].key);
- cmdActions[PianoCanvas::CMD_MODIFY_GATE_TIME]->setShortcut(shortcuts[SHRT_MODIFY_GATE_TIME].key);
- cmdActions[PianoCanvas::CMD_MODIFY_VELOCITY]->setShortcut(shortcuts[SHRT_MODIFY_VELOCITY].key);
- cmdActions[PianoCanvas::CMD_CRESCENDO]->setShortcut(shortcuts[SHRT_CRESCENDO].key);
- cmdActions[PianoCanvas::CMD_TRANSPOSE]->setShortcut(shortcuts[SHRT_TRANSPOSE].key);
- cmdActions[PianoCanvas::CMD_THIN_OUT]->setShortcut(shortcuts[SHRT_THIN_OUT].key);
- cmdActions[PianoCanvas::CMD_ERASE_EVENT]->setShortcut(shortcuts[SHRT_ERASE_EVENT].key);
- cmdActions[PianoCanvas::CMD_NOTE_SHIFT]->setShortcut(shortcuts[SHRT_NOTE_SHIFT].key);
- cmdActions[PianoCanvas::CMD_MOVE_CLOCK]->setShortcut(shortcuts[SHRT_MOVE_CLOCK].key);
- cmdActions[PianoCanvas::CMD_COPY_MEASURE]->setShortcut(shortcuts[SHRT_COPY_MEASURE].key);
- cmdActions[PianoCanvas::CMD_ERASE_MEASURE]->setShortcut(shortcuts[SHRT_ERASE_MEASURE].key);
- cmdActions[PianoCanvas::CMD_DELETE_MEASURE]->setShortcut(shortcuts[SHRT_DELETE_MEASURE].key);
- cmdActions[PianoCanvas::CMD_CREATE_MEASURE]->setShortcut(shortcuts[SHRT_CREATE_MEASURE].key);
-
- menu_ids[CMD_CONFIG_QUANT]->setShortcut(shortcuts[SHRT_CONFIG_QUANT].key);
-#endif
- }
-
-//---------------------------------------------------------
// readConfiguration
// read static init values
//---------------------------------------------------------
@@ -661,4 +559,3 @@ void PianoRoll::writeConfiguration(Xml& xml)
xml.intTag("quant", PianoRoll::initQuant);
xml.etag("PianoRoll");
}
-
diff --git a/muse/muse/midiedit/pianoroll.h b/muse/muse/midiedit/pianoroll.h
index 67f452b0..3d9a9ae1 100644
--- a/muse/muse/midiedit/pianoroll.h
+++ b/muse/muse/midiedit/pianoroll.h
@@ -66,12 +66,8 @@ class PianoRoll : public MidiEditor {
bool deltaMode;
QAction* colorModeAction[3];
- QAction* cmdActions[PianoCanvas::CMD_END];
-
QMenu* eventColor;
-
QuantConfig* quantConfig;
- void initShortcuts();
QWidget* genToolbar(QWidget* parent);
virtual void keyPressEvent(QKeyEvent*);
diff --git a/muse/muse/midiedit/prcanvas.cpp b/muse/muse/midiedit/prcanvas.cpp
index 23d7545b..e0403120 100644
--- a/muse/muse/midiedit/prcanvas.cpp
+++ b/muse/muse/midiedit/prcanvas.cpp
@@ -382,95 +382,71 @@ void PianoCanvas::pianoCmd(int cmd)
// pulldown menu commands
//---------------------------------------------------------
-void PianoCanvas::cmd(int cmd, int quantStrength, int quantLimit, bool quantLen)
+void PianoCanvas::cmd(QAction* a, int quantStrength, int quantLimit, bool quantLen)
{
- switch (cmd) {
- case CMD_PASTE:
- paste();
- break;
- case CMD_DEL:
- if (selectionSize()) {
- song->startUndo();
- for (iCItem i = items.begin(); i != items.end(); ++i) {
- if (!i->second->isSelected())
- continue;
- Event ev = i->second->event;
- audio->msgDeleteEvent(ev, i->second->part, false);
- }
- song->endUndo(SC_EVENT_REMOVED);
- }
- return;
- case CMD_OVER_QUANTIZE: // over quantize
- quantize(100, 1, quantLen);
- break;
- case CMD_ON_QUANTIZE: // note on quantize
- quantize(50, 1, false);
- break;
- case CMD_ONOFF_QUANTIZE: // note on/off quantize
- quantize(50, 1, true);
- break;
- case CMD_ITERATIVE_QUANTIZE: // Iterative Quantize
- quantize(quantStrength, quantLimit, quantLen);
- break;
- case CMD_SELECT_ALL: // select all
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- if (!k->second->isSelected())
- selectItem(k->second, true);
- }
- break;
- case CMD_SELECT_NONE: // select none
- deselectAll();
- break;
- case CMD_SELECT_INVERT: // invert selection
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- selectItem(k->second, !k->second->isSelected());
- }
- break;
- case CMD_SELECT_ILOOP: // select inside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- CItem* item = k->second;
- Event event = item->event;
- unsigned tick = event.tick();
- if (tick < song->lpos() || tick >= song->rpos())
- selectItem(k->second, false);
- else
- selectItem(k->second, true);
- }
- break;
- case CMD_SELECT_OLOOP: // select outside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
- CItem* item = k->second;
- Event event = item->event;
- unsigned tick = event.tick();
- if (tick < song->lpos() || tick >= song->rpos())
- selectItem(k->second, true);
- else
- selectItem(k->second, false);
- }
- break;
- case CMD_MODIFY_GATE_TIME:
- cmdModifyGateTime->processEvents(&items);
- break;
+ QString cmd(a->data().toString());
- case CMD_MODIFY_VELOCITY:
- cmdModifyVelocity->processEvents(&items);
- break;
-
- case CMD_CRESCENDO:
- case CMD_TRANSPOSE:
- case CMD_THIN_OUT:
- case CMD_ERASE_EVENT:
- case CMD_NOTE_SHIFT:
- case CMD_MOVE_CLOCK:
- case CMD_COPY_MEASURE:
- case CMD_ERASE_MEASURE:
- case CMD_DELETE_MEASURE:
- case CMD_CREATE_MEASURE:
- break;
- default:
-// printf("unknown ecanvas cmd %d\n", cmd);
- break;
+ if (cmd == "paste")
+ paste();
+ else if (cmd == "delete") {
+ if (selectionSize()) {
+ song->startUndo();
+ for (iCItem i = items.begin(); i != items.end(); ++i) {
+ if (!i->second->isSelected())
+ continue;
+ Event ev = i->second->event;
+ audio->msgDeleteEvent(ev, i->second->part, false);
+ }
+ song->endUndo(SC_EVENT_REMOVED);
+ }
+ return;
+ }
+ if (cmd == "midi_over_quant")
+ quantize(100, 1, quantLen);
+ else if (cmd == "midi_quant_noteon")
+ quantize(50, 1, false);
+ else if (cmd == "midi_quant_noteoff")
+ quantize(50, 1, true);
+ else if (cmd == "midi_quant_iterative")
+ quantize(quantStrength, quantLimit, quantLen);
+ else if (cmd == "sel_all") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ if (!k->second->isSelected())
+ selectItem(k->second, true);
+ }
+ }
+ else if (cmd == "sel_none")
+ deselectAll();
+ else if (cmd == "sel_inv") {
+ for (iCItem k = items.begin(); k != items.end(); ++k)
+ selectItem(k->second, !k->second->isSelected());
+ }
+ else if (cmd == "sel_ins_loc") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ CItem* item = k->second;
+ Event event = item->event;
+ unsigned tick = event.tick();
+ if (tick < song->lpos() || tick >= song->rpos())
+ selectItem(k->second, false);
+ else
+ selectItem(k->second, true);
+ }
+ }
+ else if (cmd == "sel_out_loc") {
+ for (iCItem k = items.begin(); k != items.end(); ++k) {
+ CItem* item = k->second;
+ Event event = item->event;
+ unsigned tick = event.tick();
+ if (tick < song->lpos() || tick >= song->rpos())
+ selectItem(k->second, true);
+ else
+ selectItem(k->second, false);
+ }
}
+ else if (cmd == "midi_mod_gate_time")
+ cmdModifyGateTime->processEvents(&items);
+ else if (cmd == "midi_mod_velo")
+ cmdModifyVelocity->processEvents(&items);
updateSelection();
widget()->update();
}
@@ -759,7 +735,6 @@ CItem* PianoCanvas::searchItem(const QPoint& pt) const
void PianoCanvas::selectLasso(bool toggle)
{
QRect r(
-// lrint((lasso.x() - MAP_OFFSET + wpos.x()) / _xmag),
lrint((lasso.x() + wpos.x()) / _xmag),
lrint((lasso.y() + wpos.y()) / _ymag),
lrint(lasso.width() / _xmag),
diff --git a/muse/muse/midiedit/prcanvas.h b/muse/muse/midiedit/prcanvas.h
index 95e4cecc..7f92e95e 100644
--- a/muse/muse/midiedit/prcanvas.h
+++ b/muse/muse/midiedit/prcanvas.h
@@ -66,22 +66,8 @@ class PianoCanvas : public EventCanvas {
void pianoCmd(int);
public:
- enum {
- CMD_CUT, CMD_COPY, CMD_PASTE,
- CMD_DEL,
- CMD_OVER_QUANTIZE, CMD_ON_QUANTIZE, CMD_ONOFF_QUANTIZE,
- CMD_ITERATIVE_QUANTIZE,
- CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT,
- CMD_SELECT_ILOOP, CMD_SELECT_OLOOP,
- CMD_MODIFY_GATE_TIME, CMD_MODIFY_VELOCITY,
- CMD_CRESCENDO, CMD_TRANSPOSE, CMD_THIN_OUT, CMD_ERASE_EVENT,
- CMD_NOTE_SHIFT, CMD_MOVE_CLOCK, CMD_COPY_MEASURE,
- CMD_ERASE_MEASURE, CMD_DELETE_MEASURE, CMD_CREATE_MEASURE,
- CMD_END
- };
-
PianoCanvas(MidiEditor*);
- void cmd(int, int, int, bool);
+ void cmd(QAction*, int, int, bool);
void setColorMode(int mode);
virtual void modifySelected(NoteInfo::ValType type, int delta);
};
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp
index 96a9f8ac..a5eef6ce 100644
--- a/muse/muse/muse.cpp
+++ b/muse/muse/muse.cpp
@@ -398,8 +398,23 @@ void MusE::setupTransportToolbar(QToolBar* tb) const
tb->addAction(punchinAction);
tb->addAction(punchoutAction);
tb->addAction(startAction);
- tb->addAction(rewindAction);
- tb->addAction(forwardAction);
+
+ // hack to implement auto repeat:
+ // the action auto repeat does only work for
+ // shortcuts but not for mouse press:
+
+ QToolButton* rewindTb = new QToolButton;
+ rewindTb->setDefaultAction(rewindAction);
+ rewindTb->setAutoRepeat(true);
+ tb->addWidget(rewindTb);
+ connect(rewindTb, SIGNAL(clicked()), song, SLOT(rewind()));
+
+ QToolButton* forwardTb = new QToolButton;
+ forwardTb->setDefaultAction(forwardAction);
+ forwardTb->setAutoRepeat(true);
+ tb->addWidget(forwardTb);
+ connect(forwardTb, SIGNAL(clicked()), song, SLOT(forward()));
+
tb->addAction(stopAction);
tb->addAction(playAction);
tb->addAction(recordAction);
@@ -462,7 +477,7 @@ MusE::MusE()
recordAction->setCheckable(true);
connect(recordAction, SIGNAL(triggered(bool)), song, SLOT(setRecord(bool)));
- panicAction = new QAction(QIcon(*panicIcon), tr("Panic"), this);
+ panicAction = getAction("panic", this);
connect(panicAction, SIGNAL(triggered()), song, SLOT(panic()));
startAction = getAction("start", this);
@@ -476,14 +491,24 @@ MusE::MusE()
a->setShortcutContext(Qt::ApplicationShortcut);
connect(a, SIGNAL(triggered()), SLOT(playToggle()));
addAction(a);
+
+ a = getAction("toggle_metro", this);
+ connect(a, SIGNAL(triggered()), song, SLOT(toggleClick()));
+ addAction(a);
+
+ a = getAction("goto_left", this);
+ connect(a, SIGNAL(triggered()), song, SLOT(gotoLeftMarker()));
+ addAction(a);
+
+ a = getAction("goto_right", this);
+ connect(a, SIGNAL(triggered()), song, SLOT(gotoRightMarker()));
+ addAction(a);
rewindAction = getAction("rewind", this);
rewindAction->setAutoRepeat(true);
- connect(rewindAction, SIGNAL(triggered()), song, SLOT(rewind()));
forwardAction = getAction("forward", this);
forwardAction->setAutoRepeat(true);
- connect(forwardAction, SIGNAL(triggered()), song, SLOT(forward()));
stopAction = getAction("stop", this);
stopAction->setCheckable(true);
@@ -526,21 +551,19 @@ MusE::MusE()
}
midiDriver = &alsaMidi;
#endif
- //----Actions
-
fileOpenAction = getAction("open_project", this);
+ connect(fileOpenAction, SIGNAL(triggered()), SLOT(loadProject()));
+
fileSaveAction = getAction("save_project", this);
+ connect(fileSaveAction, SIGNAL(triggered()), SLOT(save()));
- pianoAction = new QAction(*pianoIconSet, tr("Pianoroll"), this);
+ pianoAction = getAction("open_pianoroll", this);
connect(pianoAction, SIGNAL(triggered()), SLOT(startPianoroll()));
- trackerAction = new QAction(*pianoIconSet, tr("MidiTracker"), this);
+ trackerAction = getAction("open_miditracker", this);
connect(trackerAction, SIGNAL(triggered()), SLOT(startMidiTrackerEditor()));
- connect(fileOpenAction, SIGNAL(triggered()), SLOT(loadProject()));
- connect(fileSaveAction, SIGNAL(triggered()), SLOT(save()));
-
//--------------------------------------------------
// Toolbar
//--------------------------------------------------
@@ -632,7 +655,8 @@ MusE::MusE()
pasteAction->setData(CMD_PASTE);
pasteAction->setShortcut(Qt::CTRL + Qt::Key_V);
- menuEditActions[CMD_DELETE] = menuEdit->addAction(*deleteIcon, tr("&Delete Parts"));
+ menuEditActions[CMD_DELETE] = getAction("delete", this);
+ menuEdit->addAction(menuEditActions[CMD_DELETE]);
menuEditActions[CMD_DELETE]->setData(CMD_DELETE);
menuEdit->addSeparator();
@@ -646,17 +670,28 @@ MusE::MusE()
menuEdit->addSeparator();
select = menuEdit->addMenu(QIcon(*selectIcon), tr("Select"));
- menuEditActions[CMD_SELECT_ALL] = select->addAction(QIcon(*select_allIcon), tr("Select &All"));
+ menuEditActions[CMD_SELECT_ALL] = getAction("sel_all", this);
+ select->addAction(menuEditActions[CMD_SELECT_ALL]);
menuEditActions[CMD_SELECT_ALL]->setData(CMD_SELECT_ALL);
- menuEditActions[CMD_SELECT_NONE] = select->addAction(QIcon(*select_deselect_allIcon), tr("&Deselect All"));
+
+ menuEditActions[CMD_SELECT_NONE] = getAction("sel_none", this);
+ select->addAction(menuEditActions[CMD_SELECT_NONE]);
menuEditActions[CMD_SELECT_NONE]->setData(CMD_SELECT_NONE);
- menuEditActions[CMD_SELECT_INVERT] = select->addAction(QIcon(*select_invert_selectionIcon), tr("Invert &Selection"));
+
+ menuEditActions[CMD_SELECT_INVERT] = getAction("sel_inv", this);
+ select->addAction(menuEditActions[CMD_SELECT_INVERT]);
menuEditActions[CMD_SELECT_INVERT]->setData(CMD_SELECT_INVERT);
- menuEditActions[CMD_SELECT_ILOOP] = select->addAction(QIcon(*select_inside_loopIcon), tr("&Inside Loop"));
+
+ menuEditActions[CMD_SELECT_ILOOP] = getAction("sel_ins_loc", this);
+ select->addAction(menuEditActions[CMD_SELECT_ILOOP]);
menuEditActions[CMD_SELECT_ILOOP]->setData(CMD_SELECT_ILOOP);
- menuEditActions[CMD_SELECT_OLOOP] = select->addAction(QIcon(*select_outside_loopIcon), tr("&Outside Loop"));
+
+ menuEditActions[CMD_SELECT_OLOOP] = getAction("sel_out_loc", this);
+ select->addAction(menuEditActions[CMD_SELECT_OLOOP]);
menuEditActions[CMD_SELECT_OLOOP]->setData(CMD_SELECT_OLOOP);
- menuEditActions[CMD_SELECT_PARTS] = select->addAction(QIcon(*select_all_parts_on_trackIcon), tr("All &Parts on Track"));
+
+ menuEditActions[CMD_SELECT_PARTS] = getAction("select_parts_on_track", this);
+ select->addAction(menuEditActions[CMD_SELECT_PARTS]);
menuEditActions[CMD_SELECT_PARTS]->setData(CMD_SELECT_PARTS);
menuEdit->addSeparator();
@@ -703,20 +738,29 @@ MusE::MusE()
menuView = mb->addMenu(tr("&View"));
- tr_id = menuView->addAction(QIcon(*view_transport_windowIcon), tr("Transport Panel"));
+ tr_id = getAction("toggle_transport", this);
tr_id->setCheckable(true);
+ menuView->addAction(tr_id);
connect(tr_id, SIGNAL(triggered(bool)), this, SLOT(showTransport(bool)));
- bt_id = menuView->addAction(QIcon(*view_bigtime_windowIcon), tr("Bigtime window"));
+
+ bt_id = getAction("toggle_bigtime", this);
bt_id->setCheckable(true);
+ menuView->addAction(bt_id);
connect(bt_id, SIGNAL(triggered(bool)), this, SLOT(showBigtime(bool)));
- aid1a = menuView->addAction(QIcon(*mixerSIcon), tr("Mixer 1"));
+
+ aid1a = getAction("toggle_mixer1", this);
aid1a->setCheckable(true);
+ menuView->addAction(aid1a);
connect(aid1a, SIGNAL(triggered(bool)), this, SLOT(showMixer1(bool)));
- aid1b = menuView->addAction(QIcon(*mixerSIcon), tr("Mixer 2"));
+
+ aid1b = getAction("toggle_mixer2", this);
aid1b->setCheckable(true);
+ menuView->addAction(aid1b);
connect(aid1b, SIGNAL(triggered(bool)), this, SLOT(showMixer2(bool)));
- mk_id = menuView->addAction(QIcon(*view_markerIcon), tr("Marker"));
+
+ mk_id = getAction("marker_window", this);
mk_id->setCheckable(true);
+ menuView->addAction(mk_id);
connect(mk_id , SIGNAL(triggered(bool)), this, SLOT(showMarker(bool)));
//-------------------------------------------------------------
@@ -1662,54 +1706,6 @@ void MusE::playToggle()
}
//---------------------------------------------------------
-// kbAccel
-//---------------------------------------------------------
-
-void MusE::kbAccel(int /*key*/)
- {
-#if 0 //TODOB
- if (key == shortcuts[SHRT_TOGGLE_METRO].key) {
- song->setClick(!song->click());
- }
- else if (key == shortcuts[SHRT_STOP].key) {
- song->setStop(true);
- }
- else if (key == shortcuts[SHRT_PLAY_SONG].key ) {
- song->setPlay(true);
- }
- else if (key == shortcuts[SHRT_GOTO_LEFT].key) {
- if (!song->record())
- song->setPos(0, song->lPos());
- }
- else if (key == shortcuts[SHRT_GOTO_RIGHT].key) {
- if (!song->record())
- song->setPos(0, song->rPos());
- }
- else if (key == shortcuts[SHRT_TOGGLE_LOOP].key) {
- song->setLoop(!song->loop());
- }
- else if (key == shortcuts[SHRT_START_REC].key) {
- if (!audio->isPlaying()) {
- song->setRecord(!song->record());
- }
- }
- else if (key == shortcuts[SHRT_OPEN_TRANSPORT].key) {
- showTransport(!tr_id->isChecked());
- }
- else if (key == shortcuts[SHRT_OPEN_BIGTIME].key) {
- showBigtime(!bt_id->isChecked());
- }
- else if (key == shortcuts[SHRT_OPEN_MIXER].key) {
- showMixer1(!aid1a->isChecked());
- }
- else {
- if (debugMsg)
- printf("unknown kbAccel 0x%x\n", key);
- }
-#endif
- }
-
-//---------------------------------------------------------
// MuseApplication
//---------------------------------------------------------
@@ -1725,24 +1721,6 @@ MuseApplication::MuseApplication(int& argc, char** argv)
}
//---------------------------------------------------------
-// notify
-//---------------------------------------------------------
-
-bool MuseApplication::notify(QObject* receiver, QEvent* event)
- {
- bool flag = QApplication::notify(receiver, event);
- if (event->type() == QEvent::KeyPress) {
- QKeyEvent* ke = (QKeyEvent*)event;
- bool accepted = ke->isAccepted();
- if (!accepted) {
- muse->kbAccel(ke->key());
- return true;
- }
- }
- return flag;
- }
-
-//---------------------------------------------------------
// usage
//---------------------------------------------------------
diff --git a/muse/muse/muse.h b/muse/muse/muse.h
index 51dc3157..9b2ac9ff 100644
--- a/muse/muse/muse.h
+++ b/muse/muse/muse.h
@@ -324,7 +324,6 @@ class MuseApplication : public QApplication {
public:
MuseApplication(int& argc, char** argv);
void setMuse(MusE* m) { muse = m; }
- bool notify(QObject* receiver, QEvent* event);
static Shortcut sc[];
};
diff --git a/muse/muse/muse.qrc b/muse/muse/muse.qrc
index e4b807c3..4f17f18a 100644
--- a/muse/muse/muse.qrc
+++ b/muse/muse/muse.qrc
@@ -30,6 +30,29 @@
<file>xpm/punchout.xpm</file>
<file>xpm/undo.xpm</file>
<file>xpm/redo.xpm</file>
+ <file>xpm/panic.xpm</file>
+ <file>xpm/piano.xpm</file>
+ <file>xpm/view_transport_window.xpm</file>
+ <file>xpm/view_bigtime_window.xpm</file>
+ <file>xpm/view_cliplist.xpm</file>
+ <file>xpm/view_marker.xpm</file>
+ <file>xpm/view_mixer.xpm</file>
+
+ <file>xpm/pointer.xpm</file>
+ <file>xpm/pencil.xpm</file>
+ <file>xpm/delete.xpm</file>
+ <file>xpm/cut.xpm</file>
+ <file>xpm/glue.xpm</file>
+ <file>xpm/quant.xpm</file>
+ <file>xpm/draw.xpm</file>
+ <file>xpm/editmute.xpm</file>
+
+ <file>xpm/select_all.xpm</file>
+ <file>xpm/select_deselect_all.xpm</file>
+ <file>xpm/select_invert_selection.xpm</file>
+ <file>xpm/select_inside_loop.xpm</file>
+ <file>xpm/select_outside_loop.xpm</file>
+
</qresource>
<qresource lang="de">
diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp
index e58a379b..4381baa7 100644
--- a/muse/muse/shortcuts.cpp
+++ b/muse/muse/shortcuts.cpp
@@ -159,7 +159,9 @@ Shortcut MuseApplication::sc[] = {
QT_TR_NOOP("Panic"),
GLOBAL_SHRT,
0,
- QT_TR_NOOP("send note off to all midi channels")
+ QT_TR_NOOP("Panic"),
+ QT_TR_NOOP("send note off to all midi channels"),
+ ":/xpm/panic.xpm"
),
@@ -203,7 +205,10 @@ Shortcut MuseApplication::sc[] = {
"delete",
QT_TR_NOOP("Edit: Delete" ),
INVIS_SHRT,
- Qt::Key_Delete
+ Qt::Key_Delete,
+ QT_TR_NOOP("Delete"),
+ QT_TR_NOOP("Delete"),
+ ":/xpm/delete.png"
),
Shortcut(
"open_project",
@@ -259,13 +264,28 @@ Shortcut MuseApplication::sc[] = {
"select_parts_on_track",
QT_TR_NOOP("Edit: Select parts on track"),
ARRANG_SHRT,
- Qt::CTRL+ Qt::ALT + Qt::Key_P
+ Qt::CTRL+ Qt::ALT + Qt::Key_P,
+ QT_TR_NOOP("All &Parts on Track"),
+ QT_TR_NOOP("All &Parts on Track"),
+ ":/xpm/select_all_parts_on_track.xpm"
),
Shortcut(
"open_pianoroll",
- QT_TR_NOOP("Open pianoroll"),
+ QT_TR_NOOP("Open Pianoroll"),
ARRANG_SHRT,
- Qt::CTRL + Qt::Key_E
+ Qt::CTRL + Qt::Key_E,
+ QT_TR_NOOP("Pianoroll"),
+ QT_TR_NOOP("Start Pianoroll Editor"),
+ ":/xpm/piano.xpm"
+ ),
+ Shortcut(
+ "open_miditracker",
+ QT_TR_NOOP("Open MidiTracker"),
+ ARRANG_SHRT,
+ 0,
+ QT_TR_NOOP("MidiTracker"),
+ QT_TR_NOOP("Start Midi Tracker"),
+ ":/xpm/piano.xpm"
),
Shortcut(
"open_drumedit",
@@ -358,28 +378,49 @@ Shortcut MuseApplication::sc[] = {
0
),
Shortcut(
- "toggle_mixer",
- QT_TR_NOOP("View: Open mixer window"),
+ "toggle_mixer1",
+ QT_TR_NOOP("View: Open mixer 1 window"),
+ ARRANG_SHRT,
+ Qt::Key_F10,
+ QT_TR_NOOP("Mixer1"),
+ QT_TR_NOOP("Show Mixer 1"),
+ ":/xpm/view_mixer.xpm"
+ ),
+ Shortcut(
+ "toggle_mixer2",
+ QT_TR_NOOP("View: Open mixer 2 window"),
ARRANG_SHRT,
- Qt::Key_F10
+ 0,
+ QT_TR_NOOP("Mixer2"),
+ QT_TR_NOOP("Show Mixer 2"),
+ ":/xpm/view_mixer.xpm"
),
Shortcut(
"toggle_transport",
QT_TR_NOOP("View: Toggle transport window"),
ARRANG_SHRT,
- Qt::Key_F11
+ Qt::Key_F11,
+ QT_TR_NOOP("Transport"),
+ QT_TR_NOOP("Show Transport Window"),
+ ":/xpm/view_transport_window.xpm"
),
Shortcut(
"toggle_bigtime",
QT_TR_NOOP("View: Toggle bigtime window"),
ARRANG_SHRT,
- Qt::Key_F12
+ Qt::Key_F12,
+ QT_TR_NOOP("BigTime"),
+ QT_TR_NOOP("Show BigTime Window"),
+ ":/xpm/view_bigtime_window.xpm"
),
Shortcut(
"marker_window",
QT_TR_NOOP("View: Open marker window"),
ARRANG_SHRT,
- Qt::Key_F9
+ Qt::Key_F9,
+ QT_TR_NOOP("Marker"),
+ QT_TR_NOOP("Show Marker List"),
+ ":/xpm/view_marker.xpm"
),
Shortcut(
"follow_jump",
@@ -529,37 +570,53 @@ Shortcut MuseApplication::sc[] = {
"midi_transpose",
QT_TR_NOOP("Midi: Transpose"),
ARRANG_SHRT + PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Transpose")
),
Shortcut(
"sel_all",
QT_TR_NOOP("Edit: Select all"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::CTRL + Qt::Key_A
+ Qt::CTRL + Qt::Key_A,
+ QT_TR_NOOP("Select All"),
+ QT_TR_NOOP("Select All"),
+ ":/xpm/select_all.xpm"
),
Shortcut(
"sel_none",
QT_TR_NOOP("Edit: Select none"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::CTRL + Qt::SHIFT + Qt::Key_A
+ Qt::CTRL + Qt::SHIFT + Qt::Key_A,
+ QT_TR_NOOP("Deselect All"),
+ QT_TR_NOOP("Deselect All"),
+ ":/xpm/select_deselect_all.xpm"
),
Shortcut(
"sel_inv",
QT_TR_NOOP("Edit: Invert selection"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::CTRL + Qt::Key_I
+ Qt::CTRL + Qt::Key_I,
+ QT_TR_NOOP("Invert Selection"),
+ QT_TR_NOOP("Invert Selection"),
+ ":/xpm/select_invert_selection.xpm"
),
Shortcut(
"sel_ins_loc",
QT_TR_NOOP("Edit: Select events/parts inside locators"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Select Inside Loop"),
+ QT_TR_NOOP("Select Inside Loop"),
+ ":/xpm/select_inside_loop.xpm"
),
Shortcut(
"sel_out_loc",
QT_TR_NOOP("Edit: Select events/parts outside locators"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Select Outside Loop"),
+ QT_TR_NOOP("Select Outside Loop"),
+ ":/xpm/select_outside_loop.xpm"
),
Shortcut(
"sel_left",
@@ -607,31 +664,36 @@ Shortcut MuseApplication::sc[] = {
"midi_fixed_len",
QT_TR_NOOP("Edit: Set fixed length on midi events"),
DEDIT_SHRT,
- Qt::ALT + Qt::Key_L
+ Qt::ALT + Qt::Key_L,
+ QT_TR_NOOP("Set fixed length")
),
Shortcut(
"midi_over_quant",
QT_TR_NOOP("Quantize: Over Quantize"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Over Quantize")
),
Shortcut(
"midi_quant_noteon",
QT_TR_NOOP("Quantize: Note On Quantize"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Note On Quantize")
),
Shortcut(
"midi_quant_noteoff",
QT_TR_NOOP("Quantize: Note On/Off Quantize"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Note On/Off Quantize")
),
Shortcut(
"midi_quant_iterative",
QT_TR_NOOP("Quantize: Iterative Quantize"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Iterative Quantize")
),
Shortcut(
"config_quant",
@@ -643,67 +705,78 @@ Shortcut MuseApplication::sc[] = {
"midi_mod_gate_time",
QT_TR_NOOP("Quantize: Modify Gate Time"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Modify Gate Time")
),
Shortcut(
"midi_mod_velo",
QT_TR_NOOP("Quantize: Modify Velocity"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Modify Velocity")
),
Shortcut(
"midi_crescendo",
QT_TR_NOOP("Edit: Crescendo"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Crescendo")
),
Shortcut(
"midi_thin_out",
QT_TR_NOOP("Edit: Thin Out"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Thin Out")
),
Shortcut(
"midi_erase_event",
QT_TR_NOOP("Edit: Erase Event"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Erase Event")
),
Shortcut(
"midi_note_shift",
QT_TR_NOOP("Edit: Note Shift"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Note Shift")
),
Shortcut(
"midi_move_clock",
QT_TR_NOOP("Edit: Move Clock"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Move Clock")
),
Shortcut(
"midi_copy_measure",
QT_TR_NOOP("Edit: Copy Measure"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Copy Measure")
),
Shortcut(
"midi_erase_measure",
QT_TR_NOOP("Edit: Erase Measure"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Erase Measure")
),
Shortcut(
"midi_delete_measure",
QT_TR_NOOP("Edit: Delete Measure"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Delete Measure")
),
Shortcut(
"midi_create_measure",
QT_TR_NOOP("Edit: Create Measure"),
PROLL_SHRT,
- 0
+ 0,
+ QT_TR_NOOP("Create Measure")
),
Shortcut(
"change_event_color",
@@ -712,48 +785,91 @@ Shortcut MuseApplication::sc[] = {
Qt::Key_E
),
Shortcut(
- "pointer_tool",
+ "pointer",
QT_TR_NOOP("Tool: Pointer"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::Key_A
+ Qt::Key_A,
+ QT_TR_NOOP("Pointer"),
+ QT_TR_NOOP("select Pointer Tool:\n"
+ "with the pointer tool you can:\n"
+ " select parts\n"
+ " move parts\n"
+ " copy parts"),
+ ":/xpm/pointer.xpm"
),
Shortcut(
- "pencil_tool",
+ "pencil",
QT_TR_NOOP("Tool: Pencil"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::Key_D
+ Qt::Key_D,
+ QT_TR_NOOP("Pencil"),
+ QT_TR_NOOP("select Pencil Tool:\n"
+ "with the pencil tool you can:\n"
+ " create new parts\n"
+ " modify length of parts"),
+ ":/xpm/pencil.xpm"
),
Shortcut(
- "eraser_tool",
+ "eraser",
QT_TR_NOOP("Tool: Eraser"),
ARRANG_SHRT + PROLL_SHRT + DEDIT_SHRT,
- Qt::Key_R
+ Qt::Key_R,
+ QT_TR_NOOP("Eraser"),
+ QT_TR_NOOP("select Delete Tool:\n"
+ "with the delete tool you can delete parts"),
+ ":/xpm/delete.xpm"
),
Shortcut(
- "line_draw_tool",
- QT_TR_NOOP("Tool: Line Draw"),
- PROLL_SHRT + DEDIT_SHRT,
- 0
- ),
- Shortcut(
- "scissor_tool",
+ "scissor",
QT_TR_NOOP("Tool: Scissor"),
ARRANG_SHRT,
- Qt::Key_S
+ Qt::Key_S,
+ QT_TR_NOOP("Scissor"),
+ QT_TR_NOOP("select Cut Tool:\n"
+ "with the cut tool you can split a part"),
+ ":/xpm/cut.xpm"
),
Shortcut(
- "glue_tool",
+ "glue",
QT_TR_NOOP("Tool: Glue"),
ARRANG_SHRT,
- Qt::Key_G
+ Qt::Key_G,
+ QT_TR_NOOP("Glue"),
+ QT_TR_NOOP("select Glue Tool:\n"
+ "with the glue tool you can glue two parts"),
+ ":/xpm/glue.xpm"
),
Shortcut(
- "mute_tool",
- QT_TR_NOOP("Tool: Mute"),
+ "quantize",
+ QT_TR_NOOP("Tool: Quantize"),
ARRANG_SHRT,
- 0
+ Qt::Key_G,
+ QT_TR_NOOP("Quantize"),
+ QT_TR_NOOP("select Quantize Tool:\n"
+ "insert display quantize event"),
+ ":/xpm/quant.xpm"
),
Shortcut(
+ "draw",
+ QT_TR_NOOP("Tool: Line Draw"),
+ PROLL_SHRT + DEDIT_SHRT,
+ 0,
+ QT_TR_NOOP("Draw"),
+ QT_TR_NOOP("select Drawing Tool"),
+ ":/xpm/draw.xpm"
+ ),
+ Shortcut(
+ "mute_parts",
+ QT_TR_NOOP("Tool: Mute Parts"),
+ ARRANG_SHRT,
+ 0,
+ QT_TR_NOOP("Mute"),
+ QT_TR_NOOP("select Muting Tool:\n"
+ "click on part to mute/unmute"),
+ ":/xpm/editmute.xpm"
+ ),
+
+ Shortcut(
"curpos_increase",
QT_TR_NOOP("Transport: Increase current position"),
GLOBAL_SHRT,
@@ -891,8 +1007,13 @@ void readShortCuts(QDomNode node)
QAction* getAction(const char* id, QObject* parent)
{
Shortcut* s = shortcuts.value(id);
+ if (s == 0) {
+ printf("interanl error: shortcut <%s> not found\n", id);
+ return 0;
+ }
if (s->action == 0 || s->action->parent() != parent) {
s->action = new QAction(s->xml, parent);
+ s->action->setData(s->xml);
s->action->setShortcut(s->key);
if (s->help) {
s->action->setToolTip(s->help);
@@ -902,6 +1023,8 @@ QAction* getAction(const char* id, QObject* parent)
s->action->setToolTip(s->descr);
s->action->setWhatsThis(s->descr);
}
+ if (s->text)
+ s->action->setText(s->text);
if (s->iconOn) {
QIcon icon;
icon.addFile(s->iconOn, ICON_SIZE, QIcon::Normal, QIcon::On);
diff --git a/muse/muse/song.h b/muse/muse/song.h
index 62925d49..6c31c879 100644
--- a/muse/muse/song.h
+++ b/muse/muse/song.h
@@ -152,6 +152,10 @@ class Song : public QObject {
void setPunchin(bool f);
void setPunchout(bool f);
void setClick(bool val);
+ void toggleClick() { setClick(!click()); }
+ void gotoLeftMarker() { setPos(0, lPos()); }
+ void gotoRightMarker() { setPos(0, rPos()); }
+
void setQuantize(bool val);
void panic();
void seqSignal(int fd);
diff --git a/muse/muse/track.cpp b/muse/muse/track.cpp
index 150a7e57..9fd77f4b 100644
--- a/muse/muse/track.cpp
+++ b/muse/muse/track.cpp
@@ -19,20 +19,15 @@
//=============================================================================
#include "track.h"
-#include "midiplugin.h"
#include "song.h"
#include "al/tempo.h"
#include "al/xml.h"
#include "icons.h"
-#include "muse.h"
#include "audio.h"
-#include "midi.h"
#include "gconfig.h"
#include "midictrl.h"
-#include "instruments/minstrument.h"
#include "part.h"
#include "gui.h"
-#include "midioutport.h"
#include "driver/audiodev.h"
#include "driver/mididev.h"
@@ -514,7 +509,7 @@ void Track::setSelected(bool f)
if (f != _selected) {
_selected = f;
emit selectionChanged(_selected);
- muse->selectionChanged();
+// muse->selectionChanged();
}
}
diff --git a/muse/muse/waveedit/waveedit.cpp b/muse/muse/waveedit/waveedit.cpp
index 295f0814..d285bf8f 100644
--- a/muse/muse/waveedit/waveedit.cpp
+++ b/muse/muse/waveedit/waveedit.cpp
@@ -65,9 +65,9 @@ WaveEdit::WaveEdit(PartList* pl, bool init)
a->setData(CMD_REVERSE);
select = menuEdit->addMenu(QIcon(*selectIcon), tr("Select"));
- a = select->addAction(QIcon(*select_allIcon), tr("Select &All"));
+ a = select->addAction(QIcon(":/xpm/select_all.xpm"), tr("Select &All"));
a->setData(CMD_SELECT_ALL);
- a = select->addAction(QIcon(*select_deselect_allIcon), tr("&Deselect All"));
+ a = select->addAction(QIcon(":/xpm/select_deselect_all.xpm"), tr("&Deselect All"));
a->setData(CMD_SELECT_NONE);
diff --git a/muse/muse/widgets/tools.cpp b/muse/muse/widgets/tools.cpp
index cdcd6ea5..39d7aa4d 100644
--- a/muse/muse/widgets/tools.cpp
+++ b/muse/muse/widgets/tools.cpp
@@ -20,39 +20,11 @@
#include "tools.h"
#include "icons.h"
+#include "shortcuts.h"
-const char* infoPointer = QT_TR_NOOP("select Pointer Tool:\n"
- "with the pointer tool you can:\n"
- " select parts\n"
- " move parts\n"
- " copy parts");
-const char* infoPencil = QT_TR_NOOP("select Pencil Tool:\n"
- "with the pencil tool you can:\n"
- " create new parts\n"
- " modify length of parts");
-const char* infoDel = QT_TR_NOOP("select Delete Tool:\n"
- "with the delete tool you can delete parts");
-const char* infoCut = QT_TR_NOOP("select Cut Tool:\n"
- "with the cut tool you can split a part");
-const char* infoGlue = QT_TR_NOOP("select Glue Tool:\n"
- "with the glue tool you can glue two parts");
-// const char* infoScore = QT_TR_NOOP("select Score Tool:\n");
-const char* infoQuant = QT_TR_NOOP("select Quantize Tool:\n"
- "insert display quantize event");
-const char* infoDraw = QT_TR_NOOP("select Drawing Tool");
-const char* infoMute = QT_TR_NOOP("select Muting Tool:\n"
- "click on part to mute/unmute");
-
-ToolB toolList[TOOLS] = {
- {&pointerIcon, QT_TR_NOOP("pointer"), infoPointer },
- {&pencilIcon, QT_TR_NOOP("pencil"), infoPencil },
- {&deleteIcon, QT_TR_NOOP("eraser"), infoDel },
- {&cutIcon, QT_TR_NOOP("cutter"), infoCut },
-// {&note1Icon, QT_TR_NOOP("score"), infoScore },
- {&glueIcon, QT_TR_NOOP("glue"), infoGlue },
- {&quantIcon, QT_TR_NOOP("quantize"), infoQuant },
- {&drawIcon, QT_TR_NOOP("draw"), infoDraw },
- {&editmuteIcon, QT_TR_NOOP("mute parts"), infoMute },
+const char* toolList[TOOLS] = {
+ "pointer", "pencil", "eraser", "scissor", "glue",
+ "quantize", "draw", "mute_parts"
};
//---------------------------------------------------------
@@ -69,15 +41,11 @@ EditToolBar::EditToolBar(QMainWindow* parent, int tools)
for (unsigned i = 0; i < sizeof(toolList)/sizeof(*toolList); ++i) {
if ((tools & (1 << i))==0)
continue;
- ToolB* t = &toolList[i];
-
- QAction* a = new QAction(QIcon(**(t->icon)), "tool", this);
+ QAction* a = getAction(toolList[i], this);
a->setData(1 << i);
a->setCheckable(true);
actionGroup->addAction(a);
addAction(a);
- a->setToolTip(tr(t->tip));
- a->setWhatsThis(tr(t->ltip));
if (first) {
a->setChecked(true);
first = false;
diff --git a/muse/muse/widgets/tools.h b/muse/muse/widgets/tools.h
index ff6c0734..f05e1095 100644
--- a/muse/muse/widgets/tools.h
+++ b/muse/muse/widgets/tools.h
@@ -28,13 +28,7 @@ class Action;
const int arrangerTools = PointerTool | PencilTool | RubberTool | DrawTool
| CutTool | GlueTool | MuteTool;
-struct ToolB {
- QPixmap** icon;
- const char* tip;
- const char* ltip;
- };
const int TOOLS = 8;
-extern ToolB toolList[TOOLS];
//---------------------------------------------------------
// EditToolBar
@@ -58,5 +52,7 @@ class EditToolBar : public QToolBar {
int curTool();
};
+extern const char* toolList[];
+
#endif
diff --git a/muse/muse/xpm/edit_score.xpm b/muse/muse/xpm/edit_score.xpm
deleted file mode 100644
index a6cc1d99..00000000
--- a/muse/muse/xpm/edit_score.xpm
+++ /dev/null
@@ -1,24 +0,0 @@
-/* XPM */
-static const char *edit_score_xpm[]={
-"16 16 5 1",
-"# c #000000",
-". c #00c000",
-"b c #00ff00",
-"a c #dcdcdc",
-"c c #ffffff",
-"................",
-".##############.",
-"..aaaaaa#aaaaa..",
-".bcccccc##ccccb.",
-".##############.",
-"..aaaaaa#a#aaa..",
-".bcccccc#aaaccb.",
-".##############.",
-"..aaaaaa#aaaaa..",
-".bccc####accccb.",
-".##############.",
-"..aaa###aaaaaa..",
-".bccccaaacccccb.",
-".##############.",
-"................",
-"................"};
diff --git a/muse/muse/xpm/editmuteS.xpm b/muse/muse/xpm/editmuteS.xpm
deleted file mode 100644
index 92a9d4be..00000000
--- a/muse/muse/xpm/editmuteS.xpm
+++ /dev/null
@@ -1,63 +0,0 @@
-/* XPM */
-static const char * editmuteS_xpm[] = {
-"16 16 44 1",
-" c None",
-". c #313131",
-"+ c #E5141A",
-"@ c #E1180D",
-"# c #3F3F3F",
-"$ c #222222",
-"% c #9E000D",
-"& c #FB1300",
-"* c #E91900",
-"= c #3B3B3B",
-"- c #EB1420",
-"; c #A9010C",
-"> c #454545",
-", c #000000",
-"' c #E10E08",
-") c #DD1F0F",
-"! c #121212",
-"~ c #ED0014",
-"{ c #FF0603",
-"] c #F7001C",
-"^ c #4C4C4C",
-"/ c #525252",
-"( c #1E0700",
-"_ c #ED021A",
-": c #F00018",
-"< c #E21C19",
-"[ c #070707",
-"} c #030A1D",
-"| c #000F00",
-"1 c #E90412",
-"2 c #0B0017",
-"3 c #000700",
-"4 c #010101",
-"5 c #EC141D",
-"6 c #EA0900",
-"7 c #DE0B09",
-"8 c #E01000",
-"9 c #E81400",
-"0 c #F10E1C",
-"a c #EE0E16",
-"b c #E50300",
-"c c #FF0316",
-"d c #E70816",
-"e c #FF1901",
-" ",
-" . +@ ",
-" # $%&* ",
-" =. . -.; ",
-" #>, #'). ",
-" ##!, ~${], ",
-" #^/!(,_:,< [ ",
-" #.,}|,'1, , ",
-" .,,23,{], 4 ",
-" ,,,,,,< , , ",
-" ,,,, , , ",
-" 56,,, , , ",
-" 7890,, , , ",
-" abcd , , ",
-" 6e~ , ",
-" "};
diff --git a/muse/muse/xpm/pianoS.xpm b/muse/muse/xpm/piano.xpm
index 3649919e..3649919e 100644
--- a/muse/muse/xpm/pianoS.xpm
+++ b/muse/muse/xpm/piano.xpm