 
 void initializeAmplifier() {
   pinMode(AMPLIFIER_ENABLE_PIN, OUTPUT);
-  pinMode(HEADSET_LEVEL_PIN, INPUT_PULLUP);
+  pinMode(HEADPHONE_LEVEL_PIN, INPUT_PULLUP);
   enableAmplifier(false);
 }
 

    if (state == PLAY_SELECTED) stopPlaying();
    nextTimeoutTick = 0; // no timeout during playing
    enablePlayer(true);
    enableAmplifier(!headset);
    onStartFirstTrack(index);
  }
}

  onEnterIdle(1200);
}

void onHeadphoneInserted(boolean plugged) {
  headphone = plugged;
  if (plugged) {
    volume = volume + HEADPHONE_VOLUME_MAX - SPEAKER_VOLUME_MAX;
  } else {
    volume = volume + SPEAKER_VOLUME_MAX - HEADPHONE_VOLUME_MAX;
  }
  enableAmplifier(!headphone);
}

// Set volume for left, right channels. lower numbers == louder volume!
