Skip to content

set_freewheel documentation #142

Open
@00sapo

Description

@00sapo

Hello,
to my understanding, set_freewheel should be put after any call to Client.activate() and before any call to Client.deactivate().

I have prepared a little example to play with this. I think it should be added to the documentation...

import time
import jack
import threading

ttt = None

def trial():
    A = jack.Client("A")
    event = threading.Event()

    @A.set_process_callback
    def process(frames):
        global ttt
        tt = time.time()
        print(tt)
        if tt - ttt > 1:
            event.set()

    global ttt
    ttt = time.time()
    # A.set_freewheel(True) # this makes `activate` fail
    A.activate()
    A.set_freewheel(True)
    event.wait()
    A.set_freewheel(False)
    A.deactivate()
    # A.set_freewheel(False) # this makes errors on the next run
    A.close()
    del A

print("trial 1")
trial()
print("trial 2")
trial()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions