Skip to content

Commit 9fa6ad2

Browse files
committed
Update documentation comments
1 parent e81b96c commit 9fa6ad2

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

test_room/addons/gde_gozen/video_playback.gd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ func _ready() -> void:
9393

9494

9595
#------------------------------------------------ VIDEO DATA HANDLING
96+
## This is the starting point for video playback, provide a path of where
97+
## the video file can be found and it will load a Video object. After which
98+
## [code]_update_video()[/code] get's run and set's the first frame image.
9699
func set_video_path(new_path: String) -> void:
97-
## This is the starting point for video playback, provide a path of where
98-
## the video file can be found and it will load a Video object. After which
99-
## [code]_update_video()[/code] get's run and set's the first frame image.
100100
if video != null:
101101
close()
102102

@@ -133,8 +133,8 @@ func update_video(video_instance: GoZenVideo, audio_stream: AudioStreamWAV = nul
133133
_update_video(video_instance)
134134

135135

136+
## Only run this function after manually having added a Video object to the `video` variable. A good reason for doing this is to load your video's at startup time to prevent your program for freezing for a second when loading in big video files. Some video formats load faster then others so if you are experiencing issues with long loading times, try to use this function and create the video object on startup, or try switching the video format which you are using.
136137
func _update_video(new_video: GoZenVideo) -> void:
137-
## Only run this function after manually having added a Video object to the `video` variable. A good reason for doing this is to load your video's at startup time to prevent your program for freezing for a second when loading in big video files. Some video formats load faster then others so if you are experiencing issues with long loading times, try to use this function and create the video object on startup, or try switching the video format which you are using.
138138
video = new_video
139139
if !is_open():
140140
printerr("Video isn't open!")
@@ -201,8 +201,8 @@ func _update_video(new_video: GoZenVideo) -> void:
201201
video_loaded.emit()
202202

203203

204+
## Seek frame can be used to switch to a frame number you want. Remember that some video codecs report incorrect video end frames or can't seek to the last couple of frames in a video file which may result in an error. Only use this when going to far distances in the video file, else you can use [code]next_frame()[/code].
204205
func seek_frame(new_frame_nr: int) -> void:
205-
## Seek frame can be used to switch to a frame number you want. Remember that some video codecs report incorrect video end frames or can't seek to the last couple of frames in a video file which may result in an error. Only use this when going to far distances in the video file, else you can use [code]next_frame()[/code].
206206
if !is_open() and new_frame_nr == current_frame:
207207
return
208208

@@ -218,8 +218,8 @@ func seek_frame(new_frame_nr: int) -> void:
218218
audio_player.set_stream_paused(!is_playing)
219219

220220

221+
## Seeking frames can be slow, so when you just need to go a couple of frames ahead, you can use next_frame and set skip to false for the last frame.
221222
func next_frame(skip: bool = false) -> void:
222-
## Seeking frames can be slow, so when you just need to go a couple of frames ahead, you can use next_frame and set skip to false for the last frame.
223223
if video.next_frame(skip) and !skip:
224224
_set_frame_image()
225225
next_frame_called.emit(current_frame)
@@ -281,8 +281,8 @@ func _process(delta: float) -> void:
281281
play()
282282

283283

284+
## Start the video playback. This will play until reaching the end of the video and then pause and go back to the start.
284285
func play() -> void:
285-
## Start the video playback. This will play until reaching the end of the video and then pause and go back to the start.
286286
if video != null and !is_open() and is_playing:
287287
return
288288
is_playing = true
@@ -295,8 +295,8 @@ func play() -> void:
295295
playback_started.emit()
296296

297297

298+
## Pausing the video.
298299
func pause() -> void:
299-
## Pausing the video.
300300
if video != null and !is_open():
301301
return
302302
is_playing = false
@@ -308,23 +308,23 @@ func pause() -> void:
308308

309309

310310
#------------------------------------------------ GETTERS
311+
## Getting the total amount of frames found in the video file.
311312
func get_video_frame_count() -> int:
312-
## Getting the total amount of frames found in the video file.
313313
return _frame_count
314314

315315

316+
## Getting the framerate of the video
316317
func get_video_framerate() -> float:
317-
## Getting the framerate of the video
318318
return _frame_rate
319319

320320

321+
## Getting the rotation in degrees of the video
321322
func get_video_rotation() -> int:
322-
## Getting the rotation in degrees of the video
323323
return _rotation
324324

325325

326+
## Checking to see if the video is open or not, trying to run functions without checking if open can crash your project.
326327
func is_open() -> bool:
327-
## Checking to see if the video is open or not, trying to run functions without checking if open can crash your project.
328328
return video != null and video.is_open()
329329

330330

0 commit comments

Comments
 (0)