tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit 28324374d282ffcfe02a1c4f6dc6258245784b36
parent 61c9b27091a4362fc02e491b743571c8efdee7e4
Author: rbckman <robinbackman@gmail.com>
Date:   Sun, 19 Feb 2017 11:28:38 +0000

fixed mic volume and vu meter

Diffstat:
Mtarina.py | 8++++----
Mvc/src/hello_pi/hello_interface/camerainterface.bin | 0
Mvc/src/hello_pi/hello_interface/main.c | 594++++++++++++++++++++++++++++++++++++++-----------------------------------------
3 files changed, 293 insertions(+), 309 deletions(-)

diff --git a/tarina.py b/tarina.py @@ -1358,7 +1358,7 @@ def main(): os.system('amixer -c 0 set Mic Capture ' + str(miclevel) + '%') #Jessie if debianversion == '8': - os.system('amixer sset Mic ' + str(miclevel) + '%') + os.system('amixer -c 0 sset Mic ' + str(miclevel) + '%') elif menu[selected] == 'PHONES:': if headphoneslevel < 100: headphoneslevel = headphoneslevel + 2 @@ -1367,7 +1367,7 @@ def main(): os.system('amixer -c 0 set Mic Playback ' + str(headphoneslevel) + '%') #Jessie if debianversion == '8': - os.system('amixer sset Playback ' + str(headphoneslevel) + '%') + os.system('amixer -c 0 sset Mic Playback ' + str(headphoneslevel) + '%') elif menu[selected] == 'SCENE:': scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 0, 1) removeimage(camera, overlay) @@ -1442,7 +1442,7 @@ def main(): os.system('amixer -c 0 set Mic Capture ' + str(miclevel) + '%') #Jessie if debianversion == '8': - os.system('amixer sset Mic ' + str(miclevel) + '%') + os.system('amixer -c 0 sset Mic ' + str(miclevel) + '%') elif menu[selected] == 'PHONES:': if headphoneslevel > 0: headphoneslevel = headphoneslevel - 2 @@ -1451,7 +1451,7 @@ def main(): os.system('amixer -c 0 set Mic Playback ' + str(headphoneslevel) + '%') #Jessie if debianversion == '8': - os.system('amixer sset Playback ' + str(headphoneslevel) + '%') + os.system('amixer -c 0 sset Mic Playback ' + str(headphoneslevel) + '%') elif menu[selected] == 'SCENE:': scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 0, -1) removeimage(camera, overlay) diff --git a/vc/src/hello_pi/hello_interface/camerainterface.bin b/vc/src/hello_pi/hello_interface/camerainterface.bin Binary files differ. diff --git a/vc/src/hello_pi/hello_interface/main.c b/vc/src/hello_pi/hello_interface/main.c @@ -48,7 +48,7 @@ int32_t render_subtitle(GRAPHICS_RESOURCE_HANDLE img, const char *text, const ui graphics_resource_render_text_ext(img, x_offset, y_offset-height, GRAPHICS_RESOURCE_WIDTH, GRAPHICS_RESOURCE_HEIGHT, - GRAPHICS_RGBA32(100,100,100,0xff), /* fg */ + GRAPHICS_RGBA32(80,80,80,0xff), /* fg */ GRAPHICS_RGBA32(0,0,0,0xff), /* bg */ text, 74, text_size); } @@ -136,13 +136,10 @@ int main(void) int len_string_more4; int len_string_more5; int len_string_more6; - int count = 120; - int sleeptime = 100000; char check[500]; char oldcheck[500]; - char seleold; - char text[80]; - char text2[4]; + char vumeter[80]; + char menu[4]; char header[100]; char film[30]; char scene[20]; @@ -168,318 +165,305 @@ int main(void) char more4[20]; char more5[20]; char more6[20]; - graphics_resource_fill(img, 0, 0, width, height, GRAPHICS_RGBA32(0,0,0,0xff)); + //graphics_resource_fill(img, 0, 0, width, height, GRAPHICS_RGBA32(0,0,0,0xff)); while (1) { // char ch; FILE *fp; fp = fopen("/dev/shm/vumeter","r"); - while(fgets(text, 74, fp) != NULL); + while(fgets(vumeter, 74, fp) != NULL); fclose(fp); FILE *fp2; fp2 = fopen("/dev/shm/interface","r"); fgets(check, 500, fp2); fclose(fp2); - if (strcmp(check, oldcheck) != 0){ - strcpy(oldcheck, check); - fp2 = fopen("/dev/shm/interface","r"); - fgets(text2, 4, fp2); - selected = atoi(text2); - fgets(text2, 4, fp2); - len_string_header = atoi(text2) + 1; - fgets(header, len_string_header, fp2); - fgets(text2, 4, fp2); - len_string_film = atoi(text2) + 1; - fgets(film, len_string_film, fp2); - fgets(text2, 4, fp2); - len_string_scene = atoi(text2) + 1; - fgets(scene, len_string_scene, fp2); - fgets(text2, 4, fp2); - len_string_shot = atoi(text2) + 1; - fgets(shot, len_string_shot, fp2); - fgets(text2, 4, fp2); - len_string_take = atoi(text2) + 1; - fgets(take, len_string_take, fp2); - fgets(text2, 4, fp2); - len_string_rec = atoi(text2) + 1; - fgets(rec, len_string_rec, fp2); - fgets(text2, 4, fp2); - len_string_shutter = atoi(text2) + 1; - fgets(shutter, len_string_shutter, fp2); - fgets(text2, 4, fp2); - len_string_iso = atoi(text2) + 1; - fgets(iso, len_string_iso, fp2); - fgets(text2, 4, fp2); - len_string_red = atoi(text2) + 1; - fgets(red, len_string_red, fp2); - fgets(text2, 4, fp2); - len_string_blue = atoi(text2) + 1; - fgets(blue, len_string_blue, fp2); - fgets(text2, 4, fp2); - len_string_bright = atoi(text2) + 1; - fgets(bright, len_string_bright, fp2); - fgets(text2, 4, fp2); - len_string_cont = atoi(text2) + 1; - fgets(cont, len_string_cont, fp2); - fgets(text2, 4, fp2); - len_string_sat = atoi(text2) + 1; - fgets(sat, len_string_sat, fp2); - fgets(text2, 4, fp2); - len_string_flip = atoi(text2) + 1; - fgets(flip, len_string_flip, fp2); - fgets(text2, 4, fp2); - len_string_beep = atoi(text2) + 1; - fgets(beep, len_string_beep, fp2); - fgets(text2, 4, fp2); - len_string_lenght = atoi(text2) + 1; - fgets(lenght, len_string_lenght, fp2); - fgets(text2, 4, fp2); - len_string_mic = atoi(text2) + 1; - fgets(mic, len_string_mic, fp2); - fgets(text2, 4, fp2); - len_string_phones = atoi(text2) + 1; - fgets(phones, len_string_phones, fp2); - fgets(text2, 4, fp2); - len_string_dsk = atoi(text2) + 1; - fgets(dsk, len_string_dsk, fp2); - fgets(text2, 4, fp2); - len_string_more1 = atoi(text2) + 1; - fgets(more1, len_string_more1, fp2); - fgets(text2, 4, fp2); - len_string_more2 = atoi(text2) + 1; - fgets(more2, len_string_more2, fp2); - fgets(text2, 4, fp2); - len_string_more3 = atoi(text2) + 1; - fgets(more3, len_string_more3, fp2); - fgets(text2, 4, fp2); - len_string_more4 = atoi(text2) + 1; - fgets(more4, len_string_more4, fp2); - fgets(text2, 4, fp2); - len_string_more5 = atoi(text2) + 1; - fgets(more5, len_string_more5, fp2); - fgets(text2, 4, fp2); - len_string_more6 = atoi(text2) + 1; - fgets(more6, len_string_more6, fp2); - fgets(text2, 3, fp2); - fclose(fp2); - if (text2[0] == 'E' && text2[1] == 'O'){ - //FILE *fp3; - //fp3 = fopen("interface.txt","r"); - //while(fgets(text3, 57, fp3) != NULL); - //fclose(fp3); - //const char *text = "Never give up on your dreams"; - uint32_t y_offset = 460; - uint32_t y_offset2 = 0; - uint32_t y_offset3 = 22; - uint32_t y_offset4 = 44; - uint32_t y_offset5 = 418; - uint32_t y_offset6 = 440; - graphics_resource_fill(img, 0, 0, width, height, GRAPHICS_RGBA32(0,0,0,0xff)); - // blue, at the top (y=40) - // selected 0 1 2 3 4 5 6 7 8 - int space = 10; - int morespace = 15; - int color; - if (seleold != selected){ - count = 0; - } - seleold = selected; - if (count < 200){ - count = count + 1; - } - if (count < 100){ - color = 5; - } - else{ - color = 4; - } - // draw the text if updated - render_subtitle(img, text, text_size, 0, y_offset, 4); - if(strlen(header) != 0) { - render_subtitle(img, header, text_size, 0, y_offset2, 5); - if(selected == 0){ - render_subtitle(img, film, text_size, 0, y_offset3, 1); - } - else{ - render_subtitle(img, film, text_size, 0, y_offset3, color); - } - if(selected == 1){ - render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset3, 1); - } - else{ - render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset3, color); - } - if(selected == 2){ - render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset3, 1); - } - else{ - render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset3, color); - } - if(selected == 3){ - render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset3, 1); - } - else{ - render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset3, color); - } - if(selected == 5){ - render_subtitle(img, shutter, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + morespace * 4, y_offset3, 1); - } - else{ - render_subtitle(img, shutter, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + morespace * 4, y_offset3, color); - } - if(selected == 6){ - render_subtitle(img, iso, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + len_string_shutter * space + morespace * 5, y_offset3, 1); - } - else{ - render_subtitle(img, iso, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + len_string_shutter * space + morespace * 5, y_offset3, color); - } - } - if(strlen(header) == 0) { - render_subtitle(img, rec, text_size, 700, y_offset5, 2); - if(selected == 0){ - render_subtitle(img, film, text_size, 0, y_offset2, 1); - } - else{ - render_subtitle(img, film, text_size, 0, y_offset2, color); - } - if(selected == 1){ - render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset2, 1); - } - else{ - render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset2, color); - } - if(selected == 2){ - render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset2, 1); - } - else{ - render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset2, color); - } - if(selected == 3){ - render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset2, 1); - } - else{ - render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset2, color); - } - if(selected == 5){ - render_subtitle(img, shutter, text_size, 0, y_offset3, 1); - } - else{ - render_subtitle(img, shutter, text_size, 0, y_offset3, color); - } - if(selected == 6){ - render_subtitle(img, iso, text_size, (len_string_shutter * space) + morespace, y_offset3, 1); - } - else{ - render_subtitle(img, iso, text_size, (len_string_shutter * space) + morespace, y_offset3, color); - } - if(selected == 7){ - render_subtitle(img, red, text_size, (len_string_shutter * space) + (len_string_iso * space) + morespace * 2, y_offset3, 1); - } - else{ - render_subtitle(img, red, text_size, len_string_shutter * space + len_string_iso * space + morespace * 2, y_offset3, color); - } - if(selected == 8){ - render_subtitle(img, blue, text_size, len_string_shutter * space + len_string_iso * space + len_string_red * space + morespace * 3, y_offset3, 1); - } - else{ - render_subtitle(img, blue, text_size, len_string_shutter * space + len_string_iso * space + len_string_red * space + morespace * 3, y_offset3, color); - } - if(selected == 9){ - render_subtitle(img, bright, text_size, 0, y_offset4, 1); - } - else{ - render_subtitle(img, bright, text_size, 0, y_offset4, color); - } - if(selected == 10){ - render_subtitle(img, cont, text_size, len_string_bright * space + morespace, y_offset4, 1); - } - else{ - render_subtitle(img, cont, text_size, len_string_bright * space + morespace, y_offset4, color); - } - if(selected == 11){ - render_subtitle(img, sat, text_size, len_string_bright * space + len_string_cont * space + morespace * 2, y_offset4, 1); - } - else{ - render_subtitle(img, sat, text_size, len_string_bright * space + len_string_cont * space + morespace * 2, y_offset4, color); - } - if(selected == 12){ - render_subtitle(img, flip, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + morespace * 3, y_offset4, 1); - } - else{ - render_subtitle(img, flip, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + morespace * 3, y_offset4, color); - } - if(selected == 13){ - render_subtitle(img, beep, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + morespace * 4, y_offset4, 1); - } - else{ - render_subtitle(img, beep, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + morespace * 4, y_offset4, color); - } - if(selected == 14){ - render_subtitle(img, lenght, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + len_string_beep * space + morespace * 5, y_offset4, 1); - } - else{ - render_subtitle(img, lenght, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + len_string_beep * space + morespace * 5, y_offset4, color); - } - if(selected == 15){ - render_subtitle(img, mic, text_size, 0, y_offset5, 1); - } - else{ - render_subtitle(img, mic, text_size, 0, y_offset5, color); - } - if(selected == 16){ - render_subtitle(img, phones, text_size, len_string_mic * space + morespace, y_offset5, 1); - } - else{ - render_subtitle(img, phones, text_size, len_string_mic * space + morespace, y_offset5, color); - } - if(selected == 17){ - render_subtitle(img, dsk, text_size, len_string_mic * space + len_string_phones * space + morespace * 2, y_offset5, 1); - } - else{ - render_subtitle(img, dsk, text_size, len_string_mic * space + len_string_phones * space + morespace * 2, y_offset5, color); - } - if(selected == 18){ - render_subtitle(img, more1, text_size, 0, y_offset6, 1); - } - else{ - render_subtitle(img, more1, text_size, 0, y_offset6, color); - } - if(selected == 19){ - render_subtitle(img, more2, text_size, len_string_more1 * space + morespace, y_offset6, 1); - } - else{ - render_subtitle(img, more2, text_size, len_string_more1 * space + morespace, y_offset6, color); - } - if(selected == 20){ - render_subtitle(img, more3, text_size, len_string_more1 * space + len_string_more2 * space + morespace * 2, y_offset6, 1); - } - else{ - render_subtitle(img, more3, text_size, len_string_more1 * space + len_string_more2 * space + morespace * 2, y_offset6, color); - } - if(selected == 21){ - render_subtitle(img, more4, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + morespace * 3, y_offset6, 1); - } - else{ - render_subtitle(img, more4, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + morespace * 3, y_offset6, color); - } - if(selected == 22){ - render_subtitle(img, more5, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + morespace * 4, y_offset6, 1); - } - else{ - render_subtitle(img, more5, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + morespace * 4, y_offset6, color); - } - if(selected == 23){ - render_subtitle(img, more6, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + len_string_more5 * space + morespace * 5, y_offset6, 1); + // check if something has changed + if (strcmp(check, oldcheck) != 0) { + strcpy(oldcheck, check); + fp2 = fopen("/dev/shm/interface","r"); + fgets(menu, 4, fp2); + selected = atoi(menu); + fgets(menu, 4, fp2); + len_string_header = atoi(menu) + 1; + fgets(header, len_string_header, fp2); + fgets(menu, 4, fp2); + len_string_film = atoi(menu) + 1; + fgets(film, len_string_film, fp2); + fgets(menu, 4, fp2); + len_string_scene = atoi(menu) + 1; + fgets(scene, len_string_scene, fp2); + fgets(menu, 4, fp2); + len_string_shot = atoi(menu) + 1; + fgets(shot, len_string_shot, fp2); + fgets(menu, 4, fp2); + len_string_take = atoi(menu) + 1; + fgets(take, len_string_take, fp2); + fgets(menu, 4, fp2); + len_string_rec = atoi(menu) + 1; + fgets(rec, len_string_rec, fp2); + fgets(menu, 4, fp2); + len_string_shutter = atoi(menu) + 1; + fgets(shutter, len_string_shutter, fp2); + fgets(menu, 4, fp2); + len_string_iso = atoi(menu) + 1; + fgets(iso, len_string_iso, fp2); + fgets(menu, 4, fp2); + len_string_red = atoi(menu) + 1; + fgets(red, len_string_red, fp2); + fgets(menu, 4, fp2); + len_string_blue = atoi(menu) + 1; + fgets(blue, len_string_blue, fp2); + fgets(menu, 4, fp2); + len_string_bright = atoi(menu) + 1; + fgets(bright, len_string_bright, fp2); + fgets(menu, 4, fp2); + len_string_cont = atoi(menu) + 1; + fgets(cont, len_string_cont, fp2); + fgets(menu, 4, fp2); + len_string_sat = atoi(menu) + 1; + fgets(sat, len_string_sat, fp2); + fgets(menu, 4, fp2); + len_string_flip = atoi(menu) + 1; + fgets(flip, len_string_flip, fp2); + fgets(menu, 4, fp2); + len_string_beep = atoi(menu) + 1; + fgets(beep, len_string_beep, fp2); + fgets(menu, 4, fp2); + len_string_lenght = atoi(menu) + 1; + fgets(lenght, len_string_lenght, fp2); + fgets(menu, 4, fp2); + len_string_mic = atoi(menu) + 1; + fgets(mic, len_string_mic, fp2); + fgets(menu, 4, fp2); + len_string_phones = atoi(menu) + 1; + fgets(phones, len_string_phones, fp2); + fgets(menu, 4, fp2); + len_string_dsk = atoi(menu) + 1; + fgets(dsk, len_string_dsk, fp2); + fgets(menu, 4, fp2); + len_string_more1 = atoi(menu) + 1; + fgets(more1, len_string_more1, fp2); + fgets(menu, 4, fp2); + len_string_more2 = atoi(menu) + 1; + fgets(more2, len_string_more2, fp2); + fgets(menu, 4, fp2); + len_string_more3 = atoi(menu) + 1; + fgets(more3, len_string_more3, fp2); + fgets(menu, 4, fp2); + len_string_more4 = atoi(menu) + 1; + fgets(more4, len_string_more4, fp2); + fgets(menu, 4, fp2); + len_string_more5 = atoi(menu) + 1; + fgets(more5, len_string_more5, fp2); + fgets(menu, 4, fp2); + len_string_more6 = atoi(menu) + 1; + fgets(more6, len_string_more6, fp2); + fgets(menu, 3, fp2); + fclose(fp2); + if (menu[0] == 'E' && menu[1] == 'O'){ + //FILE *fp3; + //fp3 = fopen("interface.txt","r"); + //while(fgets(text3, 57, fp3) != NULL); + //fclose(fp3); + //const char *text = "Never give up on your dreams"; + uint32_t y_offset2 = 0; + uint32_t y_offset3 = 22; + uint32_t y_offset4 = 44; + uint32_t y_offset5 = 418; + uint32_t y_offset6 = 440; + graphics_resource_fill(img, 0, 0, width, height, GRAPHICS_RGBA32(0,0,0,0xff)); + // blue, at the top (y=40) + // selected 0 1 2 3 4 5 6 7 8 + int space = 10; + int morespace = 15; + int color = 5; + // draw the text if updated + if(strlen(header) != 0) { + render_subtitle(img, header, text_size, 0, y_offset2, 5); + if(selected == 0){ + render_subtitle(img, film, text_size, 0, y_offset3, 1); + } + else{ + render_subtitle(img, film, text_size, 0, y_offset3, color); + } + if(selected == 1){ + render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset3, 1); + } + else{ + render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset3, color); + } + if(selected == 2){ + render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset3, 1); + } + else{ + render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset3, color); + } + if(selected == 3){ + render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset3, 1); + } + else{ + render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset3, color); + } + if(selected == 5){ + render_subtitle(img, shutter, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + morespace * 4, y_offset3, 1); + } + else{ + render_subtitle(img, shutter, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + morespace * 4, y_offset3, color); + } + if(selected == 6){ + render_subtitle(img, iso, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + len_string_shutter * space + morespace * 5, y_offset3, 1); + } + else{ + render_subtitle(img, iso, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + len_string_take * space + len_string_shutter * space + morespace * 5, y_offset3, color); + } + } + if(strlen(header) == 0) { + render_subtitle(img, rec, text_size, 690, y_offset5, 2); + if(selected == 0){ + render_subtitle(img, film, text_size, 0, y_offset2, 1); + } + else{ + render_subtitle(img, film, text_size, 0, y_offset2, color); + } + if(selected == 1){ + render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset2, 1); + } + else{ + render_subtitle(img, scene, text_size, len_string_film * space + morespace, y_offset2, color); + } + if(selected == 2){ + render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset2, 1); + } + else{ + render_subtitle(img, shot, text_size, len_string_film * space + len_string_scene * space + morespace * 2, y_offset2, color); + } + if(selected == 3){ + render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset2, 1); + } + else{ + render_subtitle(img, take, text_size, len_string_film * space + len_string_scene * space + len_string_shot * space + morespace * 3, y_offset2, color); + } + if(selected == 5){ + render_subtitle(img, shutter, text_size, 0, y_offset3, 1); + } + else{ + render_subtitle(img, shutter, text_size, 0, y_offset3, color); + } + if(selected == 6){ + render_subtitle(img, iso, text_size, (len_string_shutter * space) + morespace, y_offset3, 1); + } + else{ + render_subtitle(img, iso, text_size, (len_string_shutter * space) + morespace, y_offset3, color); + } + if(selected == 7){ + render_subtitle(img, red, text_size, (len_string_shutter * space) + (len_string_iso * space) + morespace * 2, y_offset3, 1); + } + else{ + render_subtitle(img, red, text_size, len_string_shutter * space + len_string_iso * space + morespace * 2, y_offset3, color); + } + if(selected == 8){ + render_subtitle(img, blue, text_size, len_string_shutter * space + len_string_iso * space + len_string_red * space + morespace * 3, y_offset3, 1); + } + else{ + render_subtitle(img, blue, text_size, len_string_shutter * space + len_string_iso * space + len_string_red * space + morespace * 3, y_offset3, color); + } + if(selected == 9){ + render_subtitle(img, bright, text_size, 0, y_offset4, 1); + } + else{ + render_subtitle(img, bright, text_size, 0, y_offset4, color); + } + if(selected == 10){ + render_subtitle(img, cont, text_size, len_string_bright * space + morespace, y_offset4, 1); + } + else{ + render_subtitle(img, cont, text_size, len_string_bright * space + morespace, y_offset4, color); + } + if(selected == 11){ + render_subtitle(img, sat, text_size, len_string_bright * space + len_string_cont * space + morespace * 2, y_offset4, 1); + } + else{ + render_subtitle(img, sat, text_size, len_string_bright * space + len_string_cont * space + morespace * 2, y_offset4, color); + } + if(selected == 12){ + render_subtitle(img, flip, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + morespace * 3, y_offset4, 1); + } + else{ + render_subtitle(img, flip, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + morespace * 3, y_offset4, color); + } + if(selected == 13){ + render_subtitle(img, beep, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + morespace * 4, y_offset4, 1); + } + else{ + render_subtitle(img, beep, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + morespace * 4, y_offset4, color); + } + if(selected == 14){ + render_subtitle(img, lenght, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + len_string_beep * space + morespace * 5, y_offset4, 1); + } + else{ + render_subtitle(img, lenght, text_size, len_string_bright * space + len_string_cont * space + len_string_sat * space + len_string_flip * space + len_string_beep * space + morespace * 5, y_offset4, color); + } + if(selected == 15){ + render_subtitle(img, mic, text_size, 0, y_offset5, 1); + } + else{ + render_subtitle(img, mic, text_size, 0, y_offset5, color); + } + if(selected == 16){ + render_subtitle(img, phones, text_size, len_string_mic * space + morespace, y_offset5, 1); + } + else{ + render_subtitle(img, phones, text_size, len_string_mic * space + morespace, y_offset5, color); + } + if(selected == 17){ + render_subtitle(img, dsk, text_size, len_string_mic * space + len_string_phones * space + morespace * 2, y_offset5, 1); + } + else{ + render_subtitle(img, dsk, text_size, len_string_mic * space + len_string_phones * space + morespace * 2, y_offset5, color); + } + if(selected == 18){ + render_subtitle(img, more1, text_size, 0, y_offset6, 1); + } + else{ + render_subtitle(img, more1, text_size, 0, y_offset6, color); + } + if(selected == 19){ + render_subtitle(img, more2, text_size, len_string_more1 * space + morespace, y_offset6, 1); + } + else{ + render_subtitle(img, more2, text_size, len_string_more1 * space + morespace, y_offset6, color); + } + if(selected == 20){ + render_subtitle(img, more3, text_size, len_string_more1 * space + len_string_more2 * space + morespace * 2, y_offset6, 1); + } + else{ + render_subtitle(img, more3, text_size, len_string_more1 * space + len_string_more2 * space + morespace * 2, y_offset6, color); + } + if(selected == 21){ + render_subtitle(img, more4, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + morespace * 3, y_offset6, 1); + } + else{ + render_subtitle(img, more4, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + morespace * 3, y_offset6, color); + } + if(selected == 22){ + render_subtitle(img, more5, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + morespace * 4, y_offset6, 1); + } + else{ + render_subtitle(img, more5, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + morespace * 4, y_offset6, color); + } + if(selected == 23){ + render_subtitle(img, more6, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + len_string_more5 * space + morespace * 5, y_offset6, 1); + } + else{ + render_subtitle(img, more6, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + len_string_more5 * space + morespace * 5, y_offset6, color); + } } - else{ - render_subtitle(img, more6, text_size, len_string_more1 * space + len_string_more2 * space + len_string_more3 * space + len_string_more4 * space + len_string_more5 * space + morespace * 5, y_offset6, color); + //graphics_update_displayed_resource(img, 0, 0, 0, 0); } } + uint32_t y_offset = 460; + render_subtitle(img, vumeter, text_size, 0, y_offset, 5); graphics_update_displayed_resource(img, 0, 0, 0, 0); - } - sleeptime = 10000; - } - usleep(sleeptime); - sleeptime = 100000; + usleep(10000); } graphics_display_resource(img, 0, LAYER, 0, 0, GRAPHICS_RESOURCE_WIDTH, GRAPHICS_RESOURCE_HEIGHT, VC_DISPMAN_ROT0, 0);