Esempio n. 1
0
 def commandToggleRecord(self, schid, targetMode, toID, fromID, params=""):
     (error, clid) = ts3lib.getClientID(schid)
     (error, recording) = ts3lib.getClientVariableAsInt(schid, clid, ts3defines.ClientProperties.CLIENT_IS_RECORDING)
     if not recording:
         ts3lib.startVoiceRecording(schid)
     elif recording:
         ts3lib.stopVoiceRecording(schid)
Esempio n. 2
0
 def startVoiceRecording(self, schid):
     if self.hook:
         sendCommand(self.name,
                     "clientupdate client_is_recording=1",
                     schid,
                     mode=2)
     else:
         # ts3lib.setClientSelfVariableAsInt(schid, ts3defines.ClientProperties.CLIENT_IS_RECORDING, True)
         ts3lib.startVoiceRecording(schid)
Esempio n. 3
0
 def tick(self):
     if not self.schid or self.schid < 1: self.timer.stop()
     if self.hook:
         sendCommand(self.name, "clientupdate client_is_recording=1",
                     self.schid)
         sendCommand(self.name, "clientupdate client_is_recording=0",
                     self.schid)
     else:
         ts3lib.startVoiceRecording(self.schid)
         ts3lib.stopVoiceRecording(self.schid)
Esempio n. 4
0
 def onHotkeyOrCommandEvent(self, keyword, schid=0):
     if not schid: schid = ts3lib.getCurrentServerConnectionHandlerID()
     if keyword == "request_talk_power":
         (err, oldnick) = ts3lib.getClientSelfVariable(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME)
         ts3lib.setClientSelfVariableAsString(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME,
             self.tpr_name)
         ts3lib.flushClientSelfUpdates(schid)
         if self.hook:
             sendCommand(self.name, "clientupdate client_is_recording=1",
                         schid)
             sendCommand(self.name, "clientupdate client_is_recording=0",
                         schid)
         else:
             ts3lib.startVoiceRecording(schid)
             ts3lib.stopVoiceRecording(schid)
         ts3lib.setClientSelfVariableAsString(
             schid, ts3defines.ClientProperties.CLIENT_NICKNAME, oldnick)
         ts3lib.flushClientSelfUpdates(schid)