kalarm
sounddlg.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SOUNDDLG_H
00022 #define SOUNDDLG_H
00023
00024 #include <qframe.h>
00025 #include <qstring.h>
00026 #include <kdialogbase.h>
00027
00028 class QHBox;
00029 class QPushButton;
00030 class KArtsDispatcher;
00031 namespace KDE { class PlayObject; }
00032 class LineEdit;
00033 class PushButton;
00034 class CheckBox;
00035 class SpinBox;
00036 class Slider;
00037
00038
00039 class SoundDlg : public KDialogBase
00040 {
00041 Q_OBJECT
00042 public:
00043 SoundDlg(const QString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
00044 const QString& caption, QWidget* parent, const char* name = 0);
00045 ~SoundDlg();
00046 void setReadOnly(bool);
00047 bool isReadOnly() const { return mReadOnly; }
00048 QString getFile() const { return mFileName; }
00049 bool getSettings(float& volume, float& fadeVolume, int& fadeSeconds) const;
00050 QString defaultDir() const { return mDefaultDir; }
00051
00052 static QString i18n_SetVolume();
00053 static QString i18n_v_SetVolume();
00054 static QString i18n_Repeat();
00055 static QString i18n_p_Repeat();
00056
00057 protected:
00058 virtual void showEvent(QShowEvent*);
00059 virtual void resizeEvent(QResizeEvent*);
00060
00061 protected slots:
00062 virtual void slotOk();
00063
00064 private slots:
00065 void slotPickFile();
00066 void slotVolumeToggled(bool on);
00067 void slotFadeToggled(bool on);
00068 void playSound();
00069 void checkAudioPlay();
00070
00071 private:
00072 void stopPlay();
00073 bool checkFile();
00074
00075 QPushButton* mFilePlay;
00076 LineEdit* mFileEdit;
00077 PushButton* mFileBrowseButton;
00078 CheckBox* mRepeatCheckbox;
00079 CheckBox* mVolumeCheckbox;
00080 Slider* mVolumeSlider;
00081 CheckBox* mFadeCheckbox;
00082 QHBox* mFadeBox;
00083 SpinBox* mFadeTime;
00084 QHBox* mFadeVolumeBox;
00085 Slider* mFadeSlider;
00086 QString mDefaultDir;
00087 QString mFileName;
00088 bool mReadOnly;
00089
00090 KArtsDispatcher* mArtsDispatcher;
00091 KDE::PlayObject* mPlayObject;
00092 QTimer* mPlayTimer;
00093 QString mLocalAudioFile;
00094 QTime mAudioFileStart;
00095 bool mPlayStarted;
00096 };
00097
00098 #endif
|