Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

set_freewheel documentation #142

Copy link
Copy link
@00sapo

Description

@00sapo
Issue body actions

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()
Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.