Oberon Community Platform Forum
October 13, 2019, 08:43:13 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Wrong behaviour of WMStandardComponents.Scrollbar/Slider  (Read 3181 times)
sage
Full Member
***
Posts: 170



WWW
« 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
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  Huh
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.


* WMMixer_wrong.PNG (14.28 KB, 375x240 - viewed 500 times.)
« Last Edit: May 28, 2011, 12:43:36 PM by sage » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!