rename spotify to librespot

This commit is contained in:
badaix 2019-10-13 19:32:11 +02:00
parent 7fda592d13
commit 08a0def6c5
4 changed files with 12 additions and 12 deletions

View file

@ -28,7 +28,7 @@ using namespace std;
SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : ProcessStream(pcmListener, uri)
LibrespotStream::LibrespotStream(PcmListener* pcmListener, const StreamUri& uri) : ProcessStream(pcmListener, uri)
{
sampleFormat_ = SampleFormat("44100:16:2");
uri_.query["sampleformat"] = sampleFormat_.getFormat();
@ -63,10 +63,10 @@ SpotifyStream::SpotifyStream(PcmListener* pcmListener, const StreamUri& uri) : P
}
SpotifyStream::~SpotifyStream() = default;
LibrespotStream::~LibrespotStream() = default;
void SpotifyStream::initExeAndPath(const std::string& filename)
void LibrespotStream::initExeAndPath(const std::string& filename)
{
path_ = "";
exe_ = findExe(filename);
@ -88,7 +88,7 @@ void SpotifyStream::initExeAndPath(const std::string& filename)
}
void SpotifyStream::onStderrMsg(const char* buffer, size_t n)
void LibrespotStream::onStderrMsg(const char* buffer, size_t n)
{
static bool libreelec_patched = false;
smatch m;
@ -153,7 +153,7 @@ void SpotifyStream::onStderrMsg(const char* buffer, size_t n)
}
void SpotifyStream::stderrReader()
void LibrespotStream::stderrReader()
{
watchdog_.reset(new Watchdog(this));
/// 130min
@ -162,7 +162,7 @@ void SpotifyStream::stderrReader()
}
void SpotifyStream::onTimeout(const Watchdog* /*watchdog*/, size_t ms)
void LibrespotStream::onTimeout(const Watchdog* /*watchdog*/, size_t ms)
{
LOG(ERROR) << "Spotify timeout: " << ms / 1000 << "\n";
if (process_)

View file

@ -31,12 +31,12 @@
* snapserver -s "spotify:///librespot?name=Spotify&username=<my username>&password=<my password>[&devicename=Snapcast][&bitrate=320][&volume=<volume in
* percent>][&cache=<cache dir>]"
*/
class SpotifyStream : public ProcessStream, WatchdogListener
class LibrespotStream : public ProcessStream, WatchdogListener
{
public:
/// ctor. Encoded PCM data is passed to the PipeListener
SpotifyStream(PcmListener* pcmListener, const StreamUri& uri);
~SpotifyStream() override;
LibrespotStream(PcmListener* pcmListener, const StreamUri& uri);
~LibrespotStream() override;
protected:
std::unique_ptr<Watchdog> watchdog_;

View file

@ -69,9 +69,9 @@ PcmStreamPtr StreamManager::addStream(const std::string& uri)
{
stream = make_shared<ProcessStream>(pcmListener_, streamUri);
}
else if (streamUri.scheme == "spotify")
else if ((streamUri.scheme == "spotify") || (streamUri.scheme == "librespot"))
{
stream = make_shared<SpotifyStream>(pcmListener_, streamUri);
stream = make_shared<LibrespotStream>(pcmListener_, streamUri);
}
else if (streamUri.scheme == "airplay")
{