#include "stdafx.h" /* ----------------------------------------------------------------------------- Class: AnnouncerManager Desc: See header. Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved. Chris Danford ----------------------------------------------------------------------------- */ #include "AnnouncerManager.h" #include "RageLog.h" AnnouncerManager* ANNOUNCER = NULL; // global object accessable from anywhere in the program const CString EMPTY_ANNOUNCER_NAME = "Empty"; const CString ANNOUNCERS_DIR = "Announcers\\"; AnnouncerManager::AnnouncerManager() { LOG->Trace("AnnouncerManager::AnnouncerManager()"); } void AnnouncerManager::GetAnnouncerNames( CStringArray& AddTo ) { GetDirListing( ANNOUNCERS_DIR+"*", AddTo, true ); // strip out the folder called "CVS" and EMPTY_ANNOUNCER_NAME for( int i=AddTo.GetSize()-1; i>=0; i-- ) { if( 0 == stricmp( AddTo[i], "cvs" ) ) AddTo.RemoveAt(i); if( 0 == stricmp( AddTo[i], EMPTY_ANNOUNCER_NAME ) ) AddTo.RemoveAt(i); } } bool AnnouncerManager::DoesAnnouncerExist( CString sAnnouncerName ) { if( sAnnouncerName == "" ) return true; CStringArray asAnnouncerNames; GetAnnouncerNames( asAnnouncerNames ); for( int i=0; iTrace( "The current announcer is missing the folder '%s'.", sFolderName ); MessageBeep( MB_OK ); CreateDirectory( sPathToFolderCurrent, NULL ); } if( !DoesFileExist(sPathToFolderEmpty) ) { LOG->Trace( "The empty announcer is missing the folder '%s'.", sFolderName ); MessageBeep( MB_OK ); CreateDirectory( sPathToFolderEmpty, NULL ); } #endif return sPathToFolderCurrent; }