diff --git a/src/core/audio/Player.cpp b/src/core/audio/Player.cpp index 95e95de58..b0693bff1 100644 --- a/src/core/audio/Player.cpp +++ b/src/core/audio/Player.cpp @@ -145,6 +145,7 @@ int Player::State(){ void Player::ThreadLoop(){ #ifdef _DEBUG std::cerr << "Player::ThreadLoop started" << std::endl; + std::cerr << "this->url = " << this->url.c_str() << std::endl; #endif // First start the stream this->stream = Stream::Create(); diff --git a/src/core/audio/Transport.cpp b/src/core/audio/Transport.cpp index 9b7c5d83a..9b67b605a 100644 --- a/src/core/audio/Transport.cpp +++ b/src/core/audio/Transport.cpp @@ -100,6 +100,7 @@ void Transport::Start(utfstring url){ this->currentPlayer->PlaybackStarted.connect(this,&Transport::OnPlaybackStarted); this->currentPlayer->PlaybackAlmostEnded.connect(this,&Transport::OnPlaybackAlmostEnded); this->currentPlayer->PlaybackEnded.connect(this,&Transport::OnPlaybackEnded); + this->currentPlayer->PlaybackError.connect(this, &Transport::OnPlaybackError); #ifdef _DEBUG std::cerr << "Transport: player-Play() about to be called" << std::endl; #endif @@ -188,6 +189,10 @@ void Transport::OnPlaybackEnded(Player *player){ } } +void Transport::OnPlaybackError(Player *player) { + this->PlaybackError(); +} + diff --git a/src/core/audio/Transport.h b/src/core/audio/Transport.h index b1c58aaeb..1f1bb61c5 100644 --- a/src/core/audio/Transport.h +++ b/src/core/audio/Transport.h @@ -77,11 +77,13 @@ class Transport : public sigslot::has_slots<>{ PlaybackEvent PlaybackEnded; PlaybackEvent PlaybackPause; PlaybackEvent PlaybackResume; + PlaybackEvent PlaybackError; private: void OnPlaybackStarted(Player *player); void OnPlaybackAlmostEnded(Player *player); void OnPlaybackEnded(Player *player); + void OnPlaybackError(Player *player); private: double volume; diff --git a/src/square/ConsoleUI.cpp b/src/square/ConsoleUI.cpp index 0c761b593..4919b507c 100644 --- a/src/square/ConsoleUI.cpp +++ b/src/square/ConsoleUI.cpp @@ -63,7 +63,7 @@ ConsoleUI::ConsoleUI() this->transport.PlaybackStarted.connect(&this->audioEventHandler, &DummyAudioEventHandler::OnPlaybackStartedOk); this->transport.PlaybackAlmostDone.connect(&this->audioEventHandler, &DummyAudioEventHandler::OnPlaybackAlmostEnded); - this->transport.PlaybackEnded.connect(&this->audioEventHandler, &DummyAudioEventHandler::OnPlaybackStoppedFail); + this->transport.PlaybackError.connect(&this->audioEventHandler, &DummyAudioEventHandler::OnPlaybackStoppedFail); } ConsoleUI::~ConsoleUI()