File indexing completed on 2024-05-12 04:55:35

0001 /**
0002  * \file abstractfingerprintdecoder.h
0003  * Abstract base class for Chromaprint fingerprint decoder.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 15 Feb 2013
0008  *
0009  * Copyright (C) 2013-2018  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #include "abstractfingerprintdecoder.h"
0028 
0029 /**
0030  * Constructor.
0031  * @param parent parent object
0032  */
0033 AbstractFingerprintDecoder::AbstractFingerprintDecoder(QObject* parent)
0034   : QObject(parent), m_stopped(false)
0035 {
0036 }
0037 
0038 /**
0039  * Destructor.
0040  */
0041 AbstractFingerprintDecoder::~AbstractFingerprintDecoder()
0042 {
0043 }
0044 
0045 /**
0046  * Run decoder on audio file.
0047  */
0048 void AbstractFingerprintDecoder::start(const QString&)
0049 {
0050   m_stopped = false;
0051 }
0052 
0053 /**
0054  * Stop decoder.
0055  * Can be used to stop the decoder when an error is found after
0056  * getting bufferReady() data.
0057  */
0058 void AbstractFingerprintDecoder::stop()
0059 {
0060   m_stopped = true;
0061 }
0062 
0063 /**
0064  * Check if decoding has been stopped.
0065  * @return true if stopped.
0066  */
0067 bool AbstractFingerprintDecoder::isStopped() const
0068 {
0069   return m_stopped;
0070 }