summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-12-25 14:20:33 +0000
committerFlorian Jung <flo@windfisch.org>2011-12-25 14:20:33 +0000
commitc0cf8683409dfb74cae82e4b2adcd457a3e1d2b6 (patch)
tree0476be7bb0582af92ddcfacc1e305bfe817f3b85
parentb1b88156cb2adf84e752449f2bc803754b520f8c (diff)
ctrlcanvas now reacts properly on ALT-left/right part changes
-rw-r--r--muse2/muse/ctrl/ctrlcanvas.cpp7
-rw-r--r--muse2/muse/ctrl/ctrlcanvas.h1
-rw-r--r--muse2/muse/ctrl/ctrledit.cpp5
-rw-r--r--muse2/muse/ctrl/ctrledit.h1
-rw-r--r--muse2/muse/midiedit/dcanvas.cpp1
-rw-r--r--muse2/muse/midiedit/drumedit.cpp1
-rw-r--r--muse2/muse/midiedit/prcanvas.cpp1
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp23
-rw-r--r--muse2/muse/widgets/canvas.h4
9 files changed, 40 insertions, 4 deletions
diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp
index 9896de9a..ddecdbf6 100644
--- a/muse2/muse/ctrl/ctrlcanvas.cpp
+++ b/muse2/muse/ctrl/ctrlcanvas.cpp
@@ -2041,4 +2041,11 @@ void CtrlCanvas::setCurDrumPitch(int instrument)
//songChanged(-1);
}
+void CtrlCanvas::curPartHasChanged(MusECore::Part*)
+{
+ setCurTrackAndPart();
+ setCurDrumPitch(editor->curDrumInstrument());
+ songChanged(SC_EVENT_MODIFIED);
+}
+
} // namespace MusEGui
diff --git a/muse2/muse/ctrl/ctrlcanvas.h b/muse2/muse/ctrl/ctrlcanvas.h
index 1fcaf1d8..50b71bbe 100644
--- a/muse2/muse/ctrl/ctrlcanvas.h
+++ b/muse2/muse/ctrl/ctrlcanvas.h
@@ -188,6 +188,7 @@ class CtrlCanvas : public MusEGui::View {
void setTool(int t);
void setPos(int, unsigned, bool adjustScrollbar);
void setController(int ctrl);
+ void curPartHasChanged(MusECore::Part*);
signals:
void followEvent(int);
diff --git a/muse2/muse/ctrl/ctrledit.cpp b/muse2/muse/ctrl/ctrledit.cpp
index 5ce6a7bb..5fbdecaf 100644
--- a/muse2/muse/ctrl/ctrledit.cpp
+++ b/muse2/muse/ctrl/ctrledit.cpp
@@ -182,4 +182,9 @@ void CtrlEdit::setController(const QString& name)
}
}
+void CtrlEdit::curPartHasChanged(MusECore::Part* p)
+{
+ canvas->curPartHasChanged(p);
+}
+
} // namespace MusEGui
diff --git a/muse2/muse/ctrl/ctrledit.h b/muse2/muse/ctrl/ctrledit.h
index 1f7a67a9..a0a941cc 100644
--- a/muse2/muse/ctrl/ctrledit.h
+++ b/muse2/muse/ctrl/ctrledit.h
@@ -60,6 +60,7 @@ class CtrlEdit : public QWidget {
void setXMag(int val) { canvas->setXMag(val); }
void setCanvasWidth(int w);
void setController(int /*n*/);
+ void curPartHasChanged(MusECore::Part*);
signals:
void timeChanged(unsigned);
diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp
index bc8bbdb0..bdf16b6e 100644
--- a/muse2/muse/midiedit/dcanvas.cpp
+++ b/muse2/muse/midiedit/dcanvas.cpp
@@ -1155,6 +1155,7 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta)
void DrumCanvas::curPartChanged()
{
+ EventCanvas::curPartChanged();
editor->setWindowTitle(getCaption());
}
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 7adab525..4015bbc1 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -1076,6 +1076,7 @@ CtrlEdit* DrumEdit::addCtrl()
connect(tools2, SIGNAL(toolChanged(int)), ctrlEdit, SLOT(setTool(int)));
connect(dlist, SIGNAL(curDrumInstrumentChanged(int)), SLOT(setCurDrumInstrument(int)));
connect(dlist, SIGNAL(curDrumInstrumentChanged(int)), canvas, SLOT(setCurDrumInstrument(int)));
+ connect(canvas, SIGNAL(curPartHasChanged(MusECore::Part*)), ctrlEdit, SLOT(curPartHasChanged(MusECore::Part*)));
//printf("DrumEdit::addCtrl curDrumInstrument:%d\n", dlist->getSelectedInstrument());
diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp
index 2c32a1cf..fe7f6979 100644
--- a/muse2/muse/midiedit/prcanvas.cpp
+++ b/muse2/muse/midiedit/prcanvas.cpp
@@ -1081,6 +1081,7 @@ void PianoCanvas::itemMoved(const MusEGui::CItem* item, const QPoint& pos)
void PianoCanvas::curPartChanged()
{
+ EventCanvas::curPartChanged();
editor->setWindowTitle(getCaption());
}
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index ff1893ce..2d544c90 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -4655,6 +4655,20 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
// every time something changes.
+/* STUFF I WANT TO WORK
+ *
+ * x multiple new drum tracks can be displayed seperately in ONE drum
+ * editor
+ * x reorder drummap
+ * ? support and correctly map e-note on record and steprec
+ * ? only record nonmuted/whatever notes
+ * ? support drum controllers
+ * o refuse to mix up old-style and new-style drum tracks in ONE editor
+ * o drummap saving and loading (per-track)
+ * o drummap import/export
+ * o drummap automatically adapting to the chosen midi synth / patch
+ */
+
/* BUGS and potential bugs
* o tied notes don't work properly when there's a key-change in
* between, for example, when a cis is tied to a des
@@ -4665,6 +4679,9 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
* from clipboard failed. ignoring this one... ) [ not reproducible ]
*
* CURRENT TODO
+ * o having the same drum track in two editors open, using "hide all"
+ * on the first (while the second is in "only shown"-mode), this
+ * has no effect in the second.
* o drum controllers
* update ctrlcanvas/panel
* test!
@@ -4675,9 +4692,9 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
* o quantize must round UP, not down when at 0.5
* o my record flag handling
* o option for disabling old-style / new-style drum tracks?
- * ! o using super glue while a score editor displaying the glued parts
- * is open lets muse segfault. this may or may not be fixed in
- * the release branch :/
+ * ! o once, using super glue while a score editor displaying the glued
+ * parts is open let muse segfault. this may or may not be fixed
+ * now. check!
*
* > o drum editor: channel-stuff
* o clearly state in the changelog: when having multiple drumeditors open,
diff --git a/muse2/muse/widgets/canvas.h b/muse2/muse/widgets/canvas.h
index 38024feb..2ab4820c 100644
--- a/muse2/muse/widgets/canvas.h
+++ b/muse2/muse/widgets/canvas.h
@@ -172,7 +172,7 @@ class Canvas : public View {
virtual void itemPressed(const CItem*) {}
virtual void itemReleased(const CItem*, const QPoint&) {}
virtual void itemMoved(const CItem*, const QPoint&) {}
- virtual void curPartChanged() {}
+ virtual void curPartChanged() { emit curPartHasChanged(curPart); }
public slots:
void setTool(int t);
@@ -188,6 +188,8 @@ class Canvas : public View {
void horizontalScrollNoLimit(unsigned);
void horizontalZoomIn();
void horizontalZoomOut();
+ void curPartHasChanged(MusECore::Part*);
+
public:
Canvas(QWidget* parent, int sx, int sy, const char* name = 0);
virtual ~Canvas();