A plug-in to add Dopamine external control support
Add reference Dopamine.ExternalControl.Support
in your project, and use in-built factory method to create Dopamine plug-in client. There's a simple sample in the other folder. For more APIs, please look here: IExternalControlServer, IFftDataServer
After create a IExternalControlServer, you can simply use IExternalControlServer.PlayNext()
to force Dopamine to play next track and so on.
There are many events in ExternalControlClientCallback
, you can subscribe them and then call IExternalControlServer.RegisterClient()
to register your client in Dopamine, once Dopamine raises some event such as PlaybackPaused
, the corresponding method will be called.
Dopamine uses shared memory to provide FFT data. Before reading it, you must call IFftDataServer.GetFftData()
to notice Dopamine someone want to read FFT data, then you can read it.
- If the client is opened after Dopamine and external control isn't enabled, WCF will throw a exception when create channel.
- If the client is opened before Dopamine, you can call
IExternalControlServer.SendHeartbeat()
to detect whether Dopamine is online or not, if external control isn't enabled, WCF will throw a exception.
- Right click on your project, choose Add->Service Reference.
- Open Dopamine and enable its external control service in Settings->Playback->External Control.
- Go back to Visual Studio, enter "net.pipe://localhost/Dopamine/ExternalControlService/mex" in the textbox below "Address".
- Edit the namespace of this service at the bottom of this window and then click OK.