| 1 |
/* |
| 2 |
Copyright (C) 2004 Allan Sandfeld Jensen <[email protected]> |
| 3 |
Copyright (C) 2005 Benjamin Meyer <ben at meyerhome dot net> |
| 4 |
|
| 5 |
This library is free software; you can redistribute it and/or |
| 6 |
modify it under the terms of the GNU Library General Public |
| 7 |
License as published by the Free Software Foundation; either |
| 8 |
version 2 of the License, or (at your option) any later version. |
| 9 |
|
| 10 |
This library is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
Library General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU Library General Public License |
| 16 |
along with this library; see the file COPYING.LIB. If not, write to |
| 17 |
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 |
Boston, MA 02110-1301, USA. |
| 19 |
*/ |
| 20 |
|
| 21 |
#ifndef ENCODER_FLAC_H |
| 22 |
#define ENCODER_FLAC_H |
| 23 |
|
| 24 |
#include <config-audiocd.h> |
| 25 |
|
| 26 |
#include "ui_encoderflacconfig.h" |
| 27 |
|
| 28 |
#include "audiocdencoder.h" |
| 29 |
|
| 30 |
class EncoderFLACConfig : public QWidget, public Ui::EncoderFLACConfig |
| 31 |
{ |
| 32 |
public: |
| 33 |
explicit EncoderFLACConfig(QWidget *parent = nullptr) |
| 34 |
: QWidget(parent) |
| 35 |
{ |
| 36 |
setupUi(this); |
| 37 |
} |
| 38 |
}; |
| 39 |
|
| 40 |
/** |
| 41 |
* FLAC encoder. |
| 42 |
* Check out https://xiph.org/flac/ for more information. |
| 43 |
*/ |
| 44 |
class EncoderFLAC : public AudioCDEncoder |
| 45 |
{ |
| 46 |
public: |
| 47 |
explicit EncoderFLAC(KIO::WorkerBase *worker); |
| 48 |
~EncoderFLAC() override; |
| 49 |
|
| 50 |
QString type() const override |
| 51 |
{ |
| 52 |
return QLatin1String("FLAC"); |
| 53 |
} |
| 54 |
bool init() override; |
| 55 |
void loadSettings() override; |
| 56 |
unsigned long size(long time_secs) const override; |
| 57 |
const char *fileType() const override |
| 58 |
{ |
| 59 |
return "flac"; |
| 60 |
} |
| 61 |
const char *mimeType() const override |
| 62 |
{ |
| 63 |
return "audio/x-flac"; |
| 64 |
} |
| 65 |
void fillSongInfo(KCDDB::CDInfo info, int track, const QString &comment) override; |
| 66 |
long readInit(long size) override; |
| 67 |
long read(qint16 *buf, int frames) override; |
| 68 |
long readCleanup() override; |
| 69 |
QWidget *getConfigureWidget(KConfigSkeleton **manager) const override; |
| 70 |
|
| 71 |
class Private; |
| 72 |
|
| 73 |
private: |
| 74 |
Private *d; |
| 75 |
}; |
| 76 |
|
| 77 |
#endif // ENCODER_FLAC_H |