-
Notifications
You must be signed in to change notification settings - Fork 4
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
Make the application runnable in UNIX. #22
Conversation
Makes progress in #16. |
Hi @maxton. Any issues with this PR? |
Yes. Instead of refactoring JammitNAudioSongPlayer, you should only have added one class: MockSongPlayer, which implements ISongPlayer. In the future there will probably only be one song player, probably using PortAudio. So there's no need to pollute the class hierarchy in such a way. The MockSongPlayer class should mostly replicate the external behavior of JammitNAudioSongPlayer so that the other components can be tested; it should respond to Play/Pause/Stop calls, it should use a background thread to increment the Position when in the Play state, and should expose the channels in the same way as JammitNAudioSongPlayer does. This way things such as animation can be tested using this class without audio output. |
I did implement the a mock audio player, but it crashed the application due to Max/Min value bindings for the UI controls. I'll revisit it and show you where the exceptions originate. Maybe you can shed some light into how to correctly mock the offending methods? |
@maxton See the current
Line: You mention the MockSongPlayer should increment the position in a background thread. Is this expcted to fix the issue (seems to be a division by zero). |
Simplified the changes. Builds and runs on OS X. Does not intrude with the current Windows code base. |
Looks good. Can you squash those commits into one? |
a2c3239
to
d48082d
Compare
@maxton Squashed, and ready to merge. |
This change implements a MuteNAudioSongPlayer, which mocks lacks any _waveform member or implementation.
Works on Mac OS X (10.2) and Linux (Ubuntu).
The song will successfully load and display controls and score, but the 'Play' functionality is just a placeholder for now.
Note: class MockSongPlayer was also implemented, but its usage broke the app due to indexing errors related to some control's Max and Min values.