Ah... magic numbers.. gotta love 'em
Not really a magic number in this case.. more like a bug that I'm taking advantage of.
Back when the CD version was first released, Album was the default sort, as sorting into albums was naturally part of the process. An option to randomize the albums after they were sorted was added. Well, no one liked the default sort so I added a step to resort by artist. I added an IF statement to cover the new sort. My error was changing the symbol from Album to Artist rather than adding a new symbol
So here I have two IF statements and two symbols. If you pass something that is not a valid symbol, neither re-sort is performed and everything is left in the original album sort.
Now at some point I went back and added checks to the configuration reader to prevent invalid options from being passed, but somehow I missed adding the check to SongSort. So 3 isn't a magic number so much as an invalid one. Thus, for 3.1.5, I simply added "ALBUM" back to the symbol table and fixed the check on SongSort.
All of the symbols translate to "magic numbers" internally, and ALBUM does happen to translate to 3. More than one symbol can translate to a particular value which is handy; you don't have to guess if I use the spelling "gray" or "grey", or "color" or "colour", since both spellings are in the symbol table pointing to the same values. Likewise, "Yes", "True", and "Enabled" all mean 1, and "No", "False", "None", and "Disabled" all mean 0. I use a similar system for colors, allowing you to use "White" instead of #FFFFFF, etc.
So, that'll do for now Chris (Ta!)... although I still look forward to 3.15 to test it and other goodies again.
Not a lot of "goodies" in 3.1.5, mostly just bug fixes. Here's the change list:
- Added a new default cover art image.
- Added a basic internal constructed cover art image if default image is missing.
- Added a symbol for Album sort.
- Added an AUTO setting for DefaultArtCacheMB to allow different defaults in DOS and Windows.
- Added ability to map mouse buttons to controls.
- Changed default art cache to 32MB in Windows. Default for DOS is still 4MB.
- Changed random song select to only use the Random Popularity Preference setting if top quarter of songs have more than one play each.
- Changed product name to DWJukebox.
- Fixed crash of jukebox on invalid CD art images, including JPG files missing a JFIF header.
So, that'll do for now Chris (Ta!)... although I still look forward to 3.15 to test it and other goodies again.
Fair enough... I threw the latest build at
http://dwjukebox.com/releases/dwj30105b.zip if you want to try it. It's just the executables and docs, so it needs to be unZipped over a 3.1.4 installation.
--Chris