LCDInfo.com

http://www.lcdinfo.com
It is currently Sat Dec 21, 2024 16:51

All times are UTC + 2 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Refresh
PostPosted: Fri Dec 05, 2003 9:57 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
How do I create a plugin image and force it to be refreshed/redrawn every let's say, 500ms???

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:02 
Offline

Joined: Tue Feb 18, 2003 12:33
Posts: 118
Location: Angers, France
:|:|
excuse me if i'm wrong but this feature is already done!
their:
<item type="pluginimage" x="50" y="8">
<imageid>image_test</imageid>
<refresh>100</refresh>
</item>

the refresh params will reload you picture every 100ms, you want 500ms? replace 100 by 500 :P

after your plugin must be able to remake the picture each time lcdinfo will ask for.
Henri know (a lot) better than me this

_________________
Shadows move where light should be


Last edited by DarkElf on Fri Dec 05, 2003 14:35, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:15 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
Quote:
he refresh params will reload you picture every 100ms, you want 500ms? replace 100 by 500

after if your plugin must be able to remake the picture each time lcdinfo will ask for.


I figured that but i dont know inside the Data object, which function is called on the refresh?[/quote]

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:46 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
Agggghhh stupid me... I now only relize that it just calls virtual LCDBitmap* __stdcall getImage(int imageNo) each time it needs to refresh!!!

I was playing round with the virtual void __stdcall updateData(void) function

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:50 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
It's only the getImage() function that is called in which you first update the image and then return the pointer to the image. LCDInfo then checks if the image data has changed and updates it to lcd if needed.

I think you have the winamp2 plugin source where you could look for some example how the getImage() works ?

EDIT:
You figured it out :)
I now decided to strip the updateData() completely out of the interface until there comes use for it so it doesn't cause mixups anymore.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 11:57 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
Quote:
It's only the getImage() function that is called in which you first update the image and then return the pointer to the image. LCDInfo then checks if the image data has changed and updates it to lcd if needed.


Are you sure about this... I update my line graph plugin in the getimage part... this seems to happen each time the set refresh rate happens because I can slow this down or speed it up!!!

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 12:13 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
Maybe I wasn't very clear on my words.

You can set the refresh interval in the screen definition file. Then getImage() is called using that interval and if the data returned by getImage() is different than it was last time getImage() was called then the new data is written to the lcd.
So it should work like you described.

EDIT:
And I'll also move this into the Plugin SDK forum as that's mostly what this topic is about.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 05, 2003 12:59 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
Sorry :oops: , after a second look I only caught what you were trying to say!!!

I am still learning were to post what, will try to get it right... :?

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2003 12:52 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
Please also just check one thing in the code I send you... on the single border draw function I defined the bmp to be eg. 64 x 32 but I had to draw the border (0,0,63,32) :?: Width - 1 / Height - 1 else it doesn't display correctly??? Any thoughts...

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2003 17:48 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
I'll check this. For 64x32 bitmap the correct coordinates for border would be 0,0,63,31 I think.
0 to 63 = 64 pixels and 0 to 31 = 32 pixels.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 06, 2003 18:49 
Offline

Joined: Tue Dec 02, 2003 12:03
Posts: 107
Location: South Africa
aaaaaghh, makes sense now :oops: Any other suggestions to improve???

_________________
Rudi Grobler


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 08, 2003 1:13 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
I started implementing your class as the graph item. Simple graphing already works and next time I'll continue with it...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group