summaryrefslogtreecommitdiff
path: root/src/tests/emotion
diff options
context:
space:
mode:
authordavemds <dave@gurumeditation.it>2014-02-16 15:32:59 +0100
committerdavemds <dave@gurumeditation.it>2014-02-16 18:27:10 +0100
commit2ed26fed596456f144700d8a45b89484bda1d16c (patch)
tree5e0c1601f78419d0ecb9f33e5a42bbdf165ca035 /src/tests/emotion
parenta1b8e38a5c15ca7c689d9dd8e400a7ec7bc1304a (diff)
Emotion test: New volume slider. More readable alpha text.
Diffstat (limited to 'src/tests/emotion')
-rw-r--r--src/tests/emotion/data/theme.edc67
-rw-r--r--src/tests/emotion/emotion_test_main.c24
2 files changed, 79 insertions, 12 deletions
diff --git a/src/tests/emotion/data/theme.edc b/src/tests/emotion/data/theme.edc
index 0a4b1f6ba1..2a50c09a82 100644
--- a/src/tests/emotion/data/theme.edc
+++ b/src/tests/emotion/data/theme.edc
@@ -647,11 +647,13 @@ collections {
647 // 647 //
648 // need txt parts: 648 // need txt parts:
649 // "video_speed_txt" 649 // "video_speed_txt"
650 // "video_volume_txt"
650 // "video_progress_txt" 651 // "video_progress_txt"
651 // 652 //
652 // need dragables: 653 // need dragables:
653 // "video_progress" horizontal 654 // "video_progress" horizontal
654 // "video_speed" vertical 655 // "video_speed" vertical
656 // "video_volume" vertical
655 part { name: "video_swallow"; mouse_events: 0; type: SWALLOW; 657 part { name: "video_swallow"; mouse_events: 0; type: SWALLOW;
656 description { state: "default" 0.0; 658 description { state: "default" 0.0;
657 rel1 { 659 rel1 {
@@ -735,24 +737,35 @@ collections {
735 part { name: "video_speed_txt"; type: TEXT; mouse_events: 0; 737 part { name: "video_speed_txt"; type: TEXT; mouse_events: 0;
736 description { state: "default" 0.0; 738 description { state: "default" 0.0;
737 rel1 { 739 rel1 {
738 to: "video_frame_bottom"; 740 to: "video_frame_top";
739 relative: 0.0 0.0;
740 offset: 0 8;
741 } 741 }
742 rel2 { 742 rel2 {
743 to: "video_frame_bottom"; 743 to: "video_frame_top";
744 relative: 1.0 1.0;
745 offset: -1 -13;
746 } 744 }
747 color: 0 0 0 255; 745 color: 0 0 0 255;
748 text { 746 text {
749 text: "Video Speed";
750 font: "Sans"; 747 font: "Sans";
751 size: 6; 748 size: 8;
752 align: 1.0 0.5; 749 align: 1.0 0.5;
753 }; 750 };
754 } 751 }
755 } 752 }
753 part { name: "video_volume_txt"; type: TEXT; mouse_events: 0;
754 description { state: "default" 0.0;
755 rel1 {
756 to: "video_frame_top";
757 }
758 rel2 {
759 to: "video_frame_top";
760 }
761 color: 0 0 0 255;
762 text {
763 font: "Sans";
764 size: 8;
765 align: 0.0 0.5;
766 };
767 }
768 }
756 part { name: "video_progress_confine"; mouse_events: 0; type: RECT; 769 part { name: "video_progress_confine"; mouse_events: 0; type: RECT;
757 description { state: "default" 0.0; 770 description { state: "default" 0.0;
758 fixed: 1 1; 771 fixed: 1 1;
@@ -851,6 +864,43 @@ collections {
851 } 864 }
852 } 865 }
853 } 866 }
867 part { name: "video_volume_confine"; mouse_events: 0; type: RECT;
868 description { state: "default" 0.0;
869 rel1 {
870 to: "video_frame_left";
871 offset: 10 24;
872 }
873 rel2 {
874 to: "video_frame_left";
875 offset: 0 -48;
876 }
877 color: 0 0 0 0;
878 }
879 }
880 part { name: "video_volume"; mouse_events: 1;
881 dragable {
882 x: 0 0 0;
883 y: -1 1 0;
884 confine: "video_volume_confine";
885 }
886 description { state: "default" 0.0;
887 fixed: 1 1;
888 min: 24 24;
889 rel1 {
890 to: "video_volume_confine";
891 relative: 0.5 0.5;
892 offset: 0 0;
893 }
894 rel2 {
895 to: "video_volume_confine";
896 relative: 0.5 0.5;
897 offset: 0 0;
898 }
899 image {
900 normal: "knob.png";
901 }
902 }
903 }
854 part { name: "video_play"; mouse_events: 1; 904 part { name: "video_play"; mouse_events: 1;
855 description { state: "default" 0.0; 905 description { state: "default" 0.0;
856 fixed: 1 1; 906 fixed: 1 1;
@@ -969,6 +1019,7 @@ collections {
969 // "video_control" "stop" 1019 // "video_control" "stop"
970 // "drag" "video_progress" 1020 // "drag" "video_progress"
971 // "drag" "video_speed" 1021 // "drag" "video_speed"
1022 // "drag" "video_volume"
972 // 1023 //
973 // get signals: 1024 // get signals:
974 // "video_state" "play" 1025 // "video_state" "play"
diff --git a/src/tests/emotion/emotion_test_main.c b/src/tests/emotion/emotion_test_main.c
index 2323e06da7..c2274a4471 100644
--- a/src/tests/emotion/emotion_test_main.c
+++ b/src/tests/emotion/emotion_test_main.c
@@ -511,11 +511,24 @@ video_obj_signal_speed_cb(void *data, Evas_Object *o, const char *emission EINA_
511 edje_object_part_drag_value_get(o, source, &x, &y); 511 edje_object_part_drag_value_get(o, source, &x, &y);
512 spd = 255 * y; 512 spd = 255 * y;
513 evas_object_color_set(ov, spd, spd, spd, spd); 513 evas_object_color_set(ov, spd, spd, spd, spd);
514 snprintf(buf, sizeof(buf), "%.0f", spd); 514 snprintf(buf, sizeof(buf), "alpha %.0f", spd);
515 edje_object_part_text_set(o, "video_speed_txt", buf); 515 edje_object_part_text_set(o, "video_speed_txt", buf);
516} 516}
517 517
518static void 518static void
519video_obj_signal_vol_cb(void *data, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
520{
521 Evas_Object *ov = data;
522 double vol;
523 char buf[256];
524
525 edje_object_part_drag_value_get(o, source, NULL, &vol);
526 emotion_object_audio_volume_set(ov, vol);
527 snprintf(buf, sizeof(buf), "vol %.2f", vol);
528 edje_object_part_text_set(o, "video_volume_txt", buf);
529}
530
531static void
519video_obj_signal_frame_move_start_cb(void *data EINA_UNUSED, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 532video_obj_signal_frame_move_start_cb(void *data EINA_UNUSED, Evas_Object *o, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
520{ 533{
521 Frame_Data *fd; 534 Frame_Data *fd;
@@ -605,11 +618,10 @@ init_video_object(const char *module_filename, const char *filename)
605 return; 618 return;
606 emotion_object_vis_set(o, vis); 619 emotion_object_vis_set(o, vis);
607 if (!emotion_object_file_set(o, filename)) 620 if (!emotion_object_file_set(o, filename))
608 {
609 return; 621 return;
610 }
611 emotion_object_last_position_load(o); 622 emotion_object_last_position_load(o);
612 emotion_object_play_set(o, 1); 623 emotion_object_play_set(o, 1);
624 emotion_object_audio_volume_set(o, 0.5);
613 evas_object_move(o, 0, 0); 625 evas_object_move(o, 0, 0);
614 evas_object_resize(o, 320, 240); 626 evas_object_resize(o, 320, 240);
615 emotion_object_smooth_scale_set(o, 1); 627 emotion_object_smooth_scale_set(o, 1);
@@ -659,6 +671,7 @@ init_video_object(const char *module_filename, const char *filename)
659 edje_object_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o); 671 edje_object_signal_callback_add(oe, "video_control", "stop", video_obj_signal_stop_cb, o);
660 edje_object_signal_callback_add(oe, "drag", "video_progress", video_obj_signal_jump_cb, o); 672 edje_object_signal_callback_add(oe, "drag", "video_progress", video_obj_signal_jump_cb, o);
661 edje_object_signal_callback_add(oe, "drag", "video_speed", video_obj_signal_speed_cb, o); 673 edje_object_signal_callback_add(oe, "drag", "video_speed", video_obj_signal_speed_cb, o);
674 edje_object_signal_callback_add(oe, "drag", "video_volume", video_obj_signal_vol_cb, o);
662 675
663 edje_object_signal_callback_add(oe, "frame_move", "start", video_obj_signal_frame_move_start_cb, oe); 676 edje_object_signal_callback_add(oe, "frame_move", "start", video_obj_signal_frame_move_start_cb, oe);
664 edje_object_signal_callback_add(oe, "frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe); 677 edje_object_signal_callback_add(oe, "frame_move", "stop", video_obj_signal_frame_move_stop_cb, oe);
@@ -667,7 +680,10 @@ init_video_object(const char *module_filename, const char *filename)
667 edje_object_signal_callback_add(oe, "mouse,move", "*", video_obj_signal_frame_move_cb, oe); 680 edje_object_signal_callback_add(oe, "mouse,move", "*", video_obj_signal_frame_move_cb, oe);
668 681
669 edje_object_part_drag_value_set(oe, "video_speed", 0.0, 1.0); 682 edje_object_part_drag_value_set(oe, "video_speed", 0.0, 1.0);
670 edje_object_part_text_set(oe, "video_speed_txt", "255"); 683 edje_object_part_text_set(oe, "video_speed_txt", "alpha 255");
684
685 edje_object_part_drag_value_set(oe, "video_volume", 0.0, 0.5);
686 edje_object_part_text_set(oe, "video_volume_txt", "vol 0.50");
671 687
672 edje_object_signal_emit(o, "video_state", "play"); 688 edje_object_signal_emit(o, "video_state", "play");
673 689