1// Code generated by pipewiregen. DO NOT EDIT.
2
3package capi
4
5import "unsafe"
6
7
8// InitCAPIAdapter forwards calls to the generated CAPI variables.
9type InitCAPIAdapter struct{}
10
11func (a *InitCAPIAdapter) PWInit(argc *int32, argv ***byte) {
12 pw_init(argc, argv)
13}
14
15func (a *InitCAPIAdapter) PWDeinit() {
16 pw_deinit()
17}
18
19
20// LoopCAPIAdapter forwards calls to the generated CAPI variables.
21type LoopCAPIAdapter struct{}
22
23func (a *LoopCAPIAdapter) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer {
24 return pw_main_loop_new(props)
25}
26
27func (a *LoopCAPIAdapter) PWMainLoopDestroy(loop unsafe.Pointer) {
28 pw_main_loop_destroy(loop)
29}
30
31func (a *LoopCAPIAdapter) PWMainLoopRun(loop unsafe.Pointer) int32 {
32 return pw_main_loop_run(loop)
33}
34
35func (a *LoopCAPIAdapter) PWMainLoopQuit(loop unsafe.Pointer) int32 {
36 return pw_main_loop_quit(loop)
37}
38
39func (a *LoopCAPIAdapter) PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer {
40 return pw_main_loop_get_loop(loop)
41}
42
43
44// StreamPlaybackCAPIAdapter forwards calls to the generated CAPI variables.
45type StreamPlaybackCAPIAdapter struct{}
46
47func (a *StreamPlaybackCAPIAdapter) PWStreamNewSimple(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer {
48 return pw_stream_new_simple(context, name, props, events, data)
49}
50
51func (a *StreamPlaybackCAPIAdapter) PWStreamConnect(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32 {
52 return pw_stream_connect(stream, direction, id, flags, ports, n_ports)
53}
54
55func (a *StreamPlaybackCAPIAdapter) PWStreamSetActive(stream unsafe.Pointer, active bool) int32 {
56 return pw_stream_set_active(stream, active)
57}
58
59func (a *StreamPlaybackCAPIAdapter) PWStreamDisconnect(stream unsafe.Pointer) int32 {
60 return pw_stream_disconnect(stream)
61}
62
63func (a *StreamPlaybackCAPIAdapter) PWStreamDequeueBuffer(stream unsafe.Pointer) unsafe.Pointer {
64 return pw_stream_dequeue_buffer(stream)
65}
66
67func (a *StreamPlaybackCAPIAdapter) PWStreamQueueBuffer(stream unsafe.Pointer, buffer unsafe.Pointer) int32 {
68 return pw_stream_queue_buffer(stream, buffer)
69}
70
71func (a *StreamPlaybackCAPIAdapter) PWStreamAddListener(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32 {
72 return pw_stream_add_listener(stream, listener, events, data)
73}
74
75func (a *StreamPlaybackCAPIAdapter) PWStreamDestroy(stream unsafe.Pointer) {
76 pw_stream_destroy(stream)
77}
78
79
80
81// defaultCAPI implements the portout.CAPI composite interface by embedding
82// all generated group adapters. It is constructed by newDefaultCAPI.
83type defaultCAPI struct {
84 InitCAPIAdapter
85 LoopCAPIAdapter
86 StreamPlaybackCAPIAdapter
87}
88
89// newDefaultCAPI returns a defaultCAPI whose embedded adapters forward
90// every method to the corresponding generated C function variable.
91func newDefaultCAPI() *defaultCAPI {
92 return &defaultCAPI{}
93}