SuspendedPlaySoundAction.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. ** Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** File: suspendedplaysoundaction.cpp
  5. **
  6. ** Author:
  7. **
  8. ** Description:
  9. ** Implementation of the training library "suspendedplaysoundaction" interface.
  10. **
  11. ** History:
  12. */
  13. #include "pch.h"
  14. #include "SuspendedPlaySoundAction.h"
  15. #include "SuspendedSoundFinishedCondition.h"
  16. #include "TrainingMission.h"
  17. namespace Training
  18. {
  19. //------------------------------------------------------------------------------
  20. // global variabes
  21. //------------------------------------------------------------------------------
  22. extern TrainingMission* g_pMission;
  23. //------------------------------------------------------------------------------
  24. // class methods
  25. //------------------------------------------------------------------------------
  26. /* void */ SuspendedPlaySoundAction::SuspendedPlaySoundAction (SoundID soundID, bool bDeleteWhenDone) :
  27. PlaySoundAction (soundID),
  28. m_bDeleteWhenDone (bDeleteWhenDone)
  29. {
  30. }
  31. //------------------------------------------------------------------------------
  32. /* void */ SuspendedPlaySoundAction::~SuspendedPlaySoundAction (void)
  33. {
  34. }
  35. //------------------------------------------------------------------------------
  36. void SuspendedPlaySoundAction::Execute (void)
  37. {
  38. if (m_soundID != NA)
  39. {
  40. g_pMission->AddWaitCondition (new SuspendedSoundFinishedCondition (this, m_bDeleteWhenDone));
  41. PlaySoundAction::Execute ();
  42. }
  43. }
  44. //------------------------------------------------------------------------------
  45. }