feat: regenerate PipeWire composite and loop bindings
- commit
- 918a3b9e88ab161499f303044d0f5eb54fc3a345
- author
- brice · · 2026-04-10 13:03 UTC
- parent
- ae5412a
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
11 files · +743 -65
M cmd/pipewiregen/internal/emitter/emitter.go +14 -0
| @@ -483,6 +483,20 @@ func (a *{{$group.AdapterName}}) {{.GoName}}{{.Params}}{{if .Results}} {{.Result | |||
| 483 | 483 | } | |
| 484 | 484 | {{end}} | |
| 485 | 485 | {{end}} | |
| 486 | + | ||
| 487 | + | // defaultCAPI implements the portout.CAPI composite interface by embedding | |
| 488 | + | // all generated group adapters. It is constructed by newDefaultCAPI. | |
| 489 | + | type defaultCAPI struct { | |
| 490 | + | {{- range .Groups}} | |
| 491 | + | {{.AdapterName}} | |
| 492 | + | {{- end}} | |
| 493 | + | } | |
| 494 | + | ||
| 495 | + | // newDefaultCAPI returns a defaultCAPI whose embedded adapters forward | |
| 496 | + | // every method to the corresponding generated C function variable. | |
| 497 | + | func newDefaultCAPI() *defaultCAPI { | |
| 498 | + | return &defaultCAPI{} | |
| 499 | + | } | |
| 486 | 500 | ` | |
| 487 | 501 | ||
| 488 | 502 | const compositeTemplate = `// Code generated by pipewiregen. DO NOT EDIT. | |
| @@ -483,6 +483,20 @@ func (a *{{$group.AdapterName}}) {{.GoName}}{{.Params}}{{if .Results}} {{.Result | |||||
| 483 | } | 483 | } | ||
| 484 | {{end}} | 484 | {{end}} | ||
| 485 | {{end}} | 485 | {{end}} | ||
| 486 | + | ||||
| 487 | + | // defaultCAPI implements the portout.CAPI composite interface by embedding | |||
| 488 | + | // all generated group adapters. It is constructed by newDefaultCAPI. | |||
| 489 | + | type defaultCAPI struct { | |||
| 490 | + | {{- range .Groups}} | |||
| 491 | + | {{.AdapterName}} | |||
| 492 | + | {{- end}} | |||
| 493 | + | } | |||
| 494 | + | ||||
| 495 | + | // newDefaultCAPI returns a defaultCAPI whose embedded adapters forward | |||
| 496 | + | // every method to the corresponding generated C function variable. | |||
| 497 | + | func newDefaultCAPI() *defaultCAPI { | |||
| 498 | + | return &defaultCAPI{} | |||
| 499 | + | } | |||
| 486 | ` | 500 | ` | ||
| 487 | 501 | ||||
| 488 | const compositeTemplate = `// Code generated by pipewiregen. DO NOT EDIT. | 502 | const compositeTemplate = `// Code generated by pipewiregen. DO NOT EDIT. | ||
M cmd/pipewiregen/internal/emitter/emitter_test.go +27 -0
| @@ -170,6 +170,7 @@ func testCleanupModel() *model.Model { | |||
| 170 | 170 | "pw_main_loop_destroy", | |
| 171 | 171 | "pw_main_loop_run", | |
| 172 | 172 | "pw_main_loop_quit", | |
| 173 | + | "pw_main_loop_get_loop", | |
| 173 | 174 | }, | |
| 174 | 175 | }, | |
| 175 | 176 | { | |
| @@ -194,6 +195,7 @@ func testCleanupModel() *model.Model { | |||
| 194 | 195 | {Name: "pw_main_loop_destroy", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer)"}, | |
| 195 | 196 | {Name: "pw_main_loop_run", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | |
| 196 | 197 | {Name: "pw_main_loop_quit", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | |
| 198 | + | {Name: "pw_main_loop_get_loop", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) unsafe.Pointer"}, | |
| 197 | 199 | // Stream playback symbols | |
| 198 | 200 | {Name: "pw_stream_new_simple", Library: "pipewire", Group: "stream_playback", Signature: "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | |
| 199 | 201 | {Name: "pw_stream_connect", Library: "pipewire", Group: "stream_playback", Signature: "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | |
| @@ -237,6 +239,18 @@ func TestEmitGeneratesCleanupBindings(t *testing.T) { | |||
| 237 | 239 | } | |
| 238 | 240 | ||
| 239 | 241 | assertCleanupBindings(t, paths) | |
| 242 | + | ||
| 243 | + | // Verify composite port embeds StreamPlaybackAPI | |
| 244 | + | compositeContent := string(paths["internal/ports/out/capi_gen.go"]) | |
| 245 | + | if !strings.Contains(compositeContent, "StreamPlaybackAPI") { | |
| 246 | + | t.Fatal("checked-in model: composite output missing StreamPlaybackAPI embed") | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | // Verify loop port contains PWMainLoopGetLoop | |
| 250 | + | loopPortContent := string(paths["internal/ports/out/loop_gen.go"]) | |
| 251 | + | if !strings.Contains(loopPortContent, "PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer") { | |
| 252 | + | t.Fatal("checked-in model: loop port output missing PWMainLoopGetLoop method") | |
| 253 | + | } | |
| 240 | 254 | }) | |
| 241 | 255 | } | |
| 242 | 256 | ||
| @@ -255,12 +269,25 @@ func assertCleanupBindings(t *testing.T, paths map[string][]byte) { | |||
| 255 | 269 | t.Fatalf("capi loop output missing pw_main_loop_quit registration") | |
| 256 | 270 | } | |
| 257 | 271 | ||
| 272 | + | // Verify loop_gen.go contains pw_main_loop_get_loop | |
| 273 | + | if !strings.Contains(loopCapiContent, "pw_main_loop_get_loop") { | |
| 274 | + | t.Fatalf("capi loop output missing pw_main_loop_get_loop binding") | |
| 275 | + | } | |
| 276 | + | if !strings.Contains(loopCapiContent, "pw_main_loop_get_loopFunc") { | |
| 277 | + | t.Fatalf("capi loop output missing pw_main_loop_get_loopFunc type") | |
| 278 | + | } | |
| 279 | + | ||
| 258 | 280 | // Verify loop port interface contains PWMainLoopQuit | |
| 259 | 281 | loopPortContent := string(paths["internal/ports/out/loop_gen.go"]) | |
| 260 | 282 | if !strings.Contains(loopPortContent, "PWMainLoopQuit(loop unsafe.Pointer) int32") { | |
| 261 | 283 | t.Fatalf("port loop output missing PWMainLoopQuit method") | |
| 262 | 284 | } | |
| 263 | 285 | ||
| 286 | + | // Verify loop port interface contains PWMainLoopGetLoop | |
| 287 | + | if !strings.Contains(loopPortContent, "PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer") { | |
| 288 | + | t.Fatalf("port loop output missing PWMainLoopGetLoop method") | |
| 289 | + | } | |
| 290 | + | ||
| 264 | 291 | // Verify stream_playback_gen.go contains pw_stream_destroy | |
| 265 | 292 | streamCapiContent := string(paths["internal/capi/stream_playback_gen.go"]) | |
| 266 | 293 | if !strings.Contains(streamCapiContent, "pw_stream_destroy") { | |
| @@ -170,6 +170,7 @@ func testCleanupModel() *model.Model { | |||||
| 170 | "pw_main_loop_destroy", | 170 | "pw_main_loop_destroy", | ||
| 171 | "pw_main_loop_run", | 171 | "pw_main_loop_run", | ||
| 172 | "pw_main_loop_quit", | 172 | "pw_main_loop_quit", | ||
| 173 | + | "pw_main_loop_get_loop", | |||
| 173 | }, | 174 | }, | ||
| 174 | }, | 175 | }, | ||
| 175 | { | 176 | { | ||
| @@ -194,6 +195,7 @@ func testCleanupModel() *model.Model { | |||||
| 194 | {Name: "pw_main_loop_destroy", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer)"}, | 195 | {Name: "pw_main_loop_destroy", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer)"}, | ||
| 195 | {Name: "pw_main_loop_run", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | 196 | {Name: "pw_main_loop_run", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | ||
| 196 | {Name: "pw_main_loop_quit", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | 197 | {Name: "pw_main_loop_quit", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) int32"}, | ||
| 198 | + | {Name: "pw_main_loop_get_loop", Library: "pipewire", Group: "loop", Signature: "func(loop unsafe.Pointer) unsafe.Pointer"}, | |||
| 197 | // Stream playback symbols | 199 | // Stream playback symbols | ||
| 198 | {Name: "pw_stream_new_simple", Library: "pipewire", Group: "stream_playback", Signature: "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | 200 | {Name: "pw_stream_new_simple", Library: "pipewire", Group: "stream_playback", Signature: "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | ||
| 199 | {Name: "pw_stream_connect", Library: "pipewire", Group: "stream_playback", Signature: "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | 201 | {Name: "pw_stream_connect", Library: "pipewire", Group: "stream_playback", Signature: "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | ||
| @@ -237,6 +239,18 @@ func TestEmitGeneratesCleanupBindings(t *testing.T) { | |||||
| 237 | } | 239 | } | ||
| 238 | 240 | ||||
| 239 | assertCleanupBindings(t, paths) | 241 | assertCleanupBindings(t, paths) | ||
| 242 | + | ||||
| 243 | + | // Verify composite port embeds StreamPlaybackAPI | |||
| 244 | + | compositeContent := string(paths["internal/ports/out/capi_gen.go"]) | |||
| 245 | + | if !strings.Contains(compositeContent, "StreamPlaybackAPI") { | |||
| 246 | + | t.Fatal("checked-in model: composite output missing StreamPlaybackAPI embed") | |||
| 247 | + | } | |||
| 248 | + | ||||
| 249 | + | // Verify loop port contains PWMainLoopGetLoop | |||
| 250 | + | loopPortContent := string(paths["internal/ports/out/loop_gen.go"]) | |||
| 251 | + | if !strings.Contains(loopPortContent, "PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer") { | |||
| 252 | + | t.Fatal("checked-in model: loop port output missing PWMainLoopGetLoop method") | |||
| 253 | + | } | |||
| 240 | }) | 254 | }) | ||
| 241 | } | 255 | } | ||
| 242 | 256 | ||||
| @@ -255,12 +269,25 @@ func assertCleanupBindings(t *testing.T, paths map[string][]byte) { | |||||
| 255 | t.Fatalf("capi loop output missing pw_main_loop_quit registration") | 269 | t.Fatalf("capi loop output missing pw_main_loop_quit registration") | ||
| 256 | } | 270 | } | ||
| 257 | 271 | ||||
| 272 | + | // Verify loop_gen.go contains pw_main_loop_get_loop | |||
| 273 | + | if !strings.Contains(loopCapiContent, "pw_main_loop_get_loop") { | |||
| 274 | + | t.Fatalf("capi loop output missing pw_main_loop_get_loop binding") | |||
| 275 | + | } | |||
| 276 | + | if !strings.Contains(loopCapiContent, "pw_main_loop_get_loopFunc") { | |||
| 277 | + | t.Fatalf("capi loop output missing pw_main_loop_get_loopFunc type") | |||
| 278 | + | } | |||
| 279 | + | ||||
| 258 | // Verify loop port interface contains PWMainLoopQuit | 280 | // Verify loop port interface contains PWMainLoopQuit | ||
| 259 | loopPortContent := string(paths["internal/ports/out/loop_gen.go"]) | 281 | loopPortContent := string(paths["internal/ports/out/loop_gen.go"]) | ||
| 260 | if !strings.Contains(loopPortContent, "PWMainLoopQuit(loop unsafe.Pointer) int32") { | 282 | if !strings.Contains(loopPortContent, "PWMainLoopQuit(loop unsafe.Pointer) int32") { | ||
| 261 | t.Fatalf("port loop output missing PWMainLoopQuit method") | 283 | t.Fatalf("port loop output missing PWMainLoopQuit method") | ||
| 262 | } | 284 | } | ||
| 263 | 285 | ||||
| 286 | + | // Verify loop port interface contains PWMainLoopGetLoop | |||
| 287 | + | if !strings.Contains(loopPortContent, "PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer") { | |||
| 288 | + | t.Fatalf("port loop output missing PWMainLoopGetLoop method") | |||
| 289 | + | } | |||
| 290 | + | ||||
| 264 | // Verify stream_playback_gen.go contains pw_stream_destroy | 291 | // Verify stream_playback_gen.go contains pw_stream_destroy | ||
| 265 | streamCapiContent := string(paths["internal/capi/stream_playback_gen.go"]) | 292 | streamCapiContent := string(paths["internal/capi/stream_playback_gen.go"]) | ||
| 266 | if !strings.Contains(streamCapiContent, "pw_stream_destroy") { | 293 | if !strings.Contains(streamCapiContent, "pw_stream_destroy") { | ||
M gen/pipewire.json +2 -1
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ], | |
| 6 | 6 | "groups": [ | |
| 7 | 7 | {"name": "init", "interface": "InitAPI", "package": "out", "symbols": ["pw_init", "pw_deinit"]}, | |
| 8 | - | {"name": "loop", "interface": "LoopAPI", "package": "out", "symbols": ["pw_main_loop_new", "pw_main_loop_destroy", "pw_main_loop_run", "pw_main_loop_quit"]}, | |
| 8 | + | {"name": "loop", "interface": "LoopAPI", "package": "out", "symbols": ["pw_main_loop_new", "pw_main_loop_destroy", "pw_main_loop_run", "pw_main_loop_quit", "pw_main_loop_get_loop"]}, | |
| 9 | 9 | {"name": "stream_playback", "interface": "StreamPlaybackAPI", "package": "out", "symbols": ["pw_stream_new_simple", "pw_stream_connect", "pw_stream_set_active", "pw_stream_disconnect", "pw_stream_dequeue_buffer", "pw_stream_queue_buffer", "pw_stream_add_listener", "pw_stream_destroy"]} | |
| 10 | 10 | ], | |
| 11 | 11 | "symbols": [ | |
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | {"name": "pw_main_loop_destroy", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer)"}, | |
| 16 | 16 | {"name": "pw_main_loop_run", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | |
| 17 | 17 | {"name": "pw_main_loop_quit", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | |
| 18 | + | {"name": "pw_main_loop_get_loop", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) unsafe.Pointer"}, | |
| 18 | 19 | {"name": "pw_stream_new_simple", "library": "pipewire", "group": "stream_playback", "signature": "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | |
| 19 | 20 | {"name": "pw_stream_connect", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | |
| 20 | 21 | {"name": "pw_stream_set_active", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, active bool) int32"}, | |
| @@ -5,7 +5,7 @@ | |||||
| 5 | ], | 5 | ], | ||
| 6 | "groups": [ | 6 | "groups": [ | ||
| 7 | {"name": "init", "interface": "InitAPI", "package": "out", "symbols": ["pw_init", "pw_deinit"]}, | 7 | {"name": "init", "interface": "InitAPI", "package": "out", "symbols": ["pw_init", "pw_deinit"]}, | ||
| 8 | - | {"name": "loop", "interface": "LoopAPI", "package": "out", "symbols": ["pw_main_loop_new", "pw_main_loop_destroy", "pw_main_loop_run", "pw_main_loop_quit"]}, | 8 | + | {"name": "loop", "interface": "LoopAPI", "package": "out", "symbols": ["pw_main_loop_new", "pw_main_loop_destroy", "pw_main_loop_run", "pw_main_loop_quit", "pw_main_loop_get_loop"]}, |
| 9 | {"name": "stream_playback", "interface": "StreamPlaybackAPI", "package": "out", "symbols": ["pw_stream_new_simple", "pw_stream_connect", "pw_stream_set_active", "pw_stream_disconnect", "pw_stream_dequeue_buffer", "pw_stream_queue_buffer", "pw_stream_add_listener", "pw_stream_destroy"]} | 9 | {"name": "stream_playback", "interface": "StreamPlaybackAPI", "package": "out", "symbols": ["pw_stream_new_simple", "pw_stream_connect", "pw_stream_set_active", "pw_stream_disconnect", "pw_stream_dequeue_buffer", "pw_stream_queue_buffer", "pw_stream_add_listener", "pw_stream_destroy"]} | ||
| 10 | ], | 10 | ], | ||
| 11 | "symbols": [ | 11 | "symbols": [ | ||
| @@ -15,6 +15,7 @@ | |||||
| 15 | {"name": "pw_main_loop_destroy", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer)"}, | 15 | {"name": "pw_main_loop_destroy", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer)"}, | ||
| 16 | {"name": "pw_main_loop_run", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | 16 | {"name": "pw_main_loop_run", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | ||
| 17 | {"name": "pw_main_loop_quit", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | 17 | {"name": "pw_main_loop_quit", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) int32"}, | ||
| 18 | + | {"name": "pw_main_loop_get_loop", "library": "pipewire", "group": "loop", "signature": "func(loop unsafe.Pointer) unsafe.Pointer"}, | |||
| 18 | {"name": "pw_stream_new_simple", "library": "pipewire", "group": "stream_playback", "signature": "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | 19 | {"name": "pw_stream_new_simple", "library": "pipewire", "group": "stream_playback", "signature": "func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer"}, | ||
| 19 | {"name": "pw_stream_connect", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | 20 | {"name": "pw_stream_connect", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32"}, | ||
| 20 | {"name": "pw_stream_set_active", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, active bool) int32"}, | 21 | {"name": "pw_stream_set_active", "library": "pipewire", "group": "stream_playback", "signature": "func(stream unsafe.Pointer, active bool) int32"}, | ||
A internal/capi/adapters_gen.go +93 -0 generated file: collapsed
M internal/capi/loop_gen.go +7 -0 generated file: collapsed
M internal/capi/register.go +3 -60
| @@ -2,70 +2,13 @@ package capi | |||
| 2 | 2 | ||
| 3 | 3 | import ( | |
| 4 | 4 | "sync" | |
| 5 | - | "unsafe" | |
| 6 | 5 | ||
| 7 | 6 | "github.com/bnema/purego-pipewire/internal/loader" | |
| 8 | 7 | portout "github.com/bnema/purego-pipewire/internal/ports/out" | |
| 9 | 8 | ) | |
| 10 | 9 | ||
| 11 | - | // defaultImpl implements portout.CAPI by wrapping the registered functions. | |
| 12 | - | type defaultImpl struct{} | |
| 13 | - | ||
| 14 | - | func (d defaultImpl) PWInit(argc *int32, argv ***byte) { | |
| 15 | - | pw_init(argc, argv) | |
| 16 | - | } | |
| 17 | - | ||
| 18 | - | func (d defaultImpl) PWDeinit() { | |
| 19 | - | pw_deinit() | |
| 20 | - | } | |
| 21 | - | ||
| 22 | - | func (d defaultImpl) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | |
| 23 | - | return pw_main_loop_new(props) | |
| 24 | - | } | |
| 25 | - | ||
| 26 | - | func (d defaultImpl) PWMainLoopDestroy(loop unsafe.Pointer) { | |
| 27 | - | pw_main_loop_destroy(loop) | |
| 28 | - | } | |
| 29 | - | ||
| 30 | - | func (d defaultImpl) PWMainLoopRun(loop unsafe.Pointer) int32 { | |
| 31 | - | return pw_main_loop_run(loop) | |
| 32 | - | } | |
| 33 | - | ||
| 34 | - | func (d defaultImpl) PWMainLoopQuit(loop unsafe.Pointer) int32 { | |
| 35 | - | return pw_main_loop_quit(loop) | |
| 36 | - | } | |
| 37 | - | ||
| 38 | - | func (d defaultImpl) PWStreamNewSimple(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer { | |
| 39 | - | return pw_stream_new_simple(context, name, props, events, data) | |
| 40 | - | } | |
| 41 | - | ||
| 42 | - | func (d defaultImpl) PWStreamConnect(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32 { | |
| 43 | - | return pw_stream_connect(stream, direction, id, flags, ports, n_ports) | |
| 44 | - | } | |
| 45 | - | ||
| 46 | - | func (d defaultImpl) PWStreamSetActive(stream unsafe.Pointer, active bool) int32 { | |
| 47 | - | return pw_stream_set_active(stream, active) | |
| 48 | - | } | |
| 49 | - | ||
| 50 | - | func (d defaultImpl) PWStreamDisconnect(stream unsafe.Pointer) int32 { | |
| 51 | - | return pw_stream_disconnect(stream) | |
| 52 | - | } | |
| 53 | - | ||
| 54 | - | func (d defaultImpl) PWStreamDequeueBuffer(stream unsafe.Pointer) unsafe.Pointer { | |
| 55 | - | return pw_stream_dequeue_buffer(stream) | |
| 56 | - | } | |
| 57 | - | ||
| 58 | - | func (d defaultImpl) PWStreamQueueBuffer(stream unsafe.Pointer, buffer unsafe.Pointer) int32 { | |
| 59 | - | return pw_stream_queue_buffer(stream, buffer) | |
| 60 | - | } | |
| 61 | - | ||
| 62 | - | func (d defaultImpl) PWStreamAddListener(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32 { | |
| 63 | - | return pw_stream_add_listener(stream, listener, events, data) | |
| 64 | - | } | |
| 65 | - | ||
| 66 | - | func (d defaultImpl) PWStreamDestroy(stream unsafe.Pointer) { | |
| 67 | - | pw_stream_destroy(stream) | |
| 68 | - | } | |
| 10 | + | // Compile-time check: defaultCAPI satisfies portout.CAPI. | |
| 11 | + | var _ portout.CAPI = (*defaultCAPI)(nil) | |
| 69 | 12 | ||
| 70 | 13 | var ( | |
| 71 | 14 | defaultAPI portout.CAPI | |
| @@ -86,7 +29,7 @@ func Register() error { | |||
| 86 | 29 | registerErr = err | |
| 87 | 30 | return | |
| 88 | 31 | } | |
| 89 | - | defaultAPI = defaultImpl{} | |
| 32 | + | defaultAPI = newDefaultCAPI() | |
| 90 | 33 | }) | |
| 91 | 34 | return registerErr | |
| 92 | 35 | } | |
| @@ -2,70 +2,13 @@ package capi | |||||
| 2 | 2 | ||||
| 3 | import ( | 3 | import ( | ||
| 4 | "sync" | 4 | "sync" | ||
| 5 | - | "unsafe" | |||
| 6 | 5 | ||||
| 7 | "github.com/bnema/purego-pipewire/internal/loader" | 6 | "github.com/bnema/purego-pipewire/internal/loader" | ||
| 8 | portout "github.com/bnema/purego-pipewire/internal/ports/out" | 7 | portout "github.com/bnema/purego-pipewire/internal/ports/out" | ||
| 9 | ) | 8 | ) | ||
| 10 | 9 | ||||
| 11 | - | // defaultImpl implements portout.CAPI by wrapping the registered functions. | 10 | + | // Compile-time check: defaultCAPI satisfies portout.CAPI. |
| 12 | - | type defaultImpl struct{} | 11 | + | var _ portout.CAPI = (*defaultCAPI)(nil) |
| 13 | - | ||||
| 14 | - | func (d defaultImpl) PWInit(argc *int32, argv ***byte) { | |||
| 15 | - | pw_init(argc, argv) | |||
| 16 | - | } | |||
| 17 | - | ||||
| 18 | - | func (d defaultImpl) PWDeinit() { | |||
| 19 | - | pw_deinit() | |||
| 20 | - | } | |||
| 21 | - | ||||
| 22 | - | func (d defaultImpl) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | |||
| 23 | - | return pw_main_loop_new(props) | |||
| 24 | - | } | |||
| 25 | - | ||||
| 26 | - | func (d defaultImpl) PWMainLoopDestroy(loop unsafe.Pointer) { | |||
| 27 | - | pw_main_loop_destroy(loop) | |||
| 28 | - | } | |||
| 29 | - | ||||
| 30 | - | func (d defaultImpl) PWMainLoopRun(loop unsafe.Pointer) int32 { | |||
| 31 | - | return pw_main_loop_run(loop) | |||
| 32 | - | } | |||
| 33 | - | ||||
| 34 | - | func (d defaultImpl) PWMainLoopQuit(loop unsafe.Pointer) int32 { | |||
| 35 | - | return pw_main_loop_quit(loop) | |||
| 36 | - | } | |||
| 37 | - | ||||
| 38 | - | func (d defaultImpl) PWStreamNewSimple(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer { | |||
| 39 | - | return pw_stream_new_simple(context, name, props, events, data) | |||
| 40 | - | } | |||
| 41 | - | ||||
| 42 | - | func (d defaultImpl) PWStreamConnect(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32 { | |||
| 43 | - | return pw_stream_connect(stream, direction, id, flags, ports, n_ports) | |||
| 44 | - | } | |||
| 45 | - | ||||
| 46 | - | func (d defaultImpl) PWStreamSetActive(stream unsafe.Pointer, active bool) int32 { | |||
| 47 | - | return pw_stream_set_active(stream, active) | |||
| 48 | - | } | |||
| 49 | - | ||||
| 50 | - | func (d defaultImpl) PWStreamDisconnect(stream unsafe.Pointer) int32 { | |||
| 51 | - | return pw_stream_disconnect(stream) | |||
| 52 | - | } | |||
| 53 | - | ||||
| 54 | - | func (d defaultImpl) PWStreamDequeueBuffer(stream unsafe.Pointer) unsafe.Pointer { | |||
| 55 | - | return pw_stream_dequeue_buffer(stream) | |||
| 56 | - | } | |||
| 57 | - | ||||
| 58 | - | func (d defaultImpl) PWStreamQueueBuffer(stream unsafe.Pointer, buffer unsafe.Pointer) int32 { | |||
| 59 | - | return pw_stream_queue_buffer(stream, buffer) | |||
| 60 | - | } | |||
| 61 | - | ||||
| 62 | - | func (d defaultImpl) PWStreamAddListener(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32 { | |||
| 63 | - | return pw_stream_add_listener(stream, listener, events, data) | |||
| 64 | - | } | |||
| 65 | - | ||||
| 66 | - | func (d defaultImpl) PWStreamDestroy(stream unsafe.Pointer) { | |||
| 67 | - | pw_stream_destroy(stream) | |||
| 68 | - | } | |||
| 69 | 12 | ||||
| 70 | var ( | 13 | var ( | ||
| 71 | defaultAPI portout.CAPI | 14 | defaultAPI portout.CAPI | ||
| @@ -86,7 +29,7 @@ func Register() error { | |||||
| 86 | registerErr = err | 29 | registerErr = err | ||
| 87 | return | 30 | return | ||
| 88 | } | 31 | } | ||
| 89 | - | defaultAPI = defaultImpl{} | 32 | + | defaultAPI = newDefaultCAPI() |
| 90 | }) | 33 | }) | ||
| 91 | return registerErr | 34 | return registerErr | ||
| 92 | } | 35 | } | ||
M internal/ports/out/capi.go +3 -4
| @@ -1,6 +1,5 @@ | |||
| 1 | - | // Temporary manual composition of the outbound CAPI interface. | |
| 2 | - | // This file bridges the gap until the generator emits a composite CAPI interface. | |
| 3 | - | // NOTE: The CAPI type is now generated in capi_gen.go — this file only holds | |
| 4 | - | // the narrative comment. The actual composite interface is capi_gen.go CAPI. | |
| 1 | + | // Package out defines outbound port interfaces for PipeWire bindings. | |
| 2 | + | // The CAPI composite interface and per-group interfaces are generated in | |
| 3 | + | // capi_gen.go, init_gen.go, loop_gen.go, and stream_playback_gen.go. | |
| 5 | 4 | ||
| 6 | 5 | package out | |
| @@ -1,6 +1,5 @@ | |||||
| 1 | - | // Temporary manual composition of the outbound CAPI interface. | 1 | + | // Package out defines outbound port interfaces for PipeWire bindings. |
| 2 | - | // This file bridges the gap until the generator emits a composite CAPI interface. | 2 | + | // The CAPI composite interface and per-group interfaces are generated in |
| 3 | - | // NOTE: The CAPI type is now generated in capi_gen.go — this file only holds | 3 | + | // capi_gen.go, init_gen.go, loop_gen.go, and stream_playback_gen.go. |
| 4 | - | // the narrative comment. The actual composite interface is capi_gen.go CAPI. | |||
| 5 | 4 | ||||
| 6 | package out | 5 | package out | ||
A internal/ports/out/capi_gen.go +10 -0 generated file: collapsed
M internal/ports/out/loop_gen.go +1 -0 generated file: collapsed
M internal/ports/out/mocks/mock_CAPI.go +532 -0
| @@ -156,6 +156,57 @@ func (_c *MockCAPI_PWMainLoopDestroy_Call) RunAndReturn(run func(loop unsafe.Poi | |||
| 156 | 156 | return _c | |
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | + | // PWMainLoopGetLoop provides a mock function for the type MockCAPI | |
| 160 | + | func (_mock *MockCAPI) PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer { | |
| 161 | + | ret := _mock.Called(loop) | |
| 162 | + | ||
| 163 | + | if len(ret) == 0 { | |
| 164 | + | panic("no return value specified for PWMainLoopGetLoop") | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | var r0 unsafe.Pointer | |
| 168 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |
| 169 | + | r0 = returnFunc(loop) | |
| 170 | + | } else { | |
| 171 | + | r0 = ret.Get(0).(unsafe.Pointer) | |
| 172 | + | } | |
| 173 | + | return r0 | |
| 174 | + | } | |
| 175 | + | ||
| 176 | + | // MockCAPI_PWMainLoopGetLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWMainLoopGetLoop' | |
| 177 | + | type MockCAPI_PWMainLoopGetLoop_Call struct { | |
| 178 | + | *mock.Call | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | // PWMainLoopGetLoop is a helper method to define mock.On call | |
| 182 | + | // - loop unsafe.Pointer | |
| 183 | + | func (_e *MockCAPI_Expecter) PWMainLoopGetLoop(loop interface{}) *MockCAPI_PWMainLoopGetLoop_Call { | |
| 184 | + | return &MockCAPI_PWMainLoopGetLoop_Call{Call: _e.mock.On("PWMainLoopGetLoop", loop)} | |
| 185 | + | } | |
| 186 | + | ||
| 187 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) Run(run func(loop unsafe.Pointer)) *MockCAPI_PWMainLoopGetLoop_Call { | |
| 188 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 189 | + | var arg0 unsafe.Pointer | |
| 190 | + | if args[0] != nil { | |
| 191 | + | arg0 = args[0].(unsafe.Pointer) | |
| 192 | + | } | |
| 193 | + | run( | |
| 194 | + | arg0, | |
| 195 | + | ) | |
| 196 | + | }) | |
| 197 | + | return _c | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) Return(v unsafe.Pointer) *MockCAPI_PWMainLoopGetLoop_Call { | |
| 201 | + | _c.Call.Return(v) | |
| 202 | + | return _c | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) RunAndReturn(run func(loop unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWMainLoopGetLoop_Call { | |
| 206 | + | _c.Call.Return(run) | |
| 207 | + | return _c | |
| 208 | + | } | |
| 209 | + | ||
| 159 | 210 | // PWMainLoopNew provides a mock function for the type MockCAPI | |
| 160 | 211 | func (_mock *MockCAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | |
| 161 | 212 | ret := _mock.Called(props) | |
| @@ -308,3 +359,484 @@ func (_c *MockCAPI_PWMainLoopRun_Call) RunAndReturn(run func(loop unsafe.Pointer | |||
| 308 | 359 | _c.Call.Return(run) | |
| 309 | 360 | return _c | |
| 310 | 361 | } | |
| 362 | + | ||
| 363 | + | // PWStreamAddListener provides a mock function for the type MockCAPI | |
| 364 | + | func (_mock *MockCAPI) PWStreamAddListener(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32 { | |
| 365 | + | ret := _mock.Called(stream, listener, events, data) | |
| 366 | + | ||
| 367 | + | if len(ret) == 0 { | |
| 368 | + | panic("no return value specified for PWStreamAddListener") | |
| 369 | + | } | |
| 370 | + | ||
| 371 | + | var r0 int32 | |
| 372 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32); ok { | |
| 373 | + | r0 = returnFunc(stream, listener, events, data) | |
| 374 | + | } else { | |
| 375 | + | r0 = ret.Get(0).(int32) | |
| 376 | + | } | |
| 377 | + | return r0 | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | // MockCAPI_PWStreamAddListener_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamAddListener' | |
| 381 | + | type MockCAPI_PWStreamAddListener_Call struct { | |
| 382 | + | *mock.Call | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // PWStreamAddListener is a helper method to define mock.On call | |
| 386 | + | // - stream unsafe.Pointer | |
| 387 | + | // - listener unsafe.Pointer | |
| 388 | + | // - events unsafe.Pointer | |
| 389 | + | // - data unsafe.Pointer | |
| 390 | + | func (_e *MockCAPI_Expecter) PWStreamAddListener(stream interface{}, listener interface{}, events interface{}, data interface{}) *MockCAPI_PWStreamAddListener_Call { | |
| 391 | + | return &MockCAPI_PWStreamAddListener_Call{Call: _e.mock.On("PWStreamAddListener", stream, listener, events, data)} | |
| 392 | + | } | |
| 393 | + | ||
| 394 | + | func (_c *MockCAPI_PWStreamAddListener_Call) Run(run func(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer)) *MockCAPI_PWStreamAddListener_Call { | |
| 395 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 396 | + | var arg0 unsafe.Pointer | |
| 397 | + | if args[0] != nil { | |
| 398 | + | arg0 = args[0].(unsafe.Pointer) | |
| 399 | + | } | |
| 400 | + | var arg1 unsafe.Pointer | |
| 401 | + | if args[1] != nil { | |
| 402 | + | arg1 = args[1].(unsafe.Pointer) | |
| 403 | + | } | |
| 404 | + | var arg2 unsafe.Pointer | |
| 405 | + | if args[2] != nil { | |
| 406 | + | arg2 = args[2].(unsafe.Pointer) | |
| 407 | + | } | |
| 408 | + | var arg3 unsafe.Pointer | |
| 409 | + | if args[3] != nil { | |
| 410 | + | arg3 = args[3].(unsafe.Pointer) | |
| 411 | + | } | |
| 412 | + | run( | |
| 413 | + | arg0, | |
| 414 | + | arg1, | |
| 415 | + | arg2, | |
| 416 | + | arg3, | |
| 417 | + | ) | |
| 418 | + | }) | |
| 419 | + | return _c | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | func (_c *MockCAPI_PWStreamAddListener_Call) Return(n int32) *MockCAPI_PWStreamAddListener_Call { | |
| 423 | + | _c.Call.Return(n) | |
| 424 | + | return _c | |
| 425 | + | } | |
| 426 | + | ||
| 427 | + | func (_c *MockCAPI_PWStreamAddListener_Call) RunAndReturn(run func(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32) *MockCAPI_PWStreamAddListener_Call { | |
| 428 | + | _c.Call.Return(run) | |
| 429 | + | return _c | |
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // PWStreamConnect provides a mock function for the type MockCAPI | |
| 433 | + | func (_mock *MockCAPI) PWStreamConnect(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32 { | |
| 434 | + | ret := _mock.Called(stream, direction, id, flags, ports, n_ports) | |
| 435 | + | ||
| 436 | + | if len(ret) == 0 { | |
| 437 | + | panic("no return value specified for PWStreamConnect") | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | var r0 int32 | |
| 441 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, int32, uint32, uint32, unsafe.Pointer, uint32) int32); ok { | |
| 442 | + | r0 = returnFunc(stream, direction, id, flags, ports, n_ports) | |
| 443 | + | } else { | |
| 444 | + | r0 = ret.Get(0).(int32) | |
| 445 | + | } | |
| 446 | + | return r0 | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // MockCAPI_PWStreamConnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamConnect' | |
| 450 | + | type MockCAPI_PWStreamConnect_Call struct { | |
| 451 | + | *mock.Call | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // PWStreamConnect is a helper method to define mock.On call | |
| 455 | + | // - stream unsafe.Pointer | |
| 456 | + | // - direction int32 | |
| 457 | + | // - id uint32 | |
| 458 | + | // - flags uint32 | |
| 459 | + | // - ports unsafe.Pointer | |
| 460 | + | // - n_ports uint32 | |
| 461 | + | func (_e *MockCAPI_Expecter) PWStreamConnect(stream interface{}, direction interface{}, id interface{}, flags interface{}, ports interface{}, n_ports interface{}) *MockCAPI_PWStreamConnect_Call { | |
| 462 | + | return &MockCAPI_PWStreamConnect_Call{Call: _e.mock.On("PWStreamConnect", stream, direction, id, flags, ports, n_ports)} | |
| 463 | + | } | |
| 464 | + | ||
| 465 | + | func (_c *MockCAPI_PWStreamConnect_Call) Run(run func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32)) *MockCAPI_PWStreamConnect_Call { | |
| 466 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 467 | + | var arg0 unsafe.Pointer | |
| 468 | + | if args[0] != nil { | |
| 469 | + | arg0 = args[0].(unsafe.Pointer) | |
| 470 | + | } | |
| 471 | + | var arg1 int32 | |
| 472 | + | if args[1] != nil { | |
| 473 | + | arg1 = args[1].(int32) | |
| 474 | + | } | |
| 475 | + | var arg2 uint32 | |
| 476 | + | if args[2] != nil { | |
| 477 | + | arg2 = args[2].(uint32) | |
| 478 | + | } | |
| 479 | + | var arg3 uint32 | |
| 480 | + | if args[3] != nil { | |
| 481 | + | arg3 = args[3].(uint32) | |
| 482 | + | } | |
| 483 | + | var arg4 unsafe.Pointer | |
| 484 | + | if args[4] != nil { | |
| 485 | + | arg4 = args[4].(unsafe.Pointer) | |
| 486 | + | } | |
| 487 | + | var arg5 uint32 | |
| 488 | + | if args[5] != nil { | |
| 489 | + | arg5 = args[5].(uint32) | |
| 490 | + | } | |
| 491 | + | run( | |
| 492 | + | arg0, | |
| 493 | + | arg1, | |
| 494 | + | arg2, | |
| 495 | + | arg3, | |
| 496 | + | arg4, | |
| 497 | + | arg5, | |
| 498 | + | ) | |
| 499 | + | }) | |
| 500 | + | return _c | |
| 501 | + | } | |
| 502 | + | ||
| 503 | + | func (_c *MockCAPI_PWStreamConnect_Call) Return(n int32) *MockCAPI_PWStreamConnect_Call { | |
| 504 | + | _c.Call.Return(n) | |
| 505 | + | return _c | |
| 506 | + | } | |
| 507 | + | ||
| 508 | + | func (_c *MockCAPI_PWStreamConnect_Call) RunAndReturn(run func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32) *MockCAPI_PWStreamConnect_Call { | |
| 509 | + | _c.Call.Return(run) | |
| 510 | + | return _c | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // PWStreamDequeueBuffer provides a mock function for the type MockCAPI | |
| 514 | + | func (_mock *MockCAPI) PWStreamDequeueBuffer(stream unsafe.Pointer) unsafe.Pointer { | |
| 515 | + | ret := _mock.Called(stream) | |
| 516 | + | ||
| 517 | + | if len(ret) == 0 { | |
| 518 | + | panic("no return value specified for PWStreamDequeueBuffer") | |
| 519 | + | } | |
| 520 | + | ||
| 521 | + | var r0 unsafe.Pointer | |
| 522 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |
| 523 | + | r0 = returnFunc(stream) | |
| 524 | + | } else { | |
| 525 | + | r0 = ret.Get(0).(unsafe.Pointer) | |
| 526 | + | } | |
| 527 | + | return r0 | |
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // MockCAPI_PWStreamDequeueBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDequeueBuffer' | |
| 531 | + | type MockCAPI_PWStreamDequeueBuffer_Call struct { | |
| 532 | + | *mock.Call | |
| 533 | + | } | |
| 534 | + | ||
| 535 | + | // PWStreamDequeueBuffer is a helper method to define mock.On call | |
| 536 | + | // - stream unsafe.Pointer | |
| 537 | + | func (_e *MockCAPI_Expecter) PWStreamDequeueBuffer(stream interface{}) *MockCAPI_PWStreamDequeueBuffer_Call { | |
| 538 | + | return &MockCAPI_PWStreamDequeueBuffer_Call{Call: _e.mock.On("PWStreamDequeueBuffer", stream)} | |
| 539 | + | } | |
| 540 | + | ||
| 541 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDequeueBuffer_Call { | |
| 542 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 543 | + | var arg0 unsafe.Pointer | |
| 544 | + | if args[0] != nil { | |
| 545 | + | arg0 = args[0].(unsafe.Pointer) | |
| 546 | + | } | |
| 547 | + | run( | |
| 548 | + | arg0, | |
| 549 | + | ) | |
| 550 | + | }) | |
| 551 | + | return _c | |
| 552 | + | } | |
| 553 | + | ||
| 554 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) Return(v unsafe.Pointer) *MockCAPI_PWStreamDequeueBuffer_Call { | |
| 555 | + | _c.Call.Return(v) | |
| 556 | + | return _c | |
| 557 | + | } | |
| 558 | + | ||
| 559 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) RunAndReturn(run func(stream unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWStreamDequeueBuffer_Call { | |
| 560 | + | _c.Call.Return(run) | |
| 561 | + | return _c | |
| 562 | + | } | |
| 563 | + | ||
| 564 | + | // PWStreamDestroy provides a mock function for the type MockCAPI | |
| 565 | + | func (_mock *MockCAPI) PWStreamDestroy(stream unsafe.Pointer) { | |
| 566 | + | _mock.Called(stream) | |
| 567 | + | return | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | // MockCAPI_PWStreamDestroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDestroy' | |
| 571 | + | type MockCAPI_PWStreamDestroy_Call struct { | |
| 572 | + | *mock.Call | |
| 573 | + | } | |
| 574 | + | ||
| 575 | + | // PWStreamDestroy is a helper method to define mock.On call | |
| 576 | + | // - stream unsafe.Pointer | |
| 577 | + | func (_e *MockCAPI_Expecter) PWStreamDestroy(stream interface{}) *MockCAPI_PWStreamDestroy_Call { | |
| 578 | + | return &MockCAPI_PWStreamDestroy_Call{Call: _e.mock.On("PWStreamDestroy", stream)} | |
| 579 | + | } | |
| 580 | + | ||
| 581 | + | func (_c *MockCAPI_PWStreamDestroy_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDestroy_Call { | |
| 582 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 583 | + | var arg0 unsafe.Pointer | |
| 584 | + | if args[0] != nil { | |
| 585 | + | arg0 = args[0].(unsafe.Pointer) | |
| 586 | + | } | |
| 587 | + | run( | |
| 588 | + | arg0, | |
| 589 | + | ) | |
| 590 | + | }) | |
| 591 | + | return _c | |
| 592 | + | } | |
| 593 | + | ||
| 594 | + | func (_c *MockCAPI_PWStreamDestroy_Call) Return() *MockCAPI_PWStreamDestroy_Call { | |
| 595 | + | _c.Call.Return() | |
| 596 | + | return _c | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | func (_c *MockCAPI_PWStreamDestroy_Call) RunAndReturn(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDestroy_Call { | |
| 600 | + | _c.Run(run) | |
| 601 | + | return _c | |
| 602 | + | } | |
| 603 | + | ||
| 604 | + | // PWStreamDisconnect provides a mock function for the type MockCAPI | |
| 605 | + | func (_mock *MockCAPI) PWStreamDisconnect(stream unsafe.Pointer) int32 { | |
| 606 | + | ret := _mock.Called(stream) | |
| 607 | + | ||
| 608 | + | if len(ret) == 0 { | |
| 609 | + | panic("no return value specified for PWStreamDisconnect") | |
| 610 | + | } | |
| 611 | + | ||
| 612 | + | var r0 int32 | |
| 613 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) int32); ok { | |
| 614 | + | r0 = returnFunc(stream) | |
| 615 | + | } else { | |
| 616 | + | r0 = ret.Get(0).(int32) | |
| 617 | + | } | |
| 618 | + | return r0 | |
| 619 | + | } | |
| 620 | + | ||
| 621 | + | // MockCAPI_PWStreamDisconnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDisconnect' | |
| 622 | + | type MockCAPI_PWStreamDisconnect_Call struct { | |
| 623 | + | *mock.Call | |
| 624 | + | } | |
| 625 | + | ||
| 626 | + | // PWStreamDisconnect is a helper method to define mock.On call | |
| 627 | + | // - stream unsafe.Pointer | |
| 628 | + | func (_e *MockCAPI_Expecter) PWStreamDisconnect(stream interface{}) *MockCAPI_PWStreamDisconnect_Call { | |
| 629 | + | return &MockCAPI_PWStreamDisconnect_Call{Call: _e.mock.On("PWStreamDisconnect", stream)} | |
| 630 | + | } | |
| 631 | + | ||
| 632 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDisconnect_Call { | |
| 633 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 634 | + | var arg0 unsafe.Pointer | |
| 635 | + | if args[0] != nil { | |
| 636 | + | arg0 = args[0].(unsafe.Pointer) | |
| 637 | + | } | |
| 638 | + | run( | |
| 639 | + | arg0, | |
| 640 | + | ) | |
| 641 | + | }) | |
| 642 | + | return _c | |
| 643 | + | } | |
| 644 | + | ||
| 645 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) Return(n int32) *MockCAPI_PWStreamDisconnect_Call { | |
| 646 | + | _c.Call.Return(n) | |
| 647 | + | return _c | |
| 648 | + | } | |
| 649 | + | ||
| 650 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) RunAndReturn(run func(stream unsafe.Pointer) int32) *MockCAPI_PWStreamDisconnect_Call { | |
| 651 | + | _c.Call.Return(run) | |
| 652 | + | return _c | |
| 653 | + | } | |
| 654 | + | ||
| 655 | + | // PWStreamNewSimple provides a mock function for the type MockCAPI | |
| 656 | + | func (_mock *MockCAPI) PWStreamNewSimple(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer { | |
| 657 | + | ret := _mock.Called(context, name, props, events, data) | |
| 658 | + | ||
| 659 | + | if len(ret) == 0 { | |
| 660 | + | panic("no return value specified for PWStreamNewSimple") | |
| 661 | + | } | |
| 662 | + | ||
| 663 | + | var r0 unsafe.Pointer | |
| 664 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, *byte, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer); ok { | |
| 665 | + | r0 = returnFunc(context, name, props, events, data) | |
| 666 | + | } else { | |
| 667 | + | r0 = ret.Get(0).(unsafe.Pointer) | |
| 668 | + | } | |
| 669 | + | return r0 | |
| 670 | + | } | |
| 671 | + | ||
| 672 | + | // MockCAPI_PWStreamNewSimple_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamNewSimple' | |
| 673 | + | type MockCAPI_PWStreamNewSimple_Call struct { | |
| 674 | + | *mock.Call | |
| 675 | + | } | |
| 676 | + | ||
| 677 | + | // PWStreamNewSimple is a helper method to define mock.On call | |
| 678 | + | // - context unsafe.Pointer | |
| 679 | + | // - name *byte | |
| 680 | + | // - props unsafe.Pointer | |
| 681 | + | // - events unsafe.Pointer | |
| 682 | + | // - data unsafe.Pointer | |
| 683 | + | func (_e *MockCAPI_Expecter) PWStreamNewSimple(context interface{}, name interface{}, props interface{}, events interface{}, data interface{}) *MockCAPI_PWStreamNewSimple_Call { | |
| 684 | + | return &MockCAPI_PWStreamNewSimple_Call{Call: _e.mock.On("PWStreamNewSimple", context, name, props, events, data)} | |
| 685 | + | } | |
| 686 | + | ||
| 687 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) Run(run func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer)) *MockCAPI_PWStreamNewSimple_Call { | |
| 688 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 689 | + | var arg0 unsafe.Pointer | |
| 690 | + | if args[0] != nil { | |
| 691 | + | arg0 = args[0].(unsafe.Pointer) | |
| 692 | + | } | |
| 693 | + | var arg1 *byte | |
| 694 | + | if args[1] != nil { | |
| 695 | + | arg1 = args[1].(*byte) | |
| 696 | + | } | |
| 697 | + | var arg2 unsafe.Pointer | |
| 698 | + | if args[2] != nil { | |
| 699 | + | arg2 = args[2].(unsafe.Pointer) | |
| 700 | + | } | |
| 701 | + | var arg3 unsafe.Pointer | |
| 702 | + | if args[3] != nil { | |
| 703 | + | arg3 = args[3].(unsafe.Pointer) | |
| 704 | + | } | |
| 705 | + | var arg4 unsafe.Pointer | |
| 706 | + | if args[4] != nil { | |
| 707 | + | arg4 = args[4].(unsafe.Pointer) | |
| 708 | + | } | |
| 709 | + | run( | |
| 710 | + | arg0, | |
| 711 | + | arg1, | |
| 712 | + | arg2, | |
| 713 | + | arg3, | |
| 714 | + | arg4, | |
| 715 | + | ) | |
| 716 | + | }) | |
| 717 | + | return _c | |
| 718 | + | } | |
| 719 | + | ||
| 720 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) Return(v unsafe.Pointer) *MockCAPI_PWStreamNewSimple_Call { | |
| 721 | + | _c.Call.Return(v) | |
| 722 | + | return _c | |
| 723 | + | } | |
| 724 | + | ||
| 725 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) RunAndReturn(run func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWStreamNewSimple_Call { | |
| 726 | + | _c.Call.Return(run) | |
| 727 | + | return _c | |
| 728 | + | } | |
| 729 | + | ||
| 730 | + | // PWStreamQueueBuffer provides a mock function for the type MockCAPI | |
| 731 | + | func (_mock *MockCAPI) PWStreamQueueBuffer(stream unsafe.Pointer, buffer unsafe.Pointer) int32 { | |
| 732 | + | ret := _mock.Called(stream, buffer) | |
| 733 | + | ||
| 734 | + | if len(ret) == 0 { | |
| 735 | + | panic("no return value specified for PWStreamQueueBuffer") | |
| 736 | + | } | |
| 737 | + | ||
| 738 | + | var r0 int32 | |
| 739 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, unsafe.Pointer) int32); ok { | |
| 740 | + | r0 = returnFunc(stream, buffer) | |
| 741 | + | } else { | |
| 742 | + | r0 = ret.Get(0).(int32) | |
| 743 | + | } | |
| 744 | + | return r0 | |
| 745 | + | } | |
| 746 | + | ||
| 747 | + | // MockCAPI_PWStreamQueueBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamQueueBuffer' | |
| 748 | + | type MockCAPI_PWStreamQueueBuffer_Call struct { | |
| 749 | + | *mock.Call | |
| 750 | + | } | |
| 751 | + | ||
| 752 | + | // PWStreamQueueBuffer is a helper method to define mock.On call | |
| 753 | + | // - stream unsafe.Pointer | |
| 754 | + | // - buffer unsafe.Pointer | |
| 755 | + | func (_e *MockCAPI_Expecter) PWStreamQueueBuffer(stream interface{}, buffer interface{}) *MockCAPI_PWStreamQueueBuffer_Call { | |
| 756 | + | return &MockCAPI_PWStreamQueueBuffer_Call{Call: _e.mock.On("PWStreamQueueBuffer", stream, buffer)} | |
| 757 | + | } | |
| 758 | + | ||
| 759 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) Run(run func(stream unsafe.Pointer, buffer unsafe.Pointer)) *MockCAPI_PWStreamQueueBuffer_Call { | |
| 760 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 761 | + | var arg0 unsafe.Pointer | |
| 762 | + | if args[0] != nil { | |
| 763 | + | arg0 = args[0].(unsafe.Pointer) | |
| 764 | + | } | |
| 765 | + | var arg1 unsafe.Pointer | |
| 766 | + | if args[1] != nil { | |
| 767 | + | arg1 = args[1].(unsafe.Pointer) | |
| 768 | + | } | |
| 769 | + | run( | |
| 770 | + | arg0, | |
| 771 | + | arg1, | |
| 772 | + | ) | |
| 773 | + | }) | |
| 774 | + | return _c | |
| 775 | + | } | |
| 776 | + | ||
| 777 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) Return(n int32) *MockCAPI_PWStreamQueueBuffer_Call { | |
| 778 | + | _c.Call.Return(n) | |
| 779 | + | return _c | |
| 780 | + | } | |
| 781 | + | ||
| 782 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) RunAndReturn(run func(stream unsafe.Pointer, buffer unsafe.Pointer) int32) *MockCAPI_PWStreamQueueBuffer_Call { | |
| 783 | + | _c.Call.Return(run) | |
| 784 | + | return _c | |
| 785 | + | } | |
| 786 | + | ||
| 787 | + | // PWStreamSetActive provides a mock function for the type MockCAPI | |
| 788 | + | func (_mock *MockCAPI) PWStreamSetActive(stream unsafe.Pointer, active bool) int32 { | |
| 789 | + | ret := _mock.Called(stream, active) | |
| 790 | + | ||
| 791 | + | if len(ret) == 0 { | |
| 792 | + | panic("no return value specified for PWStreamSetActive") | |
| 793 | + | } | |
| 794 | + | ||
| 795 | + | var r0 int32 | |
| 796 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, bool) int32); ok { | |
| 797 | + | r0 = returnFunc(stream, active) | |
| 798 | + | } else { | |
| 799 | + | r0 = ret.Get(0).(int32) | |
| 800 | + | } | |
| 801 | + | return r0 | |
| 802 | + | } | |
| 803 | + | ||
| 804 | + | // MockCAPI_PWStreamSetActive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamSetActive' | |
| 805 | + | type MockCAPI_PWStreamSetActive_Call struct { | |
| 806 | + | *mock.Call | |
| 807 | + | } | |
| 808 | + | ||
| 809 | + | // PWStreamSetActive is a helper method to define mock.On call | |
| 810 | + | // - stream unsafe.Pointer | |
| 811 | + | // - active bool | |
| 812 | + | func (_e *MockCAPI_Expecter) PWStreamSetActive(stream interface{}, active interface{}) *MockCAPI_PWStreamSetActive_Call { | |
| 813 | + | return &MockCAPI_PWStreamSetActive_Call{Call: _e.mock.On("PWStreamSetActive", stream, active)} | |
| 814 | + | } | |
| 815 | + | ||
| 816 | + | func (_c *MockCAPI_PWStreamSetActive_Call) Run(run func(stream unsafe.Pointer, active bool)) *MockCAPI_PWStreamSetActive_Call { | |
| 817 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 818 | + | var arg0 unsafe.Pointer | |
| 819 | + | if args[0] != nil { | |
| 820 | + | arg0 = args[0].(unsafe.Pointer) | |
| 821 | + | } | |
| 822 | + | var arg1 bool | |
| 823 | + | if args[1] != nil { | |
| 824 | + | arg1 = args[1].(bool) | |
| 825 | + | } | |
| 826 | + | run( | |
| 827 | + | arg0, | |
| 828 | + | arg1, | |
| 829 | + | ) | |
| 830 | + | }) | |
| 831 | + | return _c | |
| 832 | + | } | |
| 833 | + | ||
| 834 | + | func (_c *MockCAPI_PWStreamSetActive_Call) Return(n int32) *MockCAPI_PWStreamSetActive_Call { | |
| 835 | + | _c.Call.Return(n) | |
| 836 | + | return _c | |
| 837 | + | } | |
| 838 | + | ||
| 839 | + | func (_c *MockCAPI_PWStreamSetActive_Call) RunAndReturn(run func(stream unsafe.Pointer, active bool) int32) *MockCAPI_PWStreamSetActive_Call { | |
| 840 | + | _c.Call.Return(run) | |
| 841 | + | return _c | |
| 842 | + | } | |
| @@ -156,6 +156,57 @@ func (_c *MockCAPI_PWMainLoopDestroy_Call) RunAndReturn(run func(loop unsafe.Poi | |||||
| 156 | return _c | 156 | return _c | ||
| 157 | } | 157 | } | ||
| 158 | 158 | ||||
| 159 | + | // PWMainLoopGetLoop provides a mock function for the type MockCAPI | |||
| 160 | + | func (_mock *MockCAPI) PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer { | |||
| 161 | + | ret := _mock.Called(loop) | |||
| 162 | + | ||||
| 163 | + | if len(ret) == 0 { | |||
| 164 | + | panic("no return value specified for PWMainLoopGetLoop") | |||
| 165 | + | } | |||
| 166 | + | ||||
| 167 | + | var r0 unsafe.Pointer | |||
| 168 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |||
| 169 | + | r0 = returnFunc(loop) | |||
| 170 | + | } else { | |||
| 171 | + | r0 = ret.Get(0).(unsafe.Pointer) | |||
| 172 | + | } | |||
| 173 | + | return r0 | |||
| 174 | + | } | |||
| 175 | + | ||||
| 176 | + | // MockCAPI_PWMainLoopGetLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWMainLoopGetLoop' | |||
| 177 | + | type MockCAPI_PWMainLoopGetLoop_Call struct { | |||
| 178 | + | *mock.Call | |||
| 179 | + | } | |||
| 180 | + | ||||
| 181 | + | // PWMainLoopGetLoop is a helper method to define mock.On call | |||
| 182 | + | // - loop unsafe.Pointer | |||
| 183 | + | func (_e *MockCAPI_Expecter) PWMainLoopGetLoop(loop interface{}) *MockCAPI_PWMainLoopGetLoop_Call { | |||
| 184 | + | return &MockCAPI_PWMainLoopGetLoop_Call{Call: _e.mock.On("PWMainLoopGetLoop", loop)} | |||
| 185 | + | } | |||
| 186 | + | ||||
| 187 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) Run(run func(loop unsafe.Pointer)) *MockCAPI_PWMainLoopGetLoop_Call { | |||
| 188 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 189 | + | var arg0 unsafe.Pointer | |||
| 190 | + | if args[0] != nil { | |||
| 191 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 192 | + | } | |||
| 193 | + | run( | |||
| 194 | + | arg0, | |||
| 195 | + | ) | |||
| 196 | + | }) | |||
| 197 | + | return _c | |||
| 198 | + | } | |||
| 199 | + | ||||
| 200 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) Return(v unsafe.Pointer) *MockCAPI_PWMainLoopGetLoop_Call { | |||
| 201 | + | _c.Call.Return(v) | |||
| 202 | + | return _c | |||
| 203 | + | } | |||
| 204 | + | ||||
| 205 | + | func (_c *MockCAPI_PWMainLoopGetLoop_Call) RunAndReturn(run func(loop unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWMainLoopGetLoop_Call { | |||
| 206 | + | _c.Call.Return(run) | |||
| 207 | + | return _c | |||
| 208 | + | } | |||
| 209 | + | ||||
| 159 | // PWMainLoopNew provides a mock function for the type MockCAPI | 210 | // PWMainLoopNew provides a mock function for the type MockCAPI | ||
| 160 | func (_mock *MockCAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | 211 | func (_mock *MockCAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | ||
| 161 | ret := _mock.Called(props) | 212 | ret := _mock.Called(props) | ||
| @@ -308,3 +359,484 @@ func (_c *MockCAPI_PWMainLoopRun_Call) RunAndReturn(run func(loop unsafe.Pointer | |||||
| 308 | _c.Call.Return(run) | 359 | _c.Call.Return(run) | ||
| 309 | return _c | 360 | return _c | ||
| 310 | } | 361 | } | ||
| 362 | + | ||||
| 363 | + | // PWStreamAddListener provides a mock function for the type MockCAPI | |||
| 364 | + | func (_mock *MockCAPI) PWStreamAddListener(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32 { | |||
| 365 | + | ret := _mock.Called(stream, listener, events, data) | |||
| 366 | + | ||||
| 367 | + | if len(ret) == 0 { | |||
| 368 | + | panic("no return value specified for PWStreamAddListener") | |||
| 369 | + | } | |||
| 370 | + | ||||
| 371 | + | var r0 int32 | |||
| 372 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32); ok { | |||
| 373 | + | r0 = returnFunc(stream, listener, events, data) | |||
| 374 | + | } else { | |||
| 375 | + | r0 = ret.Get(0).(int32) | |||
| 376 | + | } | |||
| 377 | + | return r0 | |||
| 378 | + | } | |||
| 379 | + | ||||
| 380 | + | // MockCAPI_PWStreamAddListener_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamAddListener' | |||
| 381 | + | type MockCAPI_PWStreamAddListener_Call struct { | |||
| 382 | + | *mock.Call | |||
| 383 | + | } | |||
| 384 | + | ||||
| 385 | + | // PWStreamAddListener is a helper method to define mock.On call | |||
| 386 | + | // - stream unsafe.Pointer | |||
| 387 | + | // - listener unsafe.Pointer | |||
| 388 | + | // - events unsafe.Pointer | |||
| 389 | + | // - data unsafe.Pointer | |||
| 390 | + | func (_e *MockCAPI_Expecter) PWStreamAddListener(stream interface{}, listener interface{}, events interface{}, data interface{}) *MockCAPI_PWStreamAddListener_Call { | |||
| 391 | + | return &MockCAPI_PWStreamAddListener_Call{Call: _e.mock.On("PWStreamAddListener", stream, listener, events, data)} | |||
| 392 | + | } | |||
| 393 | + | ||||
| 394 | + | func (_c *MockCAPI_PWStreamAddListener_Call) Run(run func(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer)) *MockCAPI_PWStreamAddListener_Call { | |||
| 395 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 396 | + | var arg0 unsafe.Pointer | |||
| 397 | + | if args[0] != nil { | |||
| 398 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 399 | + | } | |||
| 400 | + | var arg1 unsafe.Pointer | |||
| 401 | + | if args[1] != nil { | |||
| 402 | + | arg1 = args[1].(unsafe.Pointer) | |||
| 403 | + | } | |||
| 404 | + | var arg2 unsafe.Pointer | |||
| 405 | + | if args[2] != nil { | |||
| 406 | + | arg2 = args[2].(unsafe.Pointer) | |||
| 407 | + | } | |||
| 408 | + | var arg3 unsafe.Pointer | |||
| 409 | + | if args[3] != nil { | |||
| 410 | + | arg3 = args[3].(unsafe.Pointer) | |||
| 411 | + | } | |||
| 412 | + | run( | |||
| 413 | + | arg0, | |||
| 414 | + | arg1, | |||
| 415 | + | arg2, | |||
| 416 | + | arg3, | |||
| 417 | + | ) | |||
| 418 | + | }) | |||
| 419 | + | return _c | |||
| 420 | + | } | |||
| 421 | + | ||||
| 422 | + | func (_c *MockCAPI_PWStreamAddListener_Call) Return(n int32) *MockCAPI_PWStreamAddListener_Call { | |||
| 423 | + | _c.Call.Return(n) | |||
| 424 | + | return _c | |||
| 425 | + | } | |||
| 426 | + | ||||
| 427 | + | func (_c *MockCAPI_PWStreamAddListener_Call) RunAndReturn(run func(stream unsafe.Pointer, listener unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) int32) *MockCAPI_PWStreamAddListener_Call { | |||
| 428 | + | _c.Call.Return(run) | |||
| 429 | + | return _c | |||
| 430 | + | } | |||
| 431 | + | ||||
| 432 | + | // PWStreamConnect provides a mock function for the type MockCAPI | |||
| 433 | + | func (_mock *MockCAPI) PWStreamConnect(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32 { | |||
| 434 | + | ret := _mock.Called(stream, direction, id, flags, ports, n_ports) | |||
| 435 | + | ||||
| 436 | + | if len(ret) == 0 { | |||
| 437 | + | panic("no return value specified for PWStreamConnect") | |||
| 438 | + | } | |||
| 439 | + | ||||
| 440 | + | var r0 int32 | |||
| 441 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, int32, uint32, uint32, unsafe.Pointer, uint32) int32); ok { | |||
| 442 | + | r0 = returnFunc(stream, direction, id, flags, ports, n_ports) | |||
| 443 | + | } else { | |||
| 444 | + | r0 = ret.Get(0).(int32) | |||
| 445 | + | } | |||
| 446 | + | return r0 | |||
| 447 | + | } | |||
| 448 | + | ||||
| 449 | + | // MockCAPI_PWStreamConnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamConnect' | |||
| 450 | + | type MockCAPI_PWStreamConnect_Call struct { | |||
| 451 | + | *mock.Call | |||
| 452 | + | } | |||
| 453 | + | ||||
| 454 | + | // PWStreamConnect is a helper method to define mock.On call | |||
| 455 | + | // - stream unsafe.Pointer | |||
| 456 | + | // - direction int32 | |||
| 457 | + | // - id uint32 | |||
| 458 | + | // - flags uint32 | |||
| 459 | + | // - ports unsafe.Pointer | |||
| 460 | + | // - n_ports uint32 | |||
| 461 | + | func (_e *MockCAPI_Expecter) PWStreamConnect(stream interface{}, direction interface{}, id interface{}, flags interface{}, ports interface{}, n_ports interface{}) *MockCAPI_PWStreamConnect_Call { | |||
| 462 | + | return &MockCAPI_PWStreamConnect_Call{Call: _e.mock.On("PWStreamConnect", stream, direction, id, flags, ports, n_ports)} | |||
| 463 | + | } | |||
| 464 | + | ||||
| 465 | + | func (_c *MockCAPI_PWStreamConnect_Call) Run(run func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32)) *MockCAPI_PWStreamConnect_Call { | |||
| 466 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 467 | + | var arg0 unsafe.Pointer | |||
| 468 | + | if args[0] != nil { | |||
| 469 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 470 | + | } | |||
| 471 | + | var arg1 int32 | |||
| 472 | + | if args[1] != nil { | |||
| 473 | + | arg1 = args[1].(int32) | |||
| 474 | + | } | |||
| 475 | + | var arg2 uint32 | |||
| 476 | + | if args[2] != nil { | |||
| 477 | + | arg2 = args[2].(uint32) | |||
| 478 | + | } | |||
| 479 | + | var arg3 uint32 | |||
| 480 | + | if args[3] != nil { | |||
| 481 | + | arg3 = args[3].(uint32) | |||
| 482 | + | } | |||
| 483 | + | var arg4 unsafe.Pointer | |||
| 484 | + | if args[4] != nil { | |||
| 485 | + | arg4 = args[4].(unsafe.Pointer) | |||
| 486 | + | } | |||
| 487 | + | var arg5 uint32 | |||
| 488 | + | if args[5] != nil { | |||
| 489 | + | arg5 = args[5].(uint32) | |||
| 490 | + | } | |||
| 491 | + | run( | |||
| 492 | + | arg0, | |||
| 493 | + | arg1, | |||
| 494 | + | arg2, | |||
| 495 | + | arg3, | |||
| 496 | + | arg4, | |||
| 497 | + | arg5, | |||
| 498 | + | ) | |||
| 499 | + | }) | |||
| 500 | + | return _c | |||
| 501 | + | } | |||
| 502 | + | ||||
| 503 | + | func (_c *MockCAPI_PWStreamConnect_Call) Return(n int32) *MockCAPI_PWStreamConnect_Call { | |||
| 504 | + | _c.Call.Return(n) | |||
| 505 | + | return _c | |||
| 506 | + | } | |||
| 507 | + | ||||
| 508 | + | func (_c *MockCAPI_PWStreamConnect_Call) RunAndReturn(run func(stream unsafe.Pointer, direction int32, id uint32, flags uint32, ports unsafe.Pointer, n_ports uint32) int32) *MockCAPI_PWStreamConnect_Call { | |||
| 509 | + | _c.Call.Return(run) | |||
| 510 | + | return _c | |||
| 511 | + | } | |||
| 512 | + | ||||
| 513 | + | // PWStreamDequeueBuffer provides a mock function for the type MockCAPI | |||
| 514 | + | func (_mock *MockCAPI) PWStreamDequeueBuffer(stream unsafe.Pointer) unsafe.Pointer { | |||
| 515 | + | ret := _mock.Called(stream) | |||
| 516 | + | ||||
| 517 | + | if len(ret) == 0 { | |||
| 518 | + | panic("no return value specified for PWStreamDequeueBuffer") | |||
| 519 | + | } | |||
| 520 | + | ||||
| 521 | + | var r0 unsafe.Pointer | |||
| 522 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |||
| 523 | + | r0 = returnFunc(stream) | |||
| 524 | + | } else { | |||
| 525 | + | r0 = ret.Get(0).(unsafe.Pointer) | |||
| 526 | + | } | |||
| 527 | + | return r0 | |||
| 528 | + | } | |||
| 529 | + | ||||
| 530 | + | // MockCAPI_PWStreamDequeueBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDequeueBuffer' | |||
| 531 | + | type MockCAPI_PWStreamDequeueBuffer_Call struct { | |||
| 532 | + | *mock.Call | |||
| 533 | + | } | |||
| 534 | + | ||||
| 535 | + | // PWStreamDequeueBuffer is a helper method to define mock.On call | |||
| 536 | + | // - stream unsafe.Pointer | |||
| 537 | + | func (_e *MockCAPI_Expecter) PWStreamDequeueBuffer(stream interface{}) *MockCAPI_PWStreamDequeueBuffer_Call { | |||
| 538 | + | return &MockCAPI_PWStreamDequeueBuffer_Call{Call: _e.mock.On("PWStreamDequeueBuffer", stream)} | |||
| 539 | + | } | |||
| 540 | + | ||||
| 541 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDequeueBuffer_Call { | |||
| 542 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 543 | + | var arg0 unsafe.Pointer | |||
| 544 | + | if args[0] != nil { | |||
| 545 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 546 | + | } | |||
| 547 | + | run( | |||
| 548 | + | arg0, | |||
| 549 | + | ) | |||
| 550 | + | }) | |||
| 551 | + | return _c | |||
| 552 | + | } | |||
| 553 | + | ||||
| 554 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) Return(v unsafe.Pointer) *MockCAPI_PWStreamDequeueBuffer_Call { | |||
| 555 | + | _c.Call.Return(v) | |||
| 556 | + | return _c | |||
| 557 | + | } | |||
| 558 | + | ||||
| 559 | + | func (_c *MockCAPI_PWStreamDequeueBuffer_Call) RunAndReturn(run func(stream unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWStreamDequeueBuffer_Call { | |||
| 560 | + | _c.Call.Return(run) | |||
| 561 | + | return _c | |||
| 562 | + | } | |||
| 563 | + | ||||
| 564 | + | // PWStreamDestroy provides a mock function for the type MockCAPI | |||
| 565 | + | func (_mock *MockCAPI) PWStreamDestroy(stream unsafe.Pointer) { | |||
| 566 | + | _mock.Called(stream) | |||
| 567 | + | return | |||
| 568 | + | } | |||
| 569 | + | ||||
| 570 | + | // MockCAPI_PWStreamDestroy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDestroy' | |||
| 571 | + | type MockCAPI_PWStreamDestroy_Call struct { | |||
| 572 | + | *mock.Call | |||
| 573 | + | } | |||
| 574 | + | ||||
| 575 | + | // PWStreamDestroy is a helper method to define mock.On call | |||
| 576 | + | // - stream unsafe.Pointer | |||
| 577 | + | func (_e *MockCAPI_Expecter) PWStreamDestroy(stream interface{}) *MockCAPI_PWStreamDestroy_Call { | |||
| 578 | + | return &MockCAPI_PWStreamDestroy_Call{Call: _e.mock.On("PWStreamDestroy", stream)} | |||
| 579 | + | } | |||
| 580 | + | ||||
| 581 | + | func (_c *MockCAPI_PWStreamDestroy_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDestroy_Call { | |||
| 582 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 583 | + | var arg0 unsafe.Pointer | |||
| 584 | + | if args[0] != nil { | |||
| 585 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 586 | + | } | |||
| 587 | + | run( | |||
| 588 | + | arg0, | |||
| 589 | + | ) | |||
| 590 | + | }) | |||
| 591 | + | return _c | |||
| 592 | + | } | |||
| 593 | + | ||||
| 594 | + | func (_c *MockCAPI_PWStreamDestroy_Call) Return() *MockCAPI_PWStreamDestroy_Call { | |||
| 595 | + | _c.Call.Return() | |||
| 596 | + | return _c | |||
| 597 | + | } | |||
| 598 | + | ||||
| 599 | + | func (_c *MockCAPI_PWStreamDestroy_Call) RunAndReturn(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDestroy_Call { | |||
| 600 | + | _c.Run(run) | |||
| 601 | + | return _c | |||
| 602 | + | } | |||
| 603 | + | ||||
| 604 | + | // PWStreamDisconnect provides a mock function for the type MockCAPI | |||
| 605 | + | func (_mock *MockCAPI) PWStreamDisconnect(stream unsafe.Pointer) int32 { | |||
| 606 | + | ret := _mock.Called(stream) | |||
| 607 | + | ||||
| 608 | + | if len(ret) == 0 { | |||
| 609 | + | panic("no return value specified for PWStreamDisconnect") | |||
| 610 | + | } | |||
| 611 | + | ||||
| 612 | + | var r0 int32 | |||
| 613 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) int32); ok { | |||
| 614 | + | r0 = returnFunc(stream) | |||
| 615 | + | } else { | |||
| 616 | + | r0 = ret.Get(0).(int32) | |||
| 617 | + | } | |||
| 618 | + | return r0 | |||
| 619 | + | } | |||
| 620 | + | ||||
| 621 | + | // MockCAPI_PWStreamDisconnect_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamDisconnect' | |||
| 622 | + | type MockCAPI_PWStreamDisconnect_Call struct { | |||
| 623 | + | *mock.Call | |||
| 624 | + | } | |||
| 625 | + | ||||
| 626 | + | // PWStreamDisconnect is a helper method to define mock.On call | |||
| 627 | + | // - stream unsafe.Pointer | |||
| 628 | + | func (_e *MockCAPI_Expecter) PWStreamDisconnect(stream interface{}) *MockCAPI_PWStreamDisconnect_Call { | |||
| 629 | + | return &MockCAPI_PWStreamDisconnect_Call{Call: _e.mock.On("PWStreamDisconnect", stream)} | |||
| 630 | + | } | |||
| 631 | + | ||||
| 632 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) Run(run func(stream unsafe.Pointer)) *MockCAPI_PWStreamDisconnect_Call { | |||
| 633 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 634 | + | var arg0 unsafe.Pointer | |||
| 635 | + | if args[0] != nil { | |||
| 636 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 637 | + | } | |||
| 638 | + | run( | |||
| 639 | + | arg0, | |||
| 640 | + | ) | |||
| 641 | + | }) | |||
| 642 | + | return _c | |||
| 643 | + | } | |||
| 644 | + | ||||
| 645 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) Return(n int32) *MockCAPI_PWStreamDisconnect_Call { | |||
| 646 | + | _c.Call.Return(n) | |||
| 647 | + | return _c | |||
| 648 | + | } | |||
| 649 | + | ||||
| 650 | + | func (_c *MockCAPI_PWStreamDisconnect_Call) RunAndReturn(run func(stream unsafe.Pointer) int32) *MockCAPI_PWStreamDisconnect_Call { | |||
| 651 | + | _c.Call.Return(run) | |||
| 652 | + | return _c | |||
| 653 | + | } | |||
| 654 | + | ||||
| 655 | + | // PWStreamNewSimple provides a mock function for the type MockCAPI | |||
| 656 | + | func (_mock *MockCAPI) PWStreamNewSimple(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer { | |||
| 657 | + | ret := _mock.Called(context, name, props, events, data) | |||
| 658 | + | ||||
| 659 | + | if len(ret) == 0 { | |||
| 660 | + | panic("no return value specified for PWStreamNewSimple") | |||
| 661 | + | } | |||
| 662 | + | ||||
| 663 | + | var r0 unsafe.Pointer | |||
| 664 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, *byte, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer); ok { | |||
| 665 | + | r0 = returnFunc(context, name, props, events, data) | |||
| 666 | + | } else { | |||
| 667 | + | r0 = ret.Get(0).(unsafe.Pointer) | |||
| 668 | + | } | |||
| 669 | + | return r0 | |||
| 670 | + | } | |||
| 671 | + | ||||
| 672 | + | // MockCAPI_PWStreamNewSimple_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamNewSimple' | |||
| 673 | + | type MockCAPI_PWStreamNewSimple_Call struct { | |||
| 674 | + | *mock.Call | |||
| 675 | + | } | |||
| 676 | + | ||||
| 677 | + | // PWStreamNewSimple is a helper method to define mock.On call | |||
| 678 | + | // - context unsafe.Pointer | |||
| 679 | + | // - name *byte | |||
| 680 | + | // - props unsafe.Pointer | |||
| 681 | + | // - events unsafe.Pointer | |||
| 682 | + | // - data unsafe.Pointer | |||
| 683 | + | func (_e *MockCAPI_Expecter) PWStreamNewSimple(context interface{}, name interface{}, props interface{}, events interface{}, data interface{}) *MockCAPI_PWStreamNewSimple_Call { | |||
| 684 | + | return &MockCAPI_PWStreamNewSimple_Call{Call: _e.mock.On("PWStreamNewSimple", context, name, props, events, data)} | |||
| 685 | + | } | |||
| 686 | + | ||||
| 687 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) Run(run func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer)) *MockCAPI_PWStreamNewSimple_Call { | |||
| 688 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 689 | + | var arg0 unsafe.Pointer | |||
| 690 | + | if args[0] != nil { | |||
| 691 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 692 | + | } | |||
| 693 | + | var arg1 *byte | |||
| 694 | + | if args[1] != nil { | |||
| 695 | + | arg1 = args[1].(*byte) | |||
| 696 | + | } | |||
| 697 | + | var arg2 unsafe.Pointer | |||
| 698 | + | if args[2] != nil { | |||
| 699 | + | arg2 = args[2].(unsafe.Pointer) | |||
| 700 | + | } | |||
| 701 | + | var arg3 unsafe.Pointer | |||
| 702 | + | if args[3] != nil { | |||
| 703 | + | arg3 = args[3].(unsafe.Pointer) | |||
| 704 | + | } | |||
| 705 | + | var arg4 unsafe.Pointer | |||
| 706 | + | if args[4] != nil { | |||
| 707 | + | arg4 = args[4].(unsafe.Pointer) | |||
| 708 | + | } | |||
| 709 | + | run( | |||
| 710 | + | arg0, | |||
| 711 | + | arg1, | |||
| 712 | + | arg2, | |||
| 713 | + | arg3, | |||
| 714 | + | arg4, | |||
| 715 | + | ) | |||
| 716 | + | }) | |||
| 717 | + | return _c | |||
| 718 | + | } | |||
| 719 | + | ||||
| 720 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) Return(v unsafe.Pointer) *MockCAPI_PWStreamNewSimple_Call { | |||
| 721 | + | _c.Call.Return(v) | |||
| 722 | + | return _c | |||
| 723 | + | } | |||
| 724 | + | ||||
| 725 | + | func (_c *MockCAPI_PWStreamNewSimple_Call) RunAndReturn(run func(context unsafe.Pointer, name *byte, props unsafe.Pointer, events unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer) *MockCAPI_PWStreamNewSimple_Call { | |||
| 726 | + | _c.Call.Return(run) | |||
| 727 | + | return _c | |||
| 728 | + | } | |||
| 729 | + | ||||
| 730 | + | // PWStreamQueueBuffer provides a mock function for the type MockCAPI | |||
| 731 | + | func (_mock *MockCAPI) PWStreamQueueBuffer(stream unsafe.Pointer, buffer unsafe.Pointer) int32 { | |||
| 732 | + | ret := _mock.Called(stream, buffer) | |||
| 733 | + | ||||
| 734 | + | if len(ret) == 0 { | |||
| 735 | + | panic("no return value specified for PWStreamQueueBuffer") | |||
| 736 | + | } | |||
| 737 | + | ||||
| 738 | + | var r0 int32 | |||
| 739 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, unsafe.Pointer) int32); ok { | |||
| 740 | + | r0 = returnFunc(stream, buffer) | |||
| 741 | + | } else { | |||
| 742 | + | r0 = ret.Get(0).(int32) | |||
| 743 | + | } | |||
| 744 | + | return r0 | |||
| 745 | + | } | |||
| 746 | + | ||||
| 747 | + | // MockCAPI_PWStreamQueueBuffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamQueueBuffer' | |||
| 748 | + | type MockCAPI_PWStreamQueueBuffer_Call struct { | |||
| 749 | + | *mock.Call | |||
| 750 | + | } | |||
| 751 | + | ||||
| 752 | + | // PWStreamQueueBuffer is a helper method to define mock.On call | |||
| 753 | + | // - stream unsafe.Pointer | |||
| 754 | + | // - buffer unsafe.Pointer | |||
| 755 | + | func (_e *MockCAPI_Expecter) PWStreamQueueBuffer(stream interface{}, buffer interface{}) *MockCAPI_PWStreamQueueBuffer_Call { | |||
| 756 | + | return &MockCAPI_PWStreamQueueBuffer_Call{Call: _e.mock.On("PWStreamQueueBuffer", stream, buffer)} | |||
| 757 | + | } | |||
| 758 | + | ||||
| 759 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) Run(run func(stream unsafe.Pointer, buffer unsafe.Pointer)) *MockCAPI_PWStreamQueueBuffer_Call { | |||
| 760 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 761 | + | var arg0 unsafe.Pointer | |||
| 762 | + | if args[0] != nil { | |||
| 763 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 764 | + | } | |||
| 765 | + | var arg1 unsafe.Pointer | |||
| 766 | + | if args[1] != nil { | |||
| 767 | + | arg1 = args[1].(unsafe.Pointer) | |||
| 768 | + | } | |||
| 769 | + | run( | |||
| 770 | + | arg0, | |||
| 771 | + | arg1, | |||
| 772 | + | ) | |||
| 773 | + | }) | |||
| 774 | + | return _c | |||
| 775 | + | } | |||
| 776 | + | ||||
| 777 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) Return(n int32) *MockCAPI_PWStreamQueueBuffer_Call { | |||
| 778 | + | _c.Call.Return(n) | |||
| 779 | + | return _c | |||
| 780 | + | } | |||
| 781 | + | ||||
| 782 | + | func (_c *MockCAPI_PWStreamQueueBuffer_Call) RunAndReturn(run func(stream unsafe.Pointer, buffer unsafe.Pointer) int32) *MockCAPI_PWStreamQueueBuffer_Call { | |||
| 783 | + | _c.Call.Return(run) | |||
| 784 | + | return _c | |||
| 785 | + | } | |||
| 786 | + | ||||
| 787 | + | // PWStreamSetActive provides a mock function for the type MockCAPI | |||
| 788 | + | func (_mock *MockCAPI) PWStreamSetActive(stream unsafe.Pointer, active bool) int32 { | |||
| 789 | + | ret := _mock.Called(stream, active) | |||
| 790 | + | ||||
| 791 | + | if len(ret) == 0 { | |||
| 792 | + | panic("no return value specified for PWStreamSetActive") | |||
| 793 | + | } | |||
| 794 | + | ||||
| 795 | + | var r0 int32 | |||
| 796 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer, bool) int32); ok { | |||
| 797 | + | r0 = returnFunc(stream, active) | |||
| 798 | + | } else { | |||
| 799 | + | r0 = ret.Get(0).(int32) | |||
| 800 | + | } | |||
| 801 | + | return r0 | |||
| 802 | + | } | |||
| 803 | + | ||||
| 804 | + | // MockCAPI_PWStreamSetActive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWStreamSetActive' | |||
| 805 | + | type MockCAPI_PWStreamSetActive_Call struct { | |||
| 806 | + | *mock.Call | |||
| 807 | + | } | |||
| 808 | + | ||||
| 809 | + | // PWStreamSetActive is a helper method to define mock.On call | |||
| 810 | + | // - stream unsafe.Pointer | |||
| 811 | + | // - active bool | |||
| 812 | + | func (_e *MockCAPI_Expecter) PWStreamSetActive(stream interface{}, active interface{}) *MockCAPI_PWStreamSetActive_Call { | |||
| 813 | + | return &MockCAPI_PWStreamSetActive_Call{Call: _e.mock.On("PWStreamSetActive", stream, active)} | |||
| 814 | + | } | |||
| 815 | + | ||||
| 816 | + | func (_c *MockCAPI_PWStreamSetActive_Call) Run(run func(stream unsafe.Pointer, active bool)) *MockCAPI_PWStreamSetActive_Call { | |||
| 817 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 818 | + | var arg0 unsafe.Pointer | |||
| 819 | + | if args[0] != nil { | |||
| 820 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 821 | + | } | |||
| 822 | + | var arg1 bool | |||
| 823 | + | if args[1] != nil { | |||
| 824 | + | arg1 = args[1].(bool) | |||
| 825 | + | } | |||
| 826 | + | run( | |||
| 827 | + | arg0, | |||
| 828 | + | arg1, | |||
| 829 | + | ) | |||
| 830 | + | }) | |||
| 831 | + | return _c | |||
| 832 | + | } | |||
| 833 | + | ||||
| 834 | + | func (_c *MockCAPI_PWStreamSetActive_Call) Return(n int32) *MockCAPI_PWStreamSetActive_Call { | |||
| 835 | + | _c.Call.Return(n) | |||
| 836 | + | return _c | |||
| 837 | + | } | |||
| 838 | + | ||||
| 839 | + | func (_c *MockCAPI_PWStreamSetActive_Call) RunAndReturn(run func(stream unsafe.Pointer, active bool) int32) *MockCAPI_PWStreamSetActive_Call { | |||
| 840 | + | _c.Call.Return(run) | |||
| 841 | + | return _c | |||
| 842 | + | } | |||
M internal/ports/out/mocks/mock_LoopAPI.go +51 -0
| @@ -77,6 +77,57 @@ func (_c *MockLoopAPI_PWMainLoopDestroy_Call) RunAndReturn(run func(loop unsafe. | |||
| 77 | 77 | return _c | |
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | + | // PWMainLoopGetLoop provides a mock function for the type MockLoopAPI | |
| 81 | + | func (_mock *MockLoopAPI) PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer { | |
| 82 | + | ret := _mock.Called(loop) | |
| 83 | + | ||
| 84 | + | if len(ret) == 0 { | |
| 85 | + | panic("no return value specified for PWMainLoopGetLoop") | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var r0 unsafe.Pointer | |
| 89 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |
| 90 | + | r0 = returnFunc(loop) | |
| 91 | + | } else { | |
| 92 | + | r0 = ret.Get(0).(unsafe.Pointer) | |
| 93 | + | } | |
| 94 | + | return r0 | |
| 95 | + | } | |
| 96 | + | ||
| 97 | + | // MockLoopAPI_PWMainLoopGetLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWMainLoopGetLoop' | |
| 98 | + | type MockLoopAPI_PWMainLoopGetLoop_Call struct { | |
| 99 | + | *mock.Call | |
| 100 | + | } | |
| 101 | + | ||
| 102 | + | // PWMainLoopGetLoop is a helper method to define mock.On call | |
| 103 | + | // - loop unsafe.Pointer | |
| 104 | + | func (_e *MockLoopAPI_Expecter) PWMainLoopGetLoop(loop interface{}) *MockLoopAPI_PWMainLoopGetLoop_Call { | |
| 105 | + | return &MockLoopAPI_PWMainLoopGetLoop_Call{Call: _e.mock.On("PWMainLoopGetLoop", loop)} | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) Run(run func(loop unsafe.Pointer)) *MockLoopAPI_PWMainLoopGetLoop_Call { | |
| 109 | + | _c.Call.Run(func(args mock.Arguments) { | |
| 110 | + | var arg0 unsafe.Pointer | |
| 111 | + | if args[0] != nil { | |
| 112 | + | arg0 = args[0].(unsafe.Pointer) | |
| 113 | + | } | |
| 114 | + | run( | |
| 115 | + | arg0, | |
| 116 | + | ) | |
| 117 | + | }) | |
| 118 | + | return _c | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) Return(v unsafe.Pointer) *MockLoopAPI_PWMainLoopGetLoop_Call { | |
| 122 | + | _c.Call.Return(v) | |
| 123 | + | return _c | |
| 124 | + | } | |
| 125 | + | ||
| 126 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) RunAndReturn(run func(loop unsafe.Pointer) unsafe.Pointer) *MockLoopAPI_PWMainLoopGetLoop_Call { | |
| 127 | + | _c.Call.Return(run) | |
| 128 | + | return _c | |
| 129 | + | } | |
| 130 | + | ||
| 80 | 131 | // PWMainLoopNew provides a mock function for the type MockLoopAPI | |
| 81 | 132 | func (_mock *MockLoopAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | |
| 82 | 133 | ret := _mock.Called(props) | |
| @@ -77,6 +77,57 @@ func (_c *MockLoopAPI_PWMainLoopDestroy_Call) RunAndReturn(run func(loop unsafe. | |||||
| 77 | return _c | 77 | return _c | ||
| 78 | } | 78 | } | ||
| 79 | 79 | ||||
| 80 | + | // PWMainLoopGetLoop provides a mock function for the type MockLoopAPI | |||
| 81 | + | func (_mock *MockLoopAPI) PWMainLoopGetLoop(loop unsafe.Pointer) unsafe.Pointer { | |||
| 82 | + | ret := _mock.Called(loop) | |||
| 83 | + | ||||
| 84 | + | if len(ret) == 0 { | |||
| 85 | + | panic("no return value specified for PWMainLoopGetLoop") | |||
| 86 | + | } | |||
| 87 | + | ||||
| 88 | + | var r0 unsafe.Pointer | |||
| 89 | + | if returnFunc, ok := ret.Get(0).(func(unsafe.Pointer) unsafe.Pointer); ok { | |||
| 90 | + | r0 = returnFunc(loop) | |||
| 91 | + | } else { | |||
| 92 | + | r0 = ret.Get(0).(unsafe.Pointer) | |||
| 93 | + | } | |||
| 94 | + | return r0 | |||
| 95 | + | } | |||
| 96 | + | ||||
| 97 | + | // MockLoopAPI_PWMainLoopGetLoop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PWMainLoopGetLoop' | |||
| 98 | + | type MockLoopAPI_PWMainLoopGetLoop_Call struct { | |||
| 99 | + | *mock.Call | |||
| 100 | + | } | |||
| 101 | + | ||||
| 102 | + | // PWMainLoopGetLoop is a helper method to define mock.On call | |||
| 103 | + | // - loop unsafe.Pointer | |||
| 104 | + | func (_e *MockLoopAPI_Expecter) PWMainLoopGetLoop(loop interface{}) *MockLoopAPI_PWMainLoopGetLoop_Call { | |||
| 105 | + | return &MockLoopAPI_PWMainLoopGetLoop_Call{Call: _e.mock.On("PWMainLoopGetLoop", loop)} | |||
| 106 | + | } | |||
| 107 | + | ||||
| 108 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) Run(run func(loop unsafe.Pointer)) *MockLoopAPI_PWMainLoopGetLoop_Call { | |||
| 109 | + | _c.Call.Run(func(args mock.Arguments) { | |||
| 110 | + | var arg0 unsafe.Pointer | |||
| 111 | + | if args[0] != nil { | |||
| 112 | + | arg0 = args[0].(unsafe.Pointer) | |||
| 113 | + | } | |||
| 114 | + | run( | |||
| 115 | + | arg0, | |||
| 116 | + | ) | |||
| 117 | + | }) | |||
| 118 | + | return _c | |||
| 119 | + | } | |||
| 120 | + | ||||
| 121 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) Return(v unsafe.Pointer) *MockLoopAPI_PWMainLoopGetLoop_Call { | |||
| 122 | + | _c.Call.Return(v) | |||
| 123 | + | return _c | |||
| 124 | + | } | |||
| 125 | + | ||||
| 126 | + | func (_c *MockLoopAPI_PWMainLoopGetLoop_Call) RunAndReturn(run func(loop unsafe.Pointer) unsafe.Pointer) *MockLoopAPI_PWMainLoopGetLoop_Call { | |||
| 127 | + | _c.Call.Return(run) | |||
| 128 | + | return _c | |||
| 129 | + | } | |||
| 130 | + | ||||
| 80 | // PWMainLoopNew provides a mock function for the type MockLoopAPI | 131 | // PWMainLoopNew provides a mock function for the type MockLoopAPI | ||
| 81 | func (_mock *MockLoopAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | 132 | func (_mock *MockLoopAPI) PWMainLoopNew(props unsafe.Pointer) unsafe.Pointer { | ||
| 82 | ret := _mock.Called(props) | 133 | ret := _mock.Called(props) | ||