コード例 #1
0
ファイル: PlayerManager.cpp プロジェクト: mastrayer/CSM
void CPlayerManager::UpdatePlayerInfo(PlayerInfo info)
{
	UpdatePlayerState(info.mPlayerId, info.mPlayerState);
	UpdatePlayerPosition(info.mPlayerId, NNPoint( info.mX, info.mY ) );
	UpdatePlayerRotation(info.mPlayerId, info.mAngle);
	UpdatePlayerMoveDirection(info.mPlayerId, info.mMoveVelocity);
	UpdatePlayerHP(info.mPlayerId, info.mHP);
	UpdatePlayerTeam(info.mPlayerId, info.mTeam);
	UpdatePlayerType(info.mPlayerId, (PlayerType)info.mType);
	//UpdatePlayerNickname(info.mPlayerId, info.mName);
	UpdatePlayerKillScore( info.mPlayerId, info.mKillScore );
}
コード例 #2
0
ファイル: MainFrm.cpp プロジェクト: victimofleisure/WaveShop
void CMainFrame::OnActivateView(CWaveShopView *View)
{
	m_View = View;
	if (!IsPlaying())
		UpdatePlayerState();
	m_NavBar.OnActivateView(View);
	if (m_HistoryBar.IsWindowVisible())	// if history bar is visible
		m_HistoryBar.UpdateList();
	if (m_MeterBar.IsWindowVisible())	// if meter bar is visible
		m_MeterBar.UpdateView();
	if (m_SpectrumBar.IsWindowVisible())	// if spectrum bar is visible
		m_SpectrumBar.UpdateView();
}
コード例 #3
0
ファイル: MainFrm.cpp プロジェクト: victimofleisure/WaveShop
bool CMainFrame::SetPlaying(bool Enable)
{
	if (Enable == IsPlaying())	// if already in requested state
		return(TRUE);	// nothing to do
	if (m_View == NULL)
		return(FALSE);	// nothing to play
	if (Enable) {	// if playing
		if (!ActivePlayer()) {	// if active view doesn't own player
			if (!UpdatePlayerState())	// take ownership before playing
				return(FALSE);
		}
		// if cursor is at end of audio
		if (m_View->GetIntNow() >= m_View->GetWave().GetFrameCount())
			m_Player.Rewind();	// rewind so non-repeat play works
		if (m_MeterBar.IsWindowVisible())
			m_MeterBar.ResetClipping();
	}
	return(m_Player.SetPlaying(Enable));
}
コード例 #4
0
ファイル: MainFrm.cpp プロジェクト: victimofleisure/WaveShop
void CMainFrame::ApplyOptions(const COptionsInfo& PrevOpts)
{
	// if playback device or buffer size changed
	if (m_Options.m_PlayDeviceGuid != PrevOpts.m_PlayDeviceGuid
	|| m_Options.m_PlayBufferSize != PrevOpts.m_PlayBufferSize
	|| !m_Player.IsCreated()) {	// or player not created
		if (m_Player.Create(&m_Options.m_PlayDeviceGuid, m_hWnd)) {	// create player
			m_Player.SetBufferDuration(m_Options.m_PlayBufferSize);
			UpdatePlayerState();
		}
	}
	// if recording device or buffer size changed
	if (m_Options.m_RecordDeviceGuid != PrevOpts.m_RecordDeviceGuid
	|| m_Options.m_RecordBufferSize != PrevOpts.m_RecordBufferSize) {
		if (m_RecordDlg != NULL)	// if record dialog exists
			m_RecordDlg->OnDeviceChange();	// notify it of device change
	}
	if (m_Options.m_UndoLevels != PrevOpts.m_UndoLevels) {
		CAllDocIter	iter;
		CDocument	*pDoc;
		while ((pDoc = iter.GetNextDoc()) != NULL)
			((CWaveShopDoc *)pDoc)->m_UndoMgr.SetLevels(m_Options.m_UndoLevels);
	}
	LPARAM	Hint = CWaveShopView::HINT_NONE;
	if (m_Options.m_TimeInFrames != PrevOpts.m_TimeInFrames) {
		m_NavBar.OnTimeFormatChange();
		Hint |= CWaveShopView::HINT_TIME_UNIT;
	}
	if (m_Options.m_MaxDensity != PrevOpts.m_MaxDensity)
		Hint |= CWaveShopView::HINT_WAVE_UPDATE;
	if (m_Options.m_ShowChannelNames != PrevOpts.m_ShowChannelNames)
		Hint |= CWaveShopView::HINT_SHOW_CAPTIONS;
	theApp.UpdateAllViews(NULL, Hint, NULL);
	if (m_Options.m_CheckForUpdates && !PrevOpts.m_CheckForUpdates)
		PostMessage(WM_COMMAND, ID_APP_CHECK_FOR_UPDATES);
	if (memcmp(&m_Options.m_RTSA, &PrevOpts.m_RTSA, sizeof(RTSA_PARMS)))
		m_SpectrumBar.SetParms(m_Options.m_RTSA);
	theApp.m_TempFolderPath = m_Options.GetTempFolderPath();
	RegisterHotKeys();
}