Commit ff7367d1 authored by Scott Wheeler's avatar Scott Wheeler

Wrote a lovely little script to prefix all member variables with m_

and ran it on all of the classes.

svn path=/trunk/kdemultimedia/juk/; revision=209916
parent 2299f7f0
......@@ -22,100 +22,100 @@
// public members
////////////////////////////////////////////////////////////////////////////////
CachedTag::CachedTag(const QString &file) : Tag(file), externalTag(0), tagTrackNumber(0), tagYear(0), tagSeconds(0), tagExists(false)
CachedTag::CachedTag(const QString &file) : Tag(file), m_externalTag(0), m_tagTrackNumber(0), m_tagYear(0), m_tagSeconds(0), m_tagExists(false)
{
}
CachedTag::~CachedTag()
{
delete externalTag;
delete m_externalTag;
}
void CachedTag::save()
{
if(externalTag)
externalTag->save();
if(m_externalTag)
m_externalTag->save();
}
QString CachedTag::track() const
{
if(externalTag)
return externalTag->track();
if(m_externalTag)
return m_externalTag->track();
else
return tagTrack;
return m_tagTrack;
}
QString CachedTag::artist() const
{
if(externalTag)
return externalTag->artist();
if(m_externalTag)
return m_externalTag->artist();
else
return tagArtist;
return m_tagArtist;
}
QString CachedTag::album() const
{
if(externalTag)
return externalTag->album();
if(m_externalTag)
return m_externalTag->album();
else
return tagAlbum;
return m_tagAlbum;
}
Genre CachedTag::genre() const
{
if(externalTag)
return externalTag->genre();
if(m_externalTag)
return m_externalTag->genre();
else
return tagGenre;
return m_tagGenre;
}
int CachedTag::trackNumber() const
{
if(externalTag)
return externalTag->trackNumber();
if(m_externalTag)
return m_externalTag->trackNumber();
else
return tagTrackNumber;
return m_tagTrackNumber;
}
QString CachedTag::trackNumberString() const
{
if(externalTag)
return externalTag->trackNumberString();
if(m_externalTag)
return m_externalTag->trackNumberString();
else
return tagTrackNumberString;
return m_tagTrackNumberString;
}
int CachedTag::year() const
{
if(externalTag)
return externalTag->year();
if(m_externalTag)
return m_externalTag->year();
else
return tagYear;
return m_tagYear;
}
QString CachedTag::yearString() const
{
if(externalTag)
return externalTag->yearString();
if(m_externalTag)
return m_externalTag->yearString();
else
return tagYearString;
return m_tagYearString;
}
QString CachedTag::comment() const
{
if(externalTag)
return externalTag->comment();
if(m_externalTag)
return m_externalTag->comment();
else
return tagComment;
return m_tagComment;
}
bool CachedTag::hasTag() const
{
if(externalTag)
return externalTag->hasTag();
if(m_externalTag)
return m_externalTag->hasTag();
else
return tagExists;
return m_tagExists;
}
void CachedTag::setTrack(const QString &value)
......@@ -155,47 +155,47 @@ void CachedTag::setComment(const QString &value)
QString CachedTag::bitrateString() const
{
return tagBitrateString;
return m_tagBitrateString;
}
QString CachedTag::lengthString() const
{
return tagLengthString;
return m_tagLengthString;
}
int CachedTag::seconds() const
{
return tagSeconds;
return m_tagSeconds;
}
bool CachedTag::current() const
{
return(fileExists() &&
modificationTime.isValid() &&
m_modificationTime.isValid() &&
lastModified().isValid() &&
modificationTime >= Tag::lastModified());
m_modificationTime >= Tag::lastModified());
}
QDataStream &CachedTag::read(QDataStream &s)
{
s >> int(tagExists)
s >> int(m_tagExists)
>> tagTrack
>> tagArtist
>> tagAlbum
>> tagGenre
>> tagTrackNumber
>> tagTrackNumberString
>> tagYear
>> tagYearString
>> tagComment
>> m_tagTrack
>> m_tagArtist
>> m_tagAlbum
>> m_tagGenre
>> m_tagTrackNumber
>> m_tagTrackNumberString
>> m_tagYear
>> m_tagYearString
>> m_tagComment
>> tagBitrateString
>> tagLengthString
>> tagSeconds
>> m_tagBitrateString
>> m_tagLengthString
>> m_tagSeconds
>> fileName
>> modificationTime;
>> m_fileName
>> m_modificationTime;
return s;
}
......@@ -206,12 +206,12 @@ QDataStream &CachedTag::read(QDataStream &s)
Tag *CachedTag::proxiedTag()
{
if(!externalTag) {
if(!m_externalTag) {
Cache::instance()->remove(absFilePath());
externalTag = Tag::createTag(absFilePath(), true);
m_externalTag = Tag::createTag(absFilePath(), true);
}
return externalTag;
return m_externalTag;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -63,26 +63,26 @@ public:
private:
Tag *proxiedTag();
Tag *externalTag;
QString tagTrack;
QString tagArtist;
QString tagAlbum;
Genre tagGenre;
int tagTrackNumber;
QString tagTrackNumberString;
int tagYear;
QString tagYearString;
QString tagComment;
QString tagBitrateString;
QString tagLengthString;
int tagSeconds;
bool tagExists;
QString fileName;
QDateTime modificationTime;
Tag *m_externalTag;
QString m_tagTrack;
QString m_tagArtist;
QString m_tagAlbum;
Genre m_tagGenre;
int m_tagTrackNumber;
QString m_tagTrackNumberString;
int m_tagYear;
QString m_tagYearString;
QString m_tagComment;
QString m_tagBitrateString;
QString m_tagLengthString;
int m_tagSeconds;
bool m_tagExists;
QString m_fileName;
QDateTime m_modificationTime;
};
QDataStream &operator>>(QDataStream &s, CachedTag &t);
......
......@@ -55,23 +55,23 @@ void CollectionList::initialize(PlaylistSplitter *s, QWidget *parent, bool resto
QStringList CollectionList::artists() const
{
return artistList.values();
return m_artistList.values();
}
QStringList CollectionList::albums() const
{
return albumList.values();
return m_albumList.values();
}
CollectionListItem *CollectionList::lookup(const QString &file)
{
return itemsDict.find(file);
return m_itemsDict.find(file);
}
PlaylistItem *CollectionList::createItem(const QFileInfo &file, QListViewItem *)
{
QString path = file.absFilePath();
if(itemsDict.find(path))
if(m_itemsDict.find(path))
return 0;
return new CollectionListItem(file, path);
......@@ -145,12 +145,12 @@ void CollectionList::contentsDragMoveEvent(QDragMoveEvent *e)
void CollectionList::addToDict(const QString &file, CollectionListItem *item)
{
itemsDict.replace(file, item);
m_itemsDict.replace(file, item);
}
void CollectionList::removeFromDict(const QString &file)
{
itemsDict.remove(file);
m_itemsDict.remove(file);
}
void CollectionList::addArtist(const QString &artist)
......@@ -158,7 +158,7 @@ void CollectionList::addArtist(const QString &artist)
// Do a bit of caching since there will very often be "two in a row" insertions.
static QString previousArtist;
if(artist != previousArtist && !artistList.insert(artist))
if(artist != previousArtist && !m_artistList.insert(artist))
previousArtist = artist;
}
......@@ -167,7 +167,7 @@ void CollectionList::addAlbum(const QString &album)
// Do a bit of caching since there will very often be "two in a row" insertions.
static QString previousAlbum;
if(album != previousAlbum && !albumList.insert(album))
if(album != previousAlbum && !m_albumList.insert(album))
previousAlbum = album;
}
......
......@@ -86,9 +86,9 @@ protected:
private:
static CollectionList *list;
QDict<CollectionListItem> itemsDict;
SortedStringList artistList;
SortedStringList albumList;
QDict<CollectionListItem> m_itemsDict;
SortedStringList m_artistList;
SortedStringList m_albumList;
};
class CollectionListItem : public PlaylistItem
......
......@@ -26,7 +26,7 @@
////////////////////////////////////////////////////////////////////////////////
DirectoryList::DirectoryList(QStringList &directories, QWidget* parent, const char* name) : DirectoryListBase(parent, name, true, 0),
dirList(directories)
m_dirList(directories)
{
directoryListView->setFullWidth(true);
connect(addDirectoryButton, SIGNAL(clicked()), this, SLOT(addDirectory()));
......@@ -48,8 +48,8 @@ DirectoryList::~DirectoryList()
void DirectoryList::addDirectory()
{
QString dir = KFileDialog::getExistingDirectory();
if(!dir.isEmpty() && dirList.find(dir) == dirList.end()) {
dirList.append(dir);
if(!dir.isEmpty() && m_dirList.find(dir) == m_dirList.end()) {
m_dirList.append(dir);
new KListViewItem(directoryListView, dir);
emit(directoryAdded(dir));
}
......@@ -61,7 +61,7 @@ void DirectoryList::removeDirectory()
return;
QString dir = directoryListView->selectedItem()->text(0);
dirList.remove(dir);
m_dirList.remove(dir);
emit(directoryRemoved(dir));
delete directoryListView->selectedItem();
}
......
......@@ -39,7 +39,7 @@ private slots:
void removeDirectory();
private:
QStringList dirList;
QStringList m_dirList;
};
#endif
......@@ -21,14 +21,14 @@
// public members
////////////////////////////////////////////////////////////////////////////////
Genre::Genre() : QString(), ID3v1(255)
Genre::Genre() : QString(), m_ID3v1(255)
{
}
Genre::Genre(const QString &genreName, int ID3v1Number) : QString(genreName)
{
ID3v1 = ID3v1Number;
m_ID3v1 = ID3v1Number;
}
// Ok, this just looks *really* ugly at first, but after thinking I must have
......@@ -46,12 +46,12 @@ Genre &Genre::operator=(const QString &genreName)
int Genre::getID3v1() const
{
return ID3v1;
return m_ID3v1;
}
void Genre::setID3v1(int ID3v1Number)
{
ID3v1 = ID3v1Number;
m_ID3v1 = ID3v1Number;
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -32,7 +32,7 @@ public:
void setID3v1(int number);
private:
int ID3v1;
int m_ID3v1;
};
QDataStream &operator<<(QDataStream &s, const Genre &g);
......
......@@ -24,12 +24,12 @@
// public members
////////////////////////////////////////////////////////////////////////////////
GenreList::GenreList(bool createIndex) : QValueList<Genre>(), hasIndex(createIndex)
GenreList::GenreList(bool createIndex) : QValueList<Genre>(), m_hasIndex(createIndex)
{
}
GenreList::GenreList(const QString &file, bool createIndex) : QValueList<Genre>(), hasIndex(createIndex)
GenreList::GenreList(const QString &file, bool createIndex) : QValueList<Genre>(), m_hasIndex(createIndex)
{
load(file);
}
......@@ -48,14 +48,14 @@ void GenreList::load(const QString &file)
reader.setContentHandler(handler);
reader.parse(source);
if(hasIndex)
if(m_hasIndex)
initializeIndex();
}
QString GenreList::ID3v1Name(int ID3v1)
{
if(hasIndex && ID3v1 >= 0 && ID3v1 < int(index.size()))
return index[ID3v1];
if(m_hasIndex && ID3v1 >= 0 && ID3v1 < int(m_index.size()))
return m_index[ID3v1];
else
return QString::null;
}
......@@ -88,12 +88,12 @@ int GenreList::findIndex(const QString &item)
QString GenreList::name() const
{
return listName;
return m_listName;
}
void GenreList::setName(const QString &n)
{
listName = n;
m_listName = n;
}
////////////////////////////////////////////////////////////////////////////////
......@@ -102,9 +102,9 @@ void GenreList::setName(const QString &n)
void GenreList::initializeIndex()
{
index.clear();
index.resize(size());
m_index.clear();
m_index.resize(size());
for(GenreList::Iterator it = begin(); it != end(); ++it)
if((*it).getID3v1() >= 0 && (*it).getID3v1() < int(index.size()))
index[(*it).getID3v1()] = QString(*it);
if((*it).getID3v1() >= 0 && (*it).getID3v1() < int(m_index.size()))
m_index[(*it).getID3v1()] = QString(*it);
}
......@@ -38,7 +38,7 @@ public:
QString ID3v1Name(int ID3v1);
/**
* Do a "reverse" lookup. Given an ID3v1 genre name, find the index. Though
* Do a "reverse" lookup. Given an ID3v1 genre name, find the m_index. Though
* I didn't realize it at the time that I wrote it, this is a
* reimplimentation from QValueList; ours however caches the last search so
* it should speed things up a bit for "two in a row" searches that are
......@@ -48,8 +48,8 @@ public:
QString name() const;
void setName(const QString &n);
bool readOnly() const { return readOnlyList; }
void setReadOnly(bool ro) { readOnlyList = ro; }
bool readOnly() const { return m_readOnlyList; }
void setReadOnly(bool ro) { m_readOnlyList = ro; }
private:
/**
......@@ -59,10 +59,10 @@ private:
*/
void initializeIndex();
QValueVector<QString> index;
bool hasIndex;
QString listName;
bool readOnlyList;
QValueVector<QString> m_index;
bool m_hasIndex;
QString m_listName;
bool m_readOnlyList;
};
#endif
......@@ -56,7 +56,7 @@ void GenreListEditor::loadLists()
GenreListList lists = GenreListList::lists();
for(GenreListList::Iterator it = lists.begin(); it != lists.end(); it++) {
listDict.insert((*it).name(), &(*it));
m_listDict.insert((*it).name(), &(*it));
selectListBox->insertItem((*it).name());
}
......@@ -65,7 +65,7 @@ void GenreListEditor::loadLists()
void GenreListEditor::updateGenreList()
{
GenreList *currentList = listDict[selectListBox->currentText()];
GenreList *currentList = m_listDict[selectListBox->currentText()];
if(currentList) {
genreList->clear();
......
......@@ -42,7 +42,7 @@ private slots:
virtual void updateGenreName(const QString &name);
private:
QDict<GenreList> listDict;
QDict<GenreList> m_listDict;
};
#endif
......@@ -37,7 +37,7 @@ using namespace QGstPlay;
GStreamerPlayer::GStreamerPlayer() : QObject(0), Player()
{
currentVolume = 1.0;
m_currentVolume = 1.0;
positionNs = 0;
durationNs = 0;
......@@ -46,14 +46,14 @@ GStreamerPlayer::GStreamerPlayer() : QObject(0), Player()
GStreamerPlayer::~GStreamerPlayer()
{
delete player;
delete m_player;
}
void GStreamerPlayer::play(const QString &fileName, float volume)
{
currentFile = fileName;
m_currentFile = fileName;
if(!fileName.isNull())
player->setLocation(fileName);
m_player->setLocation(fileName);
play(volume);
}
......@@ -63,51 +63,51 @@ void GStreamerPlayer::play(float volume)
// 1.0 is full volume
positionNs = 0;
durationNs = 0;
if (player->getState() != Element::STATE_PLAYING) {
player->setState(Element::STATE_PLAYING);
player->setVolume(volume);
if (m_player->getState() != Element::STATE_PLAYING) {
m_player->setState(Element::STATE_PLAYING);
m_player->setVolume(volume);
}
}
void GStreamerPlayer::pause()
{
if(player->getState() != Element::STATE_PAUSED)
player->setState(Element::STATE_PAUSED);
if(m_player->getState() != Element::STATE_PAUSED)
m_player->setState(Element::STATE_PAUSED);
}
void GStreamerPlayer::stop()
{
if(player->getState() != Element::STATE_READY)
player->setState(Element::STATE_READY);
if(m_player->getState() != Element::STATE_READY)
m_player->setState(Element::STATE_READY);
}
void GStreamerPlayer::setVolume(float volume)
{
// 1.0 is full volume
player->setVolume(volume);
m_player->setVolume(volume);
}
float GStreamerPlayer::getVolume() const
{
// 1.0 is full volume
return player->getVolume();
return m_player->getVolume();
}
/////////////////////////////////////////////////////////////////////////////////
// player status functions
// m_player status functions
/////////////////////////////////////////////////////////////////////////////////
bool GStreamerPlayer::playing() const
{
// true if playing
return player->getState() == Element::STATE_PLAYING;
return m_player->getState() == Element::STATE_PLAYING;
}
bool GStreamerPlayer::paused() const
{
// true if paused
return player->getState() == Element::STATE_PAUSED;
return m_player->getState() == Element::STATE_PAUSED;
}
long GStreamerPlayer::totalTime() const
......@@ -129,22 +129,22 @@ int GStreamerPlayer::position() const
}
/////////////////////////////////////////////////////////////////////////////////
// player seek functions
// m_player seek functions
/////////////////////////////////////////////////////////////////////////////////
void GStreamerPlayer::seek(long seekTime)
{
// seek time in seconds?
player->seekToTime(seekTime*1000000000);
m_player->seekToTime(seekTime*1000000000);
}
void GStreamerPlayer::seekPosition(int position)
{
// position unit is 1/1000th
if(durationNs > 0)
player->seekToTime(position * durationNs / 1000L);
m_player->seekToTime(position * durationNs / 1000L);
else
player->seekToTime(0);
m_player->seekToTime(0);
}
......@@ -164,12 +164,12 @@ void GStreamerPlayer::setPosition(long long d)
void GStreamerPlayer::setupPlayer()
{
player = new Play(Play::PIPE_AUDIO_BUFFER_THREADED, this, "Play");
connect(player, SIGNAL(timeTick(long long)),
m_player = new Play(Play::PIPE_AUDIO_BUFFER_THREADED, this, "Play");
connect(m_player, SIGNAL(timeTick(long long)),
SLOT(setPosition(long long)));
connect(player, SIGNAL(streamLength(long long)),
connect(m_player, SIGNAL(streamLength(long long)),
SLOT(setDuration(long long)));
connect(player, SIGNAL(streamEnd()), SLOT(stop()));
connect(m_player, SIGNAL(streamEnd()), SLOT(stop()));
}
#include "gstreamerplayer.moc"
......
......@@ -65,14 +65,14 @@ private slots:
private:
void setupPlayer();
QGstPlay::Play *player;
QGstPlay::Play *m_player;
unsigned long long duration;
long long positionNs; // in ns
long long durationNs; // in ns
QString currentFile;
float currentVolume;
QString m_currentFile;
float m_currentVolume;
};
#endif
......
/***************************************************************************
tag.cpp - description
m_tag.cpp - description
-------------------
begin : Sun Feb 17 2002
copyright : (C) 2002 by Scott Wheeler
......@@ -39,74 +39,74 @@
// public members
////////////////////////////////////////////////////////////////////////////////
ID3Tag::ID3Tag(const QString &file) : Tag(file), fileName(file), changed(false)
ID3Tag::ID3Tag(const QString &file) : Tag(file), m_fileName(file), m_changed(false)
{
metaInfo = KFileMetaInfo(file, QString::null, KFileMetaInfo::Fastest);
m_metaInfo = KFileMetaInfo(file, QString::null, KFileMetaInfo::Fastest);
tag.Link(fileName.latin1());
m_tag.Link(m_fileName.latin1());
// the easy ones -- these are supported in the id3 class
char *temp;
temp = ID3_GetArtist(&tag);
tagArtist = temp;
temp = ID3_GetArtist(&m_tag);
m_tagArtist = temp;
delete [] temp;
temp = ID3_GetAlbum(&tag);
tagAlbum = temp;
temp = ID3_GetAlbum(&m_tag);
m_tagAlbum = temp;