Basic iTunes plugin questions

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
pgershon
Posts: 534
Joined: Sat Jul 10, 2004 1:07 am

Basic iTunes plugin questions

Post by pgershon »

Is there a way to fast forward (x seconds) or reverse within same track (x seconds)?

Also how would I get the current track name within a script?
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Basic iTunes plugin questions

Post by jay (support) »

pgershon wrote:Is there a way to fast forward (x seconds) or reverse within same track (x seconds)?
Not at present.
pgershon wrote:Also how would I get the current track name within a script?

Code: Select all

trackName = indigo.devices[DEVICEID].states["track"]
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
pgershon
Posts: 534
Joined: Sat Jul 10, 2004 1:07 am

Re: Basic iTunes plugin questions

Post by pgershon »

Thanks Jay. Another basic question: How would I get the device ID of my iTunes device within a script. Right now I hardcoded for it, but there must be a better way.
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Basic iTunes plugin questions

Post by matt (support) »

Actually hardcoding it should be fine in that you shouldn't ever have to delete it once it is created. Technically you could make a script that searches and finds it, but note that in theory you may have multiple iTunes devices (for targeting iTunes running on multiple Macs).
Image
pgershon
Posts: 534
Joined: Sat Jul 10, 2004 1:07 am

Re: Basic iTunes plugin questions

Post by pgershon »

What would be the best way to query all existing iTunes devices then? Or any other specific device type for that matter?
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Basic iTunes plugin questions

Post by matt (support) »

Code: Select all

for itunesdev in indigo.devices.iter("com.perceptiveautomation.indigoplugin.itunes"):
	indigo.server.log("found iTunes dev: " + itunesdev.name)
Image
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Basic iTunes plugin questions

Post by jay (support) »

We added unique IDs to all Indigo objects in Indigo 5 specifically so that you'd have a more permanent way to identify them rather than by name (which can easily change). So, ID's are the recommended way of identifying an object in any Python script since they never change (well, unless you delete the object).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Locked

Return to “Extending Indigo with Plugins and Python”