Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_media.c ewl_media.h
Log Message:
- move the time calculations into ewl_media itself. there is now a
ewl_media_length_time_get() and ewl_media_position_time_get() taking the
hour, min, sec variables and setting them accordingly
- update ewl_media_test.c to use these calls
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_media.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ewl_media.c 17 Jul 2004 03:42:44 -0000 1.7
+++ ewl_media.c 18 Jul 2004 18:21:46 -0000 1.8
@@ -123,6 +123,23 @@
/**
* @param m: the media widget to act upon
+ * @param h: hours variable
+ * @param min: minutes variable
+ * @param s: seconds variable
+ * @brief Puts the length of the video into the @h, @m, @s variables
+ */
+void ewl_media_length_time_get(Ewl_Media *m, int *h, int *min, double *s)
+{
+ double pos = ewl_media_length_get(m);
+
+ /* stolen from envision by benr */
+ *h = (int)pos / (60 * 60);
+ *min = ((int)pos / 60) - (*h * 60);
+ *s = pos - (*h * 60 * 60) - (*min * 60);
+}
+
+/**
+ * @param m: the media widget to act upon
* @param p: the value to set play too
* @return Returns no value
* @brief Sets the media widget into the given state
@@ -176,6 +193,23 @@
/**
* @param m: the media widget to act upon
+ * @param h: hours variable
+ * @param min: minutes variable
+ * @param s: seconds variable
+ * @brief Puts the position of the video into the @h, @m, @s variables
+ */
+void ewl_media_position_time_get(Ewl_Media *m, int *h, int *min, double *s)
+{
+ double pos = ewl_media_position_get(m);
+
+ /* stolen from envision by benr */
+ *h = (int)pos / (60 * 60);
+ *min = ((int)pos / 60) - (*h * 60);
+ *s = pos - (*h * 60 * 60) - (*min * 60);
+}
+
+/**
+ * @param m: the media widget to act upon
* @param p: the positon to seek too
* @return Returns no value
* @brief Sets the media widget to the specified position
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_media.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_media.h 17 Jul 2004 00:03:30 -0000 1.4
+++ ewl_media.h 18 Jul 2004 18:21:46 -0000 1.5
@@ -38,10 +38,12 @@
void ewl_media_media_set(Ewl_Media * m, char *media);
char *ewl_media_media_get(Ewl_Media * m);
int ewl_media_length_get(Ewl_Media *m);
+void ewl_media_length_time_get(Ewl_Media *m, int *h, int *min, double *s);
void ewl_media_play_set(Ewl_Media *m, int p);
int ewl_media_seekable_get(Ewl_Media *m);
double ewl_media_position_get(Ewl_Media *m);
+void ewl_media_position_time_get(Ewl_Media *m, int *h, int *min, double *s);
void ewl_media_position_set(Ewl_Media *m, double p);
int ewl_media_audio_mute_get(Ewl_Media *m);
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs