From 97d09b4ceeec19c6230c764fd4267325d2be4ce3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 20 Aug 2017 16:54:08 -0700 Subject: [PATCH] Remove the -m command from makehrtf It only ever outputs mhr files, so there's no need to have a command for it. If another output format is ever made, it can be a normal option flag. --- utils/makehrtf.c | 59 ++++++++++++------------------------------------ 1 file changed, 15 insertions(+), 44 deletions(-) diff --git a/utils/makehrtf.c b/utils/makehrtf.c index e7dd34c3..20fbbe82 100644 --- a/utils/makehrtf.c +++ b/utils/makehrtf.c @@ -300,12 +300,6 @@ typedef enum HeadModelT { HM_SPHERE // Calculate the onset using a spherical head model. } HeadModelT; -// Desired output format from the command line. -typedef enum OutputFormatT { - OF_NONE, - OF_MHR // OpenAL Soft MHR data set file. -} OutputFormatT; - // Unsigned integer type. typedef unsigned int uint; @@ -2809,13 +2803,14 @@ error: * resulting data set as desired. If the input name is NULL it will read * from standard input. */ -static int ProcessDefinition(const char *inName, const uint outRate, const uint fftSize, const int equalize, const int surface, const double limit, const uint truncSize, const HeadModelT model, const double radius, const OutputFormatT outFormat, const int experimental, const char *outName) +static int ProcessDefinition(const char *inName, const uint outRate, const uint fftSize, const int equalize, const int surface, const double limit, const uint truncSize, const HeadModelT model, const double radius, const int experimental, const char *outName) { char rateStr[8+1], expName[MAX_PATH_LEN]; TokenReaderT tr; HrirDataT hData; double *dfa; FILE *fp; + int ret; hData.mIrRate = 0; hData.mSampleType = ST_S24; @@ -2889,33 +2884,19 @@ static int ProcessDefinition(const char *inName, const uint outRate, const uint CalculateHrtds(model, (radius > DEFAULT_CUSTOM_RADIUS) ? radius : hData.mRadius, &hData); snprintf(rateStr, 8, "%u", hData.mIrRate); StrSubst(outName, "%r", rateStr, MAX_PATH_LEN, expName); - switch(outFormat) - { - case OF_MHR: - fprintf(stdout, "Creating MHR data set file...\n"); - if(!StoreMhr(&hData, experimental, expName)) - { - DestroyArray(hData.mHrtds); - DestroyArray(hData.mHrirs); - return 0; - } - break; - default: - break; - } + fprintf(stdout, "Creating MHR data set file...\n"); + ret = StoreMhr(&hData, experimental, expName); + DestroyArray(hData.mHrtds); DestroyArray(hData.mHrirs); - return 1; + return ret; } static void PrintHelp(const char *argv0, FILE *ofile) { fprintf(ofile, "Usage: %s [