From: werner s. <wsc...@us...> - 2006-01-27 21:12:38
|
Update of /cvsroot/lmuse/muse/muse/midiedit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2803/muse/midiedit Modified Files: citem.h ctrledit.cpp ctrledit.h dcanvas.cpp dcanvas.h drumedit.cpp drumedit.h drummap.h ecanvas.h pianoroll.h prcanvas.h Log Message: "single pitch velocity controller" for drum editor Index: ctrledit.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/ctrledit.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ctrledit.h 13 Jan 2006 14:12:51 -0000 1.6 --- ctrledit.h 27 Jan 2006 21:12:10 -0000 1.7 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2005 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= *************** *** 53,56 **** --- 53,57 ---- virtual int cheight() const { return _height; } void setCtrl(Ctrl* c) { _ctrl = c; } + void setSinglePitch(int); }; Index: drumedit.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/drumedit.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** drumedit.cpp 27 Jan 2006 14:08:48 -0000 1.72 --- drumedit.cpp 27 Jan 2006 21:12:10 -0000 1.73 *************** *** 186,191 **** DrumEdit::~DrumEdit() { - // refreshSettings(); - // undoRedo->removeFrom(tools); } --- 186,189 ---- *************** *** 255,283 **** void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val) { - #if 0 - if (selEvent.empty()) { - printf("noteinfoChanged while note is zero %d\n", type); - return; - } - Event event = selEvent.clone(); - switch (type) { - case NoteInfo::VAL_TIME: - event.setTick(val - selPart->tick()); - break; - case NoteInfo::VAL_LEN: - event.setLenTick(val); - break; - case NoteInfo::VAL_VELON: - event.setVelo(val); - break; - case NoteInfo::VAL_VELOFF: - event.setVeloOff(val); - break; - case NoteInfo::VAL_PITCH: - event.setPitch(val); - break; - } - audio->msgChangeEvent(selEvent, event, selPart); - #endif int selections = canvas()->selectionSize(); --- 253,256 ---- Index: pianoroll.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/pianoroll.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** pianoroll.h 26 Jan 2006 16:11:22 -0000 1.33 --- pianoroll.h 27 Jan 2006 21:12:10 -0000 1.34 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= Index: dcanvas.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/dcanvas.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** dcanvas.cpp 27 Jan 2006 12:25:46 -0000 1.57 --- dcanvas.cpp 27 Jan 2006 21:12:10 -0000 1.58 *************** *** 57,60 **** --- 57,61 ---- : EventCanvas(pr, TIME_CANVAS_DRUMEDIT) { + singlePitch = -1; verticalScrollBar()->setSingleStep(drumHeight/2); canvasTools = PointerTool | PencilTool | RubberTool; *************** *** 410,414 **** void DrumCanvas::startDrag(CItem* /* item*/, bool copymode) { ! #if 0 QMimeData* drag = getTextDrag(); if (drag) { --- 411,415 ---- void DrumCanvas::startDrag(CItem* /* item*/, bool copymode) { ! #if 0 //TD QMimeData* drag = getTextDrag(); if (drag) { *************** *** 437,441 **** void DrumCanvas::dragMoveEvent(QDragMoveEvent*) { ! // printf("drag move %x\n", this); } --- 438,442 ---- void DrumCanvas::dragMoveEvent(QDragMoveEvent*) { ! //TD printf("drag move %x\n", this); } *************** *** 446,450 **** void DrumCanvas::dragLeaveEvent(QDragLeaveEvent*) { ! // printf("drag leave\n"); } --- 447,451 ---- void DrumCanvas::dragLeaveEvent(QDragLeaveEvent*) { ! //TD printf("drag leave\n"); } *************** *** 615,619 **** break; QRect r(3, y, drumWidth-4, drumHeight); ! if (dm->anote(i) == curPitch) p.fillRect(0, y, drumWidth-4, drumHeight, Qt::white); DrumMapEntry* de = dm->entry(i); --- 616,620 ---- break; QRect r(3, y, drumWidth-4, drumHeight); ! if (dm->anote(i) == curPitch || dm->anote(i) == singlePitch) p.fillRect(0, y, drumWidth-4, drumHeight, Qt::white); DrumMapEntry* de = dm->entry(i); *************** *** 693,701 **** { QPoint r(ev->pos()); if (r.x() < 20) { // // "mute" button click // - int pitch = y2pitch(r.y() - rPanelA.y() - wpos.y()); DrumMap* dm = drumMap(); int idx = dm->outmap(pitch); --- 694,702 ---- { QPoint r(ev->pos()); + int pitch = y2pitch(r.y() - rPanelA.y() - wpos.y()); if (r.x() < 20) { // // "mute" button click // DrumMap* dm = drumMap(); int idx = dm->outmap(pitch); *************** *** 705,708 **** --- 706,717 ---- return; } + else if (r.x() < rCanvasA.x()) { + if (pitch != singlePitch) { + singlePitch = pitch; + for (iCtrlEdit i = ctrlEditList.begin(); i != ctrlEditList.end(); ++i) + (*i)->setSinglePitch(singlePitch); + widget()->update(); + } + } EventCanvas::mousePress(ev); } Index: dcanvas.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/dcanvas.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** dcanvas.h 26 Jan 2006 16:11:22 -0000 1.29 --- dcanvas.h 27 Jan 2006 21:12:10 -0000 1.30 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= *************** *** 21,24 **** --- 21,25 ---- Q_OBJECT + int singlePitch; virtual void mousePress(QMouseEvent*); virtual void paint(QPainter&, QRect); Index: prcanvas.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/prcanvas.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** prcanvas.h 27 Jan 2006 12:25:46 -0000 1.34 --- prcanvas.h 27 Jan 2006 21:12:10 -0000 1.35 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2005 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= Index: ctrledit.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/ctrledit.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ctrledit.cpp 23 Jan 2006 17:41:21 -0000 1.7 --- ctrledit.cpp 27 Jan 2006 21:12:10 -0000 1.8 *************** *** 7,11 **** #include "ctrledit.h" - // #include "extmidieditor.h" #include "al/xml.h" #include "gconfig.h" --- 7,10 ---- *************** *** 20,23 **** --- 19,23 ---- 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 //--------------------------------------------------------- *************** *** 85,88 **** --- 85,93 ---- _ctrlTrack = _track; } + else if (id == CTRL_SVELOCITY) { + ctrlId = id; + _ctrl = &sveloList; + _ctrlTrack = _track; + } else if (id == CTRL_OTHER) { // "other" if (track()->type() == Track::MIDI) { *************** *** 130,131 **** --- 135,146 ---- return val.i; } + + //--------------------------------------------------------- + // setSinglePitch + //--------------------------------------------------------- + + void CtrlEdit::setSinglePitch(int val) + { + singlePitch = val; + } + Index: drummap.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/drummap.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** drummap.h 27 Jan 2006 10:35:26 -0000 1.9 --- drummap.h 27 Jan 2006 21:12:10 -0000 1.10 *************** *** 4,8 **** // $Id$ // ! // (C) Copyright 1999/2005 Werner Schweer (ws...@se...) //========================================================= --- 4,8 ---- // $Id$ // ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= Index: citem.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/citem.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** citem.h 7 Jan 2006 16:29:13 -0000 1.5 --- citem.h 27 Jan 2006 21:12:10 -0000 1.6 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2005 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= Index: drumedit.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/drumedit.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** drumedit.h 26 Jan 2006 16:11:22 -0000 1.35 --- drumedit.h 27 Jan 2006 21:12:10 -0000 1.36 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2006 Werner Schweer (ws...@se...) //========================================================= Index: ecanvas.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/midiedit/ecanvas.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ecanvas.h 27 Jan 2006 12:25:46 -0000 1.36 --- ecanvas.h 27 Jan 2006 21:12:10 -0000 1.37 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 2001-2005 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 2001-2006 Werner Schweer (ws...@se...) //========================================================= *************** *** 31,36 **** int playedPitch; - CtrlEditList ctrlEditList; - void noteOn(int pitch, int velocity, bool shift); void noteOff(int pitch); --- 31,34 ---- *************** *** 51,54 **** --- 49,53 ---- }; + CtrlEditList ctrlEditList; MidiEditor* editor; CItemList items; |