index 541f31a908239b7e0d05417ab52cfe1394279bbc..4d2e93d25260243e34c6228fb59c4b40cb9ba652 100644 (file)
+(* Copyright (C) DooM 2D:Forever Developers
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *)
interface
uses
sdl2,
SDL2_mixer,
+ mempool,
e_log,
SysUtils;
nRefs: Integer;
end;
- TBasicSound = class (TObject)
+ TBasicSound = class(TPoolObject)
private
FChanNum: Integer; // <0: no channel allocated
const
NO_SOUND_ID = DWORD(-1);
-function e_InitSoundSystem(): Boolean;
+function e_InitSoundSystem(NoOutput: Boolean = False): Boolean;
function e_LoadSound(FileName: string; var ID: DWORD; isMusic: Boolean): Boolean;
function e_LoadSoundMem(pData: Pointer; Length: Integer; var ID: DWORD; isMusic: Boolean): Boolean;
end;
end;
-function e_InitSoundSystem(): Boolean;
+function e_InitSoundSystem(NoOutput: Boolean = False): Boolean;
var
res, i: Integer;
rfreq: Integer;
Result := False;
SoundInitialized := False;
+ if NoOutput then begin Result := true; Exit end;
+
// wow, this is actually MIDI player!
// we need module player
res := Mix_Init(MIX_INIT_FLAC or MIX_INIT_MOD or MIX_INIT_MODPLUG or MIX_INIT_MP3 or MIX_INIT_OGG or MIX_INIT_FLUIDSYNTH);