LCDInfo.com http://forum.lcdinfo.com/ |
|
What kind of code is used in the *.ini files in LCDINFO http://forum.lcdinfo.com/viewtopic.php?f=9&t=469 |
Page 1 of 1 |
Author: | Geurts [ Mon Dec 29, 2003 21:55 ] |
Post subject: | What kind of code is used in the *.ini files in LCDINFO |
Stupid question probably, but I would be stupid to don't ask it... LCDINFO has the possibility to enter code into the *.ini files, and display the variable on your LCD (like " $winamptitle$ "). Now is my question if there is some kind of library with that kind of code Greetz |
Author: | Henri [ Tue Dec 30, 2003 0:58 ] |
Post subject: | |
I didn't quite get for what part you are looking the code for. Maybe you could be more specific in what you are after ? If you'd like to know how to replace the $variable$ in the string with a value here's code for that: Code: std::string TLCDInfo::IniLineToLCDLine(std::string str2)
{ std::string str = str2; int len = str.length(); for(int i = 0; i < len; i++) { if(str[i] == '$') { int kw_beg = i + 1; int kw_end = str.find("$", kw_beg); int kw_len = kw_end - kw_beg; if(kw_len < 0) continue; std::string keyword = str.substr(kw_beg, kw_len); std::stringstream stor; stor.clear(); if(keyword == "mhzmuuttuja") stor << 1400; else if(keyword == "mbmtemp") stor << 53; else if(keyword == "lehma") stor << "Mansikki"; str.replace(kw_beg - 1, kw_len + 2, stor.str()); i += stor.str().length() - 1; len = str.length(); } } return str; } |
Author: | Geurts [ Tue Dec 30, 2003 13:36 ] |
Post subject: | |
It is very simple what I mean When you go to the *.ini file *.*\lcd_info_v0.3.2\screens\128X64_ks0108.ini and open it whit notepad, you can add some screens to LCDINFO by adding some code like this. There are aprox 5 screens(winamp, memory status). This is screen 0, as you see. [Screen0] Enable=0 Interval=5000 Bitmap=screens\128x64_ks0108_images\image1_128x64.bmp Graphic0= Graphic1= Graphic2= Graphic3= Graphic4= Icon0= Icon1= Icon2= Icon3= Icon4= Icon5= Icon6= Icon7= Icon8= Icon9= Line0= Line1=" :$mbmtemp(0)$ c" Line2=" :$mbmtemp(1)$ c" Line3= Line4= Line5=" :$mbmvolt(0)$ 12V:$mbmvolt(4)$" Line6=" :$mbmvolt(2)$ 5V:$mbmvolt(3)$" Line7= You can see that there is in line1 of the screen an vriable for the temp. of the computer, line2 is an variable for the temp., etc. Now my question was if there is more of this kind of code to find on the internet, like the online status on MSN messenger or something more usefull?? I am now beginning my education, but they only teach me Java So don't laugh at me if this is a stupid question |
Author: | Henri [ Tue Dec 30, 2003 22:31 ] |
Post subject: | |
The term "code" is still something I'm not sure how to interpret in your post. This is in programming forum and not LCDInfo forum so I'd presume it means some source code but you might also mean the $variables$ with codes. All $variables$ that you can use in LCDInfo are programmed into the program so you can't add more without modifying the source code. Then again internet is full of source code that can be used to add more $variables$ in LCDInfo by modifying the LCDInfo source code. For example MSN Messenger has some SDK's available that can be used to interface with it. I don't remember where to get the SDK but I'm sure google helps here. |
Author: | Geurts [ Wed Dec 31, 2003 14:12 ] |
Post subject: | |
Thank you very much for the information henry And sorry for the problems i caused |
Page 1 of 1 | All times are UTC + 2 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |