[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/arts/knotify
From: Matthias Kretz <kretz () kde ! org>
Date: 2003-08-14 10:34:49
[Download RAW message or body]
CVS commit by mkretz:
Use the aRts audio manager for output. Now you can open aRts Control and
route the "KDE System Notifications" through a mixer or/and effect rack.
Pretty cool.
M +21 -0 knotify.cpp 1.81
M +1 -0 knotify.h 1.28
--- kdelibs/arts/knotify/knotify.cpp #1.80:1.81
@@ -56,4 +56,5 @@
#include <kiconloader.h>
#include <kplayobjectfactory.h>
+#include <kaudiomanagerplay.h>
#include <kprocess.h>
#include <kstandarddirs.h>
@@ -82,4 +83,5 @@ public:
int volume;
QTimer *playTimer;
+ KAudioManagerPlay *audioManager;
};
@@ -213,4 +215,10 @@ KNotify::KNotify( bool useArts )
d->useArts = useArts;
d->playObjects.setAutoDelete(true);
+ d->audioManager = 0;
+ if( useArts )
+ {
+ connect( soundServer, SIGNAL( restartedServer() ), this, SLOT( restartedArtsd() ) );
+ restartedArtsd(); //started allready need to initialize d->audioManager
+ }
d->volume = 100;
@@ -230,4 +238,5 @@ KNotify::~KNotify()
delete d->globalConfig;
delete d->externalPlayerProc;
+ delete d->audioManager;
delete d;
}
@@ -417,4 +426,6 @@ bool KNotify::notifyBySound( const QStri
KDE::PlayObjectFactory factory(soundServer->server());
+ if( d->audioManager )
+ factory.setAudioManagerPlay( d->audioManager );
KURL soundURL;
soundURL.setPath(soundFile);
@@ -691,2 +702,12 @@ WId KNotify::checkWinId( const QString &
return senderWinId;
}
+
+void KNotify::restartedArtsd()
+{
+ delete d->audioManager;
+ d->audioManager = new KAudioManagerPlay( soundServer );
+ d->audioManager->setTitle( i18n( "KDE System Notifications" ) );
+ d->audioManager->setAutoRestoreID( "KNotify Aman Play" );
+}
+
+// vim: sw=4 sts=4 ts=8 et
--- kdelibs/arts/knotify/knotify.h #1.27:1.28
@@ -94,4 +94,5 @@ private slots:
void playTimeout();
void slotPlayerProcessExited( KProcess *proc );
+ void restartedArtsd();
private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic