trying to follow cspot...

This commit is contained in:
philippe44
2023-04-19 00:43:06 +02:00
parent dc62afd788
commit 7dbed7a67b
36 changed files with 625 additions and 424 deletions

View File

@@ -1,15 +1,18 @@
#pragma once
#include <memory>
#include <stdint.h> // for uint8_t
#include <memory> // for shared_ptr, unique_ptr, weak_ptr
#include <vector> // for vector
#include "AccessKeyFetcher.h"
#include "CDNTrackStream.h"
#include "CSpotContext.h"
#include "TrackReference.h"
#include "protobuf/metadata.pb.h"
#include "protobuf/spirc.pb.h"
#include "MercurySession.h" // for MercurySession
#include "TrackReference.h" // for TrackReference
#include "protobuf/metadata.pb.h" // for Episode, Restriction, Track
namespace cspot {
class AccessKeyFetcher;
class CDNTrackStream;
struct Context;
class TrackProvider {
public:
TrackProvider(std::shared_ptr<cspot::Context> ctx);
@@ -23,11 +26,13 @@ class TrackProvider {
std::unique_ptr<cspot::CDNTrackStream> cdnStream;
Track trackInfo;
Episode episodeInfo;
std::weak_ptr<CDNTrackStream> currentTrackReference;
TrackReference trackIdInfo;
void queryMetadata();
void onMetadataResponse(MercurySession::Response& res);
bool doRestrictionsApply(Restriction* restrictions, int count);
void fetchFile(const std::vector<uint8_t>& fileId,
const std::vector<uint8_t>& trackId);
bool canPlayTrack(int index);