From 72f6cf7ca0d0baaef7fb0171e0d14cce50d1ef04 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 18 Aug 2004 01:01:12 +0000 Subject: add support for statwindow git-svn-id: file:///home/lennart/svn/public/paman/trunk@15 cdefa82f-4ce1-0310-97f5-ab6066f37c3c --- src/ServerInfoManager.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/ServerInfoManager.cc') diff --git a/src/ServerInfoManager.cc b/src/ServerInfoManager.cc index 1f454eb..9542773 100644 --- a/src/ServerInfoManager.cc +++ b/src/ServerInfoManager.cc @@ -342,7 +342,8 @@ static void subscribe_callback(struct pa_context *c, enum pa_subscription_event_ } ServerInfoManager::ServerInfoManager(struct pa_context &c) : - context(c) { + context(c), + statWindow(NULL) { pa_operation_unref(pa_context_get_server_info(&c, server_info_callback, this)); pa_operation_unref(pa_context_get_sink_info_list(&c, sink_info_callback, this)); pa_operation_unref(pa_context_get_source_info_list(&c, source_info_callback, this)); @@ -381,6 +382,9 @@ ServerInfoManager::~ServerInfoManager() { for (std::map::iterator i = sourceOutputs.begin(); i != sourceOutputs.end(); i++) delete i->second; + + if (statWindow) + delete statWindow; } void ServerInfoManager::updateInfo(const struct pa_sink_info &i) { @@ -572,3 +576,13 @@ void ServerInfoManager::setSinkVolume(uint32_t index, uint32_t volume) { void ServerInfoManager::setSinkInputVolume(uint32_t index, uint32_t volume) { pa_operation_unref(pa_context_set_sink_input_volume(&context, index, volume, NULL, NULL)); } + +void ServerInfoManager::showStatWindow() { + if (statWindow) + statWindow->present(); + else { + statWindow = StatWindow::create(); + statWindow->show(); + } + +} -- cgit