summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/lib/Emotion.h282
-rw-r--r--legacy/emotion/src/lib/emotion_smart.c17
2 files changed, 241 insertions, 58 deletions
diff --git a/legacy/emotion/src/lib/Emotion.h b/legacy/emotion/src/lib/Emotion.h
index 1616541be5..116d287a45 100644
--- a/legacy/emotion/src/lib/Emotion.h
+++ b/legacy/emotion/src/lib/Emotion.h
@@ -73,39 +73,57 @@ enum _Emotion_Event
73 EMOTION_EVENT_10 73 EMOTION_EVENT_10
74}; 74};
75 75
76/**
77 * @enum _Emotion_Meta_Info
78 *
79 * Used for retrieving information about the media file being played.
80 *
81 * @see emotion_object_meta_info_get()
82 *
83 * @ingroup Emotion_Info
84 */
76enum _Emotion_Meta_Info 85enum _Emotion_Meta_Info
77{ 86{
78 EMOTION_META_INFO_TRACK_TITLE, 87 EMOTION_META_INFO_TRACK_TITLE, /**< track title */
79 EMOTION_META_INFO_TRACK_ARTIST, 88 EMOTION_META_INFO_TRACK_ARTIST, /**< artist name */
80 EMOTION_META_INFO_TRACK_ALBUM, 89 EMOTION_META_INFO_TRACK_ALBUM, /**< album name */
81 EMOTION_META_INFO_TRACK_YEAR, 90 EMOTION_META_INFO_TRACK_YEAR, /**< track year */
82 EMOTION_META_INFO_TRACK_GENRE, 91 EMOTION_META_INFO_TRACK_GENRE, /**< track genre */
83 EMOTION_META_INFO_TRACK_COMMENT, 92 EMOTION_META_INFO_TRACK_COMMENT, /**< track comments */
84 EMOTION_META_INFO_TRACK_DISC_ID, 93 EMOTION_META_INFO_TRACK_DISC_ID, /**< track disc ID */
85 EMOTION_META_INFO_TRACK_COUNT 94 EMOTION_META_INFO_TRACK_COUNT /**< track count - number of the track in the album */
86}; 95};
87 96
97/**
98 * @enum _Emotion_Vis
99 *
100 * Used for displaying a visualization on the emotion object.
101 *
102 * @see emotion_object_vis_set()
103 *
104 * @ingroup Emotion_Visualization
105 */
88enum _Emotion_Vis 106enum _Emotion_Vis
89{ 107{
90 EMOTION_VIS_NONE, 108 EMOTION_VIS_NONE, /**< no visualization set */
91 EMOTION_VIS_GOOM, 109 EMOTION_VIS_GOOM, /**< goom */
92 EMOTION_VIS_LIBVISUAL_BUMPSCOPE, 110 EMOTION_VIS_LIBVISUAL_BUMPSCOPE, /**< bumpscope */
93 EMOTION_VIS_LIBVISUAL_CORONA, 111 EMOTION_VIS_LIBVISUAL_CORONA, /**< corona */
94 EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES, 112 EMOTION_VIS_LIBVISUAL_DANCING_PARTICLES, /**< dancing particles */
95 EMOTION_VIS_LIBVISUAL_GDKPIXBUF, 113 EMOTION_VIS_LIBVISUAL_GDKPIXBUF, /**< gdkpixbuf */
96 EMOTION_VIS_LIBVISUAL_G_FORCE, 114 EMOTION_VIS_LIBVISUAL_G_FORCE, /**< G force */
97 EMOTION_VIS_LIBVISUAL_GOOM, 115 EMOTION_VIS_LIBVISUAL_GOOM, /**< goom */
98 EMOTION_VIS_LIBVISUAL_INFINITE, 116 EMOTION_VIS_LIBVISUAL_INFINITE, /**< infinite */
99 EMOTION_VIS_LIBVISUAL_JAKDAW, 117 EMOTION_VIS_LIBVISUAL_JAKDAW, /**< jakdaw */
100 EMOTION_VIS_LIBVISUAL_JESS, 118 EMOTION_VIS_LIBVISUAL_JESS, /**< jess */
101 EMOTION_VIS_LIBVISUAL_LV_ANALYSER, 119 EMOTION_VIS_LIBVISUAL_LV_ANALYSER, /**< lv analyser */
102 EMOTION_VIS_LIBVISUAL_LV_FLOWER, 120 EMOTION_VIS_LIBVISUAL_LV_FLOWER, /**< lv flower */
103 EMOTION_VIS_LIBVISUAL_LV_GLTEST, 121 EMOTION_VIS_LIBVISUAL_LV_GLTEST, /**< lv gltest */
104 EMOTION_VIS_LIBVISUAL_LV_SCOPE, 122 EMOTION_VIS_LIBVISUAL_LV_SCOPE, /**< lv scope */
105 EMOTION_VIS_LIBVISUAL_MADSPIN, 123 EMOTION_VIS_LIBVISUAL_MADSPIN, /**< madspin */
106 EMOTION_VIS_LIBVISUAL_NEBULUS, 124 EMOTION_VIS_LIBVISUAL_NEBULUS, /**< nebulus */
107 EMOTION_VIS_LIBVISUAL_OINKSIE, 125 EMOTION_VIS_LIBVISUAL_OINKSIE, /**< oinksie */
108 EMOTION_VIS_LIBVISUAL_PLASMA, 126 EMOTION_VIS_LIBVISUAL_PLASMA, /**< plasma */
109 EMOTION_VIS_LAST /* sentinel */ 127 EMOTION_VIS_LAST /* sentinel */
110}; 128};
111 129
@@ -119,8 +137,8 @@ typedef enum
119 137
120typedef enum _Emotion_Module Emotion_Module; 138typedef enum _Emotion_Module Emotion_Module;
121typedef enum _Emotion_Event Emotion_Event; 139typedef enum _Emotion_Event Emotion_Event;
122typedef enum _Emotion_Meta_Info Emotion_Meta_Info; 140typedef enum _Emotion_Meta_Info Emotion_Meta_Info; /**< Meta info type to be retrieved. */
123typedef enum _Emotion_Vis Emotion_Vis; 141typedef enum _Emotion_Vis Emotion_Vis; /**< Type of visualization. */
124 142
125#define EMOTION_CHANNEL_AUTO -1 143#define EMOTION_CHANNEL_AUTO -1
126#define EMOTION_CHANNEL_DEFAULT 0 144#define EMOTION_CHANNEL_DEFAULT 0
@@ -165,6 +183,14 @@ extern "C" {
165 */ 183 */
166 184
167/** 185/**
186 * @defgroup Emotion_Visualization Visualization control functions
187 */
188
189/**
190 * @defgroup Emotion_Info Miscellaneous information retrieval functions
191 */
192
193/**
168 * @brief Add an emotion object to the canvas. 194 * @brief Add an emotion object to the canvas.
169 * 195 *
170 * @param evas The canvas where the object will be added to. 196 * @param evas The canvas where the object will be added to.
@@ -350,18 +376,7 @@ EAPI Eina_Bool emotion_object_seekable_get (const Evas_Object *obj);
350 * been emitted. 376 * been emitted.
351 */ 377 */
352EAPI double emotion_object_play_length_get (const Evas_Object *obj); 378EAPI double emotion_object_play_length_get (const Evas_Object *obj);
353/** 379
354 * @brief Gets the native aspect ratio of the media file.
355 *
356 * @param obj The emotion object from which the ratio will be retrieved.
357 * @return The aspect ration of the video.
358 *
359 * This function returns the aspect ratio of the video file being played. The
360 * aspect is width divided by height.
361 *
362 * @warning For audio files this function returns 0.
363 */
364EAPI double emotion_object_ratio_get (const Evas_Object *obj);
365/** 380/**
366 * @brief Set the play speed of the media file. 381 * @brief Set the play speed of the media file.
367 * 382 *
@@ -411,8 +426,78 @@ EAPI double emotion_object_progress_status_get (const Evas_Object *obj);
411 */ 426 */
412EAPI Eina_Bool emotion_object_video_handled_get (const Evas_Object *obj); 427EAPI Eina_Bool emotion_object_video_handled_get (const Evas_Object *obj);
413EAPI Eina_Bool emotion_object_audio_handled_get (const Evas_Object *obj); 428EAPI Eina_Bool emotion_object_audio_handled_get (const Evas_Object *obj);
429
430/**
431 * @brief Retrieve the video aspect ratio of the media file loaded.
432 *
433 * @param obj The emotion object which the video aspect ratio will be retrieved
434 * from.
435 * @return The video aspect ratio of the file loaded.
436 *
437 * This function returns the video aspect ratio (width / height) of the file
438 * loaded. It can be used to adapt the size of the emotion object in the canvas,
439 * so the aspect won't be changed (by wrongly resizing the object). Or to crop
440 * the video correctly, if necessary.
441 *
442 * @note This function returns the aspect ratio that the video @b should be, but
443 * sometimes the reported size from emotion_object_size_get() represents a
444 * different aspect ratio. You can safely resize the video to respect the aspect
445 * ratio returned by @b this function.
446 *
447 * @see emotion_object_size_get()
448 *
449 * @ingroup Emotion_Video
450 */
451EAPI double emotion_object_ratio_get (const Evas_Object *obj);
452
453/**
454 * @brief Retrieve the video size of the loaded file.
455 *
456 * @param obj The object from which we are retrieving the video size.
457 * @param iw A pointer to a variable where the width will be stored.
458 * @param iw A pointer to a variable where the height will be stored.
459 *
460 * This function returns the reported size of the loaded video file. If a file
461 * that doesn't contain a video channel is loaded, then this size can be
462 * ignored.
463 *
464 * The value reported by this function should be consistent with the aspect
465 * ratio returned by emotion_object_ratio_get(), but sometimes the information
466 * stored in the file is wrong. So use the ratio size reported by
467 * emotion_object_ratio_get(), since it is more likely going to be accurate.
468 *
469 * @note Use @c NULL for @p iw or @p ih if you don't need one of these values.
470 *
471 * @see emotion_object_ratio_get()
472 *
473 * @ingroup Emotion_Video
474 */
414EAPI void emotion_object_size_get (const Evas_Object *obj, int *iw, int *ih); 475EAPI void emotion_object_size_get (const Evas_Object *obj, int *iw, int *ih);
476
477/**
478 * @brief Sets whether to use of high-quality image scaling algorithm
479 * of the given video object.
480 *
481 * When enabled, a higher quality video scaling algorithm is used when
482 * scaling videos to sizes other than the source video. This gives
483 * better results but is more computationally expensive.
484 *
485 * @param obj The given video object.
486 * @param smooth Whether to use smooth scale or not.
487 *
488 * @see emotion_object_smooth_scale_get()
489 */
415EAPI void emotion_object_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth); 490EAPI void emotion_object_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth);
491
492/**
493 * @brief Gets whether the high-quality image scaling algorithm
494 * of the given video object is used.
495 *
496 * @param obj The given video object.
497 * @return Whether the smooth scale is used or not.
498 *
499 * @see emotion_object_smooth_scale_set()
500 */
416EAPI Eina_Bool emotion_object_smooth_scale_get (const Evas_Object *obj); 501EAPI Eina_Bool emotion_object_smooth_scale_get (const Evas_Object *obj);
417EAPI void emotion_object_event_simple_send (Evas_Object *obj, Emotion_Event ev); 502EAPI void emotion_object_event_simple_send (Evas_Object *obj, Emotion_Event ev);
418 503
@@ -487,7 +572,38 @@ EAPI int emotion_object_audio_channel_count (const Evas_Object *obj);
487EAPI const char *emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel); 572EAPI const char *emotion_object_audio_channel_name_get(const Evas_Object *obj, int channel);
488EAPI void emotion_object_audio_channel_set (Evas_Object *obj, int channel); 573EAPI void emotion_object_audio_channel_set (Evas_Object *obj, int channel);
489EAPI int emotion_object_audio_channel_get (const Evas_Object *obj); 574EAPI int emotion_object_audio_channel_get (const Evas_Object *obj);
575
576/**
577 * @brief Set the mute video option for this object.
578 *
579 * @param obj The object which we are setting the mute video option.
580 * @param mute Whether the video should be muted (@c EINA_TRUE) or not (@c
581 * EINA_FALSE).
582 *
583 * This function sets the mute video option for this emotion object. The
584 * current module used for this object can use this information to avoid
585 * decoding the video portion of the loaded media file.
586 *
587 * @see emotion_object_video_mute_get()
588 * @see emotion_object_audio_mute_set()
589 *
590 * @ingroup Emotion_Video
591 */
490EAPI void emotion_object_video_mute_set (Evas_Object *obj, Eina_Bool mute); 592EAPI void emotion_object_video_mute_set (Evas_Object *obj, Eina_Bool mute);
593
594/**
595 * @brief Get the mute video option of this object.
596 *
597 * @param obj The object which we are retrieving the mute video option from.
598 * @return Whether the video is muted (@c EINA_TRUE) or not (@c EINA_FALSE).
599 *
600 * This function returns the mute video option from this emotion object. It can
601 * be set with emotion_object_video_mute_set().
602 *
603 * @see emotion_object_video_mute_set()
604 *
605 * @ingroup Emotion_Video
606 */
491EAPI Eina_Bool emotion_object_video_mute_get (const Evas_Object *obj); 607EAPI Eina_Bool emotion_object_video_mute_get (const Evas_Object *obj);
492EAPI int emotion_object_video_channel_count (const Evas_Object *obj); 608EAPI int emotion_object_video_channel_count (const Evas_Object *obj);
493EAPI const char *emotion_object_video_channel_name_get(const Evas_Object *obj, int channel); 609EAPI const char *emotion_object_video_channel_name_get(const Evas_Object *obj, int channel);
@@ -504,15 +620,99 @@ EAPI void emotion_object_chapter_set (Evas_Object *obj, int ch
504EAPI int emotion_object_chapter_get (const Evas_Object *obj); 620EAPI int emotion_object_chapter_get (const Evas_Object *obj);
505EAPI const char *emotion_object_chapter_name_get (const Evas_Object *obj, int chapter); 621EAPI const char *emotion_object_chapter_name_get (const Evas_Object *obj, int chapter);
506EAPI void emotion_object_eject (Evas_Object *obj); 622EAPI void emotion_object_eject (Evas_Object *obj);
623
624/**
625 * @brief Get the dvd title from this emotion object.
626 *
627 * @param obj The object which the title will be retrieved from.
628 * @return A string containing the title.
629 *
630 * This function is only useful when playing a DVD.
631 *
632 * @note Don't change or free the string returned by this function.
633 *
634 * @ingroup Emotion_Info
635 */
507EAPI const char *emotion_object_title_get (const Evas_Object *obj); 636EAPI const char *emotion_object_title_get (const Evas_Object *obj);
508EAPI const char *emotion_object_ref_file_get (const Evas_Object *obj); 637EAPI const char *emotion_object_ref_file_get (const Evas_Object *obj);
509EAPI int emotion_object_ref_num_get (const Evas_Object *obj); 638EAPI int emotion_object_ref_num_get (const Evas_Object *obj);
510EAPI int emotion_object_spu_button_count_get (const Evas_Object *obj); 639EAPI int emotion_object_spu_button_count_get (const Evas_Object *obj);
511EAPI int emotion_object_spu_button_get (const Evas_Object *obj); 640EAPI int emotion_object_spu_button_get (const Evas_Object *obj);
641
642/**
643 * @brief Retrieve meta information from this file being played.
644 *
645 * @param obj The object which the meta info will be extracted from.
646 * @param meta The type of meta information that will be extracted.
647 *
648 * This function retrieves information about the file loaded. It can retrieve
649 * the track title, artist name, album name, etc. See @ref Emotion_Meta_Info
650 * for all the possibilities.
651 *
652 * The meta info may be not available on all types of files. It will return @c
653 * NULL if the the file doesn't have meta info, or if this specific field is
654 * empty.
655 *
656 * @note Don't change or free the string returned by this function.
657 *
658 * @see Emotion_Meta_Info
659 *
660 * @ingroup Emotion_Info
661 */
512EAPI const char *emotion_object_meta_info_get (const Evas_Object *obj, Emotion_Meta_Info meta); 662EAPI const char *emotion_object_meta_info_get (const Evas_Object *obj, Emotion_Meta_Info meta);
513 663
664/**
665 * @brief Set the visualization to be used with this object.
666 *
667 * @param obj The object where the visualization will be set on.
668 * @param visualization The type of visualization to be used.
669 *
670 * The @p visualization specified will be played instead of a video. This is
671 * commonly used to display a visualization for audio only files (musics).
672 *
673 * The available visualizations are @ref Emotion_Vis.
674 *
675 * @see Emotion_Vis
676 * @see emotion_object_vis_get()
677 * @see emotion_object_vis_supported()
678 *
679 * @ingroup Emotion_Visualization
680 */
514EAPI void emotion_object_vis_set (Evas_Object *obj, Emotion_Vis visualization); 681EAPI void emotion_object_vis_set (Evas_Object *obj, Emotion_Vis visualization);
682
683/**
684 * @brief Get the type of visualization in use by this emotion object.
685 *
686 * @param obj The emotion object which the visualization is being retrieved
687 * from.
688 * @return The type of visualization in use by this object.
689 *
690 * The type of visualization can be set by emotion_object_vis_set().
691 *
692 * @see Emotion_Vis
693 * @see emotion_object_vis_set()
694 * @see emotion_object_vis_supported()
695 *
696 * @ingroup Emotion_Visualization
697 */
515EAPI Emotion_Vis emotion_object_vis_get (const Evas_Object *obj); 698EAPI Emotion_Vis emotion_object_vis_get (const Evas_Object *obj);
699
700/**
701 * @brief Query whether a type of visualization is supported by this object.
702 *
703 * @param obj The object which the query is being ran on.
704 * @param visualization The type of visualization that is being queried.
705 * @return EINA_TRUE if the visualization is supported, EINA_FALSE otherwise.
706 *
707 * This can be used to check if a visualization is supported. e.g.: one wants to
708 * display a list of available visualizations for a specific object.
709 *
710 * @see Emotion_Vis
711 * @see emotion_object_vis_set()
712 * @see emotion_object_vis_get()
713 *
714 * @ingroup Emotion_Visualization
715 */
516EAPI Eina_Bool emotion_object_vis_supported (const Evas_Object *obj, Emotion_Vis visualization); 716EAPI Eina_Bool emotion_object_vis_supported (const Evas_Object *obj, Emotion_Vis visualization);
517 717
518EAPI void emotion_object_last_position_load (Evas_Object *obj); 718EAPI void emotion_object_last_position_load (Evas_Object *obj);
diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c
index 648c0116af..ebbfdef120 100644
--- a/legacy/emotion/src/lib/emotion_smart.c
+++ b/legacy/emotion/src/lib/emotion_smart.c
@@ -529,17 +529,6 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
529 evas_object_image_size_get(sd->obj, iw, ih); 529 evas_object_image_size_get(sd->obj, iw, ih);
530} 530}
531 531
532/**
533 * Sets whether to use of high-quality image scaling algorithm
534 * of the given video object.
535 *
536 * When enabled, a higher quality video scaling algorithm is used when
537 * scaling videos to sizes other than the source video. This gives
538 * better results but is more computationally expensive.
539 *
540 * @param obj The given video object.
541 * @param smooth Whether to use smooth scale or not.
542 */
543EAPI void 532EAPI void
544emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth) 533emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth)
545{ 534{
@@ -549,12 +538,6 @@ emotion_object_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth)
549 evas_object_image_smooth_scale_set(sd->obj, smooth); 538 evas_object_image_smooth_scale_set(sd->obj, smooth);
550} 539}
551 540
552/**
553 * Gets whether the high-quality image scaling algorithm
554 * of the given video object is used.
555 *
556 * @return Whether the smooth scale is used or not.
557 */
558EAPI Eina_Bool 541EAPI Eina_Bool
559emotion_object_smooth_scale_get(const Evas_Object *obj) 542emotion_object_smooth_scale_get(const Evas_Object *obj)
560{ 543{