diff options
author | Werner Schweer <ws.seh.de> | 2006-09-25 12:04:23 +0000 |
---|---|---|
committer | Werner Schweer <ws.seh.de> | 2006-09-25 12:04:23 +0000 |
commit | 68bb16e746a46c32acb32daacda9ee82f6de46f9 (patch) | |
tree | 3ec9f169bedeef21053bad27204dc0b9cffd8814 | |
parent | 40ff59846dd3b816693357db03efdd82d49c8365 (diff) |
updates
45 files changed, 214 insertions, 206 deletions
diff --git a/muse/CMakeLists.txt b/muse/CMakeLists.txt index 0867579e..bd5a66ea 100644 --- a/muse/CMakeLists.txt +++ b/muse/CMakeLists.txt @@ -21,8 +21,8 @@ project(muse) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.1) -set(CMAKE_BUILD_TYPE Debug) -# set(CMAKE_BUILD_TYPE Release) +# set(CMAKE_BUILD_TYPE Debug) +set(CMAKE_BUILD_TYPE Release) set(CMAKE_INCLUDE_CURRENT_DIR TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) diff --git a/muse/awl/aslider.cpp b/muse/awl/aslider.cpp index 5f751bf6..3c5b1780 100644 --- a/muse/awl/aslider.cpp +++ b/muse/awl/aslider.cpp @@ -134,7 +134,7 @@ void AbstractSlider::wheelEvent(QWheelEvent* ev) void AbstractSlider::keyPressEvent(QKeyEvent* ev) { - float oval = _value; + double oval = _value; switch (ev->key()) { case Qt::Key_Home: _value = _minValue; break; @@ -160,7 +160,7 @@ void AbstractSlider::keyPressEvent(QKeyEvent* ev) // setValue //--------------------------------------------------------- -void AbstractSlider::setValue(float val) +void AbstractSlider::setValue(double val) { if (_log) { if (val == 0.0f) @@ -189,7 +189,7 @@ void AbstractSlider::valueChange() // value //--------------------------------------------------------- -float AbstractSlider::value() const +double AbstractSlider::value() const { return _log ? (_value <= _minValue) ? 0.0f : pow(10.0, _value*0.05f) : _value; diff --git a/muse/awl/aslider.h b/muse/awl/aslider.h index eed73277..058114e3 100644 --- a/muse/awl/aslider.h +++ b/muse/awl/aslider.h @@ -26,7 +26,8 @@ namespace Awl { //--------------------------------------------------------- // AbstractSlider // -//! The AwlAbstractSlider class provides an float value within a range +//! The AwlAbstractSlider class provides an double value +//! within a range // //! The class is designed as a common super class for //! widgets like AwlKnob and AwlSlider @@ -35,7 +36,7 @@ namespace Awl { class AbstractSlider : public QWidget { Q_OBJECT - Q_PROPERTY(float value READ value WRITE setValue) + Q_PROPERTY(double value READ value WRITE setValue) Q_PROPERTY(bool center READ center WRITE setCenter) Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance) @@ -55,7 +56,7 @@ class AbstractSlider : public QWidget { protected: int _id; - float _value; + double _value; double _minValue, _maxValue, _lineStep, _pageStep; bool _center; bool _invert; @@ -70,10 +71,10 @@ class AbstractSlider : public QWidget { virtual void valueChange(); signals: - void valueChanged(float, int); + void valueChanged(double, int); public slots: - virtual void setValue(float v); + virtual void setValue(double v); public: AbstractSlider(QWidget* parent = 0); @@ -101,7 +102,7 @@ class AbstractSlider : public QWidget { int id() const { return _id; } void setId(int i) { _id = i; } - virtual float value() const; + virtual double value() const; double minValue() const { return _minValue; } void setMinValue(double v) { _minValue = v; } diff --git a/muse/awl/checkbox.h b/muse/awl/checkbox.h index 145105bf..7a6252c1 100644 --- a/muse/awl/checkbox.h +++ b/muse/awl/checkbox.h @@ -35,13 +35,13 @@ class CheckBox : public QCheckBox { private slots: void hasToggled(bool val) { - emit valueChanged(float(val), _id); + emit valueChanged(double(val), _id); } signals: void valueChanged(float, int); public slots: - void setValue(float val) { setDown(val > 0.5f); } + void setValue(double val) { setDown(val > 0.5f); } public: CheckBox(QWidget* parent); diff --git a/muse/awl/combobox.h b/muse/awl/combobox.h index c3c4d91b..d335d993 100644 --- a/muse/awl/combobox.h +++ b/muse/awl/combobox.h @@ -35,14 +35,14 @@ class ComboBox : public QComboBox { private slots: void activatedIntern(int val) { - emit valueChanged(float(val), _id); + emit valueChanged(double(val), _id); } signals: - void valueChanged(float, int); + void valueChanged(double, int); public slots: - void setValue(float val) { setCurrentIndex(int(val)); } + void setValue(double val) { setCurrentIndex(int(val)); } public: ComboBox(QWidget* parent); diff --git a/muse/awl/floatentry.cpp b/muse/awl/floatentry.cpp index a9875594..7831614f 100644 --- a/muse/awl/floatentry.cpp +++ b/muse/awl/floatentry.cpp @@ -55,7 +55,7 @@ FloatEntry::FloatEntry(QWidget* parent) // setString //--------------------------------------------------------- -bool FloatEntry::setString(float v) +bool FloatEntry::setString(double v) { QString s; // if (v < _minValue || v > _maxValue) { @@ -80,7 +80,7 @@ bool FloatEntry::setString(float v) void FloatEntry::setSValue(const QString& s) { bool ok; - float v = s.toFloat(&ok); + double v = s.toFloat(&ok); if (ok && (v != _value)) { if (v < _minValue) v = _minValue; @@ -105,7 +105,7 @@ void FloatEntry::valueChange() // incValue //--------------------------------------------------------- -void FloatEntry::incValue(float) +void FloatEntry::incValue(double) { if (_value + 1.0 < _maxValue) { _value = _value + 1.0; @@ -118,7 +118,7 @@ void FloatEntry::incValue(float) // decValue //--------------------------------------------------------- -void FloatEntry::decValue(float) +void FloatEntry::decValue(double) { if (_value - 1.0 > _minValue) { _value = _value - 1.0; @@ -169,7 +169,7 @@ void FloatEntry::mousePressEvent(QMouseEvent* event) { button = event->button(); starty = event->y(); - evx = float(event->x()); + evx = double(event->x()); timecount = 0; repeat(); timer->start(TIMER1); @@ -272,7 +272,7 @@ void FloatEntry::mouseDoubleClickEvent(QMouseEvent* event) // setValue //--------------------------------------------------------- -void FloatEntry::setValue(float val) +void FloatEntry::setValue(double val) { if (_log) { if (val == 0.0f) @@ -304,9 +304,9 @@ void FloatEntry::updateValue() // value //--------------------------------------------------------- -float FloatEntry::value() const +double FloatEntry::value() const { - float rv; + double rv; if (_log) rv = pow(10.0, _value * 0.05f); else diff --git a/muse/awl/floatentry.h b/muse/awl/floatentry.h index 1fbdc7bc..a90232a9 100644 --- a/muse/awl/floatentry.h +++ b/muse/awl/floatentry.h @@ -56,15 +56,15 @@ class FloatEntry : public QLineEdit { virtual void mouseDoubleClickEvent(QMouseEvent*); virtual void mouseReleaseEvent(QMouseEvent*); virtual void setSValue(const QString&); - virtual bool setString(float); - virtual void incValue(float); - virtual void decValue(float); + virtual bool setString(double); + virtual void incValue(double); + virtual void decValue(double); void updateValue(); protected: int _id; - float _value; + double _value; virtual void valueChange(); private slots: @@ -74,15 +74,15 @@ class FloatEntry : public QLineEdit { void endEdit(); public slots: - virtual void setValue(float); + virtual void setValue(double); signals: - void valueChanged(float, int); + void valueChanged(double, int); public: FloatEntry(QWidget*); virtual QSize sizeHint() const; - virtual float value() const; + virtual double value() const; int id() const { return _id; } void setId(int i) { _id = i; } double minValue() const { return _minValue; } diff --git a/muse/awl/knob.cpp b/muse/awl/knob.cpp index 8fb57508..30956859 100644 --- a/muse/awl/knob.cpp +++ b/muse/awl/knob.cpp @@ -134,7 +134,7 @@ void Knob::mouseReleaseEvent(QMouseEvent*) void Knob::mouseMoveEvent(QMouseEvent* ev) { int y = ev->y(); - float delta = (maxValue() - minValue()) / 100.0f; + double delta = (maxValue() - minValue()) / 100.0f; if (delta == 0) delta = 1; _value += (startY - y) * delta; @@ -188,7 +188,7 @@ void Knob::paint(const QRect& r) // draw arc //----------------------------------------- - float dvalue = maxValue() - minValue(); + double dvalue = maxValue() - minValue(); if (_center) { int size = _scaleSize * 8; if (_value >= 0) { diff --git a/muse/awl/midimeter.cpp b/muse/awl/midimeter.cpp index aa6e528b..eaae83ee 100644 --- a/muse/awl/midimeter.cpp +++ b/muse/awl/midimeter.cpp @@ -44,7 +44,7 @@ MidiMeter::MidiMeter(QWidget* parent) // v - 0.0 < 1.0 //--------------------------------------------------------- -void MidiMeter::setMeterVal(float v) +void MidiMeter::setMeterVal(double v) { if (v < 0.001) v = .0f; @@ -72,7 +72,7 @@ void MidiMeter::mouseDoubleClickEvent(QMouseEvent*) void MidiMeter::paint(const QRect& r) { int pixel = height() - sliderSize().height(); - float range = maxValue() - minValue(); + double range = maxValue() - minValue(); int ppos = int(pixel * (_value - minValue()) / range); if (_invert) ppos = pixel - ppos; diff --git a/muse/awl/midimeter.h b/muse/awl/midimeter.h index 1624fd97..80f3c52a 100644 --- a/muse/awl/midimeter.h +++ b/muse/awl/midimeter.h @@ -34,7 +34,7 @@ class MidiMeter : public Slider Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth) Q_OBJECT - float meterval; + double meterval; int _meterWidth; virtual void paint(const QRect& r); @@ -43,7 +43,7 @@ class MidiMeter : public Slider virtual void mouseDoubleClickEvent(QMouseEvent*); public slots: - void setMeterVal(float value); + void setMeterVal(double value); public: MidiMeter(QWidget* parent = 0); diff --git a/muse/awl/midimslider.cpp b/muse/awl/midimslider.cpp index 0c3ffc0e..c7d7efa8 100644 --- a/muse/awl/midimslider.cpp +++ b/muse/awl/midimslider.cpp @@ -44,7 +44,7 @@ MidiMeterSlider::MidiMeterSlider(QWidget* parent) // v - 0.0 < 1.0 //--------------------------------------------------------- -void MidiMeterSlider::setMeterVal(float v) +void MidiMeterSlider::setMeterVal(double v) { if (v < 0.001) v = .0f; @@ -72,7 +72,7 @@ void MidiMeterSlider::mouseDoubleClickEvent(QMouseEvent*) void MidiMeterSlider::paint(const QRect& r) { int pixel = height() - sliderSize().height(); - float range = maxValue() - minValue(); + double range = maxValue() - minValue(); int ppos = int(pixel * (_value - minValue()) / range); if (_invert) ppos = pixel - ppos; diff --git a/muse/awl/midimslider.h b/muse/awl/midimslider.h index f2f58a4d..15533b09 100644 --- a/muse/awl/midimslider.h +++ b/muse/awl/midimslider.h @@ -34,7 +34,7 @@ class MidiMeterSlider : public Slider Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth) Q_OBJECT - float meterval; + double meterval; int _meterWidth; virtual void paint(const QRect& r); @@ -43,7 +43,7 @@ class MidiMeterSlider : public Slider virtual void mouseDoubleClickEvent(QMouseEvent*); public slots: - void setMeterVal(float value); + void setMeterVal(double value); public: MidiMeterSlider(QWidget* parent = 0); diff --git a/muse/awl/midipanentry.h b/muse/awl/midipanentry.h index 913339f8..25f7333a 100644 --- a/muse/awl/midipanentry.h +++ b/muse/awl/midipanentry.h @@ -36,12 +36,12 @@ class MidiPanEntry : public FloatEntry { virtual void valueChange(); public slots: - virtual void setValue(float v) { + virtual void setValue(double v) { FloatEntry::setValue(v - 64.0f); } public: MidiPanEntry(QWidget* parent); - virtual float value() const { return _value + 64.0f; } + virtual double value() const { return _value + 64.0f; } }; } diff --git a/muse/awl/midipanknob.h b/muse/awl/midipanknob.h index 5c4b715a..9b628e6b 100644 --- a/muse/awl/midipanknob.h +++ b/muse/awl/midipanknob.h @@ -42,12 +42,12 @@ class MidiPanKnob : public Knob { } public slots: - virtual void setValue(float v) { + virtual void setValue(double v) { AbstractSlider::setValue(v - 64.0f); } public: MidiPanKnob(QWidget* parent = 0); - virtual float value() const { return _value + 64.0f; } + virtual double value() const { return _value + 64.0f; } }; } diff --git a/muse/awl/midivolentry.cpp b/muse/awl/midivolentry.cpp index 80aa1d1d..0b74afcc 100644 --- a/muse/awl/midivolentry.cpp +++ b/muse/awl/midivolentry.cpp @@ -42,9 +42,9 @@ MidiVolEntry::MidiVolEntry(QWidget* parent) // setValue //--------------------------------------------------------- -void MidiVolEntry::setValue(float v) +void MidiVolEntry::setValue(double v) { - FloatEntry::setValue(-fast_log10(float(_max*_max)/(v*v))*20.0f); + FloatEntry::setValue(-fast_log10(double(_max*_max)/(v*v))*20.0f); } } diff --git a/muse/awl/midivolentry.h b/muse/awl/midivolentry.h index 45216521..99155877 100644 --- a/muse/awl/midivolentry.h +++ b/muse/awl/midivolentry.h @@ -36,7 +36,7 @@ class MidiVolEntry : public FloatEntry { int _max; public: - virtual void setValue(float); + virtual void setValue(double); void setMax(int val) { _max = val; } int max() const { return _max; } MidiVolEntry(QWidget* parent); diff --git a/muse/awl/mslider.cpp b/muse/awl/mslider.cpp index 2f910731..0bfac826 100644 --- a/muse/awl/mslider.cpp +++ b/muse/awl/mslider.cpp @@ -67,7 +67,7 @@ void MeterSlider::setChannel(int n) // setMeterVal //--------------------------------------------------------- -void MeterSlider::setMeterVal(int channel, float v, float peak) +void MeterSlider::setMeterVal(int channel, double v, double peak) { bool mustRedraw = false; if (meterval[channel] != v) { diff --git a/muse/awl/mslider.h b/muse/awl/mslider.h index 24e67889..7f02eee6 100644 --- a/muse/awl/mslider.h +++ b/muse/awl/mslider.h @@ -37,8 +37,8 @@ class MeterSlider : public VolSlider Q_OBJECT int _channel; - std::vector<float> meterval; - std::vector<float> meterPeak; + std::vector<double> meterval; + std::vector<double> meterPeak; int yellowScale, redScale; int _meterWidth; @@ -50,7 +50,7 @@ class MeterSlider : public VolSlider public slots: void resetPeaks(); - void setMeterVal(int channel, float value, float peak); + void setMeterVal(int channel, double value, double peak); public: MeterSlider(QWidget* parent = 0); diff --git a/muse/awl/tcanvas.cpp b/muse/awl/tcanvas.cpp index ef515f50..3cd0d9ff 100644 --- a/muse/awl/tcanvas.cpp +++ b/muse/awl/tcanvas.cpp @@ -891,6 +891,26 @@ void TimeCanvas::canvasPaintEvent(const QRect& r, QPainter& p) int y1 = r.y(); int y2 = y1 + r.height(); + if (drawRuler) { + p.setClipRect(hor); + int w = r.width(); + int x = r.x(); + int y = rulerHeight - 16; + QColor lcColors[3] = { Qt::red, Qt::blue, Qt::blue }; + + for (int i = 0; i < 3; ++i) { + p.setPen(lcColors[i]); + int xp = pos2pix(pos[i]) + rRuler.x(); + QPixmap* pm = markIcon[i]; + int pw = (pm->width() + 1) / 2; + int x1 = x - pw; + int x2 = x + w + pw; + if (xp >= x1 && xp < x2) { + p.drawPixmap(xp - pw, y-2, *pm); + p.drawLine(xp, y1, xp, y2); + } + } + } if (marker) { int yy1 = y1; if (yy1 < rCanvasA.x()) @@ -900,33 +920,14 @@ void TimeCanvas::canvasPaintEvent(const QRect& r, QPainter& p) if (start != marker->begin()) --start; AL::iMarker end = marker->lower_bound(pos2.tick()); + if (end != marker->end()) + ++end; for (AL::iMarker m = start; m != end; ++m) { AL::Pos pm(m->second); int x = pos2pix(pm) + rRuler.x(); p.drawLine(x, yy1, x, y2); } } - if (!drawRuler) - return; - - p.setClipRect(hor); - int w = r.width(); - int x = r.x(); - int y = rulerHeight - 16; - QColor lcColors[3] = { Qt::red, Qt::blue, Qt::blue }; - - for (int i = 0; i < 3; ++i) { - p.setPen(lcColors[i]); - int xp = pos2pix(pos[i]) + rRuler.x(); - QPixmap* pm = markIcon[i]; - int pw = (pm->width() + 1) / 2; - int x1 = x - pw; - int x2 = x + w + pw; - if (xp >= x1 && xp < x2) { - p.drawPixmap(xp - pw, y-2, *pm); - p.drawLine(xp, y1, xp, y2); - } - } } //--------------------------------------------------------- diff --git a/muse/awl/tcanvas.h b/muse/awl/tcanvas.h index df4b9d70..cdecdbe6 100644 --- a/muse/awl/tcanvas.h +++ b/muse/awl/tcanvas.h @@ -244,6 +244,7 @@ class TimeCanvas : public QFrame { void setCanvasBackground(const QPixmap& pm); void updateCanvasB() { _widget->update(rCanvasB); } + void updateRuler() { _widget->update(rRuler); } static FollowMode followMode; friend class CtrlEdit; diff --git a/muse/midiplugins/metronom/metronom.cpp b/muse/midiplugins/metronom/metronom.cpp index 8dfce574..28fb00a1 100644 --- a/muse/midiplugins/metronom/metronom.cpp +++ b/muse/midiplugins/metronom/metronom.cpp @@ -47,8 +47,8 @@ bool Metronom::init() data.beatVelo = 70; gui = new MetronomGui(this, 0); + gui->hide(); gui->setWindowTitle(QString(name())); - gui->show(); return false; } diff --git a/muse/muse/arranger/canvas.cpp b/muse/muse/arranger/canvas.cpp index bb75b1b1..1a0ef232 100644 --- a/muse/muse/arranger/canvas.cpp +++ b/muse/muse/arranger/canvas.cpp @@ -52,6 +52,17 @@ PartCanvas::PartCanvas() lselected = -1; starty = -1; setMarkerList(song->marker()); + connect(song, SIGNAL(markerChanged(int)), SLOT(markerChanged(int))); + } + +//--------------------------------------------------------- +// markerChanged +//--------------------------------------------------------- + +void PartCanvas::markerChanged(int val) + { + if (val == Song::MARKER_CUR) + updateRuler(); } //--------------------------------------------------------- diff --git a/muse/muse/arranger/canvas.h b/muse/muse/arranger/canvas.h index d1c1d166..8ecd3abe 100644 --- a/muse/muse/arranger/canvas.h +++ b/muse/muse/arranger/canvas.h @@ -97,6 +97,9 @@ class PartCanvas : public TimeCanvas { } void contextMenu(const QPoint&); + private slots: + void markerChanged(int); + signals: void kbdMovementUpdate(Track* t, Part* p); void startEditor(Part*, int); diff --git a/muse/muse/audiotrack.cpp b/muse/muse/audiotrack.cpp index b430b87d..2f3608bc 100644 --- a/muse/muse/audiotrack.cpp +++ b/muse/muse/audiotrack.cpp @@ -113,7 +113,7 @@ void AudioTrack::addPlugin(PluginI* plugin, int idx) for (int i = 0; i < ncontroller; ++i) { int id = (idx + 1) * 0x1000 + i; QString name(plugin->getParameterName(i)); - float min, max; + double min, max; plugin->range(i, &min, &max); Ctrl* cl = getController(id); //printf("Plugin name: %s id:%d\n",name.toAscii().data(), id); diff --git a/muse/muse/ctrl.cpp b/muse/muse/ctrl.cpp index 4bc154e7..c2eac773 100644 --- a/muse/muse/ctrl.cpp +++ b/muse/muse/ctrl.cpp @@ -202,7 +202,7 @@ void Ctrl::del(unsigned frame) // read //--------------------------------------------------------- -void Ctrl::read(QDomNode node, bool midi) +void Ctrl::read(QDomNode node, bool) { QDomElement e = node.toElement(); _id = e.attribute("id").toInt(); @@ -379,7 +379,7 @@ CVal Ctrl::pixel2val(int pixel, int maxpixel) // setRange //--------------------------------------------------------- -void Ctrl::setRange(float _min, float _max) +void Ctrl::setRange(double _min, double _max) { if (_type & LOG) { min.f = fast_log10(_min); diff --git a/muse/muse/ctrl.h b/muse/muse/ctrl.h index 7c4148c8..df4a3b6b 100644 --- a/muse/muse/ctrl.h +++ b/muse/muse/ctrl.h @@ -190,7 +190,7 @@ class Ctrl : public CTRL { bool changed() const { return _changed; } void setTouched(bool val) { _touched = val; } bool touched() const { return _touched; } - void setRange(float min, float max); + void setRange(double min, double max); void setRange(int min, int max); CVal minVal() const { return min; } CVal maxVal() const { return max; } diff --git a/muse/muse/globals.cpp b/muse/muse/globals.cpp index 3a5f9558..ca51a659 100644 --- a/muse/muse/globals.cpp +++ b/muse/muse/globals.cpp @@ -138,7 +138,7 @@ bool precountPrerecord = false; bool precountPreroll = false; bool midiClickFlag = true; bool audioClickFlag = true; -float audioClickVolume = 0.1f; +double audioClickVolume = 0.1f; bool rcEnable = false; bool midiSeqRunning = false; diff --git a/muse/muse/globals.h b/muse/muse/globals.h index 9e7f413b..70a222cd 100644 --- a/muse/muse/globals.h +++ b/muse/muse/globals.h @@ -92,7 +92,7 @@ extern bool precountPrerecord; extern bool precountPreroll; extern bool midiClickFlag; extern bool audioClickFlag; -extern float audioClickVolume; +extern double audioClickVolume; extern bool rcEnable; #endif diff --git a/muse/muse/importmidi.cpp b/muse/muse/importmidi.cpp index 3afdd22f..5033b6f9 100644 --- a/muse/muse/importmidi.cpp +++ b/muse/muse/importmidi.cpp @@ -507,7 +507,7 @@ bool MusE::importMidi(const QString name, bool merge) int n = sig.n; transport->setTimesig(z, n); -//TD int tempo = AL::tempomap.tempo(0); +// int tempo = AL::tempomap.tempo(0); // transport->setTempo(tempo); bool masterF = !AL::tempomap.empty(); @@ -531,11 +531,11 @@ void MusE::processTrack(MidiTrack* track) return; //--------------------------------------------------- - // Parts ermitteln - // die Midi-Spuren werden in Parts aufgebrochen; - // ein neuer Part wird bei einer Lcke von einem - // Takt gebildet; die L�ge wird jeweils auf - // Takte aufgerundet und aligned + // create parts + // Break midi tracks into parts. + // A new part is created when a gap of at least + // one measure is detected. Part len is aligned + // to one measure. //--------------------------------------------------- PartList* pl = track->parts(); @@ -575,7 +575,6 @@ void MusE::processTrack(MidiTrack* track) part->setType(AL::TICKS); part->setTick(st); part->setLenTick(x1-st); -// printf("new part %d len: %d\n", st, x1-st); part->setName(partname); pl->add(part); st = -1; @@ -600,7 +599,6 @@ void MusE::processTrack(MidiTrack* track) Part* part = new Part(track); part->setType(AL::TICKS); part->setTick(st); -// printf("new part %d len: %d\n", st, x2-st); part->setLenTick(x2-st); part->setName(partname); pl->add(part); diff --git a/muse/muse/midiplugin.cpp b/muse/muse/midiplugin.cpp index 5c230e6c..498369df 100644 --- a/muse/muse/midiplugin.cpp +++ b/muse/muse/midiplugin.cpp @@ -181,8 +181,8 @@ MidiPluginI::~MidiPluginI() static void loadMidiPlugin(QFileInfo* fi) { if (debugMsg) - printf(" load midi plugin <%s>\n", fi->filePath().toLatin1().data()); - void* handle = dlopen(fi->filePath().toLatin1().data(), RTLD_NOW); + printf(" load midi plugin <%s>\n", fi->filePath().toAscii().data()); + void* handle = dlopen(fi->filePath().toLocal8Bit().data(), RTLD_NOW); if (handle == 0) { fprintf(stderr, "loadMidiPlugin::dlopen(%s) failed: %s\n", fi->filePath().toLatin1().data(), dlerror()); diff --git a/muse/muse/mixer/astrip.cpp b/muse/muse/mixer/astrip.cpp index f03f3320..0af3e63a 100644 --- a/muse/muse/mixer/astrip.cpp +++ b/muse/muse/mixer/astrip.cpp @@ -34,7 +34,7 @@ void AudioStrip::heartBeat() for (int ch = 0; ch < channel; ++ch) { int n = track->peakTimer(ch); ++n; - float f = track->peak(ch); + double f = track->peak(ch); if (n >= peakHold) { // track->resetPeak(ch); track->setPeak(ch, f * 0.7); @@ -129,7 +129,7 @@ void AudioStrip::stereoToggled(bool val) // auxChanged //--------------------------------------------------------- -void AudioStrip::auxChanged(float v, int idx) +void AudioStrip::auxChanged(double v, int idx) { if (auxValue[idx] != v) { CVal val; @@ -143,7 +143,7 @@ void AudioStrip::auxChanged(float v, int idx) // volumeChanged //--------------------------------------------------------- -void AudioStrip::volumeChanged(float v) +void AudioStrip::volumeChanged(double v) { CVal val; val.f = v; @@ -154,7 +154,7 @@ void AudioStrip::volumeChanged(float v) // setAux //--------------------------------------------------------- -void AudioStrip::setAux(float val, int idx) +void AudioStrip::setAux(double val, int idx) { auxKnob[idx]->setValue(val); auxLabel[idx]->setValue(val); @@ -201,7 +201,7 @@ void AudioStrip::volumeReleased() // panChanged //--------------------------------------------------------- -void AudioStrip::panChanged(float v) +void AudioStrip::panChanged(double v) { if (v != panVal) { CVal val; @@ -215,7 +215,7 @@ void AudioStrip::panChanged(float v) // setPan //--------------------------------------------------------- -void AudioStrip::setPan(float val) +void AudioStrip::setPan(double val) { if (val != panVal) { panVal = val; @@ -299,8 +299,8 @@ Awl::VolKnob* AudioStrip::addAuxKnob(int id, Awl::VolEntry** dlabel) connect(knob, SIGNAL(sliderPressed(int)), SLOT(auxPressed(int))); connect(knob, SIGNAL(sliderReleased(int)), SLOT(auxReleased(int))); - connect(knob, SIGNAL(valueChanged(float, int)), SLOT(auxChanged(float, int))); - connect(pl, SIGNAL(valueChanged(float, int)), SLOT(auxChanged(float, int))); + connect(knob, SIGNAL(valueChanged(double, int)), SLOT(auxChanged(double, int))); + connect(pl, SIGNAL(valueChanged(double, int)), SLOT(auxChanged(double, int))); return knob; } @@ -339,8 +339,8 @@ Awl::PanKnob* AudioStrip::addPanKnob(Awl::PanEntry** dlabel) pangrid->addWidget(knob, 0, 1, 2, 1); layout->addLayout(pangrid); - connect(knob, SIGNAL(valueChanged(float,int)), SLOT(panChanged(float))); - connect(pl, SIGNAL(valueChanged(float,int)), SLOT(panChanged(float))); + connect(knob, SIGNAL(valueChanged(double,int)), SLOT(panChanged(double))); + connect(pl, SIGNAL(valueChanged(double,int)), SLOT(panChanged(double))); connect(knob, SIGNAL(sliderPressed(int)), SLOT(panPressed())); connect(knob, SIGNAL(sliderReleased(int)), SLOT(panReleased())); return knob; @@ -414,7 +414,7 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align) auxKnob.push_back(ak); auxLabel.push_back(al); auxValue.push_back(0.0f); - float as = t->getController(AC_AUX+idx)->curVal().f; + double as = t->getController(AC_AUX+idx)->curVal().f; ak->setValue(as); al->setValue(as); } @@ -431,7 +431,7 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align) slider->setFixedWidth(60); slider->setChannel(channel); Ctrl* ctrl = t->getController(AC_VOLUME); - float vol = 0.0; + double vol = 0.0f; if (ctrl) vol = ctrl->curVal().f; slider->setValue(vol); @@ -443,8 +443,8 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align) sl->setFrame(true); sl->setValue(vol); - connect(slider, SIGNAL(valueChanged(float,int)), SLOT(volumeChanged(float))); - connect(sl, SIGNAL(valueChanged(float,int)), SLOT(volumeChanged(float))); + connect(slider, SIGNAL(valueChanged(double,int)), SLOT(volumeChanged(double))); + connect(sl, SIGNAL(valueChanged(double,int)), SLOT(volumeChanged(double))); connect(slider, SIGNAL(sliderPressed(int)), SLOT(volumePressed())); connect(slider, SIGNAL(sliderReleased(int)), SLOT(volumeReleased())); @@ -456,7 +456,7 @@ AudioStrip::AudioStrip(Mixer* m, AudioTrack* t, bool align) //--------------------------------------------------- pan = addPanKnob(&panl); - float panv = t->getController(AC_PAN)->curVal().f; + double panv = t->getController(AC_PAN)->curVal().f; pan->setValue(panv); panl->setValue(panv); @@ -964,7 +964,7 @@ void AudioStrip::recordToggled(bool val) void AudioStrip::controllerChanged(int id) { - float val = track->getController(id)->curVal().f; + double val = track->getController(id)->curVal().f; switch (id) { case AC_VOLUME: slider->setValue(val); diff --git a/muse/muse/mixer/astrip.h b/muse/muse/mixer/astrip.h index 4a6c9cf7..f761299c 100644 --- a/muse/muse/mixer/astrip.h +++ b/muse/muse/mixer/astrip.h @@ -36,15 +36,15 @@ class AudioStrip : public Strip { Awl::MeterSlider* slider; Awl::VolEntry* sl; - float volume; + double volume; Awl::PanKnob* pan; Awl::PanEntry* panl; - float panVal; + double panVal; std::vector<Awl::VolKnob*> auxKnob; std::vector<Awl::VolEntry*> auxLabel; - std::vector<float> auxValue; + std::vector<double> auxValue; QToolButton* stereo; QToolButton* pre; @@ -65,15 +65,15 @@ class AudioStrip : public Strip { void offToggled(bool); void iRoutePressed(); void oRoutePressed(); - void auxChanged(float, int); - void volumeChanged(float); + void auxChanged(double, int); + void volumeChanged(double); void volumePressed(); void volumeReleased(); - void panChanged(float); - void setPan(float); + void panChanged(double); + void setPan(double); void panPressed(); void panReleased(); - void setAux(float, int); + void setAux(double, int); void auxPressed(int); void auxReleased(int); void muteToggled(bool); diff --git a/muse/muse/mixer/mstrip.cpp b/muse/muse/mixer/mstrip.cpp index 5838af8b..6d8c624e 100644 --- a/muse/muse/mixer/mstrip.cpp +++ b/muse/muse/mixer/mstrip.cpp @@ -74,8 +74,8 @@ void MidiChannelStrip::addKnob(int ctrl, int idx, const QString& tt, const QStri grid->addWidget(knob, 0, 1, 2, 1); layout->addLayout(grid); - connect(knob, SIGNAL(valueChanged(float,int)), slot); - connect(dl, SIGNAL(valueChanged(float,int)), slot); + connect(knob, SIGNAL(valueChanged(double,int)), slot); + connect(dl, SIGNAL(valueChanged(double,int)), slot); connect(knob, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int))); connect(knob, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int))); } @@ -93,9 +93,9 @@ MidiChannelStrip::MidiChannelStrip(Mixer* m, MidiChannel* t, bool align) variSendTouched = false; chorusSendTouched = false; - addKnob(CTRL_VARIATION_SEND, KNOB_VAR_SEND, tr("VariationSend"), tr("Var"), SLOT(ctrlChanged(float,int)), true); - addKnob(CTRL_REVERB_SEND, KNOB_REV_SEND, tr("ReverbSend"), tr("Rev"), SLOT(ctrlChanged(float,int)), true); - addKnob(CTRL_CHORUS_SEND, KNOB_CHOR_SEND, tr("ChorusSend"), tr("Cho"), SLOT(ctrlChanged(float,int)), true); + addKnob(CTRL_VARIATION_SEND, KNOB_VAR_SEND, tr("VariationSend"), tr("Var"), SLOT(ctrlChanged(double,int)), true); + addKnob(CTRL_REVERB_SEND, KNOB_REV_SEND, tr("ReverbSend"), tr("Rev"), SLOT(ctrlChanged(double,int)), true); + addKnob(CTRL_CHORUS_SEND, KNOB_CHOR_SEND, tr("ChorusSend"), tr("Cho"), SLOT(ctrlChanged(double,int)), true); int auxsSize = song->auxs()->size(); if (auxsSize) @@ -114,17 +114,17 @@ MidiChannelStrip::MidiChannelStrip(Mixer* m, MidiChannel* t, bool align) sl->setId(CTRL_VOLUME); sl->setFont(*config.fonts[1]); - connect(slider, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(slider, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int))); connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int))); - connect(sl, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); layout->addWidget(sl); //--------------------------------------------------- // pan, balance //--------------------------------------------------- - addKnob(CTRL_PANPOT, KNOB_PAN, tr("Pan/Balance"), tr("Pan"), SLOT(ctrlChanged(float,int)), true); + addKnob(CTRL_PANPOT, KNOB_PAN, tr("Pan/Balance"), tr("Pan"), SLOT(ctrlChanged(double,int)), true); //--------------------------------------------------- // --- record @@ -199,7 +199,7 @@ void MidiChannelStrip::songChanged(int val) void MidiChannelStrip::heartBeat() { - float a = track->meter(0); // fast_log10(track->meter(0)) * .2f; + double a = track->meter(0); // fast_log10(track->meter(0)) * .2f; slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack } @@ -210,7 +210,7 @@ void MidiChannelStrip::heartBeat() void MidiChannelStrip::controllerChanged(int id) { - float val = float(track->ctrlVal(id).i); + double val = double(track->ctrlVal(id).i); switch (id) { case CTRL_VOLUME: @@ -246,7 +246,7 @@ void MidiChannelStrip::controllerChanged(int id) // called when user changes controller //--------------------------------------------------------- -void MidiChannelStrip::ctrlChanged(float val, int num) +void MidiChannelStrip::ctrlChanged(double val, int num) { int ival = int(val); CVal cval; @@ -509,7 +509,7 @@ void MidiStrip::songChanged(int val) void MidiStrip::heartBeat() { - float a = track->meter(0); // fast_log10(track->meter(0)) * .2f; + double a = track->meter(0); // fast_log10(track->meter(0)) * .2f; meter->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack } @@ -716,10 +716,10 @@ MidiOutPortStrip::MidiOutPortStrip(Mixer* m, MidiOutPort* t, bool align) controllerChanged(CTRL_MASTER_VOLUME); - connect(slider, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(slider, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int))); connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int))); - connect(sl, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); layout->addWidget(sl); //--------------------------------------------------- @@ -808,7 +808,7 @@ void MidiOutPortStrip::songChanged(int val) void MidiOutPortStrip::heartBeat() { - float a = track->meter(0); // fast_log10(track->meter(0)) * .2f; + double a = track->meter(0); // fast_log10(track->meter(0)) * .2f; slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack } @@ -817,7 +817,7 @@ void MidiOutPortStrip::heartBeat() // ctrlChanged //--------------------------------------------------------- -void MidiOutPortStrip::ctrlChanged(float val, int num) +void MidiOutPortStrip::ctrlChanged(double val, int num) { int ival = int(val); CVal cval; @@ -910,7 +910,7 @@ void MidiOutPortStrip::autoWriteToggled(bool val) void MidiOutPortStrip::controllerChanged(int id) { if (id == CTRL_MASTER_VOLUME) { - float val = float(track->ctrlVal(id).i); + double val = double(track->ctrlVal(id).i); if (!volumeTouched) slider->setValue(val); sl->setValue(val); @@ -1141,7 +1141,7 @@ void MidiInPortStrip::songChanged(int val) void MidiInPortStrip::heartBeat() { - float a = track->meter(0); // fast_log10(track->meter(0)) * .2f; + double a = track->meter(0); // fast_log10(track->meter(0)) * .2f; meter->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack } @@ -1366,10 +1366,10 @@ MidiSyntiStrip::MidiSyntiStrip(Mixer* m, MidiSynti* t, bool align) sl->setFont(*config.fonts[1]); sl->setFixedWidth(STRIP_WIDTH-2); - connect(slider, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(slider, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); connect(slider, SIGNAL(sliderPressed(int)), SLOT(sliderPressed(int))); connect(slider, SIGNAL(sliderReleased(int)), SLOT(sliderReleased(int))); - connect(sl, SIGNAL(valueChanged(float,int)), SLOT(ctrlChanged(float, int))); + connect(sl, SIGNAL(valueChanged(double,int)), SLOT(ctrlChanged(double, int))); layout->addWidget(sl); //--------------------------------------------------- @@ -1458,7 +1458,7 @@ void MidiSyntiStrip::songChanged(int val) void MidiSyntiStrip::heartBeat() { - float a = track->meter(0); // fast_log10(track->meter(0)) * .2f; + double a = track->meter(0); // fast_log10(track->meter(0)) * .2f; slider->setMeterVal(a * 0.008); track->setMeter(0, a * 0.8); // hack } @@ -1467,7 +1467,7 @@ void MidiSyntiStrip::heartBeat() // ctrlChanged //--------------------------------------------------------- -void MidiSyntiStrip::ctrlChanged(float val, int num) +void MidiSyntiStrip::ctrlChanged(double val, int num) { int ival = int(val); CVal cval; @@ -1560,7 +1560,7 @@ void MidiSyntiStrip::autoWriteToggled(bool val) void MidiSyntiStrip::controllerChanged(int id) { if (id == CTRL_MASTER_VOLUME) { - float val = float(track->ctrlVal(id).i); + double val = double(track->ctrlVal(id).i); if (!volumeTouched) slider->setValue(val); sl->setValue(val); diff --git a/muse/muse/mixer/mstrip.h b/muse/muse/mixer/mstrip.h index c42dfe94..cfec0183 100644 --- a/muse/muse/mixer/mstrip.h +++ b/muse/muse/mixer/mstrip.h @@ -80,7 +80,7 @@ class MidiChannelStrip : public Strip { private slots: virtual void controllerChanged(int id); - void ctrlChanged(float val, int num); + void ctrlChanged(double val, int num); void muteToggled(bool); void soloToggled(bool); void autoChanged(); @@ -116,7 +116,7 @@ class MidiOutPortStrip : public Strip { private slots: virtual void controllerChanged(int id); - void ctrlChanged(float val, int num); + void ctrlChanged(double val, int num); void muteToggled(bool); void soloToggled(bool); void autoChanged(); @@ -153,7 +153,7 @@ class MidiSyntiStrip : public Strip { private slots: virtual void controllerChanged(int id); - void ctrlChanged(float val, int num); + void ctrlChanged(double val, int num); void muteToggled(bool); void soloToggled(bool); void autoChanged(); diff --git a/muse/muse/mixer/rack.cpp b/muse/muse/mixer/rack.cpp index 863a788a..f8e5526f 100644 --- a/muse/muse/mixer/rack.cpp +++ b/muse/muse/mixer/rack.cpp @@ -389,7 +389,7 @@ void EffectRack::initPlugin(QDomNode &node, int idx) //QString name = e.attribute("name"); // currently this value is just thrown. QString value = e.attribute("val"); QLocale::setDefault(QLocale::C); - float val = value.toFloat(); + double val = value.toFloat(); CVal cval; cval.f = val; song->setControllerVal(plugi->track(), plugi->controller(i), cval); diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index 73def94a..50387659 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -442,7 +442,7 @@ void MusE::setupTransportToolbar(QToolBar* tb) const MusE::MusE() : QMainWindow() { -// setupUi(this); + setWindowIcon(*museIcon); setIconSize(ICON_SIZE); setFocusPolicy(Qt::WheelFocus); @@ -746,19 +746,19 @@ MusE::MusE() tr_id = menuView->addAction(QIcon(*view_transport_windowIcon), tr("Transport Panel")); tr_id->setCheckable(true); - connect(tr_id, SIGNAL(toggled(bool)), this, SLOT(showTransport(bool))); + connect(tr_id, SIGNAL(triggered(bool)), this, SLOT(showTransport(bool))); bt_id = menuView->addAction(QIcon(*view_bigtime_windowIcon), tr("Bigtime window")); bt_id->setCheckable(true); - connect(bt_id, SIGNAL(toggled(bool)), this, SLOT(showBigtime(bool))); + connect(bt_id, SIGNAL(triggered(bool)), this, SLOT(showBigtime(bool))); aid1a = menuView->addAction(QIcon(*mixerSIcon), tr("Mixer 1")); aid1a->setCheckable(true); - connect(aid1a, SIGNAL(toggled(bool)), this, SLOT(showMixer1(bool))); + connect(aid1a, SIGNAL(triggered(bool)), this, SLOT(showMixer1(bool))); aid1b = menuView->addAction(QIcon(*mixerSIcon), tr("Mixer 2")); aid1b->setCheckable(true); - connect(aid1b, SIGNAL(toggled(bool)), this, SLOT(showMixer2(bool))); + connect(aid1b, SIGNAL(triggered(bool)), this, SLOT(showMixer2(bool))); mk_id = menuView->addAction(QIcon(*view_markerIcon), tr("Marker")); mk_id->setCheckable(true); - connect(mk_id , SIGNAL(toggled(bool)), this, SLOT(showMarker(bool))); + connect(mk_id , SIGNAL(triggered(bool)), this, SLOT(showMarker(bool))); //------------------------------------------------------------- // Structure @@ -1022,6 +1022,7 @@ MusE::MusE() initMidiSynth(); transport = new Transport; + transport->hide(); connect(transport, SIGNAL(closed()), SLOT(transportClosed())); QClipboard* cb = QApplication::clipboard(); @@ -1158,6 +1159,7 @@ void MusE::loadProject1(const QString& path) w->close(); } emit startLoadSong(); + song->setProjectPath(path); song->clear(false); song->setCreated(newProject); @@ -1166,6 +1168,8 @@ void MusE::loadProject1(const QString& path) QFile f(s); + song->blockSignals(true); + bool rv = true; if (f.open(QIODevice::ReadOnly)) { rv = song->read(&f); @@ -1192,14 +1196,9 @@ void MusE::loadProject1(const QString& path) QString msg(tr("File <%1> read error")); QMessageBox::critical(this, header, msg.arg(s)); } - tr_id->setChecked(config.transportVisible); bt_id->setChecked(config.bigTimeVisible); - // - // dont emit song->update(): - song->blockSignals(true); - showBigtime(config.bigTimeVisible); showMixer1(config.mixer1Visible); showMixer2(config.mixer2Visible); @@ -1207,17 +1206,13 @@ void MusE::loadProject1(const QString& path) mixer1->setUpdateMixer(); if (mixer2 && config.mixer2Visible) mixer2->setUpdateMixer(); - resize(config.geometryMain.size()); move(config.geometryMain.topLeft()); - if (config.transportVisible) transport->show(); transport->move(config.geometryTransport.topLeft()); showTransport(config.transportVisible); - song->blockSignals(false); - transport->setMasterFlag(song->masterFlag()); punchinAction->setChecked(song->punchin()); punchoutAction->setChecked(song->punchout()); @@ -2990,7 +2985,6 @@ int main(int argc, char* argv[]) song = new Song(); muse = new MusE(); app.setMuse(muse); - muse->setWindowIcon(*museIcon); //--------------------------------------------------- // load project @@ -3103,7 +3097,6 @@ int main(int argc, char* argv[]) muse->loadProject(path); muse->changeConfig(false); - if (!debugMode) { if (mlockall(MCL_CURRENT | MCL_FUTURE)) perror("WARNING: Cannot lock memory:"); diff --git a/muse/muse/plugin.cpp b/muse/muse/plugin.cpp index 09cdf555..7f6459c1 100644 --- a/muse/muse/plugin.cpp +++ b/muse/muse/plugin.cpp @@ -447,7 +447,7 @@ PluginI::~PluginI() // range //--------------------------------------------------------- -void LadspaPlugin::range(int i, float* min, float* max) const +void LadspaPlugin::range(int i, double* min, double* max) const { i = pIdx[i]; LADSPA_PortRangeHint range = plugin->PortRangeHints[i]; @@ -457,7 +457,7 @@ void LadspaPlugin::range(int i, float* min, float* max) const *max = 1.0; return; } - float m = (desc & LADSPA_HINT_SAMPLE_RATE) ? float(AL::sampleRate) : 1.0f; + double m = (desc & LADSPA_HINT_SAMPLE_RATE) ? float(AL::sampleRate) : 1.0f; if (desc & LADSPA_HINT_BOUNDED_BELOW) *min = range.LowerBound * m; @@ -600,7 +600,7 @@ void PluginI::setChannels(int c) // defaultValue //--------------------------------------------------------- -float LadspaPlugin::defaultValue(int k) const +double LadspaPlugin::defaultValue(int k) const { k = pIdx[k]; return ladspaDefaultValue(plugin, k); @@ -804,7 +804,7 @@ void PluginI::deactivate() // setParam //--------------------------------------------------------- -void PluginI::setParam(int idx, float val) +void PluginI::setParam(int idx, double val) { if (_gui) _gui->updateValue(idx, val); diff --git a/muse/muse/plugin.h b/muse/muse/plugin.h index 08e61f4d..1f7a6a98 100644 --- a/muse/muse/plugin.h +++ b/muse/muse/plugin.h @@ -67,7 +67,7 @@ class Plugin { virtual PluginIF* createPIF(PluginI*) = 0; - virtual void range(int, float* min, float* max) const { + virtual void range(int, double* min, double* max) const { *min = 0.0f; *max = 1.0f; } @@ -81,7 +81,7 @@ class Plugin { virtual bool isLog(int) const { return false; } virtual bool isBool(int) const { return false; } virtual bool isInt(int) const { return false; } - virtual float defaultValue(int) const { return 0.0f; } + virtual double defaultValue(int) const { return 0.0f; } }; //--------------------------------------------------------- @@ -117,7 +117,7 @@ class LadspaPlugin : public Plugin { virtual QString copyright() const { return QString(plugin->Copyright); } void* instantiate(); - virtual void range(int i, float*, float*) const; + virtual void range(int i, double*, double*) const; virtual int parameter() const { return _parameter; } virtual int inports() const { return _inports; } virtual int outports() const { return _outports; } @@ -137,7 +137,7 @@ class LadspaPlugin : public Plugin { LADSPA_PortRangeHint r = plugin->PortRangeHints[pIdx[k]]; return LADSPA_IS_HINT_INTEGER(r.HintDescriptor); } - virtual float defaultValue(int) const; + virtual double defaultValue(int) const; }; //--------------------------------------------------------- @@ -179,7 +179,7 @@ class PluginIF { virtual void activate() = 0; virtual void deactivate() = 0; virtual void cleanup() = 0; - virtual void setParam(int i, float val) = 0; + virtual void setParam(int i, double val) = 0; virtual float param(int i) const = 0; virtual const char* getParameterName(int) const { return ""; } virtual const char* getParameterLabel(int) const { return 0; } @@ -216,7 +216,7 @@ class LadspaPluginIF : public PluginIF { virtual const char* getParameterName(int i) const { return plugin->plugin->PortNames[plugin->pIdx[i]]; } - virtual void setParam(int i, float val) { controls[i].val = val; } + virtual void setParam(int i, double val) { controls[i].val = val; } virtual float param(int i) const { return controls[i].val; } bool init(Plugin*); }; @@ -285,17 +285,17 @@ class PluginI { void setControllerList(Ctrl* cl) { controllerList.push_back(cl); } Ctrl* controller(int idx) const { return controllerList[idx]; } bool setParameter(const QString& s, double val); - void setParam(int i, float val); - float param(int i) const { return pif[0]->param(i); } + void setParam(int i, double val); + double param(int i) const { return pif[0]->param(i); } const char* getParameterName(int i) const { return pif[0]->getParameterName(i); } const char* getParameterLabel(int i) const { return pif[0]->getParameterLabel(i); } const char* getParameterDisplay(int i, float v) const { return pif[0]->getParameterDisplay(i, v); } - void range(int i, float* min, float* max) const { + void range(int i, double* min, double* max) const { _plugin->range(i, min, max); } - float defaultValue(int i) const { return _plugin->defaultValue(i); } + double defaultValue(int i) const { return _plugin->defaultValue(i); } bool inPlaceCapable() const { return _plugin->inPlaceCapable(); } bool isLog(int k) const { return _plugin->isLog(k); } @@ -313,7 +313,6 @@ class PluginI { class Pipeline : public QList<PluginI*> { public: Pipeline() {} -// void insert(PluginI* p, int index); bool isOn(int idx) const; void setOn(int, bool); QString label(int idx) const; @@ -325,7 +324,6 @@ class Pipeline : public QList<PluginI*> { void showNativeGui(int, bool); void apply(int ports, unsigned long nframes, float** buffer); void move(int idx, bool up); -// bool empty(int idx) const; void setChannels(int); PluginI* plugin(int idx) { return value(idx); } }; diff --git a/muse/muse/plugingui.cpp b/muse/muse/plugingui.cpp index 2bc0929f..a811dc36 100644 --- a/muse/muse/plugingui.cpp +++ b/muse/muse/plugingui.cpp @@ -398,12 +398,12 @@ printf("build gui from ui <path><%s>\n", path.toLatin1().data()); int h = fm.height() + 4; for (int i = 0; i < n; ++i) { - float lower; - float upper; - float dlower; - float dupper; - float val = plugin->param(i); - float dval = val; + double lower; + double upper; + double dlower; + double dupper; + double val = plugin->param(i); + double dval = val; plugin->range(i, &lower, &upper); dlower = lower; @@ -433,7 +433,7 @@ printf("build gui from ui <path><%s>\n", path.toLatin1().data()); w.type = GuiWidget::CHECKBOX; gw.push_back(w); grid->addWidget(cb, i, 0, 1, 3); - connect(cb, SIGNAL(valueChanged(float,int)), SLOT(setController(float, int))); + connect(cb, SIGNAL(valueChanged(double,int)), SLOT(setController(double, int))); } else { QLabel* label = new QLabel(QString(plugin->getParameterName(i)), mw); @@ -474,8 +474,8 @@ printf("build gui from ui <path><%s>\n", path.toLatin1().data()); grid->addWidget(l, i, 2); } grid->addWidget(s, i, 3); - connect(s, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); - connect(e, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); + connect(s, SIGNAL(valueChanged(double,int)), SLOT(setController(double,int))); + connect(e, SIGNAL(valueChanged(double,int)), SLOT(setController(double,int))); } updateValue(i, val); } @@ -506,24 +506,24 @@ void PluginGui::connectPrebuiltGui(QWidget* wContainer) GuiWidget w; w.widget = (QWidget*)obj; if (strcmp(obj->metaObject()->className(), "Awl::Slider") == 0) { - connect((Slider*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); + connect((Slider*)obj, SIGNAL(valueChanged(double,int)), SLOT(setController(double,int))); w.type = GuiWidget::SLIDER; w.parameter = ((Slider*)obj)->id(); } else if (strcmp(obj->metaObject()->className(), "Awl::FloatEntry") == 0) { - connect((FloatEntry*)obj, SIGNAL(valueChanged(float,int)), SLOT(setController(float,int))); + connect((FloatEntry*)obj, SIGNAL(valueChanged(double,int)), SLOT(setController(double,int))); w.type = GuiWidget::FLOAT_ENTRY; w.parameter = ((FloatEntry*)obj)->id(); } else if (strcmp(obj->metaObject()->className(), "Awl::CheckBox") == 0) { w.type = GuiWidget::CHECKBOX; w.parameter = ((CheckBox*)obj)->id(); - connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float, int))); + connect(obj, SIGNAL(valueChanged(double, int)), SLOT(setController(double, int))); } else if (strcmp(obj->metaObject()->className(), "Awl::ComboBox") == 0) { w.type = GuiWidget::COMBOBOX; w.parameter = ((ComboBox*)obj)->id(); - connect(obj, SIGNAL(valueChanged(float, int)), SLOT(setController(float,int))); + connect(obj, SIGNAL(valueChanged(double, int)), SLOT(setController(double,int))); } else { printf("PluginGui::unknown widget class %s\n", obj->metaObject()->className()); @@ -546,7 +546,7 @@ PluginGui::~PluginGui() // setController //--------------------------------------------------------- -void PluginGui::setController(float val, int param) +void PluginGui::setController(double val, int param) { if (plugin->isInt(param)) val = rint(val); @@ -669,7 +669,7 @@ void PluginGui::setOn(bool val) // updateValue //--------------------------------------------------------- -void PluginGui::updateValue(int parameter, float value) +void PluginGui::updateValue(int parameter, double value) { for (std::vector<GuiWidget>::iterator i = gw.begin(); i != gw.end(); ++i) { int idx = i->parameter; @@ -706,7 +706,7 @@ void PluginGui::updateValues() { int n = plugin->plugin()->parameter(); for (int i = 0; i < n; ++i) { - float val = plugin->param(i); + double val = plugin->param(i); updateValue(i, val); } } @@ -717,7 +717,7 @@ void PluginGui::updateValues() void PluginGui::controllerChanged(int id) { - float value = plugin->track()->ctrlVal(id).f; + double value = plugin->track()->ctrlVal(id).f; for (std::vector<GuiWidget>::iterator i = gw.begin(); i != gw.end(); ++i) { int idx = i->parameter; if (plugin->controller(idx)->id() != id) diff --git a/muse/muse/plugingui.h b/muse/muse/plugingui.h index 71c58a91..3dac942c 100644 --- a/muse/muse/plugingui.h +++ b/muse/muse/plugingui.h @@ -72,14 +72,14 @@ class PluginGui : public QMainWindow { void save(); void bypassToggled(bool); - void setController(float, int); + void setController(double, int); void autoChanged(); public: PluginGui(PluginI*); ~PluginGui(); void setOn(bool); - void updateValue(int, float); + void updateValue(int, double); void updateValues(); public slots: diff --git a/muse/muse/songfile.cpp b/muse/muse/songfile.cpp index efd30fcb..c719ceb3 100644 --- a/muse/muse/songfile.cpp +++ b/muse/muse/songfile.cpp @@ -141,7 +141,7 @@ void Song::read(QDomNode node) QString tag(e.tagName()); int i = e.text().toInt(); if (tag == "configuration") - readConfiguration(node.firstChild()); + ; // readConfiguration(node.firstChild()); else if (tag == "master") setMasterFlag(i); else if (tag == "loop") diff --git a/muse/muse/synth.cpp b/muse/muse/synth.cpp index 0c2285c6..5d1a959c 100644 --- a/muse/muse/synth.cpp +++ b/muse/muse/synth.cpp @@ -135,9 +135,11 @@ Synth::Synth(const QFileInfo* fi, QString s) void* MessSynth::instantiate(const QString& instanceName) { ++_instances; - const char* path = strdup(info.filePath().toLatin1().data()); + const char* path = strdup(info.filePath().toAscii().data()); // load Synti dll + if (debugMsg) + printf(" load synti <%s>\n", path); // void* handle = dlopen(path, RTLD_NOW); void* handle = dlopen(path, RTLD_LAZY); if (handle == 0) { @@ -448,8 +450,8 @@ void SynthI::read(QDomNode node) if (initInstance(s)) return; song->insertTrack0(this, -1); - showGui(startGui); setGeometry(r.x(), r.y(), r.width(), r.height()); + showGui(startGui); } //--------------------------------------------------------- diff --git a/muse/muse/track.cpp b/muse/muse/track.cpp index a12890b9..5ed7fc87 100644 --- a/muse/muse/track.cpp +++ b/muse/muse/track.cpp @@ -532,7 +532,7 @@ void Track::setController(Pos pos, int id, int v) setController(pos, id, val); } -void Track::setController(Pos pos, int id, float v) +void Track::setController(Pos pos, int id, double v) { CVal val; val.f = v; @@ -802,13 +802,13 @@ void MidiTrackBase::addPlugin(MidiPluginI* plugin, int idx) for (int i = 0; i < ncontroller; ++i) { int id = (idx + 1) * 0x1000 + i; QString name(plugin->getParameterName(i)); - float min, max; + double min, max; plugin->range(i, &min, &max); Ctrl* cl = getController(id); if (cl == 0) { cl = new Ctrl(id, name); cl->setRange(min, max); - float defaultValue = plugin->defaultValue(i); + double defaultValue = plugin->defaultValue(i); cl->setDefault(defaultValue); cl->setCurVal(defaultValue); addController(cl); diff --git a/muse/muse/track.h b/muse/muse/track.h index c4146276..2a051a06 100644 --- a/muse/muse/track.h +++ b/muse/muse/track.h @@ -126,8 +126,8 @@ class Track : public QObject { bool _monitor; int _channels; // 1 - mono, 2 - stereo CtrlRecList _recEvents; // recorded automation events - float _meter[MAX_CHANNELS]; - float _peak[MAX_CHANNELS]; + double _meter[MAX_CHANNELS]; + double _peak[MAX_CHANNELS]; int _peakTimer[MAX_CHANNELS]; bool _locked; // true if parts are locked to frames bool _selected; @@ -262,21 +262,21 @@ class Track : public QObject { void resetMeter(); void resetPeaks(); static void resetAllMeter(); - float meter(int ch) const { return _meter[ch]; } + double meter(int ch) const { return _meter[ch]; } void addMidiMeter(int velo) { _meter[0] += velo/5; if (_meter[0] > 127.0f) _meter[0] = 127.0f; } - float peak(int ch) const { return _peak[ch]; } - void setPeak(int ch, float v) { _peak[ch] = v; } + double peak(int ch) const { return _peak[ch]; } + void setPeak(int ch, double v) { _peak[ch] = v; } void resetPeak(int ch) { _peak[ch] = 0; _peakTimer[ch] = 0; } int peakTimer(int ch) const { return _peakTimer[ch]; } void setPeakTimer(int ch, int v) { _peakTimer[ch] = v; } - void setMeter(int ch, float v) { + void setMeter(int ch, double v) { _meter[ch] = v; if (v > _peak[ch]) { _peak[ch] = v; diff --git a/muse/synti/organ/organ.cpp b/muse/synti/organ/organ.cpp index dc8e9fe4..f2196493 100644 --- a/muse/synti/organ/organ.cpp +++ b/muse/synti/organ/organ.cpp @@ -153,8 +153,8 @@ static inline float table_pos (float* table, unsigned long freq_256, unsigned *a bool Organ::init(const char* name) { gui = new OrganGui; + gui->hide(); gui->setWindowTitle(QString(name)); - gui->show(); for (int i = 0; i < NUM_CONTROLLER; ++i) setController(0, synthCtrl[i].num, synthCtrl[i].val); |