Sign in to follow this  
Followers 0
Garry

iTunes outgoing interfaces (events) not all working

1 post in this topic

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)

EndIf

Next

Do

; Wait around for the ripping to complete

Until False

func ITEvent_OnConvertOperationCompleteEvent()

$dif = TimerDiff($begin)

MsgBox(0,"Time Difference",$dif)

$objApp.Quit()

EndFunc

func ITEvent_OnConvertOperationStatusChangedEvent($trackName, $progressValue, $maxProgressValue)

MsgBox(0, "Convert", "Change event", 10)

EndFunc

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