hide_osd() script function - page 9 - General Discussion and Assistance - CHDK Forum

hide_osd() script function

  • 98 Replies
  • 34209 Views
*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: hide_osd() script function
« Reply #80 on: 14 / October / 2013, 17:40:53 »
Advertisements
I push the topic a little bit. ;)

Is there a chance for a minimal variant - hide the ALT text & script name. This could be a first step.

msl
CHDK-DE:  CHDK-DE links

Re: hide_osd() script function
« Reply #81 on: 14 / October / 2013, 17:49:13 »
Is there a chance for a minimal variant - hide the ALT text & script name. This could be a first step.
As a matter of fact, the attached covers what I think was agreed to some time ago.  Patch file and sample Lua and uBASIC scripts included in the zip.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #82 on: 14 / October / 2013, 19:50:38 »
Is there a chance for a minimal variant - hide the ALT text & script name. This could be a first step.
As a matter of fact, the attached covers what I think was agreed to some time ago.  Patch file and sample Lua and uBASIC scripts included in the zip.
If you can hold off a little, I've got another idea for a better interface that I'd like everyone to consider. I'm doing income taxes at the moment, since they're due tomorrow. I should have something ready to show by Thursday at the latest.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: hide_osd() script function
« Reply #83 on: 15 / October / 2013, 07:15:36 »
hmmm... yet another solution. This is a little bit like the quadrature of the circle.

We need a simple solution. And waterwingz's patch is simple and good. Everything else would be more cosmetic improvements.

msl
CHDK-DE:  CHDK-DE links


Re: hide_osd() script function
« Reply #84 on: 15 / October / 2013, 09:15:30 »
One further digression.  I was chatting with reyalp on IRC last night and he suggested using something like

Code: [Select]
set_title_line() 
get_title_line()

rather than

Code: [Select]
set_chdk_osd()
get_chdk_osd()
« Last Edit: 15 / October / 2013, 09:29:46 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #85 on: 15 / October / 2013, 10:01:57 »
We need a simple solution. And waterwingz's patch is simple and good. Everything else would be more cosmetic improvements.

The patch isn't a solution. The simple solution was the "purpose" in the original post, to hide everything (not just the <alt> line). Why do you want to hide just the <alt> line, anyway?

I fixed the concerns with touchscreens, textbox, and file browser. And MD scripts might want to turn off the chdk overlays.

Purpose: Hide all CHDK overlays, including OSD, Console, and bottom "<ALT>" line. This gives scripts a "clean slate" to draw on.

I'm writing a more generalized solution to the "on/off" problem. It's based on the press/release/click function idea.

on("switch")
off("switch")
toggle("switch")
boolean_variable=status("switch")   -- this function isn't really necessary. toggle() could also return the status, if needed

"switch" can be anything you want to turn off or on, including:

"alt", "osd", "console", "overlays"
"backlight", "display"   (display on/off capability to be added)
"led1","led2"  (turn led on/off camera independently - future possibility)
====
I'm also considering the single function:

boolean_variable=status("[+ | - | ~]switch")

for example:

status("+alt") -- means turn on "alt" line display
status("-alt") -- turn off "alt"
status("~alt")  -- toggle "alt"
boolean_variable=status("alt") -- no change in "alt" state

Just saw this:
One further digression.  I was chatting with reyalp on IRC last night and he suggested using something like
It sounds like you're going to do what you're going to do, but it's not a solution to the original "purpose" of this topic. I'll write up my solution and add it to my custom build, and others can use it if they want.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: hide_osd() script function
« Reply #86 on: 15 / October / 2013, 11:35:03 »
The patch isn't a solution. The simple solution was the "purpose" in the original post, to hide everything (not just the <alt> line). Why do you want to hide just the <alt> line, anyway?
With Phil's cleanup in changeset 3144 works get/set_config_value(1,[1|0]) pretty well. So I need only for the ALT line a new function.

Your suggestion sounds good, but also complicated. Maybe your custom build is a good test platform for this.

At the moment I prefer the 'simple solution'.

@waterwingz
get/set_title_line() is better.

msl
CHDK-DE:  CHDK-DE links

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #87 on: 15 / October / 2013, 12:10:37 »
At the moment I prefer the 'simple solution'.
I don't think that will interfere with what I want to do, but it sets a precedent for needing 2 new functions for everything you want to hide.

I did think of a simpler way to hide "all" that won't interfere with touchscreens or textbox, etc. There are 3 different things to hide, that I've already implemented:

title_line  (alt)
console
osd

If  you hide all 3, you've hidden all. But I want to hide all, and then restore the previous state of the 3 components. The way to do that is to "and" with the show_all variable when checking the other 3 components. My patch hid everything by skipping the entire gui refresh, which Phil pointed out causes problems.

So instead of testing just (show_console), I'll test (show_console&&show_all).

I'll code the single "status" function idea and post a patch soon.  i.e.

alt=status("~alt") -- toggles alt line (title line?) and returns true if on, false if off
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


Re: hide_osd() script function
« Reply #88 on: 15 / October / 2013, 19:23:52 »
Update patch file - script functions are now  set_title_line() & get_title_line().
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14121
Re: hide_osd() script function
« Reply #89 on: 16 / October / 2013, 01:09:49 »
Update patch file - script functions are now  set_title_line() & get_title_line().
OK, I've checked this in with some modifications, changeset 3160. I decided set_title_line sounded too much like setting the actual text, so I changed it to set_draw_title_line

I also made the lua version of set_ accept a boolean or number, and the get_ version return a boolean.

I also changed the code in gui.c a bit, the static should be function local, and I really hate ifdefs intermingled with runtime if statements. Hopefully I didn't break the non CAM_DISP_ALT_TEXT case.

Updated test scripts are attached.

This is the trunk so nothing is set in stone, we can change it if someone has a convincing argument or better code, but after 9 pages of discussion we might as well have something people can actually use...
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal