soundstreamid.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KRADIO_SOUNDSTREAMID_H
00019 #define KRADIO_SOUNDSTREAMID_H
00020
00021 #ifdef HAVE_CONFIG_H
00022 #include <config.h>
00023 #endif
00024
00025 #include <kdemacros.h>
00026 #include <QtCore/QMetaType>
00027
00028 class KDE_EXPORT SoundStreamID {
00029
00030 SoundStreamID(int _id, int _phys_id);
00031 public:
00032 SoundStreamID();
00033 SoundStreamID(const SoundStreamID &org);
00034
00035 SoundStreamID &operator = (const SoundStreamID &id);
00036
00037 static SoundStreamID createNewID();
00038 static SoundStreamID createNewID(const SoundStreamID &oldID);
00039
00040 bool operator == (const SoundStreamID id) const { return m_ID == id.m_ID; }
00041 bool operator != (const SoundStreamID id) const { return m_ID != id.m_ID; }
00042 bool operator > (const SoundStreamID id) const { return m_ID > id.m_ID; }
00043 bool operator < (const SoundStreamID id) const { return m_ID < id.m_ID; }
00044 bool operator >= (const SoundStreamID id) const { return m_ID >= id.m_ID; }
00045 bool operator <= (const SoundStreamID id) const { return m_ID <= id.m_ID; }
00046
00047 bool HasSamePhysicalID(const SoundStreamID &x) const { return m_PhysicalID == x.m_PhysicalID; }
00048
00049 bool isValid() const { return m_ID != 0; }
00050 void invalidate();
00051
00052 static const SoundStreamID InvalidID;
00053
00054 int getID() const { return m_ID; }
00055 int getPhysicalID() const { return m_PhysicalID; }
00056
00057 protected:
00058 unsigned m_ID;
00059 unsigned m_PhysicalID;
00060 static unsigned nextID;
00061 static unsigned nextPhysicalID;
00062 };
00063
00064 Q_DECLARE_METATYPE(SoundStreamID)
00065
00066 #endif
00067