Commit 2e173c19 authored by Benjamin Meyer's avatar Benjamin Meyer
Browse files

Changed some base encoder functions to be const

svn path=/trunk/kdemultimedia/kioslave/audiocd/; revision=286159
parent cdbfcb09
......@@ -61,26 +61,26 @@ public:
* @param time_secs the lengh of the audio track in seconds.
* @returns the size of a file if it is time_secs in length.
*/
virtual unsigned long size(long time_secs) = 0;
virtual unsigned long size(long time_secs) const = 0;
/**
* @returns the generic user string type/name of this encoder
* Examples: "MP3", "Ogg Vorbis", "Wav", "FID Level 2", etc
*/
virtual QString type() = 0;
virtual QString type() const = 0;
/**
* @returns the mime type for the files this encoder produces.
* Example: "audio/x-wav"
*/
virtual const char * mimeType() = 0;
virtual const char * mimeType() const = 0;
/**
* @returns the file type for the files this encoder produces.
* Used in naming of the file for example foo.mp3
* Examples: "mp3", "ogg", "wav"
*/
virtual const char * fileType() = 0;
virtual const char * fileType() const = 0;
/**
* Before the read functions are called this is
......
......@@ -30,12 +30,12 @@ class EncoderCda::Private
};
unsigned long EncoderCda::size(long time_secs){
unsigned long EncoderCda::size(long time_secs) const {
//return (time_secs * (44100 * 2 * 16))/8;
return (time_secs) * 176400;
}
const char * EncoderCda::mimeType(){
const char * EncoderCda::mimeType() const {
return "audio/x-cda";
}
......
......@@ -42,10 +42,10 @@ public:
~EncoderCda(){};
virtual bool init(){ return true; };
virtual void loadSettings(KConfig *){};
virtual unsigned long size(long time_secs);
virtual QString type(){ return "CDA"; };
virtual const char * mimeType();
virtual const char * fileType(){ return "cda"; };
virtual unsigned long size(long time_secs) const;
virtual QString type() const { return "CDA"; };
virtual const char * mimeType() const;
virtual const char * fileType() const { return "cda"; };
virtual void fillSongInfo(QString,
QString,
QString,
......
......@@ -447,11 +447,11 @@ void EncoderLame::loadSettings(KConfig *config){
}
}
unsigned long EncoderLame::size(long time_secs){
unsigned long EncoderLame::size(long time_secs) const {
return (time_secs * d->bitrate * 1000)/8;
}
const char * EncoderLame::mimeType(){
const char * EncoderLame::mimeType() const {
return "audio/x-mp3";
}
......
......@@ -39,12 +39,12 @@ public:
EncoderLame(KIO::SlaveBase *slave);
~EncoderLame();
virtual QString type(){ return "MP3"; };
virtual QString type() const { return "MP3"; };
virtual bool init();
virtual void loadSettings(KConfig *config);
virtual unsigned long size(long time_secs);
virtual const char * fileType(){ return "mp3"; };
virtual const char * mimeType();
virtual unsigned long size(long time_secs) const;
virtual const char * fileType() const { return "mp3"; };
virtual const char * mimeType() const;
virtual void fillSongInfo(QString trackName,
......
......@@ -164,7 +164,7 @@ long EncoderVorbis::flush_vorbis(void) {
return processed;
}
unsigned long EncoderVorbis::size(long time_secs){
unsigned long EncoderVorbis::size(long time_secs) const {
long vorbis_size;
switch (d->vorbis_encode_method)
{
......@@ -196,7 +196,7 @@ unsigned long EncoderVorbis::size(long time_secs){
return vorbis_size;
}
const char * EncoderVorbis::mimeType(){
const char * EncoderVorbis::mimeType() const{
return "audio/vorbis";
}
......
......@@ -42,12 +42,12 @@ public:
EncoderVorbis(KIO::SlaveBase *slave);
~EncoderVorbis();
virtual QString type(){ return "Ogg Vorbis"; };
virtual QString type() const { return "Ogg Vorbis"; };
virtual bool init();
virtual void loadSettings(KConfig *config);
virtual unsigned long size(long time_secs);
virtual const char * fileType(){ return "ogg"; };
virtual const char * mimeType();
virtual unsigned long size(long time_secs) const;
virtual const char * fileType() const { return "ogg"; };
virtual const char * mimeType() const;
virtual void fillSongInfo(QString trackName,
QString cdArtist,
......
......@@ -30,11 +30,11 @@ class EncoderWav::Private
};
unsigned long EncoderWav::size(long time_secs){
unsigned long EncoderWav::size(long time_secs) const {
return (EncoderCda::size(time_secs) + 44);
}
const char * EncoderWav::mimeType(){
const char * EncoderWav::mimeType() const {
return "audio/x-wav";
}
......
......@@ -41,10 +41,10 @@ public:
~EncoderWav(){};
virtual bool init(){ return true; };
virtual void loadSettings(KConfig *){};
virtual unsigned long size(long time_secs);
virtual QString type(){ return "Wav"; };
virtual const char * fileType(){ return "wav"; };
virtual const char * mimeType();
virtual unsigned long size(long time_secs) const;
virtual QString type() const { return "Wav"; };
virtual const char * fileType() const { return "wav"; };
virtual const char * mimeType() const;
virtual void fillSongInfo(QString ,
QString ,
......
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