MCPcopy Create free account
hub / github.com/Recordscript/recordscript / build

Method build

libs/scrap/src/quartz/config.rs:23–63  ·  view source on GitHub ↗

Don't forget to CFRelease this!

(self)

Source from the content-addressed store, hash-verified

21impl Config {
22 /// Don't forget to CFRelease this!
23 pub fn build(self) -> CFDictionaryRef {
24 unsafe {
25 let throttle = CFNumberCreate(
26 ptr::null_mut(),
27 CFNumberType::Float64,
28 &self.throttle as *const _ as *const c_void,
29 );
30 let queue_length = CFNumberCreate(
31 ptr::null_mut(),
32 CFNumberType::SInt8,
33 &self.queue_length as *const _ as *const c_void,
34 );
35
36 let keys: [CFStringRef; 4] = [
37 kCGDisplayStreamShowCursor,
38 kCGDisplayStreamPreserveAspectRatio,
39 kCGDisplayStreamMinimumFrameTime,
40 kCGDisplayStreamQueueDepth,
41 ];
42 let values: [*mut c_void; 4] = [
43 cfbool(self.cursor),
44 cfbool(self.letterbox),
45 throttle,
46 queue_length,
47 ];
48
49 let res = CFDictionaryCreate(
50 ptr::null_mut(),
51 keys.as_ptr(),
52 values.as_ptr(),
53 4,
54 &kCFTypeDictionaryKeyCallBacks,
55 &kCFTypeDictionaryValueCallBacks,
56 );
57
58 CFRelease(throttle);
59 CFRelease(queue_length);
60
61 res
62 }
63 }
64}
65
66impl Default for Config {

Callers 5

newMethod · 0.80
mainFunction · 0.80
previewMethod · 0.80
auto_smtp_transportMethod · 0.80
decode_audioFunction · 0.80

Calls 1

cfboolFunction · 0.85

Tested by

no test coverage detected