You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As i understand it, an audio unit can have several inputs and several
outputs, and an 'element' is just an index of one of those.
(https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html).
Therefore, it's should be possible, for example, to have several render
callbacks for a single audio unit. An example would be a crossfade unit
with 2 inputs: it'll have 2 elements in its input scope and 1 in output
scope, and it'll require either two render callbacks (one for each input),
or two upstream audio units.
This changes Element to be just a number and adds explicit element
parameter to all the places where it hasn't been present before
(i.e. setting callbacks and input/output stream formats).
I also had to change handling of render callbacks a bit, since there can
now be more than one of them for a single audio unit.
This relates to the issue #60 and PR #47.
Copy file name to clipboardExpand all lines: src/audio_unit/mod.rs
+25-22Lines changed: 25 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ pub use self::types::{
37
37
MixerType,
38
38
MusicDeviceType,
39
39
};
40
+
use std::collections::HashMap;
40
41
41
42
42
43
pubmod audio_format;
@@ -62,22 +63,17 @@ pub enum Scope {
62
63
LayerItem = 7,
63
64
}
64
65
65
-
/// Represents the **Input** and **Output** **Element**s.
66
-
///
67
-
/// These are used when specifying which **Element** we're setting the properties of.
68
-
#[derive(Copy,Clone,Debug)]
69
-
pubenumElement{
70
-
Output = 0,
71
-
Input = 1,
72
-
}
66
+
/// These are used when specifying which **Element** (bus) we're setting the properties of.
67
+
/// [The anatomy of an AudioUnit](https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html#//apple_ref/doc/uid/TP40003278-CH12-SW11)
68
+
typeElement = u32;
73
69
74
70
75
71
/// A rust representation of the sys::AudioUnit, including a pointer to the current rendering callback.
76
72
///
77
73
/// Find the original Audio Unit Programming Guide [here](https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html).
0 commit comments