add an interface for sound libraries

Groundwork for a more versatile interface for using
sound libraries. A lot of sound libraries work across
multiple platforms.

The current NetHack sound stuff is quite limited.

Binaries can have a variety of window ports linked into
them, and it makes sense to have something similar for
sound.

This tries to set things up in a more soundlib-centric way,
rather than inserting things in a platform-centric way.

It establishes a new top-level directory sound (akin to win
for the window interface routines, or "window-port") where
sound-related additions and sndprocs and support files can be
added and used across platforms.

The default interface is nosound and the 'nosound' interface
is in src/sounds.c

The interface for 'windsound', which contains the same minimal
USER_SOUNDS support using built-in routines that has been in the
windows port for a long time is added to
sound/windsound/windsound.c.

For now, the sound interface support for 'qtsound' has been added
to the existing Qt files win/Qt/qt_bind.h and win/Qt/qt_bind.cpp,
and a note has been placed in sound/qtsound/README.md to avoid
confusion.

New header file added: include/sndprocs.h.
This commit is contained in:
nhmall
2023-01-19 18:51:42 -05:00
parent 6e49372d8f
commit ea4a81901d
24 changed files with 705 additions and 85 deletions
+12 -1
View File
@@ -36,6 +36,9 @@ private:
public:
static void qt_Splash();
/* window interface */
static void qt_init_nhwindows(int* argc, char** argv);
static void qt_player_selection();
static void qt_askname();
@@ -90,8 +93,16 @@ public:
static int qt_kbhit();
static void qt_update_inventory(int);
static win_request_info *qt_ctrl_nhwindow(winid, int, win_request_info *);
static QWidget *mainWidget() { return main; }
#if defined(SND_LIB_QTSOUND) && !defined(QT_NO_SOUND)
/* sound interface */
static void qtsound_init_nhsound(void);
static void qtsound_exit_nhsound(const char *);
static void qtsound_achievement(schar, schar, int32_t);
static void qtsound_soundeffect(char *, int32_t, int32_t);
static void qtsound_hero_playnotes(int32_t instrument, char *str, int32_t volume);
static void qtsound_play_usersound(char *, int32_t, int32_t);
#endif
private:
virtual bool notify(QObject *receiver, QEvent *event);