summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2010-07-21 09:38:59 +0000
committerRobert Jonsson <spamatica@gmail.com>2010-07-21 09:38:59 +0000
commitfa27945706de2f72c082b7157ffdc658f84f58bd (patch)
tree57e98a3a0ce1d92363cc51f9dc02b3fdee2c5913
parent6a65acc8616f159e6ead854ee33571dbdac8fc94 (diff)
see changelog
-rw-r--r--muse/ChangeLog4
-rw-r--r--muse/muse/driver/dummyaudio.cpp1
-rw-r--r--muse/muse/midiedit/piano.cpp148
-rw-r--r--muse/muse/midiedit/piano.h1
-rw-r--r--muse/muse/midiedit/prcanvas.cpp6
-rw-r--r--muse/muse/shortcuts.cpp4
6 files changed, 159 insertions, 5 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 09b431f8..cc28a4c4 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,7 @@
+21.07.2010
+ * Improved: Note lanes in pianoroll and marking of C-notes (rj)
+20.07.2010
+ * Fixed: illegal shortcut no longer reported on startup (rj)
18.07.2010
* Fixed: Handle errors during timer initialization more gracefully (rj)
15.07.2010
diff --git a/muse/muse/driver/dummyaudio.cpp b/muse/muse/driver/dummyaudio.cpp
index d7c2e127..30da8197 100644
--- a/muse/muse/driver/dummyaudio.cpp
+++ b/muse/muse/driver/dummyaudio.cpp
@@ -12,6 +12,7 @@
#include <stdarg.h>
#include <pthread.h>
#include <sys/poll.h>
+#include <qmessagebox.h>
#include "config.h"
#include "audio.h"
diff --git a/muse/muse/midiedit/piano.cpp b/muse/muse/midiedit/piano.cpp
index 477e7dab..4b2dc9de 100644
--- a/muse/muse/midiedit/piano.cpp
+++ b/muse/muse/midiedit/piano.cpp
@@ -100,13 +100,136 @@ static const char *oct_xpm[] = {
"########################...............#",
"#######################................#", //------------------------
".......................................#",
+ "..........................###..........#",
+ ".........................#...#.........#",
+ ".........................#.............#",
+ ".........................#.............#",
+ ".........................#...#.........#", // 10
+ "..........................###..........#",
".......................................#",
".......................................#",
".......................................#",
+ };
+
+static const char *mk1_xpmC1[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###.....#....#",
+ ".........................#...#...##....#",
+ ".........................#........#....#",
+ ".........................#........#....#",
+ ".........................#...#....#....#", // 10
+ "..........................###....###...#",
".......................................#",
- ".......................................#", // 10
".......................................#",
".......................................#",
+ };
+static const char *mk1_xpmC2[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###....##....#",
+ ".........................#...#..#..#...#",
+ ".........................#........#....#",
+ ".........................#.......#.....#",
+ ".........................#...#..#......#", // 10
+ "..........................###...####...#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+static const char *mk1_xpmC3[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###....##....#",
+ ".........................#...#..#..#...#",
+ ".........................#........#....#",
+ ".........................#.........#...#",
+ ".........................#...#..#..#...#", // 10
+ "..........................###....##....#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+static const char *mk1_xpmC4[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###...#..#...#",
+ ".........................#...#..#..#...#",
+ ".........................#......####...#",
+ ".........................#.........#...#",
+ ".........................#...#.....#...#", // 10
+ "..........................###......#...#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+static const char *mk1_xpmC5[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###...####...#",
+ ".........................#...#..#......#",
+ ".........................#......###....#",
+ ".........................#.........#...#",
+ ".........................#...#.....#...#", // 10
+ "..........................###...###....#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+
+static const char *mk1_xpmC6[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###....###...#",
+ ".........................#...#..#......#",
+ ".........................#......###....#",
+ ".........................#......#..#...#",
+ ".........................#...#..#..#...#", // 10
+ "..........................###...###....#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+
+static const char *mk1_xpmC7[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###...####...#",
+ ".........................#...#.....#...#",
+ ".........................#........#....#",
+ ".........................#.......#.....#",
+ ".........................#...#..#......#", // 10
+ "..........................###...#......#",
+ ".......................................#",
+ ".......................................#",
+ ".......................................#",
+ };
+static const char *mk1_xpmC8[] = {
+ "40 10 2 1",
+ ". c #c0c0c0",
+ "# c #000000",
+ ".......................................#",
+ "..........................###....##....#",
+ ".........................#...#..#..#....#",
+ ".........................#.......##....#",
+ ".........................#......#..#...#",
+ ".........................#...#..#..#...#", // 10
+ "..........................###....##....#",
+ ".......................................#",
".......................................#",
".......................................#",
};
@@ -233,6 +356,15 @@ Piano::Piano(QWidget* parent, int ymag)
setMouseTracking(true);
curPitch = -1;
octave = new QPixmap(oct_xpm);
+ c_keys[0] = new QPixmap(mk1_xpmC8);
+ c_keys[1] = new QPixmap(mk1_xpmC7);
+ c_keys[2] = new QPixmap(mk1_xpmC6);
+ c_keys[3] = new QPixmap(mk1_xpmC5);
+ c_keys[4] = new QPixmap(mk1_xpmC4);
+ c_keys[5] = new QPixmap(mk1_xpmC3);
+ c_keys[6] = new QPixmap(mk1_xpmC2);
+ c_keys[7] = new QPixmap(mk1_xpmC1);
+
mk1 = new QPixmap(mk1_xpm);
mk2 = new QPixmap(mk2_xpm);
mk3 = new QPixmap(mk3_xpm);
@@ -249,6 +381,20 @@ void Piano::draw(QPainter& p, const QRect& r)
{
QPoint offset(0, KH*2);
p.drawTiledPixmap(r, *octave, r.topLeft()+offset);
+
+ // draw C notes
+ for (int drawKey = 0; drawKey < 8;drawKey++) {
+ int octaveSize=91;
+
+ int drawY = octaveSize * drawKey + 81 - KH*2;
+ if (drawY > r.y() && drawY < r.y() + r.height()) {
+ //printf("drawing c %d at %d r.y %d r.x %d\n",drawKey, drawY, r.y(), r.x());
+ p.drawPixmap(0,drawY,*c_keys[drawKey]);
+ }
+ }
+ //p.drawTiledPixmap(r, *c1, r.topLeft()+offset + coffset);
+ //printf("drawText KH %d %d, x %d y %d\n",KH, curPitch, r.x(), r.y());
+ //p.drawText(r,Qt::AlignAuto,"A");
if (curPitch == -1)
return;
int y = pitch2y(curPitch);
diff --git a/muse/muse/midiedit/piano.h b/muse/muse/midiedit/piano.h
index 3650c3d4..279349d2 100644
--- a/muse/muse/midiedit/piano.h
+++ b/muse/muse/midiedit/piano.h
@@ -22,6 +22,7 @@ class Piano : public View
{
int curPitch;
QPixmap* octave;
+ QPixmap* c_keys[10];
QPixmap* mk1;
QPixmap* mk2;
QPixmap* mk3;
diff --git a/muse/muse/midiedit/prcanvas.cpp b/muse/muse/midiedit/prcanvas.cpp
index b5a5d87c..d61f26a7 100644
--- a/muse/muse/midiedit/prcanvas.cpp
+++ b/muse/muse/midiedit/prcanvas.cpp
@@ -853,12 +853,14 @@ void PianoCanvas::drawCanvas(QPainter& p, const QRect& rect)
case 0:
case 3:
p.setPen(black);
+ p.drawLine(x, yy, x + w, yy);
break;
default:
- p.setPen(gray);
+ //p.setPen(lightGray);
+ p.fillRect(x, yy-3, w, 6, QBrush(QColor(230,230,230)));
+ //p.drawLine(x, yy, x + w, yy);
break;
}
- p.drawLine(x, yy, x + w, yy);
--key;
}
diff --git a/muse/muse/shortcuts.cpp b/muse/muse/shortcuts.cpp
index 6a1ffc7c..13bb1f10 100644
--- a/muse/muse/shortcuts.cpp
+++ b/muse/muse/shortcuts.cpp
@@ -128,8 +128,8 @@ void initShortCuts()
defShrt(SHRT_SEL_BELOW, Qt::Key_Down, "Edit: Select nearest part on track below", ARRANG_SHRT, "sel_part_below");
defShrt(SHRT_SEL_BELOW_ADD, Qt::SHIFT + Qt::Key_Down, "Edit: Add nearest part on track below", ARRANG_SHRT, "sel_part_below_add");
- defShrt(SHRT_INSERT, Qt::CTRL+Qt::SHIFT+ Qt::Key_I, "Edit: Insert parts, moving time", ARRANG_SHRT, "insert parts");
- defShrt(SHRT_INSERTMEAS, Qt::CTRL+Qt::SHIFT+ Qt::Key_M, "Edit: Insert empty measure", ARRANG_SHRT, "insert measure");
+ defShrt(SHRT_INSERT, Qt::CTRL+Qt::SHIFT+ Qt::Key_I, "Edit: Insert parts, moving time", ARRANG_SHRT, "insert_parts");
+ defShrt(SHRT_INSERTMEAS, Qt::CTRL+Qt::SHIFT+ Qt::Key_M, "Edit: Insert empty measure", ARRANG_SHRT, "insert_measure");
defShrt(SHRT_SEL_TRACK_ABOVE, Qt::CTRL + Qt::Key_Up, "Select track above", ARRANG_SHRT, "sel_track_above");
defShrt(SHRT_SEL_TRACK_BELOW, Qt::CTRL + Qt::Key_Down, "Select track below", ARRANG_SHRT, "sel_track_below");