pause sound while moving window

This commit is contained in:
spacy51 2007-12-15 19:41:01 +00:00
parent 800015a05d
commit 6f7abe4ee0
2 changed files with 14 additions and 5 deletions

View File

@ -457,6 +457,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_OPENAL, &MainWnd::OnUpdateOutputapiOpenal)
ON_COMMAND(ID_OUTPUTAPI_OALCONFIGURATION, &MainWnd::OnOutputapiOalconfiguration)
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_OALCONFIGURATION, &MainWnd::OnUpdateOutputapiOalconfiguration)
ON_WM_MOVING()
END_MESSAGE_MAP()
@ -746,10 +747,19 @@ void MainWnd::OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu)
}
}
void MainWnd::OnMoving(UINT fwSide, LPRECT pRect)
{
CWnd::OnMoving(fwSide, pRect);
if( emulating ) {
soundPause();
}
}
void MainWnd::OnMove(int x, int y)
{
CWnd::OnMove(x, y);
if(!theApp.changingVideoSize) {
if(this) {
if(!IsIconic()) {
@ -1262,10 +1272,8 @@ void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
if(a && theApp.input) {
theApp.active = a;
theApp.input->activate();
if(!theApp.paused) {
if(emulating) {
soundResume();
}
if(!theApp.paused && emulating) {
soundResume();
}
} else {
theApp.wasPaused = true;

View File

@ -451,6 +451,7 @@ public:
afx_msg void OnUpdateOutputapiOpenal(CCmdUI *pCmdUI);
afx_msg void OnOutputapiOalconfiguration();
afx_msg void OnUpdateOutputapiOalconfiguration(CCmdUI *pCmdUI);
afx_msg void OnMoving(UINT fwSide, LPRECT pRect);
};
/////////////////////////////////////////////////////////////////////////////