|
 |
04-29-2009, 01:21 AM
|
#1
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
How to get/set VAR in plugin?
My plugin has some vars which need to be kept when RR exit and restore when RR start. Here is my code, but it does not work. Any suggestions?
Get the var value in New() of RRExtension
Dim station As String = SDK.getInfo("STATION")
Save the var to skin.ini in Finalize() of RRExtension
SDK.execute("SAVETOSKIN;STATION;" + station)
|
|
|
|
|
|
Advertisement
|
Sponsored links
|
04-29-2009, 08:51 AM
|
#2
|
|
RoadRunner Mastermind
Join Date: Nov 2004
Location: Vitória, ES - Brazil
Posts: 9,060
|
Well, if you're defining station within the scope of New() or Initialize() it will not be available in Finalize(), you need to declare station in a global scope (i.e. first line of the class module) then grab/set the value of it with getinfo at any given time during the execution of the plugin (i.e. startup, initialize, etc). Just be sure to call execute with savetoskin BEFORE your plugin destroys the SDK object.
__________________
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
|
|
|
04-29-2009, 09:36 AM
|
#3
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
To debug, I pre-defined the STATION in skin.ini : STATION=10
1) set a label code with "=$station$", the label display 10 which is correct
2) call SDK.getInfo("STATION") in plugin, but it returns ""
any wrong in my code?
Last edited by efun; 04-29-2009 at 09:39 AM.
|
|
|
04-29-2009, 09:49 AM
|
#4
|
|
FLAC
Join Date: Aug 2006
Location: Sun Diego
Posts: 1,405
|
Quote: Originally Posted by efun 
To debug, I pre-defined the STATION in skin.ini : STATION=10
1) set a label code with "=$station$", the label display 10 which is correct
2) call SDK.getInfo("STATION") in plugin, but it returns ""
any wrong in my code?
SDK.getinfo("=$station$")
__________________
Pico-ITX / nLite'd XP Pro with EWF-HORM / RR v9/22/2009 / Winamp v5.13 / RRMedia v1.2.2
|
|
|
04-29-2009, 11:13 AM
|
#5
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
Quote: Originally Posted by Sal R. 
SDK.getinfo("=$station$")
yeah, it works now. Thanks a lot!
|
|
|
04-29-2009, 11:15 AM
|
#6
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
Where to find the document about the SDK? for example, it's methods and parameters.
|
|
|
04-29-2009, 11:23 AM
|
#7
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
Quote: Originally Posted by guino 
Well, if you're defining station within the scope of New() or Initialize() it will not be available in Finalize(), you need to declare station in a global scope (i.e. first line of the class module) then grab/set the value of it with getinfo at any given time during the execution of the plugin (i.e. startup, initialize, etc). Just be sure to call execute with savetoskin BEFORE your plugin destroys the SDK object.
Hi guino, is there a good place to save the var just before RR shutdown? I don't want to savetoskin on every command. Puting code in Finalize() does not work. Seems that the SDK has been destroyed when calling Finalize().
|
|
|
04-29-2009, 04:55 PM
|
#8
|
|
RoadRunner Mastermind
Join Date: Nov 2004
Location: Vitória, ES - Brazil
Posts: 9,060
|
All you have to is monitor the value, then WHEN IT CHANGES, issue a SAVETOSKIN command, that way whenever you exit, it's already saved.
__________________
Ride Runner RR's Myspace
"Being happy is not about having what you want, it's about wanting what you have."
"The best things in life are always free - but that doesn't mean money can't buy you good things."
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
04-30-2009, 06:27 AM
|
#9
|
|
Constant Bitrate
Join Date: Dec 2008
Posts: 162
|
Quote: Originally Posted by guino 
All you have to is monitor the value, then WHEN IT CHANGES, issue a SAVETOSKIN command, that way whenever you exit, it's already saved.
it is a good way to save the value. thanks!
|
|
|
|
Sponsored links
|
|
Advertisement
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:39 PM.
| |