kelvinlawson / pykaraoke

Cross-platform karaoke player: supports CDG (MP3+G, OGG+G, WAV+G), MIDI (.KAR, .MID) and MPEG formats
http://kibosh.org/pykaraoke
GNU Lesser General Public License v2.1
76 stars 30 forks source link

Unresponsive after playing a MIDI file without lyrics #10

Open kelvinlawson opened 12 years ago

kelvinlawson commented 12 years ago

Reported on mailing list by Pietro Battiston:

there are some MIDI files (I can provide an example only privately, since they are not free) for which, when played, PyKaraoke only shows the error "ERROR: Could not parse the MIDI file" and then, in another MessageDialog, the error "No lyrics in the track". Now, that would be fair to me... the only problem is that then, pykaraoke is stuck: not unresponsive, but it won't play any other file, and will print forever in the terminal: Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/pykaraoke.py", line 3815, in handleIdle position = self.Player.GetPos() File "/usr/lib/pymodules/python2.7/pykar.py", line 1072, in GetPos if self.useMidiTimer: AttributeError: midPlayer instance has no attribute 'useMidiTimer'

Interestingly, if I played some MIDI before trying to play the faulty one, then in the background that will play again, but without showing the lyrics (and i will not be able to stop it in any way).

You may think it is stupid to play faulty MIDI files, or MIDI files without lyrics... but when I have a huge library it's impossible to try all of them before, and then it's also annoying to have to restart the program (and loose the queue) any time a faulty one is chosen...

Maybe an alternative fix could be to (optionally) run some "validity check" on MIDI files when refreshing the library?

by the way, thanks for the nice app

Pietro