The theme directory is the unit: a second theme Base (the lower voice of Camouflage) sits beside it. The Sound pane lists the directories found next to the current theme; a click sends McdeSoundSetTheme, which writes the path into _MCDE_SOUND_THEME and sends _MCDE_SOUND_RELOAD; the server reads the property and reloads (McdeSoundLoadTheme). Measured: click on Base -> daemon log 'theme now .../Base', the next Launch plays .../Base/launch.wav; screenshot settings-sound3.png.
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
/*
|
|
* Sound.h -- MCDE: desktop events and sound themes
|
|
*
|
|
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
|
|
*
|
|
* A program names an event ("Launch", "OpenFolder", ...) and the session's
|
|
* sound server plays it. The theme is an X-Resource file: *<Event>.soundfile
|
|
* names a file next to it (docs/MCDE-PROGRAMS.md A1-A4).
|
|
*/
|
|
#ifndef _Mcde_Sound_h
|
|
#define _Mcde_Sound_h
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
/* read the theme; returns 0 on success, -1 if none was found */
|
|
int McdeSoundInit(void);
|
|
|
|
/* the file of an event, or NULL; the name is the theme's (Launch, Beep) */
|
|
const char * McdeSoundFile(const char *event);
|
|
|
|
/* the theme directory (for the daemon's relative file names) */
|
|
const char * McdeSoundThemeDir(void);
|
|
|
|
/* load another theme directory (the server's side of a theme change) */
|
|
int McdeSoundLoadTheme(const char *dir);
|
|
|
|
/* ask the running server to load DIR; returns 0 when it took it */
|
|
int McdeSoundSetTheme(Display *dpy, const char *dir);
|
|
|
|
/* how many events the theme names, and their names (for a settings list) */
|
|
int McdeSoundCount(void);
|
|
const char * McdeSoundEventName(int i);
|
|
|
|
/*
|
|
* Send the event to the session's server. Returns 0 when the server took it,
|
|
* 1 when no server runs -- the caller may then play it itself.
|
|
*/
|
|
int McdeSoundEvent(Display *dpy, const char *event);
|
|
|
|
/* play one file; without a sound server the X bell answers (daemon side) */
|
|
int McdeSoundPlay(Display *dpy, const char *path);
|
|
|
|
#endif /* _Mcde_Sound_h */
|