本文整理汇总了C++中CAudio::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudio::Load方法的具体用法?C++ CAudio::Load怎么用?C++ CAudio::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAudio
的用法示例。
在下文中一共展示了CAudio::Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CAudio
_MEMBER_FUNCTION_IMPL(Audio, constructor)
{
bool sqbIsOnlineStream;
script_getbool(pVM, -3, &sqbIsOnlineStream);
bool bIsOnlineStream = (sqbIsOnlineStream != 0);
bool sqbReplay;
script_getbool(pVM, -2, &sqbReplay);
bool bReplay = (sqbReplay != 0);
const char * szSoundName;
script_getstring(pVM, -1, &szSoundName);
CAudio * pAudio = new CAudio(szSoundName, bReplay, bIsOnlineStream);
///SQ metatable = null
if(!pAudio || !pAudio->Load() || script_setinstance(pVM, pAudio, &_CLASS_DECL(Audio)) != 0)
{
CLogFile::Printf("Failed to load audio from file %s",szSoundName);
SAFE_DELETE(pAudio);
script_pushnull(pVM);
return 1;
}
g_pClient->GetAudioManager()->Add(pAudio);
//script_pushbool(pVM, true);
return 1;
}
示例2: WndProc_Hook
LRESULT APIENTRY WndProc_Hook(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
bool bFocused = (GetForegroundWindow() == hWnd);
// Update HWND state..
if(bFocused != g_pCore->GetGame()->IsFocused())
g_pCore->GetGame()->SetFocused(bFocused);
// Are we focused?
if(bFocused)
{
if (g_pCore->GetGraphics()->GetGUI())
g_pCore->GetGraphics()->GetGUI()->HandleUserInput(uMsg, wParam);
if(uMsg == WM_KILLFOCUS || (uMsg == WM_ACTIVATE && LOWORD(wParam) == WA_INACTIVE))
{
return true;
}
if(uMsg == WM_KEYUP)
{
switch(wParam)
{
case VK_F7:
{
const char *szSoundName = "test.mp3";
szSoundName = SharedUtility::GetAbsolutePath("resources\\%s", szSoundName);
CAudio *pAudio = new CAudio(szSoundName, false, false);
if (pAudio && pAudio->Load())
{
g_pCore->GetAudioManager()->Add(pAudio);
pAudio->Play();
}
break;
}
case VK_ESCAPE: // Our own main menu
{
g_pCore->GetGraphics()->GetMainMenu()->SetVisible(!g_pCore->GetGraphics()->GetMainMenu()->IsMainMenuVisible());
if (g_pCore->GetGraphics()->GetMainMenu()->IsMainMenuVisible()) {
g_pCore->GetGame()->GetLocalPlayer()->SetPlayerControlAdvanced(false, false);
}
else {
g_pCore->GetGame()->GetLocalPlayer()->SetPlayerControlAdvanced(true, true);
}
break;
}
case VK_F8:
{
// Take a screen shot
if(!CSnapShot::Take())
{
g_pCore->GetGraphics()->GetChat()->Print(CString("Screen shot capture failed (%s).", CSnapShot::GetError().Get()));
CSnapShot::Reset();
}
break;
}
}
}
if(g_pCore->GetGraphics()->GetChat())
g_pCore->GetGraphics()->GetChat()->HandleUserInput(uMsg, wParam);
}
return CallWindowProc(m_wWndProc, hWnd, uMsg, wParam, lParam);
}