Change TimingSegment to RoleTiming
[laugh.git] / src / laugh-timing.h
blob555b374c0772e8ab6df6f4f3113acfce54946a77
1 /*
2 * Laugh.
4 * An glib SMIL library.
6 * Authored By Koos Vriezen <koos.vriezen@gmail.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
24 #include "laugh-dom.h"
26 #ifndef _LAUGH_TIMING_H
27 #define _LAUGH_TIMING_H
29 G_BEGIN_DECLS
31 #define LAUGH_TYPE_TIMING_CONTAINER laugh_timing_container_get_type()
33 #define LAUGH_TIMING_CONTAINER(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
35 LAUGH_TYPE_TIMING_CONTAINER, LaughTimingContainer))
37 #define LAUGH_TYPE_TIMING_CONTAINER_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), \
39 LAUGH_TYPE_TIMING_CONTAINER, LaughTimingContainerClass))
41 #define LAUGH_IS_TIMING_CONTAINER(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
43 LAUGH_TYPE_TIMING_CONTAINER))
45 #define LAUGH_IS_TIMING_CONTAINER_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
47 LAUGH_TYPE_TIMING_CONTAINER))
49 #define LAUGH_TIMING_CONTAINER_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
51 LAUGH_TYPE_TIMING_CONTAINER, LaughTimingContainerClass))
53 typedef struct _LaughTimingContainer LaughTimingContainer;
54 typedef struct _LaughTimingContainerClass LaughTimingContainerClass;
55 typedef struct _LaughTimingContainerPrivate LaughTimingContainerPrivate;
56 typedef enum _LaughTimingType LaughTimingType;
57 typedef struct _LaughTiming LaughTiming;
58 typedef struct _LaughRoleTiming LaughRoleTiming;
60 enum _LaughTimingType
62 LaughTimingUnknown = -1,
63 LaughTimingTime = 0, LaughTimingIndefinite, LaughTimingMedia,
64 LaughTimingActivated, LaughTimingInbounds, LaughTimingOutbounds,
65 LaughTimingEndSync, LaughTimingStartSync
68 struct _LaughTiming
70 LaughTimingType type;
71 int offset;
72 gulong handler_id;
73 gchar *element_id;
76 struct _LaughRoleTiming
78 LaughRole role;
79 LaughNode *node;
81 /*TODO: begin and end should support multiple events, make a list*/
82 LaughTiming *begin;
83 LaughTiming *dur;
84 LaughTiming *end;
86 gboolean active;
88 GSList *sub_segments;
89 LaughRoleTiming *parent;
92 struct _LaughTimingContainer
94 LaughNode parent;
96 /*< public >*/
97 LaughRoleTiming *timing_role;
99 /*< private >*/
100 LaughTimingContainerPrivate *priv;
103 struct _LaughTimingContainerClass
105 LaughNodeClass parent_class;
108 GType laugh_timing_container_get_type (void) G_GNUC_CONST;
110 LaughTiming *laugh_timing_new ();
112 LaughTiming *laugh_timing_new_from_string (const gchar *value);
114 LaughNode *laugh_timing_container_new (LaughDocument *doc, LaughNodeTagId id,
115 GHashTable *attributes);
117 void laugh_timing_delete (LaughTiming *timing);
119 LaughRoleTiming *laugh_timing_role_new (LaughNode *node);
121 void laugh_timing_role_delete (LaughRoleTiming *segment);
123 int laugh_timing_set_value (LaughTiming *timing, const gchar *value);
125 void laugh_timing_role_add (LaughRoleTiming *p, LaughRoleTiming *seg);
127 gboolean laugh_timing_setting_set_attribute (LaughRoleTiming *segment,
128 LaughNodeAttributeId att, const gchar *val);
130 gboolean laugh_timing_setting_start (LaughRoleTiming *segment);
132 void laugh_timing_notify (LaughRoleTiming *segment, gulong handler_id);
134 void laugh_timing_setting_stop (LaughRoleTiming *segment);
136 void laugh_timing_setting_jump (LaughNode *target);
138 G_END_DECLS
140 #endif