Compare commits
2 Commits
11c9fc653d
...
af27abbaca
Author | SHA1 | Date |
---|---|---|
Christopher Arndt | af27abbaca | |
Christopher Arndt | 1dcf5ac82f |
|
@ -163,18 +163,19 @@ type
|
|||
##
|
||||
## The body of an AtomSequence (a sequence of events).
|
||||
##
|
||||
## The unit field is either a Urid that described an appropriate time stamp
|
||||
## type, or may be 0 where a default stamp is known. For
|
||||
## lv2Descriptor.run(), the default stamp is audio frames.
|
||||
## The unit field is either a Urid that describes an appropriate time stamp
|
||||
## type, or may be 0 where a default stamp type is known. For
|
||||
## lv2Descriptor.run(), the default stamp type is audio frames.
|
||||
##
|
||||
## The contents of a sequence is a series of AtomEvent, each aligned
|
||||
## to 64-bits, for example:
|
||||
## <pre>
|
||||
##
|
||||
## ```
|
||||
## | Event 1 (size 6) | Event 2
|
||||
## | | | | | | | | |
|
||||
## | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
## |FRAMES |SIZE |TYPE |DATADATADATAPAD|FRAMES |...
|
||||
## </pre>
|
||||
## ```
|
||||
##
|
||||
AtomSequenceBody* {.bycopy.} = object
|
||||
unit*: Urid ## Urid of unit of event time stamps.
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
## Utilities for working with atoms.
|
||||
##
|
||||
|
||||
from system/ansi_c import c_memcmp, c_memcpy
|
||||
import ../atom
|
||||
import ../ptrmath
|
||||
import ../urid
|
||||
|
@ -40,7 +39,7 @@ proc atomIsNull*(atom: ptr Atom): bool {.inline.} =
|
|||
proc atomEquals*(a: ptr Atom; b: ptr Atom): bool {.inline.} =
|
||||
return (a == b) or
|
||||
((a.`type` == b.`type`) and (a.size == b.size) and
|
||||
c_memcmp(a + 1, b + 1, a.size) == 0)
|
||||
cmpMem(a + 1, b + 1, a.size) == 0)
|
||||
|
||||
##
|
||||
## Sequence Iterator
|
||||
|
@ -126,7 +125,7 @@ proc atomSequenceAppendEvent*(seq: ptr AtomSequence; capacity: uint32;
|
|||
return nil
|
||||
|
||||
var e = atomSequenceEnd(seq.body.addr, seq.atom.size)
|
||||
c_memcpy(e, event, totalSize)
|
||||
copyMem(e, event, totalSize)
|
||||
seq.atom.size += atomPadSize(totalSize)
|
||||
return e
|
||||
|
||||
|
|
Loading…
Reference in New Issue