Exemplo n.º 1
0
def streamingControl(address):
    controlType = removePrefix(address, '/streaming/')
    if controlType == 'start':
        ws.call(requests.StartStreaming())
    elif controlType == 'stop':
        ws.call(requests.StopStreaming())
    elif controlType == 'toggle':
        ws.call(requests.StartStopStreaming())
Exemplo n.º 2
0
    def set_stream(self, val=None):
        if val is None:
            val = not self.connection.call(
                requests.GetStreamingStatus()).getStreaming()

        if val == True:
            self.connection.call(requests.StartStreaming())
        else:
            self.connection.call(requests.StopStreaming())
Exemplo n.º 3
0
def ToggleStream(BUTTONCONF):
    #Here we check whether or not the stream is on
    StreamingState = True
    try:
        StreamingState = ws.call(requests.GetStreamingStatus())
        StreamingState = StreamingState.getStreaming()
    except:
        print("Couldn't get streaming status")

    if StreamingState == True:
        try:
            #Here we turn the stream off
            ws.call(requests.StopStreaming())
            #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
            #Here we wait for the stream to be turned off
            while StreamingState == True:
                try:
                    StreamingState = ws.call(requests.GetStreamingStatus())
                    StreamingState = StreamingState.getStreaming()
                except:
                    print("Couldn't get streaming status")
            print("Stopped Streaming")
        except:
            print("Couldn't stop stream")
    else:
        try:
            #Here we turn the stream on
            ws.call(requests.StartStreaming())
            #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
            #Here we wait for the stream to be turned on
            while StreamingState == False:
                try:
                    StreamingState = ws.call(requests.GetStreamingStatus())
                    StreamingState = StreamingState.getStreaming()
                except:
                    print("Couldn't get streaming status")
            print("Started Streaming")
        except:
            print("Couldn't start stream")
Exemplo n.º 4
0
def OBS_StopStreaming():
    ws = obsws(host, port, password)
    try:
        ws.connect()
    except:
        return 1,"Error de Conexion - ¿OBS Parado?)"
    falcon_logger.info("Parando Streaming")
    ws.call(requests.StopStreaming())
    ws.disconnect()
    falcon_logger.info("Streaming Parado")
#    Mata_Proceso("obs")
#    falcon_logger.info("OBS Matado")
    return 0,"Ok"
Exemplo n.º 5
0
def ToggleStream(Action, ws, midi_out):
    #Here we check whether or not the stream is on
    try:
        StreamingState = ws.call(requests.GetStreamingStatus())
        StreamingState = StreamingState.getStreaming()
    except:
        print("Couldn't get streaming status")
    else:
        if StreamingState == True:
            try:
                #Here we turn the stream off
                ws.call(requests.StopStreaming())
            except:
                print("Couldn't stop stream")
            else:
                #Here we turn the Led on the midi pad off
                MidiLed(Action, "off", midi_out)
                #Here we wait for the stream to be turned off
                while StreamingState == True:
                    try:
                        StreamingState = ws.call(requests.GetStreamingStatus())
                        StreamingState = StreamingState.getStreaming()
                    except:
                        print("Couldn't get streaming status")
                        break
                PrintWithTime("Stopped Streaming")
        else:
            try:
                #Here we turn the stream on
                ws.call(requests.StartStreaming())
            except:
                print("Couldn't start stream")
            else:
                #Here we turn the Led on the midi pad on
                MidiLed(Action, "on", midi_out)
                #Here we wait for the stream to be turned on
                while StreamingState == False:
                    try:
                        StreamingState = ws.call(requests.GetStreamingStatus())
                        StreamingState = StreamingState.getStreaming()
                    except:
                        print("Couldn't get streaming status")
                        break
                PrintWithTime("Started Streaming")
Exemplo n.º 6
0
def TurnStreamOff(Action):
    try:
        #Here we turn the stream off
        ws.call(requests.StopStreaming())
    except:
        PrintError("Couldn't stop stream")
    else:
        #Here we turn the Led on the midi pad off
        MidiLed(Action, "off")
        #Here we wait for the stream to be turned off
        StreamingState == True
        while StreamingState == True:
            try:
                StreamingState = ws.call(requests.GetStreamingStatus())
                StreamingState = StreamingState.getStreaming()
            except:
                PrintError("Couldn't get streaming status")
                break
        PrintWithTime("Stopped Streaming")
Exemplo n.º 7
0
 def stream_cb(values):
     if values > 0.0:
         self.client.call(requests.StartStreaming())
     else:
         self.client.call(requests.StopStreaming())
     self.osc.answer('/stream', [values])
Exemplo n.º 8
0
 def StopStreaming(self):
     try:
         self.ws.call(requests.StopStreaming())
     except Exception as e:
         print(e)
 def stop_stream(self):
     logging.info("OBS command: stop stream.")
     return self.ws_call(requests.StopStreaming())
Exemplo n.º 10
0
def stop_stream():
    ws.call(requests.StopStreaming())
Exemplo n.º 11
0
        #    time.sleep(2)
        print("Started Command Processing")
        if command == "Start Streaming Bool":
            if getStreamStatus == False:
                if currentScene == destinationScene:
                    print("Already running on the correct scene: Starting Stream")
                    ws.call(requests.StartStreaming())
                else:
                    print("Setting scene to destination and starting stream")
                    ws.call(requests.SetCurrentScene(destinationScene))
                    time.sleep(2)
                    ws.call(requests.StartStreaming())
            else:
                print("Stream already running. Command halted.")
        elif command == "Stop Stream":
            ws.call(requests.StopStreaming())
        elif command == "Start Stream":
            ws.call(requests.StartStreaming())
        elif command == "Switch Scene":
            if enableOverride == "True" or getStreamStatus == False:
                ws.call(requests.SetCurrentScene(destinationScene))
            elif enableOverride == "False":
                print("Override is not enabled.")  
        
        print("End of list")

    except KeyboardInterrupt:
        pass

    ws.disconnect()
Exemplo n.º 12
0
    def stop_stream(self):
        if not self.is_streaming():
            return True

        res = self._call(requests.StopStreaming())
        return res.status
Exemplo n.º 13
0
 def Streaming_Stop(self, *args, **kwargs):
     try:
         self.ws.call(requests.StopStreaming())
         PrintWithTime(f"Stopped streaming")
     except Exception as e:
         PrintWithTime(f"Couldn't stop streaming. Error : {e}")