Move warnings meant for the user to userlog.txt. These are as inconsistent in format as before but at least they're all in one place.

This commit is contained in:
Steve Checkoway
2006-09-03 05:16:09 +00:00
parent c6eb78a3cf
commit 4606d68fdf
14 changed files with 158 additions and 137 deletions
+6 -6
View File
@@ -123,7 +123,7 @@ void BannerCache::LoadBanner( RString BannerPath )
RageSurface *img = RageSurfaceUtils::LoadSurface( CachePath ); RageSurface *img = RageSurfaceUtils::LoadSurface( CachePath );
if( img == NULL ) if( img == NULL )
{ {
if(tries == 0) if( tries == 0 )
{ {
/* The file doesn't exist. It's possible that the banner cache file is /* The file doesn't exist. It's possible that the banner cache file is
* missing, so try to create it. Don't do this first, for efficiency. */ * missing, so try to create it. Don't do this first, for efficiency. */
@@ -216,7 +216,7 @@ struct BannerTexture: public RageTexture
if( img->w > DISPLAY->GetMaxTextureSize() || if( img->w > DISPLAY->GetMaxTextureSize() ||
img->h > DISPLAY->GetMaxTextureSize() ) img->h > DISPLAY->GetMaxTextureSize() )
{ {
LOG->Warn("Converted %s at runtime", GetID().filename.c_str() ); LOG->Warn( "Converted %s at runtime", GetID().filename.c_str() );
int width = min( img->w, DISPLAY->GetMaxTextureSize() ); int width = min( img->w, DISPLAY->GetMaxTextureSize() );
int height = min( img->h, DISPLAY->GetMaxTextureSize() ); int height = min( img->h, DISPLAY->GetMaxTextureSize() );
RageSurfaceUtils::Zoom( img, width, height ); RageSurfaceUtils::Zoom( img, width, height );
@@ -270,7 +270,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString BannerPath )
if( BannerPath == "" ) if( BannerPath == "" )
return ID; return ID;
LOG->Trace("BannerCache::LoadCachedBanner(%s): %s", BannerPath.c_str(), ID.filename.c_str() ); LOG->Trace( "BannerCache::LoadCachedBanner(%s): %s", BannerPath.c_str(), ID.filename.c_str() );
/* Hack: make sure Banner::Load doesn't change our return value and end up /* Hack: make sure Banner::Load doesn't change our return value and end up
* reloading. */ * reloading. */
@@ -297,7 +297,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString BannerPath )
BannerData.GetValue( BannerPath, "Rotated", WasRotatedBanner ); BannerData.GetValue( BannerPath, "Rotated", WasRotatedBanner );
if(src_width == 0 || src_height == 0) if(src_width == 0 || src_height == 0)
{ {
LOG->Warn("Couldn't load '%s'", BannerPath.c_str() ); LOG->UserLog( "Couldn't load '%s'", BannerPath.c_str() );
return ID; return ID;
} }
@@ -312,7 +312,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString BannerPath )
if( TEXTUREMAN->IsTextureRegistered(ID) ) if( TEXTUREMAN->IsTextureRegistered(ID) )
return ID; /* It's all set. */ return ID; /* It's all set. */
LOG->Trace("Loading banner texture %s; src %ix%i; image %ix%i", LOG->Trace( "Loading banner texture %s; src %ix%i; image %ix%i",
ID.filename.c_str(), src_width, src_height, img->w, img->h ); ID.filename.c_str(), src_width, src_height, img->w, img->h );
RageTexture *pTexture = new BannerTexture( ID, img, src_width, src_height ); RageTexture *pTexture = new BannerTexture( ID, img, src_width, src_height );
@@ -377,7 +377,7 @@ void BannerCache::CacheBannerInternal( RString BannerPath )
RageSurface *img = RageSurfaceUtils::LoadFile( BannerPath, error ); RageSurface *img = RageSurfaceUtils::LoadFile( BannerPath, error );
if( img == NULL ) if( img == NULL )
{ {
LOG->Warn( "BannerCache::CacheBanner: Couldn't load %s: %s", BannerPath.c_str(), error.c_str() ); LOG->UserLog( "BannerCache::CacheBanner: Couldn't load %s: %s", BannerPath.c_str(), error.c_str() );
return; return;
} }
+13 -15
View File
@@ -75,7 +75,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] ); const CourseDifficulty cd = StringToCourseDifficulty( sParams[1] );
if( cd == DIFFICULTY_INVALID ) if( cd == DIFFICULTY_INVALID )
{ {
LOG->Warn( "Course file '%s' contains an invalid #METER string: \"%s\"", LOG->UserLog( "Course file '%s' contains an invalid #METER string: \"%s\"",
sPath.c_str(), sParams[1].c_str() ); sPath.c_str(), sParams[1].c_str() );
continue; continue;
} }
@@ -114,7 +114,8 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
if( attack.fSecsRemaining <= 0.0f) if( attack.fSecsRemaining <= 0.0f)
{ {
LOG->Warn( "Attack has nonpositive length: %s", sBits[1].c_str() ); LOG->UserLog( "Course file \"%s\" has an attack with a nonpositive length: %s",
sPath.c_str(), sBits[1].c_str() );
attack.fSecsRemaining = 0.0f; attack.fSecsRemaining = 0.0f;
} }
@@ -126,7 +127,8 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
} }
else else
{ {
LOG->Warn( "Unexpected value named '%s'", sBits[0].c_str() ); LOG->UserLog( "Course file \"%s\" has an unexpected value named '%s'",
sPath.c_str(), sBits[0].c_str() );
} }
} }
@@ -166,16 +168,14 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
} }
else else
{ {
LOG->Warn( "Course file '%s' contains a random_within_group entry '%s' that is invalid. " LOG->UserLog( "Course file '%s' contains a random_within_group entry '%s' that is invalid. "
"Song should be in the format '<group>/*'.", "Song should be in the format '<group>/*'.",
sPath.c_str(), sSong.c_str() ); sPath.c_str(), sSong.c_str() );
} }
if( !SONGMAN->DoesSongGroupExist(new_entry.songCriteria.m_sGroupName) ) if( !SONGMAN->DoesSongGroupExist(new_entry.songCriteria.m_sGroupName) )
{ {
/* XXX: We need a place to put "user warnings". This is too loud for info.txt-- LOG->UserLog( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. "
* it obscures important warnings--and regular users never look there, anyway. */
LOG->Trace( "Course file '%s' random_within_group entry '%s' specifies a group that doesn't exist. "
"This entry will be ignored.", "This entry will be ignored.",
sPath.c_str(), sSong.c_str() ); sPath.c_str(), sSong.c_str() );
continue; // skip this #SONG continue; // skip this #SONG
@@ -200,9 +200,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
if( new_entry.pSong == NULL ) if( new_entry.pSong == NULL )
{ {
/* XXX: We need a place to put "user warnings". This is too loud for info.txt-- LOG->UserLog( "Course file '%s' contains a fixed song entry '%s' that does not exist. "
* it obscures important warnings--and regular users never look there, anyway. */
LOG->Trace( "Course file '%s' contains a fixed song entry '%s' that does not exist. "
"This entry will be ignored.", "This entry will be ignored.",
sPath.c_str(), sSong.c_str()); sPath.c_str(), sSong.c_str());
continue; // skip this #SONG continue; // skip this #SONG
@@ -217,7 +215,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
new_entry.stepsCriteria.m_iHighMeter = new_entry.stepsCriteria.m_iLowMeter; new_entry.stepsCriteria.m_iHighMeter = new_entry.stepsCriteria.m_iLowMeter;
else if( retval != 2 ) else if( retval != 2 )
{ {
LOG->Warn( "Course file '%s' contains an invalid difficulty setting: \"%s\", 3..6 used instead", LOG->UserLog( "Course file '%s' contains an invalid difficulty setting: \"%s\", 3..6 used instead",
sPath.c_str(), sParams[2].c_str() ); sPath.c_str(), sParams[2].c_str() );
new_entry.stepsCriteria.m_iLowMeter = 3; new_entry.stepsCriteria.m_iLowMeter = 3;
new_entry.stepsCriteria.m_iHighMeter = 6; new_entry.stepsCriteria.m_iHighMeter = 6;
@@ -273,7 +271,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
} }
else else
{ {
LOG->Warn( "Unexpected value named '%s'", sValueName.c_str() ); LOG->UserLog( "Unexpected value named '%s'", sValueName.c_str() );
} }
} }
static TitleSubst tsub("Courses"); static TitleSubst tsub("Courses");
@@ -344,7 +342,7 @@ bool CourseLoaderCRS::LoadFromCRSFile( const RString &_sPath, Course &out )
if( !msd.ReadFile(sPath) ) if( !msd.ReadFile(sPath) )
{ {
LOG->Trace( "Error opening CRS file '%s': %s.", sPath.c_str(), msd.GetError().c_str() ); LOG->UserLog( "Error opening CRS file '%s': %s.", sPath.c_str(), msd.GetError().c_str() );
return false; return false;
} }
@@ -373,14 +371,14 @@ bool CourseLoaderCRS::LoadEditFromFile( const RString &sEditFilePath, ProfileSlo
int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath ); int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath );
if( iBytes > MAX_EDIT_COURSE_SIZE_BYTES ) if( iBytes > MAX_EDIT_COURSE_SIZE_BYTES )
{ {
LOG->Warn( "The edit '%s' is unreasonably large. It won't be loaded.", sEditFilePath.c_str() ); LOG->UserLog( "The edit '%s' is unreasonably large. It won't be loaded.", sEditFilePath.c_str() );
return false; return false;
} }
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sEditFilePath ) ) if( !msd.ReadFile( sEditFilePath ) )
{ {
LOG->Warn( "Error opening edit file \"%s\": %s", sEditFilePath.c_str(), msd.GetError().c_str() ); LOG->UserLog( "Error opening edit file \"%s\": %s", sEditFilePath.c_str(), msd.GetError().c_str() );
return false; return false;
} }
Course *pCourse = new Course; Course *pCourse = new Course;
+1 -1
View File
@@ -13,7 +13,7 @@ bool CourseWriterCRS::Write( const Course &course, const RString &sPath, bool bS
RageFile f; RageFile f;
if( !f.Open( sPath, RageFile::WRITE ) ) if( !f.Open( sPath, RageFile::WRITE ) )
{ {
LOG->Warn( "Could not write course file '%s': %s", sPath.c_str(), f.GetError().c_str() ); LOG->UserLog( "Could not write course file '%s': %s", sPath.c_str(), f.GetError().c_str() );
return false; return false;
} }
+1 -1
View File
@@ -219,7 +219,7 @@ static void LoadFromSMNoteDataStringWithPlayer( NoteData& out, const RString &sS
if( tn.type == TapNote::hold_head && tn.iDuration == MAX_NOTE_ROW ) if( tn.type == TapNote::hold_head && tn.iDuration == MAX_NOTE_ROW )
{ {
int iRow = begin->first; int iRow = begin->first;
LOG->Warn( "Unmatched 2 at beat %f", NoteRowToBeat(iRow) ); LOG->UserLog( "Unmatched 2 at beat %f", NoteRowToBeat(iRow) );
out.RemoveTapNote( t, begin ); out.RemoveTapNote( t, begin );
} }
+22 -15
View File
@@ -197,7 +197,7 @@ static StepsType DetermineStepsType( int iPlayer, const NoteData &nd )
default: return STEPS_TYPE_INVALID; default: return STEPS_TYPE_INVALID;
} }
default: default:
LOG->Warn( "Invalid #PLAYER value %d", iPlayer ); LOG->UserLog( "Invalid #PLAYER value %d", iPlayer );
return STEPS_TYPE_INVALID; return STEPS_TYPE_INVALID;
} }
} }
@@ -410,7 +410,7 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa
if( out.m_StepsType == STEPS_TYPE_INVALID ) if( out.m_StepsType == STEPS_TYPE_INVALID )
{ {
LOG->Warn( "Couldn't determine note type of file '%s'", sPath.c_str() ); LOG->UserLog( "Couldn't determine note type of file '%s'", sPath.c_str() );
return false; return false;
} }
@@ -429,7 +429,7 @@ bool BMSLoader::LoadFromBMSFile( const RString &sPath, const NameToData_t &mapNa
} }
else else
{ {
LOG->Warn( "No room to shift." ); LOG->UserLog( "In BMS file \"%s\", there is no room to shift the autokeysound tracks.", sPath.c_str() );
} }
} }
} }
@@ -555,13 +555,17 @@ bool BMSLoader::ReadBMSFile( const RString &sPath, NameToData_t &mapNameToData )
{ {
RageFile file; RageFile file;
if( !file.Open(sPath) ) if( !file.Open(sPath) )
RageException::Throw( "Failed to open \"%s\" for reading: %s", sPath.c_str(), file.GetError().c_str() ); {
LOG->UserLog( "Failed to open \"%s\" for reading: %s", sPath.c_str(), file.GetError().c_str() );
return false;
}
while( !file.AtEOF() ) while( !file.AtEOF() )
{ {
RString line; RString line;
if( file.GetLine(line) == -1 ) if( file.GetLine(line) == -1 )
{ {
LOG->Warn( "Error reading \"%s\": %s", sPath.c_str(), file.GetError().c_str() ); LOG->UserLog( "Error reading \"%s\": %s", sPath.c_str(), file.GetError().c_str() );
return false; return false;
} }
@@ -648,7 +652,8 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
else else
{ {
LOG->Trace( "Invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(0), fBPM ); LOG->UserLog( "In BMS file \"%s\", there is an invalid BPM change at beat %f, BPM %f.",
out.GetSongFilePath().c_str(), NoteRowToBeat(0), fBPM );
} }
} }
@@ -682,7 +687,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
} }
if( !IsAFile(out.GetSongDir()+sData) ) if( !IsAFile(out.GetSongDir()+sData) )
LOG->Trace( "Song \"%s\" references key \"%s\" that can't be found", LOG->UserLog( "Song \"%s\" references key \"%s\" that can't be found",
m_sDir.c_str(), sData.c_str() ); m_sDir.c_str(), sData.c_str() );
sWavID.MakeUpper(); // HACK: undo the MakeLower() sWavID.MakeUpper(); // HACK: undo the MakeLower()
@@ -730,8 +735,8 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
else else
{ {
// This is too loud for warn. LOG->UserLog( "In BMS file \"%s\", there is an invalid BPM change at beat %f, BPM %d.",
LOG->Trace( "Invalid BPM change at beat %f, BPM %d.", fBeat, iVal ); out.GetSongFilePath().c_str(), fBeat, iVal );
} }
break; break;
@@ -751,12 +756,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
else else
{ {
LOG->Trace( "Invalid BPM change at beat %f, BPM %f", fBeat, fBPM ); LOG->UserLog( "In BMS file \"%s\", there is an invalid BPM change at beat %f, BPM %f",
out.GetSongFilePath().c_str(), fBeat, fBPM );
} }
} }
else else
{ {
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() ); LOG->UserLog( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
} }
break; break;
} }
@@ -777,7 +783,7 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
else else
{ {
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() ); LOG->UserLog( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
} }
break; break;
} }
@@ -807,12 +813,13 @@ void BMSLoader::ReadGlobalTags( const NameToData_t &mapNameToData, Song &out )
} }
else else
{ {
LOG->Trace( "Invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(iStepIndex), fBPM ); LOG->UserLog( "In BMS file \"%s\", there is an invalid BPM change at beat %f, BPM %f.",
out.GetSongFilePath().c_str(), NoteRowToBeat(iStepIndex), fBPM );
} }
} }
else else
{ {
LOG->Warn( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() ); LOG->UserLog( "Couldn't find tag '%s' in '%s'.", sTagToLookFor.c_str(), m_sDir.c_str() );
} }
break; break;
@@ -942,7 +949,7 @@ bool BMSLoader::LoadFromDir( const RString &sDir, Song &out )
{ {
// All bets are off; the titles don't match at all. // All bets are off; the titles don't match at all.
// At this rate we're lucky if we even get the title right. // At this rate we're lucky if we even get the title right.
LOG->Warn("BMS files in %s have inconsistent titles", sDir.c_str() ); LOG->UserLog( "BMS files in %s have inconsistent titles", sDir.c_str() );
} }
/* Create a Steps for each. */ /* Create a Steps for each. */
+19 -13
View File
@@ -60,7 +60,7 @@ void DWILoader::DWIcharToNote( char c, GameController i, int &note1Out, int &not
case 'L': note1Out = DANCE_NOTE_PAD1_UPRIGHT; note2Out = DANCE_NOTE_PAD1_RIGHT; break; case 'L': note1Out = DANCE_NOTE_PAD1_UPRIGHT; note2Out = DANCE_NOTE_PAD1_RIGHT; break;
case 'M': note1Out = DANCE_NOTE_PAD1_UPLEFT; note2Out = DANCE_NOTE_PAD1_UPRIGHT; break; case 'M': note1Out = DANCE_NOTE_PAD1_UPLEFT; note2Out = DANCE_NOTE_PAD1_UPRIGHT; break;
default: default:
LOG->Warn( "Encountered invalid DWI note character '%c' in '%s'", c, m_sLoadingFile.c_str() ); LOG->UserLog( "Encountered invalid DWI note character '%c' in '%s'", c, m_sLoadingFile.c_str() );
note1Out = DANCE_NOTE_NONE; note2Out = DANCE_NOTE_NONE; break; note1Out = DANCE_NOTE_NONE; note2Out = DANCE_NOTE_NONE; break;
} }
@@ -234,7 +234,7 @@ bool DWILoader::LoadFromDWITokens(
{ {
if( c == '!' ) if( c == '!' )
{ {
LOG->Warn( "Unexpected character in '%s': '!'", m_sLoadingFile.c_str() ); LOG->UserLog( "Unexpected character in '%s': '!'", m_sLoadingFile.c_str() );
continue; continue;
} }
@@ -316,10 +316,8 @@ bool DWILoader::LoadFromDWITokens(
if( !bFound ) if( !bFound )
{ {
/* The hold was never closed. */ /* The hold was never closed. */
LOG->Warn( "File \"%s\":\"%s\" failed to close a hold note on track %i", LOG->UserLog( "File \"%s\":\"%s\" failed to close a hold note on track %i",
m_sLoadingFile.c_str(), m_sLoadingFile.c_str(), sDescription.c_str(), t );
sDescription.c_str(),
t );
newNoteData.SetTapNote( t, iHeadRow, TAP_EMPTY ); newNoteData.SetTapNote( t, iHeadRow, TAP_EMPTY );
} }
@@ -366,7 +364,10 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sPath ) ) if( !msd.ReadFile( sPath ) )
RageException::Throw( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() ); {
LOG->UserLog( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() );
return false;
}
for( unsigned i=0; i<msd.GetNumValues(); i++ ) for( unsigned i=0; i<msd.GetNumValues(); i++ )
{ {
@@ -376,7 +377,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
if(iNumParams < 1) if(iNumParams < 1)
{ {
LOG->Warn("Got \"%s\" tag with no parameters in '%s'", sValueName.c_str(), m_sLoadingFile.c_str() ); LOG->UserLog( "Got \"%s\" tag with no parameters in '%s'", sValueName.c_str(), m_sLoadingFile.c_str() );
continue; continue;
} }
@@ -410,7 +411,8 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
if( fBPM > 0.0f ) if( fBPM > 0.0f )
out.AddBPMSegment( BPMSegment(0, fBPM) ); out.AddBPMSegment( BPMSegment(0, fBPM) );
else else
LOG->Trace( "Invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(0), fBPM ); LOG->UserLog( "Invalid BPM change at beat %f, BPM %f in \"%s\".",
NoteRowToBeat(0), fBPM, sPath.c_str() );
} }
else if( 0==stricmp(sValueName,"DISPLAYBPM") ) else if( 0==stricmp(sValueName,"DISPLAYBPM") )
{ {
@@ -457,7 +459,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); split( arrayFreezeExpressions[f], "=", arrayFreezeValues );
if( arrayFreezeValues.size() != 2 ) if( arrayFreezeValues.size() != 2 )
{ {
LOG->Warn( "Invalid FREEZE in '%s': '%s'", m_sLoadingFile.c_str(), arrayFreezeExpressions[f].c_str() ); LOG->UserLog( "Invalid FREEZE in '%s': '%s'", m_sLoadingFile.c_str(), arrayFreezeExpressions[f].c_str() );
continue; continue;
} }
int iFreezeRow = BeatToNoteRow( StringToFloat(arrayFreezeValues[0]) / 4.0f ); int iFreezeRow = BeatToNoteRow( StringToFloat(arrayFreezeValues[0]) / 4.0f );
@@ -479,7 +481,7 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
if( arrayBPMChangeValues.size() != 2 ) if( arrayBPMChangeValues.size() != 2 )
{ {
LOG->Warn( "Invalid CHANGEBPM in '%s': '%s'", m_sLoadingFile.c_str(), arrayBPMChangeExpressions[b].c_str() ); LOG->UserLog( "Invalid CHANGEBPM in '%s': '%s'", m_sLoadingFile.c_str(), arrayBPMChangeExpressions[b].c_str() );
continue; continue;
} }
@@ -492,7 +494,8 @@ bool DWILoader::LoadFromDWIFile( const RString &sPath, Song &out )
} }
else else
{ {
LOG->Trace( "Invalid BPM change at beat %f, BPM %f.", NoteRowToBeat(iStartIndex), fBPM ); LOG->UserLog( "Invalid BPM change at beat %f, BPM %f in \"%s\".",
NoteRowToBeat(iStartIndex), fBPM, m_sLoadingFile.c_str() );
} }
} }
} }
@@ -561,7 +564,10 @@ bool DWILoader::LoadFromDir( const RString &sPath, Song &out )
GetApplicableFiles( sPath, aFileNames ); GetApplicableFiles( sPath, aFileNames );
if( aFileNames.size() > 1 ) if( aFileNames.size() > 1 )
RageException::Throw( "There is more than one DWI file in '%s'. There should be only one!", sPath.c_str() ); {
LOG->UserLog( "There is more than one DWI file in '%s'. There should be only one!", sPath.c_str() );
return false;
}
/* We should have exactly one; if we had none, we shouldn't have been /* We should have exactly one; if we had none, we shouldn't have been
* called to begin with. */ * called to begin with. */
+35 -24
View File
@@ -68,7 +68,10 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sPath ) ) if( !msd.ReadFile( sPath ) )
RageException::Throw( "Error opening file '%s'.", sPath.c_str() ); {
LOG->UserLog( "Error opening file '%s'.", sPath.c_str() );
return false;
}
m_iTickCount = -1; // this is the value we read for TICKCOUNT m_iTickCount = -1; // this is the value we read for TICKCOUNT
m_vNoteRows.clear(); //Start from a clean slate. m_vNoteRows.clear(); //Start from a clean slate.
@@ -84,8 +87,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
m_iTickCount = atoi( sParams[1] ); m_iTickCount = atoi( sParams[1] );
if( m_iTickCount <= 0 ) if( m_iTickCount <= 0 )
{ {
// XXX need a place for user warnings. LOG->UserLog( "KSF file \"%s\" has an invalid tick count: %d", sPath.c_str(), m_iTickCount );
LOG->Warn( "Invalid tick count: %d", m_iTickCount );
return false; return false;
} }
} }
@@ -104,7 +106,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
if( m_iTickCount == -1 ) if( m_iTickCount == -1 )
{ {
m_iTickCount = 2; m_iTickCount = 2;
LOG->Warn( "\"%s\": TICKCOUNT not found; defaulting to %i", sPath.c_str(), m_iTickCount ); LOG->UserLog( "\"%s\": TICKCOUNT not found; defaulting to %i", sPath.c_str(), m_iTickCount );
} }
NoteData notedata; // read it into here NoteData notedata; // read it into here
@@ -196,10 +198,10 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
if( sRowString.size() != 13 ) if( sRowString.size() != 13 )
{ {
if (m_bKIUCompliant) if( m_bKIUCompliant )
{ {
LOG->Warn("File %s had illegal syntax (\"%s\") which can't be in KIU complient files.", LOG->UserLog( "File \"%s\" had illegal syntax (\"%s\") which can't be in KIU complient files.",
sPath.c_str(), sRowString.c_str()); sPath.c_str(), sRowString.c_str() );
return false; return false;
} }
if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") ) if( BeginsWith(sRowString, "|B") || BeginsWith(sRowString, "|D") )
@@ -216,8 +218,8 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
} }
else else
{ {
LOG->Warn("File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored", LOG->UserLog( "File %s had a RowString with an improper length (\"%s\"); corrupt notes ignored",
sPath.c_str(), sRowString.c_str()); sPath.c_str(), sRowString.c_str() );
return false; return false;
} }
} }
@@ -227,7 +229,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
sRowString.erase( 0, 2 ); sRowString.erase( 0, 2 );
// Update TICKCOUNT for Direct Move files. // Update TICKCOUNT for Direct Move files.
if (m_bTickChangeNeeded) if( m_bTickChangeNeeded )
{ {
m_iTickCount = newTick; m_iTickCount = newTick;
m_bTickChangeNeeded = false; m_bTickChangeNeeded = false;
@@ -262,7 +264,7 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
case '0': tap = TAP_EMPTY; break; case '0': tap = TAP_EMPTY; break;
case '1': tap = TAP_ORIGINAL_TAP; break; case '1': tap = TAP_ORIGINAL_TAP; break;
default: default:
LOG->Warn( "File %s had an invalid row (\"%s\"); corrupt notes ignored", LOG->UserLog( "File %s had an invalid row (\"%s\"); corrupt notes ignored",
sPath.c_str(), sRowString.c_str() ); sPath.c_str(), sRowString.c_str() );
return false; return false;
} }
@@ -335,7 +337,10 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
{ {
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sPath ) ) if( !msd.ReadFile( sPath ) )
RageException::Throw( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() ); {
LOG->UserLog( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() );
return false;
}
float SMGap1 = 0, SMGap2 = 0, BPM1 = -1, BPMPos2 = -1, BPM2 = -1, BPMPos3 = -1, BPM3 = -1; float SMGap1 = 0, SMGap2 = 0, BPM1 = -1, BPMPos2 = -1, BPM2 = -1, BPMPos3 = -1, BPM3 = -1;
m_iTickCount = -1; m_iTickCount = -1;
@@ -413,14 +418,17 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
continue; continue;
} }
else else
LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); {
LOG->UserLog( "In KSF file \"%s\", there was an unexpected value named '%s'",
sPath.c_str(), sValueName.c_str() );
}
} }
/* BPM Change checks are done here. If m_bKIUCompliant, it's short and sweet. /* BPM Change checks are done here. If m_bKIUCompliant, it's short and sweet.
* Otherwise, the whole file has to be processed. Right now, this is only * Otherwise, the whole file has to be processed. Right now, this is only
* called once, for the initial file (often the Crazy steps). Hopefully that * called once, for the initial file (often the Crazy steps). Hopefully that
* will end up changing soon. */ * will end up changing soon. */
if (m_bKIUCompliant) if( m_bKIUCompliant )
{ {
if( BPM2 > 0 && BPMPos2 > 0 ) if( BPM2 > 0 && BPMPos2 > 0 )
{ {
@@ -495,27 +503,27 @@ bool KSFLoader::LoadGlobalData( const RString &sPath, Song &out )
else else
{ {
/* Quit while we're ahead if any bad syntax is spotted. */ /* Quit while we're ahead if any bad syntax is spotted. */
LOG->Warn("File %s has a RowString which matches no known syntax rules (\"%s\"); bad file", LOG->UserLog( "File %s has a RowString which matches no known syntax rules (\"%s\"); bad file",
sPath.c_str(), NoteRowString.c_str()); sPath.c_str(), NoteRowString.c_str() );
return false; return false;
} }
} }
if (m_bTickChangeNeeded) if( m_bTickChangeNeeded )
{ {
m_iTickCount = tickToChange; m_iTickCount = tickToChange;
m_bTickChangeNeeded = false; m_bTickChangeNeeded = false;
} }
if (m_bBPMChangeNeeded) if( m_bBPMChangeNeeded )
{ {
LOG->Trace( "Adding tempo change of %f BPM at beat %f", speedToChange, m_fCurBeat); LOG->Trace( "Adding tempo change of %f BPM at beat %f", speedToChange, m_fCurBeat );
out.AddBPMSegment(BPMSegment(BeatToNoteRow(m_fCurBeat),speedToChange)); out.AddBPMSegment( BPMSegment(BeatToNoteRow(m_fCurBeat), speedToChange) );
m_bBPMChangeNeeded = false; m_bBPMChangeNeeded = false;
} }
if (m_bBPMStopNeeded) if( m_bBPMStopNeeded )
{ {
LOG->Trace( "Adding tempo freeze of %f seconds at beat %f", timeToStop, m_fCurBeat); LOG->Trace( "Adding tempo freeze of %f seconds at beat %f", timeToStop, m_fCurBeat );
out.AddStopSegment(StopSegment(BeatToNoteRow(m_fCurBeat),timeToStop)); out.AddStopSegment( StopSegment(BeatToNoteRow(m_fCurBeat),timeToStop) );
m_bBPMStopNeeded = false; m_bBPMStopNeeded = false;
} }
m_fCurBeat += 1.0f / m_iTickCount; m_fCurBeat += 1.0f / m_iTickCount;
@@ -552,7 +560,10 @@ bool KSFLoader::LoadFromDir( const RString &sDir, Song &out )
/* We shouldn't have been called to begin with if there were no KSFs. */ /* We shouldn't have been called to begin with if there were no KSFs. */
if( arrayKSFFileNames.empty() ) if( arrayKSFFileNames.empty() )
RageException::Throw( "Couldn't find any KSF files in '%s'", sDir.c_str() ); {
LOG->UserLog( "Couldn't find any KSF files in '%s'", sDir.c_str() );
return false;
}
/* If only the first file is read, it will cause problems for other simfiles with /* If only the first file is read, it will cause problems for other simfiles with
* different BPM changes and tickcounts. This command will probably have to be * different BPM changes and tickcounts. This command will probably have to be
+23 -26
View File
@@ -73,7 +73,7 @@ bool SMLoader::LoadTimingFromFile( const RString &fn, TimingData &out )
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( fn ) ) if( !msd.ReadFile( fn ) )
{ {
LOG->Warn( "Couldn't load %s, \"%s\"", fn.c_str(), msd.GetError().c_str() ); LOG->UserLog( "Couldn't load %s, \"%s\"", fn.c_str(), msd.GetError().c_str() );
return false; return false;
} }
@@ -107,11 +107,10 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
{ {
vector<RString> arrayFreezeValues; vector<RString> arrayFreezeValues;
split( arrayFreezeExpressions[f], "=", arrayFreezeValues ); split( arrayFreezeExpressions[f], "=", arrayFreezeValues );
/* XXX: Once we have a way to display warnings that the user actually
* cares about (unlike most warnings), this should be one of them. */
if( arrayFreezeValues.size() != 2 ) if( arrayFreezeValues.size() != 2 )
{ {
LOG->Warn( "Invalid #%s value \"%s\" (must have exactly one '='), ignored", // XXX: Hard to tell which file caused this.
LOG->UserLog( "Invalid #%s value \"%s\" (must have exactly one '='), ignored",
sValueName.c_str(), arrayFreezeExpressions[f].c_str() ); sValueName.c_str(), arrayFreezeExpressions[f].c_str() );
continue; continue;
} }
@@ -136,11 +135,10 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
{ {
vector<RString> arrayBPMChangeValues; vector<RString> arrayBPMChangeValues;
split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues ); split( arrayBPMChangeExpressions[b], "=", arrayBPMChangeValues );
/* XXX: Once we have a way to display warnings that the user actually // XXX: Hard to tell which file caused this.
* cares about (unlike most warnings), this should be one of them. */ if( arrayBPMChangeValues.size() != 2 )
if(arrayBPMChangeValues.size() != 2)
{ {
LOG->Warn( "Invalid #%s value \"%s\" (must have exactly one '='), ignored", LOG->UserLog( "Invalid #%s value \"%s\" (must have exactly one '='), ignored",
sValueName.c_str(), arrayBPMChangeExpressions[b].c_str() ); sValueName.c_str(), arrayBPMChangeExpressions[b].c_str() );
continue; continue;
} }
@@ -151,7 +149,7 @@ void SMLoader::LoadTimingFromSMFile( const MsdFile &msd, TimingData &out )
if( fNewBPM > 0.0f ) if( fNewBPM > 0.0f )
out.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) ); out.AddBPMSegment( BPMSegment(BeatToNoteRow(fBeat), fNewBPM) );
else else
LOG->Trace( "Invalid BPM change at beat %f, BPM %f.", fBeat, fNewBPM ); LOG->UserLog( "Invalid BPM change at beat %f, BPM %f.", fBeat, fNewBPM );
} }
} }
} }
@@ -230,7 +228,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sPath ) ) if( !msd.ReadFile( sPath ) )
{ {
LOG->Warn( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() ); LOG->UserLog( "Error opening file \"%s\": %s", sPath.c_str(), msd.GetError().c_str() );
return false; return false;
} }
@@ -359,7 +357,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
else if(!stricmp(sParams[1],"ROULETTE")) else if(!stricmp(sParams[1],"ROULETTE"))
out.m_SelectionDisplay = out.SHOW_ROULETTE; out.m_SelectionDisplay = out.SHOW_ROULETTE;
else else
LOG->Warn( "The song file '%s' has an unknown #SELECTABLE value, '%s'; ignored.", sPath.c_str(), sParams[1].c_str()); LOG->UserLog( "The song file '%s' has an unknown #SELECTABLE value, '%s'; ignored.", sPath.c_str(), sParams[1].c_str());
} }
else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" ) else if( sValueName.Left(strlen("BGCHANGES"))=="BGCHANGES" || sValueName=="ANIMATIONS" )
@@ -371,7 +369,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
bool bValid = iLayer>=0 && iLayer<NUM_BackgroundLayer; bool bValid = iLayer>=0 && iLayer<NUM_BackgroundLayer;
if( !bValid ) if( !bValid )
{ {
LOG->Warn( "The song file '%s' has a BGCHANGES tag '%s' that is out of range.", sPath.c_str(), sValueName.c_str() ); LOG->UserLog( "The song file '%s' has a BGCHANGES tag '%s' that is out of range.", sPath.c_str(), sValueName.c_str() );
} }
else else
{ {
@@ -409,7 +407,7 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
{ {
if( iNumParams < 7 ) if( iNumParams < 7 )
{ {
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have at least %d.", sPath.c_str(), iNumParams, 7 ); LOG->UserLog( "The song file '%s' is has %d fields in a #NOTES tag, but should have at least %d.", sPath.c_str(), iNumParams, 7 );
continue; continue;
} }
@@ -425,11 +423,10 @@ bool SMLoader::LoadFromSMFile( const RString &sPath, Song &out )
out.AddSteps( pNewNotes ); out.AddSteps( pNewNotes );
} }
else if( sValueName=="OFFSET" || sValueName=="BPMS" || else if( sValueName=="OFFSET" || sValueName=="BPMS" || sValueName=="STOPS" || sValueName=="FREEZES" )
sValueName=="STOPS" || sValueName=="FREEZES" )
; ;
else else
LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); LOG->UserLog( "The song file \"%s\" has an unexpected value named '%s'", sPath.c_str(), sValueName.c_str() );
} }
return true; return true;
@@ -443,7 +440,7 @@ bool SMLoader::LoadFromDir( const RString &sPath, Song &out )
if( aFileNames.size() > 1 ) if( aFileNames.size() > 1 )
{ {
LOG->Warn( "There is more than one SM file in '%s'. There should be only one!", sPath.c_str() ); LOG->UserLog( "There is more than one SM file in '%s'. There should be only one!", sPath.c_str() );
return false; return false;
} }
@@ -461,14 +458,14 @@ bool SMLoader::LoadEditFromFile( RString sEditFilePath, ProfileSlot slot, bool b
int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath ); int iBytes = FILEMAN->GetFileSizeInBytes( sEditFilePath );
if( iBytes > MAX_EDIT_STEPS_SIZE_BYTES ) if( iBytes > MAX_EDIT_STEPS_SIZE_BYTES )
{ {
LOG->Warn( "The edit '%s' is unreasonably large. It won't be loaded.", sEditFilePath.c_str() ); LOG->UserLog( "The edit '%s' is unreasonably large. It won't be loaded.", sEditFilePath.c_str() );
return false; return false;
} }
MsdFile msd; MsdFile msd;
if( !msd.ReadFile( sEditFilePath ) ) if( !msd.ReadFile( sEditFilePath ) )
{ {
LOG->Warn( "Error opening edit file \"%s\": %s", sEditFilePath.c_str(), msd.GetError().c_str() ); LOG->UserLog( "Error opening edit file \"%s\": %s", sEditFilePath.c_str(), msd.GetError().c_str() );
return false; return false;
} }
@@ -498,7 +495,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
{ {
if( pSong ) if( pSong )
{ {
LOG->Warn( "The edit file '%s' has more than one #SONG tag.", sEditFilePath.c_str() ); LOG->UserLog( "The edit file '%s' has more than one #SONG tag.", sEditFilePath.c_str() );
return false; return false;
} }
@@ -508,13 +505,13 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
pSong = SONGMAN->FindSong( sSongFullTitle ); pSong = SONGMAN->FindSong( sSongFullTitle );
if( pSong == NULL ) if( pSong == NULL )
{ {
LOG->Warn( "The edit file '%s' required a song '%s' that isn't present.", sEditFilePath.c_str(), sSongFullTitle.c_str() ); LOG->UserLog( "The edit file '%s' required a song '%s' that isn't present.", sEditFilePath.c_str(), sSongFullTitle.c_str() );
return false; return false;
} }
if( pSong->GetNumStepsLoadedFromProfile(slot) >= MAX_EDITS_PER_SONG_PER_PROFILE ) if( pSong->GetNumStepsLoadedFromProfile(slot) >= MAX_EDITS_PER_SONG_PER_PROFILE )
{ {
LOG->Warn( "The song '%s' already has the maximum number of edits allowed for ProfileSlotP%d.", sSongFullTitle.c_str(), slot+1 ); LOG->UserLog( "The song '%s' already has the maximum number of edits allowed for ProfileSlotP%d.", sSongFullTitle.c_str(), slot+1 );
return false; return false;
} }
} }
@@ -523,13 +520,13 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
{ {
if( pSong == NULL ) if( pSong == NULL )
{ {
LOG->Warn( "The edit file '%s' has doesn't have a #SONG tag preceeding the first #NOTES tag.", sEditFilePath.c_str() ); LOG->UserLog( "The edit file '%s' has doesn't have a #SONG tag preceeding the first #NOTES tag.", sEditFilePath.c_str() );
return false; return false;
} }
if( iNumParams < 7 ) if( iNumParams < 7 )
{ {
LOG->Trace( "The song file '%s' is has %d fields in a #NOTES tag, but should have at least %d.", sEditFilePath.c_str(), iNumParams, 7 ); LOG->UserLog( "The edit file '%s' is has %d fields in a #NOTES tag, but should have at least %d.", sEditFilePath.c_str(), iNumParams, 7 );
continue; continue;
} }
@@ -547,7 +544,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
if( pSong->IsEditAlreadyLoaded(pNewNotes) ) if( pSong->IsEditAlreadyLoaded(pNewNotes) )
{ {
LOG->Warn( "The edit file '%s' is a duplicate of another edit that was already loaded.", sEditFilePath.c_str() ); LOG->UserLog( "The edit file '%s' is a duplicate of another edit that was already loaded.", sEditFilePath.c_str() );
SAFE_DELETE( pNewNotes ); SAFE_DELETE( pNewNotes );
return false; return false;
} }
@@ -557,7 +554,7 @@ bool SMLoader::LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath
} }
else else
{ {
LOG->Trace( "Unexpected value named '%s'", sValueName.c_str() ); LOG->UserLog( "The edit file \"%s\" has an unexpected value named '%s'", sEditFilePath.c_str(), sValueName.c_str() );
} }
} }
+4 -1
View File
@@ -347,7 +347,10 @@ bool NotesWriterDWI::Write( RString sPath, const Song &out )
{ {
RageFile f; RageFile f;
if( !f.Open( sPath, RageFile::WRITE ) ) if( !f.Open( sPath, RageFile::WRITE ) )
RageException::Throw( "Error opening song file \"%s\" for writing: \"%s\"", sPath.c_str(), f.GetError().c_str() ); {
LOG->UserLog( "Error opening song file \"%s\" for writing: \"%s\"", sPath.c_str(), f.GetError().c_str() );
return false;
}
/* Write transliterations, if we have them, since DWI doesn't support UTF-8. */ /* Write transliterations, if we have them, since DWI doesn't support UTF-8. */
f.PutLine( ssprintf("#TITLE:%s;", out.GetTranslitFullTitle().c_str()) ); f.PutLine( ssprintf("#TITLE:%s;", out.GetTranslitFullTitle().c_str()) );
+1 -1
View File
@@ -209,7 +209,7 @@ bool NotesWriterSM::Write( RString sPath, const Song &out, bool bSavingCache )
RageFile f; RageFile f;
if( !f.Open( sPath, flags ) ) if( !f.Open( sPath, flags ) )
{ {
LOG->Warn( "Error opening song file '%s' for writing: %s", sPath.c_str(), f.GetError().c_str() ); LOG->UserLog( "Error opening song file '%s' for writing: %s", sPath.c_str(), f.GetError().c_str() );
return false; return false;
} }
+2 -2
View File
@@ -245,7 +245,7 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid )
{ {
if( bWarnOnInvalid ) if( bWarnOnInvalid )
{ {
LOG->Warn( "Invalid player options '%s'; did you mean '*%d'?", LOG->UserLog( "Invalid player options '%s'; did you mean '*%d'?",
s->c_str(), atoi(*s) ); s->c_str(), atoi(*s) );
} }
// XXX We know what they want, is there any reason not to handle it? // XXX We know what they want, is there any reason not to handle it?
@@ -361,7 +361,7 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid )
if( bWarnOnInvalid ) if( bWarnOnInvalid )
{ {
RString sWarning = ssprintf( "The options string '%s' contains an invalid mod name '%s'", sOptions.c_str(), sBit.c_str() ); RString sWarning = ssprintf( "The options string '%s' contains an invalid mod name '%s'", sOptions.c_str(), sBit.c_str() );
LOG->Warn( "%s", sWarning.c_str() ); LOG->UserLog( "%s", sWarning.c_str() );
Dialog::OK( sWarning, "INVALID_PLAYER_OPTION_WARNING" ); Dialog::OK( sWarning, "INVALID_PLAYER_OPTION_WARNING" );
} }
} }
+1 -1
View File
@@ -119,7 +119,7 @@ SoundReader *SoundReader_FileReader::OpenFile( RString filename, RString &error
SoundReader_FileReader *NewSample = TryOpenFile( filename, error, *it, bKeepTrying ); SoundReader_FileReader *NewSample = TryOpenFile( filename, error, *it, bKeepTrying );
if( NewSample ) if( NewSample )
{ {
LOG->Warn("File \"%s\" is really %s", filename.c_str(), it->c_str()); LOG->UserLog( "File \"%s\" is really %s", filename.c_str(), it->c_str() );
return NewSample; return NewSample;
} }
} }
+1 -1
View File
@@ -108,7 +108,7 @@ RageSurface *RageSurfaceUtils::LoadFile( const RString &sPath, RString &error, b
RageSurface *ret = TryOpenFile( sPath, bHeaderOnly, error, *it, bKeepTrying ); RageSurface *ret = TryOpenFile( sPath, bHeaderOnly, error, *it, bKeepTrying );
if( ret ) if( ret )
{ {
LOG->Warn("File \"%s\" is really %s", sPath.c_str(), it->c_str()); LOG->UserLog( "File \"%s\" is really %s", sPath.c_str(), it->c_str() );
return ret; return ret;
} }
} }
+13 -14
View File
@@ -236,7 +236,7 @@ bool Song::LoadFromSongDir( RString sDir )
} }
else else
{ {
LOG->Warn( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'.", sDir.c_str() ); LOG->UserLog( "Couldn't find any SM, DWI, BMS, or KSF files in '%s'.", sDir.c_str() );
vector<RString> vs; vector<RString> vs;
GetDirListing( sDir + "*.mp3", vs, false, false ); GetDirListing( sDir + "*.mp3", vs, false, false );
@@ -245,7 +245,7 @@ bool Song::LoadFromSongDir( RString sDir )
if( !bHasMusic ) if( !bHasMusic )
{ {
LOG->Warn( "No music file in this directory either. Ignoring this song directory." ); LOG->UserLog( "No music file in this directory either. Ignoring this song directory." );
return false; return false;
} }
@@ -277,7 +277,7 @@ bool Song::LoadFromSongDir( RString sDir )
if( !m_bHasMusic ) if( !m_bHasMusic )
{ {
LOG->Trace( "Song \"%s\" ignored (no music)", sDir.c_str() ); LOG->UserLog( "Song \"%s\" ignored (no music)", sDir.c_str() );
return false; // don't load this song return false; // don't load this song
} }
@@ -349,7 +349,7 @@ void Song::TidyUpData()
* (which have no music file, per se) but it's something of a hack. */ * (which have no music file, per se) but it's something of a hack. */
if( Sample == NULL && m_sMusicFile != "" ) if( Sample == NULL && m_sMusicFile != "" )
{ {
LOG->Warn( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() ); LOG->UserLog( "Error opening sound \"%s\": %s", GetMusicPath().c_str(), error.c_str() );
/* Don't use this file. */ /* Don't use this file. */
m_sMusicFile = ""; m_sMusicFile = "";
@@ -366,19 +366,19 @@ void Song::TidyUpData()
} }
else if( m_fMusicLengthSeconds == 0 ) else if( m_fMusicLengthSeconds == 0 )
{ {
LOG->Warn( "File %s is empty?", GetMusicPath().c_str() ); LOG->UserLog( "File \"%s\" is empty?", GetMusicPath().c_str() );
} }
} }
} }
else // ! HasMusic() else // ! HasMusic()
{ {
m_fMusicLengthSeconds = 100; // guess m_fMusicLengthSeconds = 100; // guess
LOG->Warn("Song \"%s\" has no music file; guessing at %f seconds", this->GetSongDir().c_str(), m_fMusicLengthSeconds); LOG->UserLog( "Song \"%s\" has no music file; guessing at %f seconds", this->GetSongDir().c_str(), m_fMusicLengthSeconds );
} }
if(m_fMusicLengthSeconds < 0) if( m_fMusicLengthSeconds < 0 )
{ {
LOG->Warn( "File %s has negative length? (%f)", GetMusicPath().c_str(), m_fMusicLengthSeconds ); LOG->UserLog( "File %s has negative length? (%f)", GetMusicPath().c_str(), m_fMusicLengthSeconds );
m_fMusicLengthSeconds = 0; m_fMusicLengthSeconds = 0;
} }
@@ -403,9 +403,7 @@ void Song::TidyUpData()
if( m_Timing.m_BPMSegments.empty() ) if( m_Timing.m_BPMSegments.empty() )
{ {
/* XXX: Once we have a way to display warnings that the user actually LOG->UserLog( "No BPM segments specified in '%s%s', default provided.",
* cares about (unlike most warnings), this should be one of them. */
LOG->Warn( "No BPM segments specified in '%s%s', default provided.",
m_sSongDir.c_str(), m_sSongFileName.c_str() ); m_sSongDir.c_str(), m_sSongFileName.c_str() );
m_Timing.AddBPMSegment( BPMSegment(0, 60) ); m_Timing.AddBPMSegment( BPMSegment(0, 60) );
@@ -529,7 +527,7 @@ void Song::TidyUpData()
RageSurface *img = RageSurfaceUtils::LoadFile( sPath, error, true ); RageSurface *img = RageSurfaceUtils::LoadFile( sPath, error, true );
if( !img ) if( !img )
{ {
LOG->Trace( "Couldn't load '%s': %s", sPath.c_str(), error.c_str() ); LOG->UserLog( "Couldn't load '%s': %s", sPath.c_str(), error.c_str() );
continue; continue;
} }
@@ -741,9 +739,10 @@ void Song::Save()
if( !FileCopy( sOldPath, sNewPath ) ) if( !FileCopy( sOldPath, sNewPath ) )
{ {
LOG->Warn( "Backup of \"%s\" failed", sOldPath.c_str() ); LOG->UserLog( "Backup of \"%s\" failed", sOldPath.c_str() );
/* Don't remove. */ /* Don't remove. */
} else }
else
FILEMAN->Remove( sOldPath ); FILEMAN->Remove( sOldPath );
} }
} }