From a5dbb325155db659223de7dd97855ac44d3be823 Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Sun, 3 Sep 2006 16:07:37 +0000 Subject: rearrange some code --- muse/muse/CMakeLists.txt | 21 +--- muse/muse/ctrl/CMakeLists.txt | 7 +- muse/muse/midiedit/CMakeLists.txt | 65 ++++++++++++ muse/muse/midiedit/dcanvas.cpp | 2 +- muse/muse/midiedit/gatetime.cpp | 65 ++++++++++++ muse/muse/midiedit/gatetime.h | 51 +++++++++ muse/muse/midiedit/gatetime.ui | 210 +++++++++++++++++++++++++++++++++++++ muse/muse/midiedit/midicmd.cpp | 154 +++++++++++++++++++++++++--- muse/muse/midiedit/midicmd.h | 22 +++- muse/muse/midiedit/prcanvas.cpp | 4 +- muse/muse/midiedit/velocity.cpp | 65 ++++++++++++ muse/muse/midiedit/velocity.h | 51 +++++++++ muse/muse/midiedit/velocity.ui | 211 ++++++++++++++++++++++++++++++++++++++ muse/muse/muse.cpp | 14 ++- muse/muse/muse.h | 10 +- muse/muse/muse.ui | 87 ---------------- muse/muse/widgets/CMakeLists.txt | 7 +- muse/muse/widgets/gatetime.cpp | 65 ------------ muse/muse/widgets/gatetime.h | 50 --------- muse/muse/widgets/gatetime.ui | 210 ------------------------------------- muse/muse/widgets/noteinfo.cpp | 2 +- muse/muse/widgets/velocity.cpp | 65 ------------ muse/muse/widgets/velocity.h | 50 --------- muse/muse/widgets/velocity.ui | 211 -------------------------------------- 24 files changed, 907 insertions(+), 792 deletions(-) create mode 100644 muse/muse/midiedit/CMakeLists.txt create mode 100644 muse/muse/midiedit/gatetime.cpp create mode 100644 muse/muse/midiedit/gatetime.h create mode 100644 muse/muse/midiedit/gatetime.ui create mode 100644 muse/muse/midiedit/velocity.cpp create mode 100644 muse/muse/midiedit/velocity.h create mode 100644 muse/muse/midiedit/velocity.ui delete mode 100644 muse/muse/muse.ui delete mode 100644 muse/muse/widgets/gatetime.cpp delete mode 100644 muse/muse/widgets/gatetime.h delete mode 100644 muse/muse/widgets/gatetime.ui delete mode 100644 muse/muse/widgets/velocity.cpp delete mode 100644 muse/muse/widgets/velocity.h delete mode 100644 muse/muse/widgets/velocity.ui diff --git a/muse/muse/CMakeLists.txt b/muse/muse/CMakeLists.txt index a0b5f7d3..d1a6c806 100644 --- a/muse/muse/CMakeLists.txt +++ b/muse/muse/CMakeLists.txt @@ -41,11 +41,10 @@ MACRO(WRAP_UI outfiles ) ENDMACRO(WRAP_UI) subdirs( - ctrl widgets master driver instruments marker liste + ctrl midiedit widgets master driver instruments marker liste ) set (muse_uics - muse preferences exportmididialog configmidifile @@ -55,7 +54,6 @@ set (muse_uics projectpropsdialog projectdialog templatedialog - midiedit/quantconfig mixer/routedialog arranger/configtrack arranger/miditrackinfo @@ -71,14 +69,6 @@ set(muse_mocs cobject transpose track midisynti miditrack wavetrack audiotrack audioaux audiooutput audioinput audiogroup exportmidi - midiedit/pianoroll - midiedit/prcanvas - midiedit/quantconfig - midiedit/drumedit - midiedit/dcanvas - midiedit/ecanvas - midiedit/ctrledit - midiedit/midieditor mixer/mixer mixer/rack mixer/midirack @@ -124,11 +114,6 @@ add_executable ( muse gconfig.cpp midirc.cpp midififo.cpp midiport.cpp - midiedit/drummap.cpp - midiedit/citem.cpp - midiedit/midicmd.h - midiedit/midicmd.cpp - ${muse_mocCPP} ${muse_moc_headers} ${ui_headers} @@ -139,8 +124,8 @@ set_target_properties( muse ) target_link_libraries(muse - widgets ctrl master driver instruments marker liste - al awl synti + ctrl midiedit master driver instruments marker liste + al synti widgets awl ${QT_LIBRARIES} ${ALSA_LIB} ${JACK_LIB} diff --git a/muse/muse/ctrl/CMakeLists.txt b/muse/muse/ctrl/CMakeLists.txt index d2916fb4..d71bbede 100644 --- a/muse/muse/ctrl/CMakeLists.txt +++ b/muse/muse/ctrl/CMakeLists.txt @@ -19,10 +19,13 @@ #============================================================================= QT4_WRAP_CPP (ctrl_mocs - configmidictrl.h ctrleditor.h ctrldialog.h + configmidictrl.h + ctrleditor.h + ctrldialog.h ) QT4_WRAP_UI (ctrl_ui_headers - configmidictrl.ui ctrldialog.ui + configmidictrl.ui + ctrldialog.ui ) add_library ( ctrl STATIC diff --git a/muse/muse/midiedit/CMakeLists.txt b/muse/muse/midiedit/CMakeLists.txt new file mode 100644 index 00000000..c48d0f24 --- /dev/null +++ b/muse/muse/midiedit/CMakeLists.txt @@ -0,0 +1,65 @@ +#============================================================================= +# 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. +#============================================================================= + +QT4_WRAP_CPP ( midiedit_mocs + gatetime.h + velocity.h + quantconfig.h + ctrledit.h + dcanvas.h + drumedit.h + ecanvas.h + midieditor.h + pianoroll.h + prcanvas.h + ) + +QT4_WRAP_UI ( midiedit_ui_headers + gatetime.ui + velocity.ui + quantconfig.ui + ) + +add_library ( midiedit STATIC + gatetime.cpp + velocity.cpp + quantconfig.cpp + citem.h + cmd.h + drummap.h + midicmd.h + citem.cpp + ctrledit.cpp + dcanvas.cpp + drumedit.cpp + drummap.cpp + ecanvas.cpp + midicmd.cpp + midieditor.cpp + pianoroll.cpp + prcanvas.cpp + ${midiedit_mocs} + ${midiedit_ui_headers} + ) + +set_target_properties( midiedit + PROPERTIES COMPILE_FLAGS "-include ${PROJECT_SOURCE_DIR}/all.h" + ) + diff --git a/muse/muse/midiedit/dcanvas.cpp b/muse/muse/midiedit/dcanvas.cpp index 4a068c1a..d3ee766b 100644 --- a/muse/muse/midiedit/dcanvas.cpp +++ b/muse/muse/midiedit/dcanvas.cpp @@ -23,7 +23,7 @@ #include "midieditor.h" #include "drummap.h" #include "audio.h" -#include "widgets/velocity.h" +#include "velocity.h" #include "gconfig.h" #include "part.h" diff --git a/muse/muse/midiedit/gatetime.cpp b/muse/muse/midiedit/gatetime.cpp new file mode 100644 index 00000000..e75710c8 --- /dev/null +++ b/muse/muse/midiedit/gatetime.cpp @@ -0,0 +1,65 @@ +//============================================================================= +// 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 "gatetime.h" +#include "song.h" +#include "tb1.h" + +//--------------------------------------------------------- +// GateTime +//--------------------------------------------------------- + +GateTime::GateTime(QWidget*) + : MidiCmdDialog() + { + setupUi(this); + rangeGroup = new QButtonGroup(this); + rangeGroup->setExclusive(true); + rangeGroup->addButton(allEventsButton, RANGE_ALL); + rangeGroup->addButton(selectedEventsButton, RANGE_SELECTED); + rangeGroup->addButton(loopedEventsButton, RANGE_LOOPED); + rangeGroup->addButton(selectedLoopedButton, RANGE_SELECTED | RANGE_LOOPED); + allEventsButton->setChecked(true); + } + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void GateTime::accept() + { + _range = rangeGroup->checkedId(); + _rateVal = rate->value(); + _offsetVal = offset->value(); + QDialog::accept(); + } + +//--------------------------------------------------------- +// setRange +//--------------------------------------------------------- + +void GateTime::setRange(int id) + { + if (rangeGroup->button(id)) + rangeGroup->button(id)->setChecked(true); + else + printf("setRange: not button %d!\n", id); + } + diff --git a/muse/muse/midiedit/gatetime.h b/muse/muse/midiedit/gatetime.h new file mode 100644 index 00000000..f438fc1d --- /dev/null +++ b/muse/muse/midiedit/gatetime.h @@ -0,0 +1,51 @@ +//============================================================================= +// 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 __GATETIME_H__ +#define __GATETIME_H__ + +#include "ui_gatetime.h" +#include "midicmd.h" + +//--------------------------------------------------------- +// GateTime +//--------------------------------------------------------- + +class GateTime : public MidiCmdDialog, public Ui::GateTimeBase { + Q_OBJECT + + QButtonGroup* rangeGroup; + int _range; + int _rateVal; + int _offsetVal; + + protected slots: + void accept(); + + public: + GateTime(QWidget* parent = 0); + void setRange(int id); + int range() const { return _range; } + int rateVal() const { return _rateVal; } + int offsetVal() const { return _offsetVal; } + }; + +#endif + diff --git a/muse/muse/midiedit/gatetime.ui b/muse/muse/midiedit/gatetime.ui new file mode 100644 index 00000000..76d45ddc --- /dev/null +++ b/muse/muse/midiedit/gatetime.ui @@ -0,0 +1,210 @@ + + + + + GateTimeBase + + + + 0 + 0 + 387 + 392 + + + + MusE: Modify Gate Time + + + + 11 + + + 6 + + + + + Apply To + + + + 6 + + + 3 + + + + + All Events + + + + + + + Selected Events + + + true + + + + + + + Looped Events + + + + + + + Selected AND Looped + + + + + + + + + + Values + + + + 6 + + + 3 + + + + + Rate: + + + + + + + Offset: + + + + + + + % + + + 200 + + + 100 + + + + + + + 999 + + + -999 + + + 1 + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + OK + + + false + + + true + + + + + + + Cancel + + + + + + + + qPixmapFromMimeSource + + + + okButton + clicked() + GateTimeBase + accept() + + + 211 + 360 + + + 36 + 356 + + + + + cancelButton + clicked() + GateTimeBase + reject() + + + 316 + 372 + + + 124 + 378 + + + + + diff --git a/muse/muse/midiedit/midicmd.cpp b/muse/muse/midiedit/midicmd.cpp index fd3f29ed..231a442f 100644 --- a/muse/muse/midiedit/midicmd.cpp +++ b/muse/muse/midiedit/midicmd.cpp @@ -20,8 +20,35 @@ #include "midicmd.h" #include "song.h" -#include "widgets/gatetime.h" +#include "gatetime.h" +#include "velocity.h" #include "audio.h" +#include "midieditor.h" + +//========================================================== +// class MidiCmd is an attempt to formalize the +// interface between midi command code and MusE. +// Maybe this can be extended to an specialized +// plugin interface +//========================================================== + +//--------------------------------------------------------- +// MidiCmdDialog +//--------------------------------------------------------- + +MidiCmdDialog::MidiCmdDialog() + : QDialog(0) + { + } + +//--------------------------------------------------------- +// MidiCmd +//--------------------------------------------------------- + +MidiCmd::MidiCmd(MidiEditor* e) + { + editor = e; + } //--------------------------------------------------------- // processEvents @@ -29,11 +56,21 @@ void MidiCmd::processEvents(CItemList* items) { + MidiCmdDialog* dialog = guiDialog(); + editor->applyTo(); + dialog->setRange(range); + bool rv = dialog->exec(); + if (!rv) { + delete dialog; + return; + } + range = dialog->range(); // all, selected, looped, sel+loop + editor->setApplyTo(range); + delete dialog; + modified = 0; song->startUndo(); - range = 0; //editor->applyTo(); - process(items, &range); -// editor->setApplyTo(range); + process(items); song->endUndo(modified); } @@ -65,6 +102,8 @@ void MidiCmd::changeEvent(Event oldEvent, Event newEvent, Part* part) } //================================================================== +// process midi event lists +//================================================================== //--------------------------------------------------------- // ModifyGateTimeCmd @@ -72,27 +111,43 @@ void MidiCmd::changeEvent(Event oldEvent, Event newEvent, Part* part) class ModifyGateTimeCmd : public MidiCmd { - protected: - virtual void process(CItemList* items, int* range); + GateTime* dialog; + virtual MidiCmdDialog* guiDialog(); + virtual void process(CItemList* items); public: - ModifyGateTimeCmd() {} + ModifyGateTimeCmd(MidiEditor* e); }; +//--------------------------------------------------------- +// MidifyGateTime +//--------------------------------------------------------- + +ModifyGateTimeCmd::ModifyGateTimeCmd(MidiEditor* e) + : MidiCmd(e) + { + dialog = 0; + } + +//--------------------------------------------------------- +// guiDialog +//--------------------------------------------------------- + +MidiCmdDialog* ModifyGateTimeCmd::guiDialog() + { + if (dialog == 0) + dialog = new GateTime(0); + return dialog; + } + //--------------------------------------------------------- // process -// return true if events are modified //--------------------------------------------------------- -void ModifyGateTimeCmd::process(CItemList* items, int* range) +void ModifyGateTimeCmd::process(CItemList* items) { - GateTime w(0); - w.setRange(*range); - if (!w.exec()) - return; - *range = w.range(); // all, selected, looped, sel+loop - int rate = w.rateVal(); - int offset = w.offsetVal(); + int rate = dialog->rateVal(); + int offset = dialog->offsetVal(); for (iCItem k = items->begin(); k != items->end(); ++k) { CItem* item = k->second; @@ -116,3 +171,70 @@ void ModifyGateTimeCmd::process(CItemList* items, int* range) } } +//--------------------------------------------------------- +// ModifyVelocityCmd +//--------------------------------------------------------- + +class ModifyVelocityCmd : public MidiCmd + { + Velocity* dialog; + virtual MidiCmdDialog* guiDialog(); + virtual void process(CItemList* items); + + public: + ModifyVelocityCmd(MidiEditor* e); + }; + +//--------------------------------------------------------- +// ModifyVelocityCmd +//--------------------------------------------------------- + +ModifyVelocityCmd::ModifyVelocityCmd(MidiEditor* e) + : MidiCmd(e) + { + dialog = 0; + } + +//--------------------------------------------------------- +// guiDialog +//--------------------------------------------------------- + +MidiCmdDialog* ModifyVelocityCmd::guiDialog() + { + if (dialog == 0) + dialog = new Velocity(0); + return dialog; + } + +//--------------------------------------------------------- +// process +//--------------------------------------------------------- + +void ModifyVelocityCmd::process(CItemList* items) + { + int rate = dialog->rateVal(); + int offset = dialog->offsetVal(); + + for (iCItem k = items->begin(); k != items->end(); ++k) { + CItem* item = k->second; + Event event = item->event; + if (event.type() != Note) + continue; + if (itemInRange(item)) { + int velo = event.velo(); + velo = (velo * rate) / 100; + velo += offset; + + if (velo <= 0) + velo = 1; + if (velo > 127) + velo = 127; + if (event.velo() != velo) { + Event newEvent = event.clone(); + newEvent.setVelo(velo); + audio->msgChangeEvent(event, newEvent, item->part, false); + } + } + } + } + diff --git a/muse/muse/midiedit/midicmd.h b/muse/muse/midiedit/midicmd.h index 2cfabb26..0e4a9b43 100644 --- a/muse/muse/midiedit/midicmd.h +++ b/muse/muse/midiedit/midicmd.h @@ -23,6 +23,22 @@ #include "citem.h" +class MidiEditor; +class MidiCmdDialog; + +//--------------------------------------------------------- +// MidiCmdDialog +//--------------------------------------------------------- + +class MidiCmdDialog : public QDialog + { + + public: + MidiCmdDialog(); + int range() const { return 0; } + void setRange(int /*val*/) { } + }; + //--------------------------------------------------------- // MidiCmd // abstract base class for midi commands @@ -32,6 +48,7 @@ class MidiCmd { int modified; protected: + MidiEditor* editor; int range; // convenience classes for derived classes @@ -39,10 +56,11 @@ class MidiCmd { void changeEvent(Event oldEvent, Event newEvent, Part* part); // virtual functions provided by derived classes - virtual void process(CItemList*, int*) = 0; + virtual void process(CItemList*) = 0; + virtual MidiCmdDialog* guiDialog() { return 0; } public: - MidiCmd() {} + MidiCmd(MidiEditor*); virtual ~MidiCmd() {} void processEvents(CItemList*); }; diff --git a/muse/muse/midiedit/prcanvas.cpp b/muse/muse/midiedit/prcanvas.cpp index 2b5b12f0..df674e0e 100644 --- a/muse/muse/midiedit/prcanvas.cpp +++ b/muse/muse/midiedit/prcanvas.cpp @@ -21,8 +21,8 @@ #include "midieditor.h" #include "prcanvas.h" #include "cmd.h" -#include "widgets/gatetime.h" -#include "widgets/velocity.h" +#include "gatetime.h" +#include "velocity.h" #include "song.h" #include "audio.h" #include "part.h" diff --git a/muse/muse/midiedit/velocity.cpp b/muse/muse/midiedit/velocity.cpp new file mode 100644 index 00000000..a011317d --- /dev/null +++ b/muse/muse/midiedit/velocity.cpp @@ -0,0 +1,65 @@ +//============================================================================= +// 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 "velocity.h" +#include "song.h" +#include "tb1.h" + +//--------------------------------------------------------- +// Velocity +//--------------------------------------------------------- + +Velocity::Velocity(QWidget*) + : MidiCmdDialog() + { + setupUi(this); + rangeGroup = new QButtonGroup(this); + rangeGroup->setExclusive(true); + rangeGroup->addButton(allEventsButton, RANGE_ALL); + rangeGroup->addButton(selectedEventsButton, RANGE_SELECTED); + rangeGroup->addButton(loopedEventsButton, RANGE_LOOPED); + rangeGroup->addButton(selectedLoopedButton, RANGE_SELECTED | RANGE_LOOPED); + allEventsButton->setChecked(true); + } + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void Velocity::accept() + { + _range = rangeGroup->checkedId(); + _rateVal = rate->value(); + _offsetVal = offset->value(); + QDialog::accept(); + } + +//--------------------------------------------------------- +// setRange +//--------------------------------------------------------- + +void Velocity::setRange(int id) + { + if (rangeGroup->button(id)) + rangeGroup->button(id)->setChecked(true); + else + printf("setRange: not button %d!\n", id); + } + diff --git a/muse/muse/midiedit/velocity.h b/muse/muse/midiedit/velocity.h new file mode 100644 index 00000000..8cbf1e26 --- /dev/null +++ b/muse/muse/midiedit/velocity.h @@ -0,0 +1,51 @@ +//============================================================================= +// 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 __VELOCITY_H__ +#define __VELOCITY_H__ + +#include "ui_velocity.h" +#include "midicmd.h" + +//--------------------------------------------------------- +// Velocity +//--------------------------------------------------------- + +class Velocity : public MidiCmdDialog, public Ui::VelocityBase { + Q_OBJECT + + QButtonGroup* rangeGroup; + int _range; + int _rateVal; + int _offsetVal; + + protected slots: + void accept(); + + public: + Velocity(QWidget* parent = 0); + void setRange(int id); + int range() const { return _range; } + int rateVal() const { return _rateVal; } + int offsetVal() const { return _offsetVal; } + }; + +#endif + diff --git a/muse/muse/midiedit/velocity.ui b/muse/muse/midiedit/velocity.ui new file mode 100644 index 00000000..e0122520 --- /dev/null +++ b/muse/muse/midiedit/velocity.ui @@ -0,0 +1,211 @@ + + + + + VelocityBase + + + + 0 + 0 + 275 + 335 + + + + MusE: Modify Velocity + + + + 11 + + + 6 + + + + + Apply To + + + + 6 + + + 3 + + + + + All Events + + + + + + + Selected Events + + + true + + + + + + + Looped Events + + + + + + + Selected AND Looped + + + + + + + + + + Values + + + + 6 + + + 3 + + + + + Rate: + + + + + + + Offset: + + + + + + + % + + + 200 + + + 100 + + + + + + + 127 + + + 1 + + + 1 + + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + OK + + + false + + + true + + + + + + + Cancel + + + + + + + + + qPixmapFromMimeSource + + + + okButton + clicked() + VelocityBase + accept() + + + 204 + 362 + + + 59 + 357 + + + + + cancelButton + clicked() + VelocityBase + reject() + + + 322 + 377 + + + 127 + 377 + + + + + diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index ba7db90f..35861a0c 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -41,7 +41,7 @@ #include "marker/markerview.h" #include "transpose.h" #include "preferences.h" -#include "widgets/gatetime.h" +// #include "widgets/gatetime.h" #include "audio.h" #include "midiseq.h" #include "audioprefetch.h" @@ -441,7 +441,7 @@ void MusE::setupTransportToolbar(QToolBar* tb) const MusE::MusE() : QMainWindow() { - setupUi(this); +// setupUi(this); setIconSize(ICON_SIZE); setFocusPolicy(Qt::WheelFocus); @@ -470,6 +470,12 @@ MusE::MusE() exportMidiDialog = 0; projectPropsDialog = 0; + startAction = new QAction(QIcon(":/xpm/start.xpm"), "start", this); + rewindAction = new QAction(QIcon(":/xpm/frewind.xpm"), "rewind", this); + forwardAction = new QAction(QIcon(":/xpm/fforward.xpm"), "forward", this); + stopAction = new QAction(QIcon(":/xpm/stop.xpm"), "stop", this); + playAction = new QAction(QIcon(":/xpm/play.xpm"), "play", this); + song->blockSignals(true); heartBeatTimer = new QTimer(this); connect(heartBeatTimer, SIGNAL(timeout()), song, SLOT(beat())); @@ -1954,8 +1960,8 @@ void MusE::transpose() void MusE::modifyGateTime() { - GateTime* w = new GateTime(this); - w->show(); +//TODO GateTime* w = new GateTime(this); +// w->show(); } //--------------------------------------------------------- diff --git a/muse/muse/muse.h b/muse/muse/muse.h index bcd13af9..43f5551e 100644 --- a/muse/muse/muse.h +++ b/muse/muse/muse.h @@ -21,7 +21,6 @@ #ifndef __APP_H__ #define __APP_H__ -#include "ui_muse.h" #include "cobject.h" #include "widgets/tools.h" @@ -61,7 +60,7 @@ extern void configMidiController(); // MusE //--------------------------------------------------------- -class MusE : public QMainWindow, public Ui::MuseBase +class MusE : public QMainWindow // , public Ui::MuseBase { Q_OBJECT enum { @@ -93,6 +92,7 @@ class MusE : public QMainWindow, public Ui::MuseBase QAction* fileOpenAction; QAction* pianoAction; QAction* fileNewAction; + QString appName; QToolBar *tools; @@ -292,6 +292,12 @@ class MusE : public QMainWindow, public Ui::MuseBase int raster() const { return _raster; } void setupTransportToolbar(QToolBar* tb) const; void readToplevels(QDomNode); + + QAction* startAction; + QAction* rewindAction; + QAction* forwardAction; + QAction* stopAction; + QAction* playAction; }; extern MusE* muse; diff --git a/muse/muse/muse.ui b/muse/muse/muse.ui deleted file mode 100644 index e8fda401..00000000 --- a/muse/muse/muse.ui +++ /dev/null @@ -1,87 +0,0 @@ - - - - - MuseBase - - - - 0 - 0 - 800 - 600 - - - - MusE - - - - - - 0 - 0 - 800 - 35 - - - - - - :/xpm/start.xpm - - - start action - - - - - :/xpm/frewind.xpm - - - rewind - - - - - :/xpm/fforward.xpm - - - forward - - - - - true - - - true - - - :/xpm/stop.xpm - - - stop - - - - - true - - - false - - - :/xpm/play.xpm - - - play - - - - - - - - - diff --git a/muse/muse/widgets/CMakeLists.txt b/muse/muse/widgets/CMakeLists.txt index 5bdaacdf..03866a0c 100644 --- a/muse/muse/widgets/CMakeLists.txt +++ b/muse/muse/widgets/CMakeLists.txt @@ -34,8 +34,7 @@ QT4_WRAP_CPP (widget_mocs comboQuant.h bigtime.h midisync.h mixdowndialog.h - comment.h gatetime.h - velocity.h + comment.h shortcutconfig.h shortcutcapturedialog.h greendotbutton.h recordbutton.h @@ -47,8 +46,6 @@ QT4_WRAP_UI (widget_ui_headers mixdowndialog.ui shortcutcapturedialog.ui shortcutconfig.ui - gatetime.ui - velocity.ui ) # add_custom_command(OUTPUT ui_midisync.h @@ -70,8 +67,6 @@ add_library ( widgets STATIC midisync.cpp comment.cpp mixdowndialog.cpp - velocity.cpp - gatetime.cpp tools.cpp doublelabel.cpp noteinfo.cpp diff --git a/muse/muse/widgets/gatetime.cpp b/muse/muse/widgets/gatetime.cpp deleted file mode 100644 index 83624fa8..00000000 --- a/muse/muse/widgets/gatetime.cpp +++ /dev/null @@ -1,65 +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 "gatetime.h" -#include "song.h" -#include "tb1.h" - -//--------------------------------------------------------- -// GateTime -//--------------------------------------------------------- - -GateTime::GateTime(QWidget* parent) - : QDialog(parent) - { - setupUi(this); - rangeGroup = new QButtonGroup(this); - rangeGroup->setExclusive(true); - rangeGroup->addButton(allEventsButton, RANGE_ALL); - rangeGroup->addButton(selectedEventsButton, RANGE_SELECTED); - rangeGroup->addButton(loopedEventsButton, RANGE_LOOPED); - rangeGroup->addButton(selectedLoopedButton, RANGE_SELECTED | RANGE_LOOPED); - allEventsButton->setChecked(true); - } - -//--------------------------------------------------------- -// accept -//--------------------------------------------------------- - -void GateTime::accept() - { - _range = rangeGroup->checkedId(); - _rateVal = rate->value(); - _offsetVal = offset->value(); - QDialog::accept(); - } - -//--------------------------------------------------------- -// setRange -//--------------------------------------------------------- - -void GateTime::setRange(int id) - { - if (rangeGroup->button(id)) - rangeGroup->button(id)->setChecked(true); - else - printf("setRange: not button %d!\n", id); - } - diff --git a/muse/muse/widgets/gatetime.h b/muse/muse/widgets/gatetime.h deleted file mode 100644 index cf0d6ff7..00000000 --- a/muse/muse/widgets/gatetime.h +++ /dev/null @@ -1,50 +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 __GATETIME_H__ -#define __GATETIME_H__ - -#include "ui_gatetime.h" - -//--------------------------------------------------------- -// GateTime -//--------------------------------------------------------- - -class GateTime : public QDialog, public Ui::GateTimeBase { - Q_OBJECT - - QButtonGroup* rangeGroup; - int _range; - int _rateVal; - int _offsetVal; - - protected slots: - void accept(); - - public: - GateTime(QWidget* parent = 0); - void setRange(int id); - int range() const { return _range; } - int rateVal() const { return _rateVal; } - int offsetVal() const { return _offsetVal; } - }; - -#endif - diff --git a/muse/muse/widgets/gatetime.ui b/muse/muse/widgets/gatetime.ui deleted file mode 100644 index 76d45ddc..00000000 --- a/muse/muse/widgets/gatetime.ui +++ /dev/null @@ -1,210 +0,0 @@ - - - - - GateTimeBase - - - - 0 - 0 - 387 - 392 - - - - MusE: Modify Gate Time - - - - 11 - - - 6 - - - - - Apply To - - - - 6 - - - 3 - - - - - All Events - - - - - - - Selected Events - - - true - - - - - - - Looped Events - - - - - - - Selected AND Looped - - - - - - - - - - Values - - - - 6 - - - 3 - - - - - Rate: - - - - - - - Offset: - - - - - - - % - - - 200 - - - 100 - - - - - - - 999 - - - -999 - - - 1 - - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - OK - - - false - - - true - - - - - - - Cancel - - - - - - - - qPixmapFromMimeSource - - - - okButton - clicked() - GateTimeBase - accept() - - - 211 - 360 - - - 36 - 356 - - - - - cancelButton - clicked() - GateTimeBase - reject() - - - 316 - 372 - - - 124 - 378 - - - - - diff --git a/muse/muse/widgets/noteinfo.cpp b/muse/muse/widgets/noteinfo.cpp index b495005f..9ae02ab0 100644 --- a/muse/muse/widgets/noteinfo.cpp +++ b/muse/muse/widgets/noteinfo.cpp @@ -27,7 +27,7 @@ //--------------------------------------------------- // NoteInfo // ToolBar -// Start, Länge, Note, Velo an, Velo aus, Kanal +// Start, Len, Note, Velo on, Velo off, Channel //--------------------------------------------------- NoteInfo::NoteInfo(QMainWindow* parent) diff --git a/muse/muse/widgets/velocity.cpp b/muse/muse/widgets/velocity.cpp deleted file mode 100644 index ed2cac4e..00000000 --- a/muse/muse/widgets/velocity.cpp +++ /dev/null @@ -1,65 +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 "velocity.h" -#include "song.h" -#include "tb1.h" - -//--------------------------------------------------------- -// Velocity -//--------------------------------------------------------- - -Velocity::Velocity(QWidget* parent) - : QDialog(parent) - { - setupUi(this); - rangeGroup = new QButtonGroup(this); - rangeGroup->setExclusive(true); - rangeGroup->addButton(allEventsButton, RANGE_ALL); - rangeGroup->addButton(selectedEventsButton, RANGE_SELECTED); - rangeGroup->addButton(loopedEventsButton, RANGE_LOOPED); - rangeGroup->addButton(selectedLoopedButton, RANGE_SELECTED | RANGE_LOOPED); - allEventsButton->setChecked(true); - } - -//--------------------------------------------------------- -// accept -//--------------------------------------------------------- - -void Velocity::accept() - { - _range = rangeGroup->checkedId(); - _rateVal = rate->value(); - _offsetVal = offset->value(); - QDialog::accept(); - } - -//--------------------------------------------------------- -// setRange -//--------------------------------------------------------- - -void Velocity::setRange(int id) - { - if (rangeGroup->button(id)) - rangeGroup->button(id)->setChecked(true); - else - printf("setRange: not button %d!\n", id); - } - diff --git a/muse/muse/widgets/velocity.h b/muse/muse/widgets/velocity.h deleted file mode 100644 index f479bc0f..00000000 --- a/muse/muse/widgets/velocity.h +++ /dev/null @@ -1,50 +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 __VELOCITY_H__ -#define __VELOCITY_H__ - -#include "ui_velocity.h" - -//--------------------------------------------------------- -// Velocity -//--------------------------------------------------------- - -class Velocity : public QDialog, public Ui::VelocityBase { - Q_OBJECT - - QButtonGroup* rangeGroup; - int _range; - int _rateVal; - int _offsetVal; - - protected slots: - void accept(); - - public: - Velocity(QWidget* parent = 0); - void setRange(int id); - int range() const { return _range; } - int rateVal() const { return _rateVal; } - int offsetVal() const { return _offsetVal; } - }; - -#endif - diff --git a/muse/muse/widgets/velocity.ui b/muse/muse/widgets/velocity.ui deleted file mode 100644 index e0122520..00000000 --- a/muse/muse/widgets/velocity.ui +++ /dev/null @@ -1,211 +0,0 @@ - - - - - VelocityBase - - - - 0 - 0 - 275 - 335 - - - - MusE: Modify Velocity - - - - 11 - - - 6 - - - - - Apply To - - - - 6 - - - 3 - - - - - All Events - - - - - - - Selected Events - - - true - - - - - - - Looped Events - - - - - - - Selected AND Looped - - - - - - - - - - Values - - - - 6 - - - 3 - - - - - Rate: - - - - - - - Offset: - - - - - - - % - - - 200 - - - 100 - - - - - - - 127 - - - 1 - - - 1 - - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - OK - - - false - - - true - - - - - - - Cancel - - - - - - - - - qPixmapFromMimeSource - - - - okButton - clicked() - VelocityBase - accept() - - - 204 - 362 - - - 59 - 357 - - - - - cancelButton - clicked() - VelocityBase - reject() - - - 322 - 377 - - - 127 - 377 - - - - - -- cgit v1.2.3