main slider cbk, detected minor l_dcpp bug

This commit is contained in:
Hane 2023-08-13 15:25:34 +02:00
commit 679ad34f84
7 changed files with 49 additions and 22 deletions

View file

@ -26,10 +26,10 @@ uint64_t EndpointHandler::getIndex(){
/*
* -1 for master volume
*/
void EndpointHandler::setValue(int channel, int value){
void EndpointHandler::setVolume(NGuid* guid, int channel, int value){
if (channel == ENDPOINT_MASTER_VOLUME)
ep->setVolume(channel, (float)value / 100);
else ep->setVolume(channel, (float)value / 100);
ep->setVolume(guid, channel, (float)value / 100);
else ep->setVolume(guid, channel, (float)value / 100);
}
void EndpointHandler::setMute(NGuid* guid, bool muted){
@ -114,3 +114,10 @@ void OverseerHandler::updateMuteCallback(uint64_t idx, bool muted){
epwMuteFunc f = &EndpointWidget::updateMute;
std::invoke(f, endpointWidgets.at(idx), muted);
}
void OverseerHandler::updateMainVolumeCallback(uint64_t idx, float newVal){
//int translatedNewVal = newVal * 100;
log_debugcpp("mainvolcallback float: " << newVal);
epwMainVolumeFunc f = &EndpointWidget::updateMainVolume;
std::invoke(f, endpointWidgets.at(idx), newVal);
}