in reply to Net::DBus/Logitech G19 Meditator

I'm the author of Gnome15, and was just doing some vanity searching and came across this post.

Love the hypno-effect, I think I have a headache now though. And the text problem probably isn't PEBCAC ;) There is a bug with that call, mainly when you supply a width/height. This is fixed in 0.8.2 which is building now. To draw some text, you would do something like :-

$page->Text("Hypnotoad - Our Lord And Master", 50, 0, 220, 240, "center,center,wrapword");

That would draw text in a 220x240 box located at x=50,y=0, with the text wrapped at word boundaries, vertically and horizontally centered.

You can also change the font :-

$page->SetFont("24", "Sans", "normal", "normal");

It's great to see someone else using the API and if you've got any other suggestions to improve it, please feel free :)

Brett

Replies are listed 'Best First'.
Re^2: Net::DBus/Logitech G19 Meditator
by cavac (Prior) on Jan 12, 2012 at 12:48 UTC

    Thanks for your reply.

    After thinking long and hard about it, the API itself isn't that bad (it works and when understood is quite locigal). But the documentation of it could use some updates.

    Here are some recommendations and questions:

    • How is the relationship between the different interfaces? A simple tree graph or similar could really clear that up.
    • Show some (pseudo-code?) examples on how to actually use it.
    • What happens if the client crashes? Thus Gnome15 clean everything up? What do i have to do for a clean shutdown?
    • The drawing commands feel quite slow. Any way to batch process them?
    • The Image() page function rocks. I was able to play high FPS movies. But what formats are supported?
    • Gnome15 also controls the keyboard backlight and the G-Key mapping, right? Could i use the API to control that?

    After writing my "list of demands", i like to really thank you for a very nice software. It actually is more fun to use the G19 on Linux than on Windows (with the possible exception of playing DNF)!

    "Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid… and I went ahead anyway." (Crow in "MST3K The Movie")

      And thank you :)

      I'll certainly look into implementing your suggestions regarding the documentation. To answer your other questions :-

      "Client Crashes" - Currently Gnome15 will clean up any resources opened by the DBUS client when it closes. It didn't used to do this, allowing bash scripts and the command line DBUS tools to be used to create pages. But this was slow, and there was no way of knowing when to clean up if it went wrong.

      "The drawing commands feel quite slow" - This may be just DBUS, the drawing itself should be pretty quick. I think it's possible to make DBUS calls without waiting for a reply, which might speed things up a bit - no idea how though or what any side effects might be. Another alternative is to design the screen in SVG and use the SetThemeSVG() or LoadTheme() calls which will mean only 1 call. You can then draw other shapes or text over the top of that.

      "The Image() page function rocks" - Interesting use of that function! It should support anything that GTK does. Can you find out by runnng :-

      $ python import gtk gtk.gdk.pixbuf_get_formats()

      Brett