~ubuntu-branches/ubuntu/trusty/portmidi/trusty

« back to all changes in this revision

Viewing changes to porttime/porttime.h

  • Committer: Bazaar Package Importer
  • Author(s): Paul Brossier
  • Date: 2009-09-16 06:50:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090916065057-lz24lbrrygyev85b
Tags: 1:131-1
* New upstream version, uses epoch (closes: #501132)
* debian/watch: update to match new download location and version
  numbering (closes: #450055), but still fails due to zip format
* Add depends on quilt, move patches to debian/patches
* Add Homepage to debian/control
* debian/control: use ${binary:Version}, bump to S-V 3.8.3
* debian/compat: bump to 5
* debian/copyright: update to match license.txt and add missing copyrights
* debian/patches/02_pmlinuxalsa.diff: remove merged hunks
* debian/patches/04_ptlinux.diff: remove merged hunks
* debian/patches/05_makefile.diff: merge and link portmidi to porttime,
  thanks to Willem van Engen (closes: #515712)
* debian/rules: use pm_linux/Makefile, ship CHANGELOG.txt and make sure
  source and header files are not executable
* debian/README.source: refer to quilt documentation
* debian/libportmidi-dev.install: do not try to install unexisting files
* debian/patches/{06_pm_test_mm,07_pm_test_sysex,08_pm_test_qtest}.diff:
  get rid of missing include and parenthesis, fix long int formatting
* debian/rules: do not compress header files

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
 
15
15
typedef enum {
16
 
    ptNoError = 0,
17
 
    ptHostError = -10000,
18
 
    ptAlreadyStarted,
19
 
    ptAlreadyStopped,
20
 
    ptInsufficientMemory
 
16
    ptNoError = 0,         /* success */
 
17
    ptHostError = -10000,  /* a system-specific error occurred */
 
18
    ptAlreadyStarted,      /* cannot start timer because it is already started */
 
19
    ptAlreadyStopped,      /* cannot stop timer because it is already stopped */
 
20
    ptInsufficientMemory   /* memory could not be allocated */
21
21
} PtError;
22
22
 
23
23
 
25
25
 
26
26
typedef void (PtCallback)( PtTimestamp timestamp, void *userData );
27
27
 
28
 
 
 
28
/*
 
29
    Pt_Start() starts a real-time service.
 
30
 
 
31
    resolution is the timer resolution in ms. The time will advance every
 
32
    resolution ms.
 
33
 
 
34
    callback is a function pointer to be called every resolution ms.
 
35
 
 
36
    userData is passed to callback as a parameter.
 
37
 
 
38
    return value:
 
39
    Upon success, returns ptNoError. See PtError for other values.
 
40
*/
29
41
PtError Pt_Start(int resolution, PtCallback *callback, void *userData);
 
42
 
 
43
/*
 
44
    Pt_Stop() stops the timer.
 
45
 
 
46
    return value:
 
47
    Upon success, returns ptNoError. See PtError for other values.
 
48
*/
30
49
PtError Pt_Stop();
 
50
 
 
51
/*
 
52
    Pt_Started() returns true iff the timer is running.
 
53
*/
31
54
int Pt_Started();
 
55
 
 
56
/* 
 
57
    Pt_Time() returns the current time in ms.
 
58
*/
32
59
PtTimestamp Pt_Time();
33
60
 
 
61
/*
 
62
    Pt_Sleep() pauses, allowing other threads to run.
 
63
 
 
64
    duration is the length of the pause in ms. The true duration 
 
65
    of the pause may be rounded to the nearest or next clock tick
 
66
    as determined by resolution in Pt_Start().
 
67
*/
 
68
void Pt_Sleep(long duration);
 
69
 
34
70
#ifdef __cplusplus
35
71
}
36
72
#endif