00001
00002
00003
00004 #ifndef SLSOUNDCONF_H_INCLUDED
00005 #define SLSOUNDCONF_H_INCLUDED
00006
00007 #include <qobject.h>
00008 #include <qstring.h>
00009 #include <qvaluelist.h>
00010
00011 #define SLSOUNDPLAYER_ERROR_NOERROR 0
00012 #define SLSOUNDPLAYER_ERROR_NOWPLAYING -1
00013 #define SLSOUNDPLAYER_ERROR_CANTPLAY -2
00014
00015 class SlSoundPlayerPrivate;
00016 class SlSoundPlayer : public QObject
00017 {
00018 public:
00019 SlSoundPlayer();
00020 ~SlSoundPlayer();
00021 int startPlay(const QString&);
00022 int syncPlay(const QString&);
00023 static int play(const QString&,bool block=false);
00024 void stop();
00025 protected:
00026 void timerEvent(QTimerEvent*);
00027 private:
00028 SlSoundPlayerPrivate *p;
00029 };
00030
00031 class SlSoundConfPrivate;
00032 class SlSoundConf : public QObject
00033 {
00034 public:
00035 SlSoundConf();
00036 ~SlSoundConf();
00037
00038
00039 enum SoundType{
00040
00041 ScheduleAlarm = 1,
00042
00043 Startup,
00044
00045 Alert,
00046
00047 TimeTone,
00048
00049 Connected,
00050
00051 StartSync,
00052
00053 SambaEvent,
00054
00055 ReceivedMail
00056 };
00057 static QValueList<SoundType> soundTypeList();
00058 static QString soundId(SoundType);
00059 static QString soundName(SoundType);
00060 static QString wavFileName(SoundType);
00061 static void play(SoundType,bool block=FALSE);
00062 static void setConfig(SoundType,const QString&);
00063 static void clearConfig(SoundType);
00064 static void clearConfig();
00065 static QString defWavFileName(SoundType);
00066 private:
00067 SlSoundConfPrivate *p;
00068 };
00069 typedef QValueList<SlSoundConf::SoundType> SlSoundTypeList;
00070
00071 #endif