@@ -256,3 +256,19 @@ bool EngineBase::ValidOutput(const QString &output) {
|
||||
return (true);
|
||||
|
||||
}
|
||||
|
||||
void EngineBase::UpdateSpotifyAccessToken(const QString &spotify_access_token) {
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
|
||||
spotify_access_token_ = spotify_access_token;
|
||||
|
||||
SetSpotifyAccessToken();
|
||||
|
||||
#else
|
||||
|
||||
Q_UNUSED(spotify_access_token)
|
||||
|
||||
#endif // HAVE_SPOTIFY
|
||||
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ class EngineBase : public QObject {
|
||||
virtual void ReloadSettings();
|
||||
void UpdateVolume(const uint volume);
|
||||
void EmitAboutToFinish();
|
||||
void UpdateSpotifyAccessToken(const QString &spotify_access_token);
|
||||
|
||||
public:
|
||||
// Simple accessors
|
||||
@@ -175,6 +176,11 @@ class EngineBase : public QObject {
|
||||
|
||||
void Finished();
|
||||
|
||||
private:
|
||||
#ifdef HAVE_SPOTIFY
|
||||
virtual void SetSpotifyAccessToken() {}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
bool playbin3_enabled_;
|
||||
bool exclusive_mode_;
|
||||
|
||||
@@ -517,10 +517,20 @@ bool GstEngine::ExclusiveModeSupport(const QString &output) const {
|
||||
|
||||
void GstEngine::ReloadSettings() {
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
const QString old_spotify_access_token = spotify_access_token_;
|
||||
#endif
|
||||
|
||||
EngineBase::ReloadSettings();
|
||||
|
||||
if (output_.isEmpty()) output_ = QLatin1String(kAutoSink);
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
if (current_pipeline_ && old_spotify_access_token != spotify_access_token_) {
|
||||
current_pipeline_->set_spotify_access_token(spotify_access_token_);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void GstEngine::ConsumeBuffer(GstBuffer *buffer, const int pipeline_id, const QString &format) {
|
||||
@@ -1199,3 +1209,13 @@ bool GstEngine::AnyExclusivePipelineActive() const {
|
||||
return (current_pipeline_ && current_pipeline_->exclusive_mode()) || OldExclusivePipelineActive();
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
void GstEngine::SetSpotifyAccessToken() {
|
||||
|
||||
if (current_pipeline_) {
|
||||
current_pipeline_->set_spotify_access_token(spotify_access_token_);
|
||||
}
|
||||
|
||||
}
|
||||
#endif // HAVE_SPOTIFY
|
||||
|
||||
@@ -146,6 +146,10 @@ class GstEngine : public EngineBase, public GstBufferConsumer {
|
||||
bool OldExclusivePipelineActive() const;
|
||||
bool AnyExclusivePipelineActive() const;
|
||||
|
||||
#ifdef HAVE_SPOTIFY
|
||||
void SetSpotifyAccessToken() override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
SharedPtr<TaskManager> task_manager_;
|
||||
GstDiscoverer *discoverer_;
|
||||
|
||||
Reference in New Issue
Block a user