Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

JPSVolumeButtonHandler Added feature to allow the handler to only res… #45

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

apple-ihack-geek
Copy link
Contributor

…pond to exact button presses, rather than just responding to any change in volume.

  1. Basically, our app and another app were having some major interference. What we do when we received a volume button caused another app to change the volume of the phone, but not by the same amount. However, because this is a volume change, one button press would trigger another and so on. This PR adds a new feature, where an app, if they call useExactJumpsOnly:YES, the handler will only respond to jumps that are exactly the 6.25% that actual button presses are (+/- .05% since these are floating point values).

  2. I cleaned up the logging a little.

…pond to exact button presses, rather than just responding to any change in volume.

squash me
@apple-ihack-geek
Copy link
Contributor Author

@jpsim
Hey, I just wanted to take a moment and thank you for creating and maintaining this library so far. It's been very helpful.
I don't mean to pushy or anything, but we're creating a release candidate on Friday, and I would love to have this fix in our code first. I'll maintain my fork if I have to, but I would prefer to keep it pointed here (to save myself some time in the future).
Thanks again.

@jpsim
Copy link
Owner

jpsim commented Apr 19, 2017

Sure, looks good to me, though I really can't take much credit for "continuing" to maintain this. I haven't used this myself in years and all contributions come from more active users like yourself.

That being said, this looks good to me, or at the very least this shouldn't do any harm to existing users.

I'll merge and produce a release asap. Thanks!

@jpsim jpsim merged commit 03933b6 into jpsim:master Apr 19, 2017
@jpsim
Copy link
Owner

jpsim commented Apr 19, 2017

1.0.4 has been tagged in this repo: https://github.com/jpsim/JPSVolumeButtonHandler/releases/tag/1.0.4

and pushed to CocoaPods trunk: CocoaPods/Specs@2af491e

@jpeyer
Copy link

jpeyer commented May 2, 2017

One instance where this logic doesn't work is if the volume is already at min/max. It will get adjusted up/down to 0.00001f or 0.99999f, which means down/up in those cases won't trigger because the .00001 difference is < 0.0625.

I am not using this new functionality, so it isn't affecting me, but I thought I'd mention it @apple-ihack-geek

@apple-ihack-geek
Copy link
Contributor Author

Thanks, yes, our testers did end up realizing that, but sadly thanks to #46 I had to pull out this feature from our app entirely. If I ever do end of using this library again, I do plan to address that.

@apple-ihack-geek
Copy link
Contributor Author

@jpeyer Thanks, I've addressed this in my new PR #47

@apple-ihack-geek apple-ihack-geek deleted the bk-Exact-Jumps-Only branch May 3, 2017 16:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants