From kde-commits Fri Dec 10 10:56:39 2004 From: John Tapsell Date: Fri, 10 Dec 2004 10:56:39 +0000 To: kde-commits Subject: kdelibs/kabc Message-Id: <20041210105639.462571BBDC () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110267621132230 CVS commit by johnflux: Add some very crappy documentation to sound.h in the hopes that someone else will make it better. M +28 -0 sound.h 1.6 --- kdelibs/kabc/sound.h #1.5:1.6 @@ -29,4 +29,32 @@ namespace KABC { +/** @short Class that holds a Sound clip for a contact. + * + * The sound can be played doing something like this: + * + * \code + * KTempFile tmp; + * if(sound.isIntern()) { + * tmp.file()->writeBlock( sound.data() ); + * tmp.close(); + * KAudioPlayer::play( tmp.name() ); + * } else if(!sound.url().isEmpty()) { + * QString tmpFile; + * if(!KIO::NetAccess::download(KURL(themeURL.url()), tmpFile, NULL)) + * { + * KMessageBox::error(0L, + * KIO::NetAccess::lastErrorString(), + * i18n("Failed to download sound file"), + * KMessageBox::Notify + * ); + * return; + * } + * KAudioPlayer::play( tmpFile ); + * } + * \code + * + * Unfortunetly KAudioPlayer::play is ASync, so to delete the temporary file, the best you can really do is set a timer. + * + */ class KABC_EXPORT Sound {