James Posted April 9, 2013 Posted April 9, 2013 Hey Guys ... is there any chance to get the current position in a song thats currently playing?so if I use _iTunes_Current_GetInfo() I can only get the length of the titel, but what I want to have is the exact point the player is at atmI tried to modify something in the udf, but I can just guess what I have to call the object with since I don't know how to look up what I can ask the object .. maybe I'm just a little stupid but nevermind .. $iTunesApp.CurrentTrack. <- and then? currentPosition, currPos .. it wont work please help me My has this built in _iTunes_PlayerPos(), you call $iTunesApp.PlayerPosition Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Leo1906 Posted April 9, 2013 Posted April 9, 2013 (edited) thanks James! I added this to the udf in this thread and it worked. just didn't knew where to get the command I can ask the object. Where do you get this, how can you figure out that it is called .PlayerPosition ? but what ever .. it's working Thanks for your reply €: and there's something else I would like to ask .. is there any chance to unload the itunes object without quitting itunes? Edited April 9, 2013 by Leo1906
James Posted April 9, 2013 Posted April 9, 2013 Where do you get this, how can you figure out that it is called .PlayerPosition ? but what ever .. it's working Thanks for your reply €: and there's something else I would like to ask .. is there any chance to unload the itunes object without quitting itunes? The documentation I made great use of it when I was writing iTunesTweet. I've uploaded it to Dropbox. Good question. This was the bane of many problems for me. If you take a look at the bottom of my UDF you'll see these functions: expandcollapse popup; Sets the $iCOMEvnt to 1 if COM is disabled Func _iTunesCOM_onCOMCallsDisabledEvent($reason) $iCOMEvnt = 1 ConsoleWrite("!>COM Disabled... " & _iTunesRes_Disabled($reason) & @CRLF) Return 0 EndFunc ;==>_iTunesCOM_onCOMCallsDisabledEvent ; Sets the $iCOMEvnt to 0 if COM is enabled Func _iTunesCOM_onCOMCallsEnabledEvent() $iCOMEvnt = 0 ConsoleWrite("+>COM Enabled..." & @CRLF) Return 1 EndFunc ;==>_iTunesCOM_onCOMCallsEnabledEvent ; Quits the iTunes COM interface Func _iTunesCOM_OnQuittingEvent() _iTunes_Quit() ProcessWait("itunes.exe") ; Wait for the process to come back _iTunes_Start() EndFunc ;==>_iTunesCOM_OnQuittingEvent ; If the database changes (renamed/deleted/moved) whilst playing just ignore it Func _iTunesCOM_OnDatabaseChangedEvent() Return 1 EndFunc ;==>_iTunesCOM_OnDatabaseChangedEvent Func _iTunesCOM_OnPlayerPlayingTrackChanged() _iTunes_Quit() ; Close the iTunes COM handle _iTunes_Start() ; Then re-open it to get all of the data again Return 0 EndFunc ;==>_iTunesCOM_OnPlayerPlayingTrackChanged ; What happens when iTunes wants to close Func _iTunesCOM_OnAboutToPromptUserToQuitEvent() ConsoleWrite("->iTunes says bye bye!" & @CRLF) _iTunes_Quit() EndFunc ;==>_iTunesCOM_OnAboutToPromptUserToQuitEvent ; Returns the value why the COM is disabled Func _iTunesRes_Disabled($iReason) Switch $iReason Case 0 Return "COM interface is being disabled: for some other reason." Case 1 Return "COM interface is being disabled: a modal dialog is being displayed." Case 2 Return "COM interface is being disabled: iTunes is quitting." Case Else Return "COM interface is being disabled: only iTunes knows why." EndSwitch EndFunc ;==>_iTunesRes_Disabled When iTunes quit and my program was running, it'd crash. This is how I got about that Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Leo1906 Posted April 9, 2013 Posted April 9, 2013 (edited) haha yeah I thought that you should get them from the documentation, but as I was looking fot it yesterday I wasn't able to find it but thanks for the upload Edited April 9, 2013 by Leo1906
James Posted April 10, 2013 Posted April 10, 2013 I was looking fot it yesterday I wasn't able to find it You have to login to their developer portal, hunt for iTunes, then Windows and help. It's a lot of work, but now it should be much easier. These docs might not apply to iTunes 11 though. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Vreo Posted May 21, 2013 Posted May 21, 2013 Hey torels, it's been a while since you wrote Your script is awesome. I am just starting with AutoIt. I am looking for a way to control Airplay speakers, to activate and deactivate them by name. Do you know a way I can do that? Thank you and congrats.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now