ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Data Structures | Functions | Variables
SoundStage.h File Reference

Sound playback. More...

#include <ObjectivelyMVC/Sound.h>

Go to the source code of this file.

Data Structures

struct  SoundStage
 The SoundStage type. More...
 

Functions

OBJECTIVELYMVC_EXPORT Class * _SoundStage (void)
 
OBJECTIVELYMVC_EXPORT void MVC_PlaySound (const Sound *sound)
 Plays the specified Sound through the current SoundStage (if any). More...
 

Variables

OBJECTIVELYMVC_EXPORT Sound_clack
 
OBJECTIVELYMVC_EXPORT Sound_click
 

Detailed Description

Sound playback.

Definition in file SoundStage.h.

Function Documentation

◆ _SoundStage()

OBJECTIVELYMVC_EXPORT Class * _SoundStage ( void  )

Definition at line 120 of file SoundStage.c.

120 {
121 static Class *clazz;
122 static Once once;
123
124 do_once(&once, {
125 clazz = _initialize(&(const ClassDef) {
126 .name = "SoundStage",
127 .superclass = _Object(),
128 .instanceSize = sizeof(SoundStage),
129 .interfaceOffset = offsetof(SoundStage, interface),
130 .interfaceSize = sizeof(SoundStageInterface),
132 .destroy = destroy,
133 });
134 });
135
136 return clazz;
137}
static void destroy(Class *clazz)
Definition: SoundStage.c:108
static void initialize(Class *clazz)
Definition: SoundStage.c:91
The SoundStage type.
Definition: SoundStage.h:40

◆ MVC_PlaySound()

OBJECTIVELYMVC_EXPORT void MVC_PlaySound ( const Sound sound)

Plays the specified Sound through the current SoundStage (if any).

Parameters
soundThe Sound to play.
Remarks
This is a convenience function, allowing Views to emit sounds in an ad-hoc way, without obtaining a reference to the SoundStage.

Definition at line 141 of file SoundStage.c.

141 {
142
143 SDL_Window *window = SDL_GL_GetCurrentWindow();
144 assert(window);
145
147 assert(windowController);
149
150 $(windowController->soundStage, play, sound);
151}
void play(const SoundStage *self, const char *sound)
Enqueues the given Sound for playback.
A WindowController manages a ViewController and its descendants within an SDL_Window.
WindowController * windowController(SDL_Window *window)
SoundStage * soundStage
The SoundStage.

Variable Documentation

◆ _clack

Definition at line 100 of file SoundStage.h.

◆ _click

Definition at line 99 of file SoundStage.h.