Пример #1
0
    def panCB(self, msg):
        """Called when a /live/pan message is received.

        Messages:
        /live/pan     (int track)                            Returns the pan of track number track as: /live/pan (int track, float pan(-1.0 to 1.0))
        /live/pan     (int track, float pan(-1.0 to 1.0))     Sets track number track's pan to pan

        """
        if len(msg) == 4:
            track = msg[2]
            pan = msg[3]
            LiveUtils.trackPan(track, pan)
        if len(msg) >= 3:
            track = msg[2]
            self.oscServer.sendOSC("/live/pan", (track, LiveUtils.trackPan(track)))
Пример #2
0
    def panCB(self, msg, source):
        """Called when a /live/pan message is received.

        Messages:
        /live/pan     (int track)                            Returns the pan of track number track as: /live/pan (int track, float pan(-1.0 to 1.0))
        /live/pan     (int track, float pan(-1.0 to 1.0))    Sets track number track's pan to pan

        """
        if msg[0] == '/live/return/pan':
            ty = 1
        elif msg[0] == '/live/master/pan':
            ty = 2
        else:
            ty = 0

        if len(msg) == 2 and ty == 2:
            self.oscEndpoint.send(
                "/live/master/pan",
                LiveUtils.getSong().master_track.mixer_device.panning.value)

        elif len(msg) == 3 and ty == 2:
            pan = msg[2]
            LiveUtils.getSong().master_track.mixer_device.panning.value = pan

        elif len(msg) == 4:
            track = msg[2]
            pan = msg[3]

            if ty == 0:
                LiveUtils.trackPan(track, pan)
            elif ty == 1:
                LiveUtils.getSong(
                ).return_tracks[track].mixer_device.panning.value = pan

        elif len(msg) == 3:
            track = msg[2]

            if ty == 1:
                self.oscEndpoint.send("/live/pan", (track, LiveUtils.getSong(
                ).return_tracks[track].mixer_device.panning.value))

            else:
                self.oscEndpoint.send("/live/pan",
                                      (track, LiveUtils.trackPan(track)))
Пример #3
0
    def panCB(self, msg, source):
        """Called when a /live/pan message is received.

        Messages:
        /live/pan     (int track)                            Returns the pan of track number track as: /live/pan (int track, float pan(-1.0 to 1.0))
        /live/pan     (int track, float pan(-1.0 to 1.0))    Sets track number track's pan to pan

        """
        if msg[0] == '/live/return/pan':
            ty = 1
        elif msg[0] == '/live/master/pan':
            ty = 2
        else:
            ty = 0
        
        if len(msg) == 2 and ty == 2:
            self.oscEndpoint.send("/live/master/pan", LiveUtils.getSong().master_track.mixer_device.panning.value)
        
        elif len(msg) == 3 and ty == 2:
            pan = msg[2]
            LiveUtils.getSong().master_track.mixer_device.panning.value = pan
            
        elif len(msg) == 4:
            track = msg[2]
            pan = msg[3]
            
            if ty == 0:
                LiveUtils.trackPan(track, pan)
            elif ty == 1:
                LiveUtils.getSong().return_tracks[track].mixer_device.panning.value = pan
            
        elif len(msg) == 3:
            track = msg[2]
            
            if ty == 1:
                self.oscEndpoint.send("/live/pan", (track, LiveUtils.getSong().return_tracks[track].mixer_device.panning.value))
            
            else:
                self.oscEndpoint.send("/live/pan", (track, LiveUtils.trackPan(track)))