idf overriding method to bring back SPDIF and fix SPI + new CSPOT (which crashes)

This commit is contained in:
Philippe G
2022-01-04 00:15:33 -08:00
parent cf1315e6a4
commit 06b637c55b
43 changed files with 2955 additions and 402 deletions

View File

@@ -4,7 +4,7 @@
#include <memory>
#include <iostream>
#include "FileHelper.h"
#include "ProtoHelper.h"
#include "protobuf/metadata.pb.h"
class ConfigJSON
{

View File

@@ -5,7 +5,7 @@
#include <memory>
#include <iostream>
#include "Crypto.h"
#include "ProtoHelper.h"
#include "protobuf/authentication.pb.h"
class LoginBlob
{

View File

@@ -10,7 +10,6 @@
#include "MercuryResponse.h"
#include "Packet.h"
#include "Utils.h"
#include "ProtoHelper.h"
#include "MercuryManager.h"
#include "AudioChunk.h"
#include "AudioChunkManager.h"
@@ -19,7 +18,8 @@
#include "platform/WrappedSemaphore.h"
#include "TimeProvider.h"
#include "Session.h"
#include <NanoPBHelper.h>
#include "protobuf/mercury.pb.h"
#include <stdint.h>
#include <memory>
@@ -56,6 +56,7 @@ extern std::map<MercuryType, std::string> MercuryTypeMap;
class MercuryManager : public bell::Task
{
private:
Header tempMercuryHeader;
std::map<uint64_t, mercuryCallback> callbacks;
std::mutex reconnectionMutex;
std::mutex runningMutex;
@@ -76,6 +77,7 @@ private:
void runTask();
public:
MercuryManager(std::unique_ptr<Session> session);
~MercuryManager();
voidCallback reconnectedCallback;
uint16_t audioChunkSequence;
std::shared_ptr<TimeProvider> timeProvider;

View File

@@ -6,7 +6,8 @@
#include <string>
#include <functional>
#include <vector>
#include "ProtoHelper.h"
#include <NanoPBHelper.h>
#include "protobuf/mercury.pb.h"
#include "Utils.h"
typedef std::vector<std::vector<uint8_t>> mercuryParts;
@@ -18,6 +19,7 @@ private:
std::vector<uint8_t> data;
public:
MercuryResponse(std::vector<uint8_t> &data);
~MercuryResponse();
void decodeHeader();
Header mercuryHeader;
uint8_t flags;

View File

@@ -4,13 +4,14 @@
#include <vector>
#include <memory>
#include <string>
#include "ProtoHelper.h"
#include "Utils.h"
#include "TimeProvider.h"
#include "ConstantParameters.h"
#include "CspotAssert.h"
#include "TrackReference.h"
#include "ConfigJSON.h"
#include <NanoPBHelper.h>
#include "protobuf/spirc.pb.h"
enum class PlaybackState {
Playing,
@@ -30,8 +31,8 @@ private:
void addCapability(CapabilityType typ, int intValue = -1, std::vector<std::string> stringsValue = std::vector<std::string>());
public:
Frame innerFrame = Frame();
Frame remoteFrame = Frame();
Frame innerFrame;
Frame remoteFrame;
/**
* @brief Player state represents the current state of player.
@@ -41,6 +42,8 @@ public:
* @param timeProvider synced time provider
*/
PlayerState(std::shared_ptr<TimeProvider> timeProvider);
~PlayerState();
/**
* @brief Updates state according to current playback state.

View File

@@ -16,7 +16,9 @@
#include "Packet.h"
#include "ConstantParameters.h"
#include "Crypto.h"
#include "ProtoHelper.h"
#include "NanoPBHelper.h"
#include "protobuf/authentication.pb.h"
#include "protobuf/keyexchange.pb.h"
#define SPOTIFY_VERSION 0x10800000000
#define LOGIN_REQUEST_COMMAND 0xAB
@@ -38,6 +40,7 @@ private:
public:
Session();
~Session();
std::shared_ptr<ShannonConnection> shanConn;
std::shared_ptr<LoginBlob> authBlob;
void connect(std::unique_ptr<PlainConnection> connection);

View File

@@ -6,7 +6,6 @@
#include <functional>
#include "Utils.h"
#include "MercuryManager.h"
#include "ProtoHelper.h"
#include "Session.h"
#include "PlayerState.h"
#include "SpotifyTrack.h"

View File

@@ -5,7 +5,6 @@
#include <vector>
#include <iostream>
#include "MercuryManager.h"
#include "ProtoHelper.h"
#include "Utils.h"
#include "MercuryResponse.h"
#include <fstream>
@@ -13,6 +12,8 @@
#include <functional>
#include "ChunkedAudioStream.h"
#include "TrackReference.h"
#include "NanoPBHelper.h"
#include "protobuf/metadata.pb.h"
#include <cassert>
struct TrackInfo {
@@ -33,7 +34,7 @@ private:
void episodeInformationCallback(std::unique_ptr<MercuryResponse> response, uint32_t position_ms, bool isPaused);
void requestAudioKey(std::vector<uint8_t> fileId, std::vector<uint8_t> trackId, int32_t trackDuration, uint32_t position_ms, bool isPaused);
bool countryListContains(std::string countryList, std::string country);
bool canPlayTrack(std::vector<Restriction> &restrictions);
bool canPlayTrack();
Track trackInfo;
Episode episodeInfo;

View File

@@ -3,7 +3,8 @@
#include <vector>
#include "Utils.h"
#include "ProtoHelper.h"
#include "protobuf/spirc.pb.h"
#include <NanoPBHelper.h>
#include <iostream>
#include <string>