Esempio n. 1
0
def ToggleRecording(BUTTONCONF):
	RecordOn = True
	try:
		#Here we try to turn the recording on
		if str(ws.call(requests.StartRecording())) != "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>":
			print("Recording started")
			RecordOn = False
			#Here we turn the Led on the midi pad on
			try:
				if "Led" in BUTTONCONF:
					if "LedMode" in BUTTONCONF:
						midi_out.write_short(0x90, BUTTONCONF["Led"], BUTTONCONF["LedMode"])
					else:
						print("No LedMode argument in Button config")
				else:
					print("No Led argument in Button config")
			except:
				pass
	except:
		pass
	#Here we try to turn the recording off if the first try failed
	if RecordOn == True:
		try:
			ws.call(requests.StopRecording())
			print("Recording stopped")
			#Here we turn the Led on the midi pad off
			try:
				if "Led" in BUTTONCONF:
					midi_out.write_short(0x90, BUTTONCONF["Led"], 0)
				else:
					print("No Led argument in Button config")
			except:
				pass
		except:
			print("Recording couldn't be toggled")
Esempio n. 2
0
    async def start_(self, ctx: Context):
        """
            Начало трансляции. Аналог resume но без подсчёта зрителей

            %%start
        """
        if not self.bot.check_sender(ctx, 'iarspider'):
            asyncio.ensure_future(
                ctx.send('/timeout ' + ctx.author.name + ' 1'))
            return

        # self.get_player()
        # self.player_play_pause()

        if self.ws is not None:
            if self.vr:
                self.switch_to('VR Game')
                self.ws.call(
                    obsws_requests.SetMute(self.aud_sources.getMic2(), False))
            else:
                self.switch_to('Game')
                self.ws.call(
                    obsws_requests.SetMute(self.aud_sources.getMic1(), False))
            self.ws.call(obsws_requests.SetMute(True, 'Радио'))

        self.ws.call(obsws_requests.StartRecording())
Esempio n. 3
0
def recordingControl(address):
    controlType = removePrefix(address, '/recording/')
    if controlType == 'start':
        ws.call(requests.StartRecording())
    elif controlType == 'stop':
        ws.call(requests.StopRecording())
    elif controlType == 'toggle':
        ws.call(requests.StartStopRecording())
Esempio n. 4
0
    def set_record(self, val=None):
        if val is None:
            val = not self.connection.call(
                requests.GetStreamingStatus()).getRecording()

        if val == True:
            self.connection.call(requests.StartRecording())
        else:
            self.connection.call(requests.StopRecording())
Esempio n. 5
0
def TurnRecordingOn():
    try:
        Response = str(ws.call(requests.StartRecording()))
    except:
        PrintError("Recording can't be turned on")
    else:
        if Response == "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>":
            PrintError("Recording can't be turned on")
        else:
            MidiLed(Action, "on")
            PrintWithTime("Recording started")
Esempio n. 6
0
def ToggleRecording(Action, ws, midi_out):
    try:
        Response = str(ws.call(requests.StartRecording()))
    except:
        print("Recording can't be toggled")
    else:
        if Response == "<StartRecording request ({}) called: failed ({'error': 'recording already active'})>":
            try:
                ws.call(requests.StopRecording())
            except:
                print("Couldn't turn recording off")
            else:
                MidiLed(Action, "off", midi_out)
                PrintWithTime("Recording stopped")
        elif Response == "<StartRecording request ({}) called: success ({})>":
            MidiLed(Action, "on", midi_out)
            PrintWithTime("Recording started")
        else:
            print("Couldn't toggle recording")
Esempio n. 7
0
 def rec_cb(values):
     if values > 0.0:
         self.client.call(requests.StartRecording())
     else:
         self.client.call(requests.StopRecording())
     self.osc.answer('/rec', [values])
Esempio n. 8
0
 def StartRecording(self):
     try:
         self.ws.call(requests.StartRecording())
     except Exception as e:
         print(e)
Esempio n. 9
0
    def start_record(self):
        if self.is_recording():
            return True

        res = self._call(requests.StartRecording())
        return res.status
Esempio n. 10
0
mouse_listener.start()


def on_press(key):
    add_time_to_deque()


def on_release(key):
    add_time_to_deque()


keyboard_listener = keyboard.Listener(on_press=on_press, on_release=on_release)
keyboard_listener.start()

if __name__ == "__main__":
    ws.call(requests.StartRecording())

    while True:
        time.sleep(1)
        if checkIfDequeTimeLargerThanCurrentTimeBy(5):
            isInMoving = False
        else:
            isInMoving = True

        print(isInMoving)

        if isInMoving:
            ws.call(requests.ResumeRecording())
        else:
            ws.call(requests.PauseRecording())
Esempio n. 11
0
 def StartRecording(self, *args):
     return self.ws.call(requests.StartRecording())
Esempio n. 12
0
async def start():
    myOBScall(requests.StartRecording())
    return {"message": "done"}
Esempio n. 13
0
 def Recording_Start(self, *args, **kwargs):
     try:
         self.ws.call(requests.StartRecording())
         PrintWithTime(f"Started recording")
     except Exception as e:
         PrintWithTime(f"Couldn't start recording. Error : {e}")