#2926

prehaps, something like the following, where it is up to you get define getselection();

setup{
  if(!sd.begin(SD_SEL, SPI_HALF_SPEED)) sd.initErrorHalt();
  if(!sd.chdir("/")) sd.errorHalt("sd.chdir");
  MP3player.begin();
  prv_selection = selection;
}

loop{
  selection = getselection();
  if (()selection == 0) and (prv_selection != 0)) {
    MP3player.stopTrack();
    prv_selection = selection;
  }
  else if (selection != prv_selection) {
    MP3player.playTrack(selection);
    prv_selection = selection;
  }
  // do other stuff and then loop back around.
}