2

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.toAscii()+"&"); 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

Exa
  • 4,020
  • 7
  • 43
  • 60
yamuna mathew
  • 71
  • 1
  • 4

2 Answers2

1

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.

Blue Phoenix
  • 153
  • 11
1

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.

abesto
  • 2,331
  • 16
  • 28