@@ -70,6 +70,10 @@ use crate::sys::SDL_AudioStatus;
70
70
71
71
impl AudioSubsystem {
72
72
/// Opens a new audio device given the desired parameters and callback.
73
+ ///
74
+ /// If you want to modify the callback-owned data at a later point (for example to update
75
+ /// its data buffer) you're likely to be interested in the
76
+ /// [AudioDevice.lock method](audio/struct.AudioDevice.html#method.lock).
73
77
#[ inline]
74
78
pub fn open_playback < ' a , CB , F , D > ( & self , device : D , spec : & AudioSpecDesired , get_callback : F ) -> Result < AudioDevice < CB > , String >
75
79
where CB : AudioCallback , F : FnOnce ( AudioSpec ) -> CB , D : Into < Option < & ' a str > > ,
@@ -79,6 +83,10 @@ impl AudioSubsystem {
79
83
80
84
/// Opens a new audio device for capture (given the desired parameters and callback).
81
85
/// Supported since SDL 2.0.5
86
+ ///
87
+ /// If you want to modify the callback-owned data at a later point (for example to update
88
+ /// its data buffer) you're likely to be interested in the
89
+ /// [AudioDevice.lock method](audio/struct.AudioDevice.html#method.lock).
82
90
pub fn open_capture < ' a , CB , F , D > ( & self , device : D , spec : & AudioSpecDesired , get_callback : F ) -> Result < AudioDevice < CB > , String >
83
91
where CB : AudioCallback , F : FnOnce ( AudioSpec ) -> CB , D : Into < Option < & ' a str > > ,
84
92
{
@@ -646,6 +654,9 @@ impl<CB: AudioCallback> AudioDevice<CB> {
646
654
}
647
655
648
656
/// Opens a new audio device for playback (given the desired parameters and callback).
657
+ ///
658
+ /// If you want to modify the callback-owned data at a later point (for example to update
659
+ /// its data buffer) you're likely to be interested in the [lock method](#method.lock).
649
660
pub fn open_playback < ' a , F , D > ( a : & AudioSubsystem , device : D , spec : & AudioSpecDesired , get_callback : F ) -> Result < AudioDevice < CB > , String >
650
661
where
651
662
F : FnOnce ( AudioSpec ) -> CB ,
@@ -656,6 +667,9 @@ impl<CB: AudioCallback> AudioDevice<CB> {
656
667
657
668
/// Opens a new audio device for capture (given the desired parameters and callback).
658
669
/// Supported since SDL 2.0.5
670
+ ///
671
+ /// If you want to modify the callback-owned data at a later point (for example to update
672
+ /// its data buffer) you're likely to be interested in the [lock method](#method.lock).
659
673
pub fn open_capture < ' a , F , D > ( a : & AudioSubsystem , device : D , spec : & AudioSpecDesired , get_callback : F ) -> Result < AudioDevice < CB > , String >
660
674
where
661
675
F : FnOnce ( AudioSpec ) -> CB ,
0 commit comments