For my 1st attempt at a Smartie plugin, I'm trying to create a scroller that works like a cross between RevEng's width.dll and krisp's scroll.dll (from if/scroll/swap package). I'm using good old MS VC++. The plugin behaviour is as follows:
If the text to display is shorter than the specified width, it is simply returned as-is.
If the text is longer than the width allowed, it is scrolled in a loop, with an optional separator/padding string.
Usage: $dll(scrollpad.dll,1,width#separator,TextToDisplay)
eg:
Code: Select all
$dll(scrollpad.dll,1,20# ** ,$WinampTitle)
Code: Select all
ange ** Coldplay - W
Code: Select all
angeColdplay - We Ne
It's working fine so far, but problems arise when you have 2 or more calls to the dll on the same screen. The scroll position is declared as "static", but I need a way to distinguish between separate calls to the plugin so the scrolling is independent. I'm sort of figuring out various things as I go along, but can't spot any C/C++ source that does this (that I can understand). Open-source plugins, please!
Any hints and source snippets on keeping multiple instances of static/persistent variables separate would be appreciated!
I'm pretty green as far as C/C++ application programming is concerned (is it obvious from by source code?), having only done some C at uni (Electronics Eng) and some microcontroller stuff... I've based this plugin on code from Rev Eng and krisp - thanks for your contributions to Smartie!
Matt.