Skip to content

Callback version of PortMidi for Windows, bad idea? #76

@cogled4

Description

@cogled4

I needed a callback version of PortMidi for my Windows app. I modified the library to accept a callback function when opening a midi input stream. Then, in the Windows implementation, I call this callback instead of inserting the PmEvent into the queue.

For my purposes this seems to work well, the queue stays empty and I get the PmEvent's, both short and Sysex, sent straight to my callback function. Of course this isn't portable and I'm not recommending anyone else do this :) But I did want to ask, should I anticipate any major problems with this approach? It looks like the Windows Midi callback does use EnterCriticalSection() and LeaveCriticalSection(). I need to do more research about what that entails.

Forgive me if I'm posting this question in the wrong place. I couldn't find any Portmidi forum anywhere else.

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