Skip to content

Commit 292983a

Browse files
committed
Update function naming and account for potential bug.
1 parent aa5bf90 commit 292983a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

main.lua

+10-6
Original file line numberDiff line numberDiff line change
@@ -248,16 +248,16 @@ function love.load()
248248
audio.mute()
249249
end,
250250
["1"] = function ()
251-
visualization.set(1)
251+
visualization.setType(1)
252252
end,
253253
["2"] = function ()
254-
visualization.set(2)
254+
visualization.setType(2)
255255
end,
256256
["3"] = function ()
257-
visualization.set(3)
257+
visualization.setType(3)
258258
end,
259259
["4"] = function ()
260-
visualization.set(4)
260+
visualization.setType(4)
261261
end,
262262
["escape"] = function ()
263263
if love.window.getFullscreen() then
@@ -294,7 +294,11 @@ function love.load()
294294

295295
gui.load()
296296

297-
MONITOR_REFRESH_RATE = ({love.window.getMode()})[3].refreshrate
297+
-- If refresh rate can be determined, use it.
298+
local potential_refresh_rate = ({love.window.getMode()})[3].refreshrate
299+
if potential_refresh_rate ~= 0 then
300+
MONITOR_REFRESH_RATE = potential_refresh_rate
301+
end
298302

299303
--[[ Init Location Jumping ]]
300304
if config.init_location == "sysaudio" then
@@ -614,7 +618,7 @@ function love.quit()
614618

615619
-- If need to update config values, set flag to true and save new values.
616620
if config.session_persistence then
617-
local visualization_type = visualization.get()
621+
local visualization_type = visualization.getType()
618622
local shuffle = audio.isShuffling()
619623
local loop = audio.isLooping()
620624
local mute = audio.isMuted()

visualization.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,15 @@ end
209209

210210
--- Sets the type of bar visualization.
211211
-- @param v number: An integer of 1-4. Each changes the bar visualization properties.
212-
function visualization.set(v)
212+
function visualization.setType(v)
213213

214214
visualizer_type = v
215215

216216
end
217217

218218
--- Obtains the type of bar visualization.
219219
-- @return number: An integer of 1-4. The type of bar visualization.
220-
function visualization.get()
220+
function visualization.getType()
221221

222222
return visualizer_type
223223

0 commit comments

Comments
 (0)