From 6558578f5423b3e1f072a4a06e12a51f48e91102 Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Mon, 11 Sep 2017 03:06:45 +0200 Subject: AUDIO: Import micromod code, xm/s3m/mod decoder --- audio/mods/mod_xm_s3m.h | 92 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 audio/mods/mod_xm_s3m.h (limited to 'audio/mods/mod_xm_s3m.h') diff --git a/audio/mods/mod_xm_s3m.h b/audio/mods/mod_xm_s3m.h new file mode 100644 index 0000000000..904adae952 --- /dev/null +++ b/audio/mods/mod_xm_s3m.h @@ -0,0 +1,92 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This code is based on IBXM mod player + * + * Copyright (c) 2015, Martin Cameron + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the + * following conditions are met: + * + * * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * * Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * * Neither the name of the organization nor the names of + * its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef AUDIO_MODS_MOD_XM_S3M_H +#define AUDIO_MODS_MOD_XM_S3M_H + +namespace Common { +class SeekableReadStream; +} + +namespace Audio { + +class AudioStream; + +/* + * Factory function for ModXmS3mStream streams. Reads all data from the + * given ReadStream and creates an AudioStream from this. No reference + * to the 'stream' object is kept, so you can safely delete it after + * invoking this factory. + * + * @param stream the ReadStream from which to read the tracker sound data + * @param disposeAfterUse whether to delete the stream after use + * @param rate sample rate + * @param interpolation interpolation effect level + */ +AudioStream *makeModXmS3mStream(Common::SeekableReadStream *stream, + DisposeAfterUse::Flag disposeAfterUse, + int rate = 48000, int interpolation = 0); + +} // End of namespace Audio + +#endif -- cgit v1.2.3