Commit cdc547c7 authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Fix minor EBN issues

parent d4436c7f
......@@ -22,6 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "audiocd.h"
#include <config-audiocd.h>
#include <kdemacros.h>
......@@ -36,7 +37,6 @@ extern "C"
KDE_EXPORT int kdemain(int argc, char ** argv);
}
#include "audiocd.h"
#include "plugins/audiocdencoder.h"
#include <sys/stat.h>
......@@ -47,7 +47,8 @@ extern "C"
#include <kmacroexpander.h>
#include <QFile>
#include <qfileinfo.h>
#include <QFileInfo>
#include <QGlobalStatic>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include <kapplication.h>
......@@ -71,7 +72,7 @@ int kdemain(int argc, char ** argv)
// KApplication uses libkcddb which needs a valid kapp pointer
// GUIenabled must be true as libkcddb sometimes wants to communicate
// with the user
putenv(strdup("SESSION_MANAGER="));
qunsetenv("SESSION_MANAGER");
//KApplication::disableAutoDcopRegistration();
KCmdLineArgs::init(argc, argv, "kio_audiocd", 0, KLocalizedString(), 0, KLocalizedString());
......@@ -406,12 +407,12 @@ struct cdrom_drive * AudioCDProtocol::initRequest(const QUrl & url)
break;
}
// Find where the numbers end
for (end = start; end < name.length(); end++)
for (end = start; end < name.length(); ++end)
if (!name[end].isDigit())
break;
if (start < name.length()){
bool ok;
// The external representation counts from 1 so subtrac 1.
// The external representation counts from 1 so subtract 1.
d->req_track = name.mid(start-1, end - start+2).toInt(&ok) - 1;
if (!ok)
d->req_track = -1;
......@@ -895,7 +896,7 @@ void AudioCDProtocol::paranoiaRead(
while (currentSector <= lastSector)
{
// TODO make the 5 configurable? The default in the lib is 20 fyi
int16_t * buf = paranoia_read_limited(paranoia, paranoiaCallback, 5);
qint16 * buf = paranoia_read_limited(paranoia, paranoiaCallback, 5);
if( warned == 0 && paranoia_read_limited_error >= 5 && d->reportErrors ){
warning(i18n("AudioCD: Disk damage detected on this track, risk of data corruption."));
warned = 1;
......@@ -1162,7 +1163,7 @@ void AudioCDProtocol::generateTemplateTitles()
* Based upon the cdparanoia ripping application
* Only output BAD stuff
* The higher the paranoia_read_limited_error the worse the problem is
* FYI: PARANOIA_CB_READ & PARANOIA_CB_VERIFY happen continusly when ripping
* FYI: PARANOIA_CB_READ & PARANOIA_CB_VERIFY happen continuously when ripping
*/
void paranoiaCallback(long, int function)
{
......
......@@ -23,7 +23,7 @@
#include <sys/types.h>
#include <kio/slavebase.h>
#include <QtCore/QList>
#include <QList>
#include <KCddb/Cdinfo>
......@@ -102,12 +102,12 @@ public:
/**
* Passes a little bit of cd data to be encoded
* This function is most likly called many many times.
* This function is most likely called many many times.
* @param buf pointer to the audio that has been read in so far
* @param frames the number of frames of audio that are in buf
* @return size of the data that was created by this function, -1 on error.
*/
virtual long read(int16_t * buf, int frames) = 0;
virtual long read(qint16 * buf, int frames) = 0;
/**
* Perform any final file creation/padding that is necessary
......
......@@ -155,7 +155,7 @@ long EncoderFLAC::readInit(long size) {
#endif
#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
// The options match approximely those of flac compression-level-5
// The options match approximately those of flac compression-level-5
FLAC__stream_encoder_set_do_mid_side_stereo(d->encoder, true);
FLAC__stream_encoder_set_max_lpc_order(d->encoder, 8); // flac -l8
FLAC__stream_encoder_set_min_residual_partition_order(d->encoder, 3);
......@@ -176,7 +176,7 @@ long EncoderFLAC::readInit(long size) {
return d->data;
}
long EncoderFLAC::read(int16_t * buf, int frames)
long EncoderFLAC::read(qint16 * buf, int frames)
{
unsigned long olddata = d->data;
FLAC__int32 *buffer = new FLAC__int32[frames*2];
......
......@@ -53,7 +53,7 @@ public:
virtual const char * mimeType() const { return "audio/x-flac"; }
virtual void fillSongInfo( KCDDB::CDInfo info, int track, const QString &comment );
virtual long readInit(long size);
virtual long read(int16_t * buf, int frames);
virtual long read(qint16 * buf, int frames);
virtual long readCleanup();
virtual QWidget* getConfigureWidget(KConfigSkeleton** manager) const;
......
......@@ -16,7 +16,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "config-audiocd.h"
#include <config-audiocd.h>
#include "encoderlame.h"
#include "audiocd_lame_encoder.h"
......@@ -288,7 +288,7 @@ void EncoderLame::receivedStdout(){
// d->waitingForWrite = false;
// }
long EncoderLame::read(int16_t *buf, int frames){
long EncoderLame::read(qint16 *buf, int frames){
if(!d->currentEncodeProcess)
return 0;
if (d->processHasExited)
......
......@@ -42,7 +42,7 @@ class EncoderLame : public QObject, public AudioCDEncoder {
Q_OBJECT
public:
EncoderLame(KIO::SlaveBase *slave);
explicit EncoderLame(KIO::SlaveBase *slave);
~EncoderLame();
virtual QString type() const { return "MP3"; }
......@@ -53,7 +53,7 @@ public:
virtual const char * mimeType() const { return "audio/x-mp3"; }
virtual void fillSongInfo( KCDDB::CDInfo info, int track, const QString &comment );
virtual long readInit(long size);
virtual long read(int16_t * buf, int frames);
virtual long read(qint16 * buf, int frames);
virtual long readCleanup();
virtual QString lastErrorMessage() const;
......
......@@ -214,8 +214,8 @@ long EncoderVorbis::readInit(long /*size*/){
vorbis_analysis_init(&d->vd,&d->vi);
vorbis_block_init(&d->vd,&d->vb);
srand(time(NULL));
ogg_stream_init(&d->os,rand());
qsrand(time(NULL));
ogg_stream_init(&d->os,qrand());
vorbis_analysis_headerout(&d->vd,&d->vc,&header,&header_comm,&header_code);
......@@ -241,7 +241,7 @@ long EncoderVorbis::readInit(long /*size*/){
return 0;
}
long EncoderVorbis::read(int16_t * buf, int frames){
long EncoderVorbis::read(qint16 * buf, int frames){
int i;
float **buffer=vorbis_analysis_buffer(&d->vd,frames);
......
......@@ -45,7 +45,7 @@ public:
class EncoderVorbis : public AudioCDEncoder {
public:
EncoderVorbis(KIO::SlaveBase *slave);
explicit EncoderVorbis(KIO::SlaveBase *slave);
~EncoderVorbis();
virtual QString type() const { return QLatin1String( "Ogg Vorbis" ); }
......@@ -56,7 +56,7 @@ public:
virtual const char * mimeType() const;
virtual void fillSongInfo( KCDDB::CDInfo info, int track, const QString &comment );
virtual long readInit(long size);
virtual long read(int16_t * buf, int frames);
virtual long read(qint16 * buf, int frames);
virtual long readCleanup();
virtual QWidget* getConfigureWidget(KConfigSkeleton** manager) const;
......
......@@ -47,12 +47,12 @@ extern "C"
#include "cdda_interface.hpp"
}
inline int16_t swap16 (int16_t i)
inline qint16 swap16 (qint16 i)
{
return (((i >> 8) & 0xFF) | ((i << 8) & 0xFF00));
}
long EncoderCda::read(int16_t * buf, int frames){
long EncoderCda::read(qint16 * buf, int frames){
QByteArray output;
int16_t i16 = 1;
/* WAV is defined to be little endian, so we need to swap it
......
......@@ -48,7 +48,7 @@ public:
virtual const char * fileType() const { return "cda"; }
virtual void fillSongInfo( KCDDB::CDInfo, int, const QString &){}
virtual long readInit(long){ return 0; }
virtual long read(int16_t * buf, int frames);
virtual long read(qint16 * buf, int frames);
virtual long readCleanup(){ return 0; }
private:
......
Markdown is supported
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