mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
big merge
This commit is contained in:
50
components/spotify/Shim.h
Normal file
50
components/spotify/Shim.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include "AudioSink.h"
|
||||
#include "FileHelper.h"
|
||||
#include "BaseHTTPServer.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include "esp_err.h"
|
||||
#include "esp_http_server.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
class ShimAudioSink : public AudioSink {
|
||||
public:
|
||||
ShimAudioSink(void) { softwareVolumeControl = false; }
|
||||
void feedPCMFrames(std::vector<uint8_t> &data);
|
||||
virtual void volumeChanged(uint16_t volume);
|
||||
};
|
||||
|
||||
class NVSFile : public FileHelper {
|
||||
private:
|
||||
std::map<std::string, std::string> files;
|
||||
|
||||
public:
|
||||
bool readFile(std::string filename, std::string &fileContent);
|
||||
bool writeFile(std::string filename, std::string fileContent);
|
||||
bool flush();
|
||||
};
|
||||
|
||||
class ShimHTTPServer : public bell::BaseHTTPServer {
|
||||
private:
|
||||
httpd_handle_t serverHandle;
|
||||
bell::httpHandler uriHandlers[4];
|
||||
|
||||
public:
|
||||
ShimHTTPServer(httpd_handle_t server, int port) { serverHandle = server; serverPort = port; }
|
||||
|
||||
void registerHandler(bell::RequestType requestType, const std::string &, bell::httpHandler);
|
||||
void respond(const bell::HTTPResponse &);
|
||||
};
|
||||
Reference in New Issue
Block a user