Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4245cea authored by Rivukanta Bhattacharya's avatar Rivukanta Bhattacharya
Browse files

libeffects: Test treble module with treble level

Bug: 183674870
Test: lvm/tests/build_and_run_all_unit_tests.sh

Change-Id: I1e630551fb5c6855759a3dc27deb9d5d42019c8b
parent 08d9d325
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -53,16 +53,16 @@ fi
flags_arr=(
flags_arr=(
    "-csE"
    "-csE"
    "-eqE"
    "-eqE"
    "-tE"
    "-tE -trebleLvl:15"
    "-csE -tE -eqE"
    "-csE -tE -trebleLvl:15 -eqE"
    "-bE -M"
    "-bE -M"
    "-csE -tE"
    "-csE -tE -trebleLvl:15"
    "-csE -eqE" "-tE -eqE"
    "-csE -eqE" "-tE -trebleLvl:15 -eqE"
    "-csE -tE -bE -M -eqE"
    "-csE -tE -trebleLvl:15 -bE -M -eqE"
    "-tE -eqE -vcBal:96 -M"
    "-tE -trebleLvl:15 -eqE -vcBal:96 -M"
    "-tE -eqE -vcBal:-96 -M"
    "-tE -trebleLvl:15 -eqE -vcBal:-96 -M"
    "-tE -eqE -vcBal:0 -M"
    "-tE -trebleLvl:15 -eqE -vcBal:0 -M"
    "-tE -eqE -bE -vcBal:30 -M"
    "-tE -trebleLvl:15 -eqE -bE -vcBal:30 -M"
)
)


fs_arr=(
fs_arr=(
+11 −4
Original line number Original line Diff line number Diff line
@@ -79,6 +79,7 @@ struct lvmConfigParams_t {
    int bassEffectLevel = 0;
    int bassEffectLevel = 0;
    int eqPresetLevel = 0;
    int eqPresetLevel = 0;
    int frameLength = 256;
    int frameLength = 256;
    int trebleEffectLevel = 0;
    LVM_BE_Mode_en bassEnable = LVM_BE_OFF;
    LVM_BE_Mode_en bassEnable = LVM_BE_OFF;
    LVM_TE_Mode_en trebleEnable = LVM_TE_OFF;
    LVM_TE_Mode_en trebleEnable = LVM_TE_OFF;
    LVM_EQNB_Mode_en eqEnable = LVM_EQNB_OFF;
    LVM_EQNB_Mode_en eqEnable = LVM_EQNB_OFF;
@@ -303,10 +304,6 @@ int LvmBundle_init(struct EffectContext* pContext, LVM_ControlParams_t* params)
    params->PSA_Enable = LVM_PSA_OFF;
    params->PSA_Enable = LVM_PSA_OFF;
    params->PSA_PeakDecayRate = LVM_PSA_SPEED_MEDIUM;
    params->PSA_PeakDecayRate = LVM_PSA_SPEED_MEDIUM;


    /* TE Control parameters */
    params->TE_OperatingMode = LVM_TE_OFF;
    params->TE_EffectLevel = 0;

    /* Activate the initial settings */
    /* Activate the initial settings */
    LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, params);
    LvmStatus = LVM_SetControlParameters(pContext->pBundledContext->hInstance, params);


@@ -445,6 +442,7 @@ int lvmControl(struct EffectContext* pContext, lvmConfigParams_t* plvmConfigPara


    /* Treble Enhancement parameters */
    /* Treble Enhancement parameters */
    params->TE_OperatingMode = plvmConfigParams->trebleEnable;
    params->TE_OperatingMode = plvmConfigParams->trebleEnable;
    params->TE_EffectLevel = plvmConfigParams->trebleEffectLevel;


    /* PSA Control parameters */
    /* PSA Control parameters */
    params->PSA_Enable = LVM_PSA_ON;
    params->PSA_Enable = LVM_PSA_ON;
@@ -604,6 +602,15 @@ int main(int argc, const char* argv[]) {
                return -1;
                return -1;
            }
            }
            lvmConfigParams.eqPresetLevel = eqPresetLevel;
            lvmConfigParams.eqPresetLevel = eqPresetLevel;
        } else if (!strncmp(argv[i], "-trebleLvl:", 11)) {
            const int trebleEffectLevel = atoi(argv[i] + 11);
            if (trebleEffectLevel > LVM_TE_MAX_EFFECTLEVEL ||
                trebleEffectLevel < LVM_TE_MIN_EFFECTLEVEL) {
                printf("Error: Unsupported Treble Effect Level : %d\n", trebleEffectLevel);
                printUsage();
                return -1;
            }
            lvmConfigParams.trebleEffectLevel = trebleEffectLevel;
        } else if (!strcmp(argv[i], "-bE")) {
        } else if (!strcmp(argv[i], "-bE")) {
            lvmConfigParams.bassEnable = LVM_BE_ON;
            lvmConfigParams.bassEnable = LVM_BE_ON;
        } else if (!strcmp(argv[i], "-eqE")) {
        } else if (!strcmp(argv[i], "-eqE")) {