kalarm

SoundPicker Class Reference

List of all members.

Detailed Description

Definition at line 34 of file soundpicker.h.


Public Types

 BEEP = 1
 SPEAK
 PLAY_FILE
enum  Type { BEEP = 1, SPEAK, PLAY_FILE }

Public Member Functions

 SoundPicker (QWidget *parent, const char *name=0)
void set (bool sound, Type defaultType, const QString &filename, float volume, float fadeVolume, int fadeSeconds, bool repeat)
bool isReadOnly () const
void setReadOnly (bool readOnly)
void showSpeak (bool show)
bool sound () const
Type type () const
bool beep () const
bool speak () const
QString file () const
float volume (float &fadeVolume, int &fadeSeconds) const
bool repeat () const
QString fileSetting () const
bool repeatSetting () const

Static Public Member Functions

static QString browseFile (QString &initialDir, const QString &initialFile=QString::null)
static QString i18n_Sound ()
static QString i18n_s_Sound ()
static QString i18n_Beep ()
static QString i18n_b_Beep ()
static QString i18n_Speak ()
static QString i18n_p_Speak ()
static QString i18n_File ()

Member Enumeration Documentation

Sound options which can be selected for when the alarm is displayed.

  • BEEP - a beep will be sounded.
  • SPEAK - the message will be spoken.
  • PLAY_FILE - a sound file will be played.

Definition at line 43 of file soundpicker.h.


Constructor & Destructor Documentation

SoundPicker::SoundPicker ( QWidget *  parent,
const char *  name = 0 
)

Constructor.

Parameters:
parent The parent object of this widget.
name The name of this widget.

Definition at line 62 of file soundpicker.cpp.


Member Function Documentation

bool SoundPicker::beep (  )  const

Returns true if 'beep' is selected.

Definition at line 178 of file soundpicker.cpp.

QString SoundPicker::browseFile ( QString &  initialDir,
const QString &  initialFile = QString::null 
) [static]

Display a dialogue to choose a sound file, initially highlighting initialFile if non-null.

Parameters:
initialDir Initial directory to display if initialFile is null. If a file is chosen, this is updated to the directory containing the chosen file.
initialFile Full path name or URL of file to be highlighted initially. If null, no file will be highlighted.
Returns:
URL selected, in human readable format. If none is selected, URL.isEmpty() is true.

Definition at line 342 of file soundpicker.cpp.

QString SoundPicker::file (  )  const

If the 'file' option is selected, returns the URL of the chosen file.

Otherwise returns a null string.

Definition at line 195 of file soundpicker.cpp.

QString SoundPicker::fileSetting (  )  const [inline]

Returns the current file URL regardless of whether the 'file' option is selected.

Definition at line 102 of file soundpicker.h.

bool SoundPicker::isReadOnly (  )  const [inline]

Returns true if the widget is read only for the user.

Definition at line 70 of file soundpicker.h.

bool SoundPicker::repeat (  )  const

Returns true if a sound file is to be played repeatedly.

If the 'file' option is not selected, returns false.

Definition at line 224 of file soundpicker.cpp.

bool SoundPicker::repeatSetting (  )  const [inline]

Returns the current file repetition setting regardless of whether the 'file' option is selected.

Definition at line 104 of file soundpicker.h.

void SoundPicker::set ( bool  sound,
Type  defaultType,
const QString &  filename,
float  volume,
float  fadeVolume,
int  fadeSeconds,
bool  repeat 
)

Initialises the widget's state.

Parameters:
sound True to enable sound.
defaultType The default option to select when sound is enabled.
filename The full path or URL of the sound file to select. If the 'file' option is not initially selected, filename provides the default should 'file' later be selected by the user.
volume The volume to play a sound file, or < 0 for no volume setting. If the 'file' option is not initially selected, volume provides the default should 'file' later be selected by the user.
fadeVolume The initial volume to play a sound file if fading is to be used, or < 0 for no fading. If the 'file' option is not initially selected, fadeVolume provides the default should 'file' later be selected by the user.
fadeSeconds The number of seconds over which the sound file volume should be faded, or 0 for no fading. If the 'file' option is not initially selected, fadeSeconds provides the default should 'file' later be selected by the user.
repeat True to play the sound file repeatedly. If the 'file' option is not initially selected, repeat provides the default should 'file' later be selected by the user.

Definition at line 232 of file soundpicker.cpp.

void SoundPicker::setReadOnly ( bool  readOnly  ) 

Sets whether the widget can be changed the user.

Parameters:
readOnly True to set the widget read-only, false to set it read-write.

Definition at line 128 of file soundpicker.cpp.

void SoundPicker::showSpeak ( bool  show  ) 

Show or hide the 'speak' option.

If it is to be hidden and it is currently selected, sound is turned off.

Definition at line 143 of file soundpicker.cpp.

bool SoundPicker::sound (  )  const

Returns true if sound is selected.

Definition at line 162 of file soundpicker.cpp.

bool SoundPicker::speak (  )  const

Returns true if 'speak' is selected.

Definition at line 186 of file soundpicker.cpp.

SoundPicker::Type SoundPicker::type (  )  const

Returns the selected option.

Definition at line 170 of file soundpicker.cpp.

float SoundPicker::volume ( float &  fadeVolume,
int &  fadeSeconds 
) const

Returns the volume and fade characteristics for playing a sound file.

Parameters:
fadeVolume Receives the initial volume if the volume is to be faded, else -1.
fadeSeconds Receives the number of seconds over which the volume is to be faded, else 0.
Returns:
Volume to play the sound file, or < 0 if the 'file' option is not selected.

Definition at line 204 of file soundpicker.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys