Steve I think you've made an excellent choice going with Bass, I love the new music engine. No codecs to install, cross-fading etc all make for a much better music portion of MP.
I've always made a one line mod to the previous code to allow playback through a second sound card, for those who've done similar and want to do the same with the new engine place the following before the call to Bass.BASS_Init in MediaPortal.Player.BassAudioEngine:
Code:int device = -1; for(int index = 0; index <= Bass.BASS_GetDeviceCount(); index++) { string description = Bass.BASS_GetDeviceDescription(index); Log.Write("Device: {0},'{1}'", index, description); if (string.Compare(description, "Sonica", true) == 0) { device = index; break; } }
Then change
Code:if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT | BASSInit.BASS_DEVICE_LATENCY, 0, null)) { ...
to
Code:if (Bass.BASS_Init(device, 44100, BASSInit.BASS_DEVICE_DEFAULT | BASSInit.BASS_DEVICE_LATENCY, 0, null)) { ...
finally run the code, check the log file for the index of the device you want to use and replace 'Sonica' above with the correct description, recompile and you'll be all set.
Note: The above is for people who don't mind fiddling with the code only, don't bug Steve about it or expect to get control over volume (I'm more than happy to control mine via my amp's remote) etc.
Looking forward to seeing what other nice things Steve has planned for us .
Steve,
I'm playing with the SVN for 2 days now, and you just made a great job with the music engine!
Two comments:
About the crossfade:
I suggest two seperate configuration bars, one for "fade-in time (seconds)" and one for "fade-out time (seconds)".
Why? because most of the songs (at least those I listen to...) are already fading out natively. Starting the second song, with little or no fade-in at all, while the first song still fades out, sounds smoother... That's what I do today with WinAmp.
About the ReplayGain support I mentioned before, I think you already have almost everything needed to support RG in place:
1. You already have a (great) tag reader; you just need to look for (in tags) for RG tags (and put them in the "song" table in Music DB). and, of course... put the new tag reader in the SVN ;-)
2. You already control the volume (gain) of songs and even do crossfading... So you just need to connect 1+2 together (with simple DB to scale/percentage calculation) - and here's your ReplayGain support ;-)
Please note, that your code DOES NOT need to calculate ReplayGain values; just apply a given gain (read from tags). Users can use other applications (such as Foobar2000) for ReplayGain calculations & tagging.
Thanks again!