diff --git a/qpulse.cpp b/qpulse.cpp index 6603803..5739d29 100644 --- a/qpulse.cpp +++ b/qpulse.cpp @@ -27,18 +27,28 @@ pa_context_state_t QPulse::ConnectionState() return pa_context_get_state(c); } -void QPulse::RequestServerInfo() +bool QPulse::RequestServerInfo() { //ThreadedMainLoopLock lock(ml); - pa_context_get_server_info(c, &QPulse::onGotServerInfoSt, this); + pa_operation* o = pa_context_get_server_info(c, &QPulse::onGotServerInfoSt, this); + if (! o) { + return false; + } + + pa_operation_unref(o); } -void QPulse::RequestCardInfo() +bool QPulse::RequestCardInfo() { //ThreadedMainLoopLock lock(ml); - pa_context_get_card_info_list(c, &QPulse::onGotCardInfoListSt, this); + pa_operation* o = pa_context_get_card_info_list(c, &QPulse::onGotCardInfoListSt, this); + if (! o) { + return false; + } + + pa_operation_unref(o); } void QPulse::onGotCardInfoListSt(pa_context*, const pa_card_info *i, int eol, void *userdata) diff --git a/qpulse.h b/qpulse.h index 4ae8373..0974036 100644 --- a/qpulse.h +++ b/qpulse.h @@ -13,8 +13,8 @@ public: pa_context_state_t ConnectionState(); - void RequestServerInfo(); - void RequestCardInfo(); + bool RequestServerInfo(); + bool RequestCardInfo(); signals: void ConnectionStateChanged();