Changeset 1402 for trunk/dll/defview.c


Ignore:
Timestamp:
Mar 14, 2009, 6:17:59 PM (16 years ago)
Author:
Gregg Young
Message:

Remove variable aurgs from docopy & unlinkf (not used); Move more strings to PCSZs and string table; Move PCSZs to compile time initialization; Fix hang on startup caused by a drive scan and a dircnr scan trying to update a drive in the tree at the same time (related to the "treeswitch options); Code cleanup mainly removal of old printfs, SayMsgs, DbgMsg and unneeded %s.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/defview.c

    r1398 r1402  
    2121                less than 10 KiB (It hangs and can't be closed)
    2222  05 Jan 09 GKY Use TestBinary so that text veiwer isn't used for hex files by default
     23  08 Mar 09 GKY Additional strings move to PCSZs
    2324
    2425***********************************************************************/
     
    6162
    6263#pragma data_seg(GLOBAL2)
    63 CHAR *Default;
     64PCSZ Default  = "DEFAULT";
    6465
    6566BOOL ShowMultimedia(CHAR * filename)
     
    124125
    125126  /* attempt to identify the file using MMPM/2 */
    126   //printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout);
    127127  memset( &mmioinfo, '\0', sizeof(MMIOINFO) );
    128128  /*Eliminate non multimedia files*/
    129129  hmmio = pMMIOOpen(filename,
    130130                    &mmioinfo,
    131                     MMIO_READ);
    132 #if 0
    133   printf("%s %d %d %d %d %d\n",
    134           __FILE__, __LINE__,mmioinfo.ulFlags, mmioinfo.ulErrorRet,
    135          mmioinfo.pIOProc, mmioinfo.aulInfo); fflush(stdout);
    136 #endif
    137          if (!hmmio) {
    138              p = strrchr(filename, '.'); //Added to save mp3, ogg & flac which fail above test
    139           if (!p)
    140               p = ".";
    141              /* printf("%s %d %s\n",
    142               __FILE__, __LINE__, p); fflush(stdout);*/
    143           if (!stricmp(p, PCSZ_DOTOGG) || !stricmp(p, PCSZ_DOTMP3) || !stricmp(p, PCSZ_DOTFLAC) ||
    144                !stricmp(p, PCSZ_DOTJPG) || !stricmp(p, PCSZ_DOTJPEG)){
    145              hmmio = pMMIOOpen(filename,
    146                     &mmioinfo,
    147                     MMIO_READ | MMIO_NOIDENTIFY);
    148              if (!hmmio){
    149                  DosFreeModule(MMIOModHandle);
    150                  //printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout);
    151                  return played;
    152              }
    153           }
    154           else {
    155              DosFreeModule(MMIOModHandle);
    156                 // printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout);
    157                  return played;
    158           }
    159          }
    160          if (!hmmio) {
    161                  DosFreeModule(MMIOModHandle);
    162                 // printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout);
    163                  return played;
    164              }
    165 
     131                    MMIO_READ);
     132  if (!hmmio) {
     133    p = strrchr(filename, '.'); //Added to save mp3, ogg & flac which fail above test
     134    if (!p)
     135      p = ".";
     136    if (!stricmp(p, PCSZ_DOTOGG) || !stricmp(p, PCSZ_DOTMP3) || !stricmp(p, PCSZ_DOTFLAC) ||
     137         !stricmp(p, PCSZ_DOTJPG) || !stricmp(p, PCSZ_DOTJPEG)) {
     138       hmmio = pMMIOOpen(filename,
     139              &mmioinfo,
     140              MMIO_READ | MMIO_NOIDENTIFY);
     141       if (!hmmio){
     142           DosFreeModule(MMIOModHandle);
     143           return played;
     144       }
     145    }
     146    else {
     147       DosFreeModule(MMIOModHandle);
     148           return played;
     149    }
     150  }
     151  if (!hmmio) {
     152          DosFreeModule(MMIOModHandle);
     153          return played;
     154  }
    166155  rc1 = pMMIOGetInfo(hmmio, &mmioinfo, 0L);
    167   // printf("%s %d\n ", __FILE__, __LINE__); fflush(stdout);
    168156  memset(&mmFormatInfo, 0, sizeof(MMFORMATINFO));
    169157  mmFormatInfo.ulStructLen = sizeof(MMFORMATINFO);
     
    173161                         &fccStorageSystem, 0L,
    174162                         MMIO_FORCE_IDENTIFY_FF);
    175 #if 0
    176    printf("%s %d %d %d %d\n %d %d %d %s\n",
    177           __FILE__, __LINE__,mmioinfo.ulFlags,
    178           mmioinfo.pIOProc, mmioinfo.aulInfo,
    179           mmFormatInfo.fccIOProc, mmFormatInfo.fccIOProc,
    180           mmFormatInfo.ulIOProcType, mmFormatInfo.szDefaultFormatExt); fflush(stdout);
    181 #endif
    182163  /* free module handle */
    183164  rc1 = pMMIOClose(hmmio, 0L);
     
    191172          if (!p)
    192173              p = ".";
    193              /* printf("%s %d %s\n",
    194               __FILE__, __LINE__, p); fflush(stdout);*/
    195174          if (!stricmp(p, PCSZ_DOTJPG) || !stricmp(p, PCSZ_DOTJPEG))
    196175            OpenObject(filename, Default, hwnd);  //Image fails to display these
     
    204183          if (!p)
    205184              p = ".";
    206              /* printf("%s %d %s\n",
    207               __FILE__, __LINE__, p); fflush(stdout);*/
    208185          if (!stricmp(p, PCSZ_DOTOGG) || !stricmp(p, PCSZ_DOTMP3) || !stricmp(p, PCSZ_DOTFLAC))
    209186              OpenObject(filename, Default, hwnd);  //FM2Play fails to play these
Note: See TracChangeset for help on using the changeset viewer.