summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/ChangeLog1
-rw-r--r--muse/TODO4
-rw-r--r--muse/doc/man/de/man-de.tex40
-rw-r--r--muse/muse/arranger/arranger.cpp1
-rw-r--r--muse/muse/arranger/canvas.cpp175
-rw-r--r--muse/muse/arranger/partdrag.h8
-rw-r--r--muse/muse/muse.cpp327
-rw-r--r--muse/muse/muse.h2
-rw-r--r--muse/muse/muse.qrc4
-rw-r--r--muse/muse/shortcuts.cpp25
10 files changed, 348 insertions, 239 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index f7abcbf7..ec26f7f1 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,5 +1,6 @@
28.11 (ws)
- application spanning drag&drop of parts
+ - cut/copy/paste for parts
24.11 (ws)
- added new make target: "doxy" to generate doxygen source
documentation
diff --git a/muse/TODO b/muse/TODO
index 23488d7f..79f7235f 100644
--- a/muse/TODO
+++ b/muse/TODO
@@ -3,9 +3,7 @@
----------------------------------------------------------------------------
- dont allow for overlapping parts
- - add shortcuts as QAction
- - extend Shortcut with ShortcutContext
- - extend shortcuts with Help Text, Icons etc.
+ - automatically create unique default part names
BUGS
- make sure all track names are unique
diff --git a/muse/doc/man/de/man-de.tex b/muse/doc/man/de/man-de.tex
index b650501f..2269e25a 100644
--- a/muse/doc/man/de/man-de.tex
+++ b/muse/doc/man/de/man-de.tex
@@ -362,6 +362,46 @@
Wie bei allen anderen Strukturkommandos werden stummgeschaltete
Spuren nicht berücksichtigt.
+ \section{Arranger}
+ \subsection{Spurtypen}
+ \startitemize[packed]
+ \item Midispur
+ \item Audiospur
+ \item Midiinput
+ \item Midioutput
+ \item Midigenerator
+ \item Audioinput
+ \item Audiooutput
+ \item Audiogruppe
+ \item Software Synthesizer
+ \stopitemize
+
+ \subsection{Spur Operationen}
+ \startitemize[packed]
+ \item Spur erzeugen
+ \item Spur löschen
+ \item Spur verschieben
+ \item Spur kopieren
+ \stopitemize
+
+ \subsection{Part Operationen}
+ \startitemize[packed]
+ \item Part erzeugen
+ \item Part löschen
+ \item Part verschieben
+ \item Part kopieren
+ \item Part clonen
+ \item Part declonen
+ \item Part nach Vorne verlängern
+ \item Part nach Hinten verlängern
+ \item Part stummschalten
+ \item Part einfärben
+ \stopitemize
+
+ \section{Pianoroll Editor}
+ \section{Drum Editor}
+ \section{Master Editor}
+
\chapter{Installation}
\component installation.tex
diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp
index cf8bbb14..a904cb1f 100644
--- a/muse/muse/arranger/arranger.cpp
+++ b/muse/muse/arranger/arranger.cpp
@@ -1383,4 +1383,3 @@ void Arranger::removeMarker(const AL::Pos& pos)
}
printf("marker not found\n");
}
-
diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp
index 1bcc3d71..f0058d60 100644
--- a/muse/muse/arranger/canvas.cpp
+++ b/muse/muse/arranger/canvas.cpp
@@ -405,25 +405,18 @@ void PartCanvas::contextMenu(const QPoint& pos)
QMenu* pop = new QMenu(widget());
QAction* a;
if (part) {
- a = pop->addAction(*editcutIconSet, tr("C&ut"));
- a->setData(4);
- a->setShortcut(Qt::CTRL + Qt::Key_X);
-
- a = pop->addAction(*editcopyIconSet, tr("&Copy"));
- a->setData(5);
- a->setShortcut(Qt::CTRL + Qt::Key_C);
-
+ pop->addAction(getAction("cut", this));
+ pop->addAction(getAction("copy", this));
pop->addSeparator();
+ a = pop->addAction(tr("Rename"));
+ a->setData("rename");
- a = pop->addAction(tr("rename"));
- a->setData(0);
-
- QMenu* cp = pop->addMenu(tr("color"));
+ QMenu* cp = pop->addMenu(tr("Color"));
// part color selection
for (int i = 0; i < NUM_PARTCOLORS; ++i) {
a = cp->addAction(partColorNames[i]);
- a->setData(20 + i);
+ a->setData(QString("color%1").arg(i));
QPixmap pm(20, 20);
QPainter p(&pm);
p.fillRect(0, 0, 20, 20, config.partColors[i]);
@@ -431,106 +424,85 @@ void PartCanvas::contextMenu(const QPoint& pos)
}
a = getAction("delete", this);
pop->addAction(a);
- a->setData(1);
- a = getAction("cut", this);
+ a->setData("delete");
+ a = getAction("scissor", this);
pop->addAction(a);
- a->setData(2);
a = getAction("glue", this);
pop->addAction(a);
- a->setData(3);
- a = pop->addAction(tr("de-clone"));
- a->setData(15);
+ a = pop->addAction(tr("Declone"));
+ a->setData("declone");
a->setEnabled(part->isClone());
if (track->type() == Track::MIDI) {
a = pop->addAction(tr("AutoFill..."));
- a->setData(16);
+ a->setData("autofill");
}
pop->addSeparator();
if (track->type() == Track::MIDI) {
MidiTrack* track = (MidiTrack*)part->track();
if (track->useDrumMap()) {
a = pop->addAction(*edit_drummsIcon, tr("drums"));
- a->setData(13);
+ a->setData("editdrums");
}
else {
a = pop->addAction(QIcon(":/xpm/piano.xpm"), tr("pianoroll"));
- a->setData(10);
+ a->setData("editpiano");
}
- a = pop->addAction(*edit_listIcon, tr("miditracker"));
- a->setData(11);
+ a = pop->addAction(*edit_listIcon, tr("miditracker"));
+ a->setData("miditracker");
a = pop->addAction(*edit_listIcon, tr("list"));
- a->setData(12);
+ a->setData("listedit");
}
else {
a = pop->addAction(*waveIcon, tr("wave edit"));
- a->setData(14);
+ a->setData("waveedit");
}
a = pop->exec(mapToGlobal(pos));
if (a) {
- int n = a->data().toInt();
- switch (n) {
- case 0:
- renamePart(part);
- break;
- case 1:
- song->cmdRemovePart(part);
- track->partListChanged();
- break;
- case 2:
- splitPart(part, startDrag);
- break;
- case 3:
- song->cmdGluePart(part);
- break;
- case 4:
- cutPart(part);
- break;
- case 5:
- copyPart(part);
- break;
- case 10: // pianoroll edit
- emit startEditor(part, 0);
- break;
- case 11: //miditracker edit
- emit startEditor(part, 2);
- break;
- case 12: // list edit
- emit startEditor(part, 1);
- break;
- case 13: // drum edit
- emit startEditor(part, 3);
- break;
- case 14:
- emit startEditor(part, 4);
- break;
- case 15:
- declonePart(part);
- break;
- case 16:
- // auto fill: ask for loop length
- {
- bool ok;
- int ticksM = AL::sigmap.ticksMeasure(part->tick());
- int n = QInputDialog::getInteger(this,
- tr("MusE: Get auto fill loop len"),
- tr("Measures: "),
- part->fillLen() / ticksM,
- 0, 16, 1, &ok);
- if (ok) {
- part->setFillLen(n * ticksM);
- }
+ QString cmd = a->data().toString();
+ if (cmd == "rename")
+ renamePart(part);
+ else if (cmd == "delete")
+ song->cmdRemovePart(part);
+ else if (cmd == "scissor")
+ splitPart(part, startDrag);
+ else if (cmd == "glue")
+ song->cmdGluePart(part);
+ else if (cmd == "cut")
+ cutPart(part);
+ else if (cmd == "copy")
+ copyPart(part);
+ else if (cmd == "editpiano")
+ emit startEditor(part, 0);
+ else if (cmd == "miditracker")
+ emit startEditor(part, 2);
+ else if (cmd == "listedit")
+ emit startEditor(part, 1);
+ else if (cmd == "drumedit")
+ emit startEditor(part, 3);
+ else if (cmd == "waveedit")
+ emit startEditor(part, 4);
+ else if (cmd == "declone")
+ declonePart(part);
+ else if (cmd == "autofill") {
+ bool ok;
+ int ticksM = AL::sigmap.ticksMeasure(part->tick());
+ int n = QInputDialog::getInteger(this,
+ tr("MusE: Get auto fill loop len"),
+ tr("Measures: "),
+ part->fillLen() / ticksM,
+ 0, 16, 1, &ok);
+ if (ok) {
+ part->setFillLen(n * ticksM);
}
- break;
- case 20 ... NUM_PARTCOLORS+20:
- part->setColorIndex(n - 20);
- widget()->update();
- break;
- case -1:
- break;
- default:
- printf("unknown action %d\n", n);
- break;
+ }
+ else if (cmd.startsWith("color")) {
+ int idx = cmd.mid(5).toInt();
+ part->setColorIndex(idx);
+ widget()->update();
+ }
+ else {
+ printf("unknown action <%s>\n", cmd.toLatin1().data());
}
}
}
@@ -540,17 +512,12 @@ void PartCanvas::contextMenu(const QPoint& pos)
continue;
a = getAction(toolList[i], this);
pop->addAction(a);
- int id = 1 << i;
- a->setData(id);
a->setCheckable(true);
- if (id == (int)_tool)
- a->setChecked(true);
+ a->setChecked((1 <<i) == (int)_tool);
}
a = pop->exec(mapToGlobal(pos));
- if (a) {
- int n = a->data().toInt();
- muse->setTool(n);
- }
+ if (a)
+ muse->setTool(a->data().toString());
}
}
@@ -933,18 +900,26 @@ void PartCanvas::renamePart(Part* part)
// cutPart
//---------------------------------------------------------
-void PartCanvas::cutPart(Part*)
+void PartCanvas::cutPart(Part* part)
{
- printf("cut part: not impl.\n");
+ copyPart(part);
+ song->cmdRemovePart(part);
}
//---------------------------------------------------------
// copyPart
//---------------------------------------------------------
-void PartCanvas::copyPart(Part*)
+void PartCanvas::copyPart(Part* part)
{
- printf("copy part: not impl.\n");
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ AL::Xml xml(&buffer);
+ part->write(xml);
+ buffer.close();
+ QMimeData* mimeData = new QMimeData;
+ mimeData->setData(MidiPartDrag::type, buffer.buffer());
+ QApplication::clipboard()->setMimeData(mimeData);
}
//---------------------------------------------------------
diff --git a/muse/muse/arranger/partdrag.h b/muse/muse/arranger/partdrag.h
index 3f9a71c1..d8c2e978 100644
--- a/muse/muse/arranger/partdrag.h
+++ b/muse/muse/arranger/partdrag.h
@@ -28,10 +28,10 @@ class Part;
//---------------------------------------------------------
class MidiPartDrag : public QDrag {
- static const char type[];
Q_OBJECT
public:
+ static const char type[];
MidiPartDrag(Part*, QWidget* src);
static bool canDecode(const QMimeData*);
static bool decode(const QMimeData* s, Part*& p);
@@ -42,10 +42,10 @@ class MidiPartDrag : public QDrag {
//---------------------------------------------------------
class AudioPartDrag : public QDrag {
- static const char type[];
Q_OBJECT
public:
+ static const char type[];
AudioPartDrag(Part*, QWidget* src);
static bool canDecode(const QMimeData*);
static bool decode(const QMimeData* s, Part*& p);
@@ -56,16 +56,14 @@ class AudioPartDrag : public QDrag {
//---------------------------------------------------------
class WavUriDrag : public QDrag {
- static const char type[];
Q_OBJECT
public:
+ static const char type[];
WavUriDrag(const QString&, QWidget* src);
static bool canDecode(const QMimeData*);
static bool decode(const QMimeData* s, QString* p);
};
-
-
#endif
diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp
index df4f9a51..eb177d4c 100644
--- a/muse/muse/muse.cpp
+++ b/muse/muse/muse.cpp
@@ -524,12 +524,10 @@ MusE::MusE()
undoAction = getAction("undo", this);
undoAction->setEnabled(false);
- undoAction->setData(-1);
connect(undoAction, SIGNAL(triggered()), song, SLOT(undo()));
redoAction = getAction("redo", this);
redoAction->setEnabled(false);
- redoAction->setData(-1);
connect(redoAction, SIGNAL(triggered()), song, SLOT(redo()));
#ifdef __APPLE__
@@ -643,25 +641,18 @@ MusE::MusE()
menuEdit->addAction(redoAction);
menuEdit->addSeparator();
- cutAction = menuEdit->addAction(*editcutIconSet, tr("C&ut"));
- cutAction->setData(CMD_CUT);
- cutAction->setShortcut(Qt::CTRL + Qt::Key_X);
-
- copyAction = menuEdit->addAction(*editcopyIconSet, tr("&Copy"));
- copyAction->setData(CMD_COPY);
- copyAction->setShortcut(Qt::CTRL + Qt::Key_C);
-
- pasteAction = menuEdit->addAction(*editpasteIconSet, tr("&Paste"));
- pasteAction->setData(CMD_PASTE);
- pasteAction->setShortcut(Qt::CTRL + Qt::Key_V);
+ cutAction = getAction("cut", this);
+ menuEdit->addAction(cutAction);
+ copyAction = getAction("copy", this);
+ menuEdit->addAction(copyAction);
+ pasteAction = getAction("paste", this);
+ menuEdit->addAction(pasteAction);
menuEditActions[CMD_DELETE] = getAction("delete", this);
- menuEdit->addAction(menuEditActions[CMD_DELETE]);
- menuEditActions[CMD_DELETE]->setData(CMD_DELETE);
menuEdit->addSeparator();
a = menuEdit->addAction(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"));
- a->setData(CMD_DELETE_TRACK);
+ a->setData("delete_track");
addTrack = menuEdit->addMenu(*edit_track_addIcon, tr("Add Track"));
// delay creation of menu (at this moment the list of software
@@ -672,11 +663,9 @@ MusE::MusE()
select = menuEdit->addMenu(QIcon(*selectIcon), tr("Select"));
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] = getAction("sel_none", this);
select->addAction(menuEditActions[CMD_SELECT_NONE]);
- menuEditActions[CMD_SELECT_NONE]->setData(CMD_SELECT_NONE);
menuEditActions[CMD_SELECT_INVERT] = getAction("sel_inv", this);
select->addAction(menuEditActions[CMD_SELECT_INVERT]);
@@ -692,7 +681,6 @@ MusE::MusE()
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();
menuEdit->addAction(pianoAction);
@@ -842,13 +830,13 @@ MusE::MusE()
follow = menuSettings->addMenu(QIcon(*settings_follow_songIcon), tr("follow song"));
//follow->menuAction()->setShortcut(Qt::Key_F);
fid0 = follow->addAction(tr("dont follow Song"));
- fid0->setData(CMD_FOLLOW_NO);
+ fid0->setData("follow_no");
fid0->setCheckable(true);
fid1 = follow->addAction(tr("follow page"));
- fid1->setData(CMD_FOLLOW_JUMP);
+ fid1->setData("follow_jump");
fid1->setCheckable(true);
fid2 = follow->addAction(tr("follow continuous"));
- fid2->setData(CMD_FOLLOW_CONTINUOUS);
+ fid2->setData("follow_continuous");
fid2->setCheckable(true);
fid0->setChecked(TimeCanvas::followMode == FOLLOW_NO);
fid1->setChecked(TimeCanvas::followMode == FOLLOW_JUMP);
@@ -1783,110 +1771,202 @@ void MusE::setFollow(FollowMode fm)
}
//---------------------------------------------------------
+// copyParts
+// copy all selected Parts of type MIDI or WAVE to
+// clipboard whatever first found
+//---------------------------------------------------------
+
+void MusE::copyParts(bool cutFlag)
+ {
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ AL::Xml xml(&buffer);
+
+ if (cutFlag)
+ song->startUndo();
+ int midiType = -1;
+ TrackList* tl = song->tracks();
+ for (iTrack i = tl->begin(); i != tl->end(); ++i) {
+ Track* track = *i;
+ if (midiType == 1 && !track->isMidiTrack())
+ continue;
+ PartList* pl = track->parts();
+ for (iPart ip = pl->begin(); ip != pl->end(); ++ip) {
+ Part* part = ip->second;
+ if (part->selected()) {
+ if (midiType == -1)
+ midiType = track->isMidiTrack();
+ part->write(xml);
+ if (cutFlag)
+ song->removePart(part);
+ }
+ }
+ }
+ buffer.close();
+ QMimeData* mimeData = new QMimeData;
+ const char* t = midiType ? "application/muse/part/midi" : "application/muse/part/audio";
+ mimeData->setData(t, buffer.buffer());
+ QApplication::clipboard()->setMimeData(mimeData);
+ if (cutFlag)
+ song->endUndo(0);
+ }
+
+//---------------------------------------------------------
// cmd
// some cmd's from pulldown menu
//---------------------------------------------------------
void MusE::cmd(QAction* a)
{
- int cmd = a->data().toInt();
+ QString cmd = a->data().toString();
TrackList* tracks = song->tracks();
int l = song->lpos();
int r = song->rpos();
- switch(cmd) {
- case CMD_CUT:
-//TODO1 arranger->cmd(Arranger::CMD_CUT_PART);
- break;
- case CMD_COPY:
-//TODO1 arranger->cmd(Arranger::CMD_COPY_PART);
- break;
- case CMD_PASTE:
-//TODO1 arranger->cmd(Arranger::CMD_PASTE_PART);
- break;
- case CMD_DELETE:
- {
- TrackList* tl = song->tracks();
- bool partsMarked = false;
- for (iTrack it = tl->begin(); it != tl->end(); ++it) {
- PartList* pl2 = (*it)->parts();
- for (iPart ip = pl2->begin(); ip != pl2->end(); ++ip) {
- if (ip->second->selected()) {
- partsMarked = true;
- break;
- }
- }
- }
- if (partsMarked)
- song->cmdRemoveParts();
- else
- audio->msgRemoveTracks();
+ if (cmd == "cut")
+ copyParts(true);
+ else if (cmd == "copy")
+ copyParts(false);
+ else if (cmd == "paste") {
+ const QMimeData* s = QApplication::clipboard()->mimeData();
+ int isMidi = -1;
+ QByteArray data;
+ if (s->hasFormat("application/muse/part/midi")) {
+ isMidi = 1;
+ data = s->data("application/muse/part/midi");
+ }
+ else if (s->hasFormat("application/muse/part/audio")) {
+ isMidi = 0;
+ data = s->data("application/muse/part/audio");
+ }
+ // exit if unknown format
+ if (isMidi == -1) {
+ printf("paste: unknown format\n");
+ return;
}
- break;
- case CMD_DELETE_TRACK:
- audio->msgRemoveTracks();
- break;
+ // search target track
+ TrackList* tl = song->tracks();
+ Track* track = 0;
+ for (iTrack i = tl->begin(); i != tl->end(); ++i) {
+ Track* t = *i;
+ if ((isMidi == 1 && t->type() == Track::MIDI)
+ || (isMidi == 0 && t->type() == Track::WAVE)) {
+ track = t;
+ break;
+ }
+ }
+ if (track == 0) {
+ printf("no destination track selected\n");
+ return;
+ }
- case CMD_SELECT_ALL:
- case CMD_SELECT_NONE:
- case CMD_SELECT_INVERT:
- case CMD_SELECT_ILOOP:
- case CMD_SELECT_OLOOP:
- for (iTrack i = tracks->begin(); i != tracks->end(); ++i) {
- PartList* parts = (*i)->parts();
- for (iPart p = parts->begin(); p != parts->end(); ++p) {
- bool f = false;
- int t1 = p->second->tick();
- int t2 = t1 + p->second->lenTick();
- bool inside =
- ((t1 >= l) && (t1 < r))
- || ((t2 > l) && (t2 < r))
- || ((t1 <= l) && (t2 > r));
- switch(cmd) {
- case CMD_SELECT_INVERT:
- f = !p->second->selected();
- break;
- case CMD_SELECT_NONE:
- f = false;
- break;
- case CMD_SELECT_ALL:
- f = true;
- break;
- case CMD_SELECT_ILOOP:
- f = inside;
- break;
- case CMD_SELECT_OLOOP:
- f = !inside;
- break;
- }
- p->second->setSelected(f);
+ QDomDocument doc;
+ int line, column;
+ QString err;
+ PartList pl;
+ if (!doc.setContent(data, false, &err, &line, &column)) {
+ QString col, ln, error;
+ col.setNum(column);
+ ln.setNum(line);
+ error = err + "\n at line: " + ln + " col: " + col;
+ printf("error parsing part: %s\n", error.toLatin1().data());
+ return;
+ }
+ int tick = -1;
+ for (QDomNode node = doc.documentElement(); !node.isNull(); node = node.nextSibling()) {
+ QDomElement e = node.toElement();
+ if (e.isNull())
+ continue;
+ if (e.tagName() == "part") {
+ Part* p = new Part(0);
+ p->ref();
+ p->read(node, true);
+ pl.add(p);
+ if (tick == -1 || p->tick() < unsigned(tick))
+ tick = int(p->tick());
+ }
+ else
+ printf("MusE: %s not supported\n", e.tagName().toLatin1().data());
+ }
+
+ unsigned cpos = song->cpos();
+ song->startUndo();
+ for (iPart ip = pl.begin(); ip != pl.end(); ++ip) {
+ Part* part = ip->second;
+ part->setTick(part->tick() - tick + cpos);
+ part->setTrack(track);
+ song->addPart(part);
+ cpos += part->lenTick();
+ }
+ song->endUndo(0);
+ track->partListChanged();
+ }
+
+ else if (cmd == "delete") {
+ TrackList* tl = song->tracks();
+ bool partsMarked = false;
+ for (iTrack it = tl->begin(); it != tl->end(); ++it) {
+ PartList* pl2 = (*it)->parts();
+ for (iPart ip = pl2->begin(); ip != pl2->end(); ++ip) {
+ if (ip->second->selected()) {
+ partsMarked = true;
+ break;
}
- (*i)->partListChanged(); // repaints canvaswidget
}
- song->update();
- break;
-
- case CMD_SELECT_PARTS:
- for (iTrack i = tracks->begin(); i != tracks->end(); ++i) {
- if (!(*i)->selected())
- continue;
- PartList* parts = (*i)->parts();
- for (iPart p = parts->begin(); p != parts->end(); ++p)
- p->second->setSelected(true);
+ }
+ if (partsMarked)
+ song->cmdRemoveParts();
+ else
+ audio->msgRemoveTracks();
+ }
+ else if (cmd == "delete_track")
+ audio->msgRemoveTracks();
+ else if (cmd == "sel_all" || cmd == "sel_none" || cmd == "sel_inv"
+ || cmd == "sel_ins_loc" || cmd == "sel_out_loc") {
+ for (iTrack i = tracks->begin(); i != tracks->end(); ++i) {
+ PartList* parts = (*i)->parts();
+ for (iPart p = parts->begin(); p != parts->end(); ++p) {
+ bool f = false;
+ int t1 = p->second->tick();
+ int t2 = t1 + p->second->lenTick();
+ bool inside =
+ ((t1 >= l) && (t1 < r))
+ || ((t2 > l) && (t2 < r))
+ || ((t1 <= l) && (t2 > r));
+ if (cmd == "sel_inv")
+ f = !p->second->selected();
+ else if (cmd == "sel_none")
+ f = false;
+ else if (cmd == "sel_all")
+ f = true;
+ else if (cmd == "sel_ins_loc")
+ f = inside;
+ else if (cmd == "sel_out_loc")
+ f = !inside;
+ p->second->setSelected(f);
}
- song->update();
- break;
- case CMD_FOLLOW_NO:
- setFollow(FOLLOW_NO);
- break;
- case CMD_FOLLOW_JUMP:
- setFollow(FOLLOW_JUMP);
- break;
- case CMD_FOLLOW_CONTINUOUS:
- setFollow(FOLLOW_CONTINUOUS);
- break;
+ (*i)->partListChanged(); // repaints canvaswidget
+ }
+ song->update();
+ }
+ else if (cmd == "select_parts_on_track") {
+ for (iTrack i = tracks->begin(); i != tracks->end(); ++i) {
+ if (!(*i)->selected())
+ continue;
+ PartList* parts = (*i)->parts();
+ for (iPart p = parts->begin(); p != parts->end(); ++p)
+ p->second->setSelected(true);
+ }
+ song->update();
}
+
+ else if (cmd == "follow_no")
+ setFollow(FOLLOW_NO);
+ else if (cmd == "follow_jump")
+ setFollow(FOLLOW_JUMP);
+ else if (cmd == "follow_continuous")
+ setFollow(FOLLOW_CONTINUOUS);
}
//---------------------------------------------------------
@@ -1895,22 +1975,13 @@ void MusE::cmd(QAction* a)
void MusE::clipboardChanged()
{
-#if 0 //TD
QString subtype("partlist");
- QMimeSource* ms = QApplication::clipboard()->data(QClipboard::Clipboard);
+ const QMimeData* ms = QApplication::clipboard()->mimeData();
if (ms == 0)
return;
- bool flag = false;
- for (int i = 0; ms->format(i); ++i) {
-// printf("Format <%s\n", ms->format(i));
- if ((strncmp(ms->format(i), "text/midipartlist", 17) == 0)
- || strncmp(ms->format(i), "text/wavepartlist", 17) == 0) {
- flag = true;
- break;
- }
- }
+ bool flag = ms->hasFormat("application/muse/part/midi")
+ || ms->hasFormat("application/muse/part/audio");
pasteAction->setEnabled(flag);
-#endif
}
//---------------------------------------------------------
@@ -2729,6 +2800,20 @@ void MusE::setTool(int tool)
arranger->setTool(tool);
}
+void MusE::setTool(const QString& s)
+ {
+ int id = 0;
+ for (int i = 0; i < TOOLS; ++i) {
+ if (toolList[i] == s) {
+ id = i;
+ break;
+ }
+ }
+ id = 1 << id;
+ tools1->set(id);
+ arranger->setTool(id);
+ }
+
//---------------------------------------------------------
// globalPitchChanged
//---------------------------------------------------------
diff --git a/muse/muse/muse.h b/muse/muse/muse.h
index 9b2ac9ff..1b2a451d 100644
--- a/muse/muse/muse.h
+++ b/muse/muse/muse.h
@@ -178,6 +178,7 @@ class MusE : public QMainWindow // , public Ui::MuseBase
virtual void focusInEvent(QFocusEvent*);
void addMidiFile(const QString name);
+ void copyParts(bool);
signals:
void configChanged();
@@ -278,6 +279,7 @@ class MusE : public QMainWindow // , public Ui::MuseBase
void setTempo200();
void setGlobalTempo(int val);
void setTool(int);
+ void setTool(const QString&);
void startEditor(Part*, int);
bool save();
diff --git a/muse/muse/muse.qrc b/muse/muse/muse.qrc
index 4f17f18a..20cc4209 100644
--- a/muse/muse/muse.qrc
+++ b/muse/muse/muse.qrc
@@ -37,7 +37,6 @@
<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>
@@ -52,6 +51,9 @@
<file>xpm/select_invert_selection.xpm</file>
<file>xpm/select_inside_loop.xpm</file>
<file>xpm/select_outside_loop.xpm</file>
+ <file>xpm/editcut.xpm</file>
+ <file>xpm/editcopy.xpm</file>
+ <file>xpm/editpaste.xpm</file>
</qresource>
diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp
index 34b91293..c0f31008 100644
--- a/muse/muse/shortcuts.cpp
+++ b/muse/muse/shortcuts.cpp
@@ -163,12 +163,6 @@ Shortcut MuseApplication::sc[] = {
":/xpm/panic.xpm"
),
Shortcut(
- "copy",
- QT_TR_NOOP("Edit: Copy"),
- INVIS_SHRT,
- Qt::CTRL + Qt::Key_C
- ),
- Shortcut(
"undo",
QT_TR_NOOP("Edit: Undo"),
INVIS_SHRT,
@@ -190,13 +184,28 @@ Shortcut MuseApplication::sc[] = {
"cut",
QT_TR_NOOP("Edit: Cut" ),
INVIS_SHRT,
- Qt::CTRL + Qt::Key_X
+ Qt::CTRL + Qt::Key_X,
+ QT_TR_NOOP("Cut"),
+ QT_TR_NOOP("Cut"),
+ ":/xpm/editcut.xpm"
+ ),
+ Shortcut(
+ "copy",
+ QT_TR_NOOP("Edit: Copy"),
+ INVIS_SHRT,
+ Qt::CTRL + Qt::Key_C,
+ QT_TR_NOOP("Copy"),
+ QT_TR_NOOP("Copy"),
+ ":/xpm/editcopy.xpm"
),
Shortcut(
"paste",
QT_TR_NOOP("Edit: Paste,"),
INVIS_SHRT,
- Qt::CTRL + Qt::Key_V
+ Qt::CTRL + Qt::Key_V,
+ QT_TR_NOOP("Paste"),
+ QT_TR_NOOP("Paste"),
+ ":/xpm/editpaste.xpm"
),
Shortcut(
"delete",