![]() |
PortMidi
Cross-platform MIDI IO library
|
Typedefs | |
| typedef int32_t | PtTimestamp |
| real time or time offset in milliseconds. | |
| typedef void() | PtCallback(PtTimestamp timestamp, void *userData) |
| a function that gets a current time | |
Enumerations | |
| enum | PtError { ptNoError = 0 , ptHostError = -10000 , ptAlreadyStarted , ptAlreadyStopped , ptInsufficientMemory } |
| PortTime error code; a common return type. More... | |
Functions | |
| PMEXPORT PtError | Pt_Start (int resolution, PtCallback *callback, void *userData) |
| start a real-time clock service. More... | |
| PMEXPORT PtError | Pt_Stop (void) |
| stop the timer. More... | |
| PMEXPORT int | Pt_Started (void) |
| test if the timer is running. More... | |
| PMEXPORT PtTimestamp | Pt_Time (void) |
| get the current time in ms. More... | |
| PMEXPORT void | Pt_Sleep (int32_t duration) |
| pauses the current thread, allowing other threads to run. More... | |
| enum PtError |
PortTime error code; a common return type.
No error is indicated by zero; errors are indicated by < 0.
| PMEXPORT void Pt_Sleep | ( | int32_t | duration | ) |
pauses the current thread, allowing other threads to run.
| duration | the length of the pause in ms. The true duration of the pause may be rounded to the nearest or next clock tick as determined by resolution in Pt_Start(). |
| PMEXPORT PtError Pt_Start | ( | int | resolution, |
| PtCallback * | callback, | ||
| void * | userData | ||
| ) |
start a real-time clock service.
| resolution | the timer resolution in ms. The time will advance every resolution ms. |
| callback | a function pointer to be called every resolution ms. |
| userData | is passed to callback as a parameter. |
| PMEXPORT int Pt_Started | ( | void | ) |
test if the timer is running.
| PMEXPORT PtError Pt_Stop | ( | void | ) |
stop the timer.
| PMEXPORT PtTimestamp Pt_Time | ( | void | ) |
get the current time in ms.