1 #![allow(dead_code)]
2 
3 use std::marker::PhantomData;
4 
5 use CreationError;
6 use DefaultFormatError;
7 use Format;
8 use FormatsEnumerationError;
9 use StreamData;
10 use SupportedFormat;
11 
12 pub struct EventLoop;
13 
14 impl EventLoop {
15     #[inline]
new() -> EventLoop16     pub fn new() -> EventLoop {
17         EventLoop
18     }
19 
20     #[inline]
run<F>(&self, _callback: F) -> ! where F: FnMut(StreamId, StreamData)21     pub fn run<F>(&self, _callback: F) -> !
22         where F: FnMut(StreamId, StreamData)
23     {
24         loop { /* TODO: don't spin */ }
25     }
26 
27     #[inline]
build_input_stream(&self, _: &Device, _: &Format) -> Result<StreamId, CreationError>28     pub fn build_input_stream(&self, _: &Device, _: &Format) -> Result<StreamId, CreationError> {
29         Err(CreationError::DeviceNotAvailable)
30     }
31 
32     #[inline]
build_output_stream(&self, _: &Device, _: &Format) -> Result<StreamId, CreationError>33     pub fn build_output_stream(&self, _: &Device, _: &Format) -> Result<StreamId, CreationError> {
34         Err(CreationError::DeviceNotAvailable)
35     }
36 
37     #[inline]
destroy_stream(&self, _: StreamId)38     pub fn destroy_stream(&self, _: StreamId) {
39         unimplemented!()
40     }
41 
42     #[inline]
play_stream(&self, _: StreamId)43     pub fn play_stream(&self, _: StreamId) {
44         panic!()
45     }
46 
47     #[inline]
pause_stream(&self, _: StreamId)48     pub fn pause_stream(&self, _: StreamId) {
49         panic!()
50     }
51 }
52 
53 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
54 pub struct StreamId;
55 
56 #[derive(Default)]
57 pub struct Devices;
58 
59 impl Iterator for Devices {
60     type Item = Device;
61 
62     #[inline]
next(&mut self) -> Option<Device>63     fn next(&mut self) -> Option<Device> {
64         None
65     }
66 }
67 
68 #[inline]
default_input_device() -> Option<Device>69 pub fn default_input_device() -> Option<Device> {
70     None
71 }
72 
73 #[inline]
default_output_device() -> Option<Device>74 pub fn default_output_device() -> Option<Device> {
75     None
76 }
77 
78 #[derive(Clone, Debug, PartialEq, Eq)]
79 pub struct Device;
80 
81 impl Device {
82     #[inline]
supported_input_formats(&self) -> Result<SupportedInputFormats, FormatsEnumerationError>83     pub fn supported_input_formats(&self) -> Result<SupportedInputFormats, FormatsEnumerationError> {
84         unimplemented!()
85     }
86 
87     #[inline]
supported_output_formats(&self) -> Result<SupportedOutputFormats, FormatsEnumerationError>88     pub fn supported_output_formats(&self) -> Result<SupportedOutputFormats, FormatsEnumerationError> {
89         unimplemented!()
90     }
91 
92     #[inline]
default_input_format(&self) -> Result<Format, DefaultFormatError>93     pub fn default_input_format(&self) -> Result<Format, DefaultFormatError> {
94         unimplemented!()
95     }
96 
97     #[inline]
default_output_format(&self) -> Result<Format, DefaultFormatError>98     pub fn default_output_format(&self) -> Result<Format, DefaultFormatError> {
99         unimplemented!()
100     }
101 
102     #[inline]
name(&self) -> String103     pub fn name(&self) -> String {
104         "null".to_owned()
105     }
106 }
107 
108 pub struct SupportedInputFormats;
109 pub struct SupportedOutputFormats;
110 
111 impl Iterator for SupportedInputFormats {
112     type Item = SupportedFormat;
113 
114     #[inline]
next(&mut self) -> Option<SupportedFormat>115     fn next(&mut self) -> Option<SupportedFormat> {
116         None
117     }
118 }
119 
120 impl Iterator for SupportedOutputFormats {
121     type Item = SupportedFormat;
122 
123     #[inline]
next(&mut self) -> Option<SupportedFormat>124     fn next(&mut self) -> Option<SupportedFormat> {
125         None
126     }
127 }
128 
129 pub struct InputBuffer<'a, T: 'a> {
130     marker: PhantomData<&'a T>,
131 }
132 
133 pub struct OutputBuffer<'a, T: 'a> {
134     marker: PhantomData<&'a mut T>,
135 }
136 
137 impl<'a, T> InputBuffer<'a, T> {
138     #[inline]
buffer(&self) -> &[T]139     pub fn buffer(&self) -> &[T] {
140         unimplemented!()
141     }
142 
143     #[inline]
finish(self)144     pub fn finish(self) {
145     }
146 }
147 
148 impl<'a, T> OutputBuffer<'a, T> {
149     #[inline]
buffer(&mut self) -> &mut [T]150     pub fn buffer(&mut self) -> &mut [T] {
151         unimplemented!()
152     }
153 
154     #[inline]
len(&self) -> usize155     pub fn len(&self) -> usize {
156         0
157     }
158 
159     #[inline]
finish(self)160     pub fn finish(self) {
161     }
162 }
163