=== modified file 'mixxx/src/audiotagger.cpp' --- mixxx/src/audiotagger.cpp 2012-01-07 05:48:41 +0000 +++ mixxx/src/audiotagger.cpp 2013-01-12 12:02:15 +0000 @@ -21,8 +21,7 @@ #include #include -AudioTagger::AudioTagger (QString file) -{ +AudioTagger::AudioTagger (QString file) { m_artist = ""; m_title = ""; m_genre = ""; @@ -37,76 +36,53 @@ m_file = file; } -AudioTagger::~AudioTagger ( ) -{ - +AudioTagger::~AudioTagger ( ) { } - -void AudioTagger::setArtist (QString artist ) -{ +void AudioTagger::setArtist (QString artist ) { m_artist = artist; } - - -void AudioTagger::setTitle (QString title ) -{ +void AudioTagger::setTitle (QString title ) { m_title = title; } - - -void AudioTagger::setAlbum (QString album ) -{ +void AudioTagger::setAlbum (QString album ) { m_album = album; } - - -void AudioTagger::setGenre (QString genre ) -{ +void AudioTagger::setGenre (QString genre ) { m_genre = genre; } - -void AudioTagger::setComposer (QString composer ) -{ +void AudioTagger::setComposer (QString composer ) { m_composer = composer; } - -void AudioTagger::setYear (QString year ) -{ +void AudioTagger::setYear (QString year ) { m_year = year; } - - -void AudioTagger::setComment (QString comment ) -{ +void AudioTagger::setComment (QString comment ) { m_comment = comment; } -void AudioTagger::setKey (QString key ) -{ +void AudioTagger::setKey (QString key ) { m_key = key; } -void AudioTagger::setBpm (QString bpm ) -{ +void AudioTagger::setBpm (QString bpm ) { m_bpm = bpm; } -void AudioTagger::setTracknumber (QString tracknumber ) -{ +void AudioTagger::setTracknumber (QString tracknumber ) { m_tracknumber = tracknumber; } -bool AudioTagger::save () -{ + +bool AudioTagger::save () { TagLib::File* file = NULL; - if(m_file.endsWith(".mp3", Qt::CaseInsensitive)){ + if (m_file.endsWith(".mp3", Qt::CaseInsensitive)) { file = new TagLib::MPEG::File(m_file.toUtf8().constData()); //process special ID3 fields, APEv2 fiels, etc @@ -116,25 +92,25 @@ addAPETag( ((TagLib::MPEG::File*) file)->APETag(false) ); } - if(m_file.endsWith(".m4a", Qt::CaseInsensitive)){ + if (m_file.endsWith(".m4a", Qt::CaseInsensitive)) { file = new TagLib::MP4::File(m_file.toUtf8().constData()); //process special ID3 fields, APEv2 fiels, etc processMP4Tag(((TagLib::MP4::File*) file)->tag()); } - if(m_file.endsWith(".ogg", Qt::CaseInsensitive)){ + if (m_file.endsWith(".ogg", Qt::CaseInsensitive)) { file = new TagLib::Ogg::Vorbis::File(m_file.toUtf8().constData()); //process special ID3 fields, APEv2 fiels, etc addXiphComment( ((TagLib::Ogg::Vorbis::File*) file)->tag() ); } - if(m_file.endsWith(".wav", Qt::CaseInsensitive)){ + if (m_file.endsWith(".wav", Qt::CaseInsensitive)) { file = new TagLib::RIFF::WAV::File(m_file.toUtf8().constData()); //If the flac has no ID3v2 tag, we create a new one and add the TBPM and TKEY frame addID3v2Tag( ((TagLib::RIFF::WAV::File*) file)->tag() ); } - if(m_file.endsWith(".flac", Qt::CaseInsensitive)){ + if (m_file.endsWith(".flac", Qt::CaseInsensitive)) { file = new TagLib::FLAC::File(m_file.toUtf8().constData()); //If the flac has no ID3v2 tag, we create a new one and add the TBPM and TKEY frame @@ -143,7 +119,7 @@ addXiphComment( ((TagLib::FLAC::File*) file)->xiphComment (true) ); } - if(m_file.endsWith(".aif", Qt::CaseInsensitive) || m_file.endsWith(".aiff", Qt::CaseInsensitive)){ + if (m_file.endsWith(".aif", Qt::CaseInsensitive) || m_file.endsWith(".aiff", Qt::CaseInsensitive)) { file = new TagLib::RIFF::AIFF::File(m_file.toUtf8().constData()); //If the flac has no ID3v2 tag, we create a new one and add the TBPM and TKEY frame addID3v2Tag( ((TagLib::RIFF::AIFF::File*) file)->tag() ); @@ -151,20 +127,19 @@ } //process standard tags - if(file){ + if (file) { TagLib::Tag *tag = file->tag(); - if (tag) - { + if (tag) { tag->setArtist(m_artist.toStdString()); tag->setTitle(m_title.toStdString()); tag->setAlbum(m_album.toStdString()); tag->setGenre(m_genre.toStdString()); tag->setComment(m_comment.toStdString()); uint year = m_year.toUInt(); - if(year > 0) + if (year > 0) tag->setYear(year); uint tracknumber = m_tracknumber.toUInt(); - if(tracknumber > 0) + if (tracknumber > 0) tag->setTrack(tracknumber); } @@ -174,33 +149,25 @@ qDebug() << "Successfully updated metadata of track " << m_file; } else { qDebug() << "Could not update metadata of track " << m_file; - } + } //delete file and return delete file; return success; - } - else{ + } else { return false; } - - } -void AudioTagger::addID3v2Tag(TagLib::ID3v2::Tag* id3v2) -{ - if(!id3v2) return; + +void AudioTagger::addID3v2Tag(TagLib::ID3v2::Tag* id3v2) { + if (!id3v2) + return; TagLib::ID3v2::FrameList bpmFrame = id3v2->frameListMap()["TBPM"]; - if (!bpmFrame.isEmpty()) - { + if (!bpmFrame.isEmpty()) { bpmFrame.front()->setText(m_bpm.toStdString()); - - } - else - { - /* - * add new frame TextIdentificationFrame which is responsible for TKEY and TBPM - * see http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1ID3v2_1_1TextIdentificationFrame.html - */ + } else { + // add new frame TextIdentificationFrame which is responsible for TKEY and TBPM + // see http://developer.kde.org/~wheeler/taglib/api/classTagLib_1_1ID3v2_1_1TextIdentificationFrame.html TagLib::ID3v2::TextIdentificationFrame* newFrame = new TagLib::ID3v2::TextIdentificationFrame("TBPM", TagLib::String::Latin1); @@ -210,13 +177,9 @@ } TagLib::ID3v2::FrameList keyFrame = id3v2->frameListMap()["TKEY"]; - if (!keyFrame.isEmpty()) - { + if (!keyFrame.isEmpty()) { keyFrame.front()->setText(m_key.toStdString()); - - } - else - { + } else { //add new frame TagLib::ID3v2::TextIdentificationFrame* newFrame = new TagLib::ID3v2::TextIdentificationFrame("TKEY", TagLib::String::Latin1); @@ -226,12 +189,9 @@ } TagLib::ID3v2::FrameList composerFrame = id3v2->frameListMap()["TCOM"]; - if (!composerFrame.isEmpty()) - { + if (!composerFrame.isEmpty()) { composerFrame.front()->setText(m_composer.toStdString()); - } - else - { + } else { //add new frame TagLib::ID3v2::TextIdentificationFrame* newFrame = new TagLib::ID3v2::TextIdentificationFrame( @@ -240,27 +200,25 @@ id3v2->addFrame(newFrame); } } -void AudioTagger::addAPETag(TagLib::APE::Tag* ape) -{ - if(!ape) return; - /* - * Adds to the item specified by key the data value. - * If replace is true, then all of the other values on the same key will be removed first. - */ + +void AudioTagger::addAPETag(TagLib::APE::Tag* ape) { + if (!ape) + return; + // Adds to the item specified by key the data value. + // If replace is true, then all of the other values on the same key will be removed first. ape->addValue("BPM",m_bpm.toStdString(), true); ape->addValue("BPM",m_bpm.toStdString(), true); ape->addValue("Composer",m_composer.toStdString(), true); } -void AudioTagger::addXiphComment(TagLib::Ogg::XiphComment* xiph) -{ - if(!xiph) return; +void AudioTagger::addXiphComment(TagLib::Ogg::XiphComment* xiph) { + if (!xiph) + return; // Some tools use "BPM" so check for that. - /* Taglib does not support the update of Vorbis comments. - * thus, we have to reomve the old comment and add the new one - */ + // Taglib does not support the update of Vorbis comments. + // thus, we have to reomve the old comment and add the new one xiph->removeField("BPM"); xiph->addField("BPM", m_bpm.toStdString()); @@ -275,10 +233,8 @@ xiph->removeField("COMPOSER"); xiph->addField("COMPOSER", m_key.toStdString()); } -void AudioTagger::processMP4Tag(TagLib::MP4::Tag* mp4) -{ +void AudioTagger::processMP4Tag(TagLib::MP4::Tag* mp4) { //TODO - } === modified file 'mixxx/src/controllers/controllerlearningeventfilter.cpp' --- mixxx/src/controllers/controllerlearningeventfilter.cpp 2012-04-27 07:47:21 +0000 +++ mixxx/src/controllers/controllerlearningeventfilter.cpp 2013-01-12 12:02:15 +0000 @@ -27,9 +27,7 @@ WSliderComposed* pSlider = dynamic_cast(pObject); bool has_right_click_reset = pKnob || pSlider; - if (pEvent->type() == QEvent::KeyPress) { - QKeyEvent* keyEvent = reinterpret_cast(pEvent); - } else if (pEvent->type() == QEvent::MouseButtonPress) { + if (pEvent->type() == QEvent::MouseButtonPress) { QMouseEvent* mouseEvent = reinterpret_cast(pEvent); qDebug() << "MouseButtonPress" << pWidget; @@ -46,7 +44,6 @@ } else { qDebug() << "No control bound to left-click for" << pWidget; } - } if (mouseEvent->button() & Qt::RightButton) { if (info.rightClickControl) { @@ -78,19 +75,17 @@ } } } else if (pEvent->type() == QEvent::MouseButtonRelease) { - QMouseEvent* mouseEvent = reinterpret_cast(pEvent); qDebug() << "MouseButtonRelease" << pWidget; } else if (pEvent->type() == QEvent::MouseMove) { - QMouseEvent* mouseEvent = reinterpret_cast(pEvent); qDebug() << "MouseMoveEvent" << pWidget; } return false; } -void ControllerLearningEventFilter::addWidgetClickInfo( - QWidget* pWidget, Qt::MouseButton buttonState, - ControlObject* pControl, - ControlObjectThreadWidget::EmitOption emitOption) { +void ControllerLearningEventFilter::addWidgetClickInfo(QWidget* pWidget, + Qt::MouseButton buttonState, + ControlObject* pControl, + ControlObjectThreadWidget::EmitOption emitOption) { ControlInfo& info = m_widgetControlInfo[pWidget]; if (buttonState == Qt::LeftButton) { === modified file 'mixxx/src/controllers/midi/midicontroller.cpp' --- mixxx/src/controllers/midi/midicontroller.cpp 2012-12-14 07:18:22 +0000 +++ mixxx/src/controllers/midi/midicontroller.cpp 2013-01-12 12:02:15 +0000 @@ -58,6 +58,7 @@ bool MidiController::matchPreset(const PresetInfo& preset) { // Product info mapping not implemented for MIDI devices yet + Q_UNUSED(preset); return false; } === modified file 'mixxx/src/controllers/qtscript-bytearray/bytearrayclass.cpp' --- mixxx/src/controllers/qtscript-bytearray/bytearrayclass.cpp 2012-02-06 19:06:55 +0000 +++ mixxx/src/controllers/qtscript-bytearray/bytearrayclass.cpp 2013-01-12 12:02:15 +0000 @@ -1,284 +1,257 @@ - /**************************************************************************** - ** - ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - ** All rights reserved. - ** Contact: Nokia Corporation (qt-info@nokia.com) - ** - ** This file is part of the examples of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:BSD$ - ** You may use this file under the terms of the BSD license as follows: - ** - ** "Redistribution and use in source and binary forms, with or without - ** modification, are permitted provided that the following conditions are - ** met: - ** * Redistributions of source code must retain the above copyright - ** notice, this list of conditions and the following disclaimer. - ** * Redistributions in binary form must reproduce the above copyright - ** notice, this list of conditions and the following disclaimer in - ** the documentation and/or other materials provided with the - ** distribution. - ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor - ** the names of its contributors may be used to endorse or promote - ** products derived from this software without specific prior written - ** permission. - ** - ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - - #include - #include - #include "bytearrayclass.h" - #include "bytearrayprototype.h" - - #include - - Q_DECLARE_METATYPE(QByteArray*) - Q_DECLARE_METATYPE(ByteArrayClass*) - - class ByteArrayClassPropertyIterator : public QScriptClassPropertyIterator - { - public: - ByteArrayClassPropertyIterator(const QScriptValue &object); - ~ByteArrayClassPropertyIterator(); - - bool hasNext() const; - void next(); - - bool hasPrevious() const; - void previous(); - - void toFront(); - void toBack(); - - QScriptString name() const; - uint id() const; - - private: - int m_index; - int m_last; - }; - - ByteArrayClass::ByteArrayClass(QScriptEngine *engine) - : QObject(engine), QScriptClass(engine) - { - qScriptRegisterMetaType(engine, toScriptValue, fromScriptValue); - - length = engine->toStringHandle(QLatin1String("length")); - - proto = engine->newQObject(new ByteArrayPrototype(this), - QScriptEngine::QtOwnership, - QScriptEngine::SkipMethodsInEnumeration - | QScriptEngine::ExcludeSuperClassMethods - | QScriptEngine::ExcludeSuperClassProperties); - QScriptValue global = engine->globalObject(); - proto.setPrototype(global.property("Object").property("prototype")); - - ctor = engine->newFunction(construct, proto); - ctor.setData(engine->toScriptValue(this)); - } - - ByteArrayClass::~ByteArrayClass() - { - } - - QScriptClass::QueryFlags ByteArrayClass::queryProperty(const QScriptValue &object, - const QScriptString &name, - QueryFlags flags, uint *id) - { - QByteArray *ba = qscriptvalue_cast(object.data()); - if (!ba) - return 0; - if (name == length) { - return flags; - } else { - bool isArrayIndex; - qint32 pos = name.toArrayIndex(&isArrayIndex); - if (!isArrayIndex) - return 0; - *id = pos; - if ((flags & HandlesReadAccess) && (pos >= ba->size())) - flags &= ~HandlesReadAccess; - return flags; - } - } - - QScriptValue ByteArrayClass::property(const QScriptValue &object, - const QScriptString &name, uint id) - { - QByteArray *ba = qscriptvalue_cast(object.data()); - if (!ba) - return QScriptValue(); - if (name == length) { - return ba->length(); - } else { - qint32 pos = id; - if ((pos < 0) || (pos >= ba->size())) - return QScriptValue(); - return uint(ba->at(pos)) & 255; - } - return QScriptValue(); - } - - void ByteArrayClass::setProperty(QScriptValue &object, - const QScriptString &name, - uint id, const QScriptValue &value) - { - QByteArray *ba = qscriptvalue_cast(object.data()); - if (!ba) - return; - if (name == length) { - resize(*ba, value.toInt32()); - } else { - qint32 pos = id; - if (pos < 0) - return; - if (ba->size() <= pos) - resize(*ba, pos + 1); - (*ba)[pos] = char(value.toInt32()); - } - } - - QScriptValue::PropertyFlags ByteArrayClass::propertyFlags( - const QScriptValue &/*object*/, const QScriptString &name, uint /*id*/) - { - if (name == length) { - return QScriptValue::Undeletable - | QScriptValue::SkipInEnumeration; - } - return QScriptValue::Undeletable; - } - - QScriptClassPropertyIterator *ByteArrayClass::newIterator(const QScriptValue &object) - { - return new ByteArrayClassPropertyIterator(object); - } - - QString ByteArrayClass::name() const - { - return QLatin1String("ByteArray"); - } - - QScriptValue ByteArrayClass::prototype() const - { - return proto; - } - - QScriptValue ByteArrayClass::constructor() - { - return ctor; - } - - QScriptValue ByteArrayClass::newInstance(int size) - { +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "bytearrayclass.h" +#include "bytearrayprototype.h" + +#include + +Q_DECLARE_METATYPE(QByteArray*) +Q_DECLARE_METATYPE(ByteArrayClass*) + +class ByteArrayClassPropertyIterator : public QScriptClassPropertyIterator { + public: + ByteArrayClassPropertyIterator(const QScriptValue &object); + ~ByteArrayClassPropertyIterator(); + + bool hasNext() const; + void next(); + + bool hasPrevious() const; + void previous(); + + void toFront(); + void toBack(); + + QScriptString name() const; + uint id() const; + + private: + int m_index; + int m_last; +}; + +ByteArrayClass::ByteArrayClass(QScriptEngine *engine) + : QObject(engine), QScriptClass(engine) { + qScriptRegisterMetaType(engine, toScriptValue, fromScriptValue); + + length = engine->toStringHandle(QLatin1String("length")); + + proto = engine->newQObject(new ByteArrayPrototype(this), + QScriptEngine::QtOwnership, + QScriptEngine::SkipMethodsInEnumeration + | QScriptEngine::ExcludeSuperClassMethods + | QScriptEngine::ExcludeSuperClassProperties); + QScriptValue global = engine->globalObject(); + proto.setPrototype(global.property("Object").property("prototype")); + + ctor = engine->newFunction(construct, proto); + ctor.setData(engine->toScriptValue(this)); +} + +ByteArrayClass::~ByteArrayClass() { +} + +QScriptClass::QueryFlags ByteArrayClass::queryProperty(const QScriptValue &object, + const QScriptString &name, + QueryFlags flags, uint *id) { + QByteArray *ba = qscriptvalue_cast(object.data()); + if (!ba) + return 0; + if (name == length) { + return flags; + } else { + bool isArrayIndex; + qint32 pos = name.toArrayIndex(&isArrayIndex); + if (!isArrayIndex) + return 0; + *id = pos; + if ((flags & HandlesReadAccess) && (pos >= ba->size())) + flags &= ~HandlesReadAccess; + return flags; + } +} + +QScriptValue ByteArrayClass::property(const QScriptValue &object, + const QScriptString &name, uint id) { + QByteArray *ba = qscriptvalue_cast(object.data()); + if (!ba) + return QScriptValue(); + if (name == length) { + return ba->length(); + } else { + qint32 pos = id; + if ((pos < 0) || (pos >= ba->size())) + return QScriptValue(); + return uint(ba->at(pos)) & 255; + } + return QScriptValue(); +} + +void ByteArrayClass::setProperty(QScriptValue &object, + const QScriptString &name, + uint id, const QScriptValue &value) { + QByteArray *ba = qscriptvalue_cast(object.data()); + if (!ba) + return; + if (name == length) { + resize(*ba, value.toInt32()); + } else { + qint32 pos = id; + if (pos < 0) + return; + if (ba->size() <= pos) + resize(*ba, pos + 1); + (*ba)[pos] = char(value.toInt32()); + } +} + +QScriptValue::PropertyFlags ByteArrayClass::propertyFlags( + const QScriptValue &/*object*/, const QScriptString &name, uint /*id*/) { + if (name == length) { + return QScriptValue::Undeletable + | QScriptValue::SkipInEnumeration; + } + return QScriptValue::Undeletable; +} + +QScriptClassPropertyIterator *ByteArrayClass::newIterator(const QScriptValue &object) { + return new ByteArrayClassPropertyIterator(object); +} + +QString ByteArrayClass::name() const { + return QLatin1String("ByteArray"); +} + +QScriptValue ByteArrayClass::prototype() const { + return proto; +} + +QScriptValue ByteArrayClass::constructor() { + return ctor; +} + +QScriptValue ByteArrayClass::newInstance(int size) { // engine()->reportAdditionalMemoryCost(size); // Requires Qt 4.7 - return newInstance(QByteArray(size, /*ch=*/0)); - } - - QScriptValue ByteArrayClass::newInstance(const QByteArray &ba) - { - QScriptValue data = engine()->newVariant(QVariant::fromValue(ba)); - return engine()->newObject(this, data); - } - - QScriptValue ByteArrayClass::construct(QScriptContext *ctx, QScriptEngine *) - { - ByteArrayClass *cls = qscriptvalue_cast(ctx->callee().data()); - if (!cls) - return QScriptValue(); - QScriptValue arg = ctx->argument(0); - if (arg.instanceOf(ctx->callee())) - return cls->newInstance(qscriptvalue_cast(arg)); - int size = arg.toInt32(); - return cls->newInstance(size); - } - - QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray &ba) - { - QScriptValue ctor = eng->globalObject().property("ByteArray"); - ByteArrayClass *cls = qscriptvalue_cast(ctor.data()); - if (!cls) - return eng->newVariant(QVariant::fromValue(ba)); - return cls->newInstance(ba); - } - - void ByteArrayClass::fromScriptValue(const QScriptValue &obj, QByteArray &ba) - { - ba = qvariant_cast(obj.data().toVariant()); - } - - void ByteArrayClass::resize(QByteArray &ba, int newSize) - { - int oldSize = ba.size(); - ba.resize(newSize); -/* if (newSize > oldSize) - engine()->reportAdditionalMemoryCost(newSize - oldSize);*/ // Requires Qt 4.7 - } - - ByteArrayClassPropertyIterator::ByteArrayClassPropertyIterator(const QScriptValue &object) - : QScriptClassPropertyIterator(object) - { - toFront(); - } - - ByteArrayClassPropertyIterator::~ByteArrayClassPropertyIterator() - { - } - - bool ByteArrayClassPropertyIterator::hasNext() const - { - QByteArray *ba = qscriptvalue_cast(object().data()); - return m_index < ba->size(); - } - - void ByteArrayClassPropertyIterator::next() - { - m_last = m_index; - ++m_index; - } - - bool ByteArrayClassPropertyIterator::hasPrevious() const - { - return (m_index > 0); - } - - void ByteArrayClassPropertyIterator::previous() - { - --m_index; - m_last = m_index; - } - - void ByteArrayClassPropertyIterator::toFront() - { - m_index = 0; - m_last = -1; - } - - void ByteArrayClassPropertyIterator::toBack() - { - QByteArray *ba = qscriptvalue_cast(object().data()); - m_index = ba->size(); - m_last = -1; - } - - QScriptString ByteArrayClassPropertyIterator::name() const - { - return object().engine()->toStringHandle(QString::number(m_last)); - } - - uint ByteArrayClassPropertyIterator::id() const - { - return m_last; - } \ No newline at end of file + return newInstance(QByteArray(size, /*ch=*/0)); +} + +QScriptValue ByteArrayClass::newInstance(const QByteArray &ba) { + QScriptValue data = engine()->newVariant(QVariant::fromValue(ba)); + return engine()->newObject(this, data); +} + +QScriptValue ByteArrayClass::construct(QScriptContext *ctx, QScriptEngine *) { + ByteArrayClass *cls = qscriptvalue_cast(ctx->callee().data()); + if (!cls) + return QScriptValue(); + QScriptValue arg = ctx->argument(0); + if (arg.instanceOf(ctx->callee())) + return cls->newInstance(qscriptvalue_cast(arg)); + int size = arg.toInt32(); + return cls->newInstance(size); +} + +QScriptValue ByteArrayClass::toScriptValue(QScriptEngine *eng, const QByteArray &ba) { + QScriptValue ctor = eng->globalObject().property("ByteArray"); + ByteArrayClass *cls = qscriptvalue_cast(ctor.data()); + if (!cls) + return eng->newVariant(QVariant::fromValue(ba)); + return cls->newInstance(ba); +} + +void ByteArrayClass::fromScriptValue(const QScriptValue &obj, QByteArray &ba) { + ba = qvariant_cast(obj.data().toVariant()); +} + +void ByteArrayClass::resize(QByteArray &ba, int newSize) { + ba.resize(newSize); + //int oldSize = ba.size(); + //if (newSize > oldSize) + //engine()->reportAdditionalMemoryCost(newSize - oldSize); // Requires Qt 4.7 +} + +ByteArrayClassPropertyIterator::ByteArrayClassPropertyIterator(const QScriptValue &object) + : QScriptClassPropertyIterator(object) { + toFront(); +} + +ByteArrayClassPropertyIterator::~ByteArrayClassPropertyIterator() { +} + +bool ByteArrayClassPropertyIterator::hasNext() const { + QByteArray *ba = qscriptvalue_cast(object().data()); + return m_index < ba->size(); +} + +void ByteArrayClassPropertyIterator::next() { + m_last = m_index; + ++m_index; +} + +bool ByteArrayClassPropertyIterator::hasPrevious() const { + return (m_index > 0); +} + +void ByteArrayClassPropertyIterator::previous() { + --m_index; + m_last = m_index; +} + +void ByteArrayClassPropertyIterator::toFront() { + m_index = 0; + m_last = -1; +} + +void ByteArrayClassPropertyIterator::toBack() { + QByteArray *ba = qscriptvalue_cast(object().data()); + m_index = ba->size(); + m_last = -1; +} + +QScriptString ByteArrayClassPropertyIterator::name() const { + return object().engine()->toStringHandle(QString::number(m_last)); +} + +uint ByteArrayClassPropertyIterator::id() const { + return m_last; +} === modified file 'mixxx/src/dlgprefcontrolsdlg.ui' --- mixxx/src/dlgprefcontrolsdlg.ui 2012-11-22 07:10:05 +0000 +++ mixxx/src/dlgprefcontrolsdlg.ui 2013-01-12 12:02:15 +0000 @@ -15,7 +15,7 @@ - + === modified file 'mixxx/src/dlgprefreplaygain.cpp' --- mixxx/src/dlgprefreplaygain.cpp 2012-11-16 04:38:16 +0000 +++ mixxx/src/dlgprefreplaygain.cpp 2013-01-12 12:02:15 +0000 @@ -112,9 +112,7 @@ void DlgPrefReplayGain::slotApply() { m_COTInitialBoost.slotSet(SliderBoost->value()); int iRGenabled = 0; - int iRGAnalyserEnabled = 0; if (EnableGain->isChecked()) iRGenabled = 1; - if (EnableAnalyser->isChecked()) iRGAnalyserEnabled = 1; m_COTEnabled.slotSet(iRGenabled); } === modified file 'mixxx/src/dlgprefreplaygain.h' --- mixxx/src/dlgprefreplaygain.h 2011-03-30 06:00:45 +0000 +++ mixxx/src/dlgprefreplaygain.h 2013-01-12 12:02:15 +0000 @@ -11,36 +11,33 @@ #include "configobject.h" #include "controlobjectthread.h" - class QWidget; class DlgPrefReplayGain: public QWidget, public Ui::DlgPrefReplayGainDlg { Q_OBJECT -public: + public: DlgPrefReplayGain(QWidget *parent, ConfigObject *_config); ~DlgPrefReplayGain(); -public slots: -/** Update initial gain increment */ -void slotUpdateBoost(); -void slotSetRGEnabled(); -void slotSetRGAnalyserEnabled(); - -void slotApply(); -void slotUpdate(); -void setDefaults(); -signals: -void apply(const QString &); -private: - -// Determines whether or not to gray out the preferences -void loadSettings(); - -/** Pointer to config object */ -ConfigObject *config; - -ControlObjectThread m_COTInitialBoost; -ControlObjectThread m_COTEnabled; - + public slots: + // Update initial gain increment + void slotUpdateBoost(); + void slotSetRGEnabled(); + void slotSetRGAnalyserEnabled(); + + void slotApply(); + void slotUpdate(); + void setDefaults(); + signals: + void apply(const QString &); + private: + // Determines whether or not to gray out the preferences + void loadSettings(); + + // Pointer to config object + ConfigObject *config; + + ControlObjectThread m_COTInitialBoost; + ControlObjectThread m_COTEnabled; }; === modified file 'mixxx/src/engine/bpmcontrol.cpp' --- mixxx/src/engine/bpmcontrol.cpp 2012-12-03 06:52:05 +0000 +++ mixxx/src/engine/bpmcontrol.cpp 2013-01-12 12:02:15 +0000 @@ -455,6 +455,7 @@ } void BpmControl::trackUnloaded(TrackPointer pTrack) { + Q_UNUSED(pTrack); if (m_pTrack) { disconnect(m_pTrack.data(), SIGNAL(beatsUpdated()), this, SLOT(slotUpdatedTrackBeats())); === modified file 'mixxx/src/engine/cuecontrol.cpp' --- mixxx/src/engine/cuecontrol.cpp 2012-11-30 20:26:42 +0000 +++ mixxx/src/engine/cuecontrol.cpp 2013-01-12 12:02:15 +0000 @@ -15,9 +15,9 @@ CueControl::CueControl(const char * _group, ConfigObject * _config) : EngineControl(_group, _config), + m_bHotcueCancel(false), m_bPreviewing(false), m_bPreviewingHotcue(false), - m_bHotcueCancel(false), m_pPlayButton(ControlObject::getControl(ConfigKey(_group, "play"))), m_iCurrentlyPreviewingHotcues(0), m_iNumHotCues(NUM_HOT_CUES), === modified file 'mixxx/src/engine/engineworkerscheduler.cpp' --- mixxx/src/engine/engineworkerscheduler.cpp 2011-11-09 04:30:24 +0000 +++ mixxx/src/engine/engineworkerscheduler.cpp 2013-01-12 12:02:15 +0000 @@ -44,6 +44,7 @@ } void EngineWorkerScheduler::workerStarted(EngineWorker* pWorker) { + Q_UNUSED(pWorker); } void EngineWorkerScheduler::workerFinished(EngineWorker* pWorker) { === modified file 'mixxx/src/engine/quantizecontrol.cpp' --- mixxx/src/engine/quantizecontrol.cpp 2012-05-01 05:59:37 +0000 +++ mixxx/src/engine/quantizecontrol.cpp 2013-01-12 12:02:15 +0000 @@ -48,6 +48,7 @@ } void QuantizeControl::trackUnloaded(TrackPointer pTrack) { + Q_UNUSED(pTrack); if (m_pTrack) { disconnect(m_pTrack.data(), SIGNAL(beatsUpdated()), this, SLOT(slotBeatsUpdated())); @@ -69,6 +70,9 @@ const double currentSample, const double totalSamples, const int iBufferSize) { + Q_UNUSED(dRate); + Q_UNUSED(totalSamples); + Q_UNUSED(iBufferSize); int iCurrentSample = currentSample; if (!even(iCurrentSample)) { iCurrentSample--; === modified file 'mixxx/src/engine/vinylcontrolcontrol.cpp' --- mixxx/src/engine/vinylcontrolcontrol.cpp 2012-05-01 05:59:37 +0000 +++ mixxx/src/engine/vinylcontrolcontrol.cpp 2013-01-12 12:02:15 +0000 @@ -58,6 +58,7 @@ } void VinylControlControl::trackUnloaded(TrackPointer pTrack) { + Q_UNUSED(pTrack); m_pCurrentTrack.clear(); } === modified file 'mixxx/src/library/browse/browsetablemodel.cpp' --- mixxx/src/library/browse/browsetablemodel.cpp 2012-11-25 09:33:00 +0000 +++ mixxx/src/library/browse/browsetablemodel.cpp 2013-01-12 12:02:15 +0000 @@ -381,6 +381,8 @@ } QAbstractItemDelegate* BrowseTableModel::delegateForColumn(const int i, QObject* pParent) { + Q_UNUSED(i); + Q_UNUSED(pParent); return NULL; } === modified file 'mixxx/src/library/librarycontrol.cpp' --- mixxx/src/library/librarycontrol.cpp 2012-11-30 06:10:10 +0000 +++ mixxx/src/library/librarycontrol.cpp 2013-01-12 12:02:15 +0000 @@ -109,6 +109,7 @@ } void LibraryControl::bindWidget(WLibrary* pLibraryWidget, MixxxKeyboard* pKeyboard) { + Q_UNUSED(pKeyboard); if (m_pLibraryWidget != NULL) { disconnect(m_pLibraryWidget, 0, this, 0); } === modified file 'mixxx/src/library/proxytrackmodel.cpp' --- mixxx/src/library/proxytrackmodel.cpp 2012-11-25 09:33:00 +0000 +++ mixxx/src/library/proxytrackmodel.cpp 2013-01-12 12:02:15 +0000 @@ -11,8 +11,8 @@ // ProxyTrackModel proxies settings requests to the composed TrackModel, // don't initialize its TrackModel with valid parameters. : TrackModel(QSqlDatabase(), ""), - m_bHandleSearches(bHandleSearches), - m_currentSearch("") { + m_currentSearch(""), + m_bHandleSearches(bHandleSearches) { m_pTrackModel = dynamic_cast(pTrackModel); Q_ASSERT(m_pTrackModel && pTrackModel); setSourceModel(pTrackModel); === modified file 'mixxx/src/library/searchqueryparser.cpp' --- mixxx/src/library/searchqueryparser.cpp 2012-09-14 02:34:24 +0000 +++ mixxx/src/library/searchqueryparser.cpp 2013-01-12 12:02:15 +0000 @@ -66,6 +66,7 @@ } bool SearchQueryParser::parseFuzzyMatch(QString field, QStringList* output) const { + Q_UNUSED(output); if (field == "bpm") { // Look up the current track's bpms and add something like // "bpm > X AND bpm" < Y to 'output' @@ -206,6 +207,10 @@ // key. The handling here will depend on how we represent the keys in the // database but it should ideally automatically deal with all the different // representations there are for keys. + Q_UNUSED(field); + Q_UNUSED(argument); + Q_UNUSED(tokens); + Q_UNUSED(output); return false; } === modified file 'mixxx/src/library/songdownloader.cpp' --- mixxx/src/library/songdownloader.cpp 2011-12-18 20:23:14 +0000 +++ mixxx/src/library/songdownloader.cpp 2013-01-12 12:02:15 +0000 @@ -5,30 +5,26 @@ #define TEMP_EXTENSION ".tmp" -SongDownloader::SongDownloader(QObject* parent) : QObject(parent) -{ +SongDownloader::SongDownloader(QObject* parent) : QObject(parent) { qDebug() << "SongDownloader constructed"; - + m_pNetwork = new QNetworkAccessManager(); m_pDownloadedFile = NULL; m_pRequest = NULL; //connect(m_pNetwork, SIGNAL(finished(QNetworkReply*)), // this, SLOT(finishedSlot(QNetworkReply*))); - } -SongDownloader::~SongDownloader() -{ +SongDownloader::~SongDownloader() { delete m_pNetwork; - + delete m_pDownloadedFile; m_pDownloadedFile = NULL; delete m_pRequest; m_pRequest = NULL; } -bool SongDownloader::downloadSongFromURL(QUrl& url) -{ +bool SongDownloader::downloadSongFromURL(QUrl& url) { qDebug() << "SongDownloader::downloadSongFromURL()"; m_downloadQueue.enqueue(url); @@ -38,8 +34,7 @@ } -bool SongDownloader::downloadFromQueue() -{ +bool SongDownloader::downloadFromQueue() { QUrl downloadUrl = m_downloadQueue.dequeue(); //Extract the filename from the URL path QString filename = downloadUrl.path(); @@ -47,13 +42,12 @@ filename = fileInfo.fileName(); m_pDownloadedFile = new QFile(filename + TEMP_EXTENSION); - if (!m_pDownloadedFile->open(QIODevice::WriteOnly)) - { + if (!m_pDownloadedFile->open(QIODevice::WriteOnly)) { //TODO: Error qDebug() << "Failed to open" << m_pDownloadedFile->fileName(); return false; } - + qDebug() << "SongDownloader: setting up download stuff"; m_pRequest = new QNetworkRequest(downloadUrl); @@ -65,55 +59,51 @@ connect(m_pReply, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); connect(m_pReply, SIGNAL(error(QNetworkReply::NetworkError)), - this, SLOT(slotError(QNetworkReply::NetworkError))); + this, SLOT(slotError(QNetworkReply::NetworkError))); connect(m_pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(slotProgress(qint64, qint64))); connect(m_pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(downloadProgress(qint64, qint64))); connect(m_pReply, SIGNAL(finished()), - this, SLOT(slotDownloadFinished())); + this, SLOT(slotDownloadFinished())); return true; } -void SongDownloader::slotReadyRead() -{ +void SongDownloader::slotReadyRead() { //Magic. Isn't this how C++ is supposed to work? //m_pDownloadedFile << m_pReply; - //Update: :( - + //Update: :( + //QByteArray buffer; - while (m_pReply->bytesAvailable() > 0) - { + while (m_pReply->bytesAvailable() > 0) { qDebug() << "downloading..."; m_pDownloadedFile->write(m_pReply->read(512)); } } -void SongDownloader::slotError(QNetworkReply::NetworkError error) -{ +void SongDownloader::slotError(QNetworkReply::NetworkError error) { + Q_UNUSED(error); qDebug() << "SongDownloader: Network error while trying to download a plugin."; - + //Delete partial file m_pDownloadedFile->remove(); emit(downloadError()); } -void SongDownloader::slotProgress( qint64 bytesReceived, qint64 bytesTotal ) -{ +void SongDownloader::slotProgress( qint64 bytesReceived, qint64 bytesTotal ) { qDebug() << bytesReceived << "/" << bytesTotal; emit(downloadProgress(bytesReceived, bytesTotal)); } -void SongDownloader::slotDownloadFinished() -{ +void SongDownloader::slotDownloadFinished() { qDebug() << "SongDownloader: Download finished!"; //Finish up with the reply and close the file handle m_pReply->deleteLater(); m_pDownloadedFile->close(); - //Chop off the .tmp from the filename + //Chop off the .tmp from the filename QFileInfo info(*m_pDownloadedFile); QString filenameWithoutTmp = info.absoluteFilePath(); filenameWithoutTmp.chop(QString(TEMP_EXTENSION).length()); @@ -127,18 +117,13 @@ downloadFromQueue(); } - { - //XXX: Add the song to the My Downloads crate - - - //Emit this signal when all the files have been downloaded. - emit(downloadFinished()); - } + //XXX: Add the song to the My Downloads crate + //Emit this signal when all the files have been downloaded. + emit(downloadFinished()); } /* -void SongDownloader::finishedSlot(QNetworkReply* reply) -{ +void SongDownloader::finishedSlot(QNetworkReply* reply) { if (reply->error() == QNetworkReply::NoError) { qDebug() << "SongDownloader: finishedSlot, no error"; === modified file 'mixxx/src/mathstuff.h' --- mixxx/src/mathstuff.h 2013-01-01 12:21:44 +0000 +++ mixxx/src/mathstuff.h 2013-01-12 12:02:15 +0000 @@ -19,10 +19,10 @@ #ifndef MATHSTUFF_H #define MATHSTUFF_H +#include +#include + #include "defs.h" -#include -#include - CSAMPLE besseli(CSAMPLE); int sign(CSAMPLE); === modified file 'mixxx/src/soundmanagerutil.cpp' --- mixxx/src/soundmanagerutil.cpp 2011-12-18 20:23:14 +0000 +++ mixxx/src/soundmanagerutil.cpp 2013-01-12 12:02:15 +0000 @@ -276,6 +276,10 @@ } } +AudioOutput::~AudioOutput() { + +} + /** * Writes this AudioOutput's data to an XML element, preallocated from an XML * DOM document. @@ -339,6 +343,10 @@ } } +AudioInput::~AudioInput() { + +} + /** * Writes this AudioInput's data to an XML element, preallocated from an XML * DOM document. === modified file 'mixxx/src/soundmanagerutil.h' --- mixxx/src/soundmanagerutil.h 2011-05-30 06:04:23 +0000 +++ mixxx/src/soundmanagerutil.h 2013-01-12 12:02:15 +0000 @@ -92,6 +92,7 @@ public: AudioOutput(AudioPathType type = INVALID, unsigned char channelBase = 0, unsigned char index = 0); + virtual ~AudioOutput(); QDomElement toXML(QDomElement *element) const; static AudioOutput fromXML(const QDomElement &xml); static QList getSupportedTypes(); @@ -109,6 +110,7 @@ public: AudioInput(AudioPathType type = INVALID, unsigned char channelBase = 0, unsigned char index = 0); + virtual ~AudioInput(); QDomElement toXML(QDomElement *element) const; static AudioInput fromXML(const QDomElement &xml); static QList getSupportedTypes(); === modified file 'mixxx/src/soundsourcemp3.cpp' --- mixxx/src/soundsourcemp3.cpp 2012-09-06 07:15:26 +0000 +++ mixxx/src/soundsourcemp3.cpp 2013-01-12 12:17:32 +0000 @@ -396,20 +396,16 @@ decode the chosen number of samples and discard */ -unsigned long SoundSourceMp3::discard(unsigned long samples_wanted) -{ +unsigned long SoundSourceMp3::discard(unsigned long samples_wanted) { unsigned long Total_samples_decoded = 0; - int no; + int no = 0; - if(rest > 0) + if (rest > 0) Total_samples_decoded += 2*(Synth->pcm.length-rest); - while (Total_samples_decoded < samples_wanted) - { - if(mad_frame_decode(Frame,Stream)) - { - if(MAD_RECOVERABLE(Stream->error)) - { + while (Total_samples_decoded < samples_wanted) { + if (mad_frame_decode(Frame,Stream)) { + if (MAD_RECOVERABLE(Stream->error)) { continue; } else if(Stream->error==MAD_ERROR_BUFLEN) { break; @@ -423,10 +419,9 @@ } if (Synth->pcm.length > no) - rest = no; + rest = no; else - rest = -1; - + rest = -1; return Total_samples_decoded; } === modified file 'mixxx/src/track/beats.h' --- mixxx/src/track/beats.h 2012-05-07 05:30:14 +0000 +++ mixxx/src/track/beats.h 2013-01-12 12:02:15 +0000 @@ -11,6 +11,7 @@ class BeatIterator { public: + virtual ~BeatIterator() {} virtual bool hasNext() const = 0; virtual double next() = 0; }; === modified file 'mixxx/src/vamp/vampanalyser.cpp' --- mixxx/src/vamp/vampanalyser.cpp 2012-12-22 08:17:20 +0000 +++ mixxx/src/vamp/vampanalyser.cpp 2013-01-12 12:45:44 +0000 @@ -141,7 +141,7 @@ qDebug() << "Please copy libmixxxminimal.so from build dir to one of the following:"; std::vector path = PluginHostAdapter::getPluginPath(); - for (int i = 0; i < path.size(); i++) { + for (unsigned int i = 0; i < path.size(); i++) { qDebug() << QString::fromStdString(path[i]); } return false; @@ -304,12 +304,14 @@ } bool VampAnalyser::SetParameter(const QString parameter, const double value) { + Q_UNUSED(parameter); + Q_UNUSED(value); return true; } -void VampAnalyser::SelectOutput(int outputnumber) { +void VampAnalyser::SelectOutput(const int outputnumber) { Plugin::OutputList outputs = m_plugin->getOutputDescriptors(); - if (outputnumber >= 0 && outputnumber < outputs.size()) { + if (outputnumber >= 0 && outputnumber < int(outputs.size())) { m_iOutput = outputnumber; } } === modified file 'mixxx/src/widget/wdisplay.cpp' --- mixxx/src/widget/wdisplay.cpp 2010-11-01 05:12:23 +0000 +++ mixxx/src/widget/wdisplay.cpp 2013-01-12 12:25:58 +0000 @@ -23,49 +23,41 @@ #include #include -WDisplay::WDisplay(QWidget * parent) : WWidget(parent) -{ +WDisplay::WDisplay(QWidget * parent) : WWidget(parent) { m_pPixmaps = 0; setPositions(0); } -WDisplay::~WDisplay() -{ +WDisplay::~WDisplay() { resetPositions(); } -void WDisplay::setup(QDomNode node) -{ +void WDisplay::setup(QDomNode node) { // Number of states setPositions(selectNodeInt(node, "NumberStates")); // Load knob pixmaps QString path = selectNodeQString(node, "Path"); - for (int i=0; i0) - { + if (m_iNoPos>0) { m_pPixmaps = new QPixmap*[m_iNoPos]; for (int i=0; isize()); } -void WDisplay::paintEvent(QPaintEvent *) -{ - if (m_pPixmaps>0) - { +void WDisplay::paintEvent(QPaintEvent *) { + if (m_pPixmaps) { int idx = (int)(m_fValue*(float)(m_iNoPos)/128.); // Range check if (idx>(m_iNoPos-1)) @@ -100,6 +89,3 @@ } } } - - - === modified file 'mixxx/src/widget/wlibrarytableview.cpp' --- mixxx/src/widget/wlibrarytableview.cpp 2012-06-03 14:37:44 +0000 +++ mixxx/src/widget/wlibrarytableview.cpp 2013-01-12 12:02:15 +0000 @@ -52,6 +52,7 @@ } void WLibraryTableView::setup(QDomNode node) { + Q_UNUSED(node); } void WLibraryTableView::loadVScrollBarPosState() { === modified file 'mixxx/src/widget/wlibrarytextbrowser.cpp' --- mixxx/src/widget/wlibrarytextbrowser.cpp 2011-03-22 16:24:04 +0000 +++ mixxx/src/widget/wlibrarytextbrowser.cpp 2013-01-12 12:02:15 +0000 @@ -35,11 +35,10 @@ } void WLibraryTextBrowser::onSearch(const QString& text) { - + Q_UNUSED(text); } void WLibraryTextBrowser::onSearchStarting() { - } void WLibraryTextBrowser::onSearchCleared() { @@ -56,8 +55,10 @@ void WLibraryTextBrowser::loadSelectedTrackToGroup(QString group) { // Not applicable to text views + Q_UNUSED(group); } void WLibraryTextBrowser::moveSelection(int delta) { // Not applicable to text views + Q_UNUSED(delta); } === modified file 'mixxx/src/widget/wslidercomposed.cpp' --- mixxx/src/widget/wslidercomposed.cpp 2013-01-02 19:48:52 +0000 +++ mixxx/src/widget/wslidercomposed.cpp 2013-01-12 12:22:15 +0000 @@ -28,22 +28,20 @@ WSliderComposed::WSliderComposed(QWidget * parent) : WAbstractControl(parent), - m_pSlider(NULL), - m_pHandle(NULL), + m_iSliderLength(0), + m_iHandleLength(0), m_bHorizontal(false), m_bEventWhileDrag(true), m_bDrag(false), - m_iSliderLength(0), - m_iHandleLength(0) { + m_pSlider(NULL), + m_pHandle(NULL) { } -WSliderComposed::~WSliderComposed() -{ +WSliderComposed::~WSliderComposed() { unsetPixmaps(); } -void WSliderComposed::setup(QDomNode node) -{ +void WSliderComposed::setup(QDomNode node) { // Setup pixmaps QString pathSlider = getPath(selectNodeQString(node, "Slider")); QString pathHandle = getPath(selectNodeQString(node, "Handle")); @@ -58,8 +56,7 @@ m_bEventWhileDrag = false; } -void WSliderComposed::setPixmaps(bool bHorizontal, const QString &filenameSlider, const QString &filenameHandle) -{ +void WSliderComposed::setPixmaps(bool bHorizontal, const QString &filenameSlider, const QString &filenameHandle) { m_bHorizontal = bHorizontal; unsetPixmaps(); m_pSlider = WPixmapStore::getPixmap(filenameSlider); @@ -91,8 +88,7 @@ } } -void WSliderComposed::unsetPixmaps() -{ +void WSliderComposed::unsetPixmaps() { if (m_pSlider) { WPixmapStore::deletePixmap(m_pSlider); m_pSlider = NULL; @@ -103,8 +99,7 @@ } } -void WSliderComposed::mouseMoveEvent(QMouseEvent * e) -{ +void WSliderComposed::mouseMoveEvent(QMouseEvent * e) { if (!m_bRightButtonPressed) { if (m_bHorizontal) m_iPos = e->x()-m_iHandleLength/2; @@ -138,8 +133,7 @@ } } -void WSliderComposed::wheelEvent(QWheelEvent *e) -{ +void WSliderComposed::wheelEvent(QWheelEvent *e) { double wheelDirection = ((QWheelEvent *)e)->delta() / 120.; double newValue = getValue() + (wheelDirection); this->updateValue(newValue); @@ -149,10 +143,8 @@ //e->ignore(); } -void WSliderComposed::mouseReleaseEvent(QMouseEvent * e) -{ - if (!m_bEventWhileDrag) - { +void WSliderComposed::mouseReleaseEvent(QMouseEvent * e) { + if (!m_bEventWhileDrag) { mouseMoveEvent(e); if (e->button()==Qt::RightButton) @@ -166,24 +158,17 @@ m_bRightButtonPressed = false; } -void WSliderComposed::mousePressEvent(QMouseEvent * e) -{ - if (!m_bEventWhileDrag) - { +void WSliderComposed::mousePressEvent(QMouseEvent * e) { + if (!m_bEventWhileDrag) { m_iStartMousePos = 0; m_iStartHandlePos = 0; mouseMoveEvent(e); m_bDrag = true; - } - else - { - if (e->button() == Qt::RightButton) - { + } else { + if (e->button() == Qt::RightButton) { emit(valueReset()); m_bRightButtonPressed = true; - } - else - { + } else { if (m_bHorizontal) m_iStartMousePos = e->x()-m_iHandleLength/2; else @@ -194,20 +179,15 @@ } } -void WSliderComposed::paintEvent(QPaintEvent *) -{ - if (m_pSlider && m_pHandle) - { +void WSliderComposed::paintEvent(QPaintEvent *) { + if (m_pSlider && m_pHandle) { QPainter p(this); int posx; int posy; - if (m_bHorizontal) - { + if (m_bHorizontal) { posx = m_iPos; posy = 0; - } - else - { + } else { posx = 0; posy = m_iPos; } @@ -218,10 +198,8 @@ } } -void WSliderComposed::setValue(double fValue) -{ - if (!m_bDrag) - { +void WSliderComposed::setValue(double fValue) { + if (!m_bDrag) { // Set value without emitting a valueChanged signal, and force display update m_fValue = fValue; === modified file 'mixxx/src/widget/wtrackproperty.cpp' --- mixxx/src/widget/wtrackproperty.cpp 2011-03-31 03:17:07 +0000 +++ mixxx/src/widget/wtrackproperty.cpp 2013-01-12 12:02:15 +0000 @@ -25,6 +25,7 @@ } void WTrackProperty::slotTrackUnloaded(TrackPointer track) { + Q_UNUSED(track); if (m_pCurrentTrack) { disconnect(m_pCurrentTrack.data(), 0, this, 0); } === modified file 'mixxx/src/widget/wtracktext.cpp' --- mixxx/src/widget/wtracktext.cpp 2010-09-19 18:34:11 +0000 +++ mixxx/src/widget/wtracktext.cpp 2013-01-12 12:02:15 +0000 @@ -15,5 +15,6 @@ } void WTrackText::slotTrackUnloaded(TrackPointer track) { + Q_UNUSED(track); m_pLabel->setText(""); } === modified file 'mixxx/src/widget/wvumeter.cpp' --- mixxx/src/widget/wvumeter.cpp 2013-01-02 19:48:52 +0000 +++ mixxx/src/widget/wvumeter.cpp 2013-01-12 12:23:44 +0000 @@ -33,12 +33,12 @@ WVuMeter::WVuMeter(QWidget * parent) : WWidget(parent), + m_iNoPos(0), m_pPixmapBack(NULL), m_pPixmapVu(NULL), m_iPeakHoldSize(0), m_iPeakPos(0), - m_iPeakHoldCountdown(0), - m_iNoPos(0) { + m_iPeakHoldCountdown(0) { } WVuMeter::~WVuMeter() === modified file 'mixxx/src/widget/wwaveformviewer.cpp' --- mixxx/src/widget/wwaveformviewer.cpp 2012-11-20 21:24:37 +0000 +++ mixxx/src/widget/wwaveformviewer.cpp 2013-01-12 12:02:15 +0000 @@ -15,7 +15,7 @@ #include "controlpotmeter.h" -WWaveformViewer::WWaveformViewer(const char *group, ConfigObject* pConfig, QWidget * parent, Qt::WFlags f) +WWaveformViewer::WWaveformViewer(const char *group, ConfigObject* pConfig, QWidget * parent) : QWidget(parent), m_pGroup(group), m_pConfig(pConfig) { === modified file 'mixxx/src/widget/wwaveformviewer.h' --- mixxx/src/widget/wwaveformviewer.h 2012-11-20 21:24:37 +0000 +++ mixxx/src/widget/wwaveformviewer.h 2013-01-12 12:02:15 +0000 @@ -19,7 +19,7 @@ class WWaveformViewer : public QWidget { Q_OBJECT public: - WWaveformViewer(const char *group, ConfigObject* pConfig, QWidget *parent=0, Qt::WFlags f = 0); + WWaveformViewer(const char *group, ConfigObject* pConfig, QWidget *parent=0); virtual ~WWaveformViewer(); const char* getGroup() const { return m_pGroup;} === modified file 'mixxx/src/xmlparse.cpp' --- mixxx/src/xmlparse.cpp 2012-03-14 03:09:37 +0000 +++ mixxx/src/xmlparse.cpp 2013-01-12 12:02:15 +0000 @@ -15,29 +15,23 @@ #include #include -XmlParse::XmlParse() -{ -} - -XmlParse::~XmlParse() -{ -} - -int XmlParse::selectNodeInt(const QDomNode &nodeHeader, const QString sNode) -{ +XmlParse::XmlParse() { +} + +XmlParse::~XmlParse() { +} + +int XmlParse::selectNodeInt(const QDomNode &nodeHeader, const QString sNode) { return selectNode(nodeHeader, sNode).toElement().text().toInt(); } -float XmlParse::selectNodeFloat(const QDomNode &nodeHeader, const QString sNode) -{ +float XmlParse::selectNodeFloat(const QDomNode &nodeHeader, const QString sNode) { return selectNode(nodeHeader, sNode).toElement().text().toFloat(); } -QDomNode XmlParse::selectNode(const QDomNode &nodeHeader, const QString sNode) -{ +QDomNode XmlParse::selectNode(const QDomNode &nodeHeader, const QString sNode) { QDomNode node = nodeHeader.firstChild(); - while (!node.isNull()) - { + while (!node.isNull()) { if (node.nodeName() == sNode) return node; node = node.nextSibling(); @@ -45,8 +39,7 @@ return node; } -QString XmlParse::selectNodeQString(const QDomNode &nodeHeader, const QString sNode) -{ +QString XmlParse::selectNodeQString(const QDomNode &nodeHeader, const QString sNode) { QString ret; QDomNode node = selectNode(nodeHeader, sNode); if (!node.isNull()) @@ -56,23 +49,18 @@ return ret; } -QVector * XmlParse::selectNodeLongArray(const QDomNode &nodeHeader, const QString sNode) -{ +QVector * XmlParse::selectNodeLongArray(const QDomNode &nodeHeader, const QString sNode) { QString s; QDomNode node = selectNode(nodeHeader, sNode); - if (!node.isNull()) - { + if (!node.isNull()) { QDomNode node2 = selectNode(node, "#cdata-section"); - if (!node2.isNull()) - { + if (!node2.isNull()) { QDomCDATASection node2cdata = node2.toCDATASection(); s = node2cdata.data(); - } } QVector *data = new QVector(s.length()/4); - for (unsigned int i=0; i * XmlParse::selectNodeCharArray(const QDomNode &nodeHeader, const QString sNode) -{ +QVector * XmlParse::selectNodeCharArray(const QDomNode &nodeHeader, const QString sNode) { QString s; QDomNode node = selectNode(nodeHeader, sNode); - if (!node.isNull()) - { + if (!node.isNull()) { QDomNode node2 = selectNode(node, "#cdata-section"); - if (!node2.isNull()) - { + if (!node2.isNull()) { QDomCDATASection node2cdata = node2.toCDATASection(); s = node2cdata.data(); } } - QVector *data = new QVector(s.length()); - for (unsigned int i=0; i * XmlParse::selectNodeHexCharArray(const QDomNode &nodeHeader, const QString sNode) -{ +QVector * XmlParse::selectNodeHexCharArray(const QDomNode &nodeHeader, const QString sNode) { QString hexdata; QDomNode node = selectNode(nodeHeader, sNode); - if (node.isNull()) { return 0; } + if (node.isNull()) { + return 0; + } hexdata = node.toElement().text(); int wavebytes = hexdata.length() / 2; - if (wavebytes == 0) { return 0; } + if (wavebytes == 0) { + return 0; + } QVector *data = new QVector(wavebytes); @@ -126,34 +112,29 @@ return data; } -QList * XmlParse::selectNodeLongList(const QDomNode &nodeHeader, const QString sNode) -{ +QList * XmlParse::selectNodeLongList(const QDomNode &nodeHeader, const QString sNode) { QVector *p = selectNodeLongArray(nodeHeader, sNode); QList *data = new QList; - for (unsigned int i=0; isize(); ++i) + for (int i=0; isize(); ++i) data->append(p->at(i)); return data; } -QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QString sText) -{ +QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QString sText) { QDomElement element = doc.createElement(sElementName); element.appendChild(doc.createTextNode(sText)); header.appendChild(element); return element; } -QDomElement XmlParse::openXMLFile(QString path, QString name) -{ +QDomElement XmlParse::openXMLFile(QString path, QString name) { QDomDocument doc(name); QFile file(path); - if (!file.open(QIODevice::ReadOnly)) - { + if (!file.open(QIODevice::ReadOnly)) { qDebug() << "Could not open xml file:" << file.fileName(); return QDomElement(); } - if (!doc.setContent(&file)) - { + if (!doc.setContent(&file)) { qWarning() << "Error parsing xml file:" << file.fileName(); file.close(); return QDomElement(); @@ -163,13 +144,11 @@ return doc.documentElement(); } -QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QList * pData) -{ +QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QList * pData) { // Create a string, binstring, that contains the data contained pointet to by pData, and save it in XML // by use of QDomCDATASection QString binstring; - for (unsigned int i=0; isize(); ++i) - { + for (int i=0; isize(); ++i) { long v = (pData->at(i)); // Split long value into four chars @@ -190,12 +169,11 @@ return element; } -QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QVector * pData) -{ +QDomElement XmlParse::addElement(QDomDocument &doc, QDomElement &header, QString sElementName, QVector * pData) { // Create a string, binstring, that contains the data contained pointet to by pData, and save it in XML // by use of QDomCDATASection QString binstring; - for (unsigned int i=0; isize(); ++i) + for (int i=0; isize(); ++i) binstring.append(pData->at(i)); QDomElement element = doc.createElement(sElementName); @@ -204,8 +182,7 @@ return element; } -QDomElement XmlParse::addHexElement(QDomDocument &doc, QDomElement &header, QString sElementName, QVector * pData) -{ +QDomElement XmlParse::addHexElement(QDomDocument &doc, QDomElement &header, QString sElementName, QVector * pData) { QDomElement element = doc.createElement(sElementName); QString hexdata("");