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.
28 #include "laugh-dom.h"
30 #include <glib/gprintf.h>
31 #include <clutter/clutter-main.h>
32 #include <clutter/clutter-stage.h>
34 void dump_timings (LaughTimingSegment
*segment
)
36 GSList
*s
= segment
->sub_segments
;
37 gboolean first
= TRUE
;
39 g_printf ("%s[", laugh_tag_from_id (segment
->node
->id
));
41 for ( ; s
; s
= s
->next
) {
42 GSList
*s1
= (GSList
*) s
->data
;
43 gboolean sub_first
= TRUE
;
48 for ( ; s1
; s1
= s1
->next
) {
53 dump_timings ((LaughTimingSegment
*) s1
->data
);
59 void initialized_callback (LaughNode
*node
, gpointer d
)
61 gchar
*xml
= laugh_node_get_inner_xml (node
);
62 g_printf ("cb initialized\n%s\n", xml
);
63 dump_timings (((LaughDocument
*)node
)->timing
);
69 int main (int argc
, char **argv
)
72 LaughInitializer
*initializer
;
77 g_printerr ("usage %s uri\n", argv
[0]);
82 clutter_init (&argc
, &argv
);
83 /*gst_init (&argc, &argv);*/
85 stage
= clutter_stage_get_default ();
86 clutter_actor_get_size (stage
, &width
, &height
);
87 initializer
= laugh_dom_initializer_new (CLUTTER_CONTAINER (stage
),
90 doc
= laugh_document_new (argv
[1]);
92 g_signal_connect (G_OBJECT (doc
), "initialized",
93 (GCallback
) initialized_callback
, (gpointer
) 0);
95 laugh_node_init (LAUGH_NODE (doc
), initializer
);
97 clutter_actor_show_all (stage
);
101 g_object_unref (G_OBJECT (doc
));
102 g_free (initializer
);