#14,#15,#29,#31: Added qr, added more settings, added keymap, changed about page.
Build / build (push) Successful in 1m10s
Build / build (push) Successful in 1m10s
This commit is contained in:
+33
-12
@@ -55,19 +55,27 @@ func _ready() -> void:
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused:
|
||||
progress_slider.value = audio_player.get_playback_position()
|
||||
if stream != null:
|
||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
else:
|
||||
music_time_label.text = format_text(progress_slider.value, 0.0)
|
||||
print("Settings.hide_beginning: ", Settings.hide_beginning)
|
||||
print("audio_player.get_playback_position(): ", audio_player.get_playback_position())
|
||||
print("audio_player.get_playback_position() >= 5.0: ", audio_player.get_playback_position() >= 5.0)
|
||||
print("(!Settings.hide_beginning && audio_player.get_playback_position() >= 5.0): ", (!Settings.hide_beginning && audio_player.get_playback_position() >= 5.0))
|
||||
if (!Settings.hide_beginning || audio_player.get_playback_position() >= 5.0):
|
||||
progress_slider.value = audio_player.get_playback_position()
|
||||
if stream != null:
|
||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
else:
|
||||
music_time_label.text = format_text(progress_slider.value, 0.0)
|
||||
|
||||
func format_time(time: float) -> String:
|
||||
var mins: String = "%02d" % floor(time / 60)
|
||||
var sec: String = "%02d" % round(fmod(time, 60))
|
||||
return mins + ":" + sec
|
||||
|
||||
func format_text(part: float, total: float) -> String:
|
||||
return format_time(part) + " / " + format_time(total)
|
||||
func format_text(part: float, total: float) -> String:
|
||||
if Settings.hide_length:
|
||||
return format_time(part) + " / ??:??"
|
||||
else:
|
||||
return format_time(part) + " / " + format_time(total)
|
||||
|
||||
func play_or_pause() -> void:
|
||||
if song_finished:
|
||||
@@ -79,7 +87,10 @@ func play_or_pause() -> void:
|
||||
audio_player.seek(playback_position)
|
||||
print("continue")
|
||||
progress_slider.max_value = round(stream.get_length())
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
if Settings.hide_ticks:
|
||||
progress_slider.tick_count = 0
|
||||
else:
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
else:
|
||||
pause()
|
||||
|
||||
@@ -148,8 +159,8 @@ func play_sound(sound_name: AudioStream) -> void:
|
||||
song_finished = true
|
||||
play_button.texture_normal = play_icon
|
||||
progress_slider.value = 0
|
||||
if stream != null:
|
||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
#if stream != null:
|
||||
# music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
|
||||
func play_song(song: AudioStream) -> void:
|
||||
audio_player.stream = song
|
||||
@@ -158,8 +169,13 @@ func play_song(song: AudioStream) -> void:
|
||||
song_finished = false
|
||||
play_button.texture_normal = pause_icon
|
||||
stream = audio_player.stream
|
||||
progress_slider.value = 0
|
||||
progress_slider.max_value = round(stream.get_length())
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
if Settings.hide_ticks:
|
||||
progress_slider.tick_count = 0
|
||||
else:
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
|
||||
func play_song_object(song_object_no: int) -> void:
|
||||
print("play_song_object")
|
||||
@@ -172,8 +188,13 @@ func play_song_object(song_object_no: int) -> void:
|
||||
song_finished = false
|
||||
play_button.texture_normal = pause_icon
|
||||
stream = audio_player.stream
|
||||
progress_slider.value = 0
|
||||
progress_slider.max_value = round(stream.get_length())
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
if Settings.hide_ticks:
|
||||
progress_slider.tick_count = 0
|
||||
else:
|
||||
progress_slider.tick_count = round(stream.get_length() / 60)
|
||||
music_time_label.text = format_text(progress_slider.value, stream.get_length())
|
||||
Playlist.set_currently_playing_song(song_object_no)
|
||||
Playlist.unset_is_playing()
|
||||
if !Settings.hide_next_track:
|
||||
|
||||
Reference in New Issue
Block a user