Jump to content



Photo

iTunes UDF


65 replies to this topic

#1 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 07 May 2008 - 09:18 AM

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
Plain Text         
#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!

Attached Files


Edited by torels, 01 September 2009 - 07:58 AM.

Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org







#2 Skrip

Skrip

    Psychonaut

  • Active Members
  • PipPipPipPipPipPip
  • 2,340 posts

Posted 07 May 2008 - 11:57 AM

I like it. Good job.

We're trapped in the belly of this horrible machine.And the machine is bleeding to death...


#3 RyGoTypE

RyGoTypE

    Wayfarer

  • Active Members
  • Pip
  • 95 posts

Posted 13 May 2008 - 09:55 PM

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.

#4 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 19 May 2008 - 06:44 PM

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:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#5 billthecreator

billthecreator

    I am The creator

  • Active Members
  • PipPipPipPipPipPip
  • 379 posts

Posted 19 August 2008 - 08:33 PM

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, 19 August 2008 - 08:35 PM.

My Scripts: From Most recent to least.Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

#6 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 15 September 2008 - 08:49 AM

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:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#7 AlmarM

AlmarM

    Programming my way.

  • Active Members
  • PipPipPipPipPipPip
  • 1,642 posts

Posted 15 September 2008 - 02:38 PM

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

#8 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 21 September 2008 - 05:23 PM

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:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#9 AcidCorps

AcidCorps

    Polymath

  • Active Members
  • PipPipPipPip
  • 228 posts

Posted 17 October 2008 - 03:55 AM

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

#10 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 05 November 2008 - 04:06 PM

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:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#11 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 05 November 2008 - 04:24 PM

You could change _iTunes_Selected_GetInfo() to use a 2D Array:
AutoIt         
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* Posted Image [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

#12 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 05 November 2008 - 04:31 PM

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, 05 November 2008 - 04:51 PM.

Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#13 AcidCorps

AcidCorps

    Polymath

  • Active Members
  • PipPipPipPip
  • 228 posts

Posted 07 November 2008 - 05:27 AM

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

#14 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 07 November 2008 - 08:10 AM

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:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#15 Psibernetic

Psibernetic

    Adventurer

  • Active Members
  • PipPip
  • 130 posts

Posted 08 November 2008 - 10:30 AM

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, 08 November 2008 - 11:59 AM.

PsiberneticMy Creations:X-HideSecuracy

#16 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 12 November 2008 - 07:30 PM

iTunes UDF updated

Added _iTunes_Unload(). It deletes the object :mellow:
Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#17 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 4,024 posts

Posted 15 November 2008 - 11:57 AM

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

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. 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


#18 lunkan

lunkan

    Seeker

  • New Members
  • 4 posts

Posted 09 December 2008 - 07:20 PM

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

#19 torels

torels

    I Hacked 127.0.0.1! :D

  • Active Members
  • PipPipPipPipPipPip
  • 676 posts

Posted 09 December 2008 - 07:32 PM

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, 09 December 2008 - 07:32 PM.

Some Projects:indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

#20 lunkan

lunkan

    Seeker

  • New Members
  • 4 posts

Posted 09 December 2008 - 07:44 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users