libvisual  0.5.0
lv_bin_c.cpp
1 #include "config.h"
2 #include "lv_bin.h"
3 #include "lv_common.h"
4 
5 VisBin *visual_bin_new (void)
6 {
7  return new LV::Bin;
8 }
9 
10 void visual_bin_free (VisBin *bin)
11 {
12  delete bin;
13 }
14 
15 void visual_bin_realize (VisBin *bin)
16 {
17  visual_return_if_fail (bin != nullptr);
18 
19  bin->realize ();
20 }
21 
22 VisActor *visual_bin_get_actor (VisBin *bin)
23 {
24  visual_return_val_if_fail (bin != nullptr, nullptr);
25 
26  return bin->get_actor ().get ();
27 }
28 
29 VisInput *visual_bin_get_input (VisBin *bin)
30 {
31  visual_return_val_if_fail (bin != nullptr, nullptr);
32 
33  return bin->get_input ().get ();
34 }
35 
36 void visual_bin_set_morph (VisBin *bin, const char *morphname)
37 {
38  visual_return_if_fail (bin != nullptr);
39 
40  bin->set_morph (morphname);
41 }
42 
43 VisMorph *visual_bin_get_morph (VisBin *bin)
44 {
45  visual_return_val_if_fail (bin != nullptr, nullptr);
46 
47  return bin->get_morph ().get ();
48 }
49 
50 void visual_bin_connect (VisBin *bin, const char *actname, const char *inname)
51 {
52  visual_return_if_fail (bin != nullptr);
53 
54  bin->connect (actname, inname);
55 }
56 
57 void visual_bin_sync (VisBin *bin, int noevent)
58 {
59  visual_return_if_fail (bin != nullptr);
60 
61  bin->sync (noevent);
62 }
63 
64 void visual_bin_set_video (VisBin *bin, VisVideo *video)
65 {
66  visual_return_if_fail (bin != nullptr);
67 
68  bin->set_video (LV::VideoPtr (video));
69 }
70 
71 void visual_bin_set_supported_depth (VisBin *bin, VisVideoDepth depthflag)
72 {
73  visual_return_if_fail (bin != nullptr);
74 
75  bin->set_supported_depth (depthflag);
76 }
77 
78 void visual_bin_set_preferred_depth (VisBin *bin, VisBinDepth depth)
79 {
80  visual_return_if_fail (bin != nullptr);
81 
82  bin->set_preferred_depth (depth);
83 }
84 
85 void visual_bin_set_depth (VisBin *bin, VisVideoDepth depth)
86 {
87  visual_return_if_fail (bin != nullptr);
88 
89  bin->set_depth (depth);
90 }
91 
92 VisVideoDepth visual_bin_get_depth (VisBin *bin)
93 {
94  visual_return_val_if_fail (bin != nullptr, VISUAL_VIDEO_DEPTH_NONE);
95 
96  return bin->get_depth ();
97 }
98 
99 int visual_bin_depth_changed (VisBin *bin)
100 {
101  visual_return_val_if_fail (bin != nullptr, FALSE);
102 
103  return bin->depth_changed ();
104 }
105 
106 const VisPalette *visual_bin_get_palette (VisBin *bin)
107 {
108  visual_return_val_if_fail (bin != nullptr, nullptr);
109 
110  return &bin->get_palette ();
111 }
112 
113 void visual_bin_switch_actor (VisBin *bin, const char *actname)
114 {
115  visual_return_if_fail (bin != nullptr);
116 
117  bin->switch_actor (actname);
118 }
119 
120 void visual_bin_switch_finalize (VisBin *bin)
121 {
122  visual_return_if_fail (bin != nullptr);
123 
124  bin->switch_finalize ();
125 }
126 
127 void visual_bin_use_morph (VisBin *bin, int use)
128 {
129  visual_return_if_fail (bin != nullptr);
130 
131  bin->use_morph (use);
132 }
133 
134 void visual_bin_switch_set_time (VisBin *bin, long sec, long usec)
135 {
136  visual_return_if_fail (bin != nullptr);
137 
138  bin->switch_set_time (LV::Time (sec, usec * VISUAL_NSECS_PER_USEC));
139 }
140 
141 void visual_bin_run (VisBin *bin)
142 {
143  visual_return_if_fail (bin != nullptr);
144 
145  bin->run ();
146 }