diff options
author | Colin Guthrie <development@colin.guthr.ie> | 2008-07-28 22:43:39 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-02-22 16:42:34 +0000 |
commit | 5336feb8529aed15c9d57f55dba5742f59725976 (patch) | |
tree | a9f938cc5bb9fa0eb3b15cf1b04ee4fd4fe5cde5 /src | |
parent | ec2d521629835830db68e875ce30f0ff72beee08 (diff) |
Add support for module-raop-discover
Diffstat (limited to 'src')
-rw-r--r-- | src/paprefs.cc | 38 | ||||
-rw-r--r-- | src/paprefs.glade | 16 |
2 files changed, 54 insertions, 0 deletions
diff --git a/src/paprefs.cc b/src/paprefs.cc index 18e6696..f7f9191 100644 --- a/src/paprefs.cc +++ b/src/paprefs.cc @@ -28,6 +28,8 @@ #include <gconfmm.h> #include <libintl.h> +#include <libintl.h> + #define PA_GCONF_ROOT "/system/pulseaudio" #define PA_GCONF_PATH_MODULES PA_GCONF_ROOT"/modules" @@ -43,6 +45,7 @@ public: *remoteAccessCheckButton, *zeroconfPublishCheckButton, *zeroconfDiscoverCheckButton, + *zeroconfRaopDiscoverCheckButton, *anonymousAuthCheckButton, *rtpReceiveCheckButton, *rtpSendCheckButton, @@ -62,6 +65,7 @@ public: void updateSensitive(); void onChangeRemoteAccess(); void onChangeZeroconfDiscover(); + void onChangeZeroconfRaopDiscover(); void onChangeRtpReceive(); void onChangeRtpSend(); void onChangeCombine(); @@ -69,6 +73,7 @@ public: void checkForModules(); void writeToGConfRemoteAccess(); void writeToGConfZeroconfDiscover(); + void writeToGConfZeroconfRaopDiscover(); void writeToGConfRtpReceive(); void writeToGConfRtpSend(); void writeToGConfCombine(); @@ -85,6 +90,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade: x->get_widget("remoteAccessCheckButton", remoteAccessCheckButton); x->get_widget("zeroconfDiscoverCheckButton", zeroconfDiscoverCheckButton); + x->get_widget("zeroconfRaopDiscoverCheckButton", zeroconfRaopDiscoverCheckButton); x->get_widget("zeroconfBrowseCheckButton", zeroconfPublishCheckButton); x->get_widget("anonymousAuthCheckButton", anonymousAuthCheckButton); x->get_widget("rtpReceiveCheckButton", rtpReceiveCheckButton); @@ -115,6 +121,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade: anonymousAuthCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onChangeRemoteAccess)); zeroconfDiscoverCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onChangeZeroconfDiscover)); + zeroconfRaopDiscoverCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onChangeZeroconfRaopDiscover)); rtpReceiveCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onChangeRtpReceive)); @@ -175,6 +182,15 @@ void MainWindow::onChangeZeroconfDiscover() { writeToGConfZeroconfDiscover(); } +void MainWindow::onChangeZeroconfRaopDiscover() { + + if (ignoreChanges) + return; + + updateSensitive(); + writeToGConfZeroconfRaopDiscover(); +} + void MainWindow::onChangeRtpReceive() { if (ignoreChanges) return; @@ -286,6 +302,28 @@ void MainWindow::writeToGConfZeroconfDiscover() { gconf->suggest_sync(); } +void MainWindow::writeToGConfZeroconfRaopDiscover() { + Gnome::Conf::ChangeSet changeSet; + + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/locked", true); + gconf->change_set_commit(changeSet, true); + + if (zeroconfDiscoverCheckButton->get_active()) { + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/name0", Glib::ustring("module-raop-discover")); + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/args0", Glib::ustring("")); + + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/enabled", true); + } else + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/enabled", false); + + gconf->change_set_commit(changeSet, true); + + changeSet.set(PA_GCONF_PATH_MODULES"/raop-discover/locked", false); + gconf->change_set_commit(changeSet, true); + + gconf->suggest_sync(); +} + void MainWindow::writeToGConfRtpReceive() { Gnome::Conf::ChangeSet changeSet; diff --git a/src/paprefs.glade b/src/paprefs.glade index 0e9b50b..881b2cb 100644 --- a/src/paprefs.glade +++ b/src/paprefs.glade @@ -167,6 +167,22 @@ <property name="position">2</property> </packing> </child> + <child> + <widget class="GtkCheckButton" id="zeroconfRaopDiscoverCheckButton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Make discoverable Apple Air_tunes sound devices available locally</property> + <property name="use_underline">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> </widget> </child> <child> |