Remove the get_ prefix of methods (#151)
* Remove the `get_` prefix of methods * Fix overlooks
This commit is contained in:
parent
35d9201b85
commit
cdcef96279
4 changed files with 48 additions and 10 deletions
38
src/lib.rs
38
src/lib.rs
|
|
@ -120,16 +120,30 @@ impl Iterator for EndpointsIterator {
|
|||
|
||||
/// Return an iterator to the list of formats that are supported by the system.
|
||||
#[inline]
|
||||
pub fn endpoints() -> EndpointsIterator {
|
||||
EndpointsIterator(Default::default())
|
||||
}
|
||||
|
||||
/// Deprecated. Use `endpoints()` instead.
|
||||
#[inline]
|
||||
#[deprecated]
|
||||
pub fn get_endpoints_list() -> EndpointsIterator {
|
||||
EndpointsIterator(Default::default())
|
||||
}
|
||||
|
||||
/// Return the default endpoint, or `None` if no device is available.
|
||||
#[inline]
|
||||
pub fn get_default_endpoint() -> Option<Endpoint> {
|
||||
pub fn default_endpoint() -> Option<Endpoint> {
|
||||
cpal_impl::get_default_endpoint().map(Endpoint)
|
||||
}
|
||||
|
||||
/// Deprecated. Use `default_endpoint()` instead.
|
||||
#[inline]
|
||||
#[deprecated]
|
||||
pub fn get_default_endpoint() -> Option<Endpoint> {
|
||||
default_endpoint()
|
||||
}
|
||||
|
||||
/// An opaque type that identifies an end point.
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct Endpoint(cpal_impl::Endpoint);
|
||||
|
|
@ -137,17 +151,33 @@ pub struct Endpoint(cpal_impl::Endpoint);
|
|||
impl Endpoint {
|
||||
/// Returns an iterator that produces the list of formats that are supported by the backend.
|
||||
#[inline]
|
||||
pub fn get_supported_formats_list(&self) -> Result<SupportedFormatsIterator,
|
||||
FormatsEnumerationError>
|
||||
pub fn supported_formats(&self) -> Result<SupportedFormatsIterator,
|
||||
FormatsEnumerationError>
|
||||
{
|
||||
Ok(SupportedFormatsIterator(try!(self.0.get_supported_formats_list())))
|
||||
}
|
||||
|
||||
/// Deprecated. Use `supported_formats` instead.
|
||||
#[inline]
|
||||
#[deprecated]
|
||||
pub fn get_supported_formats_list(&self) -> Result<SupportedFormatsIterator,
|
||||
FormatsEnumerationError>
|
||||
{
|
||||
self.supported_formats()
|
||||
}
|
||||
|
||||
/// Returns the name of the endpoint.
|
||||
#[inline]
|
||||
pub fn get_name(&self) -> String {
|
||||
pub fn name(&self) -> String {
|
||||
self.0.get_name()
|
||||
}
|
||||
|
||||
/// Deprecated. Use `name()` instead.
|
||||
#[deprecated]
|
||||
#[inline]
|
||||
pub fn get_name(&self) -> String {
|
||||
self.name()
|
||||
}
|
||||
}
|
||||
|
||||
/// Number of channels.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue