@@ -16,6 +16,7 @@ loopSlideshow = true
1616startWithAutoplay = true
1717browserSourceName = " Browser"
1818local mode_options = {" Random Order" , " Alphabetical Order" , " Alphabetical order, start on random" }
19+ captionEnabled = false
1920
2021HK_PAUSE = obs .OBS_INVALID_HOTKEY_ID
2122HK_RESUME = obs .OBS_INVALID_HOTKEY_ID
@@ -57,6 +58,7 @@ function script_properties()
5758 obs .obs_properties_add_int (props , " slideDuration" , " Slide duration (ms):" , minSlideDuration , maxSlideDuration , 500 )
5859 obs .obs_properties_add_bool (props , " startWithAutoplay" , " Autoplay" )
5960 obs .obs_properties_add_bool (props , " loopSlideshow" , " Loop slideshow" )
61+ obs .obs_properties_add_bool (props , " captionEnabled" , " Add Captaions based on filename" )
6062 obs .obs_properties_add_text (props , " browserSourceName" , " Browser source name:\n (for use with hotkeys)" , obs .OBS_TEXT_DEFAULT )
6163 obs .obs_properties_add_button (props , " refreshButton" , " Refresh" , refresh_source )
6264 return props
@@ -130,6 +132,7 @@ function script_load(settings)
130132 obs .obs_data_set_default_int (settings , " slideDuration" , defaultSlideDuration )
131133 obs .obs_data_set_default_bool (settings , " startWithAutoplay" , true )
132134 obs .obs_data_set_default_bool (settings , " loopSlideshow" , true )
135+ obs .obs_data_set_default_bool (settings , " captionEnabled" , false )
133136 obs .obs_data_set_default_string (settings , " browserSourceName" , " Browser" )
134137 update_image_list ()
135138
@@ -181,6 +184,7 @@ function script_update(settings)
181184 mode = obs .obs_data_get_int (settings , " mode" )
182185 slideDuration = obs .obs_data_get_int (settings , " slideDuration" )
183186 loopSlideshow = obs .obs_data_get_bool (settings , " loopSlideshow" )
187+ captionEnabled = obs .obs_data_get_bool (settings , " captionEnabled" )
184188 startWithAutoplay = obs .obs_data_get_bool (settings , " startWithAutoplay" )
185189 browserSourceName = obs .obs_data_get_string (settings , " browserSourceName" )
186190
@@ -198,6 +202,12 @@ function script_update(settings)
198202 else
199203 output :write (' let startWithAutoplay = false;\n ' )
200204 end
205+
206+ if captionEnabled == true then
207+ output :write (' let captionEnabled = true;\n ' )
208+ else
209+ output :write (' let captionEnabled = false;\n ' )
210+ end
201211
202212 output :close ()
203213 -- log_slideshow_info()
@@ -281,5 +291,6 @@ function log_slideshow_info()
281291 " \" | mode: " .. mode_options [mode + 1 ] ..
282292 " | slide duration: " .. slideDuration ..
283293 " ms | loop: " .. tostring (loopSlideshow ) ..
284- " | autoplay: " .. tostring (startWithAutoplay ))
294+ " | autoplay: " .. tostring (startWithAutoplay ) ..
295+ " | captionEnabled: " .. tostring (captionEnabled ))
285296end
0 commit comments