itunes

package
v0.0.0-...-3ceafa0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AirplayEnabled

func AirplayEnabled() bool

AirplayEnabled is AirPlay currently enabled?

func BackTrack

func BackTrack()

BackTrack reposition to beginning of current track or go to previous track if already at start of current track

func Converting

func Converting() bool

Converting is a track currently being converted?

func CurrentStreamTitle

func CurrentStreamTitle() string

CurrentStreamTitle the name of the current song in the playing stream (provided by streaming server)

func CurrentStreamURL

func CurrentStreamURL() string

CurrentStreamURL the URL of the playing stream or streaming web site (provided by streaming server)

func EqEnabled

func EqEnabled() bool

EqEnabled is the equalizer enabled?

func FastForward

func FastForward()

FastForward skip forward in a playing track

func FixedIndexing

func FixedIndexing() bool

FixedIndexing true if all AppleScript track indices should be independent of the play order of the owning playlist.

func Frontmost

func Frontmost() bool

Frontmost is iTunes the frontmost application?

func FullScreen

func FullScreen() bool

FullScreen are visuals displayed using the entire screen?

func Mute

func Mute() bool

Mute has the sound output been muted?

func Name

func Name() string

Name the name of the application

func NextTrack

func NextTrack()

NextTrack advance to the next track in the current playlist

func Pause

func Pause()

Pause pause playback

func PlayerPosition

func PlayerPosition() float64

PlayerPosition the player’s position within the currently playing track in seconds.

func PlayerState

func PlayerState() string

PlayerState is iTunes stopped, paused, or playing?

func Playpause

func Playpause()

Playpause toggle the playing/paused state of the current track

func PreviousTrack

func PreviousTrack()

PreviousTrack return to the previous track in the current playlist

func Resume

func Resume()

Resume disable fast forward/rewind and resume playback, if playing.

func Rewind

func Rewind()

Rewind skip backwards in a playing track

func Selection

func Selection() string

Selection the selection visible to the user

func ShuffleEnabled

func ShuffleEnabled() bool

ShuffleEnabled are songs played in random order?

func ShuffleMode

func ShuffleMode() string

ShuffleMode the playback shuffle mode

func SongRepeat

func SongRepeat() string

SongRepeat the playback repeat mode

func SoundVolume

func SoundVolume() int

SoundVolume the sound output volume (0 = minimum, 100 = maximum)

func Stop

func Stop()

Stop stop playback

func Version

func Version() string

Version the version of iTunes

func VisualSize

func VisualSize() string

VisualSize the size of the displayed visual

func VisualsEnabled

func VisualsEnabled() bool

VisualsEnabled are visuals currently being displayed?

Types

type AirPlayDevice

type AirPlayDevice struct {
	Item
	Active         bool   // is the device currently being played to?
	Available      bool   // is the device currently available?
	Kind           string // the kind of the device
	NetworkAddress string // the network (MAC) address of the device
	Protected      bool   // is the device password- or passcode-protected?
	Selected       bool   // is the device currently selected?
	SupportsAudio  bool   // does the device support audio playback?
	SupportsVideo  bool   // does the device support video playback?
	SoundVolume    int    // the output volume for the device (0 = minimum, 100 = maximum)
}

AirPlayDevice an AirPlay device

func AirplayDevices

func AirplayDevices() ([]AirPlayDevice, error)

AirplayDevices AirPlay devices

func CurrentAirPlayDevices

func CurrentAirPlayDevices() ([]AirPlayDevice, error)

CurrentAirPlayDevices the currently selected AirPlay device(s)

type Artwork

type Artwork struct {
	Item
	Data        Picture // data for this artwork, in the form of a picture
	Description string  // description of artwork as a string
	Downloaded  bool    // was this artwork downloaded by iTunes?
	Format      string  // the data format for this piece of artwork
	Kind        int     // kind or purpose of this piece of artwork
	RawData     RawData // data for this artwork, in original format
}

Artwork a piece of art within a track or playlist

type AudioCDPlaylist

type AudioCDPlaylist struct {
	Playlist
	AudioCDTracks []AudioCDTrack
	Artist        string // the artist of the CD
	Compilation   bool   // is this CD a compilation album?
	Composer      string // the composer of the CD
	DiscCount     int    // the total number of discs in this CD’s album
	DiscNumber    int    // the index of this CD disc in the source album
	Genre         string // the genre of the CD
	Year          int    // the year the album was recorded/released
}

AudioCDPlaylist a playlist representing an audio CD

type AudioCDTrack

type AudioCDTrack struct {
	Track
	Location File // the location of the file represented by this track
}

AudioCDTrack a track on an audio CD

type BrowserWindow

type BrowserWindow struct {
	Window
	Selection []Track  // the selected songs
	View      Playlist // the playlist currently displayed in the window
}

BrowserWindow the main iTunes window

func BrowserWindows

func BrowserWindows() ([]BrowserWindow, error)

BrowserWindows main iTunes windows

type EQPreset

type EQPreset struct {
	Item
	Band1        float64 // the equalizer 32 Hz band level (-12.0 dB to +12.0 dB)
	Band2        float64 // the equalizer 64 Hz band level (-12.0 dB to +12.0 dB)
	Band3        float64 // the equalizer 125 Hz band level (-12.0 dB to +12.0 dB)
	Band4        float64 // the equalizer 250 Hz band level (-12.0 dB to +12.0 dB)
	Band5        float64 // the equalizer 500 Hz band level (-12.0 dB to +12.0 dB)
	Band6        float64 // the equalizer 1 kHz band level (-12.0 dB to +12.0 dB)
	Band7        float64 // the equalizer 2 kHz band level (-12.0 dB to +12.0 dB)
	Band8        float64 // the equalizer 4 kHz band level (-12.0 dB to +12.0 dB)
	Band9        float64 // the equalizer 8 kHz band level (-12.0 dB to +12.0 dB)
	Band10       float64 // the equalizer 16 kHz band level (-12.0 dB to +12.0 dB)
	Modifiable   bool    // can this preset be modified?
	Preamp       float64 // the equalizer preamp level (-12.0 dB to +12.0 dB)
	UpdateTracks bool    // should tracks which refer to this preset be updated when the preset is renamed or deleted?
}

EQPreset equalizer preset configuration

func CurrentEQPreset

func CurrentEQPreset() (EQPreset, error)

CurrentEQPreset the currently selected equalizer preset

func EqPresets

func EqPresets() ([]EQPreset, error)

EqPresets equalizer preset configurations

type EQWindow

type EQWindow struct {
	Window
}

EQWindow the iTunes equalizer window

func EqWindows

func EqWindows() ([]EQWindow, error)

EqWindows iTunes equalizer windows

type Encoder

type Encoder struct {
	Item
	Format string // the data format created by the encoder
}

Encoder converts a track to a specific file format

func CurrentEncoder

func CurrentEncoder() (Encoder, error)

CurrentEncoder the currently selected encoder (MP3, AIFF, WAV, etc.)

func Encoders

func Encoders() ([]Encoder, error)

Encoders converts a track to a specific file formats

type File

type File string

type FileTrack

type FileTrack struct {
	Track
	Location File // the location of the file represented by this track
}

FileTrack a track representing an audio file (MP3, AIFF, etc.)

type FolderPlaylist

type FolderPlaylist struct {
	UserPlaylist
	FileTracks   []FileTrack
	URLTracks    []URLTrack
	SharedTracks []SharedTrack
	Shared       bool // is this playlist shared?
	Smart        bool //  is this a Smart Playlist?
	Genius       bool // is this a Genius Playlist?
}

FolderPlaylist a folder that contains other playlists

type Item

type Item struct {
	Class        string                 // the class of the item
	ID           int                    // the id of the item
	Index        int                    // The index of the item in internal application order.
	Name         string                 // the name of the item
	PersistentID string                 // the id of the item as a hexadecimal string. This id does not change over time.
	Properties   map[string]interface{} // every property of the item
}

Item an item

type LibraryPlaylist

type LibraryPlaylist struct {
	Playlist
	FileTracks   []FileTrack
	URLTracks    []URLTrack
	SharedTracks []SharedTrack
}

LibraryPlaylist the master music library playlist

type MiniplayerWindow

type MiniplayerWindow struct {
	Window
}

MiniplayerWindow the miniplayer window

func MiniplayerWindows

func MiniplayerWindows() ([]MiniplayerWindow, error)

MiniplayerWindows miniplayer windows

type Picture

type Picture struct {
	RawData
}

type Playlist

type Playlist struct {
	Item
	Tracks      []Track
	Artworks    []Artwork
	Description string    // the description of the playlist
	Disliked    bool      // is this playlist disliked?
	Duration    int       // the total length of all songs (in seconds)
	Name        string    // the name of the playlist
	Loved       bool      // is this playlist loved?
	Parent      *Playlist // folder which contains this playlist (if any)
	Shuffle     bool      // play the songs in this playlist in random order? (obsolete; always false)
	Size        int       // the total size of all songs (in bytes)
	SongRepeat  string    // playback repeat mode (obsolete; always off)
	Time        string    // the length of all songs in MM:SS format
	Visible     bool      // is this playlist visible in the Source list?
}

Playlist a list of songs/streams

func CurrentPlaylist

func CurrentPlaylist() (Playlist, error)

CurrentPlaylist the playlist containing the currently targeted track

func Playlists

func Playlists() ([]Playlist, error)

Playlists list of songs/streams

type PlaylistWindow

type PlaylistWindow struct {
	Window
	Selection []Track  // the selected songs
	View      Playlist // the playlist displayed in the window
}

PlaylistWindow a sub-window showing a single playlist

func PlaylistWindows

func PlaylistWindows() ([]PlaylistWindow, error)

PlaylistWindows sub-window showing a single playlist windows

type Point

type Point struct {
	X int
	Y int
}

type RadioTunerPlaylist

type RadioTunerPlaylist struct {
	Playlist
	URLTracks []URLTrack
}

RadioTunerPlaylist the radio tuner playlist

type RawData

type RawData struct {
	io.Reader
}

func (*RawData) UnmarshalJSON

func (r *RawData) UnmarshalJSON(b []byte) error

type Rectangle

type Rectangle struct {
	Point
	Width  int
	Height int
}

type SharedTrack

type SharedTrack struct {
	Track
}

SharedTrack a track residing in a shared library

type Source

type Source struct {
	Item
	AudioCDPlaylists      []AudioCDPlaylist
	LibraryPlaylists      []LibraryPlaylist
	Playlists             []Playlist
	RadioTunerPlaylists   []RadioTunerPlaylist
	SubscriptionPlaylists []SubscriptionPlaylist
	UserPlaylists         []UserPlaylist
	Capacity              int // the total size of the source if it has a fixed size
	FreeSpace             int // the free space on the source if it has a fixed size
	Kind                  string
}

Source a music source (music library, CD, device, etc.)

func Sources

func Sources() ([]Source, error)

Sources music sources (music library, CD, device, etc.)

type SubscriptionPlaylist

type SubscriptionPlaylist struct {
	FileTracks []FileTrack
	URLTracks  []URLTrack
}

SubscriptionPlaylist a subscription playlist from Apple Music

type Track

type Track struct {
	Item
	ArtWorks          []Artwork // a piece of art within a track or playlist
	Album             string    // the album name of the track
	AlbumArtist       string    // the album artist of the track
	AlbumDisliked     bool      // is the album for this track disliked?
	AlbumLoved        bool      // is the album for this track loved?
	AlbumRating       int       // the rating of the album for this track (0 to 100)
	AlbumRatingKind   string    // the rating kind of the album rating for this track
	Artist            string    // the artist/source of the track
	BitRate           int       // the bit rate of the track (in kbps)
	Bookmark          int       // the bookmark time of the track in seconds
	Bookmarkable      bool      // is the playback position for this track remembered?
	Bpm               int       // the tempo of this track in beats per minute
	Category          string    // the category of the track
	CloudStatus       string    // the iCloud status of the track
	Comment           string    // freeform notes about the track
	Compilation       bool      // is this track from a compilation album?
	Composer          string    // the composer of the track
	DatabaseID        int       // the common, unique ID for this track. If two tracks in different playlists have the same database ID, they are sharing the same data.
	DateAdded         time.Time // the date the track was added to the playlist
	Description       string    // the description of the track
	DiscCount         int       // the total number of discs in the source album
	DiscNumber        int       // the index of the disc containing this track on the source album
	Disliked          bool      // is this track disliked?
	DownloaderAppleID string    // the Apple ID of the person who downloaded this track
	DownloaderName    string    // the name of the person who downloaded this track
	Duration          float64   // the length of the track in seconds
	Enabled           bool      // is this track checked for playback?
	EpisodeID         string    // the episode ID of the track
	EpisodeNumber     int       // the episode number of the track
	Eq                string    // the name of the EQ preset of the track
	Finish            float64   // the stop time of the track in seconds
	Gapless           bool      // is this track from a gapless album?
	Genre             string    // the music/audio genre (category) of the track
	Grouping          string    // the grouping (piece) of the track. Generally used to denote movements within a classical work.
	Kind              string    // a text description of the track
	LongDescription   string    // longDescription (text)
	Loved             bool      // is this track loved?
	Lyrics            string    // the lyrics of the track
	MediaKind         string    // the media kind of the track
	ModificationDate  time.Time // the modification date of the content of this track
	Movement          string    // the movement name of the track
	MovementCount     int       // the total number of movements in the work
	MovementNumber    int       // the index of the movement in the work
	PlayedCount       int       // number of times this track has been played
	PlayedDate        time.Time // the date and time this track was last played
	PurchaserAppleID  string    // the Apple ID of the person who purchased this track
	PurchaserName     string    // the name of the person who purchased this track
	Rating            int       // the rating of this track (0 to 100)
	RatingKind        string    // the rating kind of this track
	ReleaseDate       time.Time // the release date of this track
	SampleRate        int       // the sample rate of the track (in Hz)
	SeasonNumber      int       // the season number of the track
	Shufflable        bool      // is this track included when shuffling?
	SkippedCount      int       // number of times this track has been skipped
	SkippedDate       time.Time // the date and time this track was last skipped
	Show              string    // the show name of the track
	SortAlbum         string    // override string to use for the track when sorting by album
	SortArtist        string    // override string to use for the track when sorting by artist
	SortAlbumArtist   string    // override string to use for the track when sorting by album artist
	SortName          string    // override string to use for the track when sorting by name
	SortComposer      string    // override string to use for the track when sorting by composer
	SortShow          string    // override string to use for the track when sorting by show name
	Size              int       // the size of the track (in bytes)
	Start             float64   // the start time of the track in seconds
	Time              string    // the length of the track in MM:SS format
	TrackCount        int       // the total number of tracks on the source album
	TrackNumber       int       // the index of the track on the source album
	Unplayed          bool      // is this track unplayed?
	VideoKind         string    // kind of video track
	VolumeAdjustment  int       // relative volume adjustment of the track (-100% to 100%)
	Work              string    // the work name of the track
	Year              int       // the year the track was recorded/released
}

Track playable audio source

func CurrentTrack

func CurrentTrack() (Track, error)

CurrentTrack the current targeted track

func CurrentTrackWithArtwork

func CurrentTrackWithArtwork() (Track, error)

func Tracks

func Tracks() ([]Track, error)

Tracks playable audio sources

type URLTrack

type URLTrack struct {
	Track
	Address string // the URL for this track
}

URLTrack a track representing a network stream

type UserPlaylist

type UserPlaylist struct {
	Playlist
	URLTracks    []URLTrack    // track representing a network streams
	FileTracks   []FileTrack   // track representing audio files (MP3, AIFF, etc.)
	SharedTracks []SharedTrack // track residing in a shared library
	Shared       bool          // is this playlist shared?
	Smart        bool          // is this a Smart Playlist?
	Genius       bool          // is this a Genius Playlist?
}

custom playlists created by the user

type VideoWindow

type VideoWindow struct {
	Window
}

VideoWindow the video window

func VideoWindows

func VideoWindows() ([]VideoWindow, error)

VideoWindows VideoWindows

type Visual

type Visual struct {
	Item
}

Visual a visual plug-in

func CurrentVisual

func CurrentVisual() (Visual, error)

CurrentVisual the currently selected visual plug-in

func Visuals

func Visuals() ([]Visual, error)

Visuals visual plug-in list

type Window

type Window struct {
	Item
	Bounds       Rectangle // the boundary rectangle for the window
	Closeable    bool      // does the window have a close button?
	Collapseable bool      // does the window have a collapse button?
	Collapsed    bool      // is the window collapsed?
	FullScreen   bool      // is the window full screen?
	Position     Point     // the upper left position of the window
	Resizable    bool      // is the window resizable?
	Visible      bool      // is the window visible?
	Zoomable     bool      // is the window zoomable?
	Zoomed       bool      // is the window zoomed?
}

Window any window

func Windows

func Windows() ([]Window, error)

Windows the currently windows

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL