2020-07-17 19:15:35 +02:00
|
|
|
/* derived from nwatowav.cc 2007.7.28 version, which read: */
|
2008-08-03 16:58:03 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2007 jagarl / Kazunori Ueno <jagarl@creator.club.ne.jp>
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted.
|
|
|
|
*
|
2017-03-13 06:19:22 +01:00
|
|
|
* このプログラムの作者は jagarl です。
|
2008-08-03 16:58:03 +02:00
|
|
|
*
|
2017-03-13 06:19:22 +01:00
|
|
|
* このプログラム、及びコンパイルによって生成したバイナリは
|
|
|
|
* プログラムを変更する、しないにかかわらず再配布可能です。
|
|
|
|
* その際、上記 Copyright 表示を保持するなどの条件は課しま
|
|
|
|
* せん。対応が面倒なのでバグ報告を除き、メールで連絡をする
|
|
|
|
* などの必要もありません。ソースの一部を流用することを含め、
|
|
|
|
* ご自由にお使いください。
|
2008-08-03 16:58:03 +02:00
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY KAZUNORI 'jagarl' UENO ``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 KAZUNORI UENO 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 _NWA_DECODER_H
|
|
|
|
#define _NWA_DECODER_H
|
|
|
|
|
|
|
|
#include "../streamfile.h"
|
|
|
|
|
2020-07-17 19:15:35 +02:00
|
|
|
typedef struct NWAData_s {
|
2008-08-03 16:58:03 +02:00
|
|
|
int channels;
|
2020-07-17 19:15:35 +02:00
|
|
|
int bps; /* bits per sample */
|
|
|
|
int freq; /* samples per second */
|
|
|
|
|
|
|
|
int complevel; /* compression level */
|
|
|
|
int dummy; /* ? : 0x00 */
|
|
|
|
|
|
|
|
int blocks; /* block count */
|
|
|
|
int datasize; /* all data size */
|
|
|
|
|
|
|
|
int compdatasize; /* compressed data size */
|
|
|
|
int samplecount; /* all samples */
|
|
|
|
int blocksize; /* samples per block */
|
|
|
|
int restsize; /* samples of the last block */
|
|
|
|
int dummy2; /* ? : 0x89 */
|
2008-08-03 16:58:03 +02:00
|
|
|
|
|
|
|
int curblock;
|
2020-07-17 19:15:35 +02:00
|
|
|
off_t* offsets;
|
|
|
|
int filesize;
|
2008-08-03 16:58:03 +02:00
|
|
|
|
2020-07-17 19:15:35 +02:00
|
|
|
int use_runlength; //extra
|
2008-08-03 16:58:03 +02:00
|
|
|
|
2020-07-17 19:15:35 +02:00
|
|
|
uint8_t *tmpdata;
|
|
|
|
int16_t *outdata;
|
|
|
|
int16_t *outdata_readpos;
|
2008-08-03 16:58:03 +02:00
|
|
|
int samples_in_buffer;
|
|
|
|
} NWAData;
|
|
|
|
|
2020-07-17 19:15:35 +02:00
|
|
|
NWAData* nwalib_open(STREAMFILE* sf);
|
|
|
|
void nwalib_close(NWAData* nwa);
|
|
|
|
int nwalib_decode(STREAMFILE* sf, NWAData* nwa);
|
|
|
|
void nwalib_seek(STREAMFILE* sf, NWAData* nwa, int32_t seekpos);
|
|
|
|
void nwalib_reset(NWAData* nwa);
|
2008-08-03 16:58:03 +02:00
|
|
|
|
|
|
|
#endif
|