Changeset 193 for trunk/classes/mm-progs


Ignore:
Timestamp:
Jun 29, 2024, 11:53:08 PM (14 months ago)
Author:
gyoung
Message:

Fix the media file identification code so the internal audio player plays MIDI files

Location:
trunk/classes/mm-progs/MMPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/classes/mm-progs/MMPlayer/mmplayer.c

    r144 r193  
    5151#include "mmprogs_defaults.h"
    5252#include "sys_funcs.h"
     53
     54#if 0
     55#define  _PMPRINTF_
     56#include "PMPRINTF.H"
     57#endif
    5358
    5459#ifndef OPEN_DEFAULT
     
    11011106ULONG mmIdentifyFile(char* chrFile)
    11021107{
    1103   MMIOINFO mmioInfo;
    1104   MMFORMATINFO mmFormatInfo;
     1108  MMIOINFO mmioInfo = {0};
     1109  MMFORMATINFO mmFormatInfo = {0};
    11051110  FOURCC fourCC;
    1106 
    1107 
    1108   if(MMIO_SUCCESS!=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0))
     1111  INT rc;
     1112
     1113  rc=mmioIdentifyFile(chrFile, &mmioInfo, &mmFormatInfo, &fourCC, 0,0);
     1114  if(rc!=MMIO_SUCCESS)
    11091115    {
     1116#ifdef _PMPRINTF_
     1117      DebugHereIAm();
     1118#endif
    11101119      return 0;
    11111120    }
    1112 
     1121#ifdef _PMPRINTF_
     1122  Pmpf(("MediaType %u", mmFormatInfo.ulMediaType));
     1123#endif
    11131124  if(mmFormatInfo.ulMediaType==MMIO_MEDIATYPE_MIDI)
    11141125    return 1; /* Midi */
     
    11581169          ++chrPtrName;
    11591170
    1160         if((rc=mmIdentifyFile(chrSourceName))==0)
     1171        rc=mmIdentifyFile(chrSourceName);
     1172        if(rc==0)
    11611173          {
    1162             /* FIXME: Identify error !!!*/
     1174#ifdef _PMPRINTF_
     1175            DebugHereIAm();
     1176#endif
     1177            /* FIXME: Identify error !!!*/
    11631178
    11641179          };
    1165 
     1180#ifdef _PMPRINTF_
     1181        Pmpf(("rc %u", rc));
     1182#endif
    11661183        if(rc==1)
    1167           {
    1168             /* It's a MIDI file */
     1184          {
     1185            /* It's a MIDI file */
    11691186            bIsMidi=TRUE;
    11701187          }
  • trunk/classes/mm-progs/MMPlayer/playaudio.c

    r108 r193  
    4848#include "mmplayerres.h"
    4949#include "mmplayer.h"
     50
     51#if 0
     52#define  _PMPRINTF_
     53#include "PMPRINTF.H"
     54#endif
    5055
    5156/* The object window controling the trac playing */
     
    117122{
    118123  char chrCommand[CCHMAXPATH*2];
    119   char chrDevice[30];
     124  char chrDevice[30] = {0};
    120125  char retMsg[20];
    121126  ULONG rc;
     
    147152
    148153  if(bIsMidi)
    149     strncpy(chrDevice,"SEQUENCER", sizeof(chrDevice) - 1);
     154    strncpy(chrDevice,"sequencer", sizeof(chrDevice) - 1);
    150155  else
    151156    strncpy(chrDevice,"WAVEAUDIO", sizeof(chrDevice) - 1);
    152157
    153158  hwndNotify=hwndFrame;//WinWindowFromID(hwndTop, IDDLG_TOPMIDDLE);
    154 
    155159  /* Start audio file */
    156   sprintf(chrCommand,"open \"%s\"  type %s alias wave%d SHAREABLE wait", chrSourceName, chrDevice, iWavePriv);
     160  sprintf(chrCommand,"open \"%s\"  type %s alias wave%d shareable wait", chrSourceName, chrDevice, iWavePriv);
    157161  rc = mciSendString(chrCommand, retMsg, sizeof(retMsg), hwndNotify, 0);
    158   if((rc & 0x0000ffff)!=MCIERR_SUCCESS)
    159     return 0;
     162  if((rc & 0x0000ffff)!=MCIERR_SUCCESS) {
     163    return 0;
     164  }
    160165
    161166  /* Set time format */
Note: See TracChangeset for help on using the changeset viewer.