hello friends i am playing mplayer from my qt application using the play button....i have two more buttons called pause and stop....in play button i used system ("mplayer "+s.toAsci开发者_运维百科i()+"&"); where s is the playlist.
In the pause button i used system("p"); but it is not working. I am able to store the process id of mplayer to a text file using system("ps -A |grep mplayer > PID.txt");. Is there any command to stop and pause the mplayer using the PId....?
Thanks in Advance
Not with PID as far as I know. However, check out slave mode (-slave). From man mplayer:
This option switches on slave mode. This is intended for use of MPlayer as a backend to other programs. Instead of intercepting keyboard events, MPlayer will read simplistic command lines from its stdin. The section SLAVE MODE PROTOCOL explains the syntax.
In slave mode, you can send
"pause\n"
to pause and resume. First time you send then it will pause and the second time sending will resume the playing.
精彩评论