Basic iTunes plugin questions

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

Posted on
Fri Aug 24, 2012 9:06 pm
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Basic iTunes plugin questions

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?

Posted on
Sat Aug 25, 2012 12:41 pm
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Basic iTunes plugin questions

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

Posted on
Sun Aug 26, 2012 7:08 am
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Re: Basic iTunes plugin questions

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.

Posted on
Sun Aug 26, 2012 9:20 am
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Basic iTunes plugin questions

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

Posted on
Sun Aug 26, 2012 9:51 am
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Re: Basic iTunes plugin questions

What would be the best way to query all existing iTunes devices then? Or any other specific device type for that matter?

Posted on
Sun Aug 26, 2012 9:59 am
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Basic iTunes plugin questions

Code: Select all
for itunesdev in indigo.devices.iter("com.perceptiveautomation.indigoplugin.itunes"):
   indigo.server.log("found iTunes dev: " + itunesdev.name)

Image

Posted on
Sun Aug 26, 2012 11:14 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Basic iTunes plugin questions

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests