1: /*
     2:  ============================================================================
     3:  xoblite™ -> an advanced "extended shell" for Microsoft® Windows® 11
     4:  Copyright © 2002-2026 Karl Henrik Henriksson [qwilk/@xoblite]
     5:  Copyright © 2001-2004 The Blackbox for Windows Development Team
     6:  http://xoblite.net/ + https://github.com/xoblite/
     7:  ============================================================================
     8: 
     9:   Blackbox for Windows is free software, released under the
    10:   GNU General Public License (GPL version 2 or later), with an extension
    11:   that allows linking of proprietary modules under a controlled interface.
    12:   What this means is that plugins etc. are allowed to be released
    13:   under any license the author wishes. Please note, however, that the
    14:   original Blackbox gradient math code used in Blackbox for Windows
    15:   is available under the BSD license.
    16: 
    17:   http://www.fsf.org/licenses/gpl.html
    18:   http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
    19:   http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
    20: 
    21:   This program is distributed in the hope that it will be useful,
    22:   but WITHOUT ANY WARRANTY; without even the implied warranty of
    23:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    24:   GNU General Public License for more details.
    25: 
    26:   For additional license information, please read the included license.html.
    27: 
    28:  ============================================================================
    29: */
    30: 
    31: #include "Sounds.h" 
    32: #include "..\Blackbox.h" 
    33: #include <windows.h> 
    34: #include <mmsystem.h> 
    35: 
    36: extern Settings* pSettings;
    37: 
    38: //===========================================================================
    39: 
    40: 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_s(path, sizeofArray(path), pSettings->soundsFolder);
    48:         strcat_s(path, sizeofArray(path), "\\");
    49: 
    50:         switch (sound)
    51:         {
    52:             case SFX_STARTUP:           { strcat_s(path, sizeofArray(path), "startup.wav"); break; }
    53:             case SFX_RECONFIGURE:       { strcat_s(path, sizeofArray(path), "reconfigure.wav"); break; }
    54:             case SFX_THEME_CHANGE:      { strcat_s(path, sizeofArray(path), "theme.wav"); break; }
    55: 
    56:             case SFX_MENU_SHOW:         { strcat_s(path, sizeofArray(path), "showmenu.wav"); break; }
    57:             case SFX_MENU_NAVIGATE:     { strcat_s(path, sizeofArray(path), "navigatemenu.wav"); break; }
    58:             case SFX_MENU_SUBFOLDER:    { strcat_s(path, sizeofArray(path), "submenu.wav"); break; }
    59:             case SFX_MENU_CLICK:        { strcat_s(path, sizeofArray(path), "clickmenu.wav"); break; }
    60:             case SFX_MENU_HIDE:         { strcat_s(path, sizeofArray(path), "hidemenu.wav"); break; }
    61: 
    62:             case SFX_TOGGLE_ELEMENT:    { strcat_s(path, sizeofArray(path), "toggle.wav"); break; }
    63:             case SFX_WORKSPACE_CHANGE:  { strcat_s(path, sizeofArray(path), "workspace.wav"); break; }
    64: 
    65:             case SFX_TASKBAR_MINIMIZE:  { strcat_s(path, sizeofArray(path), "minimize.wav"); break; }
    66:             case SFX_TASKBAR_RESTORE:   { strcat_s(path, sizeofArray(path), "restore.wav"); break; }
    67:             case SFX_TASKBAR_ZOOM:      { strcat_s(path, sizeofArray(path), "zoom.wav"); break; }
    68:             case SFX_TASKBAR_TILE:      { strcat_s(path, sizeofArray(path), "tile.wav"); break; }
    69: 
    70:             case SFX_HOTKEY:            { strcat_s(path, sizeofArray(path), "hotkey.wav"); break; }
    71: 
    72:             case SFX_CLOCK_HOUR:        { strcat_s(path, sizeofArray(path), "hour.wav"); break; }
    73:             case SFX_CLOCK_HALFHOUR:    { strcat_s(path, sizeofArray(path), "halfhour.wav"); break; }
    74: 
    75:             case SFX_LOCK_WORKSTATION:  { strcat_s(path, sizeofArray(path), "lock.wav"); break; }
    76: 
    77:             // case SFX_WINDOW_SHADE:       { strcat_s(path, sizeofArray(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: }
    88: 
    89: //===========================================================================
    90: