RadioDJ - Free Radio Automation Software Forum

RadioDJ v1.7+ => Plugin Development => Topic started by: RFU on September 17, 2020, 04:22:41 PM

Title: Plugin Tutorial
Post by: RFU on September 17, 2020, 04:22:41 PM
Is there a tutorial anywhere for creating plugins for v1.8.2?

I have never been able to find anything in the forums

Yes, know. Nobody likes to talk about 1.8.2 anymore
Title: Re: Plugin Tutorial
Post by: Jhonny on September 17, 2020, 04:25:09 PM
No there is no tutorial for.
Title: Re: Plugin Tutorial
Post by: DJ Garybaldy on September 17, 2020, 04:34:16 PM
I'm not even sure Marius supplies the code for creating plugins for 1.8.2 any more.  :bash:

Hardly anyone created them when the code was available or if they did create some they didn't share them with us.

Quote
Yes, know. Nobody likes to talk about 1.8.2 anymore

The reason no one talks about 1.8.2 anymore is the fact its at least 5 years old now.
Title: Re: Plugin Tutorial
Post by: RFU on September 17, 2020, 05:22:17 PM
Well I use a lot of plugins
that's why I haven't changed

And I wanted to try to get plugins made to replace SongPoster for Facebook, Instagram and Twitter

After Buffer blocked their API to him, my social media has gone to ZERO and I was getting 300-500 hits a day from them
Title: Re: Plugin Tutorial
Post by: RFU on September 19, 2020, 01:19:52 PM

Hardly anyone created them when the code was available or if they did create some they didn't share them with us.


So where did all the 1.8.2 plugins come from? I thought they were community created
Title: Re: Plugin Tutorial
Post by: DJ Garybaldy on September 19, 2020, 01:55:17 PM
The only 3rd party plugins we ever saw were the encoding ones by Snowhow, the song poster plugin and a VST one other than that nobody shared hardly any of the plugins they could have created at the time.

I guess that's why Marius stopped 3rd party plugins as nobody was really creating them.


And we all know what happened with A'cast
Title: Re: Plugin Tutorial
Post by: Jhonny on September 19, 2020, 03:12:23 PM
Some old 182 pluins
Plugin_FolderLoader 2.0.1.0
Plugin_Library_Tools_1.0.0.3
Plugin_WebExport_1.0.1.4
Radiodj-For-Wordpress-0.7.0
RadioDJ-streamer-plugin
REST-Web-Panel-0.2b
I have save them.on

www.mediafire.com (http://www.mediafire.com/folder/uensc1b27boey/Old_182_plugins)
Title: Re: Plugin Tutorial
Post by: DJ Garybaldy on September 19, 2020, 03:52:42 PM
Wordpress wasn't a RadioDJ plugin as such. he was on about plugins in the plugin folder in 182.
Title: Re: Plugin Tutorial
Post by: Jhonny on September 19, 2020, 04:42:42 PM
ok
Title: Re: Plugin Tutorial
Post by: Jhonny on September 19, 2020, 04:44:17 PM
Ok
There all made by the same programmer.
Title: Re: Plugin Tutorial
Post by: RFU on September 21, 2020, 02:23:06 PM
Well I would like to know how because I want to get three plugins made for Facebook, Instagram and Twitter to replace the dead Songposter

It seems to me there is no reason to go RadioDJ/SongPoster/Buffer/social media When it could just go RadioDJ/Social media
Title: Re: Plugin Tutorial
Post by: Jhonny on September 21, 2020, 03:01:07 PM
Well the programmer Valdis has been ill for a long time (years) and has not been on the forum for a long time. contacting him is very difficult, if not impossible, my last contact is more than a year ago.
Title: Re: Plugin Tutorial
Post by: Jhonny on September 21, 2020, 03:08:41 PM
I don't remember who made a vst plugin that could have the code to make plugins for 1.8.2. :angel:
Title: Re: Plugin Tutorial
Post by: DJ Garybaldy on September 21, 2020, 03:23:13 PM
I don't remember who made a vst plugin that could have the code to make plugins for 1.8.2. :angel:

I found the VST plugin - about the only 1.8.2 plugin I have left in backups but No plugin code.
Title: Re: Plugin Tutorial
Post by: Jhonny on September 21, 2020, 03:56:46 PM
Made by
dommel
Last Active:      06 July 2019, 15:33:53
this wiil not help!
Title: Re: Plugin Tutorial
Post by: Mastacheata on November 02, 2020, 03:19:07 AM
Sorry for the late reply, RFU tried to reach me on Facebook, but I don't really use Facebook anymore.

I wrote the SongPoster plugin for 1.8 back in the day using C# instead of VB.Net (as I'm not familiar with Basic other than QBasic, but that was in the early 90s) and published the sourcecode over here: https://github.com/songposter/plugin-radiodj

Quote
I'm not even sure Marius supplies the code for creating plugins for 1.8.2 any more.  :bash:
Was there ever any code or examples? As far as I remember you pretty much had to look at the plugins shipped with RadioDJ and work your way from there.

Thanks to using just plain .NET-Code without any obfuscation/encryption you can get a pretty good idea of what the actual sourcecode (minus variable names and comments) might have looked like.

I pretty much modeled my plugin after the Plugin_PlayingInfo.dll that ships with RadioDJv1.

The basic way to go about this is to import the PluginInterface.dll from the parent folder [make sure it's a relative path!] (as your plugin.dll will live inside the Plugins folder and PluginInterface.dll is inside the main RadioDJ folder)

Then implement the IPlugin interface and implement any of the functions published by it.

Inside showMain and showConfig you can call and show a Windows Forms Form - That's your config screen.

For the SongPoster plugin all you need now is to implement the TrackChanged function and from there look at the song that's being passed to it and make your API calls.

Apparently the PluginInterface has loads more options, you can not only react to things, but also trigger stuff inside RadioDJ by either calling one of the actual classes in PluginInterface or by implementing the Initialize callback and then storing the passed IHost entity somewhere. (i.e.: a class property MyHost)
You can then interact with that IHost entity from all other functions inside your Plugin class as the Initialize callback is the first thing that's called after or inside your class constructor.
My Plugin only uses this to save/load settings in the plugin XML file, but you can access all public methods and variables exposed by the IHost interface as well. (i.e. AddPlaylist and Add2Playlist)

Since I come from web programming and haven't done much Windows Application programming before, this whole callback thing is still crazy to me.
For example, not having to loop your program to keep it running or simply waiting for a callback with the changed track instead of actively checking the currently playing track and then actively waiting until the next track was mind-blowing.

tl;dr:
There's no documentation or description about the Plugin Interface, but the DLL ships with RadioDJ (PluginInterface.dll in the main folder) and you can simply import it into your Visual Studio project to inspect and work with all the exposed stuff.
Implement IPlugin with all methods and properties and use the TrackChanged method to perform your web activity whenever the playing track changes.