Struct itunes_com::wrappers::Track

source ·
pub struct Track { /* private fields */ }
Expand description

Safe wrapper over a IITTrack

Implementations§

source§

impl Track

source

pub fn as_file_or_cd_track(&self) -> Result<FileOrCDTrack>

In case the concrete COM object for this track actually is a derived FileOrCDTrack, this is a way to retrieve it

Examples found in repository?
examples/wrappers.rs (line 52)
45
46
47
48
49
50
51
52
53
54
55
56
57
58
fn search_tracks(iTunes: &itunes_com::wrappers::iTunes, search_text: &str) -> windows::core::Result<()> {
    println!("Searching for \"{}\"...", search_text);

    let library_playlist = iTunes.LibraryPlaylist()?;
    let results = library_playlist.Search(search_text.into(), ITPlaylistSearchField::ITPlaylistSearchFieldAll)?;

    for result in results.iter()? {
        let file_location = result.as_file_or_cd_track().map(|foct| foct.Location());

        println!("  * {} at {:?}", result.Name()?, file_location);
    }

    Ok(())
}

Trait Implementations§

source§

impl IITObjectWrapper for Track

source§

fn GetITObjectIDs(&self) -> Result<ObjectIDs>

Returns the four IDs that uniquely identify this object.
source§

fn Name(&self) -> Result<String>

The name of the object.
source§

fn set_Name(&mut self, Name: &str) -> Result<()>

The name of the object.
source§

fn Index(&self) -> Result<i32>

The index of the object in internal application order (1-based).
source§

fn sourceID(&self) -> Result<i32>

The source ID of the object.
source§

fn playlistID(&self) -> Result<i32>

The playlist ID of the object.
source§

fn trackID(&self) -> Result<i32>

The track ID of the object.
source§

fn TrackDatabaseID(&self) -> Result<i32>

The track database ID of the object.
source§

impl IITTrackWrapper for Track

source§

fn Delete(&self) -> Result<()>

Delete this track.
source§

fn Play(&self) -> Result<()>

Start playing this track.
source§

fn AddArtworkFromFile(&self, filePath: &str) -> Result<Artwork>

Add artwork from an image file to this track.
source§

fn Kind(&self) -> Result<ITTrackKind>

The track kind.
source§

fn Playlist(&self) -> Result<Playlist>

The playlist that contains this track.
source§

fn Album(&self) -> Result<String>

The album containing the track.
source§

fn set_Album(&mut self, Album: &str) -> Result<()>

The album containing the track.
source§

fn Artist(&self) -> Result<String>

The artist/source of the track.
source§

fn set_Artist(&mut self, Artist: &str) -> Result<()>

The artist/source of the track.
source§

fn BitRate(&self) -> Result<i32>

The bit rate of the track (in kbps).
source§

fn BPM(&self) -> Result<i32>

The tempo of the track (in beats per minute).
source§

fn set_BPM(&mut self, BPM: i32) -> Result<()>

The tempo of the track (in beats per minute).
source§

fn Comment(&self) -> Result<String>

Freeform notes about the track.
source§

fn set_Comment(&mut self, Comment: &str) -> Result<()>

Freeform notes about the track.
source§

fn is_Compilation(&self) -> Result<bool>

True if this track is from a compilation album.
source§

fn set_Compilation(&mut self, Compilation: bool) -> Result<()>

True if this track is from a compilation album.
source§

fn Composer(&self) -> Result<String>

The composer of the track.
source§

fn set_Composer(&mut self, Composer: &str) -> Result<()>

The composer of the track.
source§

fn DateAdded(&self) -> Result<f64>

The date the track was added to the playlist.
source§

fn DiscCount(&self) -> Result<i32>

The total number of discs in the source album.
source§

fn set_DiscCount(&mut self, DiscCount: i32) -> Result<()>

The total number of discs in the source album.
source§

fn DiscNumber(&self) -> Result<i32>

The index of the disc containing the track on the source album.
source§

fn set_DiscNumber(&mut self, DiscNumber: i32) -> Result<()>

The index of the disc containing the track on the source album.
source§

fn Duration(&self) -> Result<i32>

The length of the track (in seconds).
source§

fn is_Enabled(&self) -> Result<bool>

True if the track is checked for playback.
source§

fn set_Enabled(&mut self, Enabled: bool) -> Result<()>

True if the track is checked for playback.
source§

fn EQ(&self) -> Result<String>

The name of the EQ preset of the track.
source§

fn set_EQ(&mut self, EQ: &str) -> Result<()>

The name of the EQ preset of the track.
source§

fn set_Finish(&mut self, Finish: i32) -> Result<()>

The stop time of the track (in seconds).
source§

fn Finish(&self) -> Result<i32>

The stop time of the track (in seconds).
source§

fn Genre(&self) -> Result<String>

The music/audio genre (category) of the track.
source§

fn set_Genre(&mut self, Genre: &str) -> Result<()>

The music/audio genre (category) of the track.
source§

fn Grouping(&self) -> Result<String>

The grouping (piece) of the track. Generally used to denote movements within classical work.
source§

fn set_Grouping(&mut self, Grouping: &str) -> Result<()>

The grouping (piece) of the track. Generally used to denote movements within classical work.
source§

fn KindAsString(&self) -> Result<String>

A text description of the track.
source§

fn ModificationDate(&self) -> Result<f64>

The modification date of the content of the track.
source§

fn PlayedCount(&self) -> Result<i32>

The number of times the track has been played.
source§

fn set_PlayedCount(&mut self, PlayedCount: i32) -> Result<()>

The number of times the track has been played.
source§

fn PlayedDate(&self) -> Result<f64>

The date and time the track was last played. A value of zero means no played date.
source§

fn set_PlayedDate(&mut self, PlayedDate: f64) -> Result<()>

The date and time the track was last played. A value of zero means no played date.
source§

fn PlayOrderIndex(&self) -> Result<i32>

The play order index of the track in the owner playlist (1-based).
source§

fn Rating(&self) -> Result<i32>

The rating of the track (0 to 100).
source§

fn set_Rating(&mut self, Rating: i32) -> Result<()>

The rating of the track (0 to 100).
source§

fn SampleRate(&self) -> Result<i32>

The sample rate of the track (in Hz).
source§

fn Size(&self) -> Result<i32>

The size of the track (in bytes).
source§

fn Start(&self) -> Result<i32>

The start time of the track (in seconds).
source§

fn set_Start(&mut self, Start: i32) -> Result<()>

The start time of the track (in seconds).
source§

fn Time(&self) -> Result<String>

The length of the track (in MM:SS format).
source§

fn TrackCount(&self) -> Result<i32>

The total number of tracks on the source album.
source§

fn set_TrackCount(&mut self, TrackCount: i32) -> Result<()>

The total number of tracks on the source album.
source§

fn TrackNumber(&self) -> Result<i32>

The index of the track on the source album.
source§

fn set_TrackNumber(&mut self, TrackNumber: i32) -> Result<()>

The index of the track on the source album.
source§

fn VolumeAdjustment(&self) -> Result<i32>

The relative volume adjustment of the track (-100% to 100%).
source§

fn set_VolumeAdjustment(&mut self, VolumeAdjustment: i32) -> Result<()>

The relative volume adjustment of the track (-100% to 100%).
source§

fn Year(&self) -> Result<i32>

The year the track was recorded/released.
source§

fn set_Year(&mut self, Year: i32) -> Result<()>

The year the track was recorded/released.
source§

fn Artwork(&self) -> Result<ArtworkCollection>

Returns a collection of artwork.

Auto Trait Implementations§

§

impl RefUnwindSafe for Track

§

impl !Send for Track

§

impl !Sync for Track

§

impl Unpin for Track

§

impl UnwindSafe for Track

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.