Posts Tagged Windows Media Player

This should look better


I have spent a couple of hours of mucking around with the settings on this site. Now, I think I have sorted out most of the options I want to have in this blog (for now, as always the editor reserves the right to correct, modify, or just plain fiddle about), with a look and feel which is reasonable.

There is one big feature from the Windows Live Blog which is missing WordPress. This feature was the is the list option.  On the Windows Live Blog I had lists of books which I was reading, or had read. These lists were looking up the cover art from Amazon, and would link to the book on Amazon. I’ll have to have a think about how to implement on this site. It will be a case of out with the “roll your own HTML”, maybe I’ll need to have some script as well (if one can embed script in the HTML on this site – further research has shown that script is not allowed, so I’ll have to stick with “vanilla HTML”). The basic HTML is not too hard, just an <img src="" alt="" > tag with the correct URL and other bits of navigation. Doing the same for CD’s would be interesting as well. Finding a site of CD cover art would be the “tricky bit”, the one that Windows Media Player uses would be a good starting point.

After some fiddling about with HTML, Amazon and W3Schools I think I have something which will work for books. I still need to test it this solution on WordPress from within my blog. That testing will come in the next couple of days. The interesting next step will be to see if I can get something working for CD’s, and then DVD’s after that. Amazon may be a source for the CD’s, but I’ve yet to explore that, and the breadth of the CD selections on Amazon.

  

WordPress Tags: Windows Live List,List,WordPress,Windows Live,Blog,Amazon,HTML,script,Windows Media Player

 

, , , , , , ,

2 Comments

War with Windows Media Player!


Introduction

I’ve been on a long journey with Windows Media Player. The journey started with 100 Blues CD’s which I wanted to add to my music library. The CD’s came from a set of magazine and CD’s which I collected many years ago. This started a series of miss steps with Windows Media Player.

The Missteps

  1. Album Does not exists in the metadata service
  2. Album Art Does not exists (more to point was not found)
  3. Updating Album Art takes forever (almost)
  4. Using a network drive (file share) as the primary store for the media, with Windows 7 Home
  5. Loosing much of the library (and recovering it)
  6. Unidentified Tracks (I’m sure I’ve got some)

The Solutions

  • Album Does not exists in the metadata service

    The solution enter the information by hand. Not the most time efficient, but the option of searching the possible matches for something which matched usually resulted in not finding a match.

    • Album Art Does not exists (more to the point was not found)

    The solution here has been a very labour intensive search for on a music store web site. Find a “the” album cover, or it that failed something which is by the same artist. Save the image, and then paste that image into the album art using the context menu (right click on the “empty” album cover and then “Paste Album Art”).

    • Updating Album Art takes forever (almost)

    Not sure of the cause, and not sure what the solution could be. It seems that I have improved things by “loosing lots of the content”, and re-adding it.

    • Using a network drive (file share) as the primary store for the media, with Windows 7 Home

    I not convinced that the configuration I’m using with using is working 100%. The Western Digital My Book World claims to Windows 7 compliant. I’m not convinced that it is compliant with Windows 7 Home Premium. I suspect that the absence (or switching off) of some of the network functions could be “stuffing up” Windows Media Player, when using network share to store music library. I could have to upgrade to the Business version of Windows 7 to prove, or disprove, this suspicion. (Not something I really want to do just at the moment).

    • Loosing much of the library (and recovering it!)

    Yes, Windows Media Player lost a large proportion of the library! The content was there in the “MyBookWorld” version, but not present in the main library. I recovered from this “disaster” by doing the following:

    • Using Windows Explorer “Search for” (*.wma in one Explorer window, and *.mp3 in an other)
    • The select all of the “content” (all of the mp3’s and a second time all of the wma’s) and add to the Windows Media Player Playlist.
    • Wait for Windows Media Player to “digest” the play list.

    The effect is to “add all of the content” to the “Library” (not sure why, but damn glad it works!). Result, all of the content is now back in Windows Media Player.

    • Unidentified Tracks

    Another search for (*Track*.*) [excuse the old DOS wildcards – but it works], gets all of the Unidentified Tracks.

    Fixing these is something I’m still trying to find an answer for. I’ve noting quick and easy to offer (at this point). I’ll continue to think about the problem, and post my solutions as I discover them.

    Is it “war” with Windows Media Player? I’m not sure you’d call it war, but it’s not peace, sweetness and light, either.

    Digg This

    , , , , , ,

    Leave a comment

    Linq To SQL – A bit of fun – Cataloguing my CD Collection


    I’ve been having a bit of fun with Linq to SQL and building some programs which will generate a catalogue of the CD’s I own. This journey has provided a couple of interesting lessons along the way. The most prominent I’ll share here.

    Data Model

    image I’ve settled on a very simple data model for the relational schema, which I’m storing in SQL Server Express (which seems to work without problems). The relational data model maps into the following Objects when using the ORM (Object Relational Mapping) features in Visual Studio.

    The data model has one big deficiency, it is designed to cater for my musical tastes which are modern (Artists do Albums). If one wanted a “classical” focused, or accommodating, data model, then there are a bunch of fields one would add to the Artist (Conductor maybe as a synonym for FullName in my model). To tell the truth, I’ve no idea what would need to be added. I would need to do some research, and talk with a classical music audiophile.

    Building the data model in Visual Studio is a snack. The relational (SQL) project gives all the functionality to build tables, define keys, define the referential integrity constraints (foreign keys). The Linq to SQL class object, is a snack to to work with, just drop the tables from the Server Explorer onto the design surface (the links get sucked up from the relational database tables.

    Loading the Data

    image

    I’ve explored beforehand how Windows Media Player stores albums in the file system. You have a structure as shown. Where the “Shared Music” is the root directory from which all Artists (as sub directories), then Albums (as sub directories) below the Artist, are stored.

    The major functional code in this part of the process is in the following two C# methods.

            private List<DirDetail> ReadDirectory(string rootDir)
    
            {
    
                List<DirDetail> retVal = new List<DirDetail>();
    
                foreach (string artistDir in Directory.GetDirectories(rootDir))
    
                {
    
                    retVal.AddRange(ReadAlbums(rootDir, artistDir)); 
    
                }
    
                return retVal;
    
            }
    
    
    
            private List<DirDetail> ReadAlbums(string rootDir, string artistDir)
    
            {
    
                List<DirDetail> retVal = new List<DirDetail>();
    
                foreach (string albumDir in Directory.GetDirectories(artistDir))
    
                {
    
                    DateTime created = Directory.GetCreationTime(albumDir);
    
                    ArtistAlbum Details = new ArtistAlbum(albumDir, rootDir);
    
                    retVal.Add(new DirDetail(Details.Artist, Details.Album, created)); 
    
                }
    
                return retVal;
    
            }
    
    
    

    The rest of the support object are pretty simple data container object. The use of the List<DirDetails> and AddRange is a particularly elegant way of acuminating, in a type safe manner, a result list of things which need to be squirted into the SQL data tables.

    The following two methods show how Linq to SQL makes loading to the database tables so simple.

            internal void Update(List<DirDetail> loadValues)
    
            {
    
                Guid unfiledLocation = GetUnfiledLocation();
    
                foreach (DirDetail LoadAlbum in loadValues)
    
                {
    
                    Guid ArtistID = GetArtistID(LoadAlbum.Artist);
    
                    InsertAlbum(unfiledLocation, ArtistID, LoadAlbum.Album, LoadAlbum.Loaded);
    
                }
    
            }
    
    
    
            private void InsertAlbum(Guid unfiledLocation, Guid ArtistID, string LoadAlbum, DateTime LoadDateTime)
    
            {
    
                var AlbumQuery = from Albums in ctx.Albums
    
                                     where Albums.Title == LoadAlbum 
    
                                     && Albums.ArtistID == ArtistID
    
                                     select Albums.AlbumID;
    
                foreach (var LoadedAlbumID in AlbumQuery)
    
                    return;
    
                Album newAlbum = new Album();
    
                newAlbum.AlbumID = Guid.NewGuid();
    
                newAlbum.ArtistID = ArtistID;
    
                newAlbum.DateLoadedToLibrary = LoadDateTime;
    
                newAlbum.LocationID = unfiledLocation;
    
                newAlbum.Title = LoadAlbum;
    
                ctx.Albums.InsertOnSubmit(newAlbum);
    
                ctx.SubmitChanges();
    
            }

    The “foreach/return” is a lazy way of  checking that the Album has not been loaded previously. Propagating the insert by just filling up the properties on the generated class and calling the “InsertOnSubmit”, “SubmitChanges” methods is just too simple. This old programmer appreciates the simplicity. No more building SQL statement, building parameters, getting the data binding right, many lines of code I did not have to write.

     

    Next in this series – Using Linq to SQL in a Winforms UI (I promise I’ll write it, there are a couple things which took a bit of figuring out in this end of Linq to SQL)

    Digg This

    , , , , ,

    Leave a comment

    %d bloggers like this: