mirror of
https://github.com/fadden/ciderpress.git
synced 2024-10-06 01:56:20 +00:00
Convert WSMG to LOG
Mostly a bulk conversion of debug messages, primarily with sed: sed -e 's/\(WMSG[0-9]\)\(.*\)\(\\n"\)/LOGI\2"/' This removes the '\n' from the end of the log messages, and sets them all to "info" severity. We want to prefix each line with file/line and/or a timestamp, so it doesn't make sense to have a partial line, and there's no value in embedding the '\n' in every string.
This commit is contained in:
parent
bf5e2bce50
commit
f6647b9978
@ -127,13 +127,13 @@ AcuEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
|
||||
char* unsqBuf = NULL;
|
||||
long unsqLen = 0;
|
||||
expBuf.SeizeBuffer(&unsqBuf, &unsqLen);
|
||||
WMSG2("Unsqueezed %ld bytes to %d\n",
|
||||
LOGI("Unsqueezed %ld bytes to %d",
|
||||
(unsigned long) GetCompressedLen(), unsqLen);
|
||||
if (unsqLen == 0) {
|
||||
// some bonehead squeezed a zero-length file
|
||||
delete[] unsqBuf;
|
||||
ASSERT(*ppText == NULL);
|
||||
WMSG0("Handling zero-length squeezed file!\n");
|
||||
LOGI("Handling zero-length squeezed file!");
|
||||
if (needAlloc) {
|
||||
*ppText = new char[1];
|
||||
**ppText = '\0';
|
||||
@ -223,7 +223,7 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
|
||||
len = (long) GetUncompressedLen();
|
||||
if (len == 0) {
|
||||
WMSG0("Empty fork\n");
|
||||
LOGI("Empty fork");
|
||||
result = IDOK;
|
||||
goto bail;
|
||||
}
|
||||
@ -260,12 +260,12 @@ AcuEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
}
|
||||
|
||||
expBuf.SeizeBuffer(&buf, &uncLen);
|
||||
WMSG2("Unsqueezed %ld bytes to %d\n", len, uncLen);
|
||||
LOGI("Unsqueezed %ld bytes to %d", len, uncLen);
|
||||
|
||||
// some bonehead squeezed a zero-length file
|
||||
if (uncLen == 0) {
|
||||
ASSERT(buf == NULL);
|
||||
WMSG0("Handling zero-length squeezed file!\n");
|
||||
LOGI("Handling zero-length squeezed file!");
|
||||
result = IDOK;
|
||||
goto bail;
|
||||
}
|
||||
@ -605,11 +605,11 @@ AcuArchive::ReadMasterHeader(int* pNumEntries)
|
||||
header.unknown1 != 1 ||
|
||||
strcmp((char*) header.fZink, "fZink") != 0)
|
||||
{
|
||||
WMSG0("Not an ACU archive\n");
|
||||
LOGI("Not an ACU archive");
|
||||
return -1;
|
||||
}
|
||||
|
||||
WMSG1("Looks like an ACU archive with %d entries\n", header.fileCount);
|
||||
LOGI("Looks like an ACU archive with %d entries", header.fileCount);
|
||||
|
||||
*pNumEntries = header.fileCount;
|
||||
return 0;
|
||||
@ -661,20 +661,20 @@ AcuArchive::ReadFileHeader(AcuFileEntry* pEntry)
|
||||
|
||||
/* read the filename */
|
||||
if (pEntry->fileNameLen > kAcuMaxFileName) {
|
||||
WMSG1("GLITCH: filename is too long (%d bytes)\n",
|
||||
LOGI("GLITCH: filename is too long (%d bytes)",
|
||||
pEntry->fileNameLen);
|
||||
err = kNuErrGeneric;
|
||||
goto bail;
|
||||
}
|
||||
if (!pEntry->fileNameLen) {
|
||||
WMSG0("GLITCH: filename missing\n");
|
||||
LOGI("GLITCH: filename missing");
|
||||
err = kNuErrGeneric;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/* don't know if this is possible or not */
|
||||
if (pEntry->storageType == 5) {
|
||||
WMSG0("HEY: EXTENDED FILE\n");
|
||||
LOGI("HEY: EXTENDED FILE");
|
||||
}
|
||||
|
||||
err = AcuRead(pEntry->fileName, pEntry->fileNameLen);
|
||||
@ -702,15 +702,15 @@ AcuArchive::DumpFileHeader(const AcuFileEntry* pEntry)
|
||||
FormatDate(createWhen, &createStr);
|
||||
FormatDate(modWhen, &modStr);
|
||||
|
||||
WMSG1(" Header for file '%hs':\n", pEntry->fileName);
|
||||
WMSG4(" dataStorageLen=%d eof=%d blockCount=%d checksum=0x%04x\n",
|
||||
LOGI(" Header for file '%hs':", pEntry->fileName);
|
||||
LOGI(" dataStorageLen=%d eof=%d blockCount=%d checksum=0x%04x",
|
||||
pEntry->dataStorageLen, pEntry->dataEof, pEntry->blockCount,
|
||||
pEntry->dataChecksum);
|
||||
WMSG4(" fileType=0x%02x auxType=0x%04x storageType=0x%02x access=0x%04x\n",
|
||||
LOGI(" fileType=0x%02x auxType=0x%04x storageType=0x%02x access=0x%04x",
|
||||
pEntry->fileType, pEntry->auxType, pEntry->storageType, pEntry->access);
|
||||
WMSG2(" created %ls, modified %ls\n",
|
||||
LOGI(" created %ls, modified %ls",
|
||||
(LPCWSTR) createStr, (LPCWSTR) modStr);
|
||||
WMSG2(" fileNameLen=%d headerChecksum=0x%04x\n",
|
||||
LOGI(" fileNameLen=%d headerChecksum=0x%04x",
|
||||
pEntry->fileNameLen, pEntry->headerChecksum);
|
||||
}
|
||||
|
||||
@ -864,13 +864,13 @@ AcuArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
|
||||
ASSERT(fFp != NULL);
|
||||
|
||||
WMSG1("Testing %d entries\n", pSelSet->GetNumEntries());
|
||||
LOGI("Testing %d entries", pSelSet->GetNumEntries());
|
||||
|
||||
SelectionEntry* pSelEntry = pSelSet->IterNext();
|
||||
while (pSelEntry != NULL) {
|
||||
pEntry = (AcuEntry*) pSelEntry->GetEntry();
|
||||
|
||||
WMSG2(" Testing '%hs' (offset=%ld)\n", pEntry->GetDisplayName(),
|
||||
LOGI(" Testing '%hs' (offset=%ld)", pEntry->GetDisplayName(),
|
||||
pEntry->GetOffset());
|
||||
|
||||
SET_PROGRESS_UPDATE2(0, pEntry->GetDisplayName(), NULL);
|
||||
|
@ -23,7 +23,7 @@ ActionProgressDialog::OnInitDialog(void)
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
WMSG1("Action is %d\n", fAction);
|
||||
LOGI("Action is %d", fAction);
|
||||
|
||||
CenterWindow(AfxGetMainWnd());
|
||||
|
||||
|
@ -101,7 +101,7 @@ MainWindow::HandleView(void)
|
||||
// remember which font they used (sticky pref, not in registry)
|
||||
fPreferences.SetPrefString(kPrViewTextTypeFace, vfd.GetTextTypeFace());
|
||||
fPreferences.SetPrefLong(kPrViewTextPointSize, vfd.GetTextPointSize());
|
||||
WMSG2("Preferences: saving view font %d-point '%ls'\n",
|
||||
LOGI("Preferences: saving view font %d-point '%ls'",
|
||||
fPreferences.GetPrefLong(kPrViewTextPointSize),
|
||||
fPreferences.GetPrefString(kPrViewTextTypeFace));
|
||||
}
|
||||
@ -163,7 +163,7 @@ MainWindow::OnUpdateActionsOpenAsDisk(CCmdUI* pCmdUI)
|
||||
void
|
||||
MainWindow::OnActionsAddFiles(void)
|
||||
{
|
||||
WMSG0("Add files!\n");
|
||||
LOGI("Add files!");
|
||||
AddFilesDialog addFiles(this);
|
||||
DiskImgLib::A2File* pTargetSubdir = NULL;
|
||||
|
||||
@ -263,7 +263,7 @@ MainWindow::OnActionsAddFiles(void)
|
||||
if (result)
|
||||
SuccessBeep();
|
||||
} else {
|
||||
WMSG0("SFD bailed with Cancel\n");
|
||||
LOGI("SFD bailed with Cancel");
|
||||
}
|
||||
}
|
||||
void
|
||||
@ -313,7 +313,7 @@ MainWindow::ChooseAddTarget(DiskImgLib::A2File** ppTargetSubdir,
|
||||
*/
|
||||
DiskArchive* pDiskArchive = (DiskArchive*) fpOpenArchive;
|
||||
|
||||
WMSG0("Trying ChooseAddTarget\n");
|
||||
LOGI("Trying ChooseAddTarget");
|
||||
|
||||
ChooseAddTargetDialog targetDialog(this);
|
||||
targetDialog.fpDiskFS = pDiskArchive->GetDiskFS();
|
||||
@ -357,7 +357,7 @@ MainWindow::OnActionsAddDisks(void)
|
||||
CString openFilters, saveFolder;
|
||||
AddFilesDialog addOpts;
|
||||
|
||||
WMSG0("Add disks!\n");
|
||||
LOGI("Add disks!");
|
||||
|
||||
failed.LoadString(IDS_FAILED);
|
||||
|
||||
@ -406,23 +406,23 @@ MainWindow::OnActionsAddDisks(void)
|
||||
imf.fFileSource = dlg.GetPathName();
|
||||
imf.SetQueryDisplayFormat(false);
|
||||
|
||||
WMSG2(" On entry, sectord=%d format=%d\n",
|
||||
LOGI(" On entry, sectord=%d format=%d",
|
||||
imf.fSectorOrder, imf.fFSFormat);
|
||||
if (imf.fFSFormat == DiskImg::kFormatUnknown)
|
||||
imf.fFSFormat = DiskImg::kFormatGenericProDOSOrd;
|
||||
|
||||
if (imf.DoModal() != IDOK) {
|
||||
WMSG0("User bailed on IMF dialog\n");
|
||||
LOGI("User bailed on IMF dialog");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
WMSG2(" On exit, sectord=%d format=%d\n",
|
||||
LOGI(" On exit, sectord=%d format=%d",
|
||||
imf.fSectorOrder, imf.fFSFormat);
|
||||
|
||||
if (imf.fSectorOrder != img.GetSectorOrder() ||
|
||||
imf.fFSFormat != img.GetFSFormat())
|
||||
{
|
||||
WMSG0("Initial values overridden, forcing img format\n");
|
||||
LOGI("Initial values overridden, forcing img format");
|
||||
dierr = img.OverrideFormat(img.GetPhysicalFormat(), imf.fFSFormat,
|
||||
imf.fSectorOrder);
|
||||
if (dierr != kDIErrNone) {
|
||||
@ -535,7 +535,7 @@ MainWindow::OnActionsCreateSubdir(void)
|
||||
return;
|
||||
}
|
||||
|
||||
WMSG1("Creating subdir in '%ls'\n", pEntry->GetPathName());
|
||||
LOGI("Creating subdir in '%ls'", pEntry->GetPathName());
|
||||
|
||||
csDialog.fBasePath = pEntry->GetPathName();
|
||||
csDialog.fpArchive = fpOpenArchive;
|
||||
@ -544,7 +544,7 @@ MainWindow::OnActionsCreateSubdir(void)
|
||||
if (csDialog.DoModal() != IDOK)
|
||||
return;
|
||||
|
||||
WMSG1("Creating '%ls'\n", (LPCWSTR) csDialog.fNewName);
|
||||
LOGI("Creating '%ls'", (LPCWSTR) csDialog.fNewName);
|
||||
|
||||
fpOpenArchive->CreateSubdir(this, pEntry, csDialog.fNewName);
|
||||
fpContentList->Reload();
|
||||
@ -630,7 +630,7 @@ MainWindow::OnActionsExtract(void)
|
||||
fPreferences.SetPrefBool(kPrExtractStripFolderNames, extOpts.fStripFolderNames != 0);
|
||||
fPreferences.SetPrefBool(kPrExtractOverwriteExisting, extOpts.fOverwriteExisting != 0);
|
||||
|
||||
WMSG1("Requested extract path is '%ls'\n", (LPCWSTR) extOpts.fExtractPath);
|
||||
LOGI("Requested extract path is '%ls'", (LPCWSTR) extOpts.fExtractPath);
|
||||
|
||||
/*
|
||||
* Create a "selection set" of things to display.
|
||||
@ -711,7 +711,7 @@ MainWindow::DoBulkExtract(SelectionSet* pSelSet,
|
||||
|
||||
GenericEntry* pEntry = pSelEntry->GetEntry();
|
||||
if (pEntry->GetDamaged()) {
|
||||
WMSG1("Skipping '%ls' due to damage\n", pEntry->GetPathName());
|
||||
LOGI("Skipping '%ls' due to damage", pEntry->GetPathName());
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -839,7 +839,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
else
|
||||
convHA = GenericEntry::kConvertHAOff;
|
||||
|
||||
//WMSG2(" DBE initial text conversion: eol=%d ha=%d\n",
|
||||
//LOGI(" DBE initial text conversion: eol=%d ha=%d",
|
||||
// convEOL, convHA);
|
||||
|
||||
|
||||
@ -869,7 +869,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
{
|
||||
extractAs2MG = true;
|
||||
} else {
|
||||
WMSG2("Not extracting funky image '%ls' as 2MG (len=%ld)\n",
|
||||
LOGI("Not extracting funky image '%ls' as 2MG (len=%ld)",
|
||||
pEntry->GetPathName(), pEntry->GetUncompressedLen());
|
||||
}
|
||||
}
|
||||
@ -1016,7 +1016,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
|
||||
/* update the display in case we renamed it */
|
||||
if (outputPath != fpActionProgress->GetFileName()) {
|
||||
WMSG2(" Renamed our output, from '%ls' to '%ls'\n",
|
||||
LOGI(" Renamed our output, from '%ls' to '%ls'",
|
||||
(LPCTSTR) fpActionProgress->GetFileName(), outputPath);
|
||||
fpActionProgress->SetFileName(outputPath);
|
||||
}
|
||||
@ -1026,7 +1026,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
*/
|
||||
fpActionProgress->SetArcName(pathProp.fStoredPathName);
|
||||
fpActionProgress->SetFileName(outputPath);
|
||||
WMSG2("Extracting from '%ls' to '%ls'\n",
|
||||
LOGI("Extracting from '%ls' to '%ls'",
|
||||
pathProp.fStoredPathName, outputPath);
|
||||
SET_PROGRESS_BEGIN();
|
||||
|
||||
@ -1048,7 +1048,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
|
||||
/* update the display in case they renamed the file */
|
||||
if (outputPath != fpActionProgress->GetFileName()) {
|
||||
WMSG2(" Detected rename, from '%ls' to '%ls'\n",
|
||||
LOGI(" Detected rename, from '%ls' to '%ls'",
|
||||
(LPCWSTR) fpActionProgress->GetFileName(), outputPath);
|
||||
fpActionProgress->SetFileName(outputPath);
|
||||
}
|
||||
@ -1109,7 +1109,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
if (DiskImg::UsesDOSFileStructure(pEntry->GetSourceFS()) &&
|
||||
pEntry->GetFileType() == kFileTypeTXT)
|
||||
{
|
||||
WMSG0("Switching EOLAuto to EOLOn for DOS text file\n");
|
||||
LOGI("Switching EOLAuto to EOLOn for DOS text file");
|
||||
thisConv = GenericEntry::kConvertEOLOn;
|
||||
}
|
||||
} else if (convTextByType) {
|
||||
@ -1117,7 +1117,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
if (pEntry->GetFileType() == kFileTypeTXT ||
|
||||
pEntry->GetFileType() == kFileTypeSRC)
|
||||
{
|
||||
WMSG0("Enabling EOL conv for text file\n");
|
||||
LOGI("Enabling EOL conv for text file");
|
||||
thisConv = GenericEntry::kConvertEOLOn;
|
||||
} else {
|
||||
ASSERT(thisConv == GenericEntry::kConvertEOLOff);
|
||||
@ -1127,7 +1127,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
(thread == GenericEntry::kRsrcThread ||
|
||||
thread == GenericEntry::kDiskImageThread))
|
||||
{
|
||||
WMSG0("Disabling EOL conv for resource fork or disk image\n");
|
||||
LOGI("Disabling EOL conv for resource fork or disk image");
|
||||
thisConv = GenericEntry::kConvertEOLOff;
|
||||
}
|
||||
|
||||
@ -1159,7 +1159,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
pOutput->GetOutputKind() == ReformatOutput::kOutputRTF ||
|
||||
pOutput->GetOutputKind() == ReformatOutput::kOutputCSV)
|
||||
{
|
||||
WMSG0(" Writing text, RTF, CSV, or raw\n");
|
||||
LOGI(" Writing text, RTF, CSV, or raw");
|
||||
ASSERT(pOutput->GetTextBuf() != NULL);
|
||||
int err = 0;
|
||||
if (fwrite(pOutput->GetTextBuf(),
|
||||
@ -1175,7 +1175,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
SET_PROGRESS_UPDATE(100);
|
||||
}
|
||||
} else if (pOutput->GetOutputKind() == ReformatOutput::kOutputBitmap) {
|
||||
WMSG0(" Writing bitmap\n");
|
||||
LOGI(" Writing bitmap");
|
||||
ASSERT(pOutput->GetDIB() != NULL);
|
||||
int err = pOutput->GetDIB()->WriteToFile(fp);
|
||||
if (err != 0) {
|
||||
@ -1196,7 +1196,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
* We could just send it through to the generic non-reformatter
|
||||
* case, but that would require reading the file twice.
|
||||
*/
|
||||
WMSG1(" Writing un-reformatted data (%ld bytes)\n",
|
||||
LOGI(" Writing un-reformatted data (%ld bytes)",
|
||||
pOutput->GetTextLen());
|
||||
ASSERT(pOutput->GetTextBuf() != NULL);
|
||||
bool lastCR = false;
|
||||
@ -1216,7 +1216,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
|
||||
} else {
|
||||
/* something failed, and we don't have the file */
|
||||
WMSG0("How'd we get here?\n");
|
||||
LOGI("How'd we get here?");
|
||||
ASSERT(false);
|
||||
}
|
||||
} else {
|
||||
@ -1230,7 +1230,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
CString msg;
|
||||
int result;
|
||||
ASSERT(fpActionProgress != NULL);
|
||||
WMSG3("Extracting '%ls', requesting thisConv=%d, convHA=%d\n",
|
||||
LOGI("Extracting '%ls', requesting thisConv=%d, convHA=%d",
|
||||
outputPath, thisConv, convHA);
|
||||
result = pEntry->ExtractThreadToFile(thread, fp,
|
||||
thisConv, convHA, &msg);
|
||||
@ -1241,7 +1241,7 @@ MainWindow::ExtractEntry(GenericEntry* pEntry, int thread,
|
||||
fpActionProgress->MessageBox(msg,
|
||||
L"CiderPress", MB_OK | MB_ICONEXCLAMATION);
|
||||
} else {
|
||||
WMSG2(" FAILED on '%ls': %ls\n", outputPath, msg);
|
||||
LOGI(" FAILED on '%ls': %ls", outputPath, msg);
|
||||
errMsg.Format(L"Unable to extract file '%ls': %ls\n",
|
||||
outputPath, msg);
|
||||
fpActionProgress->MessageBox(errMsg, failed,
|
||||
@ -1309,10 +1309,10 @@ did_rename:
|
||||
if (*pOverwriteExisting) {
|
||||
do_overwrite:
|
||||
/* delete existing */
|
||||
WMSG1(" Deleting existing '%ls'\n", (LPCWSTR) *pOutputPath);
|
||||
LOGI(" Deleting existing '%ls'", (LPCWSTR) *pOutputPath);
|
||||
if (::_wunlink(*pOutputPath) != 0) {
|
||||
err = errno;
|
||||
WMSG2(" Failed deleting '%ls', err=%d\n",
|
||||
LOGI(" Failed deleting '%ls', err=%d",
|
||||
(LPCWSTR)*pOutputPath, err);
|
||||
if (err == ENOENT) {
|
||||
/* user might have removed it while dialog was up */
|
||||
@ -1324,7 +1324,7 @@ do_overwrite:
|
||||
}
|
||||
} else if (*pOvwrForAll) {
|
||||
/* never overwrite */
|
||||
WMSG1(" Skipping '%ls'\n", (LPCWSTR) *pOutputPath);
|
||||
LOGI(" Skipping '%ls'", (LPCWSTR) *pOutputPath);
|
||||
goto bail;
|
||||
} else {
|
||||
/* no firm policy, ask the user */
|
||||
@ -1382,7 +1382,7 @@ bail:
|
||||
return IDCANCEL;
|
||||
} else if (err == kUserCancel) {
|
||||
/* user elected to cancel */
|
||||
WMSG0("Cancelling due to user request\n");
|
||||
LOGI("Cancelling due to user request");
|
||||
return IDCANCEL;
|
||||
} else if (err != 0) {
|
||||
msg.Format(L"Unable to create file '%ls': %hs\n",
|
||||
@ -1422,7 +1422,7 @@ MainWindow::OnActionsTest(void)
|
||||
selOpts.fFilesToAction = UseSelectionDialog::kActionAll;
|
||||
|
||||
if (selOpts.DoModal() != IDOK) {
|
||||
WMSG0("Test cancelled\n");
|
||||
LOGI("Test cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1510,7 +1510,7 @@ MainWindow::OnActionsDelete(void)
|
||||
delOpts.fFilesToAction = UseSelectionDialog::kActionAll;
|
||||
|
||||
if (delOpts.DoModal() != IDOK) {
|
||||
WMSG0("Delete cancelled\n");
|
||||
LOGI("Delete cancelled");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -1783,14 +1783,14 @@ MainWindow::OnActionsRenameVolume(void)
|
||||
if (rvDialog.DoModal() != IDOK)
|
||||
return;
|
||||
|
||||
//WMSG1("Creating '%s'\n", rvDialog.fNewName);
|
||||
//LOGI("Creating '%s'", rvDialog.fNewName);
|
||||
|
||||
/* rename the chosen disk to the specified name */
|
||||
bool result;
|
||||
result = fpOpenArchive->RenameVolume(this, rvDialog.fpChosenDiskFS,
|
||||
rvDialog.fNewName);
|
||||
if (!result) {
|
||||
WMSG0("RenameVolume FAILED\n");
|
||||
LOGI("RenameVolume FAILED");
|
||||
/* keep going -- reload just in case something partially happened */
|
||||
}
|
||||
|
||||
@ -1842,7 +1842,7 @@ MainWindow::OnActionsRecompress(void)
|
||||
selOpts.fCompressionType = fPreferences.GetPrefLong(kPrCompressionType);
|
||||
|
||||
if (selOpts.DoModal() != IDOK) {
|
||||
WMSG0("Recompress cancelled\n");
|
||||
LOGI("Recompress cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1965,7 +1965,7 @@ MainWindow::OnActionsConvDisk(void)
|
||||
// fPreferences.GetPrefBool(kPrConvDiskAllocSparse);
|
||||
|
||||
if (selOpts.DoModal() != IDOK) {
|
||||
WMSG0("ConvDisk cancelled\n");
|
||||
LOGI("ConvDisk cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2004,7 +2004,7 @@ MainWindow::OnActionsConvDisk(void)
|
||||
//xferOpts.fUseSparseBlocks =
|
||||
// fPreferences.GetPrefBool(kPrProDOSUseSparse) != 0;
|
||||
|
||||
WMSG1("New volume name will be '%ls'\n", (LPCWSTR) selOpts.fVolName);
|
||||
LOGI("New volume name will be '%ls'", (LPCWSTR) selOpts.fVolName);
|
||||
|
||||
/*
|
||||
* Create a new disk image.
|
||||
@ -2019,7 +2019,7 @@ MainWindow::OnActionsConvDisk(void)
|
||||
dlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrOpenArchiveFolder);
|
||||
|
||||
if (dlg.DoModal() != IDOK) {
|
||||
WMSG0(" User cancelled xfer from image create dialog\n");
|
||||
LOGI(" User cancelled xfer from image create dialog");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2028,7 +2028,7 @@ MainWindow::OnActionsConvDisk(void)
|
||||
fPreferences.SetPrefString(kPrOpenArchiveFolder, saveFolder);
|
||||
|
||||
filename = dlg.GetPathName();
|
||||
WMSG1(" Will xfer to file '%ls'\n", filename);
|
||||
LOGI(" Will xfer to file '%ls'", filename);
|
||||
|
||||
/* remove file if it already exists */
|
||||
CString errMsg;
|
||||
@ -2117,7 +2117,7 @@ MainWindow::OnActionsConvFile(void)
|
||||
fPreferences.GetPrefBool(kPrConvFileEmptyFolders);
|
||||
|
||||
if (selOpts.DoModal() != IDOK) {
|
||||
WMSG0("ConvFile cancelled\n");
|
||||
LOGI("ConvFile cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2172,7 +2172,7 @@ MainWindow::OnActionsConvFile(void)
|
||||
dlg.m_ofn.lpstrInitialDir = fPreferences.GetPrefString(kPrOpenArchiveFolder);
|
||||
|
||||
if (dlg.DoModal() != IDOK) {
|
||||
WMSG0(" User cancelled xfer from archive create dialog\n");
|
||||
LOGI(" User cancelled xfer from archive create dialog");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2181,7 +2181,7 @@ MainWindow::OnActionsConvFile(void)
|
||||
fPreferences.SetPrefString(kPrOpenArchiveFolder, saveFolder);
|
||||
|
||||
filename = dlg.GetPathName();
|
||||
WMSG1(" Will xfer to file '%ls'\n", filename);
|
||||
LOGI(" Will xfer to file '%ls'", filename);
|
||||
|
||||
/* remove file if it already exists */
|
||||
CString errMsg;
|
||||
@ -2240,7 +2240,7 @@ void
|
||||
MainWindow::OnActionsConvToWav(void)
|
||||
{
|
||||
// do this someday
|
||||
WMSG0("Convert TO wav\n");
|
||||
LOGI("Convert TO wav");
|
||||
}
|
||||
void
|
||||
MainWindow::OnUpdateActionsConvToWav(CCmdUI* pCmdUI)
|
||||
@ -2286,7 +2286,7 @@ MainWindow::OnActionsConvFromWav(void)
|
||||
fPreferences.SetPrefString(kPrOpenWAVFolder, saveFolder);
|
||||
|
||||
fileName = fileDlg.GetPathName();
|
||||
WMSG1("Opening WAV file '%ls'\n", fileName);
|
||||
LOGI("Opening WAV file '%ls'", fileName);
|
||||
|
||||
dlg.fFileName = fileName;
|
||||
// pass in fpOpenArchive?
|
||||
@ -2368,7 +2368,7 @@ MainWindow::SaveToArchive(GenericArchive::FileDetails* pDetails,
|
||||
}
|
||||
if (pTargetSubdir != NULL) {
|
||||
storagePrefix = pTargetSubdir->GetPathName();
|
||||
WMSG1("--- using storagePrefix '%ls'\n", storagePrefix);
|
||||
LOGI("--- using storagePrefix '%ls'", storagePrefix);
|
||||
}
|
||||
if (!storagePrefix.IsEmpty()) {
|
||||
CString tmpStr, tmpFileName;
|
||||
@ -2434,7 +2434,7 @@ MainWindow::OnActionsImportBAS(void)
|
||||
fPreferences.SetPrefString(kPrAddFileFolder, saveFolder);
|
||||
|
||||
fileName = fileDlg.GetPathName();
|
||||
WMSG1("Opening TXT file '%ls'\n", fileName);
|
||||
LOGI("Opening TXT file '%ls'", fileName);
|
||||
|
||||
dlg.fFileName = fileName;
|
||||
// pass in fpOpenArchive?
|
||||
@ -2551,7 +2551,7 @@ MainWindow::GetFilePart(const GenericEntry* pEntry, int whichThread,
|
||||
ASSERT(buf == NULL);
|
||||
} else {
|
||||
/* transfer error message to ReformatHolder buffer */
|
||||
WMSG1("Got error message from ExtractThread: '%ls'\n",
|
||||
LOGI("Got error message from ExtractThread: '%ls'",
|
||||
(LPCWSTR) errMsg);
|
||||
pHolder->SetErrorMsg(part, errMsg);
|
||||
ASSERT(buf == NULL);
|
||||
|
@ -233,7 +233,7 @@ DiskArchiveInfoDialog::OnSubVolSelChange(void)
|
||||
{
|
||||
CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_AIDISK_SUBVOLSEL);
|
||||
ASSERT(pCombo != NULL);
|
||||
//WMSG1("+++ SELECTION IS NOW %d\n", pCombo->GetCurSel());
|
||||
//LOGI("+++ SELECTION IS NOW %d", pCombo->GetCurSel());
|
||||
|
||||
const DiskFS* pDiskFS;
|
||||
pDiskFS = (DiskFS*) pCombo->GetItemData(pCombo->GetCurSel());
|
||||
|
@ -90,12 +90,12 @@ BnyEntry::ExtractThreadToBuffer(int which, char** ppText, long* pLength,
|
||||
char* unsqBuf = NULL;
|
||||
long unsqLen = 0;
|
||||
expBuf.SeizeBuffer(&unsqBuf, &unsqLen);
|
||||
WMSG2("Unsqueezed %ld bytes to %d\n", len, unsqLen);
|
||||
LOGI("Unsqueezed %ld bytes to %d", len, unsqLen);
|
||||
if (unsqLen == 0) {
|
||||
// some bonehead squeezed a zero-length file
|
||||
delete[] unsqBuf;
|
||||
ASSERT(*ppText == NULL);
|
||||
WMSG0("Handling zero-length squeezed file!\n");
|
||||
LOGI("Handling zero-length squeezed file!");
|
||||
if (needAlloc) {
|
||||
*ppText = new char[1];
|
||||
**ppText = '\0';
|
||||
@ -185,7 +185,7 @@ BnyEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
|
||||
len = (long) GetUncompressedLen();
|
||||
if (len == 0) {
|
||||
WMSG0("Empty fork\n");
|
||||
LOGI("Empty fork");
|
||||
result = IDOK;
|
||||
goto bail;
|
||||
}
|
||||
@ -222,12 +222,12 @@ BnyEntry::ExtractThreadToFile(int which, FILE* outfp, ConvertEOL conv,
|
||||
}
|
||||
|
||||
expBuf.SeizeBuffer(&buf, &uncLen);
|
||||
WMSG2("Unsqueezed %ld bytes to %d\n", len, uncLen);
|
||||
LOGI("Unsqueezed %ld bytes to %d", len, uncLen);
|
||||
|
||||
// some bonehead squeezed a zero-length file
|
||||
if (uncLen == 0) {
|
||||
ASSERT(buf == NULL);
|
||||
WMSG0("Handling zero-length squeezed file!\n");
|
||||
LOGI("Handling zero-length squeezed file!");
|
||||
result = IDOK;
|
||||
goto bail;
|
||||
}
|
||||
@ -489,7 +489,7 @@ BnyArchive::LoadContents(void)
|
||||
rewind(fFp);
|
||||
|
||||
nerr = BNYIterate();
|
||||
WMSG1("BNYIterate returned %d\n", nerr);
|
||||
LOGI("BNYIterate returned %d", nerr);
|
||||
return (nerr != kNuErrNone);
|
||||
}
|
||||
|
||||
@ -700,7 +700,7 @@ BnyArchive::BNYDecodeHeader(BnyFileEntry* pEntry)
|
||||
|
||||
if (raw[0] != 0x0a || raw[1] != 0x47 || raw[2] != 0x4c || raw[18] != 0x02) {
|
||||
err = kNuErrBadData;
|
||||
WMSG0("this doesn't look like a Binary II header\n");
|
||||
LOGI("this doesn't look like a Binary II header");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@ -721,7 +721,7 @@ BnyArchive::BNYDecodeHeader(BnyFileEntry* pEntry)
|
||||
len = raw[23];
|
||||
if (len > kBNYMaxFileName) {
|
||||
err = kNuErrBadData;
|
||||
WMSG1("invalid filename length %d\n", len);
|
||||
LOGI("invalid filename length %d", len);
|
||||
goto bail;
|
||||
}
|
||||
memcpy(pEntry->fileName, &raw[24], len);
|
||||
@ -732,7 +732,7 @@ BnyArchive::BNYDecodeHeader(BnyFileEntry* pEntry)
|
||||
len = raw[39];
|
||||
if (len > kBNYMaxNativeName) {
|
||||
err = kNuErrBadData;
|
||||
WMSG1("invalid filename length %d\n", len);
|
||||
LOGI("invalid filename length %d", len);
|
||||
goto bail;
|
||||
}
|
||||
memcpy(pEntry->nativeName, &raw[40], len);
|
||||
@ -830,7 +830,7 @@ BnyArchive::BNYCopyBlocks(BnyFileEntry* pEntry, FILE* outfp)
|
||||
if (outfp != NULL) {
|
||||
if (fwrite(pEntry->blockBuf, toWrite, 1, outfp) != 1) {
|
||||
err = errno ? (NuError) errno : kNuErrFileWrite;
|
||||
WMSG0("BNY write failed\n");
|
||||
LOGI("BNY write failed");
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
@ -840,7 +840,7 @@ BnyArchive::BNYCopyBlocks(BnyFileEntry* pEntry, FILE* outfp)
|
||||
if (bytesLeft) {
|
||||
err = BNYRead(pEntry->blockBuf, kBNYBlockSize);
|
||||
if (err != kNuErrNone) {
|
||||
WMSG0("BNY read failed\n");
|
||||
LOGI("BNY read failed");
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
@ -868,14 +868,14 @@ BnyArchive::BNYIterate(void)
|
||||
while (toFollow) {
|
||||
err = BNYRead(entry.blockBuf, sizeof(entry.blockBuf));
|
||||
if (err != kNuErrNone) {
|
||||
WMSG0("failed while reading header\n");
|
||||
LOGI("failed while reading header");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
err = BNYDecodeHeader(&entry);
|
||||
if (err != kNuErrNone) {
|
||||
if (first) {
|
||||
WMSG0("not a Binary II archive?\n");
|
||||
LOGI("not a Binary II archive?");
|
||||
}
|
||||
goto bail;
|
||||
}
|
||||
@ -888,7 +888,7 @@ BnyArchive::BNYIterate(void)
|
||||
if (entry.realEOF != 0) {
|
||||
err = BNYRead(entry.blockBuf, sizeof(entry.blockBuf));
|
||||
if (err != kNuErrNone) {
|
||||
WMSG0("failed while reading\n");
|
||||
LOGI("failed while reading");
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
@ -913,7 +913,7 @@ BnyArchive::BNYIterate(void)
|
||||
if (nblocks > 1) {
|
||||
err = BNYSeek((nblocks-1) * kBNYBlockSize);
|
||||
if (err != kNuErrNone) {
|
||||
WMSG0("failed while seeking forward\n");
|
||||
LOGI("failed while seeking forward");
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
@ -921,7 +921,7 @@ BnyArchive::BNYIterate(void)
|
||||
|
||||
if (!first) {
|
||||
if (entry.filesToFollow != toFollow -1) {
|
||||
WMSG2("WARNING: filesToFollow %d, expected %d\n",
|
||||
LOGI("WARNING: filesToFollow %d, expected %d",
|
||||
entry.filesToFollow, toFollow -1);
|
||||
}
|
||||
}
|
||||
@ -932,7 +932,7 @@ BnyArchive::BNYIterate(void)
|
||||
|
||||
bail:
|
||||
if (err != kNuErrNone) {
|
||||
WMSG1("--- Iterator returning failure %d\n", err);
|
||||
LOGI("--- Iterator returning failure %d", err);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@ -957,13 +957,13 @@ BnyArchive::TestSelection(CWnd* pMsgWnd, SelectionSet* pSelSet)
|
||||
|
||||
ASSERT(fFp != NULL);
|
||||
|
||||
WMSG1("Testing %d entries\n", pSelSet->GetNumEntries());
|
||||
LOGI("Testing %d entries", pSelSet->GetNumEntries());
|
||||
|
||||
SelectionEntry* pSelEntry = pSelSet->IterNext();
|
||||
while (pSelEntry != NULL) {
|
||||
pEntry = (BnyEntry*) pSelEntry->GetEntry();
|
||||
|
||||
WMSG2(" Testing '%ls' (offset=%ld)\n", pEntry->GetDisplayName(),
|
||||
LOGI(" Testing '%ls' (offset=%ld)", pEntry->GetDisplayName(),
|
||||
pEntry->GetOffset());
|
||||
|
||||
SET_PROGRESS_UPDATE2(0, pEntry->GetDisplayName(), NULL);
|
||||
|
@ -98,7 +98,7 @@ ImportBASDialog::OnInitDialog(void)
|
||||
CString fileNameOnly(path.GetFileName());
|
||||
CString ext(fileNameOnly.Right(4));
|
||||
if (ext.CompareNoCase(L".txt") == 0) {
|
||||
WMSG1("removing extension from '%ls'\n", (LPCWSTR) fileNameOnly);
|
||||
LOGI("removing extension from '%ls'", (LPCWSTR) fileNameOnly);
|
||||
fileNameOnly = fileNameOnly.Left(fileNameOnly.GetLength() - 4);
|
||||
}
|
||||
|
||||
@ -356,16 +356,16 @@ ImportBASDialog::ProcessBASLine(const char* buf, int len,
|
||||
* Remove the CR, LF, or CRLF from the end of the line.
|
||||
*/
|
||||
if (len > 1 && buf[len-2] == '\r' && buf[len-1] == '\n') {
|
||||
//WMSG0("removed CRLF\n");
|
||||
//LOGI("removed CRLF");
|
||||
len -= 2;
|
||||
} else if (buf[len-1] == '\r') {
|
||||
//WMSG0("removed CR\n");
|
||||
//LOGI("removed CR");
|
||||
len--;
|
||||
} else if (buf[len-1] == '\n') {
|
||||
//WMSG0("removed LF\n");
|
||||
//LOGI("removed LF");
|
||||
len--;
|
||||
} else {
|
||||
//WMSG0("no EOL marker found\n");
|
||||
//LOGI("no EOL marker found");
|
||||
}
|
||||
|
||||
if (!len)
|
||||
@ -402,7 +402,7 @@ ImportBASDialog::ProcessBASLine(const char* buf, int len,
|
||||
}
|
||||
tokenBuf[tokenLen] = '\0';
|
||||
lineNum = atoi(tokenBuf);
|
||||
WMSG1("FOUND line %d\n", lineNum);
|
||||
LOGI("FOUND line %d", lineNum);
|
||||
|
||||
pOutput->Putc((char) 0xcc); // placeholder
|
||||
pOutput->Putc((char) 0xcc);
|
||||
@ -483,7 +483,7 @@ ImportBASDialog::ProcessBASLine(const char* buf, int len,
|
||||
for (int j = 0; j < foundLen; j++)
|
||||
GetNextNWC(&buf, &len, &ch);
|
||||
|
||||
//WMSG2("TOKEN '%s' (%d)\n",
|
||||
//LOGI("TOKEN '%s' (%d)",
|
||||
// fBASLookup.GetToken(token), tokenLen);
|
||||
|
||||
/* special handling for REM or DATA */
|
||||
@ -553,7 +553,7 @@ ImportBASDialog::FixBASLinePointers(char* buf, long len, unsigned short addr)
|
||||
if (val == 0)
|
||||
break;
|
||||
if (val != 0xcccc) {
|
||||
WMSG1("unexpected value 0x%04x found\n", val);
|
||||
LOGI("unexpected value 0x%04x found", val);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -568,7 +568,7 @@ ImportBASDialog::FixBASLinePointers(char* buf, long len, unsigned short addr)
|
||||
len--;
|
||||
}
|
||||
if (!len) {
|
||||
WMSG0("ran off the end?\n");
|
||||
LOGI("ran off the end?");
|
||||
return false;
|
||||
}
|
||||
buf++;
|
||||
|
@ -139,12 +139,12 @@ CassImpTargetDialog::GetStartAddr(void) const
|
||||
long val;
|
||||
|
||||
if (str[0] == '\0') {
|
||||
WMSG0(" HEY: blank addr, returning -1\n");
|
||||
LOGI(" HEY: blank addr, returning -1");
|
||||
return -1;
|
||||
}
|
||||
val = wcstoul(aux, &end, 16);
|
||||
if (end != str + wcslen(str)) {
|
||||
WMSG1(" HEY: found some garbage in addr '%ls', returning -1\n",
|
||||
LOGI(" HEY: found some garbage in addr '%ls', returning -1",
|
||||
(LPCWSTR) aux);
|
||||
return -1;
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ CassetteDialog::OnInitDialog(void)
|
||||
{
|
||||
pCombo->SetCurSel(defaultAlg);
|
||||
} else {
|
||||
WMSG1("GLITCH: invalid defaultAlg in prefs (%d)\n", defaultAlg);
|
||||
LOGI("GLITCH: invalid defaultAlg in prefs (%d)", defaultAlg);
|
||||
pCombo->SetCurSel(CassetteData::kAlgorithmZero);
|
||||
}
|
||||
fAlgorithm = (CassetteData::Algorithm) defaultAlg;
|
||||
@ -366,7 +366,7 @@ CassetteDialog::OnDialogReady(UINT, LONG)
|
||||
void
|
||||
CassetteDialog::OnListChange(NMHDR*, LRESULT* pResult)
|
||||
{
|
||||
WMSG0("List change\n");
|
||||
LOGI("List change");
|
||||
CListCtrl* pListView = (CListCtrl*) GetDlgItem(IDC_CASSETTE_LIST);
|
||||
CButton* pButton = (CButton*) GetDlgItem(IDC_IMPORT_CHUNK);
|
||||
pButton->EnableWindow(pListView->GetSelectedCount() != 0);
|
||||
@ -381,7 +381,7 @@ CassetteDialog::OnListChange(NMHDR*, LRESULT* pResult)
|
||||
void
|
||||
CassetteDialog::OnListDblClick(NMHDR* pNotifyStruct, LRESULT* pResult)
|
||||
{
|
||||
WMSG0("Double click!\n");
|
||||
LOGI("Double click!");
|
||||
CListCtrl* pListView = (CListCtrl*) GetDlgItem(IDC_CASSETTE_LIST);
|
||||
|
||||
if (pListView->GetSelectedCount() == 1)
|
||||
@ -398,7 +398,7 @@ CassetteDialog::OnAlgorithmChange(void)
|
||||
{
|
||||
CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_CASSETTE_ALG);
|
||||
ASSERT(pCombo != NULL);
|
||||
WMSG1("+++ SELECTION IS NOW %d\n", pCombo->GetCurSel());
|
||||
LOGI("+++ SELECTION IS NOW %d", pCombo->GetCurSel());
|
||||
fAlgorithm = (CassetteData::Algorithm) pCombo->GetCurSel();
|
||||
AnalyzeWAV();
|
||||
}
|
||||
@ -539,7 +539,7 @@ CassetteDialog::AnalyzeWAV(void)
|
||||
}
|
||||
|
||||
if (idx == 0) {
|
||||
WMSG0("No Apple II files found\n");
|
||||
LOGI("No Apple II files found");
|
||||
/* that's okay, just show the empty list */
|
||||
}
|
||||
|
||||
@ -634,7 +634,7 @@ CassetteDialog::CassetteData::Scan(SoundFile* pSoundFile, Algorithm alg,
|
||||
byteOffset = *pStartOffset;
|
||||
initialLen = dataLen = pSoundFile->GetDataLen() - byteOffset;
|
||||
sampleStartIndex = byteOffset/bytesPerSample;
|
||||
WMSG4("CassetteData::Scan(off=%ld / %ld) len=%ld alg=%d\n",
|
||||
LOGI("CassetteData::Scan(off=%ld / %ld) len=%ld alg=%d",
|
||||
byteOffset, sampleStartIndex, dataLen, alg);
|
||||
|
||||
pFormat = pSoundFile->GetWaveFormat();
|
||||
@ -644,7 +644,7 @@ CassetteDialog::CassetteData::Scan(SoundFile* pSoundFile, Algorithm alg,
|
||||
if (fOutputBuf == NULL) // alloc on first use
|
||||
fOutputBuf = new unsigned char[kMaxFileLen];
|
||||
if (buf == NULL || sampleBuf == NULL || fOutputBuf == NULL) {
|
||||
WMSG0("Buffer alloc failed\n");
|
||||
LOGI("Buffer alloc failed");
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@ -671,7 +671,7 @@ CassetteDialog::CassetteData::Scan(SoundFile* pSoundFile, Algorithm alg,
|
||||
|
||||
cc = pSoundFile->ReadData(buf, byteOffset, chunkLen);
|
||||
if (cc < 0) {
|
||||
WMSG1("ReadData(%d) failed\n", chunkLen);
|
||||
LOGI("ReadData(%d) failed", chunkLen);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
@ -683,7 +683,7 @@ CassetteDialog::CassetteData::Scan(SoundFile* pSoundFile, Algorithm alg,
|
||||
&scanState, &bitVal))
|
||||
{
|
||||
if (outByteIndex >= kMaxFileLen) {
|
||||
WMSG0("Cassette data overflow\n");
|
||||
LOGI("Cassette data overflow");
|
||||
scanState.phase = kPhaseEndReached;
|
||||
} else {
|
||||
/* output a bit, shifting until bit 8 lights up */
|
||||
@ -713,28 +713,28 @@ CassetteDialog::CassetteData::Scan(SoundFile* pSoundFile, Algorithm alg,
|
||||
case kPhaseScanFor770Start:
|
||||
case kPhaseScanning770:
|
||||
// expected case for trailing part of file
|
||||
WMSG0("Scan ended while searching for 770\n");
|
||||
LOGI("Scan ended while searching for 770");
|
||||
goto bail;
|
||||
case kPhaseScanForShort0:
|
||||
case kPhaseShort0B:
|
||||
WMSG0("Scan ended while searching for short 0/0B\n");
|
||||
LOGI("Scan ended while searching for short 0/0B");
|
||||
//DebugBreak(); // unusual
|
||||
goto bail;
|
||||
case kPhaseReadData:
|
||||
WMSG0("Scan ended while reading data\n");
|
||||
LOGI("Scan ended while reading data");
|
||||
//DebugBreak(); // truncated WAV file?
|
||||
goto bail;
|
||||
case kPhaseEndReached:
|
||||
WMSG0("Scan found end\n");
|
||||
LOGI("Scan found end");
|
||||
// winner!
|
||||
break;
|
||||
default:
|
||||
WMSG1("Unknown phase %d\n", scanState.phase);
|
||||
LOGI("Unknown phase %d", scanState.phase);
|
||||
assert(false);
|
||||
goto bail;
|
||||
}
|
||||
|
||||
WMSG3("*** Output %d bytes (bitAcc=0x%02x, checkSum=0x%02x)\n",
|
||||
LOGI("*** Output %d bytes (bitAcc=0x%02x, checkSum=0x%02x)",
|
||||
outByteIndex, bitAcc, checkSum);
|
||||
|
||||
if (outByteIndex == 0) {
|
||||
@ -778,7 +778,7 @@ CassetteDialog::CassetteData::ConvertSamplesToReal(const WAVEFORMATEX* pFormat,
|
||||
if (bitsPerSample == 8) {
|
||||
while (chunkLen > 0) {
|
||||
*sampleBuf++ = (*buf - 128) / 128.0f;
|
||||
//WMSG3("Sample8(%5d)=%d float=%.3f\n", offset, *buf, *(sampleBuf-1));
|
||||
//LOGI("Sample8(%5d)=%d float=%.3f", offset, *buf, *(sampleBuf-1));
|
||||
//offset++;
|
||||
buf += bps;
|
||||
chunkLen -= bps;
|
||||
@ -787,7 +787,7 @@ CassetteDialog::CassetteData::ConvertSamplesToReal(const WAVEFORMATEX* pFormat,
|
||||
while (chunkLen > 0) {
|
||||
short sample = *buf | *(buf+1) << 8;
|
||||
*sampleBuf++ = sample / 32768.0f;
|
||||
//WMSG3("Sample16(%5d)=%d float=%.3f\n", offset, sample, *(sampleBuf-1));
|
||||
//LOGI("Sample16(%5d)=%d float=%.3f", offset, sample, *(sampleBuf-1));
|
||||
//offset++;
|
||||
buf += bps;
|
||||
chunkLen -= bps;
|
||||
@ -796,7 +796,7 @@ CassetteDialog::CassetteData::ConvertSamplesToReal(const WAVEFORMATEX* pFormat,
|
||||
assert(false);
|
||||
}
|
||||
|
||||
//WMSG1("Conv %d\n", bitsPerSample);
|
||||
//LOGI("Conv %d", bitsPerSample);
|
||||
}
|
||||
|
||||
/* width of 1/2 cycle in 770Hz lead-in */
|
||||
@ -904,7 +904,7 @@ CassetteDialog::CassetteData::ProcessSampleZero(float sample, long sampleIndex,
|
||||
timeDelta = (sampleIndex+bias) - pScanState->lastZeroIndex;
|
||||
|
||||
halfCycleUsec = timeDelta * pScanState->usecPerSample;
|
||||
//WMSG3("Zero %6ld: half=%.1fusec full=%.1fusec\n",
|
||||
//LOGI("Zero %6ld: half=%.1fusec full=%.1fusec",
|
||||
// sampleIndex, halfCycleUsec,
|
||||
// halfCycleUsec + pScanState->halfCycleWidth);
|
||||
|
||||
@ -1033,13 +1033,13 @@ CassetteDialog::CassetteData::ProcessSamplePeak(float sample, long sampleIndex,
|
||||
|
||||
halfCycleUsec = timeDelta * pScanState->usecPerSample;
|
||||
//if (sampleIndex > 584327 && sampleIndex < 590000) {
|
||||
// WMSG4("Peak %6ld: amp=%.3f height=%.3f peakWidth=%.1fusec\n",
|
||||
// LOGI("Peak %6ld: amp=%.3f height=%.3f peakWidth=%.1fusec",
|
||||
// sampleIndex-1, pScanState->prevSample, ampDelta,
|
||||
// halfCycleUsec);
|
||||
// ::Sleep(10);
|
||||
//}
|
||||
if (sampleIndex == 32739)
|
||||
WMSG0("whee\n");
|
||||
LOGI("whee");
|
||||
|
||||
emitBit = UpdatePhase(pScanState, sampleIndex-1, halfCycleUsec, pBitVal);
|
||||
|
||||
@ -1084,7 +1084,7 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
fullCycleUsec > kLeadInHalfWidth*2.0f - kLeadInMaxError*2.0f &&
|
||||
fullCycleUsec < kLeadInHalfWidth*2.0f + kLeadInMaxError*2.0f)
|
||||
{
|
||||
//WMSG1(" scanning 770 at %ld\n", sampleIndex);
|
||||
//LOGI(" scanning 770 at %ld", sampleIndex);
|
||||
pScanState->phase = kPhaseScanning770;
|
||||
pScanState->num770 = 1;
|
||||
}
|
||||
@ -1099,12 +1099,12 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
if (pScanState->num770 > kLeadInHalfCycThreshold/2) {
|
||||
/* looks like a solid tone, advance to next phase */
|
||||
pScanState->phase = kPhaseScanForShort0;
|
||||
WMSG0(" looking for short 0\n");
|
||||
LOGI(" looking for short 0");
|
||||
}
|
||||
} else if (fullCycleUsec != 0.0f) {
|
||||
/* pattern lost, reset */
|
||||
if (pScanState->num770 > 5) {
|
||||
WMSG3(" lost 770 at %ld width=%.1f (count=%ld)\n",
|
||||
LOGI(" lost 770 at %ld width=%.1f (count=%ld)",
|
||||
sampleIndex, fullCycleUsec, pScanState->num770);
|
||||
}
|
||||
pScanState->phase = kPhaseScanFor770Start;
|
||||
@ -1116,7 +1116,7 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
if (halfCycleUsec > kShortZeroHalfWidth - kShortZeroMaxError &&
|
||||
halfCycleUsec < kShortZeroHalfWidth + kShortZeroMaxError)
|
||||
{
|
||||
WMSG3(" found short zero (half=%.1f) at %ld after %ld 770s\n",
|
||||
LOGI(" found short zero (half=%.1f) at %ld after %ld 770s",
|
||||
halfCycleUsec, sampleIndex, pScanState->num770);
|
||||
pScanState->phase = kPhaseShort0B;
|
||||
/* make sure we treat current sample as first half */
|
||||
@ -1130,7 +1130,7 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
pScanState->num770++;
|
||||
} else if (fullCycleUsec != 0.0f) {
|
||||
/* full cycle of the wrong size, we've lost it */
|
||||
WMSG3(" Lost 770 at %ld width=%.1f (count=%ld)\n",
|
||||
LOGI(" Lost 770 at %ld width=%.1f (count=%ld)",
|
||||
sampleIndex, fullCycleUsec, pScanState->num770);
|
||||
pScanState->phase = kPhaseScanFor770Start;
|
||||
}
|
||||
@ -1142,13 +1142,13 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
fullCycleUsec < (kShortZeroHalfWidth + kZeroHalfWidth) + kZeroMaxError*2.0f)
|
||||
{
|
||||
/* as expected */
|
||||
WMSG2(" Found 0B %.1f (total %.1f), advancing to 'read data' phase\n",
|
||||
LOGI(" Found 0B %.1f (total %.1f), advancing to 'read data' phase",
|
||||
halfCycleUsec, fullCycleUsec);
|
||||
pScanState->dataStart = sampleIndex;
|
||||
pScanState->phase = kPhaseReadData;
|
||||
} else {
|
||||
/* must be a false-positive at end of tone */
|
||||
WMSG2(" Didn't find post-short-0 value (half=%.1f + %.1f)\n",
|
||||
LOGI(" Didn't find post-short-0 value (half=%.1f + %.1f)",
|
||||
pScanState->halfCycleWidth, halfCycleUsec);
|
||||
pScanState->phase = kPhaseScanFor770Start;
|
||||
}
|
||||
@ -1170,7 +1170,7 @@ CassetteDialog::CassetteData::UpdatePhase(ScanState* pScanState, long sampleInde
|
||||
emitBit = true;
|
||||
} else {
|
||||
/* bad cycle, assume end reached */
|
||||
WMSG2(" Bad full cycle time %.1f in data at %ld, bailing\n",
|
||||
LOGI(" Bad full cycle time %.1f in data at %ld, bailing",
|
||||
fullCycleUsec, sampleIndex);
|
||||
pScanState->dataEnd = sampleIndex;
|
||||
pScanState->phase = kPhaseEndReached;
|
||||
|
@ -34,14 +34,14 @@ ChooseAddTargetDialog::OnInitDialog(void)
|
||||
fDiskFSTree.fIncludeSubdirs = true;
|
||||
fDiskFSTree.fExpandDepth = -1;
|
||||
if (!fDiskFSTree.BuildTree(fpDiskFS, pTree)) {
|
||||
WMSG0("Tree load failed!\n");
|
||||
LOGI("Tree load failed!");
|
||||
OnCancel();
|
||||
}
|
||||
|
||||
int count = pTree->GetCount();
|
||||
WMSG1("ChooseAddTargetDialog tree has %d items\n", count);
|
||||
LOGI("ChooseAddTargetDialog tree has %d items", count);
|
||||
if (count <= 1) {
|
||||
WMSG0(" Skipping out of target selection\n");
|
||||
LOGI(" Skipping out of target selection");
|
||||
// adding to root volume of the sole DiskFS
|
||||
fpChosenDiskFS = fpDiskFS;
|
||||
ASSERT(fpChosenSubdir == NULL);
|
||||
|
@ -36,7 +36,7 @@ ChooseDirDialog::OnInitDialog(void)
|
||||
|
||||
/* replace the tree control with a ShellTree */
|
||||
if (fShellTree.ReplaceDlgCtrl(this, IDC_CHOOSEDIR_TREE) != TRUE) {
|
||||
WMSG0("WARNING: ShellTree replacement failed\n");
|
||||
LOGI("WARNING: ShellTree replacement failed");
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ ChooseDirDialog::OnInitDialog(void)
|
||||
fShellTree.TunnelTree(fPathName, &msg);
|
||||
if (!msg.IsEmpty()) {
|
||||
/* failed */
|
||||
WMSG2("TunnelTree failed on '%ls' (%ls), using MyComputer instead\n",
|
||||
LOGI("TunnelTree failed on '%ls' (%ls), using MyComputer instead",
|
||||
(LPCWSTR) fPathName, (LPCWSTR) msg);
|
||||
fShellTree.ExpandMyComputer();
|
||||
}
|
||||
@ -72,7 +72,7 @@ ChooseDirDialog::PreTranslateMessage(MSG* pMsg)
|
||||
if (pMsg->message == WM_KEYDOWN &&
|
||||
pMsg->wParam == VK_RETURN)
|
||||
{
|
||||
//WMSG0("RETURN!\n");
|
||||
//LOGI("RETURN!");
|
||||
if (GetFocus() == GetDlgItem(IDC_CHOOSEDIR_PATHEDIT)) {
|
||||
OnExpandTree();
|
||||
return TRUE;
|
||||
@ -182,18 +182,18 @@ ChooseDirDialog::OnNewFolder(void)
|
||||
*/
|
||||
if (fShellTree.AddFolderAtSelection(newFolderDlg.fNewFolder)) {
|
||||
CString msg;
|
||||
WMSG1("Success, tunneling to '%ls'\n",
|
||||
LOGI("Success, tunneling to '%ls'",
|
||||
(LPCWSTR) newFolderDlg.fNewFullPath);
|
||||
fShellTree.TunnelTree(newFolderDlg.fNewFullPath, &msg);
|
||||
if (!msg.IsEmpty()) {
|
||||
WMSG1("TunnelTree failed: %ls\n", (LPCWSTR) msg);
|
||||
LOGI("TunnelTree failed: %ls", (LPCWSTR) msg);
|
||||
}
|
||||
} else {
|
||||
WMSG0("AddFolderAtSelection FAILED\n");
|
||||
LOGI("AddFolderAtSelection FAILED");
|
||||
ASSERT(false);
|
||||
}
|
||||
} else {
|
||||
WMSG0("NewFolderDialog returned IDOK but no create\n");
|
||||
LOGI("NewFolderDialog returned IDOK but no create");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ MainWindow::OnEditCopy(void)
|
||||
ShowFailureMsg(this, errStr, IDS_FAILED);
|
||||
goto bail;
|
||||
}
|
||||
WMSG1("myFormat = %u\n", myFormat);
|
||||
LOGI("myFormat = %u", myFormat);
|
||||
|
||||
/* open & empty the clipboard, even if we fail later */
|
||||
if (OpenClipboard() == false) {
|
||||
@ -154,12 +154,12 @@ MainWindow::OnEditCopy(void)
|
||||
size_t neededLen = (fileList.GetLength() + 1) * sizeof(WCHAR);
|
||||
hGlobal = ::GlobalAlloc(GHND | GMEM_SHARE, neededLen);
|
||||
if (hGlobal == NULL) {
|
||||
WMSG1("Failed allocating %d bytes\n", neededLen);
|
||||
LOGI("Failed allocating %d bytes", neededLen);
|
||||
errStr.LoadString(IDS_CLIPBOARD_ALLOCFAILED);
|
||||