From 755119791d4f2d1220ffa8175a53c4c148a93c21 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Wed, 18 May 2011 18:29:07 +0000 Subject: moved midi dialogs to sub project/dir --- muse2/muse/CMakeLists.txt | 1 + muse2/muse/functions.h | 4 +- muse2/muse/widgets/CMakeLists.txt | 12 +- muse2/muse/widgets/function_dialogs/gatetime.cpp | 108 ++++++++ muse2/muse/widgets/function_dialogs/gatetime.h | 47 ++++ .../muse/widgets/function_dialogs/gatetimebase.ui | 220 +++++++++++++++ muse2/muse/widgets/function_dialogs/quantbase.ui | 308 +++++++++++++++++++++ muse2/muse/widgets/function_dialogs/quantize.cpp | 103 +++++++ muse2/muse/widgets/function_dialogs/quantize.h | 45 +++ muse2/muse/widgets/gatetime.cpp | 108 -------- muse2/muse/widgets/gatetime.h | 47 ---- muse2/muse/widgets/gatetimebase.ui | 220 --------------- muse2/muse/widgets/quantbase.ui | 308 --------------------- muse2/muse/widgets/quantize.cpp | 103 ------- muse2/muse/widgets/quantize.h | 45 --- 15 files changed, 840 insertions(+), 839 deletions(-) create mode 100644 muse2/muse/widgets/function_dialogs/gatetime.cpp create mode 100644 muse2/muse/widgets/function_dialogs/gatetime.h create mode 100644 muse2/muse/widgets/function_dialogs/gatetimebase.ui create mode 100644 muse2/muse/widgets/function_dialogs/quantbase.ui create mode 100644 muse2/muse/widgets/function_dialogs/quantize.cpp create mode 100644 muse2/muse/widgets/function_dialogs/quantize.h delete mode 100644 muse2/muse/widgets/gatetime.cpp delete mode 100644 muse2/muse/widgets/gatetime.h delete mode 100644 muse2/muse/widgets/gatetimebase.ui delete mode 100644 muse2/muse/widgets/quantbase.ui delete mode 100644 muse2/muse/widgets/quantize.cpp delete mode 100644 muse2/muse/widgets/quantize.h diff --git a/muse2/muse/CMakeLists.txt b/muse2/muse/CMakeLists.txt index 8705f914..761f8e96 100644 --- a/muse2/muse/CMakeLists.txt +++ b/muse2/muse/CMakeLists.txt @@ -233,6 +233,7 @@ target_link_libraries(core synti waveedit widgets + widgets_functiondialogs ${QT_LIBRARIES} ${SNDFILE_LIBRARIES} diff --git a/muse2/muse/functions.h b/muse2/muse/functions.h index a0228831..9987958b 100644 --- a/muse2/muse/functions.h +++ b/muse2/muse/functions.h @@ -9,9 +9,9 @@ #define __FUNCTIONS_H__ #include "velocity.h" -#include "quantize.h" +#include "widgets/function_dialogs/quantize.h" #include "crescendo.h" -#include "gatetime.h" +#include "widgets/function_dialogs/gatetime.h" #include "remove.h" #include "transpose.h" #include "setlen.h" diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt index c8415d73..2d848ab0 100644 --- a/muse2/muse/widgets/CMakeLists.txt +++ b/muse2/muse/widgets/CMakeLists.txt @@ -18,6 +18,12 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #============================================================================= +set (SubDirs + function_dialogs + ) + +subdirs (${SubDirs}) + ## ## Expand Qt macros in source files ## @@ -35,7 +41,6 @@ QT4_WRAP_CPP (widget_mocs didyouknow.h doublelabel.h filedialog.h - gatetime.h genset.h header.h hitscale.h @@ -77,7 +82,6 @@ QT4_WRAP_CPP (widget_mocs ttoolbutton.h unusedwavefiles.h velocity.h - quantize.h crescendo.h move.h remove.h @@ -103,7 +107,6 @@ file (GLOB widgets_ui_files editnotedialogbase.ui editsysexdialogbase.ui fdialogbuttons.ui - gatetimebase.ui gensetbase.ui itransformbase.ui metronomebase.ui @@ -120,7 +123,6 @@ file (GLOB widgets_ui_files transposebase.ui unusedwavefiles.ui velocitybase.ui - quantbase.ui crescendobase.ui movebase.ui removebase.ui @@ -148,7 +150,6 @@ file (GLOB widgets_source_files doublelabel.cpp drange.cpp filedialog.cpp - gatetime.cpp genset.cpp header.cpp hitscale.cpp @@ -194,7 +195,6 @@ file (GLOB widgets_source_files unusedwavefiles.cpp utils.cpp velocity.cpp - quantize.cpp crescendo.cpp move.cpp remove.cpp diff --git a/muse2/muse/widgets/function_dialogs/gatetime.cpp b/muse2/muse/widgets/function_dialogs/gatetime.cpp new file mode 100644 index 00000000..9448ab1c --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/gatetime.cpp @@ -0,0 +1,108 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: gatetime.cpp,v 1.1.1.1 2003/10/27 18:54:37 wschweer Exp $ +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#include +#include + +#include "gatetime.h" + +#include "xml.h" +#include "song.h" + +//--------------------------------------------------------- +// GateTime +//--------------------------------------------------------- + +GateTime::GateTime(QWidget* parent) + : QDialog(parent) + { + setupUi(this); + rangeGroup = new QButtonGroup(rangeBox); + rangeGroup->addButton(allButton, 0); + rangeGroup->addButton(selButton, 1); + rangeGroup->addButton(loopButton, 2); + rangeGroup->addButton(sloopButton, 3); + rangeGroup->setExclusive(true); + + pullValues(); + } + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void GateTime::accept() + { + pullValues(); + QDialog::accept(); + } + +//--------------------------------------------------------- +// pullValues +//--------------------------------------------------------- + +void GateTime::pullValues() + { + range = rangeGroup->checkedId(); + rateVal = rate->value(); + offsetVal = offset->value(); + } + +//--------------------------------------------------------- +// exec +//--------------------------------------------------------- + +int GateTime::exec() + { + rangeGroup->button(range)->setChecked(true); + rate->setValue(rateVal); + offset->setValue(offsetVal); + + return QDialog::exec(); + } + + +void GateTime::read_configuration(Xml& xml) +{ + for (;;) + { + Xml::Token token = xml.parse(); + if (token == Xml::Error || token == Xml::End) + break; + + const QString& tag = xml.s1(); + switch (token) + { + case Xml::TagStart: + if (tag == "range") + range=xml.parseInt(); + else if (tag == "rate") + rateVal=xml.parseInt(); + else if (tag == "offset") + offsetVal=xml.parseInt(); + else + xml.unknown("ModLen"); + break; + + case Xml::TagEnd: + if (tag == "mod_len") + return; + + default: + break; + } + } +} + +void GateTime::write_configuration(int level, Xml& xml) +{ + xml.tag(level++, "mod_len"); + xml.intTag(level, "range", range); + xml.intTag(level, "offset", offsetVal); + xml.intTag(level, "rate", rateVal); + xml.tag(level, "/mod_len"); +} diff --git a/muse2/muse/widgets/function_dialogs/gatetime.h b/muse2/muse/widgets/function_dialogs/gatetime.h new file mode 100644 index 00000000..d2555872 --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/gatetime.h @@ -0,0 +1,47 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: gatetime.h,v 1.1.1.1.2.1 2008/01/19 13:33:47 wschweer Exp $ +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __GATETIME_H__ +#define __GATETIME_H__ + +#include "ui_gatetimebase.h" + +class QButtonGroup; +class QDialog; +class Xml; + +//--------------------------------------------------------- +// GateTime +//--------------------------------------------------------- + +class GateTime : public QDialog, public Ui::GateTimeBase { + private: + Q_OBJECT + + QButtonGroup *rangeGroup; + + protected slots: + void accept(); + void pullValues(); + + public: + GateTime(QWidget* parent=0); + + int range; + int rateVal; + int offsetVal; + + void read_configuration(Xml& xml); + void write_configuration(int level, Xml& xml); + + + public slots: + int exec(); + }; + +#endif + diff --git a/muse2/muse/widgets/function_dialogs/gatetimebase.ui b/muse2/muse/widgets/function_dialogs/gatetimebase.ui new file mode 100644 index 00000000..e804de17 --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/gatetimebase.ui @@ -0,0 +1,220 @@ + + + GateTimeBase + + + + 0 + 0 + 275 + 316 + + + + MusE: Modify Note Length + + + + 6 + + + 11 + + + + + Range + + + + 6 + + + 11 + + + + + All Events + + + + + + + Selected Events + + + true + + + + + + + Looped Events + + + + + + + Selected Looped + + + + + + + + + + Values + + + + 11 + + + 6 + + + + + Rate: + + + false + + + + + + + Offset: + + + false + + + + + + + % + + + 1000 + + + 100 + + + + + + + -999 + + + 999 + + + 1 + + + + + + + lenNew = (lenOld * rate) + offset + + + + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 0 + 0 + + + + + + + + OK + + + false + + + true + + + + + + + Cancel + + + + + + + + + + + okButton + clicked() + GateTimeBase + accept() + + + 20 + 20 + + + 20 + 20 + + + + + cancelButton + clicked() + GateTimeBase + reject() + + + 20 + 20 + + + 20 + 20 + + + + + diff --git a/muse2/muse/widgets/function_dialogs/quantbase.ui b/muse2/muse/widgets/function_dialogs/quantbase.ui new file mode 100644 index 00000000..6a88c86f --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/quantbase.ui @@ -0,0 +1,308 @@ + + + QuantBase + + + true + + + + 0 + 0 + 279 + 486 + + + + MusE: Quantize + + + + 6 + + + 11 + + + + + Range + + + + 6 + + + 11 + + + + + All Events + + + + + + + Selected Events + + + true + + + + + + + Looped Events + + + + + + + Selected Looped + + + + + + + + + + Values + + + + 11 + + + 6 + + + + + Strength: + + + false + + + + + + + % + + + 100 + + + 80 + + + + + + + Threshold (ticks): + + + false + + + + + + + 0 + + + 10000 + + + 1 + + + + + + + Quantize Len + + + + + + + + + + true + + + + + + + Raster + + + + + + + false + + + 3 + + + true + + + + Whole + + + + + Half + + + + + Quarter + + + + + 8th + + + + + 16th + + + + + 32th + + + + + + + + Swing: + + + + + + + -99 + + + + + + + If the proposed change in tick or length is smaller than threshold, nothing is done. +If swing=0, this is normal +If swing is 33, you get a 2:1-rhythm. +If swing is -33, you get a 1:2-rhythm. + + + true + + + + + + + + + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + OK + + + false + + + true + + + + + + + Cancel + + + + + + + + + + + + ok_button + clicked() + QuantBase + accept() + + + 20 + 20 + + + 20 + 20 + + + + + cancel_button + clicked() + QuantBase + reject() + + + 20 + 20 + + + 20 + 20 + + + + + diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp new file mode 100644 index 00000000..111087c2 --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/quantize.cpp @@ -0,0 +1,103 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: quantize.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $ +// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net) +//========================================================= + +#include +#include "quantize.h" +#include "xml.h" + +Quantize::Quantize(QWidget* parent) + : QDialog(parent) +{ + setupUi(this); + range_group = new QButtonGroup; + range_group->addButton(all_events_button,0); + range_group->addButton(selected_events_button,1); + range_group->addButton(looped_events_button,2); + range_group->addButton(selected_looped_button,3); + + pull_values(); +} + +void Quantize::pull_values() +{ + range = range_group->checkedId(); + strength = strength_spinbox->value(); + threshold = threshold_spinbox->value(); + raster_power2 = raster_combobox->currentIndex(); + quant_len = len_checkbox->isChecked(); + swing = swing_spinbox->value(); +} + +void Quantize::accept() +{ + pull_values(); + QDialog::accept(); +} + +int Quantize::exec() +{ + if ((range < 0) || (range > 3)) range=0; + + range_group->button(range)->setChecked(true); + strength_spinbox->setValue(strength); + threshold_spinbox->setValue(threshold); + raster_combobox->setCurrentIndex(raster_power2); + len_checkbox->setChecked(quant_len); + swing_spinbox->setValue(swing); + + return QDialog::exec(); +} + +void Quantize::read_configuration(Xml& xml) +{ + for (;;) + { + Xml::Token token = xml.parse(); + if (token == Xml::Error || token == Xml::End) + break; + + const QString& tag = xml.s1(); + switch (token) + { + case Xml::TagStart: + if (tag == "range") + range=xml.parseInt(); + else if (tag == "strength") + strength=xml.parseInt(); + else if (tag == "threshold") + threshold=xml.parseInt(); + else if (tag == "raster") + raster_power2=xml.parseInt(); + else if (tag == "swing") + swing=xml.parseInt(); + else if (tag == "quant_len") + quant_len=xml.parseInt(); + else + xml.unknown("Quantize"); + break; + + case Xml::TagEnd: + if (tag == "quantize") + return; + + default: + break; + } + } +} + +void Quantize::write_configuration(int level, Xml& xml) +{ + xml.tag(level++, "quantize"); + xml.intTag(level, "range", range); + xml.intTag(level, "strength", strength); + xml.intTag(level, "threshold", threshold); + xml.intTag(level, "raster", raster_power2); + xml.intTag(level, "swing", swing); + xml.intTag(level, "quant_len", quant_len); + xml.tag(level, "/quantize"); +} diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h new file mode 100644 index 00000000..399e2545 --- /dev/null +++ b/muse2/muse/widgets/function_dialogs/quantize.h @@ -0,0 +1,45 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: quantize.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $ +// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net) +//========================================================= + +#ifndef __QUANTIZE_H__ +#define __QUANTIZE_H__ + +#include "ui_quantbase.h" + +class QButtonGroup; +class Xml; + +class Quantize : public QDialog, public Ui::QuantBase +{ + private: + Q_OBJECT + QButtonGroup* range_group; + + protected slots: + void accept(); + void pull_values(); + + public: + Quantize(QWidget* parent = 0); + + int range; + int strength; + int threshold; + int raster_power2; + int swing; + bool quant_len; + + void read_configuration(Xml& xml); + void write_configuration(int level, Xml& xml); + + + public slots: + int exec(); +}; + +#endif + diff --git a/muse2/muse/widgets/gatetime.cpp b/muse2/muse/widgets/gatetime.cpp deleted file mode 100644 index 9448ab1c..00000000 --- a/muse2/muse/widgets/gatetime.cpp +++ /dev/null @@ -1,108 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: gatetime.cpp,v 1.1.1.1 2003/10/27 18:54:37 wschweer Exp $ -// (C) Copyright 2001 Werner Schweer (ws@seh.de) -//========================================================= - -#include -#include - -#include "gatetime.h" - -#include "xml.h" -#include "song.h" - -//--------------------------------------------------------- -// GateTime -//--------------------------------------------------------- - -GateTime::GateTime(QWidget* parent) - : QDialog(parent) - { - setupUi(this); - rangeGroup = new QButtonGroup(rangeBox); - rangeGroup->addButton(allButton, 0); - rangeGroup->addButton(selButton, 1); - rangeGroup->addButton(loopButton, 2); - rangeGroup->addButton(sloopButton, 3); - rangeGroup->setExclusive(true); - - pullValues(); - } - -//--------------------------------------------------------- -// accept -//--------------------------------------------------------- - -void GateTime::accept() - { - pullValues(); - QDialog::accept(); - } - -//--------------------------------------------------------- -// pullValues -//--------------------------------------------------------- - -void GateTime::pullValues() - { - range = rangeGroup->checkedId(); - rateVal = rate->value(); - offsetVal = offset->value(); - } - -//--------------------------------------------------------- -// exec -//--------------------------------------------------------- - -int GateTime::exec() - { - rangeGroup->button(range)->setChecked(true); - rate->setValue(rateVal); - offset->setValue(offsetVal); - - return QDialog::exec(); - } - - -void GateTime::read_configuration(Xml& xml) -{ - for (;;) - { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) - break; - - const QString& tag = xml.s1(); - switch (token) - { - case Xml::TagStart: - if (tag == "range") - range=xml.parseInt(); - else if (tag == "rate") - rateVal=xml.parseInt(); - else if (tag == "offset") - offsetVal=xml.parseInt(); - else - xml.unknown("ModLen"); - break; - - case Xml::TagEnd: - if (tag == "mod_len") - return; - - default: - break; - } - } -} - -void GateTime::write_configuration(int level, Xml& xml) -{ - xml.tag(level++, "mod_len"); - xml.intTag(level, "range", range); - xml.intTag(level, "offset", offsetVal); - xml.intTag(level, "rate", rateVal); - xml.tag(level, "/mod_len"); -} diff --git a/muse2/muse/widgets/gatetime.h b/muse2/muse/widgets/gatetime.h deleted file mode 100644 index d2555872..00000000 --- a/muse2/muse/widgets/gatetime.h +++ /dev/null @@ -1,47 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: gatetime.h,v 1.1.1.1.2.1 2008/01/19 13:33:47 wschweer Exp $ -// (C) Copyright 2001 Werner Schweer (ws@seh.de) -//========================================================= - -#ifndef __GATETIME_H__ -#define __GATETIME_H__ - -#include "ui_gatetimebase.h" - -class QButtonGroup; -class QDialog; -class Xml; - -//--------------------------------------------------------- -// GateTime -//--------------------------------------------------------- - -class GateTime : public QDialog, public Ui::GateTimeBase { - private: - Q_OBJECT - - QButtonGroup *rangeGroup; - - protected slots: - void accept(); - void pullValues(); - - public: - GateTime(QWidget* parent=0); - - int range; - int rateVal; - int offsetVal; - - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); - - - public slots: - int exec(); - }; - -#endif - diff --git a/muse2/muse/widgets/gatetimebase.ui b/muse2/muse/widgets/gatetimebase.ui deleted file mode 100644 index e804de17..00000000 --- a/muse2/muse/widgets/gatetimebase.ui +++ /dev/null @@ -1,220 +0,0 @@ - - - GateTimeBase - - - - 0 - 0 - 275 - 316 - - - - MusE: Modify Note Length - - - - 6 - - - 11 - - - - - Range - - - - 6 - - - 11 - - - - - All Events - - - - - - - Selected Events - - - true - - - - - - - Looped Events - - - - - - - Selected Looped - - - - - - - - - - Values - - - - 11 - - - 6 - - - - - Rate: - - - false - - - - - - - Offset: - - - false - - - - - - - % - - - 1000 - - - 100 - - - - - - - -999 - - - 999 - - - 1 - - - - - - - lenNew = (lenOld * rate) + offset - - - - - - - - - - 6 - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 0 - 0 - - - - - - - - OK - - - false - - - true - - - - - - - Cancel - - - - - - - - - - - okButton - clicked() - GateTimeBase - accept() - - - 20 - 20 - - - 20 - 20 - - - - - cancelButton - clicked() - GateTimeBase - reject() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/muse2/muse/widgets/quantbase.ui b/muse2/muse/widgets/quantbase.ui deleted file mode 100644 index 6a88c86f..00000000 --- a/muse2/muse/widgets/quantbase.ui +++ /dev/null @@ -1,308 +0,0 @@ - - - QuantBase - - - true - - - - 0 - 0 - 279 - 486 - - - - MusE: Quantize - - - - 6 - - - 11 - - - - - Range - - - - 6 - - - 11 - - - - - All Events - - - - - - - Selected Events - - - true - - - - - - - Looped Events - - - - - - - Selected Looped - - - - - - - - - - Values - - - - 11 - - - 6 - - - - - Strength: - - - false - - - - - - - % - - - 100 - - - 80 - - - - - - - Threshold (ticks): - - - false - - - - - - - 0 - - - 10000 - - - 1 - - - - - - - Quantize Len - - - - - - - - - - true - - - - - - - Raster - - - - - - - false - - - 3 - - - true - - - - Whole - - - - - Half - - - - - Quarter - - - - - 8th - - - - - 16th - - - - - 32th - - - - - - - - Swing: - - - - - - - -99 - - - - - - - If the proposed change in tick or length is smaller than threshold, nothing is done. -If swing=0, this is normal -If swing is 33, you get a 2:1-rhythm. -If swing is -33, you get a 1:2-rhythm. - - - true - - - - - - - - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - OK - - - false - - - true - - - - - - - Cancel - - - - - - - - - - - - ok_button - clicked() - QuantBase - accept() - - - 20 - 20 - - - 20 - 20 - - - - - cancel_button - clicked() - QuantBase - reject() - - - 20 - 20 - - - 20 - 20 - - - - - diff --git a/muse2/muse/widgets/quantize.cpp b/muse2/muse/widgets/quantize.cpp deleted file mode 100644 index 111087c2..00000000 --- a/muse2/muse/widgets/quantize.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: quantize.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $ -// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net) -//========================================================= - -#include -#include "quantize.h" -#include "xml.h" - -Quantize::Quantize(QWidget* parent) - : QDialog(parent) -{ - setupUi(this); - range_group = new QButtonGroup; - range_group->addButton(all_events_button,0); - range_group->addButton(selected_events_button,1); - range_group->addButton(looped_events_button,2); - range_group->addButton(selected_looped_button,3); - - pull_values(); -} - -void Quantize::pull_values() -{ - range = range_group->checkedId(); - strength = strength_spinbox->value(); - threshold = threshold_spinbox->value(); - raster_power2 = raster_combobox->currentIndex(); - quant_len = len_checkbox->isChecked(); - swing = swing_spinbox->value(); -} - -void Quantize::accept() -{ - pull_values(); - QDialog::accept(); -} - -int Quantize::exec() -{ - if ((range < 0) || (range > 3)) range=0; - - range_group->button(range)->setChecked(true); - strength_spinbox->setValue(strength); - threshold_spinbox->setValue(threshold); - raster_combobox->setCurrentIndex(raster_power2); - len_checkbox->setChecked(quant_len); - swing_spinbox->setValue(swing); - - return QDialog::exec(); -} - -void Quantize::read_configuration(Xml& xml) -{ - for (;;) - { - Xml::Token token = xml.parse(); - if (token == Xml::Error || token == Xml::End) - break; - - const QString& tag = xml.s1(); - switch (token) - { - case Xml::TagStart: - if (tag == "range") - range=xml.parseInt(); - else if (tag == "strength") - strength=xml.parseInt(); - else if (tag == "threshold") - threshold=xml.parseInt(); - else if (tag == "raster") - raster_power2=xml.parseInt(); - else if (tag == "swing") - swing=xml.parseInt(); - else if (tag == "quant_len") - quant_len=xml.parseInt(); - else - xml.unknown("Quantize"); - break; - - case Xml::TagEnd: - if (tag == "quantize") - return; - - default: - break; - } - } -} - -void Quantize::write_configuration(int level, Xml& xml) -{ - xml.tag(level++, "quantize"); - xml.intTag(level, "range", range); - xml.intTag(level, "strength", strength); - xml.intTag(level, "threshold", threshold); - xml.intTag(level, "raster", raster_power2); - xml.intTag(level, "swing", swing); - xml.intTag(level, "quant_len", quant_len); - xml.tag(level, "/quantize"); -} diff --git a/muse2/muse/widgets/quantize.h b/muse2/muse/widgets/quantize.h deleted file mode 100644 index 399e2545..00000000 --- a/muse2/muse/widgets/quantize.h +++ /dev/null @@ -1,45 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: quantize.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $ -// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net) -//========================================================= - -#ifndef __QUANTIZE_H__ -#define __QUANTIZE_H__ - -#include "ui_quantbase.h" - -class QButtonGroup; -class Xml; - -class Quantize : public QDialog, public Ui::QuantBase -{ - private: - Q_OBJECT - QButtonGroup* range_group; - - protected slots: - void accept(); - void pull_values(); - - public: - Quantize(QWidget* parent = 0); - - int range; - int strength; - int threshold; - int raster_power2; - int swing; - bool quant_len; - - void read_configuration(Xml& xml); - void write_configuration(int level, Xml& xml); - - - public slots: - int exec(); -}; - -#endif - -- cgit v1.2.3