Support and General Use > Recording
Recording Enhancements Pack
whatboutbob:
Last time i checked on my h120 (admittedly a while ago), pressing play while recording pauses the recording. Not sure about the file split...i guess i never saw the point to it.
By-the-by, last night i re-tested the 2 gig auto-split for the first time in months and am pleased to report that it is still seamless.
Mmmm:
--- Quote from: paulheu on March 14, 2006, 06:12:03 PM ---(small) problem..
I found the peakmeter is actually drawn twice, once in peakmeter.c and once again in recording.c.. In peakmeter.c the hight and position for the meter appear to be set in line 1190:
int peak_meter_draw_get_btn(int x, int y, int height)
Now as I see it is not possible to get the different positions/sizes for screens with different fonts using this as there is nothing to identify the screen.
I have been browsing the source, but cannot find anything that would help me here, but I might miss something..
any ideas..?
--- End quote ---
peak_meter_draw_get_btn (which is a function in peakmeter.c) calls peak_meter_screen and specifies there which screen to display. So you will have to have another h_rc and w_rc in this function to pass to peak_meter_screen.....
The peakmeter is actually drawn a lot more than twice...there is one big update (done in recording.c) of the whole recording screen, and lots of little updates (done in peakmeter.c) of just the peakmeter in one cycle.
vinylivo:
--- Quote from: paulheu on March 14, 2006, 06:12:03 PM ---(small) problem..
I found the peakmeter is actually drawn twice, once in peakmeter.c and once again in recording.c.. In peakmeter.c the hight and position for the meter appear to be set in line 1190:
int peak_meter_draw_get_btn(int x, int y, int height)
Now as I see it is not possible to get the different positions/sizes for screens with different fonts using this as there is nothing to identify the screen.
I have been browsing the source, but cannot find anything that would help me here, but I might miss something..
any ideas..?
--- End quote ---
Hi paulheu I have a solution to your prpblem. I already tried it myself and it works. But we need modifying the 'peak_meter_draw_get_btn() function, it's used by recording.c exclusively so this won't be a problem.
Change in 'peakmeter.h':
--- Code: ---extern int peak_meter_draw_get_btn(int x, int y[], int height[]);
--- End code ---
(pass an array with the different sizes to the function, this can also be written like 'int *y' which is the same in C)
changes in 'peakmeter.c':
--- Code: ---int peak_meter_draw_get_btn(int x, int y[], int height[])
{
int button = BUTTON_NONE;
long next_refresh = current_tick;
long next_big_refresh = current_tick + HZ / 10;
int i;
#ifndef SIMULATOR
bool highperf = !ata_disk_is_active();
#else
bool highperf = false;
#endif
bool dopeek = true;
while (TIME_BEFORE(current_tick, next_big_refresh)) {
button = button_get(false);
if (button != BUTTON_NONE) {
break;
}
if (dopeek) { /* Peek only once per refresh when disk is */
peak_meter_peek(); /* spinning, but as often as possible */
dopeek = highperf; /* otherwise. */
yield();
} else {
sleep(0); /* Sleep until end of current tick. */
}
if (TIME_AFTER(current_tick, next_refresh)) {
FOR_NB_SCREENS(i)
{
peak_meter_screen(&screens[i], x, y[i], height[i]);
screens[i].update_rect(x, y[i], screens[i].width, height[i]);
}
next_refresh += HZ / PEAK_METER_FPS;
dopeek = true;
}
}
return button;
}
--- End code ---
As you see we just use the different sizes for calling 'peak_meter_screen'.
The small refresh in 'recording.c' becomes:
--- Code: --- /* Wait for a button a while (HZ/10) drawing the peak meter */
button = peak_meter_draw_get_btn(0, pm_y, pm_h);
--- End code ---
And then in 'recording.c' the big refresh is done around line 2020:
--- Code: --- FOR_NB_SCREENS(i)
{
peak_meter_screen(&screens[i], 0, pm_y[i], pm_h[i]);
screens[i].update();
}
--- End code ---
Of course we need some initialisation for the pm_y and pm_h arrays:
--- Code: --- int font[2];
int w[2], h[2];
int pm_y[2], pm_h[2];
.....
FOR_NB_SCREENS(i)
{
screens[i].setfont(FONT_UI);
screens[i].getstringsize("M", &w[i], &h[i]);
if (i == SCREEN_MAIN) {
if (h[i] < ((LCD_HEIGHT - 40) / 8))
font[i] = FONT_UI;
else
font[i] = FONT_SYSFIXED;
}
else if (h[i] <= ((64 - 8) / 7))
font[i] = FONT_UI;
else
font[i] = FONT_SYSFIXED;
screens[i].setfont(font[i]);
screens[i].getstringsize("M", &w[i], &h[i]);
screens[i].setmargins(global_settings.invert_cursor ? 0 : w[i], 8);
if (h[i] > 8) {
pm_y[i] = 9 + h[i] * 2;
pm_h[i] = (h[i] - 1) * 2;
}
else {
pm_y[i] = 8 + h[i] * 2;
pm_h[i] = h[i] * 2;
}
}
--- End code ---
This includes a check if it fits on the recording screen and selects the user font if it does otherwise it chooses the default. For bigger fonts the peak meter height is made slightly (2 pixels) smaller because it looks better.
Hope this helps!
vinylivo
PS:I'm still working on an updated version of my AGC patch and then you can have the whole. I just need to go on a business trip for the next 2 days...
paulheu:
Cool.. I got your new patch and it works very well.
I have been studying the wps code to see if I can work up some sort of wrs thingie (While Recording Screen).. I do not think it has to be as fancy as WPS, but it would have mutliple fonts (so you can display less important info in a smaller font). Easy peakmeter handling, pm_set[pm_screen].xxx functions like .height, .color_low and .color_high, but that's being _very_ brave for me right now.. ;D
I'm just learning a lot about coding C now that I am getting into this stuff and it's much fun in any case. I guess it's time to get a good book on this.. :)
bennis:
My player freezed dramatically ( reset button needed to be used) on some newly encoded music files, in wma format. Does Rockbox not support wma?? Can't recall having this problem before though...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version