File indexing completed on 2024-07-21 04:25:18

0001 /*
0002     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_MPC_WRAPPER_H_
0007 #define _K3B_MPC_WRAPPER_H_
0008 
0009 #include "k3bmpc_config.h"
0010 
0011 #include <QString>
0012 
0013 #include "k3bmsf.h"
0014 
0015 #include MPC_HEADER_FILE
0016 
0017 class QFile;
0018 
0019 
0020 class K3bMpcWrapper
0021 {
0022  public:
0023   K3bMpcWrapper();
0024   ~K3bMpcWrapper();
0025 
0026   bool open( const QString& filename );
0027   void close();
0028 
0029   int decode( char*, int max );
0030 
0031   bool seek( const K3b::Msf& );
0032 
0033   K3b::Msf length() const;
0034   int samplerate() const;
0035   unsigned int channels() const;
0036 
0037   QFile* input() const { return m_input; }
0038 
0039  private:
0040   QFile* m_input;
0041   mpc_reader* m_reader;
0042 #ifdef MPC_OLD_API
0043   mpc_decoder* m_decoder;
0044 #else
0045   mpc_demux* m_decoder;
0046 #endif
0047   mpc_streaminfo* m_info;
0048 };
0049 
0050 #endif