Input select via remote

I have integrated the IR remote and would love a way to be able to switch inputs via the remote…IE one button to cycle Spotify->Analog Input1-> Optical input 1. Basically be able to define the sources i want in the cycle and if they are present each press jumps to the next. Or be able to allocate a button to each.