Changes:
New Logger Add NTCtrl Base to UI7
This commit is contained in:
@@ -50,7 +50,7 @@ Sound::Sound(const string &path, int channel, bool toloop) {
|
||||
std::fstream fp(path, std::ios::in | std::ios::binary);
|
||||
|
||||
if (!fp.is_open()) {
|
||||
printf("Could not open the WAV file: %s\n", path.c_str());
|
||||
_rd7i_logger()->Write("Could not open WAV: " + path, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ Sound::Sound(const string &path, int channel, bool toloop) {
|
||||
size_t read = fp.tellg();
|
||||
if (read != sizeof(wavHeader)) {
|
||||
// Short read.
|
||||
printf("WAV file header is too short: %s\n", path.c_str());
|
||||
_rd7i_logger()->Write("WAV Header is too short", 0);
|
||||
fp.close();
|
||||
return;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ Sound::Sound(const string &path, int channel, bool toloop) {
|
||||
static const char RIFF_magic[4] = {'R', 'I', 'F', 'F'};
|
||||
if (memcmp(wavHeader.magic, RIFF_magic, sizeof(wavHeader.magic)) != 0) {
|
||||
// Incorrect magic number.
|
||||
printf("Wrong file format.\n");
|
||||
_rd7i_logger()->Write("Wrong Fileformat", 0);
|
||||
fp.close();
|
||||
return;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ Sound::Sound(const string &path, int channel, bool toloop) {
|
||||
(wavHeader.channels != 1 && wavHeader.channels != 2) ||
|
||||
(wavHeader.bits_per_sample != 8 && wavHeader.bits_per_sample != 16)) {
|
||||
// Unsupported WAV file.
|
||||
printf("Corrupted wav file.\n");
|
||||
_rd7i_logger()->Write("File is invalid", 0);
|
||||
fp.close();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user