 |
 |
iTunes SDK on Windows?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2003
Location: Atlanta, GA
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Mar 2003
Location: Atlanta, GA
Status:
Offline
|
|
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?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
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_MyEven t);
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 11:08 AM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
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 
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
Just a bump to see if anybody else is programming for iTunes on Windows...
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jul 2004
Location: Ontario, Canada
Status:
Offline
|
|
Would the person who emailed me about this please email me back? Your mail server was down/broken and the reply bounced.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|