Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Recording
| | |-+  Recording Enhancements Pack
« previous next »
  • Print
Pages: 1 ... 10 11 [12] 13 14 ... 63

Author Topic: Recording Enhancements Pack  (Read 364636 times)

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #165 on: March 12, 2006, 06:45:31 PM »
That was not it actually, as it turns out the 'shortcuts' for the agc modes are in the code (line 180 of recording.c)

I just changed them to the full names and that worked just fine. Although I guess these should be in the/from the language file.. but for now I got it working as I like it.. I include the new patch. Now I only have to figure how to use the system font on the remote while the main lcd still uses the custom font..

But sofar so good.. you learn a bit every day.. ;)

EDIT: removed the patch as it is no longer valid..
« Last Edit: March 13, 2006, 04:00:04 PM by paulheu »
Logged

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #166 on: March 13, 2006, 09:10:39 AM »
About the font 'thing'  ;D

would this work (use set font on player lcd, system font on remote LCD):

Code: [Select]
    FOR_NB_SCREENS(i)
    {
        if (i==0)
            screens[i].setfont(FONT_UI);
        else
            screens[i].setfont(FONT_SYSFIXED);
        screens[i].getstringsize("M", &w, &h);
        screens[i].setmargins(global_settings.invert_cursor ? 0 : w, 8);
    }

or did I misunderstand the FOR_NB_SCREENS part (as a defined for-next loop of sorts..;) )
« Last Edit: March 13, 2006, 09:14:49 AM by paulheu »
Logged

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Recording Enhancements Pack
« Reply #167 on: March 13, 2006, 11:58:16 AM »
This is from screen_access.h so you can see exactly what FOR_NB_SET_SCREENS(i) does
Code: [Select]
#define FOR_NB_SCREENS(i) for(i = 0; i < NB_SCREENS; i++)
So your assumption was correct!  :)

I don't think that your code will work though!

It will store the dimensions for a user font in the variables w and h and then it will store the dimensions for the system font in w & h overwriting the originals. even if this did work you would then have to do a similar thing when calling the peakmeter as it would need the correct h value for the specific screen.

The only way that I can think of to do this using the gui system is to make a new struct for recording.c that contains w and h and possibly also the font settings. That should keep you thinking!  ;)
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #168 on: March 13, 2006, 02:08:19 PM »
Well, it works for the text, but the peakmeter is in the wrong place (as you expected..)

Oh well. It's fun enough to poke around and figure this stuff out anyway.. :^)
Logged

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #169 on: March 13, 2006, 02:28:38 PM »
Fixed it!! ..

Code: [Select]
    FOR_NB_SCREENS(i)
    {
        if (i==0) {
            screens[i].setfont(FONT_UI);
            screens[i].getstringsize("M", &w, &h);
            screens[i].setmargins(global_settings.invert_cursor ? 0 : w, 8);
}
        else {
            screens[i].setfont(FONT_SYSFIXED);
            screens[i].getstringsize("M", &rc_w, &rc_h);
            screens[i].setmargins(global_settings.invert_cursor ? 0 : rc_w, 8);
        }
    }

I'm sure there's a better way to do this.. but it's making me proud..  ;D
Logged

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #170 on: March 13, 2006, 03:59:02 PM »
Here's the patch including the AGC code, custom font and remote/peakmeter..

Works fine for me.. anyone willing to try?! please do!

[attachment deleted by admin, too old]
« Last Edit: March 13, 2006, 04:40:05 PM by paulheu »
Logged

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Recording Enhancements Pack
« Reply #171 on: March 13, 2006, 04:20:49 PM »
AHA! good thinking paulheu...  :)

Good stuff but I'm not happy with this sharing the same font as for everything else, how about a menu in the recording settings screen so that you can choose the font you want just for the recording screen? I think that is the next  big challenge!    :D
I think bk has been working on something similar for the WPS screen... might be a good place to start!  ;)
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #172 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..?
Logged

Offline larry_llama

  • Member
  • *
  • Posts: 83
Re: Recording Enhancements Pack
« Reply #173 on: March 14, 2006, 08:10:09 PM »
Hey.. sorry to interrupt the coding brianstorm (keep it going, I'm enjoying following it). I have a quick side question: Is there a button (or button combo) while you are on the recording screen that sets a file split? I know you can set it to split at a certain interval, but can you force a split (and have two wave files that are contiguous)? If not, it's no biggie but I just want to make sure I'm not missing anything :-)
Logged

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #174 on: March 15, 2006, 06:33:35 AM »
I'm not sure, but try pressing play. I believe that is what does it on the archos..
Logged

Offline whatboutbob

  • Member
  • *
  • Posts: 178
Re: Recording Enhancements Pack
« Reply #175 on: March 15, 2006, 07:20:46 AM »
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.
Logged

Offline Mmmm

  • Developer
  • Member
  • *
  • Posts: 922
Re: Recording Enhancements Pack
« Reply #176 on: March 15, 2006, 10:09:00 AM »
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..?

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.
« Last Edit: March 15, 2006, 10:10:55 AM by Mmmm »
Logged
My H120 build with Recording Enhancements Pack
Some examples of recordings done on H140 with Rockbox

Offline vinylivo

  • Member
  • *
  • Posts: 125
Re: Recording Enhancements Pack
« Reply #177 on: March 15, 2006, 12:48:27 PM »
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..?

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: [Select]
extern int  peak_meter_draw_get_btn(int x, int y[], int height[]);
(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: [Select]
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;
}

As you see we just use the different sizes for calling 'peak_meter_screen'.
The small refresh in 'recording.c' becomes:
Code: [Select]
        /* Wait for a button a while (HZ/10) drawing the peak meter */
        button = peak_meter_draw_get_btn(0, pm_y, pm_h);


And then in 'recording.c' the big refresh is done around line 2020:
Code: [Select]
            FOR_NB_SCREENS(i)
            {
                peak_meter_screen(&screens[i], 0, pm_y[i], pm_h[i]);
                screens[i].update();
            }

Of course we need some initialisation for the pm_y and pm_h arrays:
Code: [Select]
    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;
        }
    }
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...
Logged

Offline paulheu

  • Member
  • *
  • Posts: 213
Re: Recording Enhancements Pack
« Reply #178 on: March 16, 2006, 08:00:45 AM »
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.. :)
Logged

Offline bennis

  • Member
  • *
  • Posts: 5
Heavy Crash at playback with latest Recording Enhancements Pack
« Reply #179 on: March 16, 2006, 03:40:57 PM »
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...
Logged

  • Print
Pages: 1 ... 10 11 [12] 13 14 ... 63
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Recording
| | |-+  Recording Enhancements Pack
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.103 seconds with 14 queries.