Ignore:
Timestamp:
Feb 27, 2001, 10:14:00 PM (24 years ago)
Author:
sandervl
Message:

Added preliminary wavein support

File:
1 edited

Legend:

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

    r4388 r5272  
    1 /* $Id: waveout.cpp,v 1.16 2000-10-02 18:55:41 sandervl Exp $ */
     1/* $Id: waveout.cpp,v 1.17 2001-02-27 21:14:00 sandervl Exp $ */
    22//#undef DEBUG
    33/*
     
    109109        pwh->dwFlags &= ~WHDR_DONE;
    110110
    111         dprintf(("waveOutWrite %x %d %x", pwh->lpData, pwh->dwBufferLength, pwh->dwFlags));
     111        dprintf(("waveOutWrite %x %d %x", pwh->lpData, pwh->dwBufferLength, pwh->dwFlags));
    112112        return(dwave->write(pwh, cbwh));
    113113  }
     
    226226  DartWaveOut *dwave = (DartWaveOut *)hwo;
    227227
    228   if(pmmt == NULL)     
     228  if(pmmt == NULL)
    229229        return MMSYSERR_INVALPARAM;
    230230
     
    239239        switch (pmmt->wType) {
    240240        case TIME_BYTES:
    241                 pmmt->u.cb = position;
    242                 break;
     241            pmmt->u.cb = position;
     242            break;
    243243        case TIME_SAMPLES:
    244                 pmmt->u.sample = position * 8 / dwave->getBitsPerSample();
    245                 break;
     244            pmmt->u.sample = position * 8 / dwave->getBitsPerSample();
     245            break;
    246246        case TIME_SMPTE:
    247247        {
    248                 ULONG timeval = position / (dwave->getAvgBytesPerSecond() / 1000);
    249                 pmmt->u.smpte.hour = timeval / 108000;
    250                 timeval -= pmmt->u.smpte.hour * 108000;
    251                 pmmt->u.smpte.min = timeval / 1800;
    252                 timeval -= pmmt->u.smpte.min * 1800;
    253                 pmmt->u.smpte.sec = timeval / 30;
    254                 timeval -= pmmt->u.smpte.sec * 30;
    255                 pmmt->u.smpte.frame = timeval;
    256                 pmmt->u.smpte.fps = 30;
    257                 break;
    258             }
     248            ULONG timeval = position / (dwave->getAvgBytesPerSecond() / 1000);
     249            pmmt->u.smpte.hour = timeval / 108000;
     250            timeval -= pmmt->u.smpte.hour * 108000;
     251            pmmt->u.smpte.min = timeval / 1800;
     252            timeval -= pmmt->u.smpte.min * 1800;
     253            pmmt->u.smpte.sec = timeval / 30;
     254            timeval -= pmmt->u.smpte.sec * 30;
     255            pmmt->u.smpte.frame = timeval;
     256            pmmt->u.smpte.fps = 30;
     257            break;
     258        }
    259259        default:
    260                 dprintf(("waveOutGetPosition: Format %d not supported ! use TIME_MS !\n", pmmt->wType));
    261                 pmmt->wType = TIME_MS;
     260            dprintf(("waveOutGetPosition: Format %d not supported ! use TIME_MS !\n", pmmt->wType));
     261            pmmt->wType = TIME_MS;
    262262        case TIME_MS:
    263                 pmmt->u.ms = position / (dwave->getAvgBytesPerSecond() / 1000);
    264                 dprintf(("WINMM:waveOutGetPosition: TIME_MS pos=%d ms=%d time=%d", position, pmmt->u.ms, GetCurrentTime()));
    265                 break;
     263            pmmt->u.ms = position / (dwave->getAvgBytesPerSecond() / 1000);
     264            dprintf(("WINMM:waveOutGetPosition: TIME_MS pos=%d ms=%d time=%d", position, pmmt->u.ms, GetCurrentTime()));
     265            break;
    266266        }
    267267        return MMSYSERR_NOERROR;
     
    306306              UINT, cbwoc)
    307307{
    308   dprintf(("WINMM:waveOutGetDevCapsW"));
    309 
    310308  if(DartWaveOut::getNumDevices() == 0) {
    311309        memset(pwoc, 0, sizeof(*pwoc));
     
    316314  pwoc->wPid = 0;                  /* product ID */
    317315  pwoc->vDriverVersion = 0x0001;        /* version of the driver */
    318   AsciiToUnicode( "OS/2 DART Wave Out", pwoc->szPname ); /* product name */
     316  lstrcpyW(pwoc->szPname, (LPCWSTR)L"OS/2 DART Wave Out"); /* product name */
    319317  pwoc->dwFormats = WAVE_FORMAT_1M08 | WAVE_FORMAT_1S08 |
    320318                    WAVE_FORMAT_1M16 | WAVE_FORMAT_1S16 |
     
    439437  }
    440438  if(hwo == NULL) {
    441         DartWaveOut::setDefaultVolume(dwVolume);
     439    DartWaveOut::setDefaultVolume(dwVolume);
    442440  }
    443441  return MMSYSERR_NOERROR;
Note: See TracChangeset for help on using the changeset viewer.