Evas_Object *util_add_image(Evas_Object *base, const char *file);
Evas_Object *util_add_scroller(Evas_Object *base);
-void util_time_string(char *str, int size, unsigned int ms);
+void util_time_string(char *str, int size, unsigned int ms, bool full);
void util_up_string(char *str);
int util_get_media_index(Eina_List *list, void *info);
* limitations under the License.
*/
+#include <stdbool.h>
#include <Elementary.h>
#include <app_debug.h>
return scr;
}
-void util_time_string(char *str, int size, unsigned int ms)
+void util_time_string(char *str, int size, unsigned int ms, bool full)
{
int sec;
+ int h, m, s;
sec = ms / 1000;
- snprintf(str, size, "%02d:%02d:%02d",
- sec / 3600, (sec % 3600) / 60, sec % 60);
+ h = sec / 3600;
+ m = (sec % 3600) / 60;
+ s = sec % 60;
+
+ if (full) {
+ snprintf(str, size, "%02d:%02d:%02d", h, m, s);
+ } else {
+ if (h)
+ snprintf(str, size, "%d:%02d:%02d", h, m, s);
+ else
+ snprintf(str, size, "%d:%02d", m, s);
+ }
}
void util_up_string(char *str)