File indexing completed on 2024-10-13 04:21:50
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_MPC_DECODER_H_ 0008 #define _K3B_MPC_DECODER_H_ 0009 0010 #include "k3baudiodecoder.h" 0011 0012 class K3bMpcWrapper; 0013 0014 0015 class K3bMpcDecoderFactory : public K3b::AudioDecoderFactory 0016 { 0017 Q_OBJECT 0018 0019 public: 0020 K3bMpcDecoderFactory( QObject* parent, const QVariantList& ); 0021 ~K3bMpcDecoderFactory() override; 0022 0023 bool canDecode( const QUrl& filename ) override; 0024 0025 int pluginSystemVersion() const override { return K3B_PLUGIN_SYSTEM_VERSION; } 0026 0027 K3b::AudioDecoder* createDecoder( QObject* parent = 0 ) const override; 0028 }; 0029 0030 0031 class K3bMpcDecoder : public K3b::AudioDecoder 0032 { 0033 Q_OBJECT 0034 0035 public: 0036 explicit K3bMpcDecoder( QObject* parent = 0 ); 0037 ~K3bMpcDecoder() override; 0038 0039 QString fileType() const override; 0040 0041 protected: 0042 bool analyseFileInternal( K3b::Msf& frames, int& samplerate, int& ch ) override; 0043 bool initDecoderInternal() override; 0044 bool seekInternal( const K3b::Msf& ) override; 0045 0046 int decodeInternal( char* _data, int maxLen ) override; 0047 0048 private: 0049 K3bMpcWrapper* m_mpc; 0050 }; 0051 0052 #endif