当前位置: 首页>>代码示例>>C++>>正文


C++ CAudioManager::PlayStreamClip方法代码示例

本文整理汇总了C++中CAudioManager::PlayStreamClip方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::PlayStreamClip方法的具体用法?C++ CAudioManager::PlayStreamClip怎么用?C++ CAudioManager::PlayStreamClip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAudioManager的用法示例。


在下文中一共展示了CAudioManager::PlayStreamClip方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update

cGameStateObject* cGameStateSonar::update(double timeDifference){
  m_event = EVENT_GO_NO_WHERE;

  //loads mouse position into global variable.
  POINT pt;
  POINT *ppt = &pt;
  ::GetCursorPos(ppt);
  RECT rct;
  ::GetWindowRect(g_hWnd, &rct);
  g_Global.g_mouse.x = pt.x - rct.left;
  g_Global.g_mouse.y = pt.y + rct.top;
  
  CAudioManager *pAudio = CAudioManager::Instance();

  static double timeDiffTotal = 0;
  timeDiffTotal += timeDifference;
  if(timeDiffTotal > .1){
    timeDiffTotal = 0;
    
    pAudio->Update(0.1);

    if(::GetActiveWindow() == g_hWnd && keyDown('A') == true){
      pAudio->PlayStreamClip(SOUND_BIO1);
    }
    if(::GetActiveWindow() == g_hWnd && keyDown('2') == true){
      pAudio->PlayStreamClip(SOUND_BIO2);
    }
    if(::GetActiveWindow() == g_hWnd && keyDown('3') == true){
      pAudio->PlayStreamClip(SOUND_BIO3);
    }
    if(::GetActiveWindow() == g_hWnd && keyDown('4') == true){
      pAudio->PlayStreamClip(SOUND_BIO4);
    }
    if(::GetActiveWindow() == g_hWnd && keyDown('5') == true){
      pAudio->PlayStreamClip(SOUND_BIO5);
    }
   

    //process short cut buttons
    if(g_Global.g_mouse.y > 10 && g_Global.g_mouse.y < 130 
      && g_Global.g_bLeftMouseDown == true && ::GetActiveWindow() == g_hWnd){
      if(g_Global.g_mouse.x > 120 && g_Global.g_mouse.x < 220)
        m_event = EVENT_GO_RADAR;
      else if(g_Global.g_mouse.x > 230 && g_Global.g_mouse.x < 330)
        m_event = EVENT_GO_CONTROL;
      else if(g_Global.g_mouse.x > 694 && g_Global.g_mouse.x < 794)
        m_event = EVENT_GO_FIRECONTROL;
      else if(g_Global.g_mouse.x > 804 && g_Global.g_mouse.x < 904)
        m_event = EVENT_GO_STATUS;
      else if(g_Global.g_mouse.x > 914 && g_Global.g_mouse.x < 1014)
        m_event = EVENT_GO_CHART;
    }      
  }

  for(unsigned int i=0; i< m_TE.size(); i++){
    if (m_TE[i].event == m_event){
      return m_TE[i].p_gso;
    }
  }
  return 0;
}
开发者ID:ChuckBolin,项目名称:Sinking,代码行数:61,代码来源:CGameStateSonar.cpp


注:本文中的CAudioManager::PlayStreamClip方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。