Ignore:
Timestamp:
Jan 15, 2000, 11:02:50 PM (26 years ago)
Author:
sandervl
Message:

JW: Updated to Wine level 20000109 + corrected compile errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/winmm/mciseq/mciseq.cpp

    r2308 r2456  
    5151    HMMIO               hFile;                  /* mmio file handle open as Element          */
    5252    LPCSTR              lpstrElementName;       /* Name of file */
     53    LPCSTR              lpstrCopyright;
     54    LPCSTR              lpstrName;             
    5355    WORD                dwStatus;               /* one from MCI_MODE_xxxx */
    5456    DWORD               dwMciTimeFormat;        /* One of the supported MCI_FORMAT_xxxx */             
     
    371373    mmt->dwEventPulse = 0;
    372374   
    373     while (MIDI_mciReadNextEvent(wmm, mmt) == 0 &&
    374            LOWORD(mmt->dwEventData) != 0x2FFF) {       
     375    while (MIDI_mciReadNextEvent(wmm, mmt) == 0 && LOWORD(mmt->dwEventData) != 0x2FFF) {
     376        char    buf[1024];
     377        WORD    len;
     378
    375379        mmt->dwIndex += mmt->wEventLength;
     380
     381        switch (LOWORD(mmt->dwEventData)) {
     382        case 0x02FF:
     383        case 0x03FF:
     384            /* position after meta data header */
     385            mmioSeek(wmm->hFile, mmt->dwIndex + HIWORD(mmt->dwEventData), SEEK_SET);
     386            len = mmt->wEventLength - HIWORD(mmt->dwEventData);
     387                   
     388            if (len >= sizeof(buf)) {
     389                WARN("Buffer for text is too small (%d bytes, when %u are needed)\n", sizeof(buf) - 1, len);
     390                len = sizeof(buf) - 1;
     391            }
     392            if (mmioRead(wmm->hFile, (HPSTR)buf, len) == len) {
     393                buf[len] = 0;   /* end string in case */
     394                switch (HIBYTE(LOWORD(mmt->dwEventData))) {
     395                case 0x02:
     396                    if (wmm->lpstrCopyright) {
     397                        WARN("Two copyright notices (%s|%s)\n", wmm->lpstrCopyright, buf);
     398                    } else {
     399                        wmm->lpstrCopyright = HEAP_strdupA(GetProcessHeap(), 0, buf);
     400                    }
     401                    break;
     402                case 0x03:
     403                    if (wmm->lpstrCopyright) {
     404                        WARN("Two names (%s|%s)\n", wmm->lpstrName, buf);
     405                    } else {
     406                        wmm->lpstrName = HEAP_strdupA(GetProcessHeap(), 0, buf);
     407                    }
     408                    break;
     409                }
     410            }
     411            break;
     412        }
    376413    }
    377414    mmt->dwLength = mmt->dwEventPulse;
     
    681718   
    682719    if (dwFlags & MCI_OPEN_ELEMENT) {
    683         LPSTR           lpstrElementName;
    684        
    685         lpstrElementName = lpParms->lpstrElementName;
    686        
    687         TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpstrElementName);
    688         if (lpstrElementName && strlen(lpstrElementName) > 0) {
    689             wmm->hFile = mmioOpenA(lpstrElementName, NULL,
     720        TRACE("MCI_OPEN_ELEMENT '%s' !\n", lpParms->lpstrElementName);
     721        if (lpParms->lpstrElementName && strlen(lpParms->lpstrElementName) > 0) {
     722            wmm->hFile = mmioOpenA(lpParms->lpstrElementName, NULL,
    690723                                   MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
    691724            if (wmm->hFile == 0) {
    692                 WARN("Can't find file '%s' !\n", lpstrElementName);
     725                WARN("Can't find file '%s' !\n", lpParms->lpstrElementName);
    693726                wmm->nUseCount--;
    694727                return MCIERR_FILE_NOT_FOUND;
     
    701734   
    702735    /* FIXME: should I get a strdup() of it instead? */
    703     wmm->lpstrElementName = lpParms->lpstrElementName;
    704    
     736    wmm->lpstrElementName = HEAP_strdupA(GetProcessHeap(), 0, lpParms->lpstrElementName);
     737    wmm->lpstrCopyright = NULL;
     738    wmm->lpstrName = NULL;
     739
    705740    wmm->wNotifyDeviceID = dwDeviceID;
    706741    wmm->dwStatus = MCI_MODE_NOT_READY; /* while loading file contents */
     
    801836        }
    802837        HeapFree(GetProcessHeap(), 0, wmm->tracks);
     838        HeapFree(GetProcessHeap(), 0, (LPSTR)wmm->lpstrElementName);
     839        HeapFree(GetProcessHeap(), 0, (LPSTR)wmm->lpstrCopyright);
     840        HeapFree(GetProcessHeap(), 0, (LPSTR)wmm->lpstrName);
    803841    } else {
    804842        TRACE("Shouldn't happen... nUseCount=%d\n", wmm->nUseCount);
     
    906944    wmm->wStartedPlaying = FALSE;
    907945   
    908     dwRet = midiOutOpen(&wmm->hMidi, 0, 0L, 0L, CALLBACK_NULL);
    909     /*  dwRet = midiInOpen(&wmm->hMidi, 0, 0L, 0L, CALLBACK_NULL);*/
     946    dwRet = midiOutOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);
     947    /*  dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/
    910948
    911949    while (wmm->dwStatus != MCI_MODE_STOP) {
     
    9871025                        TRACE("%s => \"%s\"\n", (idx < 8 ) ? info[idx] : "", buf);
    9881026                    } else {
    989                         WARN("Couldn't read data for %s\n", (idx < 8 ) ? info[idx] : "");
     1027                        WARN("Couldn't read data for %s\n", (idx < 8) ? info[idx] : "");
    9901028                    }
    9911029                }
     
    15081546    TRACE("buf=%p, len=%lu\n", lpParms->lpstrReturn, lpParms->dwRetSize);
    15091547   
    1510     switch (dwFlags) {
     1548    switch (dwFlags & ~(MCI_WAIT|MCI_NOTIFY)) {
    15111549    case MCI_INFO_PRODUCT:
    15121550        str = "Wine's MIDI sequencer";
     
    15151553        str = wmm->lpstrElementName;
    15161554        break;
    1517 #if 0
    1518         /* FIXME: the following manifest constants are not defined in <WINE>/include/mmsystem.h */
    15191555    case MCI_INFO_COPYRIGHT:
     1556        str = wmm->lpstrCopyright;
     1557        break; 
     1558    case MCI_INFO_NAME:
     1559        str = wmm->lpstrName;
    15201560        break;
    1521     case MCI_INFO_NAME:
    1522         break;
    1523 #endif
    15241561    default:
    15251562        WARN("Don't know this info command (%lu)\n", dwFlags);
Note: See TracChangeset for help on using the changeset viewer.