13 process
= os
.popen('pgrep vlc').readline()
15 return int(string
.strip(process
))
18 def getchannels(self
):
19 process
= os
.popen('tv lschan').readline()
21 channels
= map(string
.strip
, process
.split(","))
26 pid
= self
.is_running()
31 print "Sending SIGTERM to", pid
32 os
.kill(pid
,signal
.SIGTERM
)
34 def play_tv(self
, channel
):
35 pid
= self
.is_running()
37 print "Another mplayer is running with pid", pid
40 q
= "tmux neww '/home/honza801/bin/tv "+channel
+"'"
45 if not os
.path
.isfile(file):
47 pid
= self
.is_running()
49 print "Another mplayer is running with pid", pid
52 q
= "tmux neww '/home/honza801/bin/tv \""+file+"\"'"
57 class VolumeController
:
59 def __init__(self
, mixdevice
='Master'):
60 self
.mixdevice
= alsaaudio
.Mixer(mixdevice
)
63 return self
.mixdevice
.getvolume()
66 newvol
= int(self
.mixdevice
.getvolume()[0])+10
69 self
.mixdevice
.setvolume(newvol
)
72 newvol
= int(self
.mixdevice
.getvolume()[0])-10
75 self
.mixdevice
.setvolume(newvol
)
77 class MonitorController
:
80 ret
= os
.system("m on")
84 ret
= os
.system("m off")
88 if __name__
== "__main__":
89 mpc
= VideoController()