Skip to content

Been a while…

I’ve had major problems with the last version of Simple TV Library (that never got posted to the Store).  It’s much better than it was before, but it was still unstable.  There were thread access problems all over the place which made updating the UI problematic for certain things.  It lagged a little bit as a result.  In the end, it made me want to take a break for a little while. 

But I’ve now discovered something amazing called MVVM Light.  I would have never been able to use it had I not gone through the trials of using Microsoft’s BindableBase and their simple version of a ViewModel.  Every little bit of experience counts though and decided to try and use it for Simple TV Library.  The results have been astounding.  Most of my code has shrunk in size.  It’s well organized… it’s just so much easier to add new functionality.  Oh, and the designer in VisualStudio actually shows me how my project is going to look without me having to run it all the time.  Awesome.

Anyways, the main page is nearly done.  I’m also almost done with the background methods that check for file/folder changes and download information from TheTVdb.com.  Just with this being completed, I can tell this is going to be good.  I’ve got my drive back and maybe I can get it done by next weekend. 

Sneak peak of (some) new features while certification problems are worked out

Step 1 to MKV accomplished (the easy step)

I think I know the approach I’m going to need to take to get MKV files to play in any WinRT/Windows Store app.  And that is to use the MediaStreamSource extension that is available through Silverlight.  There is a sample available on Microsoft’s website that shows how to do a very basic implementation of this.  It basically allows you to set the source of your mediaelement with a custom source… not just one that mediaelement can automatically recognize.

The sample just generates simple PCM source (pulse modulating wave – what all sound files get turned into before going to the sound hardware) within a Media Foundation object called a Source (duh) and sets that source as the mediaelement’s source.  The trouble with the sample is that it’s half C++ and half C# and written for ARM.  It took me a day to figure out since I have no idea how to set the compiler paths and stuff for C++, but I put it into Simple TV Library and made it play the PCM source when a MKV file was selected.  Out of the speakers came:  Bzzzzzzzzz.  Perfect!

So the easy part is done.  I have a framework setup in which to play any container format I want as long as the streams inside use known codecs.  The hard part is going to be writing an MKV parser… something that will read the actual file and create individual streams.

I’m hoping that this method is going to work in the end.  So far, I can’t see why not.

Certification failed???!

What the hell Microsoft testers?  All of a sudden, “this app appears to be incomplete in its functionality”??? Did you even read the notes to testers that gives you a download link to a fake library to test with?   Arrghhh… honestly, the overall functionality has not changed since the 2nd release.  It may have even gotten better.

Sorry to everyone waiting for the update.  I’m going to discuss what to do with some other devs because I am at a loss. 

MKV – Matroska support… researching

I’ve been researching what it would take to get to get MKV support in Simple TV Library.  This may be helpful to know so that app makers in general are not blamed too much when an app does NOT support MKV or codec X.  Windows Store app (formerly known as Metro apps) do NOT use any of the codecs installed on your PC.  These are DirectShow codecs and it is the older system for decoding video/audio.  It’s in heavy use still because XP is still around as well as the fact that everyone knows how to program with DirectShow.  When Vista was introduced, a new system called Windows Media Foundation was also released.  This is essentially what Windows Media Center uses (although I believe there are hacks to get it to use DirectShow).

In any case, Media Foundation is in Windows 7 and now in Windows 8.  Windows Store apps can ONLY use Media Foundation to decode video and audio.  Otherwise, you are limited to the basic MediaElement control… which is excellent!  However, it only supports a limited number of container formats and video/audio codecs.

Matroska is a container format, like an AVI file.  Inside that MKV file, there might be a video stream encoded with H264 which Media Foundation can read natively.  If there’s a non-standard stream inside that MKV file, like an Ogg Vorbis audio stream.  Then you’d also need a codec to play the Ogg Vorbis audio.

The other caveat here is that even if someone were to write an MKV “codec” for windows desktop, it WON’T work with a Windows Store app.  The MKV software must be written into the app itself.  It is the nature of these Windows Store apps that they can ONLY use the WinRT libraries on your machine.  Any other library must come with the app itself.

 

My goal right now is to figure out how to have Media Foundation open the MKV container and access the streams inside.  That’s it.  That would mean many of the MKV files available would work since they contain H264 and mp3 streams.  It’s incredibly difficult to do it though.  First, there are not many great samples to look at.  Second, there is not much literature about Media Foundation.  Third, it’s all in C++ which is not my forte.  But I’m going to try anyways.  There are possible wrappers I could use (MF.NET or SharpDX), but I still need a solid understanding of how Media Foundation works…

So that’s what I’ll be doing over the holidays.  I’ve got one more final to give tomorrow then a bunch of grading.  But then I have a few weeks to work on MKV and media foundation.  Wish me luck 🙂

Simple TV Library v1.5.1 submitted

The last release had a few problems with the file name recognition (regex).  At least for one user’s problems, I know I fixed it.  We’ll see how this works for other people.  The problem with file names is that every source uses a different naming convention and you just have to write a regex expression for each one.  I’ve got a plan for the next release that will let custom regex be entered… but that’s the next release.  Tonight, I submitted v1.5.1 which has the following changes:

Changes for v1.5.1

  • Added Episode record selector (if the app fails to identify season/episode from filename)  {Can select from a season categorized list of episodes or just use the combobox selector for quicker selection)
  • Added Two-Rows setting for Series page – complete reworking of how it was done before.  Animations included
  • Fixed bug with multiple root folders…app was keeping only last declared root folder (doh!)
  • Reorganized app localfolder hierarchy
  • Added Regex for more file name types (S##E## – Filename.avi  <- season/episode info at the beginning of file)
  • Added logic to prevent app from recognizing non-video files as video files (this happened with nfo or txt files that had the same name as the avi)
  • Series page keeps position from last selected series, no longer starts from beginning every time you navigate away
  • Settings ViewModel created for easier addition of settings with bindings to UI

Version 1.5 is officially published

Version 1.5 is officially published!  I’m eager to read the feedback.

http://apps.microsoft.com/webpdp/app/simple-tv-library/33c4793c-9a03-47e7-9ef4-3a28ed6b6a14