Author Topic: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)  (Read 19015 times)

SirReal

  • Administrator
  • Hero Member
  • *****
  • Posts: 735
    • linkdata.se
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #30 on: 2011-01-14 22:37:07 »
As you can see in the A14 preview details, LH_Lua has gotten a lot of love recently, and among that comes font support.
Cairo in general kind of punts on font handling, simply saying "use the platform specific functions". Unfortunately, the Lua Cairo Win32 font functions require one to pass LOGFONT structure pointers around, which you can't really do from Lua. In A14, there's a "lcdhost.logfont()" call you can make which will provide a suitable parameter to use in Cairo calls, along with an update cairotest.lua which shows how to use it.

lethys

  • Moderator
  • Jr. Member
  • *****
  • Posts: 78
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #31 on: 2011-01-14 22:55:05 »
ah thank you, i had a feeling this was rather hard to get working currently

lethys

  • Moderator
  • Jr. Member
  • *****
  • Posts: 78
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #32 on: 2011-01-15 02:39:23 »
I seem to have a little memleak problem:
Code: [Select]
function getfb2ksong()
  local song = nil
  local pipe = assert(io.open( FB2KPIPE, "r" ))
  for line in pipe:lines() do
    local content=QString.new(line)
    if line == QString.new("stopped") then
      song=nil
    elseif content:contains(QString.new("playing")) then
      song=content:replace(QString.new("playing: "), QString.new(""))
    elseif content:contains(QString.new("paused")) then
      song=QString.new("paused")
    else
      song=nil
    end
    content=nil
  end
  pipe:close()
  pipe=nil
  return song
end
this increases the footprint by about 1KByte per call:
Code: [Select]
15.01.2011 03:35:36 DBG LH_Lua: "1222.1962890625"
15.01.2011 03:35:36 DBG LH_Lua: "1223.1416015625"
15.01.2011 03:35:36 DBG LH_Lua: "1224.0869140625"

the content=nil and pipe=nil is supposed to remove any references that might hinder the garbage collector, my idea is that the QString.new("something") are left in the ram for some reason. any ideas on what might be the problem or what to do about it+

lethys

  • Moderator
  • Jr. Member
  • *****
  • Posts: 78
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #33 on: 2011-01-15 02:47:55 »
calling the garbagecollector to collect gargabe every rendering frame has the bizarre effect that ram usage seems to be dropping at a constant rate. I guess there is no memleak after all, just the rules of the garbage collector don't kick in until the situation is critical enough (something like twice the original ram usage afaik)

EDIT: eventually the number the garbage collector returns goes under 0 and it reports something like this:
Code: [Select]
15.01.2011 04:11:09 DBG LH_Lua: "4193159.7236328"
15.01.2011 04:11:09 DBG LH_Lua: "4193159.5361328"

but I suppose this is a problem in lua. ram usage seems to be constant from what i can see in the task manager
« Last Edit: 2011-01-15 03:13:02 by lethys »

lethys

  • Moderator
  • Jr. Member
  • *****
  • Posts: 78
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #34 on: 2011-01-15 04:36:51 »
another quick question:
I seem to be unable to find a function of QString that is similar to lua's sub function:
Code: [Select]
sub(string, 1, 20)will return char 1-20 as a string without changing the original string

SirReal

  • Administrator
  • Hero Member
  • *****
  • Posts: 735
    • linkdata.se
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #35 on: 2011-01-15 10:32:54 »
another quick question:
I seem to be unable to find a function of QString that is similar to lua's sub function:
Code: [Select]
sub(string, 1, 20)will return char 1-20 as a string without changing the original string

QString QString::mid ( int position, int n = -1 ) const


Probus

  • Newbie
  • *
  • Posts: 1
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #36 on: 2011-02-22 12:31:20 »
Hi,
First : thank you for the good job !!  ;)

Second, I cannot make the TS3 plugin/LUA display anything in LCDHost.
I have copied all files (including the TS3init.lua overwriting).
I have added the drag&drop TS3 in the layout but nothing happens ...  :-[

Is there anything to configure/install in the TS3 plugins to make it work ?

I just got my G19, replacing my G15 today. With the G15 and SirReal registered panel, all is working fine, but that's using a plugin DLL if I have correctly understood the big difference between TS3 in LH compared to the "old" G15 version.

Thanks a lot in advance for any assistance

lethys

  • Moderator
  • Jr. Member
  • *****
  • Posts: 78
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #37 on: 2011-02-23 01:05:24 »
Ok first of all, if there is any confusion, this is the latest version:
http://www.fileden.com/files/2010/3/8/2787526/0.21beta6-1.zip

The TS3 Plugin files go into TS3/plugins/lua_plugin, e.g.: D:\apps\TeamSpeak 3 Client\plugins\lua_plugin
You then have to restart TS3 and restart LCDHost (or unload/load the Lua plugin)

I can not say how this version works with LCDHost Alpha 14, I am currently looking into rewriting the whole thing more or less for Alpha 14. But since it's been almost 2 months since I coded on it and I don't feel very motivated don't expect anything too soon :P

Birks

  • Newbie
  • *
  • Posts: 1
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #38 on: 2011-02-24 21:18:11 »
Does not seem to work at all with Alpha 14, LCDhost lua pluin crashes for me with TS3 lua plugin.

SirReal

  • Administrator
  • Hero Member
  • *****
  • Posts: 735
    • linkdata.se
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #39 on: 2011-02-24 21:50:47 »
Lethys, hold off rewriting anything until A15 at least. There's more Lua changes coming.

Ender91

  • Sr. Member
  • ****
  • Posts: 336
  • Alpha & Omega
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #40 on: 2011-03-20 14:17:15 »
Hmmm I was wondering, can your plugin have a plain text output to be used with the G19 (TS3 part)? (like the others plugin, RSS etc....)
Or maybe I haven't found it.....

Talos

  • Newbie
  • *
  • Posts: 2
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #41 on: 2011-04-06 17:03:36 »
just wondering i can do to get my TS3 working with A15 build.
installed the latest hktools 0.21beta6-1
double checked and copied any dependant files to their correct folders

still getting the following error in LCDHost and no effect on my TS3 Lua frame

6-4-2011 19:00:33  WRN  LH_Lua: "[string "honkiformer.lua"]:4: attempt to call global 'modules' (a nil value)"
6-4-2011 19:00:33  WRN  LH_Lua: "[string "init.lua"]:1: module 'ts3init' not found: no field package.preload['ts3init'] no file 'C:\Users\Administrator\Documents\LCDHost\lua\ts3init.lua' no file 'C:\Users\Administrator\Documents\LCDHost\lua\ts3init.luac' no file 'C:\Users\Administrator\Documents\LCDHost\lua\ts3init\init.lua' no file 'C:\Users\Administrator\Documents\LCDHost\lua\clibs\ts3init.dll' no file 'C:\Users\Administrator\Documents\LCDHost\plugins\ts3init.dll'"
6-4-2011 19:00:33  DBG  LH_Lua: [string "HK TS3.lua"]:49: attempt to call field 'callback' (a nil value)

SirReal

  • Administrator
  • Hero Member
  • *****
  • Posts: 735
    • linkdata.se
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #42 on: 2011-04-06 22:51:08 »
The Lua interfaces were improved quite a lot between A14 and A15. Unfortunately, I had to break old Lua code to do this.
I don't think the Lua classes lethys wrote have been updated for A15 yet.

Talos

  • Newbie
  • *
  • Posts: 2
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #43 on: 2011-04-07 07:05:14 »
aww too bad :( any papyal beerbuying button for lethys to put him back to work ? :D

been a fan of your programs since i got my first g15 4years back.
LCDHost is just too imba ;)

small request i already starred in the report section... add a %volume bar applet pwetty pweaze ? :D

Insane

  • Jr. Member
  • **
  • Posts: 87
  • TRI SLI GTX480's
Re: HKTools 0.20 (IP, TS3, MIRANDA, foobar2000)
« Reply #44 on: 2011-07-20 12:17:15 »
ahhh so ts3 not currently working on a18 im guessing?

was wondering why i dont have ts3 on my layout....after i had it working in the past