Page 1 of 1

[Extension] Custom equalizer presets

Posted: 09 Jun 2016 19:40
by mederi
https://forum.videolan.org/viewtopic.ph ... 51#p442934

Code: Select all

profiles = { {"profile 1", "0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0"}, {"profile 2", "1 2 3 4 5 6 7 8 9 10"}, } function descriptor() return { title = "test - equalizer", capabilities = {}, } end function activate() Create_dialog() end function deactivate() end function meta_changed() end function close() vlc.deactivate() end --------------------------- function Create_dialog() dlg = vlc.dialog(descriptor().title) dlg:add_label(string.rep("&nbsp;",27),1,1,1,1) dlg:add_label(string.rep("&nbsp;",27),2,1,1,1) dlg:add_label(string.rep("&nbsp;",27),3,1,1,1) dlg:add_label(string.rep("&nbsp;",27),4,1,1,1) dd_profile = dlg:add_dropdown(1,1,2,1) for i,v in ipairs(profiles) do dd_profile:add_value(v[1],i) end dlg:add_button("Apply", click_Select, 3,1,1,1) dlg:add_button("Delete", click_Delete, 4,1,1,1) dlg:add_label("<hr />",1,2,4,1) dlg:add_label("Name: ",1,3,1,1) ti_name = dlg:add_text_input(profiles[1][1], 2,3,2,1) dlg:add_button("Create", click_Create, 4,3,1,1) dlg:add_label("Bands: ",1,4,1,1) ti_bands = dlg:add_text_input(profiles[1][2], 2,4,3,1) dlg:add_button("GO", click_GO, 1,5,1,1) dlg:add_button("Read", click_Read, 4,5,1,1) end function click_Select() local selection=dd_profile:get_value() ti_name:set_text(profiles[selection][1]) ti_bands:set_text(profiles[selection][2]) click_GO() end function click_Delete() end function click_Create() end function click_GO() vlc.var.set(vlc.object.aout(),"equalizer-bands",ti_bands:get_text()) end function click_Read() ti_name:set_text("") ti_bands:set_text(vlc.var.get(vlc.object.aout(),"equalizer-bands")) end