Exemple #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")
Exemple #2
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())
Exemple #3
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())
Exemple #4
0
def TurnRecordingOff():
    try:
        Response = str(ws.call(requests.StopRecording()))
    except:
        PrintError("Recording can't be turned off")
    else:
        if Response == "<StopRecording request ({}) called: success ({})>":
            MidiLed(Action, "off")
            PrintWithTime("Recording stopped")
        else:
            PrintError("Recording can't be turned off")
Exemple #5
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")
Exemple #6
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])
Exemple #7
0
 def StopRecording(self):
     try:
         self.ws.call(requests.StopRecording())
     except Exception as e:
         print(e)
Exemple #8
0
    def stop_record(self):
        if not self.is_recording():
            return True

        res = self._call(requests.StopRecording())
        return res.status
Exemple #9
0
 def StopRecording(self, *args):
     return self.ws.call(requests.StopRecording())
Exemple #10
0
async def stop():
    myOBScall(requests.StopRecording())
    return {"message": "done"}
Exemple #11
0
 def Recording_Stop(self, *args, **kwargs):
     try:
         self.ws.call(requests.StopRecording())
         PrintWithTime(f"Stopped recording")
     except Exception as e:
         PrintWithTime(f"Couldn't stop recording. Error : {e}")