def show_reinforcement(picture, sound, duration): system("mplayer " + sound + " >/dev/null 2>/dev/null &") #play_sound(sound) # this doesn't seem to work for some reason mw.splash = QSplashScreen(QPixmap(picture)) mw.splash.move(*flashPosition) mw.splash.show() mw.splash.move(*flashPosition) QTimer.singleShot(duration, mw.splash.close)
def show_multiple_reinforcements(*reinf_tuples): sounds = [tup[1] for tup in reinf_tuples] mplayer_commands = [ "(mplayer " + sound + " >/dev/null 2>/dev/null)" for sound in sounds ] command = "( " + " && ".join(mplayer_commands) + " ) &" system(command) # For now, only show the first picture picture = reinf_tuples[0][0] mw.splash = QSplashScreen(QPixmap(picture)) mw.splash.move(*flashPosition) mw.splash.show() mw.splash.move(*flashPosition) QTimer.singleShot(reinf_tuples[0][2], mw.splash.close)