AndreMiras / pycaw

Python Core Audio Windows Library
MIT License
385 stars 67 forks source link

Using the IAudioEndpointVolumeCallback::OnNotify #10

Closed csevast closed 5 years ago

csevast commented 5 years ago

I would like to ask if I can use the method in the issue subject and how. I have in my application a slide control, which I want to make it to be changed if master control is changed outside of my application.

AndreMiras commented 5 years ago

It's not yet supported, but extending it should be fairly easy. Contributions are welcome :smile:

csevast commented 5 years ago

Hmmm, I tried already to do something but I have to confess that I'm not familiar in this kind of programming, the interfacing of Python with Windows APIs. It would be very helpful if you send me some reference links to read about it.

AndreMiras commented 5 years ago

Where got you stuck? The doc would be the official one: IAudioEndpointVolumeCallback::OnNotify with some copy/paste/modify from the existing code base. As silly as it seems, I'm not that familiar either, I've been running Linux only for the last 10 years :joy: I actually made this project for a friend of mine and every-time I need to maintain it, I have to setup a Wndows VM. Maybe you could share the piece of code you're struggling with and we could walk through it together, would that make sense?

csevast commented 5 years ago

I made something but it doesn't work.

pycaw[20181220-01-csevast].zip

AndreMiras commented 5 years ago

Kudos for trying. Next time you can also try with sharing a WIP pull request :wink: I'm pretty busy at the moment, but I'll definitely take a look when I have a minute

csevast commented 5 years ago

AndreMiras, well done! I just applied it in my application and it is working nice. I had to subclass to pass a reference to another object to control a slider and now I control through my applications UI the master volume of Windows. Thank you for your work.