Commit 325f7f07 authored by emerit's avatar emerit
Browse files

fix renderer non diegetic tests

parent e9c6cace
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ typedef enum
    CmdLnOptionId_refRotFile,
    CmdLnOptionId_customHrtfFile,
    CmdLnOptionId_renderConfigFile,
    CmdLnOptionId_noDiegeticPan,
    CmdLnOptionId_nonDiegeticPan,
    CmdLnOptionId_orientationTracking,
    CmdlnOptionId_lfePosition,
    CmdlnOptionId_lfeMatrix,
@@ -239,7 +239,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .description = "Binaural renderer configuration file (only for BINAURAL and BINAURAL_ROOM outputs)",
    },
    {
        .id = CmdLnOptionId_noDiegeticPan,
        .id = CmdLnOptionId_nonDiegeticPan,
        .match = "non_diegetic_pan",
        .matchShort = "ndp",
        .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n(todo: implementation)",
@@ -1767,7 +1767,7 @@ static void parseOption(
            assert( numOptionValues == 1 );
            strncpy( args->renderConfigFilePath, optionValues[0], RENDERER_MAX_CLI_ARG_LENGTH - 1 );
            break;
        case CmdLnOptionId_noDiegeticPan:
        case CmdLnOptionId_nonDiegeticPan:
            assert( numOptionValues == 1 );
#ifdef NON_DIEGETIC_PAN
            if ( !parseDiegeticPan( optionValues[0], &args->nonDiegeticPanGain ) )
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
*******************************************************************************************************/

#include "cmdln_parser.h"
#include "cmdl_tools.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -120,7 +121,7 @@ static int8_t stringLooksLikeOption(
    const char *str )
{
#ifdef NON_DIEGETIC_PAN
    while ( ( str[0] == '-' ) && ( ( str[1] != '0' ) && ( str[1] != '1' ) ) )
    if ( ( str[0] == '-' ) && is_number( str ) == false )
#else
    if ( str[0] == '-' )
#endif
+2 −2
Original line number Diff line number Diff line
@@ -448,13 +448,13 @@ def test_metadata(test_info, in_fmt, out_fmt):

@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["MONO"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_static(test_info, in_fmt, out_fmt, non_diegetic_pan):
    run_renderer(in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan)


@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["ISM1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
@pytest.mark.parametrize("non_diegetic_pan", ["0", "-30", "45", "90", "-90"])
def test_non_diegetic_pan_ism_static(test_info, in_fmt, out_fmt, non_diegetic_pan):
    run_renderer(in_fmt, out_fmt, non_diegetic_pan=non_diegetic_pan)