Oberon Community Platform Forum

Development => Bug Report => Topic started by: sage on May 28, 2011, 12:19:59 PM



Title: Wrong behaviour of WMStandardComponents.Scrollbar/Slider
Post by: sage on May 28, 2011, 12:19:59 PM
I'm writing sound driver for WinAos using Windows WinMM.dll API https://www.ocp.inf.ethz.ch/svn/ocp/trunk/SAGE (https://www.ocp.inf.ethz.ch/svn/ocp/trunk/SAGE)
Now driver only able to create mixer channels, and WMMixer able to show them.
But, WMStandardComponents.Scrollbar/Slider works wrong, they cuts values set by value.pos.Set() to range 0..100, seems like setting value.max.Set(255) takes no any effect  ???
Debug output from my driver:
Quote
mixerGetNumDevs: 2
Product name: Realtek HD Audio output
  - Dst name: Master Volume
    - Src name: Wave
      - Ctrl name: Volume
dwValue: 65535 Volume: 255
Bounds:          0     65535
      - Ctrl name: Mute
Bounds:          0         1
    - Src name: SW Synth
      - Ctrl name: Volume
dwValue: 32845 Volume: 128
Bounds:          0     65535
      - Ctrl name: Mute
Bounds:          0         1
    - Src name: CD Player
      - Ctrl name: Volume
dwValue: 6160 Volume: 24
Bounds:          0     65535
      - Ctrl name: Mute
Bounds:          0         1
    - Src name: Mic Volume
      - Ctrl name: Mic Volume
dwValue: 49151 Volume: 191
Bounds:          0     65535
      - Ctrl name: Mute
Bounds:          0         1
    - Src name: PC Beep
      - Ctrl name: PC Beep
dwValue: 65535 Volume: 255
Bounds:          0     65535
      - Ctrl name: Mute
Bounds:          0         1
To ensure that Scrollbar/Slider cuts values I've modified the code of Mixer.MixerChangeEvent:
Code:
KernelLog.Ln;
KernelLog.String(cn);
vol := 255 - vol;
KernelLog.Int(vol, 10);
value.pos.Set(vol);
KernelLog.Int(value.pos.Get(), 10);
and obtained following output:
Quote
Master Volume       255       100
Wave         0         0
SW Synth       127       100
CD Player       231       100
Mic Volume        64        64
PC Beep         0         0
I'ts evident that cutting off occured in 3 cases.