pub struct FileId(/* private fields */);Implementations§
Source§impl FileId
impl FileId
Sourcepub fn create(
url: &Url,
type_id: FileTypeId,
format: &StreamBasicDesc,
flags: Flags,
) -> Result<Self>
pub fn create( url: &Url, type_id: FileTypeId, format: &StreamBasicDesc, flags: Flags, ) -> Result<Self>
Creates a new audio file (or initialises an existing file)
Creates a new (or initialises an existing) audio file specified by the URL. Upon success, an AudioFileID is returned which can be used for subsequent calls to the AudioFile APIs.
Sourcepub fn open(
url: &Url,
permissions: Permissions,
type_hint: FileTypeId,
) -> Result<Self>
pub fn open( url: &Url, permissions: Permissions, type_hint: FileTypeId, ) -> Result<Self>
Open an existing audio file specified by a URL. Returns a pointer to the newly opened audio file or Err(os::Status)
§Arguments
url- The URL of an existing audio file.permissions- The read-write permissions you want to assign to the file. Use the permission constants in Permissions.type_hint- A hint for the file type of the designated file. For files without filename extensions and with types not easily or uniquely determined from the data (such as ADTS or AC3), use this hint to indicate the file type. Otherwise, pass 0. Only use this hint in macOS versions 10.3.1 or greater. In all earlier versions, any attempt to open these files fails
pub fn write_packets( &mut self, use_cache: bool, num_bytes: u32, packet_descriptions: *const StreamPacketDesc, starting_packet: isize, num_packets: *mut u32, buffer: *const u8, ) -> Result
pub fn read_packets( &mut self, use_cache: bool, num_bytes: &mut u32, packet_descriptions: *mut StreamPacketDesc, starting_packet: isize, num_packets: *mut u32, buffer: *mut u8, ) -> Result
pub fn property_info(&self, property_id: PropId) -> Result<(usize, bool)>
pub unsafe fn get_property( &self, property_id: PropId, data_size: *mut u32, property_data: *mut c_void, ) -> Result
pub fn prop<T: Default>(&self, property_id: PropId) -> Result<T>
pub fn set_prop<T: Sized>(&mut self, property_id: PropId, val: &T) -> Result
pub unsafe fn set_property( &mut self, prop_id: PropId, data_size: u32, prop_data: *const c_void, ) -> Result
pub unsafe fn prop_vec<T: Sized>(&self, prop_id: PropId) -> Result<Vec<T>>
pub fn maximum_packet_size(&self) -> Result<u32>
pub fn defer_size_updates(&self) -> Result<bool>
pub fn set_defer_size_updates(&mut self, val: bool) -> Result
pub fn optimized(&self) -> Result<bool>
Sourcepub fn file_format(&self) -> Result<FileTypeId>
pub fn file_format(&self) -> Result<FileTypeId>
Read only
pub fn data_format(&self) -> Result<StreamBasicDesc>
pub fn set_data_format(&mut self, asbd: &StreamBasicDesc) -> Result
pub fn reserve_duration(&self) -> Result<f64>
pub fn set_reserve_duration(&mut self, val: f64) -> Result
pub fn estimated_duration(&self) -> Result<f64>
pub fn info_dictionary(&self) -> Result<R<Dictionary>>
Trait Implementations§
Auto Trait Implementations§
impl !UnwindSafe for FileId
impl Freeze for FileId
impl RefUnwindSafe for FileId
impl Send for FileId
impl Sync for FileId
impl Unpin for FileId
impl UnsafeUnpin for FileId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more