From: werner s. <wsc...@us...> - 2006-02-01 18:41:15
|
Update of /cvsroot/lmuse/muse/awl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17122/awl Modified Files: Makefile.am awlplugin.cpp awlplugin.h tcanvas.cpp tempolabel.cpp tempolabel.h Added Files: tempoedit.cpp tempoedit.h Log Message: updates Index: tcanvas.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/awl/tcanvas.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** tcanvas.cpp 26 Jan 2006 16:11:22 -0000 1.56 --- tcanvas.cpp 1 Feb 2006 18:40:46 -0000 1.57 *************** *** 153,157 **** //--------------------------------------------------------- ! // showController //--------------------------------------------------------- --- 153,157 ---- //--------------------------------------------------------- ! // resizeController //--------------------------------------------------------- Index: tempolabel.h =================================================================== RCS file: /cvsroot/lmuse/muse/awl/tempolabel.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tempolabel.h 1 Nov 2005 10:00:28 -0000 1.3 --- tempolabel.h 1 Feb 2006 18:40:46 -0000 1.4 *************** *** 30,48 **** TempoLabel(QWidget*); }; - - //--------------------------------------------------------- - // TempoEdit - //--------------------------------------------------------- - - class TempoEdit : public QDoubleSpinBox { - Q_OBJECT - - protected: - QSize sizeHint() const; - - public: - TempoEdit(QWidget*); - }; - } --- 30,33 ---- Index: tempolabel.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/awl/tempolabel.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tempolabel.cpp 28 Sep 2005 20:26:37 -0000 1.6 --- tempolabel.cpp 1 Feb 2006 18:40:46 -0000 1.7 *************** *** 56,84 **** return QSize(w, h).expandedTo(QApplication::globalStrut()); } - - //--------------------------------------------------------- - // TempoSpinBox - //--------------------------------------------------------- - - TempoEdit::TempoEdit(QWidget* parent) - : QDoubleSpinBox(parent) - { - setSingleStep(1.0); - setRange(30.0, 600.0); - // connect(this, SIGNAL(valueChanged(double)), SLOT(tempoChanged(int))); - } - - //--------------------------------------------------------- - // sizeHint - //--------------------------------------------------------- - - QSize TempoEdit::sizeHint() const - { - QFontMetrics fm(font()); - int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); - int h = fm.height() + fw * 2; - int w = 2 + fm.width(QString("000.00")) + fw * 4 + 30; - return QSize(w, h).expandedTo(QApplication::globalStrut()); - } } --- 56,59 ---- Index: Makefile.am =================================================================== RCS file: /cvsroot/lmuse/muse/awl/Makefile.am,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Makefile.am 8 Jan 2006 15:11:20 -0000 1.26 --- Makefile.am 1 Feb 2006 18:40:46 -0000 1.27 *************** *** 31,35 **** mslider midimslider midimeter combobox checkbox posedit \ pitchedit poslabel pitchlabel tempolabel sigedit tcanvas \ ! sigedit dist_libawl_a_SOURCES = \ --- 31,35 ---- mslider midimslider midimeter combobox checkbox posedit \ pitchedit poslabel pitchlabel tempolabel sigedit tcanvas \ ! sigedit tempoedit dist_libawl_a_SOURCES = \ *************** *** 58,61 **** --- 58,62 ---- pitchlabel.h pitchlabel.cpp \ tempolabel.h tempolabel.cpp \ + tempoedit.h tempoedit.cpp \ sigedit.h sigedit.cpp \ tcanvas.h tcanvas.cpp \ *************** *** 85,88 **** --- 86,90 ---- obj/moc_pitchlabel.cpp \ obj/moc_tempolabel.cpp \ + obj/moc_tempoedit.cpp \ obj/moc_sigedit.cpp \ obj/moc_tcanvas.cpp \ *************** *** 94,97 **** --- 96,100 ---- slider.cpp volslider.cpp mslider.cpp \ posedit.cpp poslabel.cpp \ + tempoedit.cpp tempolabel.cpp \ combobox.cpp checkbox.cpp \ panknob.cpp midipanknob.cpp \ *************** *** 103,106 **** --- 106,110 ---- slider.cpp volslider.cpp mslider.cpp \ posedit.cpp poslabel.cpp \ + tempoedit.cpp tempolabel.cpp \ combobox.cpp checkbox.cpp \ panknob.cpp midipanknob.cpp \ *************** *** 112,115 **** --- 116,120 ---- obj/moc_slider.cpp obj/moc_volslider.cpp obj/moc_mslider.cpp \ obj/moc_posedit.cpp obj/moc_poslabel.cpp \ + obj/moc_tempoedit.cpp obj/moc_tempolabel.cpp \ obj/moc_combobox.cpp obj/moc_checkbox.cpp \ obj/moc_panknob.cpp obj/moc_midipanknob.cpp \ *************** *** 121,124 **** --- 126,130 ---- obj/moc_slider.cpp obj/moc_volslider.cpp obj/moc_mslider.cpp \ obj/moc_posedit.cpp obj/moc_poslabel.cpp \ + obj/moc_tempoedit.cpp obj/moc_tempolabel.cpp \ obj/moc_combobox.cpp obj/moc_checkbox.cpp \ obj/moc_panknob.cpp obj/moc_midipanknob.cpp \ Index: awlplugin.h =================================================================== RCS file: /cvsroot/lmuse/muse/awl/awlplugin.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** awlplugin.h 29 Dec 2005 12:53:10 -0000 1.6 --- awlplugin.h 1 Feb 2006 18:40:46 -0000 1.7 *************** *** 135,138 **** --- 135,166 ---- //--------------------------------------------------------- + // TempoEditPlugin + //--------------------------------------------------------- + + class TempoEditPlugin : public QObject, public AwlPlugin { + Q_OBJECT + + public: + TempoEditPlugin(QObject* parent = 0) : QObject(parent) {} + QString includeFile() const { return "awl/tempoedit.h"; } + QString name() const { return "Awl::TempoEdit"; } + QWidget* createWidget(QWidget* parent); + }; + + //--------------------------------------------------------- + // TempoLabelPlugin + //--------------------------------------------------------- + + class TempoLabelPlugin : public QObject, public AwlPlugin { + Q_OBJECT + + public: + TempoLabelPlugin(QObject* parent = 0) : QObject(parent) {} + QString includeFile() const { return "awl/tempolabel.h"; } + QString name() const { return "Awl::TempoLabel"; } + QWidget* createWidget(QWidget* parent); + }; + + //--------------------------------------------------------- // CheckBoxPlugin //--------------------------------------------------------- --- NEW FILE: tempoedit.cpp --- //========================================================= // Awl // Audio Widget Library // $Id: tempoedit.cpp,v 1.1 2006/02/01 18:40:46 wschweer Exp $ // (C) Copyright 2006 Werner Schweer (ws...@se...) //========================================================= #include "tempoedit.h" namespace Awl { //--------------------------------------------------------- // TempoEdit //--------------------------------------------------------- TempoEdit::TempoEdit(QWidget* parent) : QDoubleSpinBox(parent) { curVal = -1.0; setSingleStep(1.0); setRange(30.0, 600.0); connect(this, SIGNAL(valueChanged(double)), SLOT(newValue(double))); } //--------------------------------------------------------- // sizeHint //--------------------------------------------------------- QSize TempoEdit::sizeHint() const { QFontMetrics fm(font()); int fw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); int h = fm.height() + fw * 2; int w = 2 + fm.width(QString("000.00")) + fw * 4 + 30; return QSize(w, h).expandedTo(QApplication::globalStrut()); } //--------------------------------------------------------- // newValue //--------------------------------------------------------- void TempoEdit::newValue(double val) { if (val != curVal) { curVal = val; emit tempoChanged(tempo()); } } //--------------------------------------------------------- // setTempo //--------------------------------------------------------- void TempoEdit::setTempo(int val) { double d = 60000000.0/double(val); if (d != curVal) { curVal = d; blockSignals(true); setValue(d); blockSignals(false); } } //--------------------------------------------------------- // tempo //--------------------------------------------------------- int TempoEdit::tempo() const { return lrint(60000000.0/value()); } } --- NEW FILE: tempoedit.h --- //========================================================= // MusE // Linux Music Editor // $Id: tempoedit.h,v 1.1 2006/02/01 18:40:46 wschweer Exp $ // (C) Copyright 1999-2004 Werner Schweer (ws...@se...) //========================================================= #ifndef __AWLTEMPOEDIT_H__ #define __AWLTEMPOEDIT_H__ namespace Awl { //--------------------------------------------------------- // TempoEdit //--------------------------------------------------------- class TempoEdit : public QDoubleSpinBox { Q_OBJECT double curVal; protected: QSize sizeHint() const; private slots: void newValue(double); public slots: void setTempo(int); signals: void tempoChanged(int); public: TempoEdit(QWidget*); int tempo() const; }; } #endif Index: awlplugin.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/awl/awlplugin.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** awlplugin.cpp 6 Jan 2006 22:48:08 -0000 1.15 --- awlplugin.cpp 1 Feb 2006 18:40:46 -0000 1.16 *************** *** 13,16 **** --- 13,18 ---- #include "posedit.h" #include "poslabel.h" + #include "tempoedit.h" + #include "tempolabel.h" #include "checkbox.h" #include "combobox.h" *************** *** 50,53 **** --- 52,63 ---- return new Awl::PosLabel(parent); } + QWidget* TempoEditPlugin::createWidget(QWidget* parent) + { + return new Awl::TempoEdit(parent); + } + QWidget* TempoLabelPlugin::createWidget(QWidget* parent) + { + return new Awl::TempoLabel(parent); + } QWidget* CheckBoxPlugin::createWidget(QWidget* parent) { *************** *** 88,91 **** --- 98,103 ---- << new PosEditPlugin << new PosLabelPlugin + << new TempoEditPlugin + << new TempoLabelPlugin << new CheckBoxPlugin << new ComboBoxPlugin |