Skip to content

Commit

Permalink
Release Apply render preset v2.1.6
Browse files Browse the repository at this point in the history
Display REAPER v7.23's new "Adjust mono media an additional -3 dB" normalize option
Accept REAPER v7.29's new batch converter settings [p=2835830]
  • Loading branch information
cfillion committed Jan 7, 2025
1 parent 64f1ab7 commit 0225699
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Rendering/cfillion_Apply render preset.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- @description Apply render preset
-- @author cfillion
-- @version 2.1.5
-- @changelog Display REAPER v7.23's new normalization options
-- @version 2.1.6
-- @changelog
-- Display REAPER v7.23's new "Adjust mono media an additional -3 dB" normalize option
-- Accept REAPER v7.29's new batch converter settings [p=2835830]
-- @provides
-- .
-- [main] . > cfillion_Apply render preset (create action).lua
Expand Down Expand Up @@ -370,7 +372,7 @@ function parseFormatPreset2(presets, file, tokens)
end

function parseOutputPreset(presets, file, tokens)
local ok, err = checkTokenCount(file, tokens, 9, 11)
local ok, err = checkTokenCount(file, tokens, 9, 12)
if not ok then return nil, err end

local settingsMask = SETTINGS_SOURCE_MASK
Expand All @@ -394,26 +396,33 @@ function parseOutputPreset(presets, file, tokens)
if tokens[11] ~= nil then
preset.RENDER_TAILMS = tonumber(tokens[11]) -- v6.62
end
-- preset._BATCH_OUTFLAGS = tokens[12] -- v7.29

return parseDefault
end

function parsePostprocessPreset(presets, file, tokens)
local ok, err = checkTokenCount(file, tokens, 4, 9)
local ok, err = checkTokenCount(file, tokens, 4, 13)
if not ok then return nil, err end

local preset = insertPreset(presets, tokens[2])
preset.RENDER_NORMALIZE = tonumber(tokens[3])
preset.RENDER_NORMALIZE_TARGET = tonumber(tokens[4])
if tokens[5] ~= nil then
preset.RENDER_BRICKWALL = tonumber(tokens[5]) -- v6.37
if tokens[5] ~= nil then -- v6.37
preset.RENDER_BRICKWALL = tonumber(tokens[5])
end
if tokens[6] ~= nil then
preset.RENDER_FADEIN = tonumber(tokens[6])
preset.RENDER_FADEOUT = tonumber(tokens[7])
preset.RENDER_FADEINSHAPE = tonumber(tokens[8])
preset.RENDER_FADEOUTSHAPE = tonumber(tokens[9])
end
if tokens[10] ~= nil then -- v7.29 (batch converter only)
preset._BATCH_TRIMSTART = tokens[10]
preset._BATCH_TRIMEND = tokens[11]
preset._BATCH_PADSTART = tokens[12]
preset._BATCH_PADSEND = tokens[13]
end

return parseDefault
end
Expand Down Expand Up @@ -674,6 +683,7 @@ local function postprocessCell(ctx, preset)
local NORMALIZE_TOO_LOUD = 1<<8
local NORMALIZE_TOO_QUIET = 1<<11
local NORMALIZE_MODE_BITS = {5, 12}
local NORMALIZE_MONO3DB = 1<<13
local BRICKWALL_ENABLE = 1<<6
-- local BRICKWALL_TPEAK = 1<<7
local FADEIN_ENABLE = 1<<9
Expand Down Expand Up @@ -726,6 +736,8 @@ local function postprocessCell(ctx, preset)
ImGui.SameLine(ctx)
ImGui.CheckboxFlags(ctx, 'too quiet', postprocess, NORMALIZE_TOO_QUIET)

ImGui.CheckboxFlags(ctx, 'Adjust mono media an additional -3 dB', postprocess, NORMALIZE_MONO3DB)

local mode = 0
for i, bit in ipairs(NORMALIZE_MODE_BITS) do
mode = mode | ((postprocess >> bit & 1) << (i - 1))
Expand Down

0 comments on commit 0225699

Please sign in to comment.