mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-11 05:57:05 +03:00
move to new cspot
This commit is contained in:
35
components/spotify/cspot/include/TrackProvider.h
Normal file
35
components/spotify/cspot/include/TrackProvider.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "AccessKeyFetcher.h"
|
||||
#include "CDNTrackStream.h"
|
||||
#include "CSpotContext.h"
|
||||
#include "TrackReference.h"
|
||||
#include "protobuf/metadata.pb.h"
|
||||
#include "protobuf/spirc.pb.h"
|
||||
|
||||
namespace cspot {
|
||||
class TrackProvider {
|
||||
public:
|
||||
TrackProvider(std::shared_ptr<cspot::Context> ctx);
|
||||
~TrackProvider();
|
||||
|
||||
std::shared_ptr<CDNTrackStream> loadFromTrackRef(TrackReference& trackRef);
|
||||
|
||||
private:
|
||||
std::shared_ptr<AccessKeyFetcher> accessKeyFetcher;
|
||||
std::shared_ptr<cspot::Context> ctx;
|
||||
std::unique_ptr<cspot::CDNTrackStream> cdnStream;
|
||||
|
||||
Track trackInfo;
|
||||
std::weak_ptr<CDNTrackStream> currentTrackReference;
|
||||
TrackReference trackIdInfo;
|
||||
|
||||
void queryMetadata();
|
||||
void onMetadataResponse(MercurySession::Response& res);
|
||||
void fetchFile(const std::vector<uint8_t>& fileId,
|
||||
const std::vector<uint8_t>& trackId);
|
||||
bool canPlayTrack(int index);
|
||||
};
|
||||
} // namespace cspot
|
||||
Reference in New Issue
Block a user