The UI

Like my previous project, Cryo, Hanasu makes use of the MahApps.Metro library for its UI. Other things like the Notifications window was originally built my X@MPP for an older project, and then modified in Cryo. I brought it back and tweaked it even more. These notifications fire off when a song is identified (more about this later), when a new song is played, a song is shared on Facebook, or when the stream sends down some sort of message.
Also, Phalanxia created the original icon and I accidentally modified it until it is the icon that I use for Hanasu.
Code
Media Playing
For the media playing engine, I make use of the ActiveX wrapper around Windows Media Player. I would have opt for VLC but its wrappers weren't suitable for my needs.
During the course of development, I started to have to 'help' WMP play certain streams. Some streams are direct urls over http which initiate a mms stream. Others are asx, mp3 or even wma. However, eventually, I came upon .pls files which are known to be tied with WinAmp and ShoutCAST. No problem, I built a simple pre-processor around that and would pass the parsed urls to the media player. If there's multiple servers in the playlist file, Hanasu will allow you to choose one of them. Soon enough, I had another pre-processor for M3U. It's quite easy to add more.

Song Identification
Other issues I encountered was dealing with the gibberish text that is sent through the internet stream. Some of it maybe be the current song playing. Other times, it may be a radio/tv message (shown below).

In order to deal with this, I use a complicated series of conditions and if they all equal true, its the 'assumed' song title. Otherwise, its shown as a radio message. Later, about 10 seconds into playback of the song, Hanasu will contact a lyric's database and check to see if the song exist. If it does, its a 'verified' song. Hanasu will display a notification and add two buttons to the main UI. One of them is a 'song info' button. When click, it displays the current lyrics for the song, and if possible, the artist/album and even album art. Lastly, it displays a link that forwards the user to a website where they can buy the album.

Sharing
The other button is a 'heart' button. This will post the song to your facebook where other users can download Hanasu and even visit the album's website.
Services
Sharing, Song Identification and the Pre-processors all work around the concept I use called services. Which is probably a step in the direction of MVVM build has a 'long way to go'. I could use MEF but for this project, I didn't use it. Anyway, for any non-media-player function, I added a service. In earlier builds, I had an irc service which would disp-lay liked songs in the channel of your choice. I also have a service for a pseudo-weak-events which allow services and the main player to interact to non-user events. I even make use of events to dynamically generate the save files. That means I do not have to hard-code settings for services through the Settings service. Instead, the individual service grabs the XDocument and appends its own setting to the document before passing it to be saved.
Video Playback
A few weeks ago, I expanded Hanasu to support video playback. This meant I had to stretch the player in the Now Playing tab. I also had to add some video streams to the catalog (which is hosted on the repo). Then, I had to included a UI that displays buffering progress.

Misc
For debug builds only, I have included a Log tab. However, at the time of posting, its kind of broken.
However, in all builds, I have included a button that shows any attributes related to the connected server. This is for people who are curious about the server version, etc.

Downloads
There is much more to this project and I spent a lot of time dreaming this up. It has been through a long 'private bug testing' and I am finally comfortable to release it to everyone to try it out. As usual, if you run into any bugs, feel free to report them here.

New Topic/Question
Reply



MultiQuote




















|