Changeset 3852 for trunk/src


Ignore:
Timestamp:
Jul 18, 2000, 8:34:43 PM (25 years ago)
Author:
sandervl
Message:

waveOutSetVolume fix

Location:
trunk/src/winmm
Files:
3 edited

Legend:

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

    r3780 r3852  
    1 /* $Id: dwaveout.cpp,v 1.27 2000-06-30 08:40:05 sandervl Exp $ */
     1/* $Id: dwaveout.cpp,v 1.28 2000-07-18 18:34:41 sandervl Exp $ */
    22
    33/*
     
    119119   ulError       = 0;
    120120   selCallback   = 0;
    121    volume        = 0xFFFFFFFF;
     121   volume        = defvolume;
    122122   State         = STATE_STOPPED;
    123123
     
    423423        wmutex->leave();
    424424
     425        //write buffers to DART; starts playback
    425426        MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle,
    426427                                 MixBuffer,
     
    529530        wmutex->leave();
    530531        curbuf = curPlayBuf;
     532
    531533        for(i=0;i<PREFILLBUF_DART;i++) {
    532534                MixSetupParms->pmixWrite(MixSetupParms->ulMixHandle, &MixBuffer[curbuf], 1);
     
    776778  MCI_SET_PARMS msp = {0};
    777779
     780  dprintf(("DartWaveOut::setVolume %x %x", ulVolL, ulVolR));
    778781  volume = ulVol;
    779782
     
    804807}
    805808/******************************************************************************/
     809//Called if waveOutSetVolume is called by the application with waveout handle NULL
     810//Sets the default volume of each waveout stream (until it's volume is changed
     811//with an appropriate waveOutSetVolume call)
     812/******************************************************************************/
     813void DartWaveOut::setDefaultVolume(ULONG volume)
     814{
     815  defvolume = volume;
     816}
     817/******************************************************************************/
    806818/******************************************************************************/
    807819DartWaveOut *DartWaveOut::waveout = NULL;
    808 
     820ULONG DartWaveOut::defvolume = 0xFFFFFFFF;
     821
  • trunk/src/winmm/dwaveout.h

    r3348 r3852  
    1 /* $Id: dwaveout.h,v 1.9 2000-04-08 09:16:54 sandervl Exp $ */
     1/* $Id: dwaveout.h,v 1.10 2000-07-18 18:34:43 sandervl Exp $ */
    22
    33/*
     
    5858  static int  getNumDevices();
    5959
     60  static void setDefaultVolume(ULONG volume);
     61
    6062protected:
    6163  static void mciError(ULONG ulError);
     
    99101    static    DartWaveOut*    waveout;                // List of Timer
    100102
     103    static    ULONG           defvolume;      //default volume for streams (if waveOutSetVolume called with NULL stream)
     104
    101105#ifndef _OS2WIN_H
    102106    friend    LONG APIENTRY WaveOutHandler(ULONG ulStatus, PMCI_MIX_BUFFER pBuffer, ULONG ulFlags);
  • trunk/src/winmm/waveout.cpp

    r3328 r3852  
    1 /* $Id: waveout.cpp,v 1.14 2000-04-06 20:36:29 sandervl Exp $ */
     1/* $Id: waveout.cpp,v 1.15 2000-07-18 18:34:43 sandervl Exp $ */
    22//#undef DEBUG
    33/*
     
    438438    return(dwave->setVolume(dwVolume));
    439439  }
    440   else
    441       return MMSYSERR_NOERROR;
     440  if(hwo == NULL) {
     441        DartWaveOut::setDefaultVolume(dwVolume);
     442  }
     443  return MMSYSERR_NOERROR;
    442444//    return(MMSYSERR_INVALHANDLE);
    443445}
Note: See TracChangeset for help on using the changeset viewer.