First post, by ElBrunzy
- Rank
- Oldbie
Hi, I think my question need a bit of context first. I enjoy using some music players under dos since they bring all kind of niceties that is sometimes lost under windows. We cannot reproach those authors not to have included a playlist support as it is easier said than done. So those who made batch file playlist might get a hint at where I am going at. What is the best way to exit that batch in between each program call.
Let say we use Gravis playmidi to illustrate the problem, I think that player even load patches before it check to skip the music, so people would ctrl-alt-del in despair to exit such playlist.
playlist.bat content:
C:\ultrasnd\playmidi.exe C:\midi\music1.mid -video
CALL checkKeyPress
C:\ultrasnd\playmidi.exe C:\midi\music2.mid -video
CALL checkKeyPress
C:\ultrasnd\playmidi.exe C:\midi\music3.mid -video
CALL checkKeyPress
C:\ultrasnd\playmidi.exe C:\midi\music4.mid -video
goto :EOF
:checkKeyPress
CHOICE /C YN /M "exit playlist Y/n?" /D N /T 1
IF %ERRORLEVEL% EQU 1 goto:EOF
exit /B
I've drafted this with no testing, it probably wont work but it's to illustrate what I have in mind. What bother's me the most here is that I would like not to introduce a 1 second pause in between two song and just scan if a key is pressed and abort the playlist batch in that case. From the doc, "/T 0" on CHOICE would only select default choice. I would prefer to avoid calling a third party program to handle keypress. Do not forget that it is for command.com and most niceties from cmd.exe are not present, that being said, I am very bad a command.com batch files so it is possible I miss something very obvious and I would appreciate any input. I think hammering ctrl-c/break do not work so well in that case also it remove the opportunity to end the batch and get back the the playlist editor that way.
Thanks for your time, I'm eager to read your suggestions.