Commit 4edb67ed authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Port to KIO::WorkerBase

parent 557be74b
Pipeline #200160 passed with stage
in 59 seconds
......@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16)
project(audiocd VERSION "5.0.0")
set(QT_MIN_VERSION "5.15.0")
set(KF_MIN_VERSION "5.90.0")
set(KF_MIN_VERSION "5.96.0")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -100,10 +100,10 @@ target_sources(kio_audiocd PRIVATE
ecm_qt_declare_logging_category(kio_audiocd
HEADER audiocd_kio_debug.h
IDENTIFIER AUDIOCD_KIO_LOG
CATEGORY_NAME kf.kio.slaves.audiocd
OLD_CATEGORY_NAMES kf5.kio.audiocd
CATEGORY_NAME kf.kio.workers.audiocd
OLD_CATEGORY_NAMES kf5.kio.audiocd kf.kio.slaves.audiocd
DEFAULT_SEVERITY Warning
DESCRIPTION "audiocd KIO slave"
DESCRIPTION "audiocd KIO worker"
EXPORT AUDIOCD
)
......
// CODE LAYOUT
audiocd.[h,cpp] - The main ioslave code. It contains the logic to rip audio from cd's. It loads all of the plugins that it can find. When it needs to encode, generate directories (and names of directories) it goes through it's list. audiocd uses libkcddb to retrieve its cddb entries and cdparinoia to retrieve the audio from the CD.
audiocd.[h,cpp] - The main KIO worker code. It contains the logic to rip audio from cd's. It loads all of the plugins that it can find. When it needs to encode, generate directories (and names of directories) it goes through it's list. audiocd uses libkcddb to retrieve its cddb entries and cdparinoia to retrieve the audio from the CD.
plugins/audiocdencoder.[h,cpp] - The base class for all of the encoder plugins
......@@ -10,7 +10,7 @@ plugins/opus/* - The opus encoder
plugins/vorbis/* - The ogg encoder
plugins/wav/* - The cda and wav "encoders"
kcmaudiocd/ - kcm configure dialog for the audiocd ioslave. It also loads the plugins and gets their configure dialogs and puts them into the tab dialog.
kcmaudiocd/ - kcm configure dialog for the audiocd KIO worker. It also loads the plugins and gets their configure dialogs and puts them into the tab dialog.
// USERS
......
This diff is collapsed.
......@@ -26,7 +26,7 @@
#ifndef AUDIO_CD_H
#define AUDIO_CD_H
#include <KIO/SlaveBase>
#include <KIO/WorkerBase>
class AudioCDEncoder;
......@@ -35,19 +35,19 @@ struct cdrom_drive;
namespace AudioCD {
/**
* The core class of the audiocd:// ioslave.
* It has the ioslave login and the ripping logic. The actual encoding
* The core class of the audiocd:// KIO worker.
* It has the KIO worker login and the ripping logic. The actual encoding
* is done by encoders that are separate objects.
*/
class AudioCDProtocol : public KIO::SlaveBase
class AudioCDProtocol : public KIO::WorkerBase
{
public:
AudioCDProtocol(const QByteArray &protocol, const QByteArray &pool, const QByteArray &app);
~AudioCDProtocol() override;
void get(const QUrl &) override;
void stat(const QUrl &) override;
void listDir(const QUrl &) override;
KIO::WorkerResult get(const QUrl &) override;
KIO::WorkerResult stat(const QUrl &) override;
KIO::WorkerResult listDir(const QUrl &) override;
protected:
AudioCDEncoder *encoderFromExtension(const QString &extension);
......@@ -73,12 +73,13 @@ protected:
long fileSize(long firstSector, long lastSector, AudioCDEncoder *encoder);
/**
* The heart of this ioslave.
* The heart of this KIO worker.
* Reads data off the cd and then passes it to an encoder to encode
*/
void paranoiaRead(struct cdrom_drive *drive, long firstSector, long lastSector, AudioCDEncoder *encoder, const QString &fileName, unsigned long size);
KIO::WorkerResult
paranoiaRead(struct cdrom_drive *drive, long firstSector, long lastSector, AudioCDEncoder *encoder, const QString &fileName, unsigned long size);
struct cdrom_drive *initRequest(const QUrl &);
KIO::WorkerResult initRequest(const QUrl &url, struct cdrom_drive **drive);
/**
* Add an entry in the KIO directory, using the title you give,
......@@ -100,10 +101,10 @@ protected:
private:
void generateTemplateTitles();
bool checkNoHost(const QUrl &url);
KIO::WorkerResult checkNoHost(const QUrl &url);
QList<AudioCDEncoder *> encoders;
cdrom_drive *getDrive();
KIO::WorkerResult getDrive(struct cdrom_drive **drive);
// These are the only guaranteed encoders to be built, the rest
// are dynamic depending on other libraries on the system
......
......@@ -77,7 +77,7 @@
<summary xml:lang="zh-CN">KDE Plasma 和 KDE 应用程序的音频 CD 透明集成从属程序,具有数据转换功能</summary>
<summary xml:lang="zh-TW">透明整合 Audio CD 到 KDE Plasma 和包含資料轉換功能的 KDE 應用程式</summary>
<description>
<p>KIO AudioCD is a KIO slave that enables KIO-aware applications (such as Dolphin or k3b) to access audio and CD text data on the audio compact disks. It allows transparent drag and drop conversion of audio data into the popular formats and has a configuration System Settings module available in the "Multimedia" section.</p>
<p>KIO AudioCD is a KIO worker that enables KIO-aware applications (such as Dolphin or k3b) to access audio and CD text data on the audio compact disks. It allows transparent drag and drop conversion of audio data into the popular formats and has a configuration System Settings module available in the "Multimedia" section.</p>
<p xml:lang="az">KIO AudioCD modulu, Dolphin fayl meneceri və ya K3b disk yazma tətbiqi kimi, KİO modulunda işləmək üçün istifadə olunan tətbiqlərin köməyi ilə kompakt-diskə yazılan səs və CD mətni məlumatlarına giriş əldə etməyə imkan verir. Bu modul, kompakt-diskdən audio məlumatlarını sadəcə köçürməklə onları tanınmış audio formatlara çevirməyə icazə verir. Modulun parametrlərini "Multimedia" bölməsindəki Sistem Ayarlarında tənzimləyə bilərsiniz.</p>
<p xml:lang="ca">El KIO AudioCD és un esclau KIO que habilita les aplicacions que admeten el KIO (com el Dolphin o el K3b) per a accedir a l'àudio CD i a les dades de text dels discs compactes d'àudio. Permet la conversió transparent de dades d'àudio en arrossegar i deixar anar cap als formats usuals i té un mòdul de configuració a l'Arranjament del sistema a la secció «Multimèdia».</p>
<p xml:lang="ca-valencia">KIO AudioCD és un esclau KIO que habilita les aplicacions que admeten KIO (com Dolphin o K3b) per a accedir a l'àudio CD i a les dades de text dels discs compactes d'àudio. Permet la conversió transparent de dades d'àudio en arrossegar i deixar anar cap als formats usuals i té un mòdul de configuració a Configuració del sistema a la secció «Multimèdia».</p>
......
......@@ -25,13 +25,13 @@ and, when copied from the folder, are digitally extracted from the
<acronym>CD</acronym>. This ensures a perfect copy of the audio
data.</para>
<para>To see how this slave works, insert an audio <acronym>CD</acronym>
<para>To see how this KIO worker works, insert an audio <acronym>CD</acronym>
in your &CD-ROM; drive and type <userinput>audiocd:/</userinput> into
&konqueror;. Within a few seconds you should see a list of tracks and
some folders.</para>
<para>Audio <acronym>CD</acronym>s don't really have folders, but
the audiocd slave provides them as a convenience. If you look inside
the audiocd KIO worker provides them as a convenience. If you look inside
these folders you will see that they all contain the same number of
tracks. If you are connected to the Internet, some folders will have
the actual track titles shown as the filenames.</para>
......@@ -48,7 +48,7 @@ saved to a file. Note that Ogg Vorbis is a compressed format, so the
file in your home folder will appear a great deal smaller than it
would have been if you had copied the raw data.</para>
<para>The mechanism behind this is quite simple. When the audiocd slave
<para>The mechanism behind this is quite simple. When the audiocd KIO worker
is asked to retrieve a track from the <filename class="directory">Ogg
Vorbis</filename> folder, it starts extracting the digital audio data
from the <acronym>CD</acronym>. As it sends the data over to the file in
......@@ -78,7 +78,7 @@ below.</para>
<listitem>
<para>Set the path to the audio <acronym>CD</acronym> device, &eg;
<userinput>audiocd:/<option>?device</option>=<parameter>/dev/sdc</parameter></userinput>.
Normally, the slave will try to find a <acronym>CD</acronym> drive with
Normally, the KIO worker will try to find a <acronym>CD</acronym> drive with
an audio <acronym>CD</acronym> inserted, but if it fails or you have
more than one <acronym>CD</acronym> drive, you may want to try this
option. Note that the configuration dialog allows you to set a default
......
......@@ -64,7 +64,7 @@ Name[uk]=Аудіо-КД
Name[x-test]=xxAudio CDsxx
Name[zh_CN]=音频 CD
Name[zh_TW]=音樂光碟
Comment=Audiocd IO Slave Configuration
Comment=Audiocd IO Worker Configuration
Comment[ar]=ضبط دخل وخرج الأقراص الصوتية
Comment[ast]=Configuración del esclavu d'E/S d'audiocd
Comment[az]=Audiocd IO Slave tənzimləməsi
......
......@@ -46,7 +46,7 @@
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="ec_enable_check">
<property name="whatsThis">
<string>If you uncheck this option, the slave will not try to use error correction which can be useful for reading damaged CDs. However, this feature can be problematic in some cases, so you can switch it off here.</string>
<string>If you uncheck this option, the KIO worker will not try to use error correction which can be useful for reading damaged CDs. However, this feature can be problematic in some cases, so you can switch it off here.</string>
</property>
<property name="text">
<string>Use &amp;error correction when reading the CD</string>
......
......@@ -36,8 +36,8 @@
</articleinfo>
<sect1 id="audiocd-page">
<title>Audiocd IO Slave Configuration</title>
<para>The module <guilabel>Audiocd IO Slave Configuration</guilabel> page is divided in the <guilabel>General</guilabel> tab, the <guilabel>Names</guilabel> tab, and the encoder parameter tabs.</para>
<title>Audiocd KIO Worker Configuration</title>
<para>The module <guilabel>Audiocd KIO Worker Configuration</guilabel> page is divided in the <guilabel>General</guilabel> tab, the <guilabel>Names</guilabel> tab, and the encoder parameter tabs.</para>
<sect2 id="general-tab">
<title>The General Tab</title>
......@@ -103,7 +103,7 @@
</screenshot>
<note>
<para>The FLAC encoder tab is only available if Audiocd IO slave was compiled with libFLAC.</para>
<para>The FLAC encoder tab is only available if Audiocd KIO worker was compiled with libFLAC.</para>
</note>
<para>FLAC is a lossless compressed audio format free of any patents or license fees. It maintains perfect CD audio quality while reducing file size by
......@@ -140,7 +140,7 @@ about 50%. When using this codec the filesize is much larger than Opus, Ogg Vorb
<para>MP3 (or MPEG-1 Audio Layer III) is a patented digital audio codec using a form of lossy data compression. In spite of its shortcomings, it is a common format for consumer audio storage, and is widely supported on portable music players.</para>
<para>Audiocd IO slave uses the LAME encoder to produce <filename class="extension">mp3</filename> files. LAME is considered the best MP3 encoder, mostly thanks to the dedicated work of its developers and the open source licensing model that allowed the project to tap into engineering resources from all around the world.</para>
<para>Audiocd KIO worker uses the LAME encoder to produce <filename class="extension">mp3</filename> files. LAME is considered the best MP3 encoder, mostly thanks to the dedicated work of its developers and the open source licensing model that allowed the project to tap into engineering resources from all around the world.</para>
<variablelist>
<varlistentry><term><guilabel>Encoding Method</guilabel></term>
......@@ -233,7 +233,7 @@ this information automatically via the Internet. Look at the &systemsettings; CD
</screenshot>
<note>
<para>The Ogg Vorbis encoder tab is only available if Audiocd IO slave was compiled with <ulink url="https://xiph.org/vorbis/">libvorbis</ulink>.</para>
<para>The Ogg Vorbis encoder tab is only available if Audiocd KIO worker was compiled with <ulink url="https://xiph.org/vorbis/">libvorbis</ulink>.</para>
</note>
<para>Ogg Vorbis is an open and royalty-free audio codec for lossy audio compression. It produces smaller files than MP3 at equivalent or higher quality.</para>
......
......@@ -91,7 +91,7 @@ KAudiocdModule::KAudiocdModule(QWidget *parent, const QVariantList &lst)
connect(audioConfig->kcfg_replaceOutput, &QLineEdit::textChanged, this, &KAudiocdModule::slotConfigChanged);
connect(audioConfig->example, &QLineEdit::textChanged, this, &KAudiocdModule::slotConfigChanged);
auto about = new KAboutData(QStringLiteral("kcmaudiocd"), i18n("KDE Audio CD IO Slave"), QStringLiteral(AUDIOCDPLUGINS_VERSION_STRING));
auto about = new KAboutData(QStringLiteral("kcmaudiocd"), i18n("KDE Audio CD KIO Worker"), QStringLiteral(AUDIOCDPLUGINS_VERSION_STRING));
about->addAuthor(i18n("Benjamin C. Meyer"), i18n("Former Maintainer"), QStringLiteral("ben@meyerhome.net"));
about->addAuthor(i18n("Carsten Duvenhorst"), i18n("Original Author"), QStringLiteral("duvenhorst@duvnet.de"));
......@@ -250,10 +250,10 @@ void KAudiocdModule::slotEcEnable() {
QString KAudiocdModule::quickHelp() const
{
return i18n(
"<h1>Audio CDs</h1> The Audio CD IO-Slave enables you to easily"
"<h1>Audio CDs</h1> The Audio CD KIO Worker enables you to easily"
" create wav, FLAC, MP3, Ogg Vorbis or Opus files from your "
"audio CD-ROMs or DVDs."
" The slave is invoked by typing <i>\"audiocd:/\"</i> in "
" The KIO worker is invoked by typing <i>\"audiocd:/\"</i> in "
"Dolphin's location"
" bar. In this module, you can configure"
" encoding, and device settings. Note that FLAC, MP3, Ogg Vorbis,"
......
......@@ -26,7 +26,7 @@
#include <QLibraryInfo>
#include <QRegularExpression>
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.slaves.audiocd")
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.workers.audiocd")
/**
* Attempt to load a plugin and see if it has the symbol
......@@ -49,7 +49,7 @@ static QFunctionPointer loadPlugin(const QString &libFileName)
* and I do know that this does work. :) Feel free to improve the loading
* system, there isn't much code anyway.
*/
void AudioCDEncoder::findAllPlugins(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders)
void AudioCDEncoder::findAllPlugins(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders)
{
QString foundEncoders;
......@@ -76,9 +76,9 @@ void AudioCDEncoder::findAllPlugins(KIO::SlaveBase *slave, QList<AudioCDEncoder
QFunctionPointer function = loadPlugin(fi.absoluteFilePath());
if (function) {
void (*functionPointer)(KIO::SlaveBase *, QList<AudioCDEncoder *> &) =
(void (*)(KIO::SlaveBase * slave, QList<AudioCDEncoder *> & encoders)) function;
functionPointer(slave, encoders);
void (*functionPointer)(KIO::WorkerBase *, QList<AudioCDEncoder *> &) =
(void (*)(KIO::WorkerBase * worker, QList<AudioCDEncoder *> & encoders)) function;
functionPointer(worker, encoders);
}
}
}
......
......@@ -22,7 +22,7 @@
#include "audiocdplugins_export.h"
#include <KIO/SlaveBase>
#include <KIO/WorkerBase>
#include <QList>
#include <QLoggingCategory>
#include <sys/types.h>
......@@ -39,11 +39,11 @@ class AUDIOCDPLUGINS_EXPORT AudioCDEncoder {
public:
/**
* Constructor.
* @param slave parent that this classes can use to call data() with
* @param worker parent that this classes can use to call data() with
* when finished encoding bits.
*/
explicit AudioCDEncoder(KIO::SlaveBase *slave)
: ioslave(slave)
explicit AudioCDEncoder(KIO::WorkerBase *worker)
: ioWorker(worker)
{
}
......@@ -143,18 +143,18 @@ public:
* Uses QLibraryInfo to find where libraries could be, opens all of the ones
* that we might own audiocd_encoder_* and then uses the symbol
* create_audiocd_encoders to obtain the encoders from that library.
* @param slave ioslave needed if the plugin is going to be used to encode
* @param worker Worker needed if the plugin is going to be used to encode
* something.
* @param encoders container for new encoders.
*/
static void findAllPlugins(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders);
static void findAllPlugins(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders);
protected:
/**
* Pointer to the ioslave that is running this encoder.
* Used (only?) for the data() function to pass back encoded data.
*/
KIO::SlaveBase *ioslave;
/**
* Pointer to the ioWorker that is running this encoder.
* Used (only?) for the data() function to pass back encoded data.
*/
KIO::WorkerBase *ioWorker;
};
#endif // AUDIOCD_ENCODER_H
......@@ -34,12 +34,12 @@
#include <QDateTime>
#include <QPair>
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.slaves.audiocd")
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.workers.audiocd")
extern "C" {
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders)
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders)
{
encoders.append(new EncoderFLAC(slave));
encoders.append(new EncoderFLAC(worker));
}
}
......@@ -48,7 +48,7 @@ class EncoderFLAC::Private {
public:
FLAC__StreamEncoder *encoder;
FLAC__StreamMetadata **metadata;
KIO::SlaveBase *ioslave;
KIO::WorkerBase *ioWorker;
unsigned long data;
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
unsigned compression_level;
......@@ -78,7 +78,7 @@ static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *e
if (bytes) {
output = QByteArray::fromRawData((const char *)buffer, bytes);
d->ioslave->data(output);
d->ioWorker->data(output);
output.clear();
}
......@@ -99,9 +99,11 @@ FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void
*client_data)
{} ; */
EncoderFLAC::EncoderFLAC(KIO::SlaveBase *slave) : AudioCDEncoder(slave) {
EncoderFLAC::EncoderFLAC(KIO::WorkerBase *worker)
: AudioCDEncoder(worker)
{
d = new Private();
d->ioslave = slave;
d->ioWorker = worker;
d->encoder = nullptr;
#if defined(FLAC_API_VERSION_CURRENT) && FLAC_API_VERSION_CURRENT > 7
d->compression_level = 5;
......
......@@ -43,13 +43,13 @@ public:
class EncoderFLAC : public AudioCDEncoder {
public:
explicit EncoderFLAC(KIO::SlaveBase *slave);
~EncoderFLAC() override;
explicit EncoderFLAC(KIO::WorkerBase *worker);
~EncoderFLAC() override;
QString type() const override
{
return QLatin1String("FLAC");
}
QString type() const override
{
return QLatin1String("FLAC");
}
bool init() override;
void loadSettings() override;
unsigned long size(long time_secs) const override;
......
......@@ -29,12 +29,12 @@
#include <QStringList>
#include <QTemporaryFile>
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.slaves.audiocd")
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.workers.audiocd")
extern "C" {
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders)
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders)
{
encoders.append(new EncoderLame(slave));
encoders.append(new EncoderLame(worker));
}
}
......@@ -53,9 +53,9 @@ public:
QTemporaryFile *tempFile;
};
EncoderLame::EncoderLame(KIO::SlaveBase *slave)
EncoderLame::EncoderLame(KIO::WorkerBase *worker)
: QObject()
, AudioCDEncoder(slave)
, AudioCDEncoder(worker)
{
d = new Private();
d->waitingForWrite = false;
......@@ -329,7 +329,7 @@ long EncoderLame::readCleanup()
while (!file.atEnd()) {
uint read = file.read(data, 1024);
QByteArray output(data, read);
ioslave->data(output);
ioWorker->data(output);
}
file.close();
}
......
......@@ -43,7 +43,7 @@ class EncoderLame : public QObject, public AudioCDEncoder {
Q_OBJECT
public:
explicit EncoderLame(KIO::SlaveBase *slave);
explicit EncoderLame(KIO::WorkerBase *worker);
~EncoderLame() override;
QString type() const override
......
......@@ -30,12 +30,12 @@
#include <QStringList>
#include <QTemporaryFile>
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.slaves.audiocd")
Q_LOGGING_CATEGORY(AUDIOCD_KIO_LOG, "kf.kio.workers.audiocd")
extern "C" {
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders)
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders)
{
encoders.append(new EncoderOpus(slave));
encoders.append(new EncoderOpus(worker));
}
}
......@@ -54,9 +54,9 @@ public:
QTemporaryFile *tempFile = nullptr;
};
EncoderOpus::EncoderOpus(KIO::SlaveBase *slave)
EncoderOpus::EncoderOpus(KIO::WorkerBase *worker)
: QObject()
, AudioCDEncoder(slave)
, AudioCDEncoder(worker)
{
d = new Private();
d->waitingForWrite = false;
......@@ -217,7 +217,7 @@ long EncoderOpus::readCleanup()
while (!file.atEnd()) {
uint read = file.read(data, 1024);
QByteArray output(data, read);
ioslave->data(output);
ioWorker->data(output);
}
file.close();
}
......
......@@ -44,7 +44,7 @@ class EncoderOpus : public QObject, public AudioCDEncoder {
Q_OBJECT
public:
explicit EncoderOpus(KIO::SlaveBase *slave);
explicit EncoderOpus(KIO::WorkerBase *worker);
~EncoderOpus() override;
QString type() const override
......
......@@ -35,9 +35,9 @@
#include <vorbis/vorbisenc.h>
extern "C" {
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::SlaveBase *slave, QList<AudioCDEncoder *> &encoders)
AUDIOCDPLUGINS_EXPORT void create_audiocd_encoders(KIO::WorkerBase *worker, QList<AudioCDEncoder *> &encoders)
{
encoders.append(new EncoderVorbis(slave));
encoders.append(new EncoderVorbis(worker));
}
}
......@@ -66,8 +66,10 @@ public:
int vorbis_bitrate;
};
EncoderVorbis::EncoderVorbis(KIO::SlaveBase *slave) : AudioCDEncoder(slave) {
d = new Private();
EncoderVorbis::EncoderVorbis(KIO::WorkerBase *worker)
: AudioCDEncoder(worker)
{
d = new Private();
}
EncoderVorbis::~EncoderVorbis()
......@@ -161,11 +163,11 @@ long EncoderVorbis::flush_vorbis()
char *oggbody = reinterpret_cast<char *>(d->og.body);
if (d->og.header_len) {
ioslave->data(QByteArray::fromRawData(oggheader, d->og.header_len));
ioWorker->data(QByteArray::fromRawData(oggheader, d->og.header_len));
}
if (d->og.body_len) {
ioslave->data(QByteArray::fromRawData(oggbody, d->og.body_len));
ioWorker->data(QByteArray::fromRawData(oggbody, d->og.body_len));
}
processed += d->og.header_len + d->og.body_len;
}
......@@ -228,11 +230,11 @@ long EncoderVorbis::readInit(long /*size*/)
char *oggbody = reinterpret_cast<char *>(d->og.body);
if (d->og.header_len) {
ioslave->data(QByteArray::fromRawData(oggheader, d->og.header_len));
ioWorker->data(QByteArray::fromRawData(oggheader, d->og.header_len));
}
if (d->og.body_len) {
ioslave->data(QByteArray::fromRawData(oggbody, d->og.body_len));
ioWorker->data(QByteArray::fromRawData(oggbody, d->og.body_len));
}
}
return 0;
......
......@@ -47,13 +47,13 @@ public:
class EncoderVorbis : public AudioCDEncoder {
public:
explicit EncoderVorbis(KIO::SlaveBase *slave);
~EncoderVorbis() override;
explicit EncoderVorbis(KIO::WorkerBase *worker);
~EncoderVorbis() override;
QString type() const override
{
return QLatin1String("Ogg Vorbis");
}
QString type() const override
{
return QLatin1String("Ogg Vorbis");
}
bool init() override;
void loadSettings() override;
unsigned long size(long time_secs) const override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment