diff options
-rw-r--r-- | muse2/muse/liste/listedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/master/masteredit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/midiedit/dcanvas.h | 3 | ||||
-rw-r--r-- | muse2/muse/midiedit/drumedit.cpp | 38 | ||||
-rw-r--r-- | muse2/muse/midiedit/drumedit.h | 8 | ||||
-rw-r--r-- | muse2/muse/midiedit/pianoroll.cpp | 62 | ||||
-rw-r--r-- | muse2/muse/midiedit/pianoroll.h | 15 | ||||
-rw-r--r-- | muse2/muse/midiedit/prcanvas.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/midieditor.cpp | 19 | ||||
-rw-r--r-- | muse2/muse/midieditor.h | 7 | ||||
-rw-r--r-- | muse2/muse/shortcuts.cpp | 10 | ||||
-rw-r--r-- | muse2/muse/shortcuts.h | 5 | ||||
-rw-r--r-- | muse2/muse/waveedit/waveedit.cpp | 2 | ||||
-rw-r--r-- | muse2/muse/widgets/tb1.cpp | 79 | ||||
-rw-r--r-- | muse2/muse/widgets/tb1.h | 8 |
15 files changed, 40 insertions, 226 deletions
diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp index 11e9cfc5..080ee01c 100644 --- a/muse2/muse/liste/listedit.cpp +++ b/muse2/muse/liste/listedit.cpp @@ -445,7 +445,7 @@ QString EventListItem::text(int col) const //--------------------------------------------------------- ListEdit::ListEdit(PartList* pl) - : MidiEditor(0, 0, pl) + : MidiEditor(0, pl) { insertItems = new QActionGroup(this); insertItems->setExclusive(false); diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp index 2b91ae90..17d390e9 100644 --- a/muse2/muse/master/masteredit.cpp +++ b/muse2/muse/master/masteredit.cpp @@ -77,7 +77,7 @@ void MasterEdit::songChanged(int type) //--------------------------------------------------------- MasterEdit::MasterEdit() - : MidiEditor(0, _rasterInit, 0) + : MidiEditor(_rasterInit, 0) { setWindowTitle(tr("MusE: Mastertrack")); _raster = 0; // measure diff --git a/muse2/muse/midiedit/dcanvas.h b/muse2/muse/midiedit/dcanvas.h index 4e05a422..deb3a096 100644 --- a/muse2/muse/midiedit/dcanvas.h +++ b/muse2/muse/midiedit/dcanvas.h @@ -90,7 +90,8 @@ class DrumCanvas : public EventCanvas { CMD_CUT, CMD_COPY, CMD_PASTE, CMD_SAVE, CMD_LOAD, CMD_RESET, CMD_SELECT_ALL, CMD_SELECT_NONE, CMD_SELECT_INVERT, CMD_SELECT_ILOOP, CMD_SELECT_OLOOP, CMD_SELECT_PREV_PART, CMD_SELECT_NEXT_PART, - CMD_DEL, CMD_FIXED_LEN, CMD_RIGHT, CMD_LEFT, CMD_RIGHT_NOSNAP, CMD_LEFT_NOSNAP, CMD_MODIFY_VELOCITY + CMD_DEL, CMD_FIXED_LEN, CMD_RIGHT, CMD_LEFT, CMD_RIGHT_NOSNAP, CMD_LEFT_NOSNAP, CMD_MODIFY_VELOCITY, + CMD_QUANTIZE }; DrumCanvas(MidiEditor*, QWidget*, int, int, const char* name = 0); diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp index d9029969..84d4bf5b 100644 --- a/muse2/muse/midiedit/drumedit.cpp +++ b/muse2/muse/midiedit/drumedit.cpp @@ -60,13 +60,11 @@ static const char* map_file_save_pattern[] = { }; */ -int DrumEdit::_quantInit = 96; int DrumEdit::_rasterInit = 96; int DrumEdit::_widthInit = 600; int DrumEdit::_heightInit = 400; int DrumEdit::_dlistWidthInit = 50; int DrumEdit::_dcanvasWidthInit = 300; -int DrumEdit::_toInit = 0; static const int xscale = -10; static const int yscale = 1; @@ -156,12 +154,11 @@ void DrumEdit::closeEvent(QCloseEvent* e) //--------------------------------------------------------- DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned initPos) - : MidiEditor(_quantInit, _rasterInit, pl, parent, name) + : MidiEditor(_rasterInit, pl, parent, name) { split1w1 = 0; resize(_widthInit, _heightInit); selPart = 0; - _to = _toInit; QSignalMapper *signalMapper = new QSignalMapper(this); //---------Pulldown Menu---------------------------- @@ -236,12 +233,15 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini fixedAction = menuFunctions->addAction(tr("Set Fixed Length")); veloAction = menuFunctions->addAction(tr("Modify Velocity")); + quantizeAction = menuFunctions->addAction(tr("Quantize")); connect(fixedAction, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(veloAction, SIGNAL(triggered()), signalMapper, SLOT(map())); + connect(quantizeAction, SIGNAL(triggered()), signalMapper, SLOT(map())); signalMapper->setMapping(fixedAction, DrumCanvas::CMD_FIXED_LEN); signalMapper->setMapping(veloAction, DrumCanvas::CMD_MODIFY_VELOCITY); + signalMapper->setMapping(quantizeAction, DrumCanvas::CMD_QUANTIZE); QMenu* menuScriptPlugins = menuBar()->addMenu(tr("&Plugins")); song->populateScriptMenu(menuScriptPlugins, this); @@ -318,7 +318,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini addToolBarBreak(); // don't show pitch value in toolbar - toolbar = new Toolbar1(this, _rasterInit, _quantInit, false); + toolbar = new Toolbar1(this, _rasterInit, false); addToolBar(toolbar); addToolBarBreak(); @@ -455,7 +455,6 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini // connect toolbar connect(canvas, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); connect(time, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); - connect(toolbar, SIGNAL(quantChanged(int)), SLOT(setQuant(int))); connect(toolbar, SIGNAL(rasterChanged(int)), SLOT(setRaster(int))); connect(toolbar, SIGNAL(soloChanged(bool)), SLOT(soloChanged(bool))); connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int))); @@ -602,16 +601,6 @@ void DrumEdit::setRaster(int val) } //--------------------------------------------------------- -// setQuant -//--------------------------------------------------------- - -void DrumEdit::setQuant(int val) - { - _quantInit = val; - MidiEditor::setQuant(val); - } - -//--------------------------------------------------------- // edit currently selected Event //--------------------------------------------------------- @@ -721,10 +710,8 @@ void DrumEdit::readStatus(Xml& xml) break; case Xml::TagEnd: if (tag == "drumedit") { - _quantInit = _quant; _rasterInit = _raster; toolbar->setRaster(_raster); - toolbar->setQuant(_quant); canvas->redrawGrid(); return; } @@ -748,9 +735,7 @@ void DrumEdit::readConfiguration(Xml& xml) case Xml::End: return; case Xml::TagStart: - if (tag == "quant") - _quantInit = xml.parseInt(); - else if (tag == "raster") + if (tag == "raster") _rasterInit = xml.parseInt(); else if (tag == "width") _widthInit = xml.parseInt(); @@ -760,9 +745,6 @@ void DrumEdit::readConfiguration(Xml& xml) _dcanvasWidthInit = xml.parseInt(); else if (tag == "dlistwidth") _dlistWidthInit = xml.parseInt(); - else if (tag == "to") { - _toInit = xml.parseInt(); - } else xml.unknown("DrumEdit"); break; @@ -783,13 +765,11 @@ void DrumEdit::readConfiguration(Xml& xml) void DrumEdit::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "drumedit"); - xml.intTag(level, "quant", _quantInit); xml.intTag(level, "raster", _rasterInit); xml.intTag(level, "width", _widthInit); xml.intTag(level, "height", _heightInit); xml.intTag(level, "dlistwidth", _dlistWidthInit); xml.intTag(level, "dcanvaswidth", _dcanvasWidthInit); - xml.intTag(level, "to", _toInit); xml.tag(level, "/drumedit"); } @@ -1231,9 +1211,7 @@ void DrumEdit::keyPressEvent(QKeyEvent* event) event->ignore(); return; } - setQuant(val); setRaster(val); - toolbar->setQuant(_quant); toolbar->setRaster(_raster); } @@ -1273,7 +1251,7 @@ void DrumEdit::execDeliveredScript(int id) { //QString scriptfile = QString(INSTPREFIX) + SCRIPTSSUFFIX + deliveredScriptNames[id]; QString scriptfile = song->getScriptPath(id, true); - song->executeScript(scriptfile.toLatin1().constData(), parts(), quant(), true); + song->executeScript(scriptfile.toLatin1().constData(), parts(), raster(), true); } //--------------------------------------------------------- @@ -1282,7 +1260,7 @@ void DrumEdit::execDeliveredScript(int id) void DrumEdit::execUserScript(int id) { QString scriptfile = song->getScriptPath(id, false); - song->executeScript(scriptfile.toLatin1().constData(), parts(), quant(), true); + song->executeScript(scriptfile.toLatin1().constData(), parts(), raster(), true); } void DrumEdit::setStep(QString v) diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h index 02a1a5cc..dd3ad223 100644 --- a/muse2/muse/midiedit/drumedit.h +++ b/muse2/muse/midiedit/drumedit.h @@ -66,15 +66,13 @@ class DrumEdit : public MidiEditor { QToolBar* tools; QComboBox *stepLenWidget; - static int _quantInit, _rasterInit; + static int _rasterInit; static int _widthInit, _heightInit; static int _dlistWidthInit, _dcanvasWidthInit; - static int _toInit; //Used in function dialog for applying modification to selection - QAction *loadAction, *saveAction, *resetAction; QAction *cutAction, *copyAction, *pasteAction, *deleteAction; - QAction *fixedAction, *veloAction; + QAction *fixedAction, *veloAction, *quantizeAction; QAction *sallAction, *snoneAction, *invAction, *inAction , *outAction; QAction *prevAction, *nextAction; @@ -85,13 +83,11 @@ class DrumEdit : public MidiEditor { QWidget* genToolbar(QWidget* parent); virtual void resizeEvent(QResizeEvent*); virtual void keyPressEvent(QKeyEvent*); - int _to;//TODO: Make this work void setHeaderToolTips(); void setHeaderWhatsThis(); private slots: void setRaster(int); - void setQuant(int); void noteinfoChanged(NoteInfo::ValType type, int val); //CtrlEdit* addCtrl(); void removeCtrl(CtrlEdit* ctrl); diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp index 6b0e37cb..153199cd 100644 --- a/muse2/muse/midiedit/pianoroll.cpp +++ b/muse2/muse/midiedit/pianoroll.cpp @@ -52,14 +52,9 @@ #include "mtrackinfo.h" -int PianoRoll::_quantInit = 96; int PianoRoll::_rasterInit = 96; int PianoRoll::_widthInit = 600; int PianoRoll::_heightInit = 400; -int PianoRoll::_quantStrengthInit = 80; // 1 - 100% -int PianoRoll::_quantLimitInit = 50; // tick value -bool PianoRoll::_quantLenInit = false; -int PianoRoll::_toInit = 0; int PianoRoll::colorModeInit = 0; static const int xscale = -10; @@ -73,16 +68,12 @@ static int pianorollTools = PointerTool | PencilTool | RubberTool | DrawTool; //--------------------------------------------------------- PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned initPos) - : MidiEditor(_quantInit, _rasterInit, pl, parent, name) + : MidiEditor(_rasterInit, pl, parent, name) { deltaMode = false; resize(_widthInit, _heightInit); selPart = 0; _playEvents = false; - _quantStrength = _quantStrengthInit; - _quantLimit = _quantLimitInit; - _quantLen = _quantLenInit; - _to = _toInit; colorMode = colorModeInit; QSignalMapper* mapper = new QSignalMapper(this); @@ -299,7 +290,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i transport->addActions(transportAction->actions()); addToolBarBreak(); - toolbar = new Toolbar1(this, _rasterInit, _quantInit); + toolbar = new Toolbar1(this, _rasterInit); addToolBar(toolbar); addToolBarBreak(); @@ -497,9 +488,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i connect(canvas, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); connect(piano, SIGNAL(pitchChanged(int)), toolbar, SLOT(setPitch(int))); connect(time, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned))); - connect(toolbar, SIGNAL(quantChanged(int)), SLOT(setQuant(int))); connect(toolbar, SIGNAL(rasterChanged(int)),SLOT(setRaster(int))); - connect(toolbar, SIGNAL(toChanged(int)), SLOT(setTo(int))); connect(toolbar, SIGNAL(soloChanged(bool)), SLOT(soloChanged(bool))); setFocusPolicy(Qt::StrongFocus); @@ -821,18 +810,8 @@ void PianoRoll::readConfiguration(Xml& xml) const QString& tag = xml.s1(); switch (token) { case Xml::TagStart: - if (tag == "quant") - _quantInit = xml.parseInt(); - else if (tag == "raster") + if (tag == "raster") _rasterInit = xml.parseInt(); - else if (tag == "quantStrength") - _quantStrengthInit = xml.parseInt(); - else if (tag == "quantLimit") - _quantLimitInit = xml.parseInt(); - else if (tag == "quantLen") - _quantLenInit = xml.parseInt(); - else if (tag == "to") - _toInit = xml.parseInt(); else if (tag == "colormode") colorModeInit = xml.parseInt(); else if (tag == "width") @@ -858,12 +837,7 @@ void PianoRoll::readConfiguration(Xml& xml) void PianoRoll::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "pianoroll"); - xml.intTag(level, "quant", _quantInit); xml.intTag(level, "raster", _rasterInit); - xml.intTag(level, "quantStrength", _quantStrengthInit); - xml.intTag(level, "quantLimit", _quantLimitInit); - xml.intTag(level, "quantLen", _quantLenInit); - xml.intTag(level, "to", _toInit); xml.intTag(level, "width", _widthInit); xml.intTag(level, "height", _heightInit); xml.intTag(level, "colormode", colorModeInit); @@ -894,17 +868,6 @@ void PianoRoll::setRaster(int val) } //--------------------------------------------------------- -// setQuant -//--------------------------------------------------------- - -void PianoRoll::setQuant(int val) - { - _quantInit = val; - MidiEditor::setQuant(val); - canvas->setFocus(); - } - -//--------------------------------------------------------- // writeStatus //--------------------------------------------------------- @@ -924,9 +887,6 @@ void PianoRoll::writeStatus(int level, Xml& xml) const xml.intTag(level, "steprec", canvas->steprec()); xml.intTag(level, "midiin", canvas->midiin()); xml.intTag(level, "tool", int(canvas->tool())); - xml.intTag(level, "quantStrength", _quantStrength); - xml.intTag(level, "quantLimit", _quantLimit); - xml.intTag(level, "quantLen", _quantLen); xml.intTag(level, "playEvents", _playEvents); xml.intTag(level, "xpos", hscroll->pos()); xml.intTag(level, "xmag", hscroll->mag()); @@ -973,12 +933,6 @@ void PianoRoll::readStatus(Xml& xml) splitter->readStatus(xml); else if (tag == hsplitter->objectName()) hsplitter->readStatus(xml); - else if (tag == "quantStrength") - _quantStrength = xml.parseInt(); - else if (tag == "quantLimit") - _quantLimit = xml.parseInt(); - else if (tag == "quantLen") - _quantLen = xml.parseInt(); else if (tag == "playEvents") { _playEvents = xml.parseInt(); canvas->playEvents(_playEvents); @@ -997,10 +951,8 @@ void PianoRoll::readStatus(Xml& xml) break; case Xml::TagEnd: if (tag == "pianoroll") { - _quantInit = _quant; _rasterInit = _raster; toolbar->setRaster(_raster); - toolbar->setQuant(_quant); canvas->redrawGrid(); return; } @@ -1179,9 +1131,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* event) event->ignore(); return; } - setQuant(val); setRaster(val); - toolbar->setQuant(_quant); toolbar->setRaster(_raster); } @@ -1306,7 +1256,7 @@ void PianoRoll::initShortcuts() //evColorPitchAction->setShortcut(shortcuts[ ].key); //evColorVelAction->setShortcut(shortcuts[ ].key); - funcQuantizeAction->setShortcut(shortcuts[SHRT_OVER_QUANTIZE].key); //FINDMICH TODO FLO + funcQuantizeAction->setShortcut(shortcuts[SHRT_QUANTIZE].key); funcGateTimeAction->setShortcut(shortcuts[SHRT_MODIFY_GATE_TIME].key); funcModVelAction->setShortcut(shortcuts[SHRT_MODIFY_VELOCITY].key); @@ -1332,7 +1282,7 @@ void PianoRoll::execDeliveredScript(int id) { //QString scriptfile = QString(INSTPREFIX) + SCRIPTSSUFFIX + deliveredScriptNames[id]; QString scriptfile = song->getScriptPath(id, true); - song->executeScript(scriptfile.toAscii().data(), parts(), quant(), true); + song->executeScript(scriptfile.toAscii().data(), parts(), raster(), true); } //--------------------------------------------------------- @@ -1341,7 +1291,7 @@ void PianoRoll::execDeliveredScript(int id) void PianoRoll::execUserScript(int id) { QString scriptfile = song->getScriptPath(id, false); - song->executeScript(scriptfile.toAscii().data(), parts(), quant(), true); + song->executeScript(scriptfile.toAscii().data(), parts(), raster(), true); } //--------------------------------------------------------- diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h index 87bf52b6..32be3bea 100644 --- a/muse2/muse/midiedit/pianoroll.h +++ b/muse2/muse/midiedit/pianoroll.h @@ -119,19 +119,11 @@ class PianoRoll : public MidiEditor { int colorMode; - static int _quantInit, _rasterInit; + static int _rasterInit; static int _widthInit, _heightInit; - static int _quantStrengthInit; - static int _quantLimitInit; - static bool _quantLenInit; - static int _toInit; static int colorModeInit; - int _quantStrength; - int _quantLimit; - int _to; - bool _quantLen; bool _playEvents; //QScrollBar* infoScroll; @@ -153,13 +145,8 @@ class PianoRoll : public MidiEditor { void soloChanged(bool flag); //void trackInfoScroll(int); void setRaster(int); - void setQuant(int); - void setQuantStrength(int val) { _quantStrength = val; } - void setQuantLimit(int val) { _quantLimit = val; } - void setQuantLen(bool val) { _quantLen = val; } void cmd(int); void setSteprec(bool); - void setTo(int val) { _to = val; } void eventColorModeChanged(int); void clipboardChanged(); // enable/disable "Paste" void selectionChanged(); // enable/disable "Copy" & "Paste" diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp index 2966cf71..5f3def81 100644 --- a/muse2/muse/midiedit/prcanvas.cpp +++ b/muse2/muse/midiedit/prcanvas.cpp @@ -1134,7 +1134,11 @@ void PianoCanvas::midiNote(int pitch, int velo) && !audio->isPlaying() && velo && pos[0] >= start_tick && pos[0] < end_tick && !(globalKeyState & Qt::AltModifier)) { - unsigned int len = editor->quant();//prevent compiler warning: comparison singed/unsigned + //len has been changed by flo: set to raster() instead of quant() + //reason: the quant-toolbar has been removed; the flexibility you + //lose with this can be re-gained by applying a "modify note len" + //on the notes you have entered. + unsigned int len = editor->raster();//prevent compiler warning: comparison singed/unsigned unsigned tick = pos[0]; //CDW unsigned starttick = tick; if (globalKeyState & Qt::ShiftModifier) diff --git a/muse2/muse/midieditor.cpp b/muse2/muse/midieditor.cpp index 9191233d..2a6d8750 100644 --- a/muse2/muse/midieditor.cpp +++ b/muse2/muse/midieditor.cpp @@ -23,7 +23,7 @@ // MidiEditor //--------------------------------------------------------- -MidiEditor::MidiEditor(int q, int r, PartList* pl, +MidiEditor::MidiEditor(int r, PartList* pl, QWidget* parent, const char* name) : TopWin(parent, name) { setAttribute(Qt::WA_DeleteOnClose); @@ -31,7 +31,6 @@ MidiEditor::MidiEditor(int q, int r, PartList* pl, if (_pl) for (iPart i = _pl->begin(); i != _pl->end(); ++i) _parts.push_back(i->second->sn()); - _quant = q; _raster = r; canvas = 0; wview = 0; @@ -81,17 +80,6 @@ MidiEditor::~MidiEditor() delete _pl; } -//--------------------------------------------------------- -// quantVal -//--------------------------------------------------------- - -int MidiEditor::quantVal(int v) const - { - int val = ((v+_quant/2)/_quant)*_quant; - if (val == 0) - val = _quant; - return val; - } //--------------------------------------------------------- // readStatus @@ -110,9 +98,7 @@ void MidiEditor::readStatus(Xml& xml) case Xml::End: return; case Xml::TagStart: - if (tag == "quant") - _quant = xml.parseInt(); - else if (tag == "raster") + if (tag == "raster") _raster = xml.parseInt(); else if (tag == "topwin") TopWin::readStatus(xml); @@ -155,7 +141,6 @@ void MidiEditor::writeStatus(int level, Xml& xml) const { xml.tag(level++, "midieditor"); TopWin::writeStatus(level, xml); - xml.intTag(level, "quant", _quant); xml.intTag(level, "raster", _raster); xml.tag(level, "/midieditor"); } diff --git a/muse2/muse/midieditor.h b/muse2/muse/midieditor.h index 1f465c2d..00272529 100644 --- a/muse2/muse/midieditor.h +++ b/muse2/muse/midieditor.h @@ -44,7 +44,7 @@ class MidiEditor : public TopWin { WaveView* wview; std::list<CtrlEdit*> ctrlEditList; - int _quant, _raster; + int _raster; QGridLayout* mainGrid; QWidget* mainw; virtual void readStatus(Xml&); @@ -61,11 +61,10 @@ class MidiEditor : public TopWin { void curDrumInstrumentChanged(int); public: - MidiEditor(int, int, PartList*, + MidiEditor(int, PartList*, QWidget* parent = 0, const char* name = 0); ~MidiEditor(); - int quantVal(int v) const; ///int rasterStep(unsigned tick) const { return sigmap.rasterStep(tick, _raster); } ///unsigned rasterVal(unsigned v) const { return sigmap.raster(v, _raster); } ///unsigned rasterVal1(unsigned v) const { return sigmap.raster1(v, _raster); } @@ -74,8 +73,6 @@ class MidiEditor : public TopWin { unsigned rasterVal(unsigned v) const { return AL::sigmap.raster(v, _raster); } unsigned rasterVal1(unsigned v) const { return AL::sigmap.raster1(v, _raster); } unsigned rasterVal2(unsigned v) const { return AL::sigmap.raster2(v, _raster); } - int quant() const { return _quant; } - void setQuant(int val) { _quant = val; } int raster() const { return _raster; } void setRaster(int val) { _raster = val; } PartList* parts() { return _pl; } diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp index cd54b096..86ab0dcd 100644 --- a/muse2/muse/shortcuts.cpp +++ b/muse2/muse/shortcuts.cpp @@ -181,13 +181,9 @@ void initShortCuts() //Pianoroll: //----------------------------------------------------------- - defShrt(SHRT_OVER_QUANTIZE, 0, "Quantize: Over Quantize", PROLL_SHRT, "midi_over_quant"); - defShrt(SHRT_ON_QUANTIZE, 0, "Quantize: Note On Quantize", PROLL_SHRT, "midi_quant_noteon"); - defShrt(SHRT_ONOFF_QUANTIZE, 0, "Quantize: Note On/Off Quantize", PROLL_SHRT,"midi_quant_noteoff"); - defShrt(SHRT_ITERATIVE_QUANTIZE,0,"Quantize: Iterative Quantize", PROLL_SHRT,"midi_quant_iterative"); - defShrt(SHRT_CONFIG_QUANT, Qt::CTRL + Qt::ALT + Qt::Key_Q, "Quantize: Configure quant", PROLL_SHRT, "config_quant"); - defShrt(SHRT_MODIFY_GATE_TIME, 0, "Quantize: Modify Gate Time", PROLL_SHRT, "midi_mod_gate_time"); - defShrt(SHRT_MODIFY_VELOCITY, 0, "Quantize: Modify Velocity", PROLL_SHRT, "midi_mod_velo"); + defShrt(SHRT_QUANTIZE, 0, "Quantize", PROLL_SHRT, "midi_quant"); + defShrt(SHRT_MODIFY_GATE_TIME, 0, "Modify Note Length", PROLL_SHRT, "midi_mod_gate_time"); + defShrt(SHRT_MODIFY_VELOCITY, 0, "Modify Velocity", PROLL_SHRT, "midi_mod_velo"); defShrt(SHRT_CRESCENDO, 0, "Edit: Crescendo", PROLL_SHRT, "midi_crescendo"); defShrt(SHRT_THIN_OUT, 0, "Edit: Thin Out", PROLL_SHRT, "midi_thin_out"); defShrt(SHRT_ERASE_EVENT, 0, "Edit: Erase Event", PROLL_SHRT, "midi_erase_event"); diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h index ede91d22..b72e0207 100644 --- a/muse2/muse/shortcuts.h +++ b/muse2/muse/shortcuts.h @@ -246,11 +246,6 @@ enum { SHRT_SCROLL_RIGHT, // l SHRT_FIXED_LEN, //Alt+L, currently only drumeditor SHRT_QUANTIZE, //q - SHRT_OVER_QUANTIZE, //Default: undefined - SHRT_ON_QUANTIZE, //Default: undefined - SHRT_ONOFF_QUANTIZE, //Default: undefined - SHRT_ITERATIVE_QUANTIZE, //Default: undefined - SHRT_CONFIG_QUANT, //Default: Ctrl+Alt+Q SHRT_MODIFY_GATE_TIME, //Default: undefined SHRT_MODIFY_VELOCITY, SHRT_CRESCENDO, diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index 2350a2c5..0e3c1c30 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -61,7 +61,7 @@ void WaveEdit::closeEvent(QCloseEvent* e) //--------------------------------------------------------- WaveEdit::WaveEdit(PartList* pl) - : MidiEditor(1, 1, pl) + : MidiEditor(1, pl) { resize(_widthInit, _heightInit); diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp index 917e6ae2..bd8e94a2 100644 --- a/muse2/muse/widgets/tb1.cpp +++ b/muse2/muse/widgets/tb1.cpp @@ -33,27 +33,16 @@ static const char* rasterStrings[] = { QT_TRANSLATE_NOOP("@default", "Off"), "4pp", "7pp", "64.", "32.", "16.", "8.", "4.", "2.", "1." }; -static int quantTable[] = { - 1, 16, 32, 64, 128, 256, 512, 1024, - 1, 24, 48, 96, 192, 384, 768, 1536, - 1, 36, 72, 144, 288, 576, 1152, 2304 - }; - -static const char* quantStrings[] = { - QT_TRANSLATE_NOOP("@default", "Off"), "64T", "32T", "16T", "8T", "4T", "2T", "1T", - QT_TRANSLATE_NOOP("@default", "Off"), "64", "32", "16", "8", "4", "2", "1", - QT_TRANSLATE_NOOP("@default", "Off"), "64.", "32.", "16.", "8.", "4.", "2.", "1." - }; //--------------------------------------------------------- // genToolbar -// solo time pitch raster quant +// solo time pitch raster //--------------------------------------------------------- -Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) - : QToolBar(QString("Quant'n'Snap-tools"), parent) +Toolbar1::Toolbar1(QWidget* parent, int r, bool sp) + : QToolBar(QString("Pos/Snap/Solo-tools"), parent) { - setObjectName("Quant'n'Snap-tools"); + setObjectName("Pos/Snap/Solo-tools"); pitch = 0; showPitch = sp; // ORCAN - FIXME: Check this: @@ -85,66 +74,34 @@ Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) } //--------------------------------------------------- - // Raster, Quant. + // Raster //--------------------------------------------------- raster = new LabelCombo(tr("Snap"), 0); - quant = new LabelCombo(tr("Quantize"), 0); rlist = new QTableWidget(10, 3); - qlist = new QTableWidget(8, 3); rlist->verticalHeader()->setDefaultSectionSize(22); rlist->horizontalHeader()->setDefaultSectionSize(32); rlist->setSelectionMode(QAbstractItemView::SingleSelection); rlist->verticalHeader()->hide(); rlist->horizontalHeader()->hide(); - qlist->verticalHeader()->setDefaultSectionSize(22); - qlist->horizontalHeader()->setDefaultSectionSize(32); - qlist->setSelectionMode(QAbstractItemView::SingleSelection); - qlist->verticalHeader()->hide(); - qlist->horizontalHeader()->hide(); rlist->setMinimumWidth(96); - qlist->setMinimumWidth(96); raster->setView(rlist); - quant->setView(qlist); for (int j = 0; j < 3; j++) for (int i = 0; i < 10; i++) rlist->setItem(i, j, new QTableWidgetItem(tr(rasterStrings[i + j * 10]))); - for (int j = 0; j < 3; j++) - for (int i = 0; i < 8; i++) - qlist->setItem(i, j, new QTableWidgetItem(tr(quantStrings[i + j * 8]))); setRaster(r); - setQuant(q); addWidget(raster); - addWidget(quant); // FIXME: Not working right. raster->setFixedHeight(38); - quant->setFixedHeight(38); - //--------------------------------------------------- - // To Menu - //--------------------------------------------------- - - addWidget(new QLabel(tr("To"))); - QComboBox* toList = new QComboBox; - toList->setFixedHeight(22); - toList->insertItem(0, tr("All Events")); - toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev.")); - toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev.")); - toList->insertItem(CMD_RANGE_LOOP | CMD_RANGE_SELECTED, tr("Looped+Sel.")); - addWidget(toList); - connect(raster, SIGNAL(activated(int)), SLOT(_rasterChanged(int))); - connect(quant, SIGNAL(activated(int)), SLOT(_quantChanged(int))); - //connect(rlist, SIGNAL(cellClicked(int,int)), SLOT(_rasterChanged(int, int))); - //connect(qlist, SIGNAL(cellClicked(int,int)), SLOT(_quantChanged(int,int))); - connect(toList, SIGNAL(activated(int)), SIGNAL(toChanged(int))); connect(solo, SIGNAL(toggled(bool)), SIGNAL(soloChanged(bool))); pos->setEnabled(false); } @@ -160,16 +117,6 @@ void Toolbar1::_rasterChanged(int /*i*/) //emit rasterChanged(rasterTable[r + c * 10]); } -//--------------------------------------------------------- -// quantChanged -//--------------------------------------------------------- - -void Toolbar1::_quantChanged(int /*i*/) -//void Toolbar1::_quantChanged(int r, int c) - { - emit quantChanged(quantTable[qlist->currentRow() + qlist->currentColumn() * 8]); - //emit quantChanged(quantTable[r + c * 8]); - } //--------------------------------------------------------- // setPitch @@ -226,22 +173,6 @@ void Toolbar1::setRaster(int val) } //--------------------------------------------------------- -// setQuant -//--------------------------------------------------------- - -void Toolbar1::setQuant(int val) - { - for (unsigned i = 0; i < sizeof(quantTable)/sizeof(*quantTable); i++) { - if (val == quantTable[i]) { - quant->setCurrentIndex(i); - return; - } - } - printf("setQuant(%d) not defined\n", val); - quant->setCurrentIndex(0); - } - -//--------------------------------------------------------- // setSolo //--------------------------------------------------------- diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h index fbed13b1..ff31593f 100644 --- a/muse2/muse/widgets/tb1.h +++ b/muse2/muse/widgets/tb1.h @@ -26,8 +26,6 @@ class Toolbar1 : public QToolBar { QToolButton* solo; PosLabel* pos; PitchLabel* pitch; - LabelCombo* quant; - QTableWidget* qlist; LabelCombo* raster; QTableWidget* rlist; bool showPitch; @@ -35,25 +33,21 @@ class Toolbar1 : public QToolBar { private slots: void _rasterChanged(int); - void _quantChanged(int); public slots: void setTime(unsigned); void setPitch(int); void setInt(int); void setRaster(int); - void setQuant(int); signals: void rasterChanged(int); - void quantChanged(int); void soloChanged(bool); - void toChanged(int); public: //Toolbar1(QMainWindow* parent = 0, int r=96, Toolbar1(QWidget* parent, int r=96, - int q=96, bool showPitch=true); + bool showPitch=true); void setSolo(bool val); void setPitchMode(bool flag); }; |