Refactor for testing

Added basic decoding functionality to test.

Refactored some code to stop 3DS specific code from compiling on
GNU/Linux.

Tested working by running the test executable on GNU/Linux. Vorbis
decoding has many errors detected by valgrind (but still decodes
successfully).
Opus, flac, and mp3 decoding work without errors.

Signed-off-by: Mahyar Koshkouei <mk@deltabeard.com>
This commit is contained in:
Mahyar Koshkouei
2017-08-14 23:14:45 +01:00
parent 11d7bede77
commit ef0289bceb
8 changed files with 190 additions and 105 deletions

25
source/file.h Normal file
View File

@@ -0,0 +1,25 @@
enum file_types
{
FILE_TYPE_ERROR = 0,
FILE_TYPE_WAV,
FILE_TYPE_FLAC,
FILE_TYPE_VORBIS,
FILE_TYPE_OPUS,
FILE_TYPE_MP3
};
/**
* Obtain file type string from file_types enum.
*
* \param ft File type enum.
* \return String representation of enum.
*/
const char* fileToStr(enum file_types ft);
/**
* Obtains file type.
*
* \param file File location.
* \return file_types enum or 0 on error and errno set.
*/
enum file_types getFileType(const char *file);