| 1 |
/* |
| 2 |
Copyright (C) 2000 Rik Hemsley (rikkus) <[email protected]> |
| 3 |
Copyright (C) 2000, 2001, 2002 Michael Matz <[email protected]> |
| 4 |
Copyright (C) 2001 Carsten Duvenhorst <[email protected]> |
| 5 |
Copyright (C) 2001 Adrian Schroeter <[email protected]> |
| 6 |
Copyright (C) 2003 Richard Lärkäng <[email protected]> |
| 7 |
Copyright (C) 2003 Scott Wheeler <[email protected]> |
| 8 |
Copyright (C) 2004, 2005 Benjamin Meyer <ben at meyerhome dot net> |
| 9 |
|
| 10 |
This program is free software; you can redistribute it and/or modify |
| 11 |
it under the terms of the GNU General Public License as published by |
| 12 |
the Free Software Foundation; either version 2 of the License, or |
| 13 |
(at your option) any later version. |
| 14 |
|
| 15 |
This program is distributed in the hope that it will be useful, |
| 16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
GNU General Public License for more details. |
| 19 |
|
| 20 |
You should have received a copy of the GNU General Public License |
| 21 |
along with this program; if not, write to the Free Software |
| 22 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
| 23 |
USA. |
| 24 |
*/ |
| 25 |
|
| 26 |
#ifndef ENCODER_VORBIS_H |
| 27 |
#define ENCODER_VORBIS_H |
| 28 |
|
| 29 |
#include "ui_encodervorbisconfig.h" |
| 30 |
|
| 31 |
#include "audiocdencoder.h" |
| 32 |
|
| 33 |
class EncoderVorbisConfig : public QWidget, public Ui::EncoderVorbisConfig |
| 34 |
{ |
| 35 |
public: |
| 36 |
EncoderVorbisConfig(QWidget *parent = nullptr) |
| 37 |
: QWidget(parent) |
| 38 |
{ |
| 39 |
setupUi(this); |
| 40 |
} |
| 41 |
}; |
| 42 |
|
| 43 |
/** |
| 44 |
* Ogg Vorbis encoder. |
| 45 |
* Check out https://xiph.org/vorbis/ for more information. |
| 46 |
*/ |
| 47 |
class EncoderVorbis : public AudioCDEncoder |
| 48 |
{ |
| 49 |
public: |
| 50 |
explicit EncoderVorbis(KIO::WorkerBase *worker); |
| 51 |
~EncoderVorbis() override; |
| 52 |
|
| 53 |
QString type() const override |
| 54 |
{ |
| 55 |
return QLatin1String("Ogg Vorbis"); |
| 56 |
} |
| 57 |
bool init() override; |
| 58 |
void loadSettings() override; |
| 59 |
unsigned long size(long time_secs) const override; |
| 60 |
const char *fileType() const override |
| 61 |
{ |
| 62 |
return "ogg"; |
| 63 |
} |
| 64 |
const char *mimeType() const override; |
| 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 |
private: |
| 72 |
long flush_vorbis(); |
| 73 |
|
| 74 |
class Private; |
| 75 |
Private *d; |
| 76 |
}; |
| 77 |
|
| 78 |
#endif // ENCODER_VORBIS_H |