开发者

How can I use iTunesLib in unattended mode?

I'm making a little app to automate my iPod update. My purpose is sync my iTunes library with my actual one and reencode songs in a lower quality for the iPod.

I use the Interop "iTunesLib" from iTunes.exe and I'm working on C#.

My program works pretty well but I have a big issue with iTunes. If a modal box is opened by iTunes during the process (could be "error while importing song", or just even "a new update is available" at iTunes startup...), then my app is completely stuck and must wait for the user to close the popup.

This is annoying because I expected to run my app at night and the process of reimporting/reencoding takes a while.

Is there any way to either tell iT开发者_如何学编程unes to not pop any message, or to ask it to close an already opened one?


Maybe try calling the IiTunes.VisualsEnabled method passing in FALSE.

From the iTunes COM SDK:

HRESULT IiTunes::VisualsEnabled  (  [in] VARIANT_BOOL  shouldEnable   )   

   Set whether visuals should be displayed. 


Parameters:
 shouldEnable  True if visuals should be displayed. 

Return values:
 S_OK  The operation was successful.  
 E_ACCESSDENIED  Visuals cannot be enabled or disabled. For example, this can happen if the iTunes Store is currently being viewed.  
 E_FAIL  An unexpected error occurred.  


Well, after having this question open for more than a year, the correct answers seems to be: I can't

However there are several alternative libraries that might be useful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜