full functionality restored, slight cleanup

This commit is contained in:
Hane 2023-08-16 23:18:36 +02:00
commit 1797b39b30
5 changed files with 27 additions and 150 deletions

View file

@ -29,15 +29,12 @@ uint64_t EndpointHandler::getIndex(){
* -1 for master volume
*/
void EndpointHandler::setVolume(NGuid* guid, int channel, int value){
if (channel == ENDPOINT_MASTER_VOLUME)
if (channel == AudioChannel::CHANNEL_MAIN)
ep->setVolume(guid, channel, (float)value / 100);
else ep->setVolume(guid, channel, (float)value / 100);
}
void EndpointHandler::setMute(NGuid* guid, bool muted){
//Qt momento, de ahi el param?
//TODO: mutex test
//log_debugcpp("kinda handling the muting tbh");
ep->setMute(guid, muted);
}
@ -100,53 +97,3 @@ NGuid* OverseerHandler::getGuid() {
void OverseerHandler::setEndpointHandlers(std::vector<EndpointHandler*> ephs){
this->endpointHandlers = ephs;
}
void OverseerHandler::setFrontVolumeCallback(std::function<void(uint64_t, uint32_t, float)> f) {
this->updateFrontVolumeCallback = f;
}
void OverseerHandler::setFrontMuteCallback(std::function<void(uint64_t, bool)> f) {
this->updateFrontMuteCallback = f;
}
/*
* void OverseerHandler::updateMuteCallback(uint64_t idx, bool muted){
* updateFrontMuteCallback(idx, muted);
* }
*/
/*
* void OverseerHandler::updateMainVolumeCallback(uint64_t idx, float newVal){
*
* }
*/
/*
* void OverseerHandler::updateVolumeCallback(uint64_t idx, uint32_t channel, float newVal){
* if (channel == (uint32_t)AudioChannel::CHANNEL_MAIN) {
* //TODO: mutex test
* //log_debugcpp("mainvolcallback float: " << newVal);
* updateFrontVolumeCallback(idx, AudioChannel::CHANNEL_MAIN, newVal);
* return;
* }
*
*
* // convert channel to bitmask
* uint32_t i = 0;
* while (i < channel)
* i++;
* uint32_t mask = (1 << i);
* //TODO: Mutex test
* //log_debugcpp("Back->Cont Channel: " << mask << " volcallback float: " << newVal);
*
* updateFrontVolumeCallback(idx, mask, newVal);
* }
*/
/*
* void OverseerHandler::receiveBackEndpointCallback(uint64_t index) {
* if (memcmp(os.getGuid(), callbackInfo.caller, sizeof(*guid)) != 0)
* updateFrontCallback(uint64_t index, &callbackInfo);
*
* }
*/