qpulse: wrappers for setting card profile
This commit is contained in:
parent
257d26248d
commit
06c38bda9c
21
qpulse.cpp
21
qpulse.cpp
@ -37,6 +37,7 @@ bool QPulse::RequestServerInfo()
|
||||
}
|
||||
|
||||
pa_operation_unref(o);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QPulse::RequestCardInfo()
|
||||
@ -49,6 +50,18 @@ bool QPulse::RequestCardInfo()
|
||||
}
|
||||
|
||||
pa_operation_unref(o);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QPulse::SetCardProfile(int32_t card_index, const char* profile_name)
|
||||
{
|
||||
pa_operation* o = pa_context_set_card_profile_by_index(c, card_index, profile_name, &QPulse::onSetCardProfileCompleteSt, this);
|
||||
if (! o) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pa_operation_unref(o);
|
||||
return true;
|
||||
}
|
||||
|
||||
void QPulse::onGotCardInfoListSt(pa_context*, const pa_card_info *i, int eol, void *userdata)
|
||||
@ -74,3 +87,11 @@ void QPulse::onConnectionStateChangedSt(pa_context*, void *userdata)
|
||||
|
||||
emit qp->ConnectionStateChanged();
|
||||
}
|
||||
|
||||
void QPulse::onSetCardProfileCompleteSt(pa_context*, int success, void *userdata)
|
||||
{
|
||||
QPulse* qp = static_cast<QPulse*>(userdata);
|
||||
//ThreadedMainLoopLock lock(qp->ml);
|
||||
|
||||
emit qp->SetCardProfileOperationCompleted(success);
|
||||
}
|
||||
|
3
qpulse.h
3
qpulse.h
@ -15,11 +15,13 @@ public:
|
||||
|
||||
bool RequestServerInfo();
|
||||
bool RequestCardInfo();
|
||||
bool SetCardProfile(int32_t card_index, const char* profile_name);
|
||||
|
||||
signals:
|
||||
void ConnectionStateChanged();
|
||||
void GotServerInfo(const pa_server_info& i);
|
||||
void GotCardInfoList(const pa_card_info& i, int eol);
|
||||
void SetCardProfileOperationCompleted(int success);
|
||||
|
||||
public slots:
|
||||
|
||||
@ -31,6 +33,7 @@ private:
|
||||
static void onConnectionStateChangedSt(pa_context *c, void *userdata);
|
||||
static void onGotServerInfoSt(pa_context *c, const pa_server_info *i, void *userdata);
|
||||
static void onGotCardInfoListSt(pa_context *c, const pa_card_info *i, int eol, void *userdata);
|
||||
static void onSetCardProfileCompleteSt(pa_context *c, int success, void *userdata);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user