-
Notifications
You must be signed in to change notification settings - Fork 1
/
msrecord.go
38 lines (29 loc) · 967 Bytes
/
msrecord.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package slink
//#cgo CFLAGS: -I/usr/local/include
//#cgo LDFLAGS: /usr/local/lib/libslink.a
//#include <libslink.h>
import "C"
import (
"unsafe"
)
type SLMSRecord _Ctype_SLMSrecord
func NewSLMSRecord() *SLMSRecord {
return (*SLMSRecord)(C.sl_msr_new())
}
func FreeSLMSRecord(r **SLMSRecord) {
C.sl_msr_free((**_Ctype_struct_SLMSrecord_s)((unsafe.Pointer)(r)))
}
func (r *SLMSRecord) Print(details int) int {
return (int)(C.sl_msr_print((*_Ctype_struct_SLlog_s)(nil), (*_Ctype_struct_SLMSrecord_s)(r), (C.int)(details)))
}
func (r *SLMSRecord) DSampRate() (float64, int) {
samprate := new(C.double)
err := (int)(C.sl_msr_dsamprate((*_Ctype_struct_SLMSrecord_s)(r), samprate))
return float64(*samprate), err
}
func (r *SLMSRecord) DNomSampRate() float64 {
return float64(C.sl_msr_dnomsamprate((*_Ctype_struct_SLMSrecord_s)(r)))
}
func (r *SLMSRecord) sl_DEpochSTime() float64 {
return float64(C.sl_msr_depochstime((*_Ctype_struct_SLMSrecord_s)(r)))
}