bool Cce152::exit(void) { StopPlay(); EjectTape(); CPObject::exit(); return true; }
/* #FN# Called when the user clicks the EJECT button */ void /* #AS# Nothing */ CTapeDlg:: OnEject() { /* Eject an inserted tape image */ EjectTape(); /* Set the dialog controls */ SetDlgState(); } /* #OF# CTapeDlg::OnEject */
/* #FN# Prepares the tape to be accessed or removed */ BOOL /* #AS# Nothing */ CTapeDlg:: PrepareTape( LPSTR pszTapeFile, BOOL bCheckIfExists /*=TRUE*/, BOOL bForceInsert /*=FALSE*/ ) { BOOL bResult = FALSE; if( _IsPathAvailable( pszTapeFile ) ) { CFileStatus fsStatus; if( !bCheckIfExists || CFile::GetStatus( pszTapeFile, fsStatus ) ) { UINT unFileType = IAF_CAS_IMAGE; m_bCasImage = IsAtariFile( pszTapeFile, &unFileType ); bForceInsert = bForceInsert || m_bCasImage || _stricmp( m_szTapeLast, pszTapeFile ) == 0; if( bForceInsert || DisplayWarning( IDS_WARN_CASFILE, DONT_SHOW_CASFILE_WARN, TRUE ) ) { /* Prevents from resource leaks */ CASSETTE_Remove(); /* We have to attach a selected file because there is need to update some kernel-depending cassette parameters */ if( CASSETTE_Insert( pszTapeFile ) ) { /* A tape image has been properly inserted */ bResult = TRUE; } else DisplayMessage( GetSafeHwnd(), IDS_ERROR_CAS_READ, 0, MB_ICONEXCLAMATION | MB_OK ); } } } /* It is a good idea to remove the tape if no success */ if( !bResult ) EjectTape(); /* Save a name of the last used image */ _strncpy( m_szTapeLast, pszTapeFile, FILENAME_MAX - 1 ); return bResult; } /* #OF# CTapeDlg::PrepareTape */