Beispiel #1
0
def button_event(evt):
    global play_button

    currentJackFrame = jack.get_current_transport_frame()

    if evt == BEV_PLAY:  #play/pause
        if play_button.val == 1:
            jack.transport_start()
        else:
            jack.transport_stop()

    elif evt == BEV_START:  #back to 0
        jack.transport_locate(0)

    elif evt == BEV_PREV:  #go back
        nextJackFrame = currentJackFrame - 200000
        if (nextJackFrame < 0): nextJackFrame = 0
        jack.transport_locate(nextJackFrame)

    elif evt == BEV_NEXT:  #go forward
        nextJackFrame = currentJackFrame + 200000
        jack.transport_locate(nextJackFrame)

    elif evt == BEV_EXIT:  #quit script
        jack.detach()
        Draw.Exit()
jack.transport_locate(jack.get_sample_rate() * 6)
sleep(0.2)

print("getting current time")
print_time()


#testing state set/get
def print_state():
    state = jack.get_transport_state()
    statename = {
        jack.TransportStopped: "stopped",
        jack.TransportRolling: "rolling",
        jack.TransportStarting: "starting"
    }[state]
    print("current state is %i (%s)" % (state, statename))


print("TransportStopped: %i" % jack.TransportStopped)
print("TransportRolling: %i" % jack.TransportRolling)
print("TransportStarting: %i" % jack.TransportStarting)
print_state()

print("playing")
jack.transport_start()
sleep(5)
print("stopping")
jack.transport_stop()

print_time()
Beispiel #3
0
    def play(self):
	if (self.b_play.isChecked()):
	  jack.transport_start()
	else:
	  jack.transport_stop()
Beispiel #4
0
jack.attach("transporter.py")
print ("getting current time")
print_time()
print ("going to frame 0")
jack.transport_locate(0)
sleep (2)

print ("getting current time")
print_time()

sleep (0.5)
print ("going to 6 sec")
jack.transport_locate(jack.get_sample_rate()*6)
sleep (2)

print ("getting current time")
print_time()

print ("TransportStopped: %i" % jack.TransportStopped)
print ("TransportRolling: %i" % jack.TransportRolling)
print ("TransportStarting: %i" % jack.TransportStarting)
print_state()

print ("playing")
jack.transport_start()
sleep(5)
print ("stopping")
jack.transport_stop()

print_time()
Beispiel #5
0
 def play(self):
     if (self.b_play.isChecked()):
         jack.transport_start()
     else:
         jack.transport_stop()