Forum: Multimedia
Delphi
by PeterPanino,
15. Okt 2023
TForm1.FormKeyUp:
TForm1.SetMasterVolumeMuteState: A
TForm1.SetMasterVolumeMuteState: B
TForm1.SetMasterVolumeMuteState: C
TForm1.SetMasterVolumeMuteState: ELSE 80070057
There must be a difference between our versions of Windows.
Forum: Multimedia
Delphi
by PeterPanino,
15. Okt 2023
Catching the R value on ELSE:
When calling SetMasterVolumeMuteState(True);
I get these debug messages:
TForm1.SetMasterVolumeMuteState: A
TForm1.SetMasterVolumeMuteState: B
TForm1.SetMasterVolumeMuteState: C
TForm1.SetMasterVolumeMuteState: ELSE = -2147024809
Forum: Multimedia
Delphi
by PeterPanino,
15. Okt 2023
Isn't the logic inverted here? (if not Succeeded -> SetMute OK)
Anyway - when calling with a False parameter, checking the exact HRESULT it returns FALSE here:
var R: System.HResult := FAudioEndpointVolume.SetMute(Muted, nil);
case R of
S_OK: CodeSite.Send('TForm1.SetMasterVolumeMuteState: OK'); // successful operation with a return value of True
...
Forum: Multimedia
Delphi
by PeterPanino,
14. Okt 2023
Diesem Irrtum bin ich vorher auch verfallen: Das betrifft nicht den Wert von MASTER VOLUME, sondern den Volume-Wert des eigenen Programms.
Kannst du in Settings -> App volume and device preferences genau beobachten.
Danke jedenfalls für deinen Beitrag! Much appreciated!
Forum: Multimedia
Delphi
by PeterPanino,
14. Okt 2023
In fact, that's what I am planning: The user should be able to simply click a button on my app to quickly mute or unmute his master volume without having to awkwardly call the Windows settings each time. With my apps, I always strive to make the operation of Windows easier, which is often unnecessarily complicated on many advanced settings. One usage example is: quickly switching off the sound...
Forum: Multimedia
Delphi
by PeterPanino,
14. Okt 2023
Ich habe jetzt endlich eine funktionierende Lösung gefunden, um den Wert von Master Volume (Mute/Unmute, Volume Percent) AUSZULESEN:
Es ist die Lösung von Andreas Rejbrand auf Stack Overflow:
https://stackoverflow.com/questions/66630233/delphi-sound-change-notification-mute-unmute
Aber leider weiß ich jetzt noch immer nicht, wie ich den Wert von Master Volume SETZEN kann. Weiß jemand...
Forum: Multimedia
Delphi
by PeterPanino,
14. Okt 2023
Hallo! Wie kann man in Delphi den Wert der Master Volume Lautstärke erhalten und setzen?
Mein System: Delphi 11 in Windows 10