summaryrefslogtreecommitdiff
path: root/apps/plugins/splitedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/splitedit.c')
-rw-r--r--apps/plugins/splitedit.c54
1 files changed, 38 insertions, 16 deletions
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index e52ce244f1..20a9922a29 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -210,7 +210,9 @@ static void update_data(void)
210 210
211 rb->lcd_getstringsize(buf, &w, &h); 211 rb->lcd_getstringsize(buf, &w, &h);
212 212
213 rb->lcd_clearrect(0, 0, LCD_WIDTH, h); 213 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
214 rb->lcd_fillrect(0, 0, LCD_WIDTH, h);
215 rb->lcd_set_drawmode(DRMODE_SOLID);
214 rb->lcd_puts(0, 0, buf); 216 rb->lcd_puts(0, 0, buf);
215 rb->lcd_update_rect(0, 0, LCD_WIDTH, h); 217 rb->lcd_update_rect(0, 0, LCD_WIDTH, h);
216} 218}
@@ -253,7 +255,9 @@ int splitedit_get_loop_mode(void)
253 */ 255 */
254static void update_icons(void) 256static void update_icons(void)
255{ 257{
256 rb->lcd_clearrect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT); 258 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
259 rb->lcd_fillrect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT);
260 rb->lcd_set_drawmode(DRMODE_SOLID);
257 261
258 /* The CUT icon */ 262 /* The CUT icon */
259 rb->lcd_bitmap(CUT_BMP, 263 rb->lcd_bitmap(CUT_BMP,
@@ -380,9 +384,11 @@ void splitedit_set_split_x(int newx)
380 /* remove old split point from screen, only if moved */ 384 /* remove old split point from screen, only if moved */
381 if (split_x != newx) 385 if (split_x != newx)
382 { 386 {
383 rb->lcd_invertrect (minx, OSCI_Y, 5, 1); 387 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
384 rb->lcd_invertrect (split_x-1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); 388 rb->lcd_fillrect(minx, OSCI_Y, 5, 1);
385 rb->lcd_invertrect (split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); 389 rb->lcd_fillrect(split_x-1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1);
390 rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2);
391 rb->lcd_set_drawmode(DRMODE_SOLID);
386 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT); 392 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT);
387 } 393 }
388 394
@@ -398,9 +404,11 @@ void splitedit_set_split_x(int newx)
398 404
399 /* display new split point */ 405 /* display new split point */
400 minx = split_x - 2 > 0 ? split_x - 2: 0; 406 minx = split_x - 2 > 0 ? split_x - 2: 0;
401 rb->lcd_invertrect (minx, OSCI_Y, 5, 1); 407 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
402 rb->lcd_invertrect (split_x - 1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1); 408 rb->lcd_fillrect(minx, OSCI_Y, 5, 1);
403 rb->lcd_invertrect (split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2); 409 rb->lcd_fillrect(split_x - 1 > 0 ? split_x - 1: 0, OSCI_Y + 1, 3, 1);
410 rb->lcd_fillrect(split_x, OSCI_Y + 2, 1, OSCI_HEIGHT - 2);
411 rb->lcd_set_drawmode(DRMODE_SOLID);
404 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT); 412 rb->lcd_update_rect(minx, OSCI_Y, 5, OSCI_HEIGHT);
405} 413}
406 414
@@ -417,7 +425,9 @@ int splitedit_get_split_x(void)
417 */ 425 */
418static void update_osci(void) 426static void update_osci(void)
419{ 427{
420 rb->lcd_clearrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); 428 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
429 rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
430 rb->lcd_set_drawmode(DRMODE_SOLID);
421 redraw_osci(); 431 redraw_osci();
422 splitedit_set_split_x(splitedit_get_split_x()); 432 splitedit_set_split_x(splitedit_get_split_x());
423 rb->lcd_update_rect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); 433 rb->lcd_update_rect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
@@ -485,7 +495,9 @@ static void scroll(struct mp3entry *mp3)
485 */ 495 */
486void splitedit_zoom_in(struct mp3entry *mp3) 496void splitedit_zoom_in(struct mp3entry *mp3)
487{ 497{
488 rb->lcd_clearrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT); 498 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
499 rb->lcd_fillrect(OSCI_X, OSCI_Y, OSCI_WIDTH, OSCI_HEIGHT);
500 rb->lcd_set_drawmode(DRMODE_SOLID);
489 zoom(mp3, 3, 4); 501 zoom(mp3, 3, 4);
490 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); 502 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
491 update_osci(); 503 update_osci();
@@ -497,7 +509,9 @@ void splitedit_zoom_in(struct mp3entry *mp3)
497 */ 509 */
498void splitedit_zoom_out(struct mp3entry *mp3) 510void splitedit_zoom_out(struct mp3entry *mp3)
499{ 511{
500 rb->lcd_clearrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); 512 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
513 rb->lcd_fillrect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
514 rb->lcd_set_drawmode(DRMODE_SOLID);
501 zoom(mp3, 4, 3); 515 zoom(mp3, 4, 3);
502 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT); 516 rb->lcd_update_rect(OSCI_X, OSCI_Y, LCD_WIDTH, OSCI_HEIGHT);
503 update_osci(); 517 update_osci();
@@ -823,7 +837,9 @@ static void save_editor(struct mp3entry *mp3, int splittime)
823 837
824 case SE_SAVE: 838 case SE_SAVE:
825 rb->lcd_stop_scroll(); 839 rb->lcd_stop_scroll();
826 rb->lcd_clearrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT); 840 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
841 rb->lcd_fillrect(0, 6*8, LCD_WIDTH, LCD_HEIGHT);
842 rb->lcd_set_drawmode(DRMODE_SOLID);
827 saved = save 843 saved = save
828 ( 844 (
829 mp3, 845 mp3,
@@ -919,7 +935,9 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
919 } 935 }
920 936
921 /* make room */ 937 /* make room */
922 rb->lcd_clearrect(lastx + 1, OSCI_Y, x - lastx, OSCI_HEIGHT); 938 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
939 rb->lcd_fillrect(lastx + 1, OSCI_Y, x - lastx, OSCI_HEIGHT);
940 rb->lcd_set_drawmode(DRMODE_SOLID);
923 /* draw a value */ 941 /* draw a value */
924 if (osci_buffer[x - OSCI_X] > 0) 942 if (osci_buffer[x - OSCI_X] > 0)
925 { 943 {
@@ -937,8 +955,10 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
937 /* mark the current position */ 955 /* mark the current position */
938 if (lastx != x) 956 if (lastx != x)
939 { 957 {
940 rb->lcd_invertrect(lastx, OSCI_Y, 1, OSCI_HEIGHT); 958 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
941 rb->lcd_invertrect(x, OSCI_Y, 1, OSCI_HEIGHT); 959 rb->lcd_fillrect(lastx, OSCI_Y, 1, OSCI_HEIGHT);
960 rb->lcd_fillrect(x, OSCI_Y, 1, OSCI_HEIGHT);
961 rb->lcd_set_drawmode(DRMODE_SOLID);
942 } 962 }
943 963
944 /* mark the split point */ 964 /* mark the split point */
@@ -946,11 +966,13 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
946 { 966 {
947 if ((lastx < split_x) && (x >= split_x)) 967 if ((lastx < split_x) && (x >= split_x))
948 { 968 {
949 rb->lcd_invertrect 969 rb->lcd_set_drawmode(DRMODE_COMPLEMENT);
970 rb->lcd_fillrect
950 ( 971 (
951 split_x, OSCI_Y + 2, 972 split_x, OSCI_Y + 2,
952 1, OSCI_HEIGHT - 2 973 1, OSCI_HEIGHT - 2
953 ); 974 );
975 rb->lcd_set_drawmode(DRMODE_SOLID);
954 } 976 }
955 rb->lcd_drawline(split_x -2, OSCI_Y, split_x + 2, OSCI_Y); 977 rb->lcd_drawline(split_x -2, OSCI_Y, split_x + 2, OSCI_Y);
956 rb->lcd_drawline(split_x-1, OSCI_Y+1, split_x +1,OSCI_Y+1); 978 rb->lcd_drawline(split_x-1, OSCI_Y+1, split_x +1,OSCI_Y+1);