~ubuntu-branches/ubuntu/wily/totem/wily

« back to all changes in this revision

Viewing changes to src/plugins/skipto/totem-time-entry.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl, Sjoerd Simons, Michael Biebl, Josselin Mouette
  • Date: 2011-11-27 06:21:34 UTC
  • mfrom: (1.4.8) (5.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20111127062134-c3ikko9wdfn9m2av
Tags: 3.2.1-1
[ Sjoerd Simons ]
* New upstream release
* debian/control.in: Update build-depends
* debian/rules: Enable vala plugins
* debian/totem-plugins.install:
  - Add grilo and rotation plugins
  - Remove jamendo, thumbnail and tracker plugins

[ Michael Biebl ]
* debian/control.in:
  - Bump Depends on python-gobject to (>= 2.90.3).

[ Josselin Mouette ]
* Replace python-gobject dependencies by python-gi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 * Author: Philip Withnall <philip@tecnocode.co.uk>
28
28
 */
29
29
 
 
30
#include "config.h"
30
31
#include <string.h>
31
32
#include <glib.h>
 
33
#include <glib/gi18n-lib.h>
32
34
#include <gtk/gtk.h>
33
35
 
34
36
#include "backend/video-utils.h"
47
49
 
48
50
G_DEFINE_TYPE (TotemTimeEntry, totem_time_entry, GTK_TYPE_SPIN_BUTTON)
49
51
 
 
52
static gint64
 
53
totem_string_to_time (const char *time_string)
 
54
{
 
55
        int sec, min, hour, args;
 
56
 
 
57
        args = sscanf (time_string, C_("long time format", "%d:%02d:%02d"), &hour, &min, &sec);
 
58
 
 
59
        if (args == 3) {
 
60
                /* Parsed all three arguments successfully */
 
61
                return (hour * (60 * 60) + min * 60 + sec) * 1000;
 
62
        } else if (args == 2) {
 
63
                /* Only parsed the first two arguments; treat hour and min as min and sec, respectively */
 
64
                return (hour * 60 + min) * 1000;
 
65
        } else if (args == 1) {
 
66
                /* Only parsed the first argument; treat hour as sec */
 
67
                return hour * 1000;
 
68
        } else {
 
69
                /* Error! */
 
70
                return -1;
 
71
        }
 
72
}
 
73
 
50
74
static void
51
75
totem_time_entry_class_init (TotemTimeEntryClass *klass)
52
76
{