Sign in to follow this  
Followers 0
torels

iTunes UDF

69 posts in this topic

#1 ·  Posted (edited)

Hi there

I wrote an iTunes UDF to integrate most iTunes functions in Au3 scripts

iTunes UDF Updated on 12/11/2008

iTunes UDF Updated on 1/9/2009 (Minor Fixes)

function list:

_iTunes_Start()

_iTunes_Vol_Up()

_iTunes_Vol_Down()

_iTunes_Prev()

_iTunes_Next()

_iTunes_Current_LyricsSet()

_iTunes_Current_LyricsGet()

_iTunes_Current_ArtworkSaveToTmp()

_iTunes_Current_Artwork_Get()

_iTunes_Current_Artwork_Set()

_iTunes_Play_Pause()

_iTunes_PlayList_Create()

_iTunes_PlayList_Add()

_iTunes_Playlist_Delete()

_iTunes_Playlist_Info()

_iTunes_Playlist_PlayFirst()

_iTunes_Playlist_Search()

_iTunes_Library_CountTracks()

_iTunes_Library_AddTrack()

_iTunes_Library_Tracks()

_iTunes_Song_LyricsGet()

_iTunes_Song_LyricsSet()

_iTunes_Song_ArtworkSaveToTmp()

_iTunes_Song_Artwork_Get()

_iTunes_Song_Artwork_Set()

_iTunes_Library_DeleteTrack()

_iTunes_Get_Vol()

_iTunes_Vol_Set()

_iTunes_Get_Selected()

_iTunes_Selected_GetInfo()

_iTunes_Song_GetInfo()

_iTunes_Current_GetInfo()

_iTunes_Quit()

_iTunes_iPod_Update()

_iTunes_iPod_Eject()

_iTunes_iPod_Version()

_iTUnes_Visuals_Enable()

_iTunes_Visuals_Disable()

_iTunes_Get_ITL_Path()

_iTunes_Podcast_Subscribe()

_iTunes_Podcast_UpdateFeeds()

_iTunes_Player_Get_State()

_iTunes_MiniPlayer()

_iTunes_Unload()

User CallTip Entries

#cs USER CALLTIP ENRTRIES
_iTunes_Start() Starts iTunes If not running and initializes the functions. Required #include <iTunes.au3>
_iTunes_Vol_Up([$vol_percent = 10]) Volume Up. Required #include <iTunes.au3>
_iTunes_Vol_Down([$vol_percent = 10]) Volume Down. Required #include <iTunes.au3>
_iTunes_Prev() Previous Song. Required #include <iTunes.au3>
_iTunes_Next() Next Song. Required #include <iTunes.au3>
_iTunes_Current_LyricsSet($Lyric_text) Set Lyrics to Current Song. Required #include <iTunes.au3>
_iTunes_Current_LyricsGet() Get Lyrics for Current Song. Required #include <iTunes.au3>
_iTunes_Current_ArtworkSaveToTmp() Save Current Song's Artwork to .tmp file (returns the tmp name). Required #include <iTunes.au3>
_iTunes_Current_Artwork_Get($path) Saves Current Song's Artwork to path. Required #include <iTunes.au3>
_iTunes_Current_Artwork_Set($path) Set Current Song's Artwork form image. Required #include <iTunes.au3>
_iTunes_Play_Pause() Play/Pause. Required #include <iTunes.au3>
_iTunes_PlayList_Create($p_name) Create Playlist. Required #include <iTunes.au3>
_iTunes_PlayList_Add($PlayList_Name, $song_Name)  Add a Library Song to a Playlist. Required #include <iTunes.au3>
_iTunes_Playlist_Delete($PlayList_Name) Delete Playlist. Required #include <iTunes.au3>
_iTunes_Playlist_Info($PlayList_Name) Get Playlist's info. Required #include <iTunes.au3>
_iTunes_Playlist_PlayFirst($PlayList_Name) Play First Song in Playlist. Required #include <iTunes.au3>
_iTunes_Playlist_Search($PlayList_Name,$search) Search Song in Playlist. Required #include <iTunes.au3>
_iTunes_Library_CountTracks() Count Library Tracks. Required #include <iTunes.au3>
_iTunes_Library_AddTrack($path) Add file to library. Required #include <iTunes.au3>
_iTunes_Library_Tracks() Return an Array Containing the Librarie's Track List. Required <iTunes.au3>
_iTunes_Song_LyricsGet($song_Name) Get Song's Lyrics. Required #include <iTunes.au3>
_iTunes_Song_LyricsSet($song_Name,$lyrics) Set Song's Lyrics. Required #include <iTunes.au3>
_iTunes_Song_ArtworkSaveToTmp($song_Name) Save Song's Artwork to .tmp file. Required #include <iTunes.au3>
_iTunes_Song_Artwork_Get($song_Name,$path) Save Song's Artwork to file. Required #include <iTunes.au3>
_iTunes_Song_Artwork_Set($song_Name,$path) Set Song's Artwork form image. Required #include <iTunes.au3>
_iTunes_Library_DeleteTrack($song_Name) Delete track. Required #include <iTunes.au3>
_iTunes_Get_Vol() Get Volume Percentage. Required #include <iTunes.au3>
_iTunes_Vol_Set($vol_percent) Set Volume Percentage. Required #include <iTunes.au3>
_iTunes_Get_Selected() Get Selected Tracks. Required #include <iTunes.au3>
_iTunes_Selected_GetInfo() Returns an array containing Selected Tracks info. Required #include <iTunes.au3>
_iTunes_Song_GetInfo($song_Name) Returns an array containing Song's info. Required #include <iTunes.au3>
_iTunes_Current_GetInfo() Returns an array containing Current Song's Info. Required #include <iTunes.au3>
_iTunes_Quit() Quit iTunes. Required #include <iTunes.au3>
_iTunes_iPod_Update() Update iPod. Required #include <iTunes.au3>
_iTunes_iPod_Eject() Eject iPod. Required #include <iTunes.au3>
_iTunes_iPod_Version() Get iPod Software Version. Required #include <iTunes.au3>
_iTUnes_Visuals_Enable() Enable Visuals. Required #include <iTunes.au3>
_iTunes_Visuals_Disable() Disable Visuals. Required #include <iTunes.au3>
_iTunes_Get_ITL_Path() Returns "library.itl" (XML file containing iTunes library info) path. Required #include <iTunes.au3>
_iTunes_Podcast_Subscribe($podcast_url) Subscribe to podcast. Required #include <iTunes.au3>
_iTunes_Podcast_UpdateFeeds() Update Podcast Feeds. Required #include <iTunes.au3>
_iTunes_Player_Get_State() Get Player State. Required #include <iTunes.au3>
_iTunes_MiniPlayer([$state = 1]) Set MiniPlayer state. Required #include <iTunes.au3>
_iTunes_Unload() Unload iTunes COM Object. Required #include <iTunes.au3>
_iTunes_Mute() Mute iTunes. Required #include <iTunes.au3>
#ce

-----------------------------------------------------------------------

Little Guide on how some functions work

_iTunes_Song_GetInfo() AND _iTunes_Current_GetInfo() both return an array containing song's info:

[0] Album

[1] Artist

[2] Name

[3] Comment

[4] Compilation

[5] Composer

[6] Date Added

[7] Duration (in seconds)

[8] EQ

[9] Genre

[10] Kind

[11] Modification Date

[12] Played Count

[13] Last Played Date

[14] Playlist

[15] Rating

[16] Sample Rate

[17] Size

[18] Time (HH:MM:SS)

[19] Track number

[20] Volume adjusment

[21] Year

note: _iTunes_Selected_GetInfo() returns an array with the same values but in a string, separated by "|" so to retrieve the informatios of each selected track you will have to StringSlit() $array[index]

_iTunes_Playlist_Info() returns an array containing the playlist's info:

[0] Kind

[1] Duration (in seconds)

[2] Shuffle (1/0)

[3] size in bytes

[4] Repeat (0 = no | 1 = one song| 2 = all songs)

[5] Time (HH:MM:SS)

[6] Visible

:)

ENJOY!

iTunes.au3

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites



I like it. Good job.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Man, where was this script about a year ago? I was trying to figure out how to do something like this. I was going to grab current song playing from my Media Player and put it in my Ventrilo comment but now Ventrilo has their own integration for media players to display that information.

Share this post


Link to post
Share on other sites

Man, where was this script about a year ago? I was trying to figure out how to do something like this. I was going to grab current song playing from my Media Player and put it in my Ventrilo comment but now Ventrilo has their own integration for media players to display that information.

sorry... I only started autoit some month ago XD


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

you have nothing on Equalizers. i figured out how to get the current, and set all in a combo, do you think you know how to set the EQ by name?

Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post


Link to post
Share on other sites

hmm... I can't work out anything for the moment

I'll take a look at the apple chm for itunes com object


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

Wow thanks!

I realy need this :idiot:!

Every time im playing a game, I want to change the music... NOW ITS ABLE :P

Thank you soo much :) >_<

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

Wow thanks!

I realy need this :idiot:!

Every time im playing a game, I want to change the music... NOW ITS ABLE :P

Thank you soo much :) >_<

AlmarM

Thanks AlmarM o:)


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

First off thank you for this script I've been using it for awhile now

Now my question is how can I read the full library list?

I see the variable $Library_Tracks but when i put it in a msgbox nothing comes up and when i put it in an array nothing comes up also tried for $tracks in $Library_Tracks and couldn't get anything

anybody know of how I can read this variable or how I can read the iTunes Library

Share this post


Link to post
Share on other sites

First off thank you for this script I've been using it for awhile now

Now my question is how can I read the full library list?

I see the variable $Library_Tracks but when i put it in a msgbox nothing comes up and when i put it in an array nothing comes up also tried for $tracks in $Library_Tracks and couldn't get anything

anybody know of how I can read this variable or how I can read the iTunes Library

Hi AcidCorps

I Updated the UDF and you can now retrieve the track list using _iTunes_Library_Tracks() Function :mellow:

By The Way Itunes UDF updated on 5/11/2008 :(


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

You could change _iTunes_Selected_GetInfo() to use a 2D Array:

Func _iTunes_Selected_GetInfo()
    Local $sInfo[1][22], $Counter=0
    For $track In $iTunesApp.SelectedTracks
        $Counter+=1
        ReDim $sInfo[$Counter][22]
        
        $sInfo[$Counter-1][0] = $track.Album & "|" 
        $sInfo[$Counter-1][1] = $track.artist & "|" 
        $sInfo[$Counter-1][2] = $track.BPM & "|" 
        $sInfo[$Counter-1][3] = $track.comment & "|" 
        $sInfo[$Counter-1][4] = $track.Compilation & "|" 
        $sInfo[$Counter-1][5] = $track.Composer & "|" 
        $sInfo[$Counter-1][6] = $track.DateAdded & "|" 
        $sInfo[$Counter-1][7] = $track.Duration & "|" 
        $sInfo[$Counter-1][8] = $track.EQ & "|" 
        $sInfo[$Counter-1][9] = $track.Genre & "|" 
        $sInfo[$Counter-1][10] = $track.KindAsString & "|" 
        $sInfo[$Counter-1][11] = $track.ModificationDate & "|" 
        $sInfo[$Counter-1][12] = $track.PlayedCount & "|" 
        $sInfo[$Counter-1][13] = $track.PlayedDate & "|" 
        $sInfo[$Counter-1][14] = $track.Playlist & "|" 
        $sInfo[$Counter-1][15] = $track.Rating & "|" 
        $sInfo[$Counter-1][16] = $track.SampleRate & "|" 
        $sInfo[$Counter-1][17] = $track.Size & "|" 
        $sInfo[$Counter-1][18] = $track.Time & "|" 
        $sInfo[$Counter-1][19] = $track.TrackNumber & "|" 
        $sInfo[$Counter-1][20] = $track.VolumeAdjustment & "|" 
        $sInfo[$Counter-1][21] = $track.Year
    Next
    If $Counter = 0 Then $sInfo = ""
    
    Return $sInfo
EndFunc   ;==>_iTunes_Selected_GetInfo

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

You could change _iTunes_Selected_GetInfo() to use a 2D Array:

I thought of that but It turns everything so complicated when getting an output from the func... I kept it the more simple I could :mellow: Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

Hi AcidCorps

I Updated the UDF and you can now retrieve the track list using _iTunes_Library_Tracks() Function :mellow:

By The Way Itunes UDF updated on 5/11/2008 :(

Thank you very much

Share this post


Link to post
Share on other sites

you're welcoome!

I had to think a bit... but in the end it wasn't that hard... you were very near to the answer

I see the variable $Library_Tracks but when i put it in a msgbox nothing comes up and when i put it in an array nothing comes up also tried for $tracks in $Library_Tracks and couldn't get anything


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Hey Torels I'm using this in a huge program I am working on, you saved my life with predefining these COM calls for me.

Also I am having an issue unregistering this COM event...iTunes feels it still must prompt that the COM interface is still in use...even though its not any ideas?

Edited by Psibernetic

[sup]Psibernetic[/sup]My Creations:X-HideSecuracy

Share this post


Link to post
Share on other sites

iTunes UDF updated

Added _iTunes_Unload(). It deletes the object :mellow:


Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

I haven't tested it yet, but thanks for what seems very promising! :mellow:


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

What scripts (command) for navigating and select thru albums in itunes. For keyboard navigatins is arrows keys and then enter for select an album.

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

What scripts (command) for navigating and select thru albums in itunes. For keyboard navigatins is arrows keys and then enter for select an album.

What ?

Is it a question or a statement ?

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Share this post


Link to post
Share on other sites

sorry for my bad english, it is a question. I had no problems with readig english.

Regards

Lunkan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0