diff options
Diffstat (limited to 'src/ServerInfoManager.cc')
-rw-r--r-- | src/ServerInfoManager.cc | 16 |
1 files changed, 15 insertions, 1 deletions
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<int, SourceOutputInfo*>::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(); + } + +} |