Garry Posted June 2, 2008 Posted June 2, 2008 Has anyone done any projects that utilize iTunes Event callbacks. I am and they all don't seem to work. I am trying to time the ripping of a CD so I start the ripping using the ConvertTracks2() function and I set a callback funtion using the OnConvertOperationCompleteEvent(). I never receive a callback to my function ITEvent_OnConvertOperationCompleteEvent(). I next tried the OnConvertOperationchangeEvent() to see if that would work but it does not. Just to verify some callback functionality with iTunes a coded a simple test using the OnQuittingEvent( ) and this one worked. Got any clues?Thanks in advance!Script:$ITSourceKindAudioCD = 3$begin = 0$objApp = ObjCreate("iTunes.Application")$SinkObject=ObjEvent($objApp,"ITEvent_") ; Assign events to UDFs starting with IEEvent_If @error = 1 Then MsgBox(0, "failed", "Event binding failed", 30)EndIf$colSources = $objApp.Sources$begin = TimerInit()For $objSource in $colSources If $objSource.Kind = $ITSourceKindAudioCD Then $strName = $objSource.Name $colPlaylists = $objSource.Playlists $objPlaylist = $colPlaylists.ItemByName($strName) $colTracks = $objPlaylist.Tracks $objApp.ConvertTracks2($colTracks) EndIfNext Do; Wait around for the ripping to completeUntil Falsefunc ITEvent_OnConvertOperationCompleteEvent() $dif = TimerDiff($begin) MsgBox(0,"Time Difference",$dif) $objApp.Quit() EndFuncfunc ITEvent_OnConvertOperationStatusChangedEvent($trackName, $progressValue, $maxProgressValue) MsgBox(0, "Convert", "Change event", 10)EndFunc
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