41 Mix_FreeChunk(this->chunk);
54 SDL_RWops *src = SDL_RWFromConstMem(bytes, (
int) length);
85 self = (
Sound *) super(Object, self,
init);
103 self = release(self);
115 Resource *resource = $$(Resource, resourceWithName, name);
164#pragma mark - Class lifecycle
171 ((ObjectInterface *) clazz->interface)->dealloc =
dealloc;
173 ((SoundInterface *) clazz->interface)->initWithBytes =
initWithBytes;
174 ((SoundInterface *) clazz->interface)->initWithChunk =
initWithChunk;
179 ((SoundInterface *) clazz->interface)->soundWithBytes =
soundWithBytes;
195 clazz = _initialize(&(
const ClassDef) {
197 .superclass = _Object(),
198 .instanceSize =
sizeof(
Sound),
199 .interfaceOffset = offsetof(
Sound, interface),
200 .interfaceSize =
sizeof(SoundInterface),
static void dealloc(Object *self)
static void initialize(Class *clazz)
Sound loading and playback.
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
Font * initWithData(Font *self, Data *data, int size, int index)
Data * data
The raw font data.
Image * initWithResourceName(Image *self, const char *name)
Initializes this Image, loading the Resource by the given name.
Image * initWithBytes(Image *self, const uint8_t *bytes, size_t length)
Initializes this Image with the specified bytes.
Image * initWithResource(Image *self, const Resource *resource)
Initializes this Image with the specified Resource.
Sound loading and playback.
Sound * soundWithData(const Data *data)
Instantiates an Sound with the specified Data.
Class * _Sound(void)
The Sound archetype.
Sound * soundWithResourceName(const char *name)
Instantiates an Sound with the specified Resource name.
Mix_Chunk * chunk
The backing audio chunk.
Sound * soundWithBytes(const uint8_t *bytes, size_t length)
Instantiates an Sound with the specified bytes.
Sound * initWithChunk(Sound *, const Chunk *)
Initializes this Sound with the given audio chunk.
Sound * initWithData(Sound *, Data *)
Sound * soundWithResource(const Resource *resource)
Instantiates an Sound with the specified Resource.
Sound * soundWithChunk(Mix_Chunk *chunk)
Instantiates an Sound with the specified chunk.