goxr3plus / java-stream-player

🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
GNU General Public License v3.0
147 stars 33 forks source link

Another main, application and listener implementation #18

Closed HelgeStenstrom closed 5 years ago

HelgeStenstrom commented 5 years ago

This implementation doesn't subclass StreamPlayer, and it doesn't implement the StreamPlayerListener interface. Instead, the application has an instance of the regular StreamPlayer, and there is a separate implementation of the StreamPlayerListener interface.

One thing I dislike, is that the StreamPlayerListener depends on the StreamPlayer; it imports it, and has an instance of it, because that is how it gets the total number of bytes.

I have also added an alternative progress logging message.

I would have prefered to create the listener i main(), but it needs information that only the application has (the filename), so it has to be created in the application.

Besides that, it works as usual.

goxr3plus commented 5 years ago

Go for it :)

HelgeStenstrom commented 5 years ago

This pull request is a draft, because I want some comments on it. The main difference compared with the previous demo application, is that this one is not a subclass of StreamPlayer. That is an advantage in my opinion, but it's a matter of preferred style. There are no feature differences; they do exactly the same thing, so keeping both variants seems a bit meaningless.

StreamPlayer has a huge amount of public methods, and many of them are not used. I'm wondering if the unused methods should be removed, or if they should be used by the demo application, or at least by some unit tests. I don't think they should remain unused. If you want to showcase them in an application, then it might be worthwhile to have both a minimal application, and one that use all or most of the available methods in StreamPlayer.

goxr3plus commented 5 years ago

Let me see this tomorrow at work.

goxr3plus commented 5 years ago

Yes i have to make a documentation on how to use all the methods . Actually all of them have a purpose ,XR3Player is using most of them .

We need a documentation somewhere :)