xoblite™ / Blackbox for Windows bb5 | RC6 preview | 0.25.2.14
http://xoblite.net/
Sounds.cpp File Reference
#include "Sounds.h"
#include "..\Blackbox.h"
#include <windows.h>
#include <mmsystem.h>

Functions

void PlaySoundFX (int sound)
 

Variables

SettingspSettings
 

Function Documentation

◆ PlaySoundFX()

void PlaySoundFX ( int sound)
41{
42 if (!pSettings->enableSoundFX) return;
43
44 if (sound < SFX_NOT_SUPPORTED)
45 {
46 char path[MAX_PATH];
47 strcpy(path, pSettings->soundsFolder);
48 strcat(path, "\\");
49
50 switch (sound)
51 {
52 case SFX_STARTUP: { strcat(path, "startup.wav"); break; }
53 case SFX_RECONFIGURE: { strcat(path, "reconfigure.wav"); break; }
54 case SFX_THEME_CHANGE: { strcat(path, "theme.wav"); break; }
55
56 case SFX_MENU_SHOW: { strcat(path, "showmenu.wav"); break; }
57 case SFX_MENU_NAVIGATE: { strcat(path, "navigatemenu.wav"); break; }
58 case SFX_MENU_SUBFOLDER: { strcat(path, "submenu.wav"); break; }
59 case SFX_MENU_CLICK: { strcat(path, "clickmenu.wav"); break; }
60 case SFX_MENU_HIDE: { strcat(path, "hidemenu.wav"); break; }
61
62 case SFX_TOGGLE_ELEMENT: { strcat(path, "toggle.wav"); break; }
63 case SFX_WORKSPACE_CHANGE: { strcat(path, "workspace.wav"); break; }
64
65 case SFX_TASKBAR_MINIMIZE: { strcat(path, "minimize.wav"); break; }
66 case SFX_TASKBAR_RESTORE: { strcat(path, "restore.wav"); break; }
67 case SFX_TASKBAR_ZOOM: { strcat(path, "zoom.wav"); break; }
68 case SFX_TASKBAR_TILE: { strcat(path, "tile.wav"); break; }
69
70 case SFX_HOTKEY: { strcat(path, "hotkey.wav"); break; }
71
72 case SFX_CLOCK_HOUR: { strcat(path, "hour.wav"); break; }
73 case SFX_CLOCK_HALFHOUR: { strcat(path, "halfhour.wav"); break; }
74
75 case SFX_LOCK_WORKSTATION: { strcat(path, "lock.wav"); break; }
76
77 // case SFX_WINDOW_SHADE: { strcat(path, "winshade.wav"); break; }
78
79 default: { return; }
80 }
81
82// if (FileExists(path)) PlaySound(path, NULL, SND_FILENAME | SND_NODEFAULT | SND_ASYNC);
83// if (FileExists(path)) PlaySound(path, NULL, SND_FILENAME | SND_NODEFAULT | SND_NOSTOP | SND_ASYNC);
84// if (FileExists(path)) PlaySound(path, NULL, SND_FILENAME | SND_NODEFAULT | SND_ASYNC | SND_SYSTEM);
85 if (FileExists(path)) PlaySound(path, NULL, SND_FILENAME | SND_NODEFAULT | SND_ASYNC | SND_NOSTOP | SND_SYSTEM);
86 }
87}
bool FileExists(LPCSTR szFileName)
Definition BBApi.cpp:819
Settings * pSettings
Definition Blackbox.cpp:46
@ SFX_CLOCK_HOUR
Definition Sounds.h:58
@ SFX_HOTKEY
Definition Sounds.h:56
@ SFX_CLOCK_HALFHOUR
Definition Sounds.h:59
@ SFX_TASKBAR_RESTORE
Definition Sounds.h:52
@ SFX_WORKSPACE_CHANGE
Definition Sounds.h:49
@ SFX_MENU_SHOW
Definition Sounds.h:42
@ SFX_LOCK_WORKSTATION
Definition Sounds.h:61
@ SFX_STARTUP
Definition Sounds.h:38
@ SFX_MENU_SUBFOLDER
Definition Sounds.h:44
@ SFX_MENU_HIDE
Definition Sounds.h:46
@ SFX_TASKBAR_TILE
Definition Sounds.h:54
@ SFX_TOGGLE_ELEMENT
Definition Sounds.h:48
@ SFX_NOT_SUPPORTED
Definition Sounds.h:63
@ SFX_THEME_CHANGE
Definition Sounds.h:40
@ SFX_TASKBAR_MINIMIZE
Definition Sounds.h:51
@ SFX_MENU_CLICK
Definition Sounds.h:45
@ SFX_RECONFIGURE
Definition Sounds.h:39
@ SFX_MENU_NAVIGATE
Definition Sounds.h:43
@ SFX_TASKBAR_ZOOM
Definition Sounds.h:53

Variable Documentation

◆ pSettings

Settings* pSettings
extern