Woohoo Microsoft

SirPoonga

Shared on Mon, 08/11/2008 - 17:16

This is probably not going to interest many people on the site and it will show how much of a geek I am. Visual Studio 2008 service pack 1 came out today. Also .NET 3.5 SP1 came out. This also includes SQL Server Compact Edition service pack 1.

I have a really good reason to be happy about it though. At work we've been moving from Visual Basic 6.0 (yuck!) to C#, .NET 3.5, WPF. To help learn this newer technology quicker I've come up with a project to do at home. One thing I want to do is take an old 50s wood radio and make it a modern mp3 jukebox. I want to find something like the following where I don't have to change the outside. I can put a touchscreen in place of the turntable.

There's jukebox software out there already, but I am going to make my own. I don't learn well by just reading a book. I need a project, a reason to use the stuff. This projectis perfect and will have stuff that is analogous to the business world.

So, why I am excited about these service packs. There's something with SQL Server Compact that has been annoying me, it had no TOP command. I am using SQL Server Compact because then I don't have to install anything extra. It's part of .NET 3.5. Yeah, it's limitted but I am not making a business application. I just need to keep track of songs. It's a simple database. What TOP does is limit the amount of data that is returned. Sometimes you don't need everything. I have such a case.

Take a look at the following screenshot. I am working on how to do the song selection. The following screenshot show the albums in order of artists. I only have one database table which stores all the songs. To make that screenshot I ask for the unique artist/album combinations from that table. Basically in return I get a list of all the albums, no song information. However, to get the cover art I need to get it from one of the mp3s. Before the service pack there was no way to ask for a single song that matches the album and artist. Currently I just take the first song in the list that is returned and use that mp3 to get the cover art. However, returning all of those songs takes up memory and extra processing cycles. Now with TOP being supported I can have the database return only the first song (Top 1) instead of all the songs in the album. With today's computers you won't see a difference in a small change like this. But I think most of today's programmers have become lazy. Doing a bunch of small improvements like this will affect the system as a whole.

(Click for actual size)

Interesting tidbit. The look and feel is programmed using WPF (Windows Presentation Foundation). This is a new thing Microsoft is introducing. It;s what Vista's interface is programmed in. It's vector based which basically means it will look the same at any resolution. That window is 800x600 but the contents are in a 640x480 box that is being stretched. doesn;t looked stretched, does it? That's vector graphics for you.

Comments

microscent's picture
Submitted by microscent on Mon, 08/11/2008 - 17:23
You could sell those jukeboxes to "high end" users if they looked as good as the pic. The rest is Greek to me. ;)
hudsmack's picture
Submitted by hudsmack on Mon, 08/11/2008 - 17:34
With the earlier versions of the SQL CE, you can use the SetRange method in lieu of TOP or LIMIT. It also seems like you would be adding a little bit of overhead to the application using SQL CE. Why not just use the ID3 information already embedded in the MP3 files? There are some inexpensive sorting algorithms in the .NET Framework that would make this pretty snappy. With a limited screen size, you wouldn't need to keep that much info in memory.
SirPoonga's picture
Submitted by SirPoonga on Mon, 08/11/2008 - 18:06
What do you mean about using the information in the ID3 files? I can query the filesystem? I am using SQL CE so I can bind the controls to the data. The database is filled by processing the the ID3 tags. I saw SetRange, but that doesn't look like it will work. It looks like you need to know what the first item is going to be.
hudsmack's picture
Submitted by hudsmack on Mon, 08/11/2008 - 18:12
Build the Dataset in memory from the ID3 tags and bind the controls to the Dataset. You in essence are cutting out the middle man.
SirPoonga's picture
Submitted by SirPoonga on Mon, 08/11/2008 - 19:02
That's what I am doing though. I am building a dataset off a database query. I am currently not storing the image n the database, so that I have to get from one of the mp3s. I am grabbing that if I need it. When something want's the cover i check to see if there is one. If not i find and mp3 and set the cover, that way i is there for later use. Are you saying put the entire database table into dataset? Can I filter a dataset to then just show albuns? .NET is new to me so I am learning this stuff. if I can do that then that makes more sense. Yeah, it uses more memory but it would be faster.
hudsmack's picture
Submitted by hudsmack on Mon, 08/11/2008 - 19:05
Send me a PM, I'll send you an email with a class structure and some threading work to give you an overall idea. You shouldn't have to change the UI, you could wire it up to this structure and just cut out the SQL CE.
Teufelhunden11's picture
Submitted by Teufelhunden11 on Mon, 08/11/2008 - 19:30
What I got from that...Blah,blah, blah....I want to turn an old turntable into an MP3 jukebox.... Much respect for your awesome knowledge of technology Poonga
SirPoonga's picture
Submitted by SirPoonga on Mon, 08/11/2008 - 19:32
Teufel, did I not warn you with the first sentence? I did provide pretty pictures for the less fortunate, though.
Lala Calamari's picture
Submitted by Lala Calamari on Mon, 08/11/2008 - 19:55
Your right, you are a Geek! ;)
VenomRudman's picture
Submitted by VenomRudman on Tue, 08/12/2008 - 10:40
Good luck finding an old turntable that's not outrageously priced. Your best bet would be to go to a lot of estate and garage sales.
SirPoonga's picture
Submitted by SirPoonga on Tue, 08/12/2008 - 10:53
Venom, yeah, i am watching garage sales. I want to find one that isn't working. Working models are insanely expensive. If I found a good woodworker I'd have him make something.

Join our Universe

Connect with 2o2p