Skip to content

Commit

Permalink
Add check for AUDIO module type under onButtonPressEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
ShobhitAd committed Aug 31, 2022
1 parent cd8ebe0 commit 72ac073
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions app/controller/sdl/RController.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ SDL.RController = SDL.SDLController.extend(
}
break;
}
case 'SOURCE': {
SDL.RCModulesController.currentAudioModel.changeSource();
break;
}
case 'SHUFFLE': {
if (SDL.RCModulesController.currentAudioModel.activeState == 'media.player.cd' ||
SDL.RCModulesController.currentAudioModel.activeState == 'media.player.usb') {
Expand Down Expand Up @@ -154,6 +150,20 @@ SDL.RController = SDL.SDLController.extend(
return result_struct;
}

if(params.moduleType == 'AUDIO') {
switch(params.buttonName){
case 'SOURCE': {
SDL.RCModulesController.currentAudioModel.changeSource();
break;
}
default: {
result_struct.resultCode = SDL.SDLModel.data.resultCode.GENERIC_ERROR;
result_struct.resultInfo = 'Unknown audio module button';
return result_struct;
}
}
}

return result_struct;
},

Expand Down

0 comments on commit 72ac073

Please sign in to comment.