Announcement

Collapse
No announcement yet.

How to get/set VAR in plugin?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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."

    Comment


    • #3
      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?

      Comment


      • #4
        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

        Comment


        • #5
          Originally posted by Sal R. View Post
          SDK.getinfo("=$station$")

          yeah, it works now. Thanks a lot!

          Comment


          • #6
            Where to find the document about the SDK? for example, it's methods and parameters.

            Comment


            • #7
              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().

              Comment


              • #8
                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."

                Comment


                • #9
                  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!

                  Comment

                  Working...
                  X