From 9ac32bd415097713d1d829dfb04e6d85a95cbbf9 Mon Sep 17 00:00:00 2001 From: "bjorn.olievier" Date: Thu, 24 Apr 2008 19:10:16 +0000 Subject: [PATCH] Fixed deadlock after 2 songs (closes #32). --- src/core/audio/Transport.cpp | 6 ------ src/square/ConsoleUI.cpp | 6 ++++++ src/square/ConsoleUI.h | 2 ++ src/square/DummyAudioEventHandler.cpp | 6 ++++++ src/square/DummyAudioEventHandler.h | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/core/audio/Transport.cpp b/src/core/audio/Transport.cpp index 42c19320a..b84a0cd27 100644 --- a/src/core/audio/Transport.cpp +++ b/src/core/audio/Transport.cpp @@ -88,12 +88,6 @@ void Transport::Start(const utfstring path) if (success) { this->PlaybackStartedOk(); - - // Stop currently playing song if any - if (this->openStreams.size() > 1) - { - this->Stop(0); - } } else { diff --git a/src/square/ConsoleUI.cpp b/src/square/ConsoleUI.cpp index fb165aa2f..960b12015 100644 --- a/src/square/ConsoleUI.cpp +++ b/src/square/ConsoleUI.cpp @@ -266,3 +266,9 @@ void ConsoleUI::ShutDown() delete instance; return 0; } + +void ConsoleUI::StartNew() +{ + Args a; + this->PlayFile(a); +} \ No newline at end of file diff --git a/src/square/ConsoleUI.h b/src/square/ConsoleUI.h index 29833ca71..842bb8a2c 100644 --- a/src/square/ConsoleUI.h +++ b/src/square/ConsoleUI.h @@ -82,6 +82,8 @@ private: boost::mutex mutex; private: void ShutDown(); public: static DWORD WINAPI ThreadRun(LPVOID param); + +public: void StartNew(); }; }} // NS diff --git a/src/square/DummyAudioEventHandler.cpp b/src/square/DummyAudioEventHandler.cpp index d4617c549..98a12281a 100644 --- a/src/square/DummyAudioEventHandler.cpp +++ b/src/square/DummyAudioEventHandler.cpp @@ -51,4 +51,10 @@ DummyAudioEventHandler::~DummyAudioEventHandler() void DummyAudioEventHandler::PrintEvent(utfstring s) { this->cui->Print(_T("EVENT: " + s + _T("\n"))); +} + +void DummyAudioEventHandler::OnMixpointReached() +{ + this->PrintEvent(_T("Mix point reached")); + //this->cui->StartNew(); // Endless test loop } \ No newline at end of file diff --git a/src/square/DummyAudioEventHandler.h b/src/square/DummyAudioEventHandler.h index 63447b4ea..ee8df868e 100644 --- a/src/square/DummyAudioEventHandler.h +++ b/src/square/DummyAudioEventHandler.h @@ -63,7 +63,7 @@ public: void OnVolumeChangedOk() { this->PrintEvent(_T("Volume chan public: void OnVolumeChangedFail() { this->PrintEvent(_T("Volume changed FAIL")); }; public: void OnStreamOpenOk() { this->PrintEvent(_T("Stream open OK")); }; public: void OnStreamOpenFail() { this->PrintEvent(_T("Stream open FAIL")); }; -public: void OnMixpointReached() { this->PrintEvent(_T("Mix point reached")); }; +public: void OnMixpointReached() ; public: void OnSetPositionOk() { this->PrintEvent(_T("Set position OK")); }; public: void OnSetPositionFail() { this->PrintEvent(_T("Set position FAIL")); }; };