summaryrefslogtreecommitdiffstats
path: root/kdemm/volumecontrold
diff options
context:
space:
mode:
Diffstat (limited to 'kdemm/volumecontrold')
-rw-r--r--kdemm/volumecontrold/Makefile.am31
-rw-r--r--kdemm/volumecontrold/volumecontrold.cpp47
-rw-r--r--kdemm/volumecontrold/volumecontrold.desktop13
-rw-r--r--kdemm/volumecontrold/volumecontrold.h53
4 files changed, 144 insertions, 0 deletions
diff --git a/kdemm/volumecontrold/Makefile.am b/kdemm/volumecontrold/Makefile.am
new file mode 100644
index 000000000..b7c7ca729
--- /dev/null
+++ b/kdemm/volumecontrold/Makefile.am
@@ -0,0 +1,31 @@
+# This file is part of the KDE project
+# Copyright (C) 2004 Matthias Kretz <kretz@kde.org>
+
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License version 2 as published by the Free Software Foundation.
+
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+INCLUDES = -I$(top_srcdir) $(all_includes)
+
+kde_module_LTLIBRARIES = kded_volumecontrold.la
+
+kded_volumecontrold_la_LDFLAGS = $(all_libraries) -module -avoid-version
+kded_volumecontrold_la_LIBADD = ../libkdemm.la
+kded_volumecontrold_la_SOURCES = volumecontrold.cpp volumecontrold.skel
+
+METASOURCES = AUTO
+
+noinst_HEADERS = volumecontrold.h
+
+services_DATA = volumecontrold.desktop
+servicesdir = $(kde_servicesdir)/kded
diff --git a/kdemm/volumecontrold/volumecontrold.cpp b/kdemm/volumecontrold/volumecontrold.cpp
new file mode 100644
index 000000000..41fbc40fd
--- /dev/null
+++ b/kdemm/volumecontrold/volumecontrold.cpp
@@ -0,0 +1,47 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Matthias Kretz <kretz@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#include "volumecontrold.h"
+
+#include <kapplication.h>
+#include <dcopclient.h>
+
+extern "C"
+{
+ KDEDModule * create_volumecontrold( const TQCString &name )
+ {
+ return new VolumeControlD( name );
+ }
+}
+
+class VolumeControlD::Private
+{
+ public:
+};
+
+VolumeControlD::VolumeControlD( const TQCString & name )
+ : KDEDModule( name )
+{
+ connect( KApplication::dcopClient(), TQT_SIGNAL( applicationRemoved( const TQCString & ) ),
+ TQT_SLOT( applicationRemoved( const TQCString& ) ) );
+}
+
+#include "volumecontrold.moc"
+
+// vim: sw=4 ts=4 noet
diff --git a/kdemm/volumecontrold/volumecontrold.desktop b/kdemm/volumecontrold/volumecontrold.desktop
new file mode 100644
index 000000000..8c0bde15f
--- /dev/null
+++ b/kdemm/volumecontrold/volumecontrold.desktop
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Service
+ServiceTypes=KDEDModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=volumecontrold
+X-KDE-FactoryName=volumecontrold
+X-KDE-Kded-autoload=false
+X-KDE-Kded-load-on-demand=true
+
+Name=Volume Control
+Comment=volume control daemon module for KDED
diff --git a/kdemm/volumecontrold/volumecontrold.h b/kdemm/volumecontrold/volumecontrold.h
new file mode 100644
index 000000000..709323c47
--- /dev/null
+++ b/kdemm/volumecontrold/volumecontrold.h
@@ -0,0 +1,53 @@
+/* This file is part of the KDE project
+ Copyright (C) 2004 Matthias Kretz <kretz@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+#ifndef VOLUMECONTROLD_H
+#define VOLUMECONTROLD_H
+
+#include <kded/kdedmodule.h>
+#include <tqstringlist.h>
+
+class VolumeControlD : public KDEDModule
+{
+ Q_OBJECT
+ K_DCOP
+ public:
+ VolumeControlD(const TQCString &name);
+ virtual ~VolumeControlD();
+
+ k_dcop:
+ // think of some better API here...
+ TQStringList availableChannels() const;
+ TQStringList openConnectionsToChannel( const TQString & channel ) const;
+ float volume( const TQString & connection, const TQString & channel ) const;
+ void setVolume( const TQString & connection, const TQString & channel, float volume );
+
+ private slots:
+ /**
+ * When an app with a registered Channel goes down we want to notice...
+ */
+ void applicationRemoved( const TQCString & );
+
+ private:
+ class Private;
+ Private * d;
+};
+
+// vim: sw=4 ts=4 tw=80 noet
+#endif // VOLUMECONTROLD_H