Fixed the Logging system to actually be able to handle errors. Database is also fixed to use directories.
This commit is contained in:
@@ -69,7 +69,7 @@ namespace ehs
|
||||
const AudioCodec* codec = GetCodec(ext);
|
||||
if (!codec)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace ehs
|
||||
const AudioCodec* codec = GetCodec(ext);
|
||||
if (!codec)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace ehs
|
||||
}
|
||||
else
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 2 channels is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 2 channels is unsupported.");
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -363,7 +363,7 @@ namespace ehs
|
||||
}
|
||||
else
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 6 channels is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 6 channels is unsupported.");
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -394,7 +394,7 @@ namespace ehs
|
||||
}
|
||||
else
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 8 channels is unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to 8 channels is unsupported.");
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -779,7 +779,7 @@ namespace ehs
|
||||
}
|
||||
else
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to " +
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to " +
|
||||
Str_8::FromNum(newChannels) + " channels is unsupported.");
|
||||
return;
|
||||
}
|
||||
@@ -878,7 +878,7 @@ namespace ehs
|
||||
}
|
||||
else
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to " +
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Conversion from " + Str_8::FromNum(channels) + " channels, to " +
|
||||
Str_8::FromNum(newChannels) + " channels is unsupported.");
|
||||
|
||||
return result;
|
||||
@@ -901,7 +901,7 @@ namespace ehs
|
||||
const AudioCodec* codec = GetCodec(ext);
|
||||
if (!codec)
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Codec not found for file extension, \"" + ext + "\".");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1927,7 +1927,7 @@ namespace ehs
|
||||
Version version = in.ReadVersion();
|
||||
if (version != Version(1, 0, 0))
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Incompatible audio file version.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Incompatible audio file version.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1954,14 +1954,14 @@ namespace ehs
|
||||
|
||||
if (riff.GetType() != "WAVE")
|
||||
{
|
||||
EHS_LOG_INT("Error", 0, "Data is not in WAVE format.");
|
||||
EHS_LOG_INT(LogType::ERR, 0, "Data is not in WAVE format.");
|
||||
return false;
|
||||
}
|
||||
|
||||
RIFF_Chunk fmt = riff.GetChunk("fmt ");
|
||||
if (!fmt.IsValid())
|
||||
{
|
||||
EHS_LOG_INT("Error", 1, "Wave does not have a format chunk.");
|
||||
EHS_LOG_INT(LogType::ERR, 1, "Wave does not have a format chunk.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1970,59 +1970,59 @@ namespace ehs
|
||||
RIFF_Chunk dChunk = riff.GetChunk("data");
|
||||
if (!dChunk.IsValid())
|
||||
{
|
||||
EHS_LOG_INT("Error", 2, "Wave does not have a data chunk.");
|
||||
EHS_LOG_INT(LogType::ERR, 2, "Wave does not have a data chunk.");
|
||||
return false;
|
||||
}
|
||||
|
||||
UInt_16 compression = fmtSer.Read<UInt_16>();
|
||||
if (compression == 0x2)
|
||||
{
|
||||
EHS_LOG_INT("Error", 3, "Microsoft ADPCM compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 3, "Microsoft ADPCM compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x6)
|
||||
{
|
||||
EHS_LOG_INT("Error", 4, "ITU G.711 a-law compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 4, "ITU G.711 a-law compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x7)
|
||||
{
|
||||
EHS_LOG_INT("Error", 5, "ITU G.711 µ-law compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 5, "ITU G.711 µ-law compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x11)
|
||||
{
|
||||
EHS_LOG_INT("Error", 6, "IMA ADPCM compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 6, "IMA ADPCM compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x16)
|
||||
{
|
||||
EHS_LOG_INT("Error", 7, "TU G.723 ADPCM (Yamaha) compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 7, "TU G.723 ADPCM (Yamaha) compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x31)
|
||||
{
|
||||
EHS_LOG_INT("Error", 8, "GSM 6.10 compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 8, "GSM 6.10 compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x40)
|
||||
{
|
||||
EHS_LOG_INT("Error", 9, "ITU G.721 ADPCM compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 9, "ITU G.721 ADPCM compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0x50)
|
||||
{
|
||||
EHS_LOG_INT("Error", 10, "MPEG compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 10, "MPEG compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression == 0xFFFF)
|
||||
{
|
||||
EHS_LOG_INT("Error", 11, "Experimental compression unsupported.");
|
||||
EHS_LOG_INT(LogType::ERR, 11, "Experimental compression unsupported.");
|
||||
return false;
|
||||
}
|
||||
else if (compression != 0x1 && compression != 0x3)
|
||||
{
|
||||
EHS_LOG_INT("Error", 12, "Wave has unknown compression of " + Str_8::FromNum(compression) + ".");
|
||||
EHS_LOG_INT(LogType::ERR, 12, "Wave has unknown compression of " + Str_8::FromNum(compression) + ".");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user