File indexing completed on 2024-10-06 04:26:03

0001 /*
0002     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_TRM_H_
0007 #define _K3B_TRM_H_
0008 
0009 #include <config-k3b.h>
0010 
0011 #ifdef ENABLE_MUSICBRAINZ
0012 
0013 #include "k3bmsf.h"
0014 #include <QByteArray>
0015 
0016 /**
0017  * This class is a wrapper around the trm part of libmusicbrainz.
0018  * It handles proxy settings automatically through KDE.
0019  *
0020  * TRM always treats audio data as 44100, 2 channel, 16 bit data.
0021  */
0022 namespace K3b {
0023 class TRM
0024 {
0025 public:
0026     TRM();
0027     ~TRM();
0028 
0029     void start( const K3b::Msf& length );
0030 
0031     /**
0032      * \return true if no more data is needed
0033      */
0034     bool generate( char* data, int len );
0035 
0036     /**
0037      * \return true on success, false on error.
0038      */
0039     bool finalize();
0040 
0041     QByteArray rawSignature() const;
0042     QByteArray signature() const;
0043 
0044 private:
0045     class Private;
0046     Private* d;
0047 };
0048 }
0049 
0050 #endif
0051 #endif