Struct itunes_com::wrappers::Track
source · pub struct Track { /* private fields */ }Expand description
Safe wrapper over a IITTrack
Implementations§
source§impl Track
impl Track
sourcepub fn as_file_or_cd_track(&self) -> Result<FileOrCDTrack>
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
impl IITObjectWrapper for Track
source§fn GetITObjectIDs(&self) -> Result<ObjectIDs>
fn GetITObjectIDs(&self) -> Result<ObjectIDs>
Returns the four IDs that uniquely identify this object.
source§fn Index(&self) -> Result<i32>
fn Index(&self) -> Result<i32>
The index of the object in internal application order (1-based).
source§fn playlistID(&self) -> Result<i32>
fn playlistID(&self) -> Result<i32>
The playlist ID of the object.
source§fn TrackDatabaseID(&self) -> Result<i32>
fn TrackDatabaseID(&self) -> Result<i32>
The track database ID of the object.
source§impl IITTrackWrapper for Track
impl IITTrackWrapper for Track
source§fn AddArtworkFromFile(&self, filePath: &str) -> Result<Artwork>
fn AddArtworkFromFile(&self, filePath: &str) -> Result<Artwork>
Add artwork from an image file to this track.
source§fn Kind(&self) -> Result<ITTrackKind>
fn Kind(&self) -> Result<ITTrackKind>
The track kind.
source§fn is_Compilation(&self) -> Result<bool>
fn is_Compilation(&self) -> Result<bool>
True if this track is from a compilation album.
source§fn set_Compilation(&mut self, Compilation: bool) -> Result<()>
fn set_Compilation(&mut self, Compilation: bool) -> Result<()>
True if this track is from a compilation album.
source§fn set_DiscCount(&mut self, DiscCount: i32) -> Result<()>
fn set_DiscCount(&mut self, DiscCount: i32) -> Result<()>
The total number of discs in the source album.
source§fn DiscNumber(&self) -> Result<i32>
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<()>
fn set_DiscNumber(&mut self, DiscNumber: i32) -> Result<()>
The index of the disc containing the track on the source album.
source§fn is_Enabled(&self) -> Result<bool>
fn is_Enabled(&self) -> Result<bool>
True if the track is checked for playback.
source§fn set_Enabled(&mut self, Enabled: bool) -> Result<()>
fn set_Enabled(&mut self, Enabled: bool) -> Result<()>
True if the track is checked for playback.
source§fn set_Genre(&mut self, Genre: &str) -> Result<()>
fn set_Genre(&mut self, Genre: &str) -> Result<()>
The music/audio genre (category) of the track.
source§fn Grouping(&self) -> Result<String>
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<()>
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>
fn KindAsString(&self) -> Result<String>
A text description of the track.
source§fn ModificationDate(&self) -> Result<f64>
fn ModificationDate(&self) -> Result<f64>
The modification date of the content of the track.
source§fn PlayedCount(&self) -> Result<i32>
fn PlayedCount(&self) -> Result<i32>
The number of times the track has been played.
source§fn set_PlayedCount(&mut self, PlayedCount: i32) -> Result<()>
fn set_PlayedCount(&mut self, PlayedCount: i32) -> Result<()>
The number of times the track has been played.
source§fn PlayedDate(&self) -> Result<f64>
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<()>
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>
fn PlayOrderIndex(&self) -> Result<i32>
The play order index of the track in the owner playlist (1-based).
source§fn SampleRate(&self) -> Result<i32>
fn SampleRate(&self) -> Result<i32>
The sample rate of the track (in Hz).
source§fn TrackCount(&self) -> Result<i32>
fn TrackCount(&self) -> Result<i32>
The total number of tracks on the source album.
source§fn set_TrackCount(&mut self, TrackCount: i32) -> Result<()>
fn set_TrackCount(&mut self, TrackCount: i32) -> Result<()>
The total number of tracks on the source album.
source§fn TrackNumber(&self) -> Result<i32>
fn TrackNumber(&self) -> Result<i32>
The index of the track on the source album.
source§fn set_TrackNumber(&mut self, TrackNumber: i32) -> Result<()>
fn set_TrackNumber(&mut self, TrackNumber: i32) -> Result<()>
The index of the track on the source album.
source§fn VolumeAdjustment(&self) -> Result<i32>
fn VolumeAdjustment(&self) -> Result<i32>
The relative volume adjustment of the track (-100% to 100%).
source§fn set_VolumeAdjustment(&mut self, VolumeAdjustment: i32) -> Result<()>
fn set_VolumeAdjustment(&mut self, VolumeAdjustment: i32) -> Result<()>
The relative volume adjustment of the track (-100% to 100%).
source§fn Artwork(&self) -> Result<ArtworkCollection>
fn Artwork(&self) -> Result<ArtworkCollection>
Returns a collection of artwork.