Skip to main content

FileId

Struct FileId 

Source
pub struct FileId(/* private fields */);

Implementations§

Source§

impl FileId

Source

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.

Source

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
Source

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

Source

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

Source

pub fn property_info(&self, property_id: PropId) -> Result<(usize, bool)>

Source

pub unsafe fn get_property( &self, property_id: PropId, data_size: *mut u32, property_data: *mut c_void, ) -> Result

Source

pub fn prop<T: Default>(&self, property_id: PropId) -> Result<T>

Source

pub fn set_prop<T: Sized>(&mut self, property_id: PropId, val: &T) -> Result

Source

pub unsafe fn set_property( &mut self, prop_id: PropId, data_size: u32, prop_data: *const c_void, ) -> Result

Source

pub unsafe fn prop_vec<T: Sized>(&self, prop_id: PropId) -> Result<Vec<T>>

Source

pub fn maximum_packet_size(&self) -> Result<u32>

Source

pub fn defer_size_updates(&self) -> Result<bool>

Source

pub fn set_defer_size_updates(&mut self, val: bool) -> Result

Source

pub fn optimized(&self) -> Result<bool>

Source

pub fn file_format(&self) -> Result<FileTypeId>

Read only

Source

pub fn data_format(&self) -> Result<StreamBasicDesc>

Source

pub fn set_data_format(&mut self, asbd: &StreamBasicDesc) -> Result

Source

pub fn reserve_duration(&self) -> Result<f64>

Source

pub fn set_reserve_duration(&mut self, val: f64) -> Result

Source

pub fn estimated_duration(&self) -> Result<f64>

Source

pub fn info_dictionary(&self) -> Result<R<Dictionary>>

Source

pub fn close(&mut self) -> Result

Close an existing audio file.

Trait Implementations§

Source§

impl Debug for FileId

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for FileId

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.