Results 1 to 9 of 9

Thread: How to get/set VAR in plugin?

  1. #1
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167

    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)

  2. #2
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,762
    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."

  3. #3
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167
    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?

  4. #4
    FLAC Sal R.'s Avatar
    Join Date
    Aug 2006
    Location
    Sun Diego
    Posts
    1,448
    Quote Originally Posted by efun View Post
    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 / XP Home with EWF-HORM / RR v12/02/2009 / Winamp v5.13 / RRMedia v1.2.2

  5. #5
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167
    Quote Originally Posted by Sal R. View Post
    SDK.getinfo("=$station$")

    yeah, it works now. Thanks a lot!

  6. #6
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167
    Where to find the document about the SDK? for example, it's methods and parameters.

  7. #7
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167
    Quote Originally Posted by guino View Post
    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().

  8. #8
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,762
    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."

  9. #9
    Constant Bitrate
    Join Date
    Dec 2008
    Posts
    167
    Quote Originally Posted by guino View Post
    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!

Similar Threads

  1. RR 04-01-09 ... Never to late.. (GET HOT FIX)
    By Blue ZX3 in forum Road Runner
    Replies: 69
    Last Post: 05-08-2009, 09:39 AM
  2. Replies: 63
    Last Post: 03-10-2009, 08:49 PM
  3. pc reboot on sd startup
    By duanes7 in forum StreetDeck
    Replies: 3
    Last Post: 12-14-2007, 09:55 AM
  4. IRMAN plugin
    By knyarko in forum StreetDeck
    Replies: 3
    Last Post: 01-05-2007, 09:26 PM
  5. Replies: 0
    Last Post: 06-11-2006, 06:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •