update CSpot + clear audio buffer when changing track

This commit is contained in:
philippe44
2022-08-23 17:06:59 -07:00
parent 36f18fc069
commit 0222dbd6de
22 changed files with 383 additions and 93 deletions

View File

@@ -166,6 +166,8 @@ void SpircController::handleFrame(std::vector<uint8_t> &data) {
}
case MessageType_kMessageTypeReplace: {
CSPOT_LOG(debug, "Got replace frame!");
state->updateTracks();
this->notify();
break;
}
case MessageType_kMessageTypeShuffle: {
@@ -191,6 +193,7 @@ void SpircController::loadTrack(uint32_t position_ms, bool isPaused) {
std::function<void()> loadedLambda = [=]() {
// Loading finished, notify that playback started
setPause(isPaused, false);
sendEvent(CSpotEventType::PLAYBACK_START);
};
player->handleLoad(state->getCurrentTrack(), loadedLambda, position_ms,