diff options
-rw-r--r-- | muse/awl/tcanvas.cpp | 8 | ||||
-rw-r--r-- | muse/muse/arranger/arranger.cpp | 14 | ||||
-rw-r--r-- | muse/muse/arranger/canvas.cpp | 9 | ||||
-rw-r--r-- | muse/muse/arranger/tlswidget.cpp | 2 | ||||
-rw-r--r-- | muse/muse/ctrl/ctrleditor.cpp | 24 | ||||
-rw-r--r-- | muse/muse/ctrl/ctrleditor.h | 4 | ||||
-rw-r--r-- | muse/muse/midiedit/ctrledit.cpp | 3 | ||||
-rw-r--r-- | muse/muse/muse.cpp | 12 |
8 files changed, 49 insertions, 27 deletions
diff --git a/muse/awl/tcanvas.cpp b/muse/awl/tcanvas.cpp index 53d91462..e892f819 100644 --- a/muse/awl/tcanvas.cpp +++ b/muse/awl/tcanvas.cpp @@ -645,7 +645,6 @@ void TimeCanvas::paintMetronomRuler(QPainter& p, const QRect& r) if (x < (MAP_OFFSET - wpos.x())) x = MAP_OFFSET - wpos.x(); -// AL::Pos pos1 = pix2pos(x - flagIconS->width()); AL::Pos pos1 = pix2pos(x); AL::Pos pos2 = pix2pos(x+w); @@ -713,7 +712,7 @@ void TimeCanvas::paintMetronomRuler(QPainter& p, const QRect& r) if (xp < 0) continue; QString s; - QRect r(xp+2, y, 1000, h); + QRect r(xp+2, y + 1, 1000, h); int y3; int num; if (beat == 0) { @@ -725,7 +724,7 @@ void TimeCanvas::paintMetronomRuler(QPainter& p, const QRect& r) num = beat + 1; y3 = y + 8; p.setFont(config.fonts[1]); - r.setY(y+3); + r.moveTop(r.top() + 1); } s.setNum(num); p.setPen(Qt::black); @@ -774,7 +773,8 @@ void TimeCanvas::canvasPaintEvent(const QRect& r, QPainter& p) p.drawLine(rButton.x(), y, rButton.width(), y); } p.setRenderHint(QPainter::TextAntialiasing, true); - p.setRenderHint(QPainter::SmoothPixmapTransform, true); + p.setRenderHint(QPainter::Antialiasing, true); +// p.setRenderHint(QPainter::SmoothPixmapTransform, true); QRect par = r & rPanelA; if (!(par.isEmpty() || rPanelA.isEmpty())) { diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp index a8912705..83b9bddc 100644 --- a/muse/muse/arranger/arranger.cpp +++ b/muse/muse/arranger/arranger.cpp @@ -300,19 +300,21 @@ Arranger::Arranger(QMainWindow* parent) infoDock = new QDockWidget(tr("TrackInfo")); infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); infoDock->setMinimumWidth(infoWidth); - infoDock->layout()->setMargin(0); + infoDock->layout()->setMargin(1); infoDock->layout()->setSpacing(0); infoDockAction = infoDock->toggleViewAction(); mixerDock = new QDockWidget(tr("Mix")); mixerDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - mixerDock->setFixedWidth(STRIP_WIDTH); - mixerDock->layout()->setMargin(0); +// mixerDock->setMaximumWidth(STRIP_WIDTH); + mixerDock->layout()->setMargin(1); mixerDock->layout()->setSpacing(0); mixerDockAction = mixerDock->toggleViewAction(); + parent->setDockNestingEnabled(true); + parent->addDockWidget(Qt::LeftDockWidgetArea, infoDock, Qt::Horizontal); - parent->addDockWidget(Qt::LeftDockWidgetArea, mixerDock, Qt::Horizontal); + parent->splitDockWidget(infoDock, mixerDock, Qt::Horizontal); infoView = new QScrollArea; infoDock->setWidget(infoView); @@ -325,6 +327,7 @@ Arranger::Arranger(QMainWindow* parent) trackInfoVisible = false; mixerStripVisible = false; + infoDock->setVisible(false); mixerDock->setVisible(false); @@ -847,6 +850,8 @@ void Arranger::toggleTrackInfo(bool val) w->init(_curTrack); trackInfo->setCurrentWidget(w); } + infoDock->layout()->invalidate(); + infoDock->layout()->update(); } //--------------------------------------------------------- @@ -882,6 +887,7 @@ void Arranger::toggleMixerStrip(bool val) strip = new AudioStrip(0, (AudioTrack*)_curTrack, false); break; } + strip->setFixedWidth(STRIP_WIDTH); mixerDock->setWidget(strip); } } diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp index 17dec5d5..de38f322 100644 --- a/muse/muse/arranger/canvas.cpp +++ b/muse/muse/arranger/canvas.cpp @@ -558,6 +558,11 @@ void PartCanvas::contextMenu(const QPoint& pos) void PartCanvas::mousePress(QMouseEvent* me) { + if (state == S_SUBTRACK) { + ((TLSWidget*)(at->tw))->mouseRelease(); + state = S_NORMAL; + } + QPoint pos(me->pos().x(), me->pos().y() - rulerHeight); startDrag = pos; int hit = searchPart(startDrag); @@ -566,7 +571,9 @@ void PartCanvas::mousePress(QMouseEvent* me) TLSWidget* w = (TLSWidget*)(at->tw); int y = wpos.y() + pos.y() - w->y(); w->mousePress(QPoint(pos.x(), y), button, me->modifiers()); - state = S_SUBTRACK; + // propagate drag events to subtrack if left button pressed: + if (me->button() == Qt::LeftButton) + state = S_SUBTRACK; return; } diff --git a/muse/muse/arranger/tlswidget.cpp b/muse/muse/arranger/tlswidget.cpp index fed37f0c..cd78b1a8 100644 --- a/muse/muse/arranger/tlswidget.cpp +++ b/muse/muse/arranger/tlswidget.cpp @@ -32,8 +32,6 @@ #include "midictrl.h" #include "widgets/utils.h" -static Ctrl veloList(CTRL_VELOCITY, "velocity", Ctrl::DISCRETE, 0.0, 127.0); // dummy - //--------------------------------------------------------- // TLSLayout //--------------------------------------------------------- diff --git a/muse/muse/ctrl/ctrleditor.cpp b/muse/muse/ctrl/ctrleditor.cpp index 13f3bc49..6698e96e 100644 --- a/muse/muse/ctrl/ctrleditor.cpp +++ b/muse/muse/ctrl/ctrleditor.cpp @@ -34,6 +34,9 @@ static const int HANDLE1 = 6; static const int HANDLE2 = 3; static const int veloWidth = 3; +Ctrl veloList(CTRL_VELOCITY, "velocity", Ctrl::DISCRETE |Ctrl::INT, 0.0, 127.0); // dummy +Ctrl sveloList(CTRL_SVELOCITY, "single velocity", Ctrl::DISCRETE |Ctrl::INT, 0.0, 127.0); // dummy + //--------------------------------------------------------- // CtrlEditor //--------------------------------------------------------- @@ -208,23 +211,30 @@ void CtrlEditor::mousePress(const QPoint& pos, int button, Qt::KeyboardModifiers { Tool tool = tc()->tool(); if (button & Qt::RightButton) { - QMenu* pop = new QMenu(tc()); + QMenu pop(tc()); QAction* a; for (int i = 0; i < TOOLS; ++i) { - if ((arrangerTools & (1 << i)) == 0) - continue; - a = pop->addAction(**toolList[i].icon, tc()->tr(toolList[i].tip)); int id = 1 << i; + if ((arrangerTools & id) == 0) + continue; + a = pop.addAction(**toolList[i].icon, tc()->tr(toolList[i].tip)); a->setData(id); a->setCheckable(true); if (id == (int)tool) a->setChecked(true); } - a = pop->exec(tc()->mapToGlobal(pos)); + a = pop.addSeparator(); + a = pop.addAction("List Editor"); + a->setData(1 << (TOOLS+1)); + + a = pop.exec(tc()->mapToGlobal(pos)); if (a) { int n = a->data().toInt(); - // tc()->setTool(n); - muse->setTool(n); + if (n == (1 << (TOOLS+1))) { + printf("TODO: start list editor\n"); + } + else + muse->setTool(n); } return; } diff --git a/muse/muse/ctrl/ctrleditor.h b/muse/muse/ctrl/ctrleditor.h index 11f042fa..c1406436 100644 --- a/muse/muse/ctrl/ctrleditor.h +++ b/muse/muse/ctrl/ctrleditor.h @@ -51,6 +51,8 @@ class CtrlEditor { virtual Track* track() const = 0; virtual Track* ctrlTrack() const = 0; + bool searchHandle(unsigned* time) const; + int ctrlY(int x, const CVal&) const; protected: @@ -66,5 +68,7 @@ class CtrlEditor { void mouseMove(const QPoint& pos); }; +extern Ctrl veloList; +extern Ctrl sveloList; #endif diff --git a/muse/muse/midiedit/ctrledit.cpp b/muse/muse/midiedit/ctrledit.cpp index 925f0247..1c537162 100644 --- a/muse/muse/midiedit/ctrledit.cpp +++ b/muse/muse/midiedit/ctrledit.cpp @@ -29,9 +29,6 @@ #include "midioutport.h" #include "midichannel.h" -static Ctrl veloList(CTRL_VELOCITY, "velocity", Ctrl::DISCRETE |Ctrl::INT, 0.0, 127.0); // dummy -static Ctrl sveloList(CTRL_SVELOCITY, "single velocity", Ctrl::DISCRETE |Ctrl::INT, 0.0, 127.0); // dummy - //--------------------------------------------------------- // CtrlEdit //--------------------------------------------------------- diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index 7eaae2e5..1fef1927 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -2856,12 +2856,12 @@ int main(int argc, char* argv[]) initMidiInstruments(); MuseApplication app(argc, argv); - config.fonts[0] = QFont(QString("arial"), 10, QFont::Normal); - config.fonts[1] = QFont(QString("arial"), 8, QFont::Normal); - config.fonts[2] = QFont(QString("arial"), 10, QFont::Normal); - config.fonts[3] = QFont(QString("arial"), 8, QFont::Bold); - config.fonts[4] = QFont(QString("arial"), 8, QFont::Bold); // simple buttons, timescale numbers - config.fonts[5] = QFont(QString("Lucidatypewriter"), 14, QFont::Bold); + config.fonts[0] = QFont(QString("helvetica"), 10, QFont::Normal); + config.fonts[1] = QFont(QString("helvetica"), 6, QFont::Normal); + config.fonts[2] = QFont(QString("helvetica"), 10, QFont::Normal); + config.fonts[3] = QFont(QString("helvetica"), 8, QFont::Bold); + config.fonts[4] = QFont(QString("helvetica"), 8, QFont::Bold); // simple buttons, timescale numbers + config.fonts[5] = QFont(QString("Courier"), 14, QFont::Bold); initShortCuts(); gmDrumMap.initGm(); // init default drum map |