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
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
;
62 LaughTimingUnknown
= -1,
63 LaughTimingTime
= 0, LaughTimingIndefinite
, LaughTimingMedia
,
64 LaughTimingActivated
, LaughTimingInbounds
, LaughTimingOutbounds
,
65 LaughTimingEndSync
, LaughTimingStartSync
76 struct _LaughRoleTiming
81 /*TODO: begin and end should support multiple events, make a list*/
87 gulong start_time_stamp
;
90 LaughRoleTiming
*parent
;
93 struct _LaughTimingContainer
98 LaughRoleTiming
*timing_role
;
101 LaughTimingContainerPrivate
*priv
;
104 struct _LaughTimingContainerClass
106 LaughNodeClass parent_class
;
109 GType
laugh_timing_container_get_type (void) G_GNUC_CONST
;
111 LaughTiming
*laugh_timing_new ();
113 LaughTiming
*laugh_timing_new_from_string (const gchar
*value
);
115 LaughNode
*laugh_timing_container_new (LaughDocument
*doc
, LaughNodeTagId id
,
116 GHashTable
*attributes
);
118 void laugh_timing_delete (LaughTiming
*timing
);
120 LaughRoleTiming
*laugh_timing_role_new (LaughNode
*node
);
122 void laugh_timing_role_delete (LaughRoleTiming
*segment
);
124 int laugh_timing_set_value (LaughTiming
*timing
, const gchar
*value
);
126 void laugh_timing_role_add (LaughRoleTiming
*p
, LaughRoleTiming
*seg
);
128 gboolean
laugh_timing_setting_set_attribute (LaughRoleTiming
*segment
,
129 LaughNodeAttributeId att
, const gchar
*val
);
131 gboolean
laugh_timing_setting_start (LaughRoleTiming
*segment
);
133 void laugh_timing_notify (LaughRoleTiming
*segment
, gulong handler_id
);
135 void laugh_timing_setting_stop (LaughRoleTiming
*segment
);
137 void laugh_timing_setting_jump (LaughNode
*target
);