Table of Contents

Airfoil

Airfoil is a great application from Rogue Amoeba that allows you to stream sound and video from your Mac across the network to a bunch of different devices - and it keeps it all in sync. Many Indigo users use it in conjunction with Apple TVs, Airport Expresses, and other computers to create whole-house audio systems, all streaming from your Mac server running iTunes or other music applications.

The Airfoil plugin included with Indigo 5 and 6 allows you to control the local (to the IndigoServer) your copy of the Airfoil application and trigger based on various events. Note: you must be running Airfoil on the same Mac as the IndigoServer.

Note: Indigo 7 includes a new Airfoil Pro plugin that uses a new API from Rogue Amoeba and allows you to also control instances of Airfoil running on other Macs on your network. This legacy plugin is also available from our Github repository for those that might want to try it with Indigo 7 (it may not work).

Actions

The Airfoil plugin provides the following actions:

Speaker Actions

Source Actions

Volume

Events

Optional Variables

In the Plugin Configuration dialog you have the option of having the plugin create variables for each speaker that holds it's current state: unavailable, connected, disconnected. Note - because variable names are restricted to certain characters, we substitute spaces with underscores (“_”) and remove any other invalid characters.

You can also have a variable called “CurrentSource” created that holds the name of the current audio source. These variables will be created in a folder named “Airfoil”. Once it's created, you can rename it if you like. However, note that if you turn off both checkboxes the variable folder and all it's contents will be deleted.

Scripting Support

As with all plugins, actions defined by this plugin may be executed by Python scripts. Here's the information you need to script the actions in this plugin.

Plugin ID: com.perceptiveautomation.indigoplugin.Airfoil

Action specific properties

Connect to Speaker

Action id: connectToSpeaker

Properties for scripting:

speaker the string key of the speaker to use - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("connectToSpeaker", props={'speaker':"0017F2F8BE78"})

Disconnect from Speaker

Action id: disconnectFromSpeaker

Properties for scripting:

speaker the string key of the speaker to use - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("disconnectFromSpeaker", props={'speaker':"0017F2F8BE78"})

Toggle Speaker

Action id: toggleSpeaker

Properties for scripting:

speaker the string key of the speaker to use - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("toggleSpeaker", props={'speaker':"0017F2F8BE78"})

Save Speaker Set

Action id: saveSpeakerSet

No properties needed for scripting.

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("saveSpeakerSet")

Restore Speaker Set

Action id: restoreSpeakerSet

No properties needed for scripting.

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("restoreSpeakerSet")

Change Audio Source

Action id: changeAudioSource

Properties for scripting:

sourceType the string key of the type of audio source to change to - must be one of: “application”, “device”, or “system”
appSource if sourceType is “application”, the name string of the application as it shows in the Airfoil UI (i.e. “Adium”, “IndigoServer”, etc.)
devSource if sourceType is “device”, the name string of the audio device as it shows in the Airfoil UI (i.e. “Default System Input”, etc.)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	# set the source to the IndigoServer
	airfoilPlugin.executeAction("changeAudioSource", props={'sourceType':"application", 'appSource':'IndigoServer'})
	# set the source to the default system input
	airfoilPlugin.executeAction("changeAudioSource", props={'sourceType':"device", 'devSource':'Default System Input'}) 
	# set the source to all system audio via soundflower
	airfoilPlugin.executeAction("changeAudioSource", props={'sourceType':"system"})

Save Source

Action id: saveSource

No properties needed for scripting.

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("saveSource")

Restore Source

Action id: restoreSource

No properties needed for scripting.

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("restoreSource")

Set Volume

Action id: setVolume

Properties for scripting:

volume a number from 0 to 100 representing the absolute volume
speakerIds a list of speaker ID strings to change - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("setVolume", props={'volume':"75", 'speakerIds':["0017F2F8BE78","5855CA5E94F9"]})

Increase Volume

Action id: increaseVolume

Properties for scripting:

volume a number from 0 to 100 representing the amount to increase - so if a speaker is currently at 50, and volume is set to 25, the volume will end up being 75
speakerIds a list of speaker ID strings to change - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("increaseVolume", props={'volume':"25", 'speakerIds':["0017F2F8BE78","5855CA5E94F9"]})

Decrease Volume

Action id: decreaseVolume

Properties for scripting:

volume a number from 0 to 100 representing the amount to increase - so if a speaker is currently at 50, and volume is set to 25, the volume will end up being 25
speakerIds a list of speaker ID strings to change - select “Show Speaker List in Event Log” from the Airfoil plugin menu to have a list of available speakers and their associated IDs displayed in the Event Log - most look like numbers although they are really strings - the one representing the local speaker is obviously a string (“com.rogueamoeba.airfoil.LocalSpeaker”)

Example:

airfoilPlugin = indigo.server.getPlugin("com.perceptiveautomation.indigoplugin.Airfoil")
if airfoilPlugin.isEnabled():
	airfoilPlugin.executeAction("decreaseVolume", props={'volume':"25", 'speakerIds':["0017F2F8BE78","5855CA5E94F9"]})

Support and Troubleshooting

For usage or troubleshooting tips discuss this plugin on our forum.