I just fixed all that crap -- it will be in the next commit. Possibly later
today, maybe tomorrow.


--ruaok         Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert
----- Original Message -----
From: Valters Vingolds <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 07, 1999 3:02 PM
Subject: volume gets lost


> Well, it really looks like volume is always reset to zero!
> (When starting to play,changing song, etc).
> I do win98, as usually...
>
>
> I offer this here patch for
> io/soundcard/win32/soundcardpmo.cpp
> == cut ==
> 163a164,165
> >    if(!m_iLastVolume) m_iLastVolume=GetVolume();
> >
> 196,198c198
> <    waveOutSetVolume(m_hwo,
> <             MAKELPARAM( 0xFFFF*m_iLastVolume/100,
> <                         0xFFFF*m_iLastVolume/100));
> ---
> >    SetVolume(m_iLastVolume);
> == cut ==
>
> This seems to fix the symptoms (well, I'm not entirely sure if I'm doing
> right thing, but this seems to do the trick...)
> Please, verify.
>
>
> But then there is another problem:
>
> void SoundCardPMO::SetVolume(int32 volume)
> {
>    // When we begin playing the volume does not get set properly.
>    // In order to work around that, we'll save the last volume
>    // settting and then set the volume on the stream after we open
>    // the stream in init.
>    waveOutSetVolume(   (HWAVEOUT)WAVE_MAPPER,
>                         MAKELPARAM( 0xFFFF*volume/100,
>                                     0xFFFF*volume/100));
>    m_iLastVolume = volume;
> }
>
> int32 SoundCardPMO::GetVolume()
> {
>     int32 volume = 0;
>
>     waveOutGetVolume((HWAVEOUT)WAVE_MAPPER, (DWORD*)&volume);
> (!)    volume = (int32)(100 * ((float)LOWORD(volume)/(float)0xffff));
>
>     return volume;
> }
>
>
> These volume (slowly) deteriorates when calling these two.
> I think it is because marked (!) line makes it lose precision and
decrease.
>
> I can't think of a way how to stop that, currently - maybe you can do it
> better?
> --
> Valters "WaTT" Vingolds
>

Reply via email to