summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-05-31 17:54:34 +0000
committerLennart Poettering <lennart@poettering.net>2006-05-31 17:54:34 +0000
commit879eef6acb3c8a6ad937a5a7cfbfc9f151bcc0cd (patch)
tree5d6b0333d973b28b79dcf21dbd55ba426cbafc9d /src
parentf533f1625e70ce3a0df31320da3f2006cc60d764 (diff)
Make the volume meter buttons insensitive if pavumeter is not in the $PATH
git-svn-id: file:///home/lennart/svn/public/paman/trunk@69 cdefa82f-4ce1-0310-97f5-ab6066f37c3c
Diffstat (limited to 'src')
-rw-r--r--src/ServerInfoManager.cc8
-rw-r--r--src/ServerInfoManager.hh3
-rw-r--r--src/SinkWindow.cc2
-rw-r--r--src/SourceWindow.cc2
4 files changed, 14 insertions, 1 deletions
diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc
index 436912d..0e41cde 100644
--- a/src/ServerInfoManager.cc
+++ b/src/ServerInfoManager.cc
@@ -790,6 +790,14 @@ void ServerInfoManager::runVolumeMeter(const Glib::ustring &source) {
Glib::spawn_command_line_async(t);
}
+bool ServerInfoManager::volumeMeterSupported() {
+ gchar *c;
+ c = g_find_program_in_path(PAVUMETER_PATH);
+ g_free(c);
+
+ return !!c;
+}
+
void ServerInfoManager::killClient(uint32_t index) {
pa_operation_unref(pa_context_kill_client(&context, index, NULL, NULL));
}
diff --git a/src/ServerInfoManager.hh b/src/ServerInfoManager.hh
index 6467c05..c8ce1d8 100644
--- a/src/ServerInfoManager.hh
+++ b/src/ServerInfoManager.hh
@@ -243,7 +243,8 @@ public:
void playSample(uint32_t sample, uint32_t sink);
void runVolumeMeter(const Glib::ustring &source);
-
+ bool volumeMeterSupported();
+
void killClient(uint32_t index);
void killSourceOutput(uint32_t index);
void killSinkInput(uint32_t index);
diff --git a/src/SinkWindow.cc b/src/SinkWindow.cc
index d6971dd..93f39ec 100644
--- a/src/SinkWindow.cc
+++ b/src/SinkWindow.cc
@@ -70,6 +70,8 @@ SinkWindow::SinkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade:
volumeResetButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onVolumeResetButton));
volumeMuteButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onVolumeMuteButton));
volumeMeterButton->signal_clicked().connect(sigc::mem_fun(*this, &SinkWindow::onVolumeMeterButton));
+
+ volumeMeterButton->set_sensitive(serverInfoManager->volumeMeterSupported());
}
SinkWindow* SinkWindow::create() {
diff --git a/src/SourceWindow.cc b/src/SourceWindow.cc
index d12802d..52119ce 100644
--- a/src/SourceWindow.cc
+++ b/src/SourceWindow.cc
@@ -66,6 +66,8 @@ SourceWindow::SourceWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl
volumeResetButton->signal_clicked().connect(sigc::mem_fun(*this, &SourceWindow::onVolumeResetButton));
volumeMuteButton->signal_clicked().connect(sigc::mem_fun(*this, &SourceWindow::onVolumeMuteButton));
volumeMeterButton->signal_clicked().connect(sigc::mem_fun(*this, &SourceWindow::onVolumeMeterButton));
+
+ volumeMeterButton->set_sensitive(serverInfoManager->volumeMeterSupported());
}
SourceWindow* SourceWindow::create() {