Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > iTunes SDK on Windows?

iTunes SDK on Windows?
Thread Tools
EmmEff
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Jul 11, 2004, 11:10 PM
 
Would this be an appropriate place to discuss this? If not, where would be? I need some help and don't know where to turn.
     
hyperb0le
Mac Enthusiast
Join Date: Mar 2003
Location: Atlanta, GA
Status: Offline
Reply With Quote
Jul 12, 2004, 12:26 AM
 
I wasn't aware that there was an iTunes SDK for Windows. I don't even know of one for OS X. If I'm mistaken, though, this would be the place to ask about it.
     
EmmEff  (op)
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Jul 12, 2004, 02:25 AM
 
Here's the link at apple.com:

http://developer.apple.com/sdk/#iTunesCOM

I have written a simple Win32 console application to control iTunes on Windows which works perfectly, however I am unable to receive events. I am not a newbie programmer, but not 100% with COM.

I have Google'd and very few people mention using the SDK on Windows.

Presumably there's no SDK on OS X because of the AppleScript supporting every function.
     
hyperb0le
Mac Enthusiast
Join Date: Mar 2003
Location: Atlanta, GA
Status: Offline
Reply With Quote
Jul 12, 2004, 08:59 AM
 
Well, you learn something new every day!

Although you might have better luck at a COM-dedicated forum, I'm sure we have a few COM programmers here. What's your question?
     
EmmEff  (op)
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Jul 12, 2004, 12:03 PM
 
Ok, here goes...

I have created an event handler class (CMyEvent) which is defined as follows:

class CMyEvent:
public IDispatchImpl<_IiTunesEvents, &DIID__IiTunesEvents>,
public CComObjectRoot
{
<required stuff here>

STDMETHOD(OnPlayerPlayEvent)(IITTrack *iTrack)
{
...
}
};

...

hr = CComObject<CMyEvent>::CreateInstance(&m_MyEvent);
if (FAILED(hr))
{
ErrorFromSystem(hr);
exit(1);
}

hr = AtlAdvise(piITunes, m_MyEvent->GetUnknown(), DIID__IiTunesEvents, &dwAdviseHandle);
if (FAILED(hr))
{
ErrorFromSystem(hr);
exit(1);
}

After that, I just run a message loop to keep things flowing:

MSG msg;
while (GetMessage(&msg, 0, 0, 0))
DispatchMessage(&msg);

The program compiles and runs without errors, however my event handlers never get called. Something is working because if I put the code into a tight loop, changing songs on iTunes is REALLY slow.

Using the "piITunes" interface pointer, I am able to control iTunes so I know that part of the code is working properly.

Any assistance would be greatly appreciated.
( Last edited by EmmEff; Jul 12, 2004 at 12:08 PM. )
     
EmmEff  (op)
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Jul 13, 2004, 03:32 PM
 
Further to my previous posting, I am encouraged to know that iTunes "sees" my application. When I attempt to exit iTunes, I get a dialog:

"One or more applications are using the iTunes scripting interface..."

Also, if I let my application spawn iTunes and start playing a track, iTunes behaves eratically (ie. the time display of track gets updated every 5 seconds, etc).

I am still not receiving event notification, however.

Something is working, just not sure what
     
EmmEff  (op)
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Jul 25, 2004, 01:28 AM
 
Just a bump to see if anybody else is programming for iTunes on Windows...
     
EmmEff  (op)
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status: Offline
Reply With Quote
Aug 11, 2004, 10:07 PM
 
Would the person who emailed me about this please email me back? Your mail server was down/broken and the reply bounced.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:11 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,