summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/lib/emotion_smart.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2010-10-07 22:16:43 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2010-10-07 22:16:43 +0000
commit1520c60364ab6bec3b47f5fabe2f4449b7387a9a (patch)
tree9280befa814428830b8f6e1de5446cc97e1142ef /legacy/emotion/src/lib/emotion_smart.c
parentb11b2f95b5b702c71c9bd808e66dc54c99e6b0eb (diff)
shutup stupid emotion debug!
to get them back, use EINA_LOG_LEVELS for each module or the catch-all: export EINA_LOG_LEVELS_GLOB='emotion*:4' ah, that was making me sick while playing enjoy... :-D SVN revision: 53170
Diffstat (limited to 'legacy/emotion/src/lib/emotion_smart.c')
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c38
1 files changed, 33 insertions, 5 deletions
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 34b63296f8..0526bb1f07 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -25,6 +25,12 @@
25 if (strcmp(_e_smart_str, type)) return ret; \ 25 if (strcmp(_e_smart_str, type)) return ret; \
26 } 26 }
27 27
28#define DBG(...) EINA_LOG_DOM_DBG(_log_domain, __VA_ARGS__)
29#define INF(...) EINA_LOG_DOM_INFO(_log_domain, __VA_ARGS__)
30#define WRN(...) EINA_LOG_DOM_WARN(_log_domain, __VA_ARGS__)
31#define ERR(...) EINA_LOG_DOM_ERR(_log_domain, __VA_ARGS__)
32#define CRITICAL(...) EINA_LOG_DOM_CRIT(_log_domain, __VA_ARGS__)
33
28#define E_OBJ_NAME "emotion_object" 34#define E_OBJ_NAME "emotion_object"
29 35
30typedef struct _Smart_Data Smart_Data; 36typedef struct _Smart_Data Smart_Data;
@@ -88,6 +94,7 @@ static void _smart_clip_unset(Evas_Object * obj);
88static Evas_Smart *smart = NULL; 94static Evas_Smart *smart = NULL;
89static Eina_Hash *_backends = NULL; 95static Eina_Hash *_backends = NULL;
90static Eina_Array *_modules = NULL; 96static Eina_Array *_modules = NULL;
97static int _log_domain = -1;
91 98
92static const char *_backend_priority[] = { 99static const char *_backend_priority[] = {
93 "xine", 100 "xine",
@@ -160,7 +167,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
160 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0); 167 E_SMART_OBJ_GET_RETURN(sd, obj, E_OBJ_NAME, 0);
161 if (!_backends) 168 if (!_backends)
162 { 169 {
163 fprintf(stderr, "No backend loaded\n"); 170 ERR("No backend loaded");
164 return NULL; 171 return NULL;
165 } 172 }
166 173
@@ -175,7 +182,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
175 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*))) 182 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
176 goto retry; 183 goto retry;
177 184
178 fprintf(stderr, "No backend loaded\n"); 185 ERR("No backend loaded");
179 return EINA_FALSE; 186 return EINA_FALSE;
180 } 187 }
181 188
@@ -191,7 +198,7 @@ _emotion_module_open(const char *name, Evas_Object *obj, Emotion_Video_Module **
191 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*))) 198 if (index != 0 && index < (sizeof (_backend_priority) / sizeof (char*)))
192 goto retry; 199 goto retry;
193 200
194 fprintf (stderr, "Unable to load module %s\n", name); 201 ERR("Unable to load module: %s", name);
195 202
196 return NULL; 203 return NULL;
197} 204}
@@ -298,6 +305,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
298 305
299 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 306 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
300 307
308 DBG("file=%s", file);
301 if (!sd->module) return; 309 if (!sd->module) return;
302 310
303 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; 311 if ((file) && (sd->file) && (!strcmp(file, sd->file))) return;
@@ -344,6 +352,7 @@ emotion_object_play_set(Evas_Object *obj, Eina_Bool play)
344 Smart_Data *sd; 352 Smart_Data *sd;
345 353
346 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 354 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
355 DBG("play=%hhu, was=%hhu", play, sd->play);
347 if (play == sd->play) return; 356 if (play == sd->play) return;
348 if (!sd->module) return; 357 if (!sd->module) return;
349 if (!sd->video) return; 358 if (!sd->video) return;
@@ -369,6 +378,7 @@ emotion_object_position_set(Evas_Object *obj, double sec)
369 Smart_Data *sd; 378 Smart_Data *sd;
370 379
371 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 380 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
381 DBG("sec=%f", sec);
372 if (!sd->module) return; 382 if (!sd->module) return;
373 if (!sd->video) return; 383 if (!sd->video) return;
374 sd->seek_pos = sec; 384 sd->seek_pos = sec;
@@ -513,6 +523,7 @@ emotion_object_audio_volume_set(Evas_Object *obj, double vol)
513 Smart_Data *sd; 523 Smart_Data *sd;
514 524
515 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 525 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
526 DBG("vol=%f", vol);
516 if (!sd->module) return; 527 if (!sd->module) return;
517 if (!sd->video) return; 528 if (!sd->video) return;
518 sd->module->audio_channel_volume_set(sd->video, vol); 529 sd->module->audio_channel_volume_set(sd->video, vol);
@@ -535,6 +546,7 @@ emotion_object_audio_mute_set(Evas_Object *obj, Eina_Bool mute)
535 Smart_Data *sd; 546 Smart_Data *sd;
536 547
537 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 548 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
549 DBG("mute=%hhu", mute);
538 if (!sd->module) return; 550 if (!sd->module) return;
539 if (!sd->video) return; 551 if (!sd->video) return;
540 sd->module->audio_channel_mute_set(sd->video, mute); 552 sd->module->audio_channel_mute_set(sd->video, mute);
@@ -579,6 +591,7 @@ emotion_object_audio_channel_set(Evas_Object *obj, int channel)
579 Smart_Data *sd; 591 Smart_Data *sd;
580 592
581 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 593 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
594 DBG("channel=%d", channel);
582 if (!sd->module) return; 595 if (!sd->module) return;
583 if (!sd->video) return; 596 if (!sd->video) return;
584 sd->module->audio_channel_set(sd->video, channel); 597 sd->module->audio_channel_set(sd->video, channel);
@@ -601,6 +614,7 @@ emotion_object_video_mute_set(Evas_Object *obj, Eina_Bool mute)
601 Smart_Data *sd; 614 Smart_Data *sd;
602 615
603 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 616 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
617 DBG("mute=%hhu", mute);
604 if (!sd->module) return; 618 if (!sd->module) return;
605 if (!sd->video) return; 619 if (!sd->video) return;
606 sd->module->video_channel_mute_set(sd->video, mute); 620 sd->module->video_channel_mute_set(sd->video, mute);
@@ -645,6 +659,7 @@ emotion_object_video_channel_set(Evas_Object *obj, int channel)
645 Smart_Data *sd; 659 Smart_Data *sd;
646 660
647 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 661 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
662 DBG("channel=%d", channel);
648 if (!sd->module) return; 663 if (!sd->module) return;
649 if (!sd->video) return; 664 if (!sd->video) return;
650 sd->module->video_channel_set(sd->video, channel); 665 sd->module->video_channel_set(sd->video, channel);
@@ -667,6 +682,7 @@ emotion_object_spu_mute_set(Evas_Object *obj, Eina_Bool mute)
667 Smart_Data *sd; 682 Smart_Data *sd;
668 683
669 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 684 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
685 DBG("mute=%hhu", mute);
670 if (!sd->module) return; 686 if (!sd->module) return;
671 if (!sd->video) return; 687 if (!sd->video) return;
672 sd->module->spu_channel_mute_set(sd->video, mute); 688 sd->module->spu_channel_mute_set(sd->video, mute);
@@ -711,6 +727,7 @@ emotion_object_spu_channel_set(Evas_Object *obj, int channel)
711 Smart_Data *sd; 727 Smart_Data *sd;
712 728
713 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 729 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
730 DBG("channel=%d", channel);
714 if (!sd->module) return; 731 if (!sd->module) return;
715 if (!sd->video) return; 732 if (!sd->video) return;
716 sd->module->spu_channel_set(sd->video, channel); 733 sd->module->spu_channel_set(sd->video, channel);
@@ -744,6 +761,7 @@ emotion_object_chapter_set(Evas_Object *obj, int chapter)
744 Smart_Data *sd; 761 Smart_Data *sd;
745 762
746 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 763 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
764 DBG("chapter=%d", chapter);
747 if (!sd->module) return; 765 if (!sd->module) return;
748 if (!sd->video) return; 766 if (!sd->video) return;
749 sd->module->chapter_set(sd->video, chapter); 767 sd->module->chapter_set(sd->video, chapter);
@@ -777,6 +795,7 @@ emotion_object_play_speed_set(Evas_Object *obj, double speed)
777 Smart_Data *sd; 795 Smart_Data *sd;
778 796
779 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 797 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
798 DBG("speed=%f", speed);
780 if (!sd->module) return; 799 if (!sd->module) return;
781 if (!sd->video) return; 800 if (!sd->video) return;
782 sd->module->speed_set(sd->video, speed); 801 sd->module->speed_set(sd->video, speed);
@@ -910,6 +929,7 @@ emotion_object_vis_set(Evas_Object *obj, Emotion_Vis visualization)
910 Smart_Data *sd; 929 Smart_Data *sd;
911 930
912 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); 931 E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
932 DBG("visualization=%d", visualization);
913 if (!sd->module) return; 933 if (!sd->module) return;
914 if (!sd->video) return; 934 if (!sd->video) return;
915 if (!sd->module->vis_set) return; 935 if (!sd->module->vis_set) return;
@@ -1315,6 +1335,14 @@ _smart_init(void)
1315 { 1335 {
1316 eina_init(); 1336 eina_init();
1317 1337
1338 _log_domain = eina_log_domain_register("emotion", EINA_COLOR_LIGHTCYAN);
1339 if (_log_domain < 0)
1340 {
1341 EINA_LOG_CRIT("Could not register log domain 'emotion'");
1342 eina_shutdown();
1343 return;
1344 }
1345
1318 _backends = eina_hash_string_small_new(free); 1346 _backends = eina_hash_string_small_new(free);
1319 1347
1320 _modules = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/emotion/", 0, NULL, NULL); 1348 _modules = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/emotion/", 0, NULL, NULL);
@@ -1333,8 +1361,8 @@ _smart_init(void)
1333 1361
1334 if (!_modules) 1362 if (!_modules)
1335 { 1363 {
1336 fprintf(stderr, "No module found !\n"); 1364 ERR("No module found!");
1337 return ; 1365 return;
1338 } 1366 }
1339 1367
1340 eina_module_list_load(_modules); 1368 eina_module_list_load(_modules);