Wave.cpp
上传用户:bsw_2008
上传日期:2013-07-09
资源大小:2446k
文件大小:2k
源码类别:

棋牌游戏

开发平台:

Visual C++

  1. // Wave.cpp: implementation of the CWave class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "CGameHallFrame.h"
  6. #include "Wave.h"
  7. #ifdef _DEBUG
  8. #undef THIS_FILE
  9. static char THIS_FILE[]=__FILE__;
  10. #define new DEBUG_NEW
  11. #endif
  12. //////////////////////////////////////////////////////////////////////
  13. // Construction/Destruction
  14. //////////////////////////////////////////////////////////////////////
  15. #pragma comment(lib,"winmm.lib")//如连接出现2001错误,用这个语句直接添加连接库
  16. CWave::CWave()
  17. {
  18. }
  19. CWave::~CWave()
  20. {
  21. }
  22. /*
  23. 0 bomb
  24. 1 begin
  25. */
  26. void CWave::PlayMusic(int k)
  27. {
  28. switch(k)
  29. {
  30. case 0:
  31. PlaySound(MAKEINTRESOURCE(IDR_BOMB),AfxGetResourceHandle(),
  32. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  33. //sndPlaySound("wf003.wav",SND_ASYNC|SND_NODEFAULT);
  34. break;
  35. case 1:
  36. PlaySound(MAKEINTRESOURCE(IDR_BEGIN),AfxGetResourceHandle(),
  37. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  38. break;
  39. case 2:
  40. PlaySound(MAKEINTRESOURCE(IDR_START),AfxGetResourceHandle(),
  41. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  42. break;
  43. case 3:
  44. PlaySound(MAKEINTRESOURCE(IDR_DEAD),AfxGetResourceHandle(),
  45. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  46. break;
  47. case 4:
  48. PlaySound(MAKEINTRESOURCE(IDR_EAT),AfxGetResourceHandle(),
  49. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  50. break;
  51. case 5:
  52. PlaySound(MAKEINTRESOURCE(IDR_KILLED),AfxGetResourceHandle(),
  53. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  54. break;
  55. case 6:
  56. PlaySound(MAKEINTRESOURCE(IDR_MOVE),AfxGetResourceHandle(),
  57. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  58. break;
  59. case 7:
  60. PlaySound(MAKEINTRESOURCE(IDR_SELECT),AfxGetResourceHandle(),
  61. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  62. break;
  63. case 8:
  64. PlaySound(MAKEINTRESOURCE(IDR_TIMER),AfxGetResourceHandle(),
  65. SND_ASYNC|SND_RESOURCE|SND_NODEFAULT);
  66. break;
  67. }
  68. }