Due the problems with TCP Server plugin, i decided myself to re-write it and make it more powerful.
This plugin will replace soon the TCP server plugin, as it's much easier to use and allows you to interact in a more advanced way with RadioDJ.
The plugin settings are kept simple, you must enter the local IP:port to which the plugin will listen for commands, eg: http://127.0.0.1:7000 for localhost. Also, you must enter a password for command validation, like in plugin TCP server.
There are 4 implemented sections:
1. Commands section, which can be accessed like this:
http://127.0.0.1:7000/opt?auth=[password]&command=[command]&arg=[argument]
You must replace the brackets and its content with the password, command and when needed with the argument, like this:
http://127.0.0.1:7000/opt?auth=changeme&command=PlayPlaylistTrack&arg=0
The implemented commands so far are:
PlayPlaylistTrack 'Zero based track number from playlist
RemovePlaylistTrack 'Zero based track number from playlist
StopPlayer
PausePlayer 'arg=0 to unpause, 1 to pause
RestartPlayer
PlayFromIntro
ClearPlaylist
LoadTrackToTop 'Song ID as argument
LoadTrackToBottom 'Song ID as argument
LoadPlaylist 'Playlist ID as argument
EnableAutoDJ 'arg=0 to disable, 1 to enable
EnableAssisted 'arg=0 to disable, 1 to enable
EnableEvents 'arg=0 to disable, 1 to enable
RefreshEvents
EnableInput 'arg=0 to disable, 1 to enable
PlaycartByNumber 'cart number as argument
StatusAutoDJ 'Get the status of AutoDJ option as boolean
StatusAssisted 'Get the status of Assisted option as boolean
StatusInput 'Get the status of Input option as boolean
StatusQueue 'Get queue playlist number of tracks
ShowMessage 'Display a message in RadioDJ. Message as argument
The second section is for getting the now playing details and can be accessed like this:
http://127.0.0.1:7000/np?auth=[password]
The third section is for getting the playlist:
http://127.0.0.1:7000/p?auth=[password]
[UPDATE] From version 1.1 of the plugin, the playlist will contain at the first position the now playing track in order to avoid multiple queries.
And, the last section is for getting details about a specific track from the playlist:
http://127.0.0.1:7000/pitem?auth=[password]&arg=[zero based track number from the playlist]
For each section the response is XML formatted, so it's much easier to parse it.
For example the now playing section will return something like:
<?xml version="1.0" encoding="UTF-8"?>
<SongData xmlns="http://schemas.datacontract.org/2004/07/rdjInterface" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Album>Bravo Hits Vol. 86</Album>
<AlbumArt />
<Artist>Clean Bandit Feat. Sharna Bass</Artist>
<ArtistPlayed>2014-11-04T19:01:24</ArtistPlayed>
<AutoFree>true</AutoFree>
<AutoStop>false</AutoStop>
<BPM>0</BPM>
<BuyLink />
<Comments />
<Composer />
<Copyright />
<CountPlayed>0</CountPlayed>
<CueTimes>&sta=0.01&xta=254.382358276644&end=255.872358276644&fin=0&fou=1.49000000000001</CueTimes>
<DatePlayed>2002-01-01T00:00:01</DatePlayed>
<DateRequested>0001-01-01T00:00:00</DateRequested>
<DiscNo>0</DiscNo>
<Duration>254.372358276644</Duration>
<Elapsed>194.80102040816328</Elapsed>
<Enabled>true</Enabled>
<EndDate>2002-01-01T00:00:01</EndDate>
<FadeIn>0</FadeIn>
<FadeOut>1.49000000000001</FadeOut>
<FadeType>0</FadeType>
<HasHooks>false</HasHooks>
<HighPrecision>0</HighPrecision>
<ID>268</ID>
<IDGenre>168</IDGenre>
<IDSubcat>6</IDSubcat>
<Isrc />
<LimitAction>0</LimitAction>
<OriginalArtist />
<Path>Y:\music\03 Club & House\17 - HOUSE 2014\Clean Bandit Feat. Sharna Bass - Extraordinary.mp3</Path>
<PlayLimit>0</PlayLimit>
<PlayOnMainMixer>true</PlayOnMainMixer>
<PlayerID>-1342177134</PlayerID>
<Position>194.81102040816327</Position>
<Publisher />
<Remaining>59.571337868480725</Remaining>
<RequestMessage />
<RequestUser />
<StartDate>2002-01-01T00:00:01</StartDate>
<Sweepers />
<Title>Extraordinary</Title>
<TrackNo>0</TrackNo>
<TrackType>Music</TrackType>
<Weight>50</Weight>
<WithLoop>false</WithLoop>
<Year>2014</Year>
<bCueDuration>45134120</bCueDuration>
<bCueEnd>45135884</bCueEnd>
<bCueIntro>0</bCueIntro>
<bCueLoopIn>0</bCueLoopIn>
<bCueLoopOut>0</bCueLoopOut>
<bCueNext>44873048</bCueNext>
<bCueOutro>0</bCueOutro>
<bCueStart>1764</bCueStart>
<bPosition>34364664</bPosition>
<bcueHookIN>0</bcueHookIN>
<bcueHookOut>0</bcueHookOut>
<cueEnd>255.872358276644</cueEnd>
<cueHookIN>0</cueHookIN>
<cueHookOut>0</cueHookOut>
<cueIntro>0</cueIntro>
<cueLoopIn>0</cueLoopIn>
<cueLoopOut>0</cueLoopOut>
<cueNext>254.382358276644</cueNext>
<cueOutro>0</cueOutro>
<cueStart>0.01</cueStart>
<isOverlay>0</isOverlay>
<isPodcast>0</isPodcast>
<swFirst>false</swFirst>
<swID>-100</swID>
<swName />
<swPlay>0</swPlay>
<vtID>0</vtID>
<vtName />
<vtPlay>-100</vtPlay>
</SongData>
As you see, it exposes all internal data about the track.
The plugin can be downloaded from the downloads page.
PS: In order to use this plugin from the internet, you will need to make sure that the used port is open on your firewalls.
PS2: The ShowMessage command will only work with the next version of RadioDJ.