• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KAudioPlayer Class Reference

This class provides one-shot-and-forget audio playing. More...

#include <kaudioplayer.h>

Inheritance diagram for KAudioPlayer:

Inheritance graph
[legend]

List of all members.


Public Slots

void play ()

Public Member Functions

 KAudioPlayer (const QString &filename, QObject *parent=0, const char *name=0)
 ~KAudioPlayer ()

Static Public Member Functions

static void play (const QString &filename)

Detailed Description

This class provides one-shot-and-forget audio playing.

You will never know if what you wanted to play really got played.

It doesn't require linking any special libraries, as it operates over DCOP. In the current implementation, it only indirectly communicates with the aRts soundserver, using knotify as DCOP -> MCOP bridge.

Due to that fact, if you need "fast" response times, more control or feedback, use the MCOP interfaces rather than this.

An example of using this class is:

   KAudioPlayer::play("/var/share/foo.wav");

If you want to use signals & slots, you can do something like:

   KAudioPlayer player("/var/share/foo.wav");
   connect(&button, SIGNAL(clicked()), &player, SLOT(play()));

Definition at line 56 of file kaudioplayer.h.


Constructor & Destructor Documentation

KAudioPlayer::KAudioPlayer ( const QString &  filename,
QObject *  parent = 0,
const char *  name = 0 
)

Constructor.

Parameters:
filename Absolute path to the filename of the sound file to play
parent A parent QObject for this KAudioPlayer
name An internal name for this KAudioPlayer

Definition at line 33 of file kaudioplayer.cpp.

KAudioPlayer::~KAudioPlayer (  ) 

Destructor.

Definition at line 39 of file kaudioplayer.cpp.


Member Function Documentation

void KAudioPlayer::play (  )  [slot]

Play function as slot.

Plays the soundfile given to the constructor.

Definition at line 50 of file kaudioplayer.cpp.

void KAudioPlayer::play ( const QString &  filename  )  [static]

Static play function.

Parameters:
filename Absolute path to the filename of the sound file to play. if not absolute, goes off KDEDIR/share/sounds/ (preferred)

Definition at line 44 of file kaudioplayer.cpp.


The documentation for this class was generated from the following files:
  • kaudioplayer.h
  • kaudioplayer.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal