summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/muse/icons.cpp41
-rw-r--r--muse/muse/icons.h18
-rw-r--r--muse/muse/muse.cpp169
-rw-r--r--muse/muse/muse.h13
-rw-r--r--muse/muse/muse.qrc5
-rw-r--r--muse/muse/shortcuts.cpp130
-rw-r--r--muse/muse/shortcuts.h40
-rw-r--r--muse/muse/xpm/fileopenS.xpm26
-rw-r--r--muse/muse/xpm/filesaveS.xpm28
-rw-r--r--muse/muse/xpm/loop.xpm50
-rw-r--r--muse/muse/xpm/loop1.xpm39
-rw-r--r--muse/muse/xpm/punchin.xpm42
-rw-r--r--muse/muse/xpm/punchin1.xpm18
-rw-r--r--muse/muse/xpm/punchout.xpm40
-rw-r--r--muse/muse/xpm/punchout1.xpm18
-rw-r--r--muse/muse/xpm/redoS.xpm25
-rw-r--r--muse/muse/xpm/undoS.xpm25
17 files changed, 272 insertions, 455 deletions
diff --git a/muse/muse/icons.cpp b/muse/muse/icons.cpp
index e7494902..5fb5e42b 100644
--- a/muse/muse/icons.cpp
+++ b/muse/muse/icons.cpp
@@ -52,9 +52,6 @@
#include "xpm/delete.xpm"
#include "xpm/play.xpm"
-#include "xpm/punchin1.xpm"
-#include "xpm/punchout1.xpm"
-#include "xpm/loop1.xpm"
#include "xpm/stick.xpm"
#include "xpm/wave.xpm"
#include "xpm/cmark.xpm"
@@ -65,8 +62,6 @@
#include "xpm/glue.xpm"
#include "xpm/draw.xpm"
#include "xpm/quant.xpm"
-#include "xpm/filesaveS.xpm"
-#include "xpm/fileopenS.xpm"
#include "xpm/master.xpm"
#include "xpm/filenewS.xpm"
#include "xpm/home.xpm"
@@ -91,13 +86,9 @@
#include "xpm/toc.xpm"
#include "xpm/pianoS.xpm"
-#include "xpm/undo.xpm"
-#include "xpm/redo.xpm"
#include "xpm/editcut.xpm"
#include "xpm/editcopy.xpm"
#include "xpm/editpaste.xpm"
-#include "xpm/undoS.xpm"
-#include "xpm/redoS.xpm"
#include "xpm/editmute.xpm"
#include "xpm/editmuteS.xpm"
@@ -106,11 +97,6 @@
#include "xpm/configure.xpm"
#include "xpm/panic.xpm"
-
-// next two lines will vanish soon
-//#include "xpm/solobutton.xpm"
-//#include "xpm/newmutebutton.xpm"
-
#include "xpm/mastertrackS.xpm"
#include "xpm/localoffS.xpm"
#include "xpm/miditransformS.xpm"
@@ -173,15 +159,9 @@ QPixmap* cliplistSIcon;
QPixmap* mixerAudioSIcon;
QPixmap* initSIcon;
-//QPixmap* newmuteIcon;
-//QPixmap* soloIcon;
-
QPixmap* pointerIcon;
QPixmap* pencilIcon;
QPixmap* deleteIcon;
-QPixmap* punchin1Icon;
-QPixmap* punchout1Icon;
-QPixmap* loop1Icon;
QPixmap* playIcon;
QPixmap* stopIcon;
@@ -197,8 +177,6 @@ QPixmap* drawIcon;
QPixmap* quantIcon;
QPixmap* openIcon;
QPixmap* saveIcon;
-QPixmap* openIconS;
-QPixmap* saveIconS;
QPixmap* masterIcon;
QPixmap* filenewIcon;
QPixmap* filenewIconS;
@@ -223,11 +201,6 @@ QPixmap* flagIconS;
QPixmap* lockIcon;
QPixmap* tocIcon;
-QPixmap* undoIcon;
-QPixmap* redoIcon;
-QPixmap* undoIconS;
-QPixmap* redoIconS;
-
QPixmap* speakerIcon;
QPixmap* buttondownIcon;
QPixmap* configureIcon;
@@ -312,9 +285,6 @@ void initIcons()
pointerIcon = new QPixmap(pointer_xpm);
pencilIcon = new QPixmap(pencil_xpm);
deleteIcon = new QPixmap(delete_xpm);
- punchin1Icon = new QPixmap(punchin1_xpm);
- punchout1Icon = new QPixmap(punchout1_xpm);
- loop1Icon = new QPixmap(loop1_xpm);
playIcon = new QPixmap(play_xpm);
stickIcon = new QPixmap(stick_xpm);
@@ -329,8 +299,6 @@ void initIcons()
quantIcon = new QPixmap(quant_xpm);
saveIcon = new QPixmap(":/xpm/filesave.png");
openIcon = new QPixmap(":/xpm/fileopen.png");
- saveIconS = new QPixmap(filesaveS_xpm);
- openIconS = new QPixmap(fileopenS_xpm);
masterIcon = new QPixmap(master_xpm);
filenewIcon = new QPixmap(":/xpm/filenew.png");
filenewIconS = new QPixmap(filenewS_xpm);
@@ -355,11 +323,6 @@ void initIcons()
lockIcon = new QPixmap(lock_xpm);
tocIcon = new QPixmap(toc_xpm);
- undoIcon = new QPixmap(undo_xpm);
- redoIcon = new QPixmap(redo_xpm);
- undoIconS = new QPixmap(undoS_xpm);
- redoIconS = new QPixmap(redoS_xpm);
-
speakerIcon = new QPixmap(speaker_xpm);
buttondownIcon = new QPixmap(buttondown_xpm);
configureIcon = new QPixmap(configure_xpm);
@@ -373,10 +336,6 @@ void initIcons()
editpasteIconSet = new QIcon(QPixmap(editpaste_xpm));
editmuteIconSet = new QIcon(QPixmap(editmute_xpm));
- // 2 lines odd code
-// newmuteIcon = new QPixmap(newmutebutton_xpm);
-// soloIcon = new QPixmap(solobutton_xpm);
-
mastertrackSIcon = new QPixmap(mastertrackS_xpm);
localoffSIcon = new QPixmap(localoffS_xpm);
miditransformSIcon = new QPixmap(miditransformS_xpm);
diff --git a/muse/muse/icons.h b/muse/muse/icons.h
index eae10087..f871c890 100644
--- a/muse/muse/icons.h
+++ b/muse/muse/icons.h
@@ -24,9 +24,6 @@
extern QPixmap* pointerIcon;
extern QPixmap* pencilIcon;
extern QPixmap* deleteIcon;
-extern QPixmap* punchin1Icon;
-extern QPixmap* punchout1Icon;
-extern QPixmap* loop1Icon;
extern QPixmap* playIcon;
extern QPixmap* stickIcon;
extern QPixmap* waveIcon;
@@ -40,8 +37,6 @@ extern QPixmap* drawIcon;
extern QPixmap* quantIcon;
extern QPixmap* openIcon;
extern QPixmap* saveIcon;
-extern QPixmap* openIconS;
-extern QPixmap* saveIconS;
extern QPixmap* archiveIcon;
extern QPixmap* findIcon;
extern QPixmap* masterIcon;
@@ -67,11 +62,6 @@ extern QPixmap* flagIconS;
extern QPixmap* lockIcon;
extern QPixmap* tocIcon;
-extern QPixmap* undoIcon;
-extern QPixmap* redoIcon;
-extern QPixmap* undoIconS;
-extern QPixmap* redoIconS;
-
extern QPixmap* speakerIcon;
extern QPixmap* buttondownIcon;
extern QPixmap* configureIcon;
@@ -87,14 +77,6 @@ extern QIcon* editmuteIconSet;
extern QIcon* editcopyIconSet;
extern QIcon* editpasteIconSet;
-//extern QPixmap* newmuteIcon;
-//extern QPixmap* soloIcon;
-
-//extern QPixmap* muteIconOn;
-//extern QPixmap* muteIconOff;
-//extern QPixmap* soloIconOn;
-//extern QPixmap* soloIconOff;
-
extern QPixmap* offIcon;
extern QPixmap* mastertrackSIcon;
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp
index f87ec003..cdb9dd93 100644
--- a/muse/muse/muse.cpp
+++ b/muse/muse/muse.cpp
@@ -72,15 +72,6 @@ extern void initMidiInstruments();
static pthread_t watchdogThread;
-static const char* infoLoopButton = QT_TR_NOOP("loop between left mark and right mark");
-static const char* infoPunchinButton = QT_TR_NOOP("record starts at left mark");
-static const char* infoPunchoutButton = QT_TR_NOOP("record stops at right mark");
-static const char* infoRewindButton = QT_TR_NOOP("rewind current position");
-static const char* infoForwardButton = QT_TR_NOOP("move current position");
-static const char* infoStopButton = QT_TR_NOOP("stop sequencer");
-static const char* infoRecordButton = QT_TR_NOOP("to record press record and then play");
-static const char* infoPanicButton = QT_TR_NOOP("send note off to all midi channels");
-
#define PROJECT_LIST_LEN 6
static QString* projectList[PROJECT_LIST_LEN];
@@ -407,19 +398,8 @@ void MusE::setupTransportToolbar(QToolBar* tb) const
tb->addAction(punchinAction);
tb->addAction(punchoutAction);
tb->addAction(startAction);
-
- QToolButton* rewindTb = new QToolButton;
- rewindTb->setDefaultAction(rewindAction);
- rewindTb->setAutoRepeat(true);
- tb->addWidget(rewindTb);
- tb->connect(rewindTb, SIGNAL(clicked()), song, SLOT(rewind()));
-
- QToolButton* forwardTb = new QToolButton;
- forwardTb->setDefaultAction(forwardAction);
- forwardTb->setAutoRepeat(true);
- tb->addWidget(forwardTb);
- tb->connect(forwardTb, SIGNAL(clicked()), song, SLOT(forward()));
-
+ tb->addAction(rewindAction);
+ tb->addAction(forwardAction);
tb->addAction(stopAction);
tb->addAction(playAction);
tb->addAction(recordAction);
@@ -462,20 +442,33 @@ MusE::MusE()
projectPropsDialog = 0;
listEditor = 0;
- for (unsigned i = 0;; ++i) {
- if (sc[i].xml == 0)
- break;
- shortcuts[sc[i].xml] = &sc[i];
- }
+ //---------------------------------------------------
+ // Transport
+ //---------------------------------------------------
+
+ loopAction = getAction("toggle_loop", this);
+ loopAction->setCheckable(true);
+ connect(loopAction, SIGNAL(triggered(bool)), song, SLOT(setLoop(bool)));
+
+ punchinAction = getAction("punchin", this);
+ punchinAction->setCheckable(true);
+ connect(punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool)));
+
+ punchoutAction = getAction("punchout", this);
+ punchoutAction->setCheckable(true);
+ connect(punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool)));
+
+ recordAction = getAction("toggle_rec", this);
+ recordAction->setCheckable(true);
+ connect(recordAction, SIGNAL(triggered(bool)), song, SLOT(setRecord(bool)));
+
+ panicAction = new QAction(QIcon(*panicIcon), tr("Panic"), this);
+ connect(panicAction, SIGNAL(triggered()), song, SLOT(panic()));
startAction = getAction("start", this);
- startAction->setIcon(QIcon(":/xpm/start.xpm"));
- startAction->setText(tr("goto start"));
connect(startAction, SIGNAL(triggered()), song, SLOT(rewindStart()));
playAction = getAction("play", this);
- playAction->setIcon(QIcon(":/xpm/play.xpm"));
- playAction->setText(tr("play"));
playAction->setCheckable(true);
connect(playAction, SIGNAL(triggered(bool)), song, SLOT(setPlay(bool)));
@@ -484,11 +477,17 @@ MusE::MusE()
connect(a, SIGNAL(triggered()), SLOT(playToggle()));
addAction(a);
- rewindAction = new QAction(QIcon(":/xpm/frewind.xpm"), "rewind", this);
- forwardAction = new QAction(QIcon(":/xpm/fforward.xpm"), "forward", this);
- stopAction = new QAction(QIcon(":/xpm/stop.xpm"), "stop", this);
+ 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);
+ connect(stopAction, SIGNAL(triggered(bool)), song, SLOT(setStop(bool)));
song->blockSignals(true);
heartBeatTimer = new QTimer(this);
@@ -498,55 +497,16 @@ MusE::MusE()
// undo/redo
//---------------------------------------------------
- undoAction = new QAction(QIcon(*undoIcon), tr("Und&o"), this);
- undoAction->setShortcut(Qt::CTRL + Qt::Key_Z);
- undoAction->setWhatsThis(tr("undo last change to song"));
+ undoAction = getAction("undo", this);
undoAction->setEnabled(false);
undoAction->setData(-1);
connect(undoAction, SIGNAL(triggered()), song, SLOT(undo()));
- redoAction = new QAction(QIcon(*redoIcon), tr("Re&do"), this);
- redoAction->setShortcut(Qt::CTRL + Qt::Key_Y);
- redoAction->setWhatsThis(tr("redo last undo"));
+
+ redoAction = getAction("redo", this);
redoAction->setEnabled(false);
redoAction->setData(-1);
connect(redoAction, SIGNAL(triggered()), song, SLOT(redo()));
- //---------------------------------------------------
- // Transport
- //---------------------------------------------------
-
- loopAction = new QAction(QIcon(*loop1Icon), tr("Loop"), this);
- loopAction->setWhatsThis(tr(infoLoopButton));
- loopAction->setCheckable(true);
- connect(loopAction, SIGNAL(toggled(bool)), song, SLOT(setLoop(bool)));
-
- punchinAction = new QAction(QIcon(*punchin1Icon), tr("Punchin"), this);
- punchinAction->setWhatsThis(tr(infoPunchinButton));
- punchinAction->setCheckable(true);
- connect(punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool)));
-
- punchoutAction = new QAction(QIcon(*punchout1Icon), tr("Punchout"), this);
- punchoutAction->setWhatsThis(tr(infoPunchoutButton));
- punchoutAction->setCheckable(true);
- connect(punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool)));
-
- rewindAction->setWhatsThis(tr(infoRewindButton));
-
- forwardAction->setWhatsThis(tr(infoForwardButton));
-
- stopAction->setWhatsThis(tr(infoStopButton));
- connect(stopAction, SIGNAL(triggered(bool)), song, SLOT(setStop(bool)));
-
-
- recordAction = new QAction(*recordIcon, tr("Record"), this);
- recordAction->setWhatsThis(tr(infoRecordButton));
- recordAction->setCheckable(true);
- connect(recordAction, SIGNAL(triggered(bool)), song, SLOT(setRecord(bool)));
-
- panicAction = new QAction(QIcon(*panicIcon), tr("Panic"), this);
- panicAction->setWhatsThis(tr(infoPanicButton));
- connect(panicAction, SIGNAL(triggered()), song, SLOT(panic()));
-
#ifdef __APPLE__
if (coreMidi.init()) {
QMessageBox::critical(NULL, "MusE fatal error.",
@@ -570,12 +530,7 @@ MusE::MusE()
fileOpenAction = getAction("open_project", this);
- fileOpenAction->setText(tr("Open Project"));
- fileOpenAction->setIcon(QIcon(*openIcon));
-
fileSaveAction = getAction("save_project", this);
- fileSaveAction->setText(tr("Save Project"));
- fileSaveAction->setIcon(QIcon(*saveIcon));
pianoAction = new QAction(*pianoIconSet, tr("Pianoroll"), this);
connect(pianoAction, SIGNAL(triggered()), SLOT(startPianoroll()));
@@ -640,13 +595,13 @@ MusE::MusE()
menu_file->addSeparator();
menu_file->addAction(fileSaveAction);
menu_file->addSeparator();
- menu_ids[CMD_IMPORT_MIDI] = menu_file->addAction(*openIconS, tr("Import Midifile"));
+ menu_ids[CMD_IMPORT_MIDI] = menu_file->addAction(*openIcon, tr("Import Midifile"));
connect(menu_ids[CMD_IMPORT_MIDI], SIGNAL(triggered()), this, SLOT(importMidi()));
- menu_ids[CMD_EXPORT_MIDI] = menu_file->addAction(*saveIconS, tr("Export Midifile"));
+ menu_ids[CMD_EXPORT_MIDI] = menu_file->addAction(*saveIcon, tr("Export Midifile"));
connect(menu_ids[CMD_EXPORT_MIDI], SIGNAL(triggered()), this, SLOT(exportMidi()));
menu_file->addSeparator();
- menu_ids[CMD_IMPORT_AUDIO] = menu_file->addAction(*openIconS, tr("Import Wave File"));
+ menu_ids[CMD_IMPORT_AUDIO] = menu_file->addAction(*openIcon, tr("Import Wave File"));
connect(menu_ids[CMD_IMPORT_AUDIO], SIGNAL(triggered()), this, SLOT(importWave()));
menu_ids[CMD_IMPORT_AUDIO]->setEnabled(!midiOnly);
@@ -1758,34 +1713,34 @@ void MusE::kbAccel(int /*key*/)
// MuseApplication
//---------------------------------------------------------
-class MuseApplication : public QApplication {
- MusE* muse;
-
- public:
- MuseApplication(int& argc, char** argv)
- : QApplication(argc, argv)
- {
- muse = 0;
+MuseApplication::MuseApplication(int& argc, char** argv)
+ : QApplication(argc, argv)
+ {
+ muse = 0;
+ for (unsigned i = 0;; ++i) {
+ if (sc[i].xml == 0)
+ break;
+ shortcuts[sc[i].xml] = &sc[i];
}
+ }
- void setMuse(MusE* m) {
- muse = m;
- }
+//---------------------------------------------------------
+// notify
+//---------------------------------------------------------
- bool 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;
- }
+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;
}
- };
+ return flag;
+ }
//---------------------------------------------------------
// usage
diff --git a/muse/muse/muse.h b/muse/muse/muse.h
index eecda42a..51dc3157 100644
--- a/muse/muse/muse.h
+++ b/muse/muse/muse.h
@@ -312,6 +312,19 @@ class MusE : public QMainWindow // , public Ui::MuseBase
QAction* playAction;
void showListEditor(const Pos&, Track*, Ctrl*);
+ };
+
+//---------------------------------------------------------
+// MuseApplication
+//---------------------------------------------------------
+
+class MuseApplication : public QApplication {
+ MusE* muse;
+
+ 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 c5b5f42c..e4b807c3 100644
--- a/muse/muse/muse.qrc
+++ b/muse/muse/muse.qrc
@@ -25,6 +25,11 @@
<file>xpm/off.svg</file>
<file>xpm/mono.svg</file>
<file>xpm/stereo.svg</file>
+ <file>xpm/loop.xpm</file>
+ <file>xpm/punchin.xpm</file>
+ <file>xpm/punchout.xpm</file>
+ <file>xpm/undo.xpm</file>
+ <file>xpm/redo.xpm</file>
</qresource>
<qresource lang="de">
diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp
index 1921107a..e58a379b 100644
--- a/muse/muse/shortcuts.cpp
+++ b/muse/muse/shortcuts.cpp
@@ -25,6 +25,7 @@
#include "widgets/shortcutconfig.h"
#include "al/xml.h"
#include "muse.h"
+#include "gui.h"
//---------------------------------------------------------
// shortcut_category
@@ -45,26 +46,33 @@ const shortcut_cg ShortcutConfig::shortcut_category[] = {
QMap<QString, Shortcut*> shortcuts;
-Shortcut MusE::sc[] = {
+Shortcut MuseApplication::sc[] = {
Shortcut(
"start",
QT_TR_NOOP("Transport: Goto Start"),
GLOBAL_SHRT,
0,
- QT_TR_NOOP("rewind to start position")
+ QT_TR_NOOP("Goto Start"),
+ QT_TR_NOOP("rewind to start position"),
+ ":/xpm/start.xpm"
+ ),
+ Shortcut(
+ "toggle_loop",
+ QT_TR_NOOP("Transport: Toggle Loop section"),
+ GLOBAL_SHRT,
+ 0, // QKeySequence(Qt::Key_Slash),
+ QT_TR_NOOP("Loop"),
+ QT_TR_NOOP("loop between left mark and right mark"),
+ ":/xpm/loop.xpm"
),
Shortcut(
"play",
QT_TR_NOOP("Transport: Start playback from current location"),
GLOBAL_SHRT,
QKeySequence(Qt::Key_Enter),
- QT_TR_NOOP("start sequencer play")
- ),
- Shortcut(
- "stop",
- QT_TR_NOOP("Transport: Stop Playback"),
- GLOBAL_SHRT,
- Qt::Key_Insert
+ QT_TR_NOOP("Play"),
+ QT_TR_NOOP("start sequencer play"),
+ ":/xpm/play.xpm"
),
Shortcut(
"play_toggle",
@@ -73,6 +81,15 @@ Shortcut MusE::sc[] = {
Qt::Key_Space
),
Shortcut(
+ "stop",
+ QT_TR_NOOP("Transport: Stop Playback"),
+ GLOBAL_SHRT,
+ Qt::Key_Insert,
+ QT_TR_NOOP("Stop"),
+ QT_TR_NOOP("stop sequencer"),
+ ":/xpm/stop.xpm"
+ ),
+ Shortcut(
"goto_left",
QT_TR_NOOP("Transport: Goto left marker"),
GLOBAL_SHRT,
@@ -91,17 +108,61 @@ Shortcut MusE::sc[] = {
QKeySequence(Qt::Key_C)
),
Shortcut(
- "toggle_loop",
- QT_TR_NOOP("Transport: Toggle Loop section"),
+ "toggle_rec",
+ QT_TR_NOOP("Transport: Toggle Record"),
GLOBAL_SHRT,
- Qt::Key_Slash
+ Qt::Key_Asterisk,
+ QT_TR_NOOP("Record"),
+ QT_TR_NOOP("to record press record and then play"),
+ ":/xpm/recordOn.svg",
+ ":/xpm/recordOff.svg"
),
+//------
Shortcut(
- "toggle_rec",
- QT_TR_NOOP("Transport: Toggle Record"),
+ "punchin",
+ QT_TR_NOOP("Transport: Punch In"),
+ GLOBAL_SHRT,
+ 0,
+ QT_TR_NOOP("Punchin"),
+ QT_TR_NOOP("record starts at left mark"),
+ ":/xpm/punchin.xpm"
+ ),
+ Shortcut(
+ "punchout",
+ QT_TR_NOOP("Transport: Punch Out"),
+ GLOBAL_SHRT,
+ 0,
+ QT_TR_NOOP("Punchout"),
+ QT_TR_NOOP("record stops at right mark"),
+ ":/xpm/punchout.xpm"
+ ),
+ Shortcut(
+ "rewind",
+ QT_TR_NOOP("Transport: Rewind"),
+ GLOBAL_SHRT,
+ 0,
+ QT_TR_NOOP("rewind"),
+ QT_TR_NOOP("rewind current position"),
+ ":/xpm/frewind.xpm"
+ ),
+ Shortcut(
+ "forward",
+ QT_TR_NOOP("Transport: Forward"),
+ GLOBAL_SHRT,
+ 0,
+ QT_TR_NOOP("forward"),
+ QT_TR_NOOP("move current position"),
+ ":/xpm/fforward.xpm"
+ ),
+ Shortcut(
+ "panic",
+ QT_TR_NOOP("Panic"),
GLOBAL_SHRT,
- Qt::Key_Asterisk
+ 0,
+ QT_TR_NOOP("send note off to all midi channels")
),
+
+
Shortcut(
"copy",
QT_TR_NOOP("Edit: Copy"),
@@ -112,13 +173,19 @@ Shortcut MusE::sc[] = {
"undo",
QT_TR_NOOP("Edit: Undo"),
INVIS_SHRT,
- Qt::CTRL + Qt::Key_Z
+ Qt::CTRL + Qt::Key_Z,
+ QT_TR_NOOP("undo"),
+ QT_TR_NOOP("undo last change to song"),
+ ":/xpm/undo.xpm"
),
Shortcut(
"redo",
QT_TR_NOOP("Edit: Redo"),
INVIS_SHRT,
- Qt::CTRL + Qt::Key_Y
+ Qt::CTRL + Qt::Key_Y,
+ QT_TR_NOOP("redo"),
+ QT_TR_NOOP("redo last undo"),
+ ":/xpm/redo.xpm"
),
Shortcut(
"cut",
@@ -143,16 +210,20 @@ Shortcut MusE::sc[] = {
QT_TR_NOOP("Open"),
ARRANG_SHRT + DEDIT_SHRT,
Qt::CTRL + Qt::Key_O,
+ QT_TR_NOOP("open project"),
QT_TR_NOOP("Click this button to select a new project\n"
- "You can also select the <b>Open command</b> from the Project menu.")
+ "You can also select the <b>Open command</b> from the Project menu."),
+ ":/xpm/fileopen.png"
),
Shortcut(
"save_project",
QT_TR_NOOP("Save"),
ARRANG_SHRT + DEDIT_SHRT,
Qt::CTRL + Qt::Key_S,
+ QT_TR_NOOP("save project"),
QT_TR_NOOP("Click this button to save the project you are editing.\n"
- "You can also select the Save command from the Project menu.")
+ "You can also select the Save command from the Project menu."),
+ ":/xpm/filesave.png"
),
Shortcut(
"open_recent",
@@ -820,14 +891,27 @@ void readShortCuts(QDomNode node)
QAction* getAction(const char* id, QObject* parent)
{
Shortcut* s = shortcuts.value(id);
- if (s == 0)
- return 0;
if (s->action == 0 || s->action->parent() != parent) {
s->action = new QAction(s->xml, parent);
s->action->setShortcut(s->key);
- s->action->setToolTip(s->descr);
- s->action->setWhatsThis(s->help);
+ if (s->help) {
+ s->action->setToolTip(s->help);
+ s->action->setWhatsThis(s->help);
+ }
+ else {
+ s->action->setToolTip(s->descr);
+ s->action->setWhatsThis(s->descr);
+ }
+ if (s->iconOn) {
+ QIcon icon;
+ icon.addFile(s->iconOn, ICON_SIZE, QIcon::Normal, QIcon::On);
+ if (s->iconOff)
+ icon.addFile(s->iconOff, ICON_SIZE, QIcon::Normal, QIcon::Off);
+ s->action->setIcon(icon);
+ }
}
+ else
+ printf("action <%s> already initialized\n", s->xml);
return s->action;
}
diff --git a/muse/muse/shortcuts.h b/muse/muse/shortcuts.h
index f06337fc..e21d2173 100644
--- a/muse/muse/shortcuts.h
+++ b/muse/muse/shortcuts.h
@@ -53,28 +53,36 @@ using AL::Xml;
struct Shortcut
{
- const char* xml; /*! xml tag name for configuration file */
- const char* descr; /*! Description of the shortcut, shown in editor */
- int type; /*! Bitmask category value mapped against PROLL_SHRT, DEDIT_SHRT etc. One shortcut can be a member of many categories */
- QKeySequence key; /*! shortcut key */
- QAction* action;
- QString help;
+ const char* xml; /*! xml tag name for configuration file */
+ const char* descr; /*! Description of the shortcut, shown in editor */
+ int type; /*! Bitmask category value mapped against
+ PROLL_SHRT, DEDIT_SHRT etc. One shortcut can
+ be a member of many categories */
+ QKeySequence key; /*! shortcut key */
+ const char* text; /*! action help */
+ const char* help;
+ const char* iconOn;
+ const char* iconOff;
+ QAction* action; /*! cached action, can be updated if user changes
+ shortcut key sequence */
Shortcut() {
- xml = 0;
- type = 0;
- key = 0;
+ xml = 0;
+ descr = 0;
+ type = 0;
+ key = 0;
+ text = 0;
+ help = 0;
+ iconOn = 0;
+ iconOff = 0;
action = 0;
}
- Shortcut(const char* x, const char* d, int t, const QKeySequence& k, const QString& h)
- : xml(x), descr(d), type(t), key(k), help(h) {
+ Shortcut(const char* name, const char* d, int t, const QKeySequence& k,
+ const char* txt=0, const char* h=0, const char* ic1=0, const char* ic2=0)
+ : xml(name), descr(d), type(t), key(k), text(txt), help(h), iconOn(ic1),
+ iconOff(ic2) {
action = 0;
}
- Shortcut(const char* x, const char* d, int t, const QKeySequence& k)
- : xml(x), descr(d), type(t), key(k) {
- action = 0;
- help = descr;
- }
};
//! Describes a shortcut category
diff --git a/muse/muse/xpm/fileopenS.xpm b/muse/muse/xpm/fileopenS.xpm
deleted file mode 100644
index 05ce7450..00000000
--- a/muse/muse/xpm/fileopenS.xpm
+++ /dev/null
@@ -1,26 +0,0 @@
-/* XPM */
-static const char * fileopenS_xpm[] = {
-"16 16 7 1",
-" c None",
-". c #000000",
-"+ c #FFA858",
-"@ c #FFDCA8",
-"# c #DCDCDC",
-"$ c #C3C3C3",
-"% c #A0A0A0",
-" .... ",
-" .. .... . ",
-" . .... ",
-" ... ",
-" .... ",
-" .... ",
-".+@@+....... ",
-".@@@@+++++++. ",
-".@@.............",
-".@+.###########.",
-".@.#$$$$%$%$%%. ",
-".+.#$$$%$%$%%%. ",
-"..#$$$%$%$%%%. ",
-"..#$$%$%$%%%%. ",
-".#$$%$%$%%%%. ",
-"............. "};
diff --git a/muse/muse/xpm/filesaveS.xpm b/muse/muse/xpm/filesaveS.xpm
deleted file mode 100644
index 6c77f6ff..00000000
--- a/muse/muse/xpm/filesaveS.xpm
+++ /dev/null
@@ -1,28 +0,0 @@
-/* XPM */
-static const char * filesaveS_xpm[] = {
-"16 16 9 1",
-" c None",
-". c #000000",
-"+ c #303030",
-"@ c #800080",
-"# c #0000C0",
-"$ c #FFFFFF",
-"% c #DCDCDC",
-"& c #C3C3C3",
-"* c #585858",
-"................",
-".+.@#@#@#@#@#.+.",
-".$.$$$$$$$$$$...",
-".+.$$$$$$$$$$.+.",
-".+.$@#@#@#@#$.+.",
-".+.$$$$$$$$$$.+.",
-".+.$@#@#@#@#$.+.",
-".+.$$$$$$$$$$.+.",
-".++..........++.",
-".++++++++++++++.",
-".+++........+++.",
-".++.$%$%%%&%.++.",
-".++.%+*&%&%&.++.",
-".++.$+*%&%&&.++.",
-"..+.%&%&%&&&.++.",
-" ..............."};
diff --git a/muse/muse/xpm/loop.xpm b/muse/muse/xpm/loop.xpm
index 91a2113f..acd999c8 100644
--- a/muse/muse/xpm/loop.xpm
+++ b/muse/muse/xpm/loop.xpm
@@ -1,23 +1,29 @@
/* XPM */
-static const char *loop_xpm[] = {
-" 29 15 4 1",
-". c #000000",
-"# c #7f7f7f",
-"a c None",
-"b c #ffffff",
-"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
-"aaaaaaaaaaaaa...#aaaaaaaaaaaa",
-"aaaaaa########....#####aaaaaa",
-"aaaaa#.................#aaaaa",
-"aaaa#.bbbbbb##....bbbbb.#aaaa",
-"aaa#.baaaaaaa...bbaaaaa#.baaa",
-"aaa#.baaaaaaabbbaaaaaaa#.baaa",
-"aaa#.aaaaaaaaaaaaaaaaaa#.baaa",
-"aaa#.aaaaaaaaaaaaaaaaaa#.baaa",
-"aaaa.aaaaaaaaaaaaaaaaaa#.baaa",
-"aaaa#.#################.baaaa",
-"aaaaa#.................baaaaa",
-"aaaaaabbbbbbbbbbbbbbbbbaaaaaa",
-"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
-"aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-};
+static char *loop[]={
+"22 22 4 1",
+". c None",
+"a c #000000",
+"b c #7f7f7f",
+"# c #ffffff",
+"......................",
+"......................",
+".......########.......",
+"......#aaaaaaaab......",
+".....#abbbbbbbbab.....",
+"....#ab........#ab....",
+"....#ab........#ab....",
+"....#ab........#ab....",
+"....#ab.......#aaa....",
+"....#ab.......#aaab...",
+"....#ab......#aaaaa...",
+"....#ab......#aaaaa...",
+"....#ab......#ababa...",
+"....#ab........bab....",
+"....#ab........#ab....",
+"....#ab........#ab....",
+"....#ab........#ab....",
+".....ba......##ab.....",
+"......baaaaaaaab......",
+"........bbbbbbb.......",
+"......................",
+"......................"};
diff --git a/muse/muse/xpm/loop1.xpm b/muse/muse/xpm/loop1.xpm
deleted file mode 100644
index 9fd00bfb..00000000
--- a/muse/muse/xpm/loop1.xpm
+++ /dev/null
@@ -1,39 +0,0 @@
-/* XPM */
-static const char *loop1_xpm[] = {
-/* width height num_colors chars_per_pixel */
-" 22 22 9 1",
-/* colors */
-". c #000000",
-"# c #00007f",
-"a c #0000ff",
-"b c #505850",
-"c c #7f7f7f",
-"d c None",
-"e c #dfdfdf",
-"f c #ffff00",
-"g c #ffffff",
-/* pixels */
-"dddddddddddddddddddddd",
-"dddddddddddddddddddddd",
-"dddddddggggggggddddddd",
-"ddddddg........cdddddd",
-"dddddg.cccccccc.cddddd",
-"ddddg.cddddddddg.cdddd",
-"ddddg.cddddddddg.cdddd",
-"ddddg.cddddddddg.cdddd",
-"ddddg.cdddddddg...dddd",
-"ddddg.cdddddddg...cddd",
-"ddddg.cddddddg.....ddd",
-"ddddg.cddddddg.....ddd",
-"ddddg.cddddddg.c.c.ddd",
-"ddddg.cddddddddc.cdddd",
-"ddddg.cddddddddg.cdddd",
-"ddddg.cddddddddg.cdddd",
-"ddddg.cddddddddg.cdddd",
-"dddddc.ddddddgg.cddddd",
-"ddddddc........cdddddd",
-"ddddddddcccccccddddddd",
-"dddddddddddddddddddddd",
-"dddddddddddddddddddddd"
-};
-
diff --git a/muse/muse/xpm/punchin.xpm b/muse/muse/xpm/punchin.xpm
index 4c0809c5..2bd3ce7f 100644
--- a/muse/muse/xpm/punchin.xpm
+++ b/muse/muse/xpm/punchin.xpm
@@ -1,27 +1,17 @@
/* XPM */
-static const char *punchin_xpm[] = {
-/* width height num_colors chars_per_pixel */
-" 22 16 3 1",
-/* colors */
-". c #000000",
-"f c None",
-"h c #ffffff",
-/* pixels */
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"fff.......ffffffffffff",
-"ffffffffff.fffffffffff",
-"fffffffffff.ffffffffff",
-"ffffffffffff.fffffffff",
-"fffffffffffff......fff",
-"fffffffffffffhhhhhhhff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-};
-
+static char *punchin[]={
+"12 12 2 1",
+". c None",
+"# c #000000",
+"............",
+"####........",
+"######......",
+"....##......",
+"....##......",
+"....##......",
+"....##......",
+"....##......",
+"....########",
+"......######",
+"............",
+"............"};
diff --git a/muse/muse/xpm/punchin1.xpm b/muse/muse/xpm/punchin1.xpm
deleted file mode 100644
index 90d0961c..00000000
--- a/muse/muse/xpm/punchin1.xpm
+++ /dev/null
@@ -1,18 +0,0 @@
-/* XPM */
-static const char* punchin1_xpm[]={
-"12 12 3 1",
-"a c #c0c0c0",
-"# c #000000",
-". c None",
-"............",
-"####........",
-"######......",
-"....##......",
-"....##......",
-"....##......",
-"....##......",
-"....##......",
-"....########",
-"......######",
-"............",
-"............"};
diff --git a/muse/muse/xpm/punchout.xpm b/muse/muse/xpm/punchout.xpm
index 98d22f43..d176ed5d 100644
--- a/muse/muse/xpm/punchout.xpm
+++ b/muse/muse/xpm/punchout.xpm
@@ -1,24 +1,18 @@
/* XPM */
-static const char *punchout_xpm[] = {
-"22 16 3 1",
-". c #000000",
-"f c None",
-"h c #ffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"fffffffffffff......fff",
-"ffffffffffff.fffffffff",
-"fffffffffff.ffffffffff",
-"ffffffffff.fffffffffff",
-"fff.......ffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-"ffffffffffffffffffffff",
-};
-
+static const char* punchout_xpm[]={
+"12 12 3 1",
+"a c #c0c0c0",
+"# c #000000",
+". c None",
+"............",
+"............",
+"......######",
+"....########",
+"....##......",
+"....##......",
+"....##......",
+"....##......",
+"######......",
+"####........",
+"............",
+"............"};
diff --git a/muse/muse/xpm/punchout1.xpm b/muse/muse/xpm/punchout1.xpm
deleted file mode 100644
index 1d3a2ae4..00000000
--- a/muse/muse/xpm/punchout1.xpm
+++ /dev/null
@@ -1,18 +0,0 @@
-/* XPM */
-static const char* punchout1_xpm[]={
-"12 12 3 1",
-"a c #c0c0c0",
-"# c #000000",
-". c None",
-"............",
-"............",
-"......######",
-"....########",
-"....##......",
-"....##......",
-"....##......",
-"....##......",
-"######......",
-"####........",
-"............",
-"............"};
diff --git a/muse/muse/xpm/redoS.xpm b/muse/muse/xpm/redoS.xpm
deleted file mode 100644
index 686e2e72..00000000
--- a/muse/muse/xpm/redoS.xpm
+++ /dev/null
@@ -1,25 +0,0 @@
-/* XPM */
-static const char * redoS_xpm[] = {
-"16 16 6 1",
-" c None",
-". c #000000",
-"+ c #00FF00",
-"@ c #00C000",
-"# c #008000",
-"$ c #004000",
-" ",
-" .... ",
-" ..++++.. ",
-" .+@@@@@++. .",
-" .+#$..#@@@+. #.",
-" .$.. ..#@@+.#.",
-".@. .#@@@#.",
-"... .@@@#.",
-"... .@@@#.",
-"... ######.",
-" .. ........",
-" ... ",
-" ... ",
-" .... ",
-" ... ",
-" "};
diff --git a/muse/muse/xpm/undoS.xpm b/muse/muse/xpm/undoS.xpm
deleted file mode 100644
index f8520fd7..00000000
--- a/muse/muse/xpm/undoS.xpm
+++ /dev/null
@@ -1,25 +0,0 @@
-/* XPM */
-static const char * undoS_xpm[] = {
-"16 16 6 1",
-" c None",
-". c #000000",
-"+ c #00FF00",
-"@ c #00C000",
-"# c #008000",
-"$ c #004000",
-" ",
-" .... ",
-" ..+++@.. ",
-". .++@@@#@#. ",
-".# .+@@@#..$##. ",
-".+.+@@#.. ..$. ",
-".++@@#. .$.",
-".+@@@. ...",
-".+@@@. ...",
-".+##### ...",
-"........ .. ",
-" ... ",
-" ... ",
-" .... ",
-" ... ",
-" "};