SDL_CDPlayTracks(3)
πΈ NAME πΈ
SDL_CDPlayTracks β bestie, this one plays the CD track(s) you tell it to πΏβ¨
This one lives in the SDL API Reference, section 3 of the manuals, and it's giving "let's put on some music" energy, fr fr.
β¨ SYNOPSIS β¨
#include "SDL.h"
int SDL_CDPlayTracks(SDL_CD *cdrom, int start_track, int start_frame,
int ntracks, int nframes));
π DESCRIPTION π
Okay so SDL_CDPlayTracks plays the given CD starting at track start_track, for ntracks tracks. Slay. πΆ
start_frame is the frame offset, from the beginning of the start_track, at which to start. And nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing. Basically: where you start, and where you stop. Periodt. π
And listen β you should only call SDL_CDPlayTracks after calling SDL_CDStatus to get track information about the CD. Do that first, no cap. Order matters bestie π
Note: Data tracks are ignored. Like, literally not even looked at. Bye π
π RETURN VALUE π
It returns 0, or -1 if there was an error. That's it, that's the whole vibe check. π«Ά
π¦ EXAMPLES π¦
Here's the group chat receipts, copied exactly:
/* assuming cdrom is a previously opened device */
/* Play the entire CD */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
/* Play the first track */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
/* Play first 15 seconds of the 2nd track */
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);
Look at that β whole CD, first track, or just the first 15 seconds of track 2. The range, the versatility, the main character energy πβ¨
π₯ SEE ALSO π₯
SDL_CDPlaySDL_CDStatusSDL_CD
Okay that's the whole page, bestie! This lil' cutie is from the SDL source, dated Tue 11 Sep 2001, 22:58, and it's filed under SDL_CDPlayTracks(3) in the SDL API Reference. Go play some tracks, you absolute icon ππ¦π
π¦ where this page comes from
- debian bookworm: libsdl1.2-dev 1.2.15+dfsg2-8 Β· LGPL-2.1-or-later
- nixos 26.05: SDL_sixel 0-unstable-2016-02-06
- nixpkgs unstable: SDL_sixel 0-unstable-2016-02-06
- ubuntu jammy: libsdl1.2-dev 1.2.15+dfsg2-6 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms