A C# / .NET 4.0 library for communicating with Rogue Amoeba's Airfoil for Windows over named pipes.
The primary use for this would be for integrating with Airfoil's remote control and metadata capabilities into an audio application of some sort. Remote speakers and clients with metadata and/or remote control capabilities can then make use of those features when Airfoil is intercepting that application's audio. More details on that here.
Nuget: https://www.nuget.org/packages/AirfoilMetadataAgent/
Start by implementing the AirfoilAgentListener
interface on a class, then create an Agent
with that listener and you're off to the races.
Don't forget to Stop()
the agent after you're done with it.
class AirfoilSupport : AirfoilAgentListener
{
private Agent airfoilAgent = null;
public void Start()
{
airfoilAgent = new Agent(this);
}
public bool SupportsRemoteControl { get { return true; } }
public bool HandleRemoteControl(RemoteControlType messageType)
{
bool handled = false;
// ...
return handled;
}
public bool SupportsMetadata { get { return true; } }
public string HandleMetadata(MetadataType messageType)
{
string result = null;
// ...
return result;
}
public void Stop()
{
airfoilAgent.Stop();
}
}
See also MusicBee-AirfoilIntegrationPlugin for a fully working implementation of this library.
The named pipes library is courtesy of webcoyote.
See this page for a description of the Airfoil for Windows Metadata Protocol.
MIT license generally means you can do anything you like with this code.