PageRenderTime 29ms CodeModel.GetById 21ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Core/objects/CD.xs

http://github.com/PerlGameDev/SDL
Unknown | 133 lines | 115 code | 18 blank | 0 comment | 0 complexity | e267a959c54eee027939f73b114d5ef0 MD5 | raw file
  1#include "EXTERN.h"
  2#include "perl.h"
  3#include "XSUB.h"
  4#include "ppport.h"
  5
  6#ifndef aTHX_
  7#define aTHX_
  8#endif
  9
 10#include <SDL.h>
 11
 12MODULE = SDL::CD 	PACKAGE = SDL::CD    PREFIX = cdr_
 13
 14SDL_CD *
 15cdr_new ( CLASS, drive )
 16	char* CLASS
 17	int drive
 18	CODE:
 19		RETVAL = SDL_CDOpen(drive);
 20	OUTPUT:
 21		RETVAL
 22
 23
 24Uint32
 25cdr_status ( cd )
 26	SDL_CD *cd 
 27	CODE:
 28		RETVAL = SDL_CDStatus(cd);
 29	OUTPUT:
 30		RETVAL
 31
 32int
 33cdr_play_tracks ( cd, start_track, ntracks, start_frame, nframes )
 34	SDL_CD *cd
 35	int start_track
 36	int ntracks
 37	int start_frame
 38	int nframes
 39	CODE:
 40		RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
 41	OUTPUT:
 42		RETVAL
 43
 44int
 45cdr_play ( cd, start, length )
 46	SDL_CD *cd
 47	int start
 48	int length
 49	CODE:
 50		RETVAL = SDL_CDPlay(cd,start,length);
 51	OUTPUT:
 52		RETVAL
 53
 54int
 55cdr_pause ( cd )
 56	SDL_CD *cd
 57	CODE:
 58		RETVAL = SDL_CDPause(cd);
 59	OUTPUT:
 60		RETVAL
 61
 62int
 63cdr_resume ( cd )
 64	SDL_CD *cd
 65	CODE:
 66		RETVAL = SDL_CDResume(cd);
 67	OUTPUT:
 68		RETVAL
 69
 70int
 71cdr_stop ( cd )
 72	SDL_CD *cd
 73	CODE:
 74		RETVAL = SDL_CDStop(cd);
 75	OUTPUT:
 76		RETVAL
 77
 78int
 79cdr_eject ( cd )
 80	SDL_CD *cd
 81	CODE:
 82		RETVAL = SDL_CDEject(cd);
 83	OUTPUT:
 84		RETVAL
 85
 86int
 87cdr_id ( cd )
 88	SDL_CD *cd
 89	CODE:
 90		RETVAL = cd->id;
 91	OUTPUT: 
 92		RETVAL
 93
 94int
 95cdr_num_tracks ( cd )
 96	SDL_CD *cd
 97	CODE:
 98		RETVAL = cd->numtracks;
 99	OUTPUT:
100		RETVAL
101
102int
103cdr_cur_track ( cd )
104	SDL_CD *cd
105	CODE:
106		RETVAL = cd->cur_track;
107	OUTPUT:
108		RETVAL
109
110int
111cdr_cur_frame ( cd )
112	SDL_CD *cd
113	CODE:
114		RETVAL = cd->cur_frame;
115	OUTPUT:
116		RETVAL
117
118SDL_CDtrack *
119cdr_track ( cd, number )
120	SDL_CD *cd
121	int number
122	PREINIT:
123		char* CLASS = "SDL::CDTrack";
124	CODE:
125		RETVAL = (SDL_CDtrack *)(cd->track + number);
126	OUTPUT:
127		RETVAL
128
129void
130cdr_DESTROY ( cd )
131	SDL_CD *cd
132	CODE:
133		SDL_CDClose(cd);