From f14e0ffa4697077b7d57ac510f6c83fad6aeb665 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Sep 2007 18:39:23 +0000 Subject: add support for configuring module-combine git-svn-id: file:///home/lennart/svn/public/paprefs/trunk@29 54a58c19-9419-0410-9bbb-d8fa3e5d54ff --- src/paprefs.cc | 40 +++++++- src/paprefs.glade | 278 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 185 insertions(+), 133 deletions(-) (limited to 'src') diff --git a/src/paprefs.cc b/src/paprefs.cc index 871f2de..b671671 100644 --- a/src/paprefs.cc +++ b/src/paprefs.cc @@ -46,7 +46,8 @@ public: *anonymousAuthCheckButton, *rtpReceiveCheckButton, *rtpSendCheckButton, - *rtpLoopbackCheckButton; + *rtpLoopbackCheckButton, + *combineCheckButton; Gtk::RadioButton *rtpMikeRadioButton, @@ -62,11 +63,13 @@ public: void onChangeRemoteAccess(); void onChangeRtpReceive(); void onChangeRtpSend(); + void onChangeCombine(); void readFromGConf(); void checkForModules(); void writeToGConfRemoteAccess(); void writeToGConfRtpReceive(); void writeToGConfRtpSend(); + void writeToGConfCombine(); void onGConfChange(const Glib::ustring& key, const Gnome::Conf::Value& value); bool rtpRecvAvailable, rtpSendAvailable, zeroconfAvailable, remoteAvailable; @@ -84,6 +87,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrget_widget("rtpReceiveCheckButton", rtpReceiveCheckButton); x->get_widget("rtpSendCheckButton", rtpSendCheckButton); x->get_widget("rtpLoopbackCheckButton", rtpLoopbackCheckButton); + x->get_widget("combineCheckButton", combineCheckButton); x->get_widget("rtpMikeRadioButton", rtpMikeRadioButton); x->get_widget("rtpSpeakerRadioButton", rtpSpeakerRadioButton); @@ -114,6 +118,8 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtrsignal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onChangeRtpSend)); rtpSpeakerRadioButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onChangeRtpSend)); rtpNullSinkRadioButton->signal_clicked().connect(sigc::mem_fun(*this, &MainWindow::onChangeRtpSend)); + + combineCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onChangeCombine)); } MainWindow* MainWindow::create() { @@ -170,6 +176,36 @@ void MainWindow::onChangeRtpSend() { writeToGConfRtpSend(); } +void MainWindow::onChangeCombine() { + Gnome::Conf::ChangeSet changeSet; + + if (ignoreChanges) + return; + + writeToGConfCombine(); +} + +void MainWindow::writeToGConfCombine() { + Gnome::Conf::ChangeSet changeSet; + changeSet.set(PA_GCONF_PATH_MODULES"/combine/locked", true); + gconf->change_set_commit(changeSet, true); + + if (combineCheckButton->get_active()) { + changeSet.set(PA_GCONF_PATH_MODULES"/combine/name0", Glib::ustring("module-combine")); + changeSet.set(PA_GCONF_PATH_MODULES"/combine/args0", Glib::ustring("")); + + changeSet.set(PA_GCONF_PATH_MODULES"/combine/enabled", true); + } else + changeSet.set(PA_GCONF_PATH_MODULES"/combine/enabled", false); + + gconf->change_set_commit(changeSet, true); + + changeSet.set(PA_GCONF_PATH_MODULES"/combine/locked", false); + gconf->change_set_commit(changeSet, true); + + gconf->suggest_sync(); +} + void MainWindow::writeToGConfRemoteAccess() { Gnome::Conf::ChangeSet changeSet; bool zeroconfEnabled, anonymousEnabled; @@ -306,6 +342,8 @@ void MainWindow::readFromGConf() { else rtpNullSinkRadioButton->set_active(TRUE); + combineCheckButton->set_active(gconf->get_bool(PA_GCONF_PATH_MODULES"/combine/enabled")); + ignoreChanges = FALSE; updateSensitive(); diff --git a/src/paprefs.glade b/src/paprefs.glade index 4dfae02..666ebd6 100644 --- a/src/paprefs.glade +++ b/src/paprefs.glade @@ -82,19 +82,23 @@ 12 12 - + True - 18 + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True + 12 6 - + True - 0 - <b>Network Access</b> - True + True + Enable _network access to local sound devices + True + 0 + True False @@ -102,18 +106,18 @@ - + True 12 - + True 6 - + True True - Enable _network access to local sound devices + Allow other machines on LAN to _browse for local sound devices True 0 True @@ -124,46 +128,17 @@ - + True - 12 - - - True - 6 - - - True - True - Allow other machines in LAN to _browse for local sound devices - True - 0 - True - - - False - False - - - - - True - True - Don't require _authentication - True - 0 - True - - - False - False - 1 - - - - + True + Don't require _authentication + True + 0 + True + False + False 1 @@ -176,39 +151,69 @@ - False - False + False - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + N_etwork Access + True + + + tab + False + False + + + + + True + 12 6 - + True - 0 - <b>Multicast/RTP</b> - True + True + Enable Multicast/RTP _receiver + True + 0 + True + + + False + False + + + + + True + True + Enable Multicast/RTP _sender + True + 0 + True False False + 1 - + True 12 - + True 6 - + True True - Enable Multicast/RTP _receiver + Send audio from local _microphone True 0 True @@ -219,13 +224,14 @@ - + True True - Enable Multicast/RTP _sender + Send audio from local s_peakers True 0 True + rtpMikeRadioButton False @@ -234,92 +240,100 @@ - + True - 12 - - - True - 6 - - - True - True - Send audio from local _microphone - True - 0 - True - - - False - False - - - - - True - True - Send audio from local s_peakers - True - 0 - True - rtpMikeRadioButton - - - False - False - 1 - - - - - True - True - Create seperate audio _device for Multicast/RTP - True - 0 - True - rtpMikeRadioButton - - - False - False - 2 - - - - - True - True - _Loopback audio to local speakers - True - 0 - True - - - False - False - 3 - - - - + True + Create seperate audio _device for Multicast/RTP + True + 0 + True + rtpMikeRadioButton + False + False 2 + + + True + True + _Loopback audio to local speakers + True + 0 + True + + + False + False + 3 + + - 1 + 2 - False 1 + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Multicast/R_TP + True + + + tab + 1 + False + False + + + + + True + 12 + 6 + + + True + True + Add _virtual output device for simultaneous output on all sound cards + True + 0 + True + + + False + False + + + + + 2 + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Sim_ultaneous Output + True + + + tab + 2 + False + False -- cgit