-
Notifications
You must be signed in to change notification settings - Fork 113
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
Refactored #75 #94
Refactored #75 #94
Conversation
can you perform a rebase since we just merged the other PR? that way it will pass CI :) |
Sorry @ladyada I don't really know how to fix this. |
it looks like I made it worse |
yeah you'll need to do a git pull on your local repo, and see what got messed up, probably just a comment broke |
nothing is ever easy (Wizard's First Rule) |
@ladyada I don't get it,
|
aaah, nevermind, I see how to document it in the file. Sigh. |
we use doxygen which requires any non-private functions/vars to be documented |
spaces? Seriously?? Sigh
OK @ladyada , all set. |
nice work!! |
* applied changes from adafruit#75 * fixed layout issues (I think) from checks * fixed incomplete comment * Update Adafruit_VS1053.cpp * I truly don't understand what the big deal is here. * Update Adafruit_VS1053.cpp * Update Adafruit_VS1053.cpp spaces? Seriously?? Sigh * ugh, another space.
Updated #75 based on feedback from @ladyada. I couldn't figure out how to make a PR on the existing PR (although I didn't spend a lot of time on it) so this is a new PR that refactors the original PR with requested changes and more.
Note: Please close the other PR when you merge this one.
Changes
currentTrack
andplayingMusic
back to their original locations in the header file. I can't think of a good reason to have moved them (sorry)._loopPlayback
fromAdafruit_VS1053.h
toAdafruit_VS1053.cpp
as its an internal variable for the library and didn't need to be exposed through the header file (AFAIK).enablePlaybackLooping
anddisablePlaybackLooping
and replaced them with a single functionplaybackLoop(boolean loopState)
- passtrue
to enable playback looping,false
to disable it.playbackLooped()
that returns the current_loopPlayback
variable. This way a developer can set it and read it; a requirement for any complete API.Limitations
With playback looping enabled if a sketch plays a sound file using
playFullFile
, the sketch blocks, no other code executes becauseplayFullFile
blocks the thread and with playback looping enabled it never stops playing. I thought about putting in a check to skip looping on this condition, but i thought that this was something somebody may actually want to do. I can't see why, but developers have done stranger things. @ladyada please let me know if you want this limitation removed.Test Code
I tested the changes using the following code: