File indexing completed on 2025-06-29 07:27:58
0001 /* 0002 FLAC decoder module for K3b. 0003 Based on the Ogg Vorbis module for same. 0004 SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org> 0005 SPDX-FileCopyrightText: 2003 John Steele Scott <toojays@toojays.net> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 0011 #ifndef _K3B_FLAC_DECODER_H_ 0012 #define _K3B_FLAC_DECODER_H_ 0013 0014 0015 #include "k3baudiodecoder.h" 0016 0017 class K3bFLACDecoderFactory : public K3b::AudioDecoderFactory 0018 { 0019 Q_OBJECT 0020 0021 public: 0022 K3bFLACDecoderFactory( QObject* parent, const QVariantList& args ); 0023 ~K3bFLACDecoderFactory() override; 0024 0025 bool canDecode( const QUrl& filename ) override; 0026 0027 int pluginSystemVersion() const override { return K3B_PLUGIN_SYSTEM_VERSION; } 0028 0029 K3b::AudioDecoder* createDecoder( QObject* parent = 0 ) const override; 0030 }; 0031 0032 0033 class K3bFLACDecoder : public K3b::AudioDecoder 0034 { 0035 Q_OBJECT 0036 0037 public: 0038 explicit K3bFLACDecoder( QObject* parent = 0 ); 0039 ~K3bFLACDecoder() override; 0040 0041 void cleanup() override; 0042 0043 bool seekInternal( const K3b::Msf& ) override; 0044 0045 QString fileType() const override; 0046 QStringList supportedTechnicalInfos() const override; 0047 QString technicalInfo( const QString& ) const override; 0048 0049 protected: 0050 bool analyseFileInternal( K3b::Msf& frames, int& samplerate, int& ch ) override; 0051 bool initDecoderInternal() override; 0052 0053 int decodeInternal( char* _data, int maxLen ) override; 0054 0055 private: 0056 class Private; 0057 Private* d; 0058 }; 0059 0060 #endif