From 5336feb8529aed15c9d57f55dba5742f59725976 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 28 Jul 2008 22:43:39 +0100 Subject: Add support for module-raop-discover --- src/paprefs.cc | 38 ++++++++++++++++++++++++++++++++++++++ src/paprefs.glade | 16 ++++++++++++++++ 2 files changed, 54 insertions(+) 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 #include +#include + #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::RefPtrget_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::RefPtrsignal_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 @@ 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Make discoverable Apple Air_tunes sound devices available locally + True + 0 + True + + + False + False + 3 + + -- cgit