From 56b3f44c6fa0d5fdaa05369b563d3692106a5208 Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Fri, 1 Dec 2006 13:43:34 +0000 Subject: updates --- muse/muse/midiedit/CMakeLists.txt | 2 - muse/muse/midiedit/ctrledit.cpp | 183 -------------------------------------- muse/muse/midiedit/ctrledit.h | 75 ---------------- muse/muse/midiedit/ecanvas.cpp | 18 ---- muse/muse/midiedit/ecanvas.h | 2 +- 5 files changed, 1 insertion(+), 279 deletions(-) delete mode 100644 muse/muse/midiedit/ctrledit.cpp delete mode 100644 muse/muse/midiedit/ctrledit.h diff --git a/muse/muse/midiedit/CMakeLists.txt b/muse/muse/midiedit/CMakeLists.txt index dcce663b..0d69b1f5 100644 --- a/muse/muse/midiedit/CMakeLists.txt +++ b/muse/muse/midiedit/CMakeLists.txt @@ -23,7 +23,6 @@ QT4_WRAP_CPP ( midiedit_mocs gatetime.h velocity.h quantconfig.h - ctrledit.h dcanvas.h drumedit.h ecanvas.h @@ -54,7 +53,6 @@ add_library ( midiedit STATIC drummap.h midicmd.h citem.cpp - ctrledit.cpp dcanvas.cpp drumedit.cpp drummap.cpp diff --git a/muse/muse/midiedit/ctrledit.cpp b/muse/muse/midiedit/ctrledit.cpp deleted file mode 100644 index d98c488a..00000000 --- a/muse/muse/midiedit/ctrledit.cpp +++ /dev/null @@ -1,183 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#include "ctrledit.h" -#include "midictrl.h" -#include "widgets/simplebutton.h" -#include "widgets/utils.h" -#include "ctrl/configmidictrl.h" -#include "ctrl/ctrldialog.h" -#include "widgets/tools.h" -#include "miditrack.h" -#include "midioutport.h" - -//--------------------------------------------------------- -// CtrlEdit -//--------------------------------------------------------- - -CtrlEdit::CtrlEdit(QWidget* parent, TimeCanvas* timeCanvas, Track* t) - : QObject(parent), _track(t) - { - y = 0; - _height = 0; - setDrawCtrlName(true); - - _tc = timeCanvas; - _ctrl = &veloList; - ctrlId = CTRL_VELOCITY; - - sel = new SimpleButton(tr("Sel"), parent); - sel->setToolTip(tr("select controller")); - sel->setAutoRaise(false); - - minus = newMinusButton(); - minus->setParent(parent); - minus->setToolTip(tr("remove controller view")); - minus->setAutoRaise(false); - - connect(_track, SIGNAL(controllerChanged(int)), SLOT(controllerListChanged(int))); - connect(sel, SIGNAL(clicked()), SLOT(showControllerList())); - } - -//--------------------------------------------------------- -// CtrlEdit -//--------------------------------------------------------- - -CtrlEdit::~CtrlEdit() - { - delete sel; - delete minus; - } - -//--------------------------------------------------------- -// setCtrl -//--------------------------------------------------------- - -void CtrlEdit::setCtrl(int id) - { - _ctrl = 0; - - if (_track->type() == Track::MIDI) { - if (id == CTRL_VELOCITY) - _ctrl = &veloList; - else if (id == CTRL_SVELOCITY) - _ctrl = &sveloList; - else - _ctrl = _track->getController(id); - } - else - _ctrl = _track->getController(id); - - if (!_ctrl) - printf("CtrlEdit::setCtrl(%d): not found for track <%s>\n", id, - _track->name().toLocal8Bit().data()); - } - -//--------------------------------------------------------- -// showControllerList -//--------------------------------------------------------- - -void CtrlEdit::showControllerList() - { - Ctrl* c = ctrl(); - int id; - if (c) - id = c->id(); - else - id = CTRL_NO_CTRL; - for (;;) { - CtrlDialog cd(_track, id); - int rv = cd.exec(); - if (rv != 1) - return; - id = cd.curId(); - if (id == CTRL_NO_CTRL) - return; - if (id != CTRL_OTHER) - break; - ConfigMidiCtrl* mce = new ConfigMidiCtrl((MidiTrack*)_track); - mce->exec(); - delete mce; - } - changeController(id); - } - -//--------------------------------------------------------- -// changeController -//--------------------------------------------------------- - -void CtrlEdit::changeController(int id) - { - if (id == CTRL_VELOCITY) { - ctrlId = id; - _ctrl = &veloList; - } - else if (id == CTRL_SVELOCITY) { - ctrlId = id; - _ctrl = &sveloList; - } - else if (id == CTRL_OTHER) { // "other" - if (track()->type() == Track::MIDI) { - ConfigMidiCtrl* mce = new ConfigMidiCtrl((MidiTrack*)track()); - mce->exec(); - sel->showMenu(); - } - else - printf("CtrlEdit::changeController: not impl.\n"); - } - else { - ctrlId = id; - _ctrl = track()->getController(ctrlId); - } - _tc->updateCanvasB(); - } - -//--------------------------------------------------------- -// controllerListChanged -//--------------------------------------------------------- - -void CtrlEdit::controllerListChanged(int id) - { - if (id != ctrlId) - return; - tc()->widget()->update(tc()->rCanvasB); - } - -//--------------------------------------------------------- -// pixel2val -//--------------------------------------------------------- - -int CtrlEdit::pixel2val(int y) const - { - if (ctrl() == 0) - return 0; - CVal val = ctrl()->pixel2val(y, _height - splitWidth); - return val.i; - } - -//--------------------------------------------------------- -// setSinglePitch -//--------------------------------------------------------- - -void CtrlEdit::setSinglePitch(int val) - { - singlePitch = val; - } - diff --git a/muse/muse/midiedit/ctrledit.h b/muse/muse/midiedit/ctrledit.h deleted file mode 100644 index b05de053..00000000 --- a/muse/muse/midiedit/ctrledit.h +++ /dev/null @@ -1,75 +0,0 @@ -//============================================================================= -// MusE -// Linux Music Editor -// $Id:$ -// -// Copyright (C) 2002-2006 by Werner Schweer and others -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//============================================================================= - -#ifndef __CTRL_EDIT_H__ -#define __CTRL_EDIT_H__ - -#include "ctrl/ctrleditor.h" -#include "gui.h" - -class SimpleButton; -class TimeCanvas; - -//--------------------------------------------------------- -// CtrlEdit -//--------------------------------------------------------- - -class CtrlEdit : public QObject, public CtrlEditor { - Q_OBJECT - - Track* const _track; - Ctrl* _ctrl; - TimeCanvas* _tc; - int _height; - - virtual Ctrl* ctrl() const { return _ctrl; } - virtual TimeCanvas* tc() const { return _tc; } - virtual Track* track() const { return _track; } - - public: - int ctrlId; - int y; - SimpleButton* minus; - SimpleButton* sel; - QMenu* ctrlList; - - private slots: - void showControllerList(); - void changeController(int); - void controllerListChanged(int); - - public: - CtrlEdit(QWidget*, TimeCanvas*, Track*); - ~CtrlEdit(); - int pixel2val(int) const; - void setHeight(int val) { _height = val; } - int height() const { return _height; } - virtual int cheight() const { return _height - splitWidth; } - void setCtrl(Ctrl* c) { _ctrl = c; } - void setCtrl(int id); - Ctrl* ctrl() { return _ctrl; } - void setSinglePitch(int); - }; - -typedef std::vector CtrlEditList; -typedef CtrlEditList::iterator iCtrlEdit; -typedef CtrlEditList::const_iterator ciCtrlEdit; -#endif - diff --git a/muse/muse/midiedit/ecanvas.cpp b/muse/muse/midiedit/ecanvas.cpp index 1bcc1868..343f3f53 100644 --- a/muse/muse/midiedit/ecanvas.cpp +++ b/muse/muse/midiedit/ecanvas.cpp @@ -970,24 +970,6 @@ void EventCanvas::addController(int id, int h) connect(ce->minus, SIGNAL(triggered(QAction*)), SLOT(removeController(QAction*))); } -//--------------------------------------------------------- -// paintVLine -//--------------------------------------------------------- - -void paintVLine(QPainter& p, int y1, int y2, int x) - { - static QColor color[splitWidth] = { - QColor(0x55, 0x55, 0x52), - QColor(0xff, 0xff, 0xff), - }; - x -= 2; - for (int i = 0; i < 2; ++i) { - p.setPen(color[i]); - p.drawLine(x, y1, x, y2); - ++x; - } - } - //--------------------------------------------------------- // paintControllerCanvas // r(0, 0) is PanelB topLeft() diff --git a/muse/muse/midiedit/ecanvas.h b/muse/muse/midiedit/ecanvas.h index 6602ee05..aac0483d 100644 --- a/muse/muse/midiedit/ecanvas.h +++ b/muse/muse/midiedit/ecanvas.h @@ -25,7 +25,7 @@ #include "awl/tcanvas.h" #include "widgets/noteinfo.h" #include "citem.h" -#include "ctrledit.h" +#include "ctrl/ctrledit.h" #include "widgets/tb1.h" class MidiTrack; -- cgit v1.2.3