Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IAudioSessionEvents callbacks & Example #36

Merged
merged 4 commits into from
Apr 24, 2021

Conversation

TurboAnonym
Copy link
Contributor

Implementing #27 and more usefull callbacks!

Following "IAudioSessionEvents" callbacks are supported:
OnSimpleVolumeChanged()
OnStateChanged()
OnSessionDisconnected()

Added an example to show the new features

Thanks @AndreMiras for this project!

Following "IAudioSessionEvents" callbacks are supported:
OnSimpleVolumeChanged()
OnStateChanged()
OnSessionDisconnected()

Added an example to show the new features
Added if __name__ == "__main__":

and the example script can now run "normally" (without python -i mode)
pycaw/pycaw.py and examples/session_callback_example.py are now style compliant to PEP 8
- Indentation and Import order fixes
- to long lines fix
* example: added missing f strings

examples/session_callback_example.py:

Due to heavy formatting i forgot to add back in f strings.

Also fixed missing whitespace between oneline strings.
@TurboAnonym
Copy link
Contributor Author

TurboAnonym commented Apr 23, 2021

Oooooops that where a lot of commits ;)

Its my first time contributing to a Github project ^^

But now everything should work as expected!

@TurboAnonym
Copy link
Contributor Author

I think i will come back later with an even bigger pull request ;)

Im working on a project and i need AudioSessionNotification::OnSessionCreated too

@AndreMiras
Copy link
Owner

AndreMiras commented Apr 24, 2021

Thanks for contributing.
When you have many commits, you can always squash with git rebase -i or git reset --soft HEAD~<N>.
I like small pull requests more over big pull requests by the way 😉

Edit: why did you close the pull request by the way?

@TurboAnonym
Copy link
Contributor Author

i have no clue 😉

i thought with all this back and forth ... that i should make a new request later and add there also:

Get State and OnSessionCreated as well as an example ;)
And add something in to pycaw.pycaw.AudioSession so you can easily access the new functions ;)

i thought it would make it easier for you to test all this if its all in one run ;)

... but youre right small is better ;) then you know where possible errors are

@TurboAnonym TurboAnonym reopened this Apr 24, 2021
Copy link
Owner

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hard work and for fixing the linter.
For your info, you can squash commits and push force in order to make a PR with one commit.
I'll squash upon merge

@AndreMiras AndreMiras merged commit c034bc5 into AndreMiras:develop Apr 24, 2021
@TurboAnonym
Copy link
Contributor Author

Yeah it was even fun trying all out and fixing it 😁
Thanks for the maintenance of this project and the info 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants