mdSetOrigin(3dm) mdSetOrigin(3dm)
mdSetOrigin mdGetOrigin - control origin time for synchronization
#include <dmedia/midi.h>
int mdSetOrigin(MDport port, long long origin)
long long mdGetOrigin(MDport port)
mdSetOrigin sets an Unadjusted System Time or UST (see syssgi(2)) that is
used for all time based calculations on the port. By default, the origin
time for a port is the time that it was opened. It may be reset with
mdSetOrigin.
mdSetOrigin takes as an argument a 64 bit UST, which represents the time
that you wish to calculate time stamps from. If 0 is used, mdSetOrigin
uses the current UST. If the time used is greater than the current
system time (eg, in the future where we will all be famous for 15
minutes), any subsequent messages sent out will have their time stamps
reckoned according to that time.
If a time value less than zero is used, the origin time is set to that
number of nanoseconds before the current time. This allows streams of
files to be re-started in the middle of the data.
mdSetOrigin returns 0 on success, -1 on error. The following error codes
are expected:
ENXIO - Invalid port
ENINVAL - An undefined operation was called.
mdSettimebuffer(3dm), mdSetStampMode(3dm), syssgi(2)
The amusing feature of setting the origin time into the future has not
yet been tested.
PPPPaaaaggggeeee 1111 [ Back ]
|