如何将监听器挂接到iTunes [英] How to hook a listener to iTunes

查看:80
本文介绍了如何将监听器挂接到iTunes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Cocoa显示当前的曲目标题。

I want to display a current track title with Cocoa.

现在我可以使用Scripting Bridge获得标题,但我不知道如何获得

For now I could get the playing title with Scripting Bridge but I don't know how to get it just after a song is changed.

有没有任何方法可以在没有计时器的情况下将监听器挂接到iTunes。

Is there any way I can hook a listener to iTunes without a timer.

谢谢。

推荐答案

iTunes在轨道变化时发布分布式通知。 此问题< a>包含有关您需要遵守的通知的信息,您应该能够根据接受的答案中的Python代码或其他答案所链接的Objective-C代码来确定您需要做什么。

iTunes posts a distributed notification when the track changes. This question contains information about the notification you need to observe for, and you should be able to work out what you need to do from either the Python code in the accepted answer or the Objective-C code that the other answer links to.

这篇关于如何将监听器挂接到iTunes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆