File indexing completed on 2025-02-16 04:29:33
0001 /* 0002 SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef _K3B_WAVE_DECODER_H_ 0008 #define _K3B_WAVE_DECODER_H_ 0009 0010 #include "k3baudiodecoder.h" 0011 #include <QScopedPointer> 0012 0013 class K3bWaveDecoderFactory : public K3b::AudioDecoderFactory 0014 { 0015 Q_OBJECT 0016 0017 public: 0018 K3bWaveDecoderFactory( QObject* parent, const QVariantList& ); 0019 ~K3bWaveDecoderFactory() override; 0020 0021 bool canDecode( const QUrl& filename ) override; 0022 0023 int pluginSystemVersion() const override { return K3B_PLUGIN_SYSTEM_VERSION; } 0024 0025 K3b::AudioDecoder* createDecoder( QObject* parent = 0 ) const override; 0026 }; 0027 0028 0029 class K3bWaveDecoder : public K3b::AudioDecoder 0030 { 0031 Q_OBJECT 0032 0033 public: 0034 explicit K3bWaveDecoder( QObject* parent = 0 ); 0035 ~K3bWaveDecoder() override; 0036 0037 void cleanup() override; 0038 0039 bool seekInternal( const K3b::Msf& ) override; 0040 0041 QString fileType() const override; 0042 0043 QStringList supportedTechnicalInfos() const override; 0044 0045 QString technicalInfo( const QString& ) const override; 0046 0047 protected: 0048 bool analyseFileInternal( K3b::Msf& frames, int& samplerate, int& channels ) override; 0049 bool initDecoderInternal() override; 0050 int decodeInternal( char* data, int maxLen ) override; 0051 0052 private: 0053 class Private; 0054 QScopedPointer<Private> d; 0055 }; 0056 0057 #endif