Tuesday, July 22, 2008

Making directories

Twice in the past month I've had great frustration because of tools that would create a file given a non-existent filename, but would not create the directory structure necessary to hold the file, if it didn't exist.

First off, the Ogg Vorbis encoder provided by RareWares is capable of auto-creating directories if they're specified in the output path. However, the Lame encoder, also provided by RareWares, does not. The directory needs to be created manually first if it doesn't exist, before a file can be written there.

I had the same issue with Perl's open() procedure. It will create a file that doesn't exist, but the directory has to be there already.

I know it's good practice to check for these things, but it's still annoying, chasing down an error like that.

Wednesday, July 9, 2008

MarqueeAnimationSpeed

I was having issues with a progress bar that was set to Marquee style. It was moving at a pretty good rate, and setting the MarqueeAnimationSpeed value seemed to have no effect. Turns out that you need to specify the speed before you set the ProgressBar to Marquee. In my case, the working code looks like this:


encodeProgress->MarqueeAnimationSpeed = 35;
encodeProgress->Style = ProgressBarStyle::Marquee;


I imagine that's the exact problem that this person had. It's a shame Microsoft didn't figure out what the person had done.