mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 05:27:01 +03:00
new cspot/bell
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <atomic> // for atomic
|
||||
#include <cstdint> // for uint8_t, uint64_t, uint32_t
|
||||
#include <functional> // for function
|
||||
#include <memory> // for shared_ptr
|
||||
#include <mutex> // for mutex
|
||||
#include <string> // for string
|
||||
#include <unordered_map> // for unordered_map
|
||||
#include <vector> // for vector
|
||||
#include <atomic> // for atomic
|
||||
#include <cstdint> // for uint8_t, uint64_t, uint32_t
|
||||
#include <functional> // for function
|
||||
#include <memory> // for shared_ptr
|
||||
#include <mutex> // for mutex
|
||||
#include <string> // for string
|
||||
#include <unordered_map> // for unordered_map
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "BellTask.h" // for Task
|
||||
#include "Packet.h" // for Packet
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "Session.h" // for Session
|
||||
#include "protobuf/mercury.pb.h" // for Header
|
||||
|
||||
namespace cspot {
|
||||
namespace cspot {
|
||||
class TimeProvider;
|
||||
|
||||
class MercurySession : public bell::Task, public cspot::Session {
|
||||
@@ -33,7 +33,8 @@ class MercurySession : public bell::Task, public cspot::Session {
|
||||
};
|
||||
|
||||
typedef std::function<void(Response&)> ResponseCallback;
|
||||
typedef std::function<void(bool, const std::vector<uint8_t>&)> AudioKeyCallback;
|
||||
typedef std::function<void(bool, const std::vector<uint8_t>&)>
|
||||
AudioKeyCallback;
|
||||
typedef std::function<void()> ConnectionEstabilishedCallback;
|
||||
|
||||
enum class RequestType : uint8_t {
|
||||
@@ -82,7 +83,11 @@ class MercurySession : public bell::Task, public cspot::Session {
|
||||
return this->executeSubscription(type, uri, callback, nullptr, parts);
|
||||
}
|
||||
|
||||
void requestAudioKey(const std::vector<uint8_t>& trackId,
|
||||
void unregister(uint64_t sequenceId);
|
||||
|
||||
void unregisterAudioKey(uint32_t sequenceId);
|
||||
|
||||
uint32_t requestAudioKey(const std::vector<uint8_t>& trackId,
|
||||
const std::vector<uint8_t>& fileId,
|
||||
AudioKeyCallback audioCallback);
|
||||
|
||||
@@ -108,7 +113,7 @@ class MercurySession : public bell::Task, public cspot::Session {
|
||||
|
||||
std::unordered_map<uint64_t, ResponseCallback> callbacks;
|
||||
std::unordered_map<std::string, ResponseCallback> subscriptions;
|
||||
AudioKeyCallback audioKeyCallback;
|
||||
std::unordered_map<uint32_t, AudioKeyCallback> audioKeyCallbacks;
|
||||
|
||||
uint64_t sequenceId = 1;
|
||||
uint32_t audioKeySequence = 1;
|
||||
|
||||
Reference in New Issue
Block a user