Permalink
Browse files

cleanup

  • Loading branch information...
1 parent 01dc406 commit ae2693750d5370e99e6971b557e85704f9cad068 @FROGGS FROGGS committed Aug 26, 2012
Showing with 14 additions and 9 deletions.
  1. +14 −9 lib/SDL/Mixer/Channels.pm6
View
@@ -3,14 +3,19 @@ module SDL::Mixer::Channels;
use NativeCall;
-our sub volume( int, int ) returns Int is native('libSDL_mixer') is symbol('Mix_Volume') { * }
-our sub allocate( int ) returns Int is native('libSDL_mixer') is symbol('Mix_AllocateChannels') { * }
-our sub finished( Code &callback(int) ) returns Int is native('libSDL_mixer') is symbol('Mix_ChannelFinished') { * }
-our sub play( $channel, $sample, $loops, $time = -1 ) returns Int { return _play( $channel, $sample, $loops, $time ); }
-our sub _play( int, OpaquePointer, int, int ) returns Int is native('libSDL_mixer') is symbol('Mix_PlayChannelTimed') { * }
-our sub halt( int ) returns Int is native('libSDL_mixer') is symbol('Mix_HaltChannel') { * }
-our sub playing( int ) returns Int is native('libSDL_mixer') is symbol('Mix_Playing') { * }
-our sub paused( int ) returns Int is native('libSDL_mixer') is symbol('Mix_Paused') { * }
-our sub fading( int ) returns Int is native('libSDL_mixer') is symbol('Mix_FadingChannel') { * }
+# native calls to libSDL_mixer
+# Note: 'is symbol' we be called 'is named' in future
+our sub volume( int, int ) returns Int is native('libSDL_mixer') is symbol('Mix_Volume') { * }
+our sub allocate( int ) returns Int is native('libSDL_mixer') is symbol('Mix_AllocateChannels') { * }
+our sub finished( Code &callback(int) ) returns Int is native('libSDL_mixer') is symbol('Mix_ChannelFinished') { * }
+our sub _play( int, OpaquePointer, int, int ) returns Int is native('libSDL_mixer') is symbol('Mix_PlayChannelTimed') { * }
+our sub halt( int ) returns Int is native('libSDL_mixer') is symbol('Mix_HaltChannel') { * }
+our sub playing( int ) returns Int is native('libSDL_mixer') is symbol('Mix_Playing') { * }
+our sub paused( int) returns Int is native('libSDL_mixer') is symbol('Mix_Paused') { * }
+our sub fading( int ) returns Int is native('libSDL_mixer') is symbol('Mix_FadingChannel') { * }
+
+# wrappers (for example to support optional parameters)
+# Note: dont use typed parameters here
+our sub play( $channel, $sample, $loops, $time = -1 ) returns Int { _play( $channel, $sample, $loops, $time ) }
1;

0 comments on commit ae26937

Please sign in to comment.