void CUpdateWizard::OnFinish(wxWizardEvent& event) { #ifdef __WXMSW__ if (m_currentPage == 2) { wxExecute(_T("\"") + m_localFile + _T("\" /update")); CMainFrame* pFrame = (CMainFrame*)m_parent; pFrame->Close(); } #endif }
CMainFrame::CPlay::~CPlay() { ASSERT(m_Instances >= 0); // instance count should always be positive if (--m_Instances > 0) // pre-decrement; if nested instance return; // defer to outermost instance; no operation CMainFrame *Main = theApp.GetMain(); if (Main->IsViewPlaying(m_View)) { // if caller owns player WAVEFORMATEXTENSIBLE WaveFormat; CWave& PlayerWave = Main->GetPlayerView()->GetWave(); PlayerWave.GetFormat(WaveFormat); // get current audio format // if audio format changed since our ctor saved it if (memcmp(&WaveFormat, &m_WaveFormat, sizeof(WAVEFORMATEXTENSIBLE))) { Main->Close(); // close audio and reset player view state if (PlayerWave.IsValid()) // if new audio is valid Main->Open(PlayerWave); // reopen audio in new format } } else { // caller doesn't own player if (Main->GetPlayerView() == NULL // if player is unowned && m_View != NULL && m_View->GetWave().IsValid()) // and caller has valid wave Main->Open(m_View->GetWave()); // open caller's audio } Main->SetPlaying(m_WasPlaying); // restore previous playing state }