Merge pull request #4308 from TheUbuntuGuy/master

Fix play bleeding into next track after auto stop
This commit is contained in:
David Sansome 2014-04-26 18:46:26 +10:00
commit 3e57a85711
5 changed files with 12 additions and 12 deletions

View File

@ -199,7 +199,7 @@ bool Player::HandleStopAfter() {
app_->playlist_manager()->active()->StopAfter(-1); app_->playlist_manager()->active()->StopAfter(-1);
Stop(); Stop(true);
return true; return true;
} }
return false; return false;
@ -264,8 +264,8 @@ void Player::RestartOrPrevious() {
SeekTo(0); SeekTo(0);
} }
void Player::Stop() { void Player::Stop(bool stop_after) {
engine_->Stop(); engine_->Stop(stop_after);
app_->playlist_manager()->active()->set_current_row(-1); app_->playlist_manager()->active()->set_current_row(-1);
current_item_.reset(); current_item_.reset();
} }

View File

@ -78,7 +78,7 @@ class PlayerInterface : public QObject {
virtual void Mute() = 0; virtual void Mute() = 0;
virtual void Pause() = 0; virtual void Pause() = 0;
virtual void Stop() = 0; virtual void Stop(bool stop_after = false) = 0;
virtual void Play() = 0; virtual void Play() = 0;
virtual void ShowOSD() = 0; virtual void ShowOSD() = 0;
@ -143,7 +143,7 @@ class Player : public PlayerInterface {
void Mute(); void Mute();
void Pause(); void Pause();
void Stop(); void Stop(bool stop_after = false);
void StopAfterCurrent(); void StopAfterCurrent();
void Play(); void Play();
void ShowOSD(); void ShowOSD();

View File

@ -47,7 +47,7 @@ class Base : public QObject {
virtual void StartPreloading(const QUrl&, bool, qint64, qint64) {} virtual void StartPreloading(const QUrl&, bool, qint64, qint64) {}
virtual bool Play(quint64 offset_nanosec) = 0; virtual bool Play(quint64 offset_nanosec) = 0;
virtual void Stop() = 0; virtual void Stop(bool stop_after = false) = 0;
virtual void Pause() = 0; virtual void Pause() = 0;
virtual void Unpause() = 0; virtual void Unpause() = 0;
virtual void Seek(quint64 offset_nanosec) = 0; virtual void Seek(quint64 offset_nanosec) = 0;

View File

@ -433,13 +433,13 @@ void GstEngine::PlayDone() {
emit ValidSongRequested(url_); emit ValidSongRequested(url_);
} }
void GstEngine::Stop() { void GstEngine::Stop(bool stop_after) {
StopTimers(); StopTimers();
url_ = QUrl(); // To ensure we return Empty from state() url_ = QUrl(); // To ensure we return Empty from state()
beginning_nanosec_ = end_nanosec_ = 0; beginning_nanosec_ = end_nanosec_ = 0;
if (fadeout_enabled_ && current_pipeline_) StartFadeout(); if (fadeout_enabled_ && current_pipeline_ && !stop_after) StartFadeout();
current_pipeline_.reset(); current_pipeline_.reset();
BufferingFinished(); BufferingFinished();
@ -672,8 +672,8 @@ GstElement* GstEngine::CreateElement(const QString& factoryName,
return element; return element;
} }
GstEngine::PluginDetailsList GstEngine::GetPluginList(const QString& classname) GstEngine::PluginDetailsList GstEngine::GetPluginList(
const { const QString& classname) const {
PluginDetailsList ret; PluginDetailsList ret;
GstRegistry* registry = gst_registry_get_default(); GstRegistry* registry = gst_registry_get_default();

View File

@ -96,7 +96,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
bool force_stop_at_end, quint64 beginning_nanosec, bool force_stop_at_end, quint64 beginning_nanosec,
qint64 end_nanosec); qint64 end_nanosec);
bool Play(quint64 offset_nanosec); bool Play(quint64 offset_nanosec);
void Stop(); void Stop(bool stop_after = false);
void Pause(); void Pause();
void Unpause(); void Unpause();
void Seek(quint64 offset_nanosec); void Seek(quint64 offset_nanosec);
@ -219,7 +219,7 @@ class GstEngine : public Engine::Base, public BufferConsumer {
int timer_id_; int timer_id_;
int next_element_id_; int next_element_id_;
QHash<int, std::shared_ptr<GstEnginePipeline> > background_streams_; QHash<int, std::shared_ptr<GstEnginePipeline>> background_streams_;
bool is_fading_out_to_pause_; bool is_fading_out_to_pause_;
bool has_faded_out_; bool has_faded_out_;