Ejemplo n.º 1
0
aux1bus = oui.Bus(screen, (10, 100, BUS_WIDTH, BUTTON_HEIGHT), "Aux1", SOURCE_LIST)
aux2bus = oui.Bus(screen, (10, 160, BUS_WIDTH, BUTTON_HEIGHT), "Aux2", SOURCE_LIST)
aux3bus = oui.Bus(screen, (10, 220, BUS_WIDTH, BUTTON_HEIGHT), "Aux3", SOURCE_LIST)

dskbus = oui.Bus(screen, (10, 280, BUS_WIDTH, BUTTON_HEIGHT), "DSK", SOURCE_LIST)

pgmbus = oui.Bus(screen, (10, 340, BUS_WIDTH, BUTTON_HEIGHT), "PGM", SOURCE_LIST)
pvwbus = oui.Bus(screen, (10, 400, BUS_WIDTH, BUTTON_HEIGHT), "PVW", SOURCE_LIST)

cutbutton = oui.Button(screen, (BUS_WIDTH + 50, 340, BUTTON_WIDTH, BUTTON_HEIGHT), "CUT")
autotakebutton = oui.Button(screen, (BUS_WIDTH + 50, 400, BUTTON_WIDTH, BUTTON_HEIGHT), "FADE")

# by wrapping the actions in lambdas, (or functions) they don't get called until
# the action is called...

pgmbus.action = lambda: atem.set_pgm_bus(pgmbus.current_source)
pvwbus.action = lambda: atem.set_pvw_bus(pvwbus.current_source)


def cut():
    atem.cut()
    pwv = pgmbus.current_source
    pgmbus.set_current(pvwbus.current_source, False)
    pvwbus.set_current(pwv, False)


cutbutton.action = cut
autotakebutton.action = cut

######################
#                    #
Ejemplo n.º 2
0
            logging.info('|', join([bank, instrument, value]))
            # 88 18 801c 01e1 0000 0000 01f7 - 000c 0000 4354 5073 0054 01f1
            # (Example pkg - value from 0-1000)
            payload = None
            if bank == 176 and instrument == 2:
                #Fader moved
                sval = value * 7.87
                if sval < 15:
                    sval = 0
                elif sval > 985:
                    sval = 1000
                atem.fade(sval)
            if bank == 176 and value == 127:
                if instrument > 22 and instrument < 32:
                    #top pressed
                    atem.set_pgm_bus(instrument-22)
                if instrument > 32  and instrument < 42: 
                    #bottom pressed
                    atem.set_pvw_bus(instrument-32)
                if instrument == 45:
                    #other bottom pressed
                    atem.auto_fade()
            continue
    atem.step()

    #Read from command line

    line = None
    try:
        line = sys.stdin.readline().strip()
    except: