]>
Dogcows Code - chaz/yoink/blob - src/moof/sound_bindings.cc
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
19 static int sound_new(script
& script
)
21 script::slot name
= script
[2].require_string("sound name");
26 script
.push(sound(str
));
30 static int sound_enqueue(script
& script
)
33 script
[1].require_object
<moof::sound
>("sound").get(sound
);
36 script
[2].require_string("sound name").get(name
);
42 static int sound_play(script
& script
)
45 script
[1].require_object
<moof::sound
>("sound").get(sound
);
50 static int sound_stop(script
& script
)
53 script
[1].require_object
<moof::sound
>("sound").get(sound
);
58 static int sound_pause(script
& script
)
61 script
[1].require_object
<moof::sound
>("sound").get(sound
);
66 static int sound_rewind(script
& script
)
69 script
[1].require_object
<moof::sound
>("sound").get(sound
);
74 static int sound_toggle(script
& script
)
77 script
[1].require_object
<moof::sound
>("sound").get(sound
);
82 static int sound_is_playing(script
& script
)
85 script
[1].require_object
<moof::sound
>("sound").get(sound
);
86 script
.push(sound
->is_playing());
91 void sound::import(script
& script
, const std::string
& nspace
)
93 script
.check_stack(4);
95 script::slot parent
= script
.push_table(nspace
);
96 script::slot meta
= script
.push_class
<sound
>(sound_new
);
98 meta
.set_field("enqueue", sound_enqueue
);
99 meta
.set_field("play", sound_play
);
100 meta
.set_field("stop", sound_stop
);
101 meta
.set_field("pause", sound_pause
);
102 meta
.set_field("rewind", sound_rewind
);
103 meta
.set_field("toggle", sound_toggle
);
104 meta
.set_field("is_playing", sound_is_playing
);
106 parent
.set_field("sound");
This page took 0.039481 seconds and 5 git commands to generate.