2 *** These modified files were found in JOE when it aborted on Fri Sep 23 20:31:28 2016
3 *** JOE was aborted because the terminal closed
8 *** Файл 'mqtt_pulse.py'
11 from pulsectl import Pulse,PulseLoopStop
19 paLock1=threading.RLock()
20 paLock2=threading.RLock()
25 pulse = Pulse("mqtt-pa")
32 return pulse.server_info().default_sink_name
35 sinkname=GetDefaultOut()
36 for sink in pulse.sink_list():
37 if sink.name==sinkname:
40 def GetDefaultVolume():
41 return pulse.volume_get_all_chans(GetDefaultSink())
44 return GetDefaultSink().mute<>0
46 def MuteDefault(mute = True):
47 return pulse.mute(GetDefaultSink(),mute)
49 def EventListener(callback):
50 pulse.event_mask_set('all')
51 pulse.event_callback_set(callback)
60 pulse.event_listen_stop()
68 global sink_name,muted,volume
70 tname=threading.current_thread().name
71 # print tname+">trying to aquire lock"
73 # print tname+">lock aquired"
74 current_sink=GetDefaultOut()
75 current_vol=round(GetDefaultVolume(),2)
76 current_muted=IsDefaultMuted()
77 if current_sink<>sink_name:
78 sink_name=current_sink
79 print tname+">sink: "+sink_name
80 if current_vol<>volume:
82 print tname+">volume: "+str(volume)
83 if current_muted<>muted:
85 print tname+">muted: "+str(muted)
88 # print tname+">lock released"
92 # print "entering wait loop"
93 EventListener(EventProcess)
94 # print "event or break happened"
97 def RunBackground(process):
99 thread = threading.Thread(target=process,name="Background")
102 def StopBackground():
105 pulse.event_listen_stop()
107 def CommandGetDefaultOut():
109 tname=threading.current_thread().name
110 # print tname+">trying to aquire lock"
112 # print tname+">lock aquired"
113 result=GetDefaultOut()
116 # print tname+">lock released"
119 def CommandGetDefaultVolume():
121 tname=threading.current_thread().name
122 # print tname+">trying to aquire lock"
124 # print tname+">lock aquired"
125 result=GetDefaultVolume()
128 # print tname+">lock released"
131 def CommandIsDefaultMuted():
133 tname=threading.current_thread().name
134 # print tname+">trying to aquire lock"
136 # print tname+">lock aquired"
137 result=IsDefaultMuted()
140 # print tname+">lock released"
143 *** Файл '* Startup Log *'
144 Processing '/etc/joe/joerc'...
145 Processing '/etc/joe/ftyperc'...
146 Finished processing /etc/joe/ftyperc
147 Finished processing /etc/joe/joerc