From: werner s. <wsc...@us...> - 2005-09-28 20:27:25
|
Update of /cvsroot/lmuse/muse/muse/master In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15332/muse/master Modified Files: master.cpp master.h masteredit.cpp masteredit.h Log Message: reorganized pianoroll editor and drum editor; part1 Index: masteredit.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/master/masteredit.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** masteredit.h 26 Sep 2005 18:26:21 -0000 1.14 --- masteredit.h 28 Sep 2005 20:26:38 -0000 1.15 *************** *** 31,40 **** class MasterEdit : public GraphMidiEditor { ! MasterCanvas* canvas; ! // MTScale* time1; ! // MTScale* time2; ! // SigScale* sign; ! // TScale* tscale; TempoEdit* curTempo; SigEdit* curSig; --- 31,37 ---- class MasterEdit : public GraphMidiEditor { ! Q_OBJECT + MasterCanvas* canvas; TempoEdit* curTempo; SigEdit* curSig; *************** *** 44,54 **** TempoLabel* tempo; - Q_OBJECT - virtual void closeEvent(QCloseEvent*); - private slots: void _setRaster(int); ! void posChanged(int,unsigned,bool); ! void setTime(unsigned); void setTempo(int); --- 41,47 ---- TempoLabel* tempo; private slots: void _setRaster(int); ! void posChanged(int idx, const AL::Pos& pos, bool); void setTempo(int); *************** *** 56,62 **** void songChanged(int); - signals: - void deleted(int); - protected: virtual EditorSettings* newDefaultSettings(); --- 49,52 ---- Index: masteredit.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/master/masteredit.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** masteredit.cpp 26 Sep 2005 18:26:21 -0000 1.17 --- masteredit.cpp 28 Sep 2005 20:26:38 -0000 1.18 *************** *** 3,7 **** // Linux Music Editor // $Id$ ! // (C) Copyright 1999 Werner Schweer (ws...@se...) //========================================================= --- 3,7 ---- // Linux Music Editor // $Id$ ! // (C) Copyright 1999-2005 Werner Schweer (ws...@se...) //========================================================= *************** *** 14,18 **** #include "master.h" #include "widgets/utils.h" - // #include "tscale.h" #include "awl/tempolabel.h" #include "al/xml.h" --- 14,17 ---- *************** *** 24,37 **** //--------------------------------------------------------- - // closeEvent - //--------------------------------------------------------- - - void MasterEdit::closeEvent(QCloseEvent* e) - { - emit deleted((int)this); - e->accept(); - } - - //--------------------------------------------------------- // songChanged //--------------------------------------------------------- --- 23,26 ---- *************** *** 54,68 **** editorType = ET_MASTEREDIT; setCaption(tr("MusE: Mastertrack")); - //setRaster(_rasterInit); - //_raster = 0; // measure setMinimumSize(400, 300); settings = getSettings(); - //resize(500, 350); - - //---------Pulldown Menu---------------------------- - // QPopupMenu* file = new QPopupMenu(this); - // menuBar()->insertItem("&File", file); - //---------ToolBar---------------------------------- tools = addToolBar(tr("edit tools")); --- 43,49 ---- *************** *** 133,137 **** // sign = new SigScale(settings->rasterPtr(), mainw, xscale); ! canvas = new MasterCanvas(this, mainw); // time2 = new MTScale(settings->rasterPtr(), mainw, xscale); --- 114,118 ---- // sign = new SigScale(settings->rasterPtr(), mainw, xscale); ! canvas = new MasterCanvas(this); // time2 = new MTScale(settings->rasterPtr(), mainw, xscale); *************** *** 143,148 **** //--------------------------------------------------- ! mainGrid->setRowStretch(5, 100); ! mainGrid->setColStretch(1, 100); // mainGrid->addWidget(hLine(mainw), 0, 1); --- 124,133 ---- //--------------------------------------------------- ! QWidget* mw = new QWidget; ! setCentralWidget(mw); ! QGridLayout* mainGrid = new QGridLayout; ! mw->setLayout(mainGrid); ! mainGrid->setRowStretch(0, 100); ! mainGrid->setColStretch(0, 100); // mainGrid->addWidget(hLine(mainw), 0, 1); *************** *** 159,194 **** connect(tools2, SIGNAL(toolChanged(int)), canvas, SLOT(setTool(int))); - // connect(vscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setYPos(int))); - // connect(vscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setYMag(int))); - - // connect(vscroll, SIGNAL(scrollChanged(int)), tscale, SLOT(setYPos(int))); - // connect(vscroll, SIGNAL(scaleChanged(int)), tscale, SLOT(setYMag(int))); - - // connect(hscroll, SIGNAL(scrollChanged(int)), time1, SLOT(setXPos(int))); - // connect(hscroll, SIGNAL(scrollChanged(int)), sign, SLOT(setXPos(int))); - // connect(hscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setXPos(int))); - // connect(hscroll, SIGNAL(scrollChanged(int)), time2, SLOT(setXPos(int))); - - // connect(hscroll, SIGNAL(scaleChanged(int)), time1, SLOT(setXMag(int))); - // connect(hscroll, SIGNAL(scaleChanged(int)), sign, SLOT(setXMag(int))); - // connect(hscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setXMag(int))); - // connect(hscroll, SIGNAL(scaleChanged(int)), time2, SLOT(setXMag(int))); - - // connect(time1, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); - // connect(time2, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); - - // connect(tscale, SIGNAL(tempoChanged(int)), SLOT(setTempo(int))); - // connect(canvas, SIGNAL(tempoChanged(int)), SLOT(setTempo(int))); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); ! connect(song, SIGNAL(posChanged(int,unsigned,bool)), SLOT(posChanged(int,unsigned,bool))); ! // connect(canvas, SIGNAL(followEvent(int)), hscroll, SLOT(setOffset(int))); ! // connect(canvas, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); //Init settings, TODO: Move up in class hierarchy - /*hscroll->setXmag(((GraphEditorSettings*)settings)->xmag()); //horizontal zoom - // hscroll->setPos(((GraphEditorSettings*)settings)->pos()); - // vscroll->setPos(((GraphEditorSettings*)settings)->ypos());*/ initSettings(); } --- 144,157 ---- connect(tools2, SIGNAL(toolChanged(int)), canvas, SLOT(setTool(int))); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); ! connect(song, SIGNAL(lenChanged(int)), canvas, SLOT(setHMax(int))); ! connect(song, SIGNAL(posChanged(int,const AL::Pos&,bool)), canvas, SLOT(setLocatorPos(int,const AL::Pos&))); ! // connect(muse, SIGNAL(rasterChanged(int)), canvas, SLOT(setRaster(int))); ! connect(canvas, SIGNAL(cursorPos(const AL::Pos&)), cursorPos, SLOT(setValue(const AL::Pos))); ! connect(canvas, SIGNAL(posChanged(int,const AL::Pos&)), song, SLOT(setPos(int,const AL::Pos&))); //Init settings, TODO: Move up in class hierarchy initSettings(); } *************** *** 220,226 **** 1, 0, 768, 384, 192, 96 }; - //_raster = rasterTable[index]; - //_rasterInit = _raster; settings->setRaster(rasterTable[index]); } --- 183,188 ---- 1, 0, 768, 384, 192, 96 }; settings->setRaster(rasterTable[index]); + canvas->setRaster(raster()); } *************** *** 229,235 **** //--------------------------------------------------------- ! void MasterEdit::posChanged(int idx, unsigned val, bool) { if (idx == 0) { int z, n; int tempo = AL::tempomap.tempo(val); --- 191,198 ---- //--------------------------------------------------------- ! void MasterEdit::posChanged(int idx, const AL::Pos& pos, bool) { if (idx == 0) { + unsigned val = pos.tick(); int z, n; int tempo = AL::tempomap.tempo(val); *************** *** 247,266 **** //--------------------------------------------------------- - // setTime - //--------------------------------------------------------- - - void MasterEdit::setTime(unsigned tick) - { - if (tick == MAXINT) - cursorPos->setEnabled(false); - else { - cursorPos->setEnabled(true); - cursorPos->setValue(tick); - // time1->setPos(3, tick, false); - // time2->setPos(3, tick, false); - } - } - - //--------------------------------------------------------- // setTempo //--------------------------------------------------------- --- 210,213 ---- Index: master.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/master/master.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** master.h 26 Sep 2005 18:26:21 -0000 1.8 --- master.h 28 Sep 2005 20:26:38 -0000 1.9 *************** *** 28,32 **** // unsigned pos[3]; QPoint start; ! // Tool tool; // DragMode drag; GraphMidiEditor* editor; --- 28,32 ---- // unsigned pos[3]; QPoint start; ! Tool tool; // DragMode drag; GraphMidiEditor* editor; *************** *** 35,39 **** virtual void pdraw(QPainter&, const QRect&); virtual void viewMouseMoveEvent(QMouseEvent* event); - // virtual void leaveEvent(QEvent*e); virtual void viewMousePressEvent(QMouseEvent* event); virtual void viewMouseReleaseEvent(QMouseEvent*); --- 35,38 ---- *************** *** 49,60 **** // void yposChanged(int); // void timeChanged(unsigned); ! // void tempoChanged(int); ! // public slots: // void setPos(int, unsigned, bool adjustScrollbar); ! // void setTool(int t); public: ! MasterCanvas(GraphMidiEditor*, QWidget*); virtual ~MasterCanvas() {} }; --- 48,59 ---- // void yposChanged(int); // void timeChanged(unsigned); ! void tempoChanged(int); ! public slots: // void setPos(int, unsigned, bool adjustScrollbar); ! void setTool(int t) { tool = Tool(t); } public: ! MasterCanvas(GraphMidiEditor*); virtual ~MasterCanvas() {} }; Index: master.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/master/master.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** master.cpp 26 Sep 2005 18:26:21 -0000 1.9 --- master.cpp 28 Sep 2005 20:26:38 -0000 1.10 *************** *** 19,34 **** //--------------------------------------------------------- ! MasterCanvas::MasterCanvas(GraphMidiEditor* e, QWidget* parent) ! : TimeCanvas(parent) { editor = e; - // setBg(Qt::white); - // vscroll = 0; - // pos[0] = 0; - // pos[1] = 0; - // pos[2] = 0; - // setMouseTracking(true); - // connect(song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); - // connect(song, SIGNAL(songChanged(int)), this, SLOT(redraw())); } --- 19,26 ---- //--------------------------------------------------------- ! MasterCanvas::MasterCanvas(GraphMidiEditor* e) ! : TimeCanvas(TIME_CANVAS) { editor = e; } *************** *** 235,236 **** --- 227,230 ---- update(); } + + |