Skip to content

rtMidi.mod: openPort() should return true/false #99

@GWRon

Description

@GWRon

For now rtMidi's openPort looks like this:

	Method openPort(portNumber:Int = 0, portName:String = "RtMidi Input")
		bmx_rtmidiin_openPort(midiPtr, portNumber, portName)
	End Method

if the rtMidi-openPort fails, it rtMidi-library-internally throws an exception (which you can catch in Blitzmax (as @woollybah handles it) - if you knew it could throw something).

Maybe you should extend openPort to catch the exceptions already and simply return "true" or "false" depending on the result. You might have a simple "GetLastError()" if you want to know what failed.

Think it would be at least a bit more "beginner proof".

PS: coming from this thread there: https://www.syntaxbomb.com/blitzmax-blitzmax-ng/chord-displayer/msg347057737

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