The original intent of the code was correct in not letting the user play a song when there were no tracks unmuted. This would cause a win32 api call crash if that were the case.
I improved the usability of that section both in the code and on the program by popping a message box telling the user how to fix it if there is a problem with the muting.