Remaining RAW+JPG shots + filespace icon/text- done :D - page 13 - General Discussion and Assistance - CHDK Forum

Remaining RAW+JPG shots + filespace icon/text- done :D

  • 175 Replies
  • 69378 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Calculation of remaining shots with RAW - done :D
« Reply #120 on: 15 / February / 2008, 20:41:26 »
Advertisements
Code: (c) [Select]
static void gui_space_draw_icon () {
    coord x;
    int perc = get_space_perc();
    color cl = (GetFreeCardSpaceKb()/1024<=15)?conf.osd_color_warn:(conf.space_color&0xFF);
       // space icon / bar
    draw_rect(conf.space_icon_pos.x,    conf.space_icon_pos.y,     conf.space_icon_pos.x+102, conf.space_icon_pos.y+6,  COLOR_BLACK);
    //draw_rect(conf.space_icon_pos.x+3-3,    conf.space_icon_pos.y+1+2,   conf.space_icon_pos.x+3-2,    conf.space_icon_pos.y+1+8,   cl);
    //draw_line(conf.space_icon_pos.x+3-4,    conf.space_icon_pos.y+1+2-1, conf.space_icon_pos.x+3-4,    conf.space_icon_pos.y+1+8+1, COLOR_BLACK);  // l
    //draw_line(conf.space_icon_pos.x+3-2,    conf.space_icon_pos.y+1-1,   conf.space_icon_pos.x+3+25+2, conf.space_icon_pos.y+1-1,   COLOR_BLACK);  // t
    //draw_line(conf.space_icon_pos.x+3-2,    conf.space_icon_pos.y+1+11,  conf.space_icon_pos.x+3+25+2, conf.space_icon_pos.y+1+11,  COLOR_BLACK);  // b
    //draw_line(conf.space_icon_pos.x+3+25+2, conf.space_icon_pos.y+1-1,   conf.space_icon_pos.x+3+25+2, conf.space_icon_pos.y+1+10,  COLOR_BLACK);  // r
   
    // space bar fill
    x=conf.space_icon_pos.x+100-perc;
    if (x<=conf.space_icon_pos.x+3) x=conf.space_icon_pos.x+3+1;
    if (x>conf.space_icon_pos.x+100) x=conf.space_icon_pos.x+100;
    draw_filled_rect(conf.space_icon_pos.x+1, conf.space_icon_pos.y+1, x-1, conf.space_icon_pos.y+5, MAKE_COLOR(COLOR_RED,COLOR_RED));
    draw_filled_rect(x, conf.space_icon_pos.y+1, conf.space_icon_pos.x+100, conf.space_icon_pos.y+5, MAKE_COLOR(COLOR_GREEN,COLOR_GREEN));
}
what do you think? of course this only makes sense when compiled ;)
it's not done yet, but the basic layout should be visible.
one could also make a battery icon like that, so then you have a battery on the top, and the filespace on the bottom of the screen. or paired together.
gonna go to bed now, i'm already seeing squares in my eyes :D too damn i cant take screenshots of the cams screen to show you the icon.
« Last Edit: 15 / February / 2008, 21:13:25 by PhyrePhoX »

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Calculation of remaining shots with RAW - done :D
« Reply #121 on: 15 / February / 2008, 22:47:31 »
@PhyrePhox

Couldn't sleep (yet)  :haha

Reapplied last diffs-sources from post #119 to fresh 300 trunk + implemented your new

gui_space_draw_icon (), just 1:1 replacement in gui_batt.c.  Thought you might wanna check  :lol ...

I already did (at least the icon) & it looks nice !

Now sleep ...

wim
« Last Edit: 15 / February / 2008, 22:53:36 by whim »

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Calculation of remaining shots with RAW - done :D
« Reply #122 on: 16 / February / 2008, 06:27:57 »
i'll check it out, space icon is almost done.
by the way, checking for key_halfpressed is easy enough, i added that check to the battery icons/text, the filespace icon/text and my raw icon.
example:
Code: (c) [Select]
if (conf.save_raw & conf.show_remaining_raw &  (kbd_is_key_pressed(KEY_SHOOT_HALF)!=1))

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Calculation of remaining shots with RAW - done :D
« Reply #123 on: 16 / February / 2008, 07:11:48 »
Now digging into moving space funcs -> gui_space.c / .h

BTW, Phox, updated XREF archives

wim

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Calculation of remaining shots with RAW - done :D
« Reply #124 on: 16 / February / 2008, 07:33:44 »
wouldnt it be better to have a gui_misc or something, where we put all our stuff, for other people too?=
edit: no, forget what i said. actually its better the way you proposed. we can add a gui_misc for really small things, but not now.
« Last Edit: 16 / February / 2008, 07:45:25 by PhyrePhoX »

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: Calculation of remaining shots with RAW - done :D
« Reply #125 on: 16 / February / 2008, 08:22:27 »
Code: (c) [Select]
static void gui_space_draw_icon () {
    coord x;
    int perc = get_space_perc();
    color cl = (GetFreeCardSpaceKb()/1024<=15)?conf.osd_color_warn:(conf.space_color&0xFF);
       // space icon / bar
    draw_rect(conf.space_icon_pos.x,    conf.space_icon_pos.y,     conf.space_icon_pos.x+102, conf.space_icon_pos.y+5,  cl);
    draw_line(conf.space_icon_pos.x-1,    conf.space_icon_pos.y-1, conf.space_icon_pos.x-1,    conf.space_icon_pos.y+6, COLOR_BLACK);  // l
    draw_line(conf.space_icon_pos.x-1,    conf.space_icon_pos.y-1,   conf.space_icon_pos.x+103, conf.space_icon_pos.y-1,   COLOR_BLACK);  // t
    draw_line(conf.space_icon_pos.x-1,    conf.space_icon_pos.y+6,  conf.space_icon_pos.x+103, conf.space_icon_pos.y+6,  COLOR_BLACK);  // b
    draw_line(conf.space_icon_pos.x+103, conf.space_icon_pos.y-1,   conf.space_icon_pos.x+103, conf.space_icon_pos.y+6,  COLOR_BLACK);  // r
   
    // space bar fill
    x=conf.space_icon_pos.x+100-perc;
    if (x<=conf.space_icon_pos.x+1) x=conf.space_icon_pos.x+1;
    if (x>conf.space_icon_pos.x+100) x=conf.space_icon_pos.x+100;
    draw_filled_rect(conf.space_icon_pos.x+1, conf.space_icon_pos.y+1, x-1, conf.space_icon_pos.y+4, MAKE_COLOR(COLOR_TRANSPARENT, COLOR_BLACK));
    draw_filled_rect(x, conf.space_icon_pos.y+1, conf.space_icon_pos.x+102, conf.space_icon_pos.y+4, MAKE_COLOR(cl, cl));
}
okay this is my final attempt in creating the space icon. it is roughly 100 pixels wide, 7 pixels thin and in the default position it pans directly on the bottom of the screen, under all other icons (even the canon ones). its color is OSD color, when below 15 Megabyte (should i make that 15 %? but then again on a 2GB card 15% is a whopping 300 MB) it switches to warning color. suggestions welcome.
in osd layout editor you can move it to anywhere you want (if you tested one of my recent builds you even HAVE to move it, because then its position is already stored in chdk config file, and this position was on top of screen at the wrong side).
if you like that icon, i can do a vertical version too (so that you can toggle between them) that fits on the right or left margin of the screen. too bad i cant make screenshots of my cam's screen!

will upload compiled build to zshare. also my current workingdir - sorry i didnt diff it yet (no diff since my own first diff with jucifers 296 diff!) so alots been changed i guessed.

if you half-press the shutter, now the battery (+ battery text), space (+ space text) and my remaining raw icon will disappear, like vit40 wished. really makes sense. when you take a picture you dont wanna be hassled by all these icons. should i make more of these icons disappear? i guess the mentioned ones are enough, because the rest of the OSD is needed when half-press (histogramm etc).

dl deleted
zSHARE - latest_changes.zip <- my latest workingdir. sorry not only changed files, as i have no more time today. the canon lenses just came in, weather is fine and i want to test them :)

edit: now i'm thinking about writing that function that calculates the remaining time in video recording mode. i got the concept in my head, but i dont know how to write the code yet. it should work as this: when in video mode & recording, check filespace (poll as often as possible) and average the values until you have a rough estimate of megabyte per second (these megabytes are drawn from diskfreespace). having that value, you can easily calculate how much time is left for shooting. this should be especially useful for the situation you use another video quality in. but also when you use original quality, because during shooting there is no counter. i hope i got the message across what i'm trying to do here.
« Last Edit: 19 / February / 2008, 17:47:33 by PhyrePhoX »

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Calculation of remaining shots with RAW - done :D
« Reply #126 on: 16 / February / 2008, 09:00:34 »
Great ! Progress report here: almost done with the split project
so will include your code straight into the new gui_space.c


(note to self: almost done ? how'bout compiling it first, do NOT forget to update the makefile in core/  first !!!)

note2: to avoid interaction problems I'm forced to wait until your/Jucifer's mods are committed.

wim

PS: idea for video time left:
Code: [Select]
// pseudo-code snippet for calc time left

if (video_recording_started) {
    original_space = GetFreeCardSpaceKb();
    original_time = get_current_time();

    while(video_recording) {
        space_eaten = original_space - GetFreeCardSpaceKb();
        time_elapsed = get_current_time() - original_time;

        avg_use = space_eaten / time_elapsed; // Kb/sec

        time_left = GetFreeCardSpaceKb() / avg_use
    }
}
:)

         
« Last Edit: 16 / February / 2008, 09:24:42 by whim »

Re: Calculation of remaining shots with RAW - done :D
« Reply #127 on: 16 / February / 2008, 11:16:09 »
Nice! I like the 'spacebar' at the bottom. :P Very useful when recording video. Tested on s3.
« Last Edit: 16 / February / 2008, 11:18:13 by fingalo »

*

Offline vit40

  • ****
  • 276
Re: Calculation of remaining shots with RAW - done :D
« Reply #128 on: 16 / February / 2008, 11:34:24 »
Great job guys

All icons behave as I wanted - half press hides them in photo mode (including voltage - we don't need it at half press either). On the other side, voltage and filespace is present during video mode, so I can monitor remaining space on the card and condiotion of the battery during longer clip recording

Strange thing, when I use video mode from script (that enables zoom and MF on my A620), part of OSD info dissapear (focal distance, aperture, ISO). But, focal distance is wrong in video mode (reported this to Allbest in build #31 thread, hope he'll trace the bug, because this worked in Ewavr's build), ISO also (we can't control it anyway), so it doesn't matter (it's even better this way, unless Allbest correct SD indicator)

About filespace icon, I think this shape makes sense (smaller one woudn't be of any use) and I had in mind something similar. Although I don't need it, tried switching it on .... but camera started behaving strangely when I tried to record a movie clip, counter didn't move from 0 sec, I couldn't switch it off etc ... maybe a bug, maybe cfg file got trashed somehow, I don't know ... tryed opening battery tray several times, switching on / off, but camera remained in this condition, so I had to copy old cfg file from PC. Strange. But doesn't matter to me, I don't need a filespace icon anyway, so this build is ok for me

« Last Edit: 16 / February / 2008, 11:40:00 by vit40 »

*

Offline Jucifer

  • *****
  • 251
  • [A710IS]
Re: Calculation of remaining shots with RAW - done :D
« Reply #129 on: 16 / February / 2008, 15:27:41 »
Don't know if this is of any use for anyone, but anyway: added gui_space.c + gui_space.h. Compiles and works. I guess. :] Changed some minor things, see patch. space_txt might need a better default pos.

'nuff said.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal