Burning Desire

After actually building something for the first time in a while, I spent some time last night researching other stuff I want to write. One of the things I’m thinking about building is a WMA to Audio CD burning program. Of course, WMP9 (and many other programs) does this today. However, there’s one specific feature I need and it doesn’t appear to be one of the more standard ones.

Pretty soon, we’re going to make the Architecture Strategy Series content available for download. For each presentation, we’re going to provide the slides, the full Producer presentation, and a WMA file suitable for burring to CD. We’re even using the Windows Media Time Compression technology to get all the sessions under 80 minutes so they fit on CD. However, when you burn the file, it creates basically one long track, making it difficult to move back and forth within the presentation. I could break it into separate files per track, but that’s a pain. At least with one big file, there’s no chance of getting it out of order.

The Windows Media Format supports named markers. My burning program could build multiple tracks, based on those markers. Other audio players or CD burners would just ignore those markers. That way you get one file to download, but multiple tracks when you burn – the best of both worlds.

However, I have precious little time to dedicate to such a project, primarily as I have higher priority projects to build first. Additionally, I’d have to write it in C++ due to the lack of managed support for the various APIs and SDKs I would need. (Windows Media Format SDK to read audio file and the Image Mastering API to create the audio CD) So I gotta wonder if this capability already exists somewhere? Are there commonly-available tools that can use either named markers or a playlist file to create multiple tracks from on audio file? I’d hate to reinvent the wheel if I didn’t need to.

Build Slide Export

I blogged yesterday about the issues I’m having with manually repurposing content. One of the specific issues has to do with the Architecture Strategy Series. We provide that content via three channels – DVD, online seminars and (soon) download. We use Producer to create the DVD and download files. However, online seminar system doesn’t support Producer. The primary issue is that Producer uses the Save as HTML version of the PPT, but the online seminar system only supports static images. This means having to manually strip out the animations, which is a pain in the ass. Since I don’t ever want to have to do that again, I wrote a PowerPoint add-in to do it for me.

When you invoke the Build Slide Export add-in , it will step thru your presentation and screen capture each slide build to disk. It’s very similar to the built in Save as JPEG/GIF/PNG feature, except that it creates an image per build, not per slide. So those complex build slides turn out multiple image files. It’s sort that you can’t use the machine for anything else while it’s processing, but it was really easy to write the code. I tested it on a long complex PPT file with lots of builds (i.e. the one that took me hours to repurpose on Monday) and it took about 10 minutes.

I’m also providing the source to the add-in. It’s not much code: maybe 150 lines of relevant code at most. I grabbed the screen capture code from Perry Lee on C# Corner.

There were a couple of gotchas involved with this add-in. For example, the add-in project type uses version 7.0 of the office.dll that comes with VS.NET. However, Office 2003 comes with version 11.0 of that DLL and not 7.0, so the first time I went to deploy on my production machine, it didn’t work. I had to grab the right version of office.dll out of the GAC in order to reference it, so it’s included in the lib directory of the source archive (it looks like Simon did something similar with Niobe). Also, PowerPoint’s object model is a little funky. Specifically, SlideShowView.Next() has to be called differently depending on the types of builds in the slides. I handle four different scenarios in the code: no builds, only auto trigger builds, and manual trigger builds, optionally with a set of auto trigger builds before the first manual trigger build.

I’m sure there’s other enhancements that could be made – for example, the directory the images are saved isn’t selectable nor is the image format. If there’s any interest, I’ll spin up a GDN workspace.

Update: I just noticed a bug, albiet a cut-and-paste bug on my part. Turns out the screen capture code that I used is creating four image objects for each screen capture. To make matters worse, three of them are never assigned to a variable, so you can’t call Dispose() on them. So for any real-sized presenation, memory usage goes thru the roof. It’s relatively easy to fix. Take the code that looks like this:

Bitmap image = new Bitmap(
    Image.FromHbitmap(new IntPtr(hBitmap)),
    Image.FromHbitmap(new IntPtr(hBitmap)).Width,
    Image.FromHbitmap(new IntPtr(hBitmap)).Height);
image.Save(fileName,imageFormat);

And replace it with this:

Bitmap image = Image.FromHbitmap(new IntPtr(hBitmap));
image.Save(fileName,imageFormat);
image.Dispose();

With the improved code, only one bitmap per screen capture is made, and it’s explicitly disposed. That keeps memory usage under control.

Another Update: I’ve updated the binary and the code links above with the new v1.0.1 version that fixes the memory hogging problem.

Looking for SPSynd Volunteers

I had eight people waiting to be admitted to the SharePoint Syndication GDN Workspace. Sorry for the delay folks – my workspace was maxed out on users and I had to get upgraded by GDN. Anyway, I’ve been given more membership slots, so the people who’ve been waiting – some since January – are now in.

There has been a lot of interest in this project and others like it. Jonathan Malek has his SpsRssGen project. Sig Weber has an RSS Generator for SPS. All in all, there is quite a bit of interest in this developing for SharePoint in general and creating syndication feeds in particular. Too bad I can’t get more involved. With my new job, I just don’t have the time to work on this project anymore. 😦

Since I can’t keep the project up, I’m wondering if someone else would like to take up the reins. I posted all the code to the workspace, but so far there’s been little traffic other than people wanting to join. I was hoping for more participation, but then I haven’t done anything to foster that so I really can’t complain. So let me ask explicitly: If you’re interested in being an admin on this project, please send me email. Once I get an admin (or two) and a core group of interested developers, I’ll start hosting chats / email lists / live meetings / conference calls / smoke signals / whatever to discuss the project direction. Personally, my #1 feature is an admin interface for creating the syndication feeds integrated directly into the existing SharePoint admin interface. Not sure how doable that is, but let’s find out. After that, I’m open to suggestions as to project direction.

URL Addressability

In a meeting with Ward the other day, he brought up the importance of URL addressability in the context of a project we are working on. I’ve run into this issue twice recently.

  • We just posted the streaming content for The Architecture Strategy Series on the MSDN Architecture Center. While I can link directly to the sessions, there’s a script on that page that pops the session up in it’s own window and checks what version of Media Player you have installed. If I link directly, the window resizes wrong and you don’t get video with the audio. So I end up linking to the series page instead.
  • TechEd just posted their list of breakouts, including the session I’m delivering. However, I can only link to the overall breakout page, not to my specific session. If you want to see my session, you can filter by speaker.

Suffice to say, I’ll be considering URL addressability from now on in anything I have a hand in developing in the future.

Service Oriented Language

I like Jeff’s suggestions for a Service Oriented Lanugage as well as RebelGeekz’ idea of how to include XML Infoset information in a language without resorting to angle brackets. I wonder what a community developed lanugauge would look like? I’ve experimented with Coco/R which really reduces the effort it takes to build a parser. Of course, the language design and code generation are the hard parts!

Source for Coco/R is available on the Rotor Community Projects page. Other cool projects include a port of Rotor to WinCE, two different AOP projects – one for C# and the other language neutral and a set of improved collections.