endpoint add/remove foundational work

This commit is contained in:
Hane 2023-09-06 17:57:15 +02:00
commit a6a052f348
6 changed files with 103 additions and 96 deletions

View file

@ -7,13 +7,15 @@ EndpointHandler::EndpointHandler(uint64_t idx) {
this->ep = osh->getPlaybackEndpoints().at(idx);
epc = new EndpointVolumeCallback(ep);
//epName = ep->getName();
ep->setVolumeCallback(epc);
callbackInfo.muted = this->getMute();
callbackInfo.mainVolume = this->getVolume(AudioChannel::CHANNEL_MAIN);
callbackInfo.channels = this->getChannelCount();
callbackInfo.channelVolumes.resize(this->callbackInfo.channels);
for(uint32_t i = 0; i < this->getChannelCount(); i++){
callbackInfo.channelVolumes[i] = this->getVolume(i);
if (this->ep->getState() == EndpointState::ENDPOINT_ACTIVE) {
callbackInfo.muted = this->getMute();
callbackInfo.mainVolume = this->getVolume(AudioChannel::CHANNEL_MAIN);
callbackInfo.channels = this->getChannelCount();
ep->setVolumeCallback(epc);
callbackInfo.channelVolumes.resize(this->callbackInfo.channels);
for(uint32_t i = 0; i < this->getChannelCount(); i++){
callbackInfo.channelVolumes[i] = this->getVolume(i);
}
}
}
@ -72,7 +74,7 @@ bool EndpointHandler::getMute(){
return ep->getMute();
}
uint8_t EndpointHandler::getState(){
size_t EndpointHandler::getState(){
return ep->getState();
}