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

hide_osd() script function

  • 98 Replies
  • 34526 Views
*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #50 on: 01 / October / 2013, 16:29:31 »
Advertisements
I think the idea is a good one and should be implemented - lets make sure it is as useful as possible to as many people as possible.
I agree. I appreciate you bringing up the possible problems. I think we can work them out and still be able to hide everything all at once. That's really what I want set_chdk_osd() to do.
Quote
Seriously? You want to implement a change that requires people to guess where to touch the screen?
I want the function to hide everything, including the touch screen buttons, so you can see the complete image underneath. But if guessing where hidden buttons are won't work, you can just make the buttons visible when you touch the screen the first time. This is what happens on my smart phone when I'm viewing a picture while the buttons are hidden. It works well. I'm not sure exactly how to implement it, but it would be something like this:

ixus 310, keyboard.c
Code: [Select]
// Called from hooked touch panel task (boot.c)
// Return 0 to allow touch event to pass onto firmware, 1 to block event from firmware.
int chdk_process_touch()
{
    //ts_check_cnt++;

    // If in canon menu, let the firmware have all the touch events.
    if (!show_virtual_buttons()) return 0;
    if(camera_info.state.osd_off)
    {
       camera_info.state.osd_off=0; //turn it back on
       return 1; //ignore this panel touch. (may need to clear current touch too?)
    }

Quote
In my view the file_browser and textbox U/I are not OSD elements and should not be turned off. This would also mean a script writer doesn't have to remember to turn everything back on in order to use these functions.
Just set camera_info.state.osd_off=0 when the file brower or text box starts. That automatically makes it visible.

I'm aware that they pause the script, so you'd have to add code to them to hide and restore the OSD if you want to be able to do that.  How about using "shoot_half"? Pressing "shoot_half" hides everything, and releasing it restores it.
Quote
. . . I can also envisage a script writer wanting to show the console without showing the ALT and script name text. Separating control of these elements makes sense to me.
I'm not sure anyone would use that capability, but a separate "hide_alt_line" function would be a better way to do this. I haven't used MD, but wouldn't it be more useful to be able to hide all overlays so you can see what's happening on the screen, like a video monitor? You could toggle the overlays back on if you want to see the motion detect areas.

I'm doing something similar with my time lapse script. I have 4 metering areas. When the user presses "right", I Lua draw the 4 metering area rectangles. The active area is red or green, and the inactive areas are yellow. But most of the time when I'm doing a time lapse, I hide these areas so I can see how the pictures look without the distraction.

The way the patch is now, I can toggle everything on and off with one call. If you split it into 3 calls, toggling everything becomes more complicated, i.e. 3 function calls, a state variable in the script, and an if then else statement.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #51 on: 01 / October / 2013, 17:10:39 »
Finally, to make this (more) useful in uBASIC, I suppose we should extend the size range allowed for the test console to allow a single line at the bottom of the screen where the <ALT> and script name currently reside?
You'd have to disable drawing the <ALT> line if the console included the bottom line. But the <ALT> line is important to tell you what script is running. I'm still hoping we'll get rid of the "EXIT" key thing and just use <ALT> as the only "ABORT" key. A different EXIT key for each script is confusing.  But it also makes the <ALT> line essential.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: hide_osd() script function
« Reply #52 on: 01 / October / 2013, 17:50:38 »
You'd have to disable drawing the <ALT> line if the console included the bottom line.
That was my point.  If you can turn off the <ALT> and script name in a uBASIC script ( i.e. the subject of this thread) then you can use the bottom line for a status line via the console if we make that change.

And I'm not going to get into the discussion again about the Exit key here!
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #53 on: 01 / October / 2013, 18:49:28 »
If you can turn off the <ALT> and script name in a uBASIC script ( i.e. the subject of this thread) then you can use the bottom line for a status line via the console if we make that change.

And I'm not going to get into the discussion again about the Exit key here!
Except that set_chdk_osd() turns everything off, AND back on. If the console includes the bottom <ALT> line, it will cover, and flicker, the <ALT> line when set_chdk_osd(1) is called. You would need a separate hide_alt_line() function, and invoke it automatically whenever the console expands to cover the bottom line. I think it's all too complicated for too little benefit.

Everyone has apparently decided to include the multiple abort key feature (and misname it the "exit" key). I'm just saying that it's another reason not to hide the <ALT> line with an expanded console. When you choose a complicated solution to a simple problem like the abort key, you end up with complications. This is one of them.

I think we're getting too bogged down with things people MIGHT want to use in hypothetical future scripts. What I need right now, and there have been other requests for, is a function to hide everything.  This is what we have now. Why don't we work on getting this into the trunk, and then see if anyone wants all this other stuff in the future?

I've discovered a one-line fix in luascript.c to the file browser and text box problems. I'll test it and post it if it works.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: hide_osd() script function
« Reply #54 on: 01 / October / 2013, 21:23:55 »
Except that set_chdk_osd() turns everything off, AND back on.
Only your version of set_chdk_osd() turns everything off and back on.  That version is apparently not being accepted and we are back to something that just disables the <ALT> and script title line.  Everything else can  actually  be turned off seperately - even though you have stated several times that you don't like doing that.

Quote
If the console includes the bottom <ALT> line, it will cover, and flicker, the <ALT> line when set_chdk_osd(1) is called.
Only with your version - which would not allow the console to be active while the <ALT> line is hidden.  The tone of this thread is to leave console enable / disable as a seperate script function. That will allow a uBASIC script to turn off everything but the console and use just the bottom line of the display for output.

Quote
You would need a separate hide_alt_line() function, and invoke it automatically whenever the console expands to cover the bottom line..
Yes - that's exactly what you will need to do and its what the set_chdk_osd() function has become.  No big deal.

Quote
Everyone has apparently decided to include the multiple abort key feature (and misname it the "exit" key).
That decision has been made and implemented. Please move on.

Quote
I think we're getting too bogged down with things people MIGHT want to use in hypothetical future scripts. What I need right now, and there have been other requests for, is a function to hide everything.  This is what we have now. Why don't we work on getting this into the trunk, and then see if anyone wants all this other stuff in the future?
Because,  once again,  your final arguement when every other choice has been exhausted and you don't like the outcome is "Let's do it my way".

Quote
I've discovered a one-line fix in luascript.c to the file browser and text box problems. I'll test it and post it if it works.
Good - now we just need to allow the touchscreen code and seperate OSD icons and we will be done.
« Last Edit: 01 / October / 2013, 21:26:09 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #55 on: 01 / October / 2013, 22:36:41 »
Only your version of set_chdk_osd() turns everything off and back on.  That version is apparently not being accepted and we are back to something that just disables the <ALT> and script title line.
I don't think this is true, but if it is, I'm not going to waste any more time working on adding any of my ideas to CHDK.

I started this topic with this:

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

I've had this working in my CHDK build for months, and it's incredibly useful compared to the current CHDK capabilities. I spent an entire day implementing all the cosmetic changes everyone requested, and they work. I added it to uBasic, even though I never use uBasic. I've fixed the issue with file_browser and textbox. I even added a feature to textbox that hides the textbox while you're holding down the video button, and restores it when you let up, so you can see the picture you're writing text about.

I see no reason not to add a function that is this simple, and this useful, to CHDK.  If you want to hide just the alt line, console, or osd, that can be done in other functions. It's not that I think I'm right and you're wrong. There's a need for my function, and it works. If this capability doesn't end up in the trunk, then I have to keep it in my custom build, which doesn't do anyone else any good.
Quote
Because,  once again,  your final arguement when every other choice has been exhausted and you don't like the outcome is "Let's do it my way".
No, that appears to be your final argument. My argument is that I need this capability, others need this capability, I have a function with this capability, and your function doesn't provide this capability.

Sometimes we perceive in others what we deny in ourselves.
http://en.wikipedia.org/wiki/Psychological_projection
« Last Edit: 01 / October / 2013, 22:38:38 by lapser »
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: hide_osd() script function
« Reply #56 on: 01 / October / 2013, 22:49:12 »
If you want to hide just the alt line, console, or osd, that can be done in other functions.
Well,  unless I am very much mistaken,  there is currently no way to hide the <ALT> line.  Which seems to be the root issue here.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: hide_osd() script function
« Reply #57 on: 01 / October / 2013, 23:29:21 »
Well,  unless I am very much mistaken,  there is currently no way to hide the <ALT> line.  Which seems to be the root issue here.
That's correct. What I should have said is:

We can add another function that hides just the <ALT> line.

I'd be happy to do that function too, if you think it's needed. It could be:

set_alt_line( 0 | false | 1 | true )
or
show_alt_line( 0 | false | 1 | true )

It's probably overkill to provide a "get_alt_line" function, so I'd prefer just "show_alt_line"
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 #58 on: 02 / October / 2013, 04:58:35 »
Yet another command for the same thing is in my opinion not the best idea. I think, the 'bit field' solution has potential. Each OSD element could get his own switch. But the implementation is certainly complicated.

msl
CHDK-DE:  CHDK-DE links

Re: hide_osd() script function
« Reply #59 on: 02 / October / 2013, 06:53:50 »
It's probably overkill to provide a "get_alt_line" function, so I'd prefer just "show_alt_line"
I believe that the argument in favor of having a get_alt_line() is the same as the one for get_chdk_osd() and thus it should be included.

Yet another command for the same thing is in my opinion not the best idea. I think, the 'bit field' solution has potential. Each OSD element could get his own switch. But the implementation is certainly complicated.
One nice thing about the bit field idea is that it would give lapser his "everything disabled" command in one line ( set_chdk_osd(0x0F) ) - a function that I find desirable as well.   

Implementation would take a little work,  but using it is simple if you just want to toggle the <ALT> line.   Not quite sure how the "get" function works in this case?  Return the "OR'd" status of any selected bit ?
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal © 2008-2014, SimplePortal