Changeset 2286 for trunk/src


Ignore:
Timestamp:
Dec 31, 1999, 2:55:51 PM (26 years ago)
Author:
sandervl
Message:

PD: implemented waveOutGet/SetVolume

Location:
trunk/src/winmm
Files:
3 edited

Legend:

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

    r2244 r2286  
    1 /* $Id: dwaveout.cpp,v 1.12 1999-12-29 10:44:16 sandervl Exp $ */
     1/* $Id: dwaveout.cpp,v 1.13 1999-12-31 13:55:51 sandervl Exp $ */
    22
    33/*
     
    3333#ifndef min
    3434#define min(a, b) ((a > b) ? b : a)
     35#endif
     36
     37#ifndef max
     38#define max(a, b) ((a > b) ? a : b)
    3539#endif
    3640
     
    114118   ulError       = 0;
    115119   selCallback   = 0;
     120   volume        = 0xFFFFFFFF;
    116121   State         = STATE_STOPPED;
    117122
     
    169174   }
    170175   State    = STATE_STOPPED;
     176
     177   setVolume(volume);
    171178
    172179   wmutex   = new VMutex();
     
    731738  return(TRUE);
    732739}
     740
     741/******************************************************************************/
     742/******************************************************************************/
     743MMRESULT DartWaveOut::setVolume(ULONG ulVol)
     744
     745  ULONG ulVolR     = (((ulVol & 0xffff0000) >> 16 )*100)/0xFFFF; // Right Volume
     746  ULONG ulVolL      = ((ulVol& 0x0000ffff)*100)/0xFFFF;          // Left Volume
     747  MCI_SET_PARMS msp = {0};
     748
     749  volume = ulVol;
     750
     751// PD: My card (ESS 1868 PnP) driver can't change only
     752//     one channel Left or Right :-(
     753//
     754#ifdef GOOD_AUDIO_CARD_DRIVER 
     755
     756  msp.ulAudio = MCI_SET_AUDIO_LEFT;
     757  msp.ulLevel = ulVolL;
     758
     759  mciSendCommand(DeviceId, MCI_SET,
     760                 MCI_WAIT | MCI_SET_AUDIO | MCI_SET_VOLUME,
     761                 &msp, 0);
     762
     763  msp.ulAudio = MCI_SET_AUDIO_RIGHT;
     764  msp.ulLevel = ulVolR;
     765
     766#else
     767  msp.ulAudio = MCI_SET_AUDIO_ALL;
     768  msp.ulLevel = max(ulVolR,ulVolL);
     769#endif
     770
     771  mciSendCommand(DeviceId, MCI_SET,
     772                 MCI_WAIT | MCI_SET_AUDIO | MCI_SET_VOLUME,
     773                 &msp, 0);
     774  return 0;
     775}
    733776/******************************************************************************/
    734777/******************************************************************************/
  • trunk/src/winmm/dwaveout.h

    r2242 r2286  
    1 /* $Id: dwaveout.h,v 1.6 1999-12-29 08:33:56 phaller Exp $ */
     1/* $Id: dwaveout.h,v 1.7 1999-12-31 13:55:51 sandervl Exp $ */
    22
    33/*
     
    4141     MMRESULT pause();
    4242     MMRESULT restart();
     43     MMRESULT setVolume(ULONG ulVol);
     44     ULONG    getVolume() {return volume; };
    4345     int      getState() { return State; };
    4446     MMRESULT reset();
     
    6163
    6264    ULONG  ulError, State;
     65    ULONG  volume;                        // Volume state
    6366
    6467    MCI_MIX_BUFFER     *MixBuffer;          /* Device buffers          */
  • trunk/src/winmm/waveout.cpp

    r2242 r2286  
    1 /* $Id: waveout.cpp,v 1.8 1999-12-29 08:33:56 phaller Exp $ */
    2 #undef DEBUG
     1/* $Id: waveout.cpp,v 1.9 1999-12-31 13:55:51 sandervl Exp $ */
     2//#undef DEBUG
    33/*
    44 * Wave out MM apis
     
    381381  if(DartWaveOut::find(dwave) == TRUE)
    382382  {
    383     return MMSYSERR_NOTSUPPORTED;
     383    if (pdwVolume!=NULL)
     384      *pdwVolume=dwave->getVolume();
     385    return MMSYSERR_NOERROR;   
    384386  }
    385387  else
     
    394396  if(DartWaveOut::find(dwave) == TRUE)
    395397  {
    396     return MMSYSERR_NOTSUPPORTED;
     398    return(dwave->setVolume(dwVolume));
    397399  }
    398400  else
Note: See TracChangeset for help on using the changeset viewer.