Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Virtual device main loop


robmac

Question

Hi,

I have been trying to add track position to a virtual device so the status is shown and the slider can be used to move to a position in the track.

It works but the interface updates jerkily.

Has anyone worked out if the main loop executes at exactly 1s intervals so this is just browser rendering and you have to live with it or if the loop executes at around 1s intervals so is not suitable for this purpose.

Overall track time works out pretty well.

Please login or register to see this attachment.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Can you put the Lua code that you used , so we can take a cue from yours??

Thanks

Greetings from Sicily

Link to comment
Share on other sites

  • 0
  • Inquirer
  • No rocket science

    ui.lblTrackLength.value and ui.lblRemain.value are set by the squeezebox add in when the track starts or play restarts

    Please login or register to see this code.

    can't understand why the UI is so jerky

    Link to comment
    Share on other sites

    • 0
    can't understand why the UI is so jerky
    because Fibaro use simple xml http request to update UI, XHR is great to refresh some part of a web page but a query that should take one second can take 10 seconds simply! for a good results should Fibaro must use a tcp socket but is not suitable for web integration (browser compatibility etc), they can use it with ios and android (but only in local i think). Main Loop is not accurate so, simply put a fibaro:debug() in it and see the result

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    main loop is very unusable for me at this time because: garbage collector occurs randomly and reset global variable sometimes yes, sometimes no ! can't use at the same time socket in main loop and socket in a button of the same virtual device, I tried many things without convincing results

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" /> but there are some bug in 3.560 beta, try a fibaro:debug(os.date()); and

    Please login or register to see this image.

    /emoticons/default_icon_sad.gif" alt=":-(" /> (seems good in 3.561 for A.Socha)

    I wait next beta update and I hope good surprises

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Noticed the random garbage collection. The main loop is just odd. Why have a loop that runs every second?

    look forward to something better.

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...