From bcbe880d4215e70e4a3e21ee4ca98696f18d09f2 Mon Sep 17 00:00:00 2001 From: maroy Date: Wed, 24 Nov 2004 13:36:01 +0000 Subject: [PATCH] removed references to usleep(), and replaced them with TimeConversion::sleep() --- .../modules/playlistExecutor/etc/configure.ac | 6 +++--- .../src/AudioPlayerFactoryTest.cxx | 7 +++++-- .../modules/playlistExecutor/src/HelixPlayer.cxx | 8 +++++--- .../playlistExecutor/src/HelixPlayerTest.cxx | 16 +++++++++++----- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/livesupport/modules/playlistExecutor/etc/configure.ac b/livesupport/modules/playlistExecutor/etc/configure.ac index 73f43f9bc..6a673582f 100644 --- a/livesupport/modules/playlistExecutor/etc/configure.ac +++ b/livesupport/modules/playlistExecutor/etc/configure.ac @@ -21,7 +21,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl dnl Author : $Author: maroy $ -dnl Version : $Revision: 1.1 $ +dnl Version : $Revision: 1.2 $ dnl Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/etc/configure.ac,v $ dnl----------------------------------------------------------------------------- @@ -35,14 +35,14 @@ dnl----------------------------------------------------------------------------- AC_INIT(PlaylistExecutor, 1.0, bugs@campware.org) AC_PREREQ(2.59) AC_COPYRIGHT([Copyright (c) 2004 Media Development Loan Fund under the GNU GPL]) -AC_REVISION($Revision: 1.1 $) +AC_REVISION($Revision: 1.2 $) AC_CONFIG_SRCDIR(../src/HelixPlayer.cxx) AC_CONFIG_HEADERS(configure.h) AC_PROG_CXX() -AC_CHECK_HEADERS(getopt.h) +AC_CHECK_HEADERS(getopt.h sys/time.h) dnl----------------------------------------------------------------------------- dnl enable compilaton for code coverage data diff --git a/livesupport/modules/playlistExecutor/src/AudioPlayerFactoryTest.cxx b/livesupport/modules/playlistExecutor/src/AudioPlayerFactoryTest.cxx index 3f342542c..7e5a5317d 100644 --- a/livesupport/modules/playlistExecutor/src/AudioPlayerFactoryTest.cxx +++ b/livesupport/modules/playlistExecutor/src/AudioPlayerFactoryTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.1 $ + Version : $Revision: 1.2 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/AudioPlayerFactoryTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -43,6 +43,8 @@ #include #include +#include "LiveSupport/Core/TimeConversion.h" + #include "AudioPlayerFactoryTest.h" @@ -129,6 +131,7 @@ AudioPlayerFactoryTest :: simplePlayTest(void) { Ptr::Ref audioPlayerFactory; Ptr::Ref audioPlayer; + Ptr::Ref sleepT(new time_duration(microseconds(10))); audioPlayerFactory = AudioPlayerFactory::getInstance(); audioPlayer = audioPlayerFactory->getAudioPlayer(); @@ -138,7 +141,7 @@ AudioPlayerFactoryTest :: simplePlayTest(void) audioPlayer->start(); CPPUNIT_ASSERT(audioPlayer->isPlaying()); while (audioPlayer->isPlaying()) { - usleep(10000); + TimeConversion::sleep(sleepT); } CPPUNIT_ASSERT(!audioPlayer->isPlaying()); } diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx b/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx index bcccef9ee..4775a62a7 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx +++ b/livesupport/modules/playlistExecutor/src/HelixPlayer.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayer.cxx,v $ ------------------------------------------------------------------------------*/ @@ -35,6 +35,7 @@ #include "HelixDefs.h" +#include "LiveSupport/Core/TimeConversion.h" #include "HelixPlayer.h" @@ -83,12 +84,13 @@ void * LiveSupport::PlaylistExecutor::eventHandlerThread(void * helixPlayer) throw () { - HelixPlayer * hPlayer = (HelixPlayer *) helixPlayer; + HelixPlayer * hPlayer = (HelixPlayer *) helixPlayer; + Ptr::Ref sleepT(new time_duration(microseconds(10))); while (hPlayer->handleEvents) { struct _HXxEvent * event = 0; hPlayer->clientEngine->EventOccurred(event); - usleep(10000); + TimeConversion::sleep(sleepT); } return 0; diff --git a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx index c8555c1c6..19deb89f6 100644 --- a/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx +++ b/livesupport/modules/playlistExecutor/src/HelixPlayerTest.cxx @@ -22,7 +22,7 @@ Author : $Author: maroy $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/playlistExecutor/src/Attic/HelixPlayerTest.cxx,v $ ------------------------------------------------------------------------------*/ @@ -43,6 +43,8 @@ #include #include +#include "LiveSupport/Core/TimeConversion.h" + #include "HelixPlayer.h" #include "HelixPlayerTest.h" @@ -124,13 +126,15 @@ void HelixPlayerTest :: simplePlayTest(void) throw (CPPUNIT_NS::Exception) { + Ptr::Ref sleepT(new time_duration(microseconds(10))); + helixPlayer->initialize(); helixPlayer->playThis("file:var/test.mp3"); CPPUNIT_ASSERT(!helixPlayer->isPlaying()); helixPlayer->start(); CPPUNIT_ASSERT(helixPlayer->isPlaying()); while (helixPlayer->isPlaying()) { - usleep(10000); + TimeConversion::sleep(sleepT); } CPPUNIT_ASSERT(!helixPlayer->isPlaying()); helixPlayer->deInitialize(); @@ -193,6 +197,8 @@ void HelixPlayerTest :: smilTest(void) throw (CPPUNIT_NS::Exception) { + Ptr::Ref sleepT(new time_duration(microseconds(10))); + helixPlayer->initialize(); helixPlayer->playThis("file:var/simpleSmil.smil"); @@ -200,7 +206,7 @@ HelixPlayerTest :: smilTest(void) helixPlayer->start(); CPPUNIT_ASSERT(helixPlayer->isPlaying()); while (helixPlayer->isPlaying()) { - usleep(10000); + TimeConversion::sleep(sleepT); } CPPUNIT_ASSERT(!helixPlayer->isPlaying()); @@ -212,7 +218,7 @@ HelixPlayerTest :: smilTest(void) helixPlayer->start(); CPPUNIT_ASSERT(helixPlayer->isPlaying()); while (helixPlayer->isPlaying()) { - usleep(10000); + TimeConversion::sleep(sleepT); } CPPUNIT_ASSERT(!helixPlayer->isPlaying()); */ @@ -224,7 +230,7 @@ HelixPlayerTest :: smilTest(void) helixPlayer->start(); CPPUNIT_ASSERT(helixPlayer->isPlaying()); while (helixPlayer->isPlaying()) { - usleep(10000); + TimeConversion::sleep(sleepT); } CPPUNIT_ASSERT(!helixPlayer->isPlaying());