It is currently September 29th, 2024, 5:22 am

New C# SDK

General topics related to Rainmeter.
User avatar
Aragas
Posts: 64
Joined: December 24th, 2012, 6:56 pm

New C# SDK

Post by Aragas »

Well, hello guys.
I wanted to do an actual working plugin this time, but in process of writing I understood that there is a problem.
The current C# SDK isn't really much. There isn't a lot of control. You can't do a plugin that will work with multiple Skins. You will probably end with one static class that will manage most of your skin logic. But the problem with static's is that you can't manage more than one skin.

README from SDK for lazy's

Code: Select all

Decided to do a lot more complex plugin system.
For each Rainmeter Skin a RainmeterSkinHandler class is created.
Each RainmeterSkinHandler contains PluginSkin's from different Plugin Assemblies(.dll)
Each PluginSkin contains PluginMeasure's

This structure system allows to write code without any static elements like before. Each PluginSkin will be unique for each Rainmeter Skin.
That's one thing that always bothered me in Rainmeter SDK. You couldn't use one .dll for multiple Rainmeter Skin's without having some troubles and some static's.
Now, for example, I can make an Audio Player Plugin and use it for multiple Rainmeter Skin's. There isn't really any point in multiple Audio Player's, but you got the idea.
This system isn't one of the most beautiful things I created, but it will work.

The architecture isn't really that bad. As a developer, you should know only couple of things.

Each PluginSkin is unique for each Rainmeter Skin. This means, most of your Plugin logic should be located there.
PluginMeasure is created only once for every Rainmeter Measure in your Rainmeter Skin. In theory, it should contain only return XXX logic as seen in examples.
Even if you don't really need a PluginSkin, it should be created.
Naming is important. Your PluginSkin and PluginMeasure should share same names and should end with "...Skin" and "...Measure" (ExampleSkin and ExampleMeasure). Enum naming is not important.
The Rainmeter Meter syntax changed a bit. Now you need some extra field:

PluginAssemblyName your Plugin assembly name (.dll)
PluginMeasureName your PluginSkin/PluginMeasure name.
PluginMeasureType enum field name that will be used by Rainmeter Meter.
And one thing that you should know. I'm sorry for this confusing documentation. See these examples or my VKPlayer 2.0 Plugin. Good luck
I tried to do multiple skin support earlier, when I had mostly zero skills in programming, but failed.
This is my second attempt. Here are Examples and here is SDK - RainManager. See Examples for my shitty explanation. And here is my plugin that I mentioned at the beginning VKPlayer
I'm attaching a picture that will try to explain how the architecture is build.
The architecture is more complex than you expect, be careful and read the source code.

The only reason I'm writing this is that I want to get some feedback. Maybe I have done something wrong, maybe it was possible to do multi skin support with less effort, and this SDK is pointless. I can't really say.
I hope this SDK will be useful for the Rainmeter community.
You do not have the required permissions to view the files attached to this post.
User avatar
winterwulf
Posts: 94
Joined: August 17th, 2016, 1:48 am
Location: São Paulo - Brazil

Re: New C# SDK

Post by winterwulf »

Seems interesting, I will take a look later on