apple-cf 0.7.1

Safe Rust bindings for Apple's shared Core* frameworks (CoreFoundation, CoreMedia, CoreVideo, CoreGraphics, IOSurface, Dispatch).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use apple_cf::cm::{CMClock, CMTime, CMTimeRange, CMTimebase};

fn main() {
    let range = CMTimeRange::new(CMTime::new(0, 600), CMTime::new(300, 600));
    assert_eq!(range.end(), CMTime::new(300, 600));
    assert!(range.contains_time(CMTime::new(150, 600)));

    let clock = CMClock::host_time_clock();
    let timebase = CMTimebase::with_master_clock(&clock).expect("timebase");
    assert_eq!(timebase.set_rate(1.0), 0);
    assert_eq!(timebase.set_time(CMTime::new(0, 600)), 0);
    assert!(timebase.time().is_valid());
}