00001
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 <tqframe.h>
00025 #include <tqstring.h>
00026 #include <kdialogbase.h>
00027
00028 class TQHBox;
00029 class TQPushButton;
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
00043 public:
00044 SoundDlg(const TQString& file, float volume, float fadeVolume, int fadeSeconds, bool repeat,
00045 const TQString& caption, TQWidget* parent, const char* name = 0);
00046 ~SoundDlg();
00047 void setReadOnly(bool);
00048 bool isReadOnly() const { return mReadOnly; }
00049 TQString getFile() const { return mFileName; }
00050 bool getSettings(float& volume, float& fadeVolume, int& fadeSeconds) const;
00051 TQString defaultDir() const { return mDefaultDir; }
00052
00053 static TQString i18n_SetVolume();
00054 static TQString i18n_v_SetVolume();
00055 static TQString i18n_Repeat();
00056 static TQString i18n_p_Repeat();
00057
00058 protected:
00059 virtual void showEvent(TQShowEvent*);
00060 virtual void resizeEvent(TQResizeEvent*);
00061
00062 protected slots:
00063 virtual void slotOk();
00064
00065 private slots:
00066 void slotPickFile();
00067 void slotVolumeToggled(bool on);
00068 void slotFadeToggled(bool on);
00069 void playSound();
00070 void checkAudioPlay();
00071
00072 private:
00073 void stopPlay();
00074 bool checkFile();
00075
00076 TQPushButton* mFilePlay;
00077 LineEdit* mFileEdit;
00078 PushButton* mFileBrowseButton;
00079 CheckBox* mRepeatCheckbox;
00080 CheckBox* mVolumeCheckbox;
00081 Slider* mVolumeSlider;
00082 CheckBox* mFadeCheckbox;
00083 TQHBox* mFadeBox;
00084 SpinBox* mFadeTime;
00085 TQHBox* mFadeVolumeBox;
00086 Slider* mFadeSlider;
00087 TQString mDefaultDir;
00088 TQString mFileName;
00089 bool mReadOnly;
00090
00091 KArtsDispatcher* mArtsDispatcher;
00092 KDE::PlayObject* mPlayObject;
00093 TQTimer* mPlayTimer;
00094 TQString mLocalAudioFile;
00095 bool mPlayStarted;
00096 };
00097
00098 #endif