      on key press play a music file from the micro SD card from a specific folder and blink the respective key (/)
      on pressing the same key or when playback stops jump to the next file in the folder, until all music is played (/)
      read the rotary decoder to change the volume, the maximum volume can be configured (/)
+     press the rotary decoder to pause/resume (/)
      detect when a headphone is plugged in and mute the amplifier for the internal speakers (/)
      switch the music box off automatically after an idle period
 

    int encoderChange = encoder.getValue() * VOLUME_DIRECTION;
    if (encoderChange != 0) {
      changeVolume(encoderChange);
    }
  }


  }
}

void onPause(bool pause) {
  if (pause) {
    Serial.println("Pause");
    trellis.blinkRate(HT16K33_BLINK_HALFHZ);
    player.pausePlaying(true);
    enableAmplifier(false);
    state = PLAY_PAUSED;
  } else {
    Serial.println("Resume");
    trellis.blinkRate(HT16K33_BLINK_1HZ);
    enableAmplifier(!headset);
    player.pausePlaying(false);
    state = PLAY_SELECTED;
  }
}

void onStopPlaying() {
  enableAmplifier(false);
  enablePlayer(false);
