diff options
Diffstat (limited to 'src/plugins/Input/modplug')
| -rw-r--r-- | src/plugins/Input/modplug/archivereader.h | 4 | ||||
| -rw-r--r-- | src/plugins/Input/modplug/decoder_modplug.cpp | 17 | ||||
| -rw-r--r-- | src/plugins/Input/modplug/decoder_modplug.h | 16 | ||||
| -rw-r--r-- | src/plugins/Input/modplug/modplugmetadatamodel.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/Input/modplug/modplugmetadatamodel.h | 4 |
5 files changed, 18 insertions, 28 deletions
diff --git a/src/plugins/Input/modplug/archivereader.h b/src/plugins/Input/modplug/archivereader.h index 7a714e385..3c55da753 100644 --- a/src/plugins/Input/modplug/archivereader.h +++ b/src/plugins/Input/modplug/archivereader.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * + * Copyright (C) 2008-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -32,7 +32,7 @@ class ArchiveReader : public QObject { Q_OBJECT public: - ArchiveReader(QObject *parent = nullptr); + explicit ArchiveReader(QObject *parent = nullptr); ~ArchiveReader(); diff --git a/src/plugins/Input/modplug/decoder_modplug.cpp b/src/plugins/Input/modplug/decoder_modplug.cpp index a2924c183..db046dd1d 100644 --- a/src/plugins/Input/modplug/decoder_modplug.cpp +++ b/src/plugins/Input/modplug/decoder_modplug.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2016 by Ilya Kotov * + * Copyright (C) 2008-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -41,19 +41,10 @@ DecoderModPlug* DecoderModPlug::m_instance = nullptr; -DecoderModPlug::DecoderModPlug(const QString &path) : Decoder(nullptr) +DecoderModPlug::DecoderModPlug(const QString &path) : Decoder(nullptr), + m_path(path) { - m_path = path; - m_freq = 0; - m_bitrate = 0; - m_totalTime = 0; - m_chan = 0; - m_soundFile = nullptr; - m_sampleSize = 0; - m_instance = this; - m_bps = 0; - m_preampFactor = 0.0f; - m_usePreamp = false; + m_instance = this; } DecoderModPlug::~DecoderModPlug() diff --git a/src/plugins/Input/modplug/decoder_modplug.h b/src/plugins/Input/modplug/decoder_modplug.h index 8797b2d59..7adbeb463 100644 --- a/src/plugins/Input/modplug/decoder_modplug.h +++ b/src/plugins/Input/modplug/decoder_modplug.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2009 by Ilya Kotov * + * Copyright (C) 2008-2020 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -28,7 +28,7 @@ class CSoundFile; class DecoderModPlug : public Decoder { public: - DecoderModPlug(const QString &path); + explicit DecoderModPlug(const QString &path); virtual ~DecoderModPlug(); void readSettings(); @@ -45,15 +45,15 @@ private: //helper function void deinit(); - CSoundFile *m_soundFile; + CSoundFile *m_soundFile = nullptr; int m_bps; //bits per sample QByteArray m_input_buf; //input buffer - quint32 m_freq; - int m_chan, m_sampleSize, m_bitrate; - qint64 m_totalTime; - double m_preampFactor; - bool m_usePreamp; + quint32 m_freq = 0; + int m_chan = 0, m_sampleSize = 0, m_bitrate = 0; + qint64 m_totalTime = 0; + double m_preampFactor = 0.0f; + bool m_usePreamp = false; QString m_path; static DecoderModPlug* m_instance; }; diff --git a/src/plugins/Input/modplug/modplugmetadatamodel.cpp b/src/plugins/Input/modplug/modplugmetadatamodel.cpp index a76d7c449..604e15b5f 100644 --- a/src/plugins/Input/modplug/modplugmetadatamodel.cpp +++ b/src/plugins/Input/modplug/modplugmetadatamodel.cpp @@ -29,10 +29,9 @@ #define MAX_MESSAGE_LENGTH 4000 -ModPlugMetaDataModel::ModPlugMetaDataModel(const QString &path) : MetaDataModel(true) +ModPlugMetaDataModel::ModPlugMetaDataModel(const QString &path) : MetaDataModel(true), + m_path(path) { - m_soundFile = nullptr; - m_path = path; ArchiveReader reader(nullptr); if(reader.isSupported(m_path)) { diff --git a/src/plugins/Input/modplug/modplugmetadatamodel.h b/src/plugins/Input/modplug/modplugmetadatamodel.h index bc930ecfb..e80fc452c 100644 --- a/src/plugins/Input/modplug/modplugmetadatamodel.h +++ b/src/plugins/Input/modplug/modplugmetadatamodel.h @@ -29,14 +29,14 @@ class ModPlugMetaDataModel : public MetaDataModel { Q_DECLARE_TR_FUNCTIONS(ModPlugMetaDataModel) public: - ModPlugMetaDataModel(const QString &path); + explicit ModPlugMetaDataModel(const QString &path); ~ModPlugMetaDataModel(); QList<MetaDataItem> extraProperties() const override; QList<MetaDataItem> descriptions() const override; static QString getTypeName(quint32 type); private: - CSoundFile* m_soundFile; + CSoundFile* m_soundFile = nullptr; QByteArray m_buffer; QString m_path; }; |
