Alot of changes(description)

- finally fixed the save system so it saves new users files
- added better bgs
- reorganized files so its less of a clusterfuck
This commit is contained in:
Bucket Of Chicken
2025-08-10 07:20:17 +02:00
parent 31ae121a8f
commit 1dbaa781dc
136 changed files with 318 additions and 186 deletions
+20
View File
@@ -0,0 +1,20 @@
shader_type canvas_item;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
vec2 animatedUV;
animatedUV.x = (sin(UV.x + (TIME))/2.0)+0.5;
animatedUV.y = (sin(UV.y + (TIME+(PI/2.0)))/2.0)+0.5;
float color1 = 1.0 *animatedUV.x;
float color2 = 1.0 *animatedUV.y;
COLOR = vec4((color1*0.7)+(color2*0.3),(color1*0.5)+(color2*0.5),(color1*0.3)+(color2*0.7),1);
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
+1
View File
@@ -0,0 +1 @@
uid://dgwslfj43mu1y
+17
View File
@@ -0,0 +1,17 @@
shader_type canvas_item;
uniform sampler2D dissolve;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
vec4 tex = texture(dissolve,UV);
COLOR.a = tex.a;
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
+1
View File
@@ -0,0 +1 @@
uid://cv5aoaprqfuhx
+14
View File
@@ -0,0 +1,14 @@
extends ColorRect
@onready var StandardColor = color
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if get_parent().is_hovered():
color = StandardColor.lightened(0.3)
else:
color = StandardColor
+1
View File
@@ -0,0 +1 @@
uid://cf1rsngucr7e2
+20
View File
@@ -0,0 +1,20 @@
shader_type canvas_item;
uniform float intensity;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
vec4 as = texture(screen_texture,SCREEN_UV);
vec4 a2s = texture(TEXTURE,UV);
vec4 fart = a2s * (0.1 + as.brga);
COLOR = fart * intensity;
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
+1
View File
@@ -0,0 +1 @@
uid://b8g2xx06g626m
+11
View File
@@ -0,0 +1,11 @@
extends Sprite2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
rotation_degrees += 90 * delta * 2
+1
View File
@@ -0,0 +1 @@
uid://bx75h6xic1hi7
+38
View File
@@ -0,0 +1,38 @@
extends Control
@onready var birthday_particles: GPUParticles2D = $BirthdayParticles
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
@onready var birthday_happy: Label = $"../BirthdayHappy"
@export var opacitycurve:Curve
var opacity:float = 1
var awaitingJumpscare:bool
var IsFocused:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
birthday_happy.hide()
var bday:bool
if Time.get_datetime_dict_from_system().day == 9:
if Time.get_datetime_dict_from_system().month == 9:
await get_tree().create_timer(0.2).timeout
awaitingJumpscare = true
bday = true
func _notification(what):
if what == get_tree().NOTIFICATION_APPLICATION_FOCUS_IN:
IsFocused = true
if what == get_tree().NOTIFICATION_APPLICATION_FOCUS_OUT:
IsFocused = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if awaitingJumpscare && IsFocused:
birthday_happy.show()
awaitingJumpscare = false
birthday_particles.emitting = true
audio_stream_player.play()
if !awaitingJumpscare:
opacity -= delta/5
birthday_happy.modulate.a = opacitycurve.sample_baked(opacity)
if opacity <= 0.0:
process_mode = ProcessMode.PROCESS_MODE_DISABLED
+1
View File
@@ -0,0 +1 @@
uid://n3koklp0funr
+28
View File
@@ -0,0 +1,28 @@
extends Sprite2D
class_name Cover
@onready var MusiMet : MusicMeta = MusicMeta.new()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if texture != null:
var relation:float = (float(texture.get_width()) / texture.get_height())
print(" relation " + str(texture.get_width()) + " " + str(texture.get_height()))
print(relation)
scale.x = 400.0 / float(texture.get_width())
scale.y = 400.0 / float(texture.get_height() * relation)
position.x = float(texture.get_width() * scale.x) / 2
position.y = -float(texture.get_height() * scale.y) / 2
func ChangeCover(AudioFile:AudioStreamMP3):
texture = MusiMet.get_mp3_metadata(AudioFile).cover
if texture != null:
var relation:float = (float(texture.get_width()) / texture.get_height())
print(" relation " + str(texture.get_width()) + " " + str(texture.get_height()))
print(relation)
scale.x = 400.0 / float(texture.get_width())
scale.y = 400.0 / float(texture.get_height() * relation)
position.x = float(texture.get_width() * scale.x) / 2
position.y = -float(texture.get_height() * scale.y) / 2
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
+1
View File
@@ -0,0 +1 @@
uid://dg68hvw773xu6
+94
View File
@@ -0,0 +1,94 @@
extends Control
@onready var good_indicator: Label = $ScrollContainer/VBoxContainer/GoodIndicator
@onready var create_playlist_button: Button = $ScrollContainer/VBoxContainer/CreatePlaylistButton
@onready var file_dialog: FileDialog = $FileDialog
@onready var current_directory: Label = $ScrollContainer/VBoxContainer/CurrentDirectory
@onready var playlist_name: LineEdit = $ScrollContainer/VBoxContainer/PlaylistName
@onready var playlists_holder: VBoxContainer = $"../PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/PlaylistsHolder"
const PLAYLIST_DISPLAY = preload("res://Scenes/PlaylistDisplay.tscn")
@onready var Parent:MainScene = owner
var NameValid:bool
var DirValid:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func IsValid():
if NameValid:
if DirValid:
create_playlist_button.disabled = false
else:
create_playlist_button.disabled = true
else:
create_playlist_button.disabled = true
func _on_playlist_name_text_changed(new_text: String) -> void:
#elif new_text.unicode_at()
if !Parent.Playlists.has(new_text):
if new_text != "":
good_indicator.text = tr("NAME_VALID")
good_indicator.label_settings.font_color = Color(0,1,0,1)
NameValid =true
else:
good_indicator.text = tr("NAME_EMPTY")
good_indicator.label_settings.font_color = Color(1,0,0,1)
NameValid = false
else:
good_indicator.text = tr("NAME_USED")
good_indicator.label_settings.font_color = Color(1,0,0,1)
NameValid = false
IsValid()
func _on_select_dir_button_pressed() -> void:
file_dialog.show()
print(get_stack())
func _on_file_dialog_dir_selected(dir: String) -> void:
if dir != "":
DirValid = true
else:
DirValid = false
current_directory.text = dir
IsValid()
func ResetToDefault():
playlist_name.clear()
good_indicator.text = ""
good_indicator.label_settings.font_color = Color(1,1,1,1)
NameValid = false
create_playlist_button.disabled = true
func _on_create_playlist_button_pressed() -> void:
Parent.PlaylistsLocation[playlist_name.text] = current_directory.text
var Access = DirAccess.open(current_directory.text)
if Access != null:
@warning_ignore("static_called_on_instance")
var Read:Array = Access.get_files_at(current_directory.text)
var songs:Array
var WavDisclaimer:bool
for song:String in Read:
if song.contains(".mp3"):
songs.append(song)
Parent.Playlists[playlist_name.text] = songs
else:
Parent.Playlists[playlist_name.text] = []
var child = PLAYLIST_DISPLAY.instantiate()
child.PlaylistName = playlist_name.text
child.PlaylistLocation = Parent.PlaylistsLocation[playlist_name.text]
child.PlaylistSongs = Parent.Playlists[playlist_name.text]
playlists_holder.add_child(child)
hide()
ResetToDefault()
func _on_close_button_pressed() -> void:
hide()
+1
View File
@@ -0,0 +1 @@
uid://bsnt1irskti8d
+17
View File
@@ -0,0 +1,17 @@
extends Button
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#await get_tree().create_timer(0.3).timeout
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_toggled(toggled_on: bool) -> void:
owner.DiscordRichPresenceEnabled = toggled_on
owner.Parent.SaveEverything()
+1
View File
@@ -0,0 +1 @@
uid://dl37gwyodonea
+69
View File
@@ -0,0 +1,69 @@
extends VBoxContainer
var HzDec = {0:"32 Hz",
1:"100 Hz",
2:"320 Hz",
3:"1000 Hz",
4:"3200 Hz",
5:"10000 Hz"}
var gainValueLabels:Array = []
var gainValueSlider:Array = []
@onready var eq_check_box: CheckBox = $"../EQCheckBox"
@onready var EQA:AudioEffectEQ6 = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),1)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
for band in EQA.get_band_count():
var slider:HSlider = HSlider.new()
slider.min_value = -100
slider.max_value = 20
slider.custom_minimum_size = Vector2(200,0)
slider.name = str(band)
slider.value_changed.connect(valueChanged.bind(slider))
var label:Label = Label.new()
label.text = HzDec.get(band)
var label2:Label = Label.new()
label2.text = " 0 "
var seperator:HSplitContainer = HSplitContainer.new()
var seperator2:HSplitContainer = HSplitContainer.new()
seperator.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED
seperator2.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED
add_child(seperator)
seperator.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
seperator.split_offset = 200
seperator.clamp_split_offset()
seperator.add_child(slider)
gainValueSlider.append(slider)
seperator.add_child(seperator2)
seperator2.add_child(label2)
gainValueLabels.append(label2)
seperator2.add_child(label)
func valueChanged(value,slider):
var idx = slider.name.to_int()
print(idx)
print(gainValueLabels)
EQA.set_band_gain_db(idx,value)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
for band in EQA.get_band_count():
gainValueLabels[band].text = str(" " + str(EQA.get_band_gain_db(band)) + " db ")
func _on_reset_pressed() -> void:
for band in EQA.get_band_count():
EQA.set_band_gain_db(band,0)
gainValueSlider[band].value = 0
eq_check_box.button_pressed = false
gainValueLabels[band].text = str(" " + str(EQA.get_band_gain_db(band)) + " db ")
+1
View File
@@ -0,0 +1 @@
uid://kt7n1epi3ng8
+15
View File
@@ -0,0 +1,15 @@
extends Button
@export var Open:String
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _pressed() -> void:
OS.shell_open(Open)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
+1
View File
@@ -0,0 +1 @@
uid://bn0iqqmor3b2b
+14
View File
@@ -0,0 +1,14 @@
extends MenuButton
@export var settings:Settings
func _ready() -> void:
for trans_language in TranslationServer.get_loaded_locales():
get_popup().add_item(trans_language)
get_popup().id_pressed.connect(got_pressed)
func got_pressed(id:int) -> void:
settings.Parent.overridden_locale = get_popup().get_item_text(id)
TranslationServer.set_locale(get_popup().get_item_text(id))
settings.Parent.SaveEverything()
+1
View File
@@ -0,0 +1 @@
uid://cej7efsj2cyen
+29
View File
@@ -0,0 +1,29 @@
extends Control
@onready var continue_anyways: Button = $VBoxContainer/HBoxContainer/ContinueAnyways
@onready var contact: Button = $VBoxContainer/HBoxContainer/Contact
@onready var failed_audio_cue: AudioStreamPlayer = $FailedAudioCue
@onready var confirmation_dialog: ConfirmationDialog = $ConfirmationDialog
func Show():
failed_audio_cue.play()
show()
continue_anyways.pressed.connect(confirmation_dialog.show)
confirmation_dialog.confirmed.connect(Confiremed)
contact.pressed.connect(Contact)
func Confiremed():
owner.LoadingSaveFailed = false
hide()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
hide()
func Contact():
print("Contact pressed")
OS.shell_open("https://notdraimdev.github.io/SimplSite/Contact.html")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
+1
View File
@@ -0,0 +1 @@
uid://cbdcs7oie12g5
+702
View File
@@ -0,0 +1,702 @@
class_name MainScene
extends Control
@onready var file_dialog: FileDialog = $FileDialog
@onready var music_player: AudioStreamPlayer = $MusicPlayer
@onready var randomize_list: Button = $RandomizeList
@onready var play_list: Button = $playList
@onready var current_progress: HSlider = $CurrentProgress
@onready var volume_slider: VSlider = $VolumeSlider
@onready var skip: Button = $Skip
@onready var go_back: Button = $GoBack
@onready var song_name: Label = $SongName
@onready var loop: Button = $Loop
@onready var time_listening_song: Label = $TimeListeningSong
@onready var cover: Cover = $CoverHolder/Cover
@onready var wav_disclaimer: AcceptDialog = $WavDisclaimer
@onready var youtube_menu_holder: Control = $YoutubeMenuHolder
@onready var youtube_menu: Control = $"YoutubeMenuHolder/Youtube menu"
@onready var yt_link: LineEdit = $"YoutubeMenuHolder/Youtube menu/YTLink"
@onready var yt_download: Button = $"YoutubeMenuHolder/Youtube menu/YTDownload"
@onready var loading_img: Sprite2D = $"YoutubeMenuHolder/Youtube menu/LoadingIMG"
@onready var songs_menu: Button = $SongsMenu
@onready var version: Label = $Version
@onready var paused_indicator: TextureRect = $PausedIndicator
@onready var settings_menu_child: Settings = $SettingsHolder/SettingsPopup/SettingsMenuChild
@onready var artist_name: Label = $ArtistName
@onready var user_bg: TextureRect = $UserBG
@onready var playlists_holder: VBoxContainer = $PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/PlaylistsHolder
@onready var play_all: Button = $PlaylistPanelHolder/PlaylistsPanel/PlaylistsContainer/VBoxContainer/HBoxContainer/PlayAll
@onready var album_name: Label = $Album
@onready var playlist_or_song: ConfirmationDialog = $PlaylistOrSong
@onready var search_results: SearchResults = $SearchResults
@onready var delete_confirm: ConfirmationDialog = $deleteConfirm
@onready var search_bar: LineEdit = $SearchBar
@onready var playing_now: Window = $PlayingNow
@export var overridden_locale:String
@onready var playing_now_window: Control = $PlayingNow/PlayingNowWindow
var DiscordUsername:String
const PLAYLIST_DISPLAY = preload("res://Scenes/PlaylistDisplay.tscn")
const PAUSE = preload("res://Icons/Pause.png")
const PLAY = preload("res://Icons/Play.png")
var OpenedSong:String = ""
var CurrentIDX:int
var CurrentSongLenth:float
var CurrentDir:String
var textSongs:Array
var Randomized:bool
var LoopingSong:bool
var Paused:bool
var UpdateProgressSlider:bool = true
var ShowInstallAlerts:bool = false
var ReactivateLoop:bool
var SeenWAVDisclaimer:bool
var TimeSpentListening:float
var DiscordRichPresenceEnabled:bool = false
var SplashStrings:Array
var SaveInterval:float = 11.2
var currentSaveTime:float = 0.4
var CurrentPausedIndicatorShaderIntensity:float
var CurrentCustomBackroundImageDirectory:String
var Playlists:Dictionary = {}
var PlaylistsLocation:Dictionary
var BackroundSetup:bool
var CurrentPlaylist:String
var PlayAllLists:bool
var UsingPlayingNow:bool
@export var LoopPressed:Texture2D
@export var LoopNotPressed:Texture2D
signal ContinueDelete
var deleteSong:bool
signal SongChanged
var currentSongName:String
var currentArtistName:String
var currentAlbumName:String
var LoadingSaveFailed:bool = true
@onready var loading_failed_screen: Control = $LoadingFailedScreen
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
playing_now.visible = false
get_tree().root.min_size = Vector2(850,492)
current_progress.drag_ended.connect(SongDragStopped)
current_progress.drag_started.connect(SongDragStarted)
loop.pressed.connect(LoopSong)
file_dialog.dir_selected.connect(DirectorySelected)
randomize_list.pressed.connect(Randomize)
play_list.pressed.connect(PlaySongs)
volume_slider.value_changed.connect(SetVolume)
skip.pressed.connect(Skip)
go_back.pressed.connect(GoBack)
search_results.index_pressed.connect(SetSong)
search_results.song_deleted.connect(deletesong)
var Strin:String
var data:Dictionary
var save = loadUserdata()
if save != {}:
data = save
loadPlaylists()
if Strin.is_empty():
if !Playlists.is_empty():
PlaylistSelected(Playlists.keys()[0],PlaylistsLocation[Playlists.keys()[0]])
#CurrentPlaylist = Playlists.keys()[0]
#CurrentDir = PlaylistsLocation[Playlists.keys()[0]]
for Playlist in Playlists.keys():
var child = PLAYLIST_DISPLAY.instantiate(PackedScene.GEN_EDIT_STATE_DISABLED)
if PlaylistsLocation.has(Playlist):
if PlaylistsLocation[Playlist] is String:
child.PlaylistLocation = PlaylistsLocation[Playlist]
else:
print("PLAYLIST LOCATION: " + str(PlaylistsLocation[Playlist]))
child.PlaylistName = Playlist
if Playlists.has(Playlist):
if Playlists[Playlist] is String:
child.PlaylistSongs = Playlists[Playlist]
playlists_holder.add_child(child)
if data != null:
if data.has("Volume"):
print(data["Volume"])
SetVolume(data["Volume"])
if data.has("CurrIDX"):
CurrentIDX = int(data["CurrIDX"]) % textSongs.size() if textSongs.size() !=0 and int(data["CurrIDX"]) != 0 else 0
if data.has("Randomized"):
Randomize()
if data.has("Playing"):
PlaySongs()
if data.has("SeenWAVDisclaimer"):
SeenWAVDisclaimer = data["SeenWAVDisclaimer"]
if data.has("TimeSpentListening"):
TimeSpentListening = data["TimeSpentListening"]
print("Listening time: " + str(TimeSpentListening))
if data.has("DiscordRichPresenceEnabled"):
settings_menu_child.discord_rich_presence_button.set_pressed_no_signal(data["DiscordRichPresenceEnabled"])
DiscordRichPresenceEnabled = data["DiscordRichPresenceEnabled"]
if data["DiscordRichPresenceEnabled"]:
setUpDiscord()
if data.has("DiscordUsername"):
if data["DiscordUsername"]:
if DiscordRichPresenceEnabled:
DiscordUsername = data["DiscordUsername"]
print("stiff ",data)
if data.has("ReverbEnabled") :
settings_menu_child.reverb_check.button_pressed = data["ReverbEnabled"]
if data.has("ReverbRoomSize") :
settings_menu_child.room_size_slider.value = data["ReverbRoomSize"]
if data.has("ReverbDampening") :
settings_menu_child.dampening_size_slider.value = data["ReverbDampening"]
if data.has("ReverbSpread") :
settings_menu_child.spread_size_slider.value = data["ReverbSpread"]
if data.has("CompressionEnabled") :
settings_menu_child.compression_check.button_pressed = data["CompressionEnabled"]
if data.has("CompressionThreshold") :
settings_menu_child.threshold_slider.value = data["CompressionThreshold"]
if data.has("CompressionRatio") :
settings_menu_child.ratio_slider.value = data["CompressionRatio"]
if data.has("CompressionGain") :
settings_menu_child.gain_slider.value = data["CompressionGain"]
if data.has("CurrentCustomBackroundImageDirectory"):
CurrentCustomBackroundImageDirectory = data["CurrentCustomBackroundImageDirectory"]
print("CurrentCustomBackroundImageDirectory " + CurrentCustomBackroundImageDirectory)
if data.has("PlayAllLists"):
PlayAllLists = data["PlayAllLists"]
if PlayAllLists:
play_all.button_pressed = true
if data.has("UsingPlayingNow"):
UsingPlayingNow = data["UsingPlayingNow"]
settings_menu_child.now_playing_window_button.button_pressed = true
if data.has("OverriddenLocale"):
TranslationServer.set_locale(data["OverriddenLocale"])
overridden_locale = data["OverriddenLocale"]
else:
if data != null:
print(data["Volume"])
SetVolume(data["Volume"])
var TrueDir
var TheSongName = Strin
var lenght = Strin.length()
var AmoutOfSwag:int = 0
for skibidi in lenght:
if Strin.ends_with("\\"):
AmoutOfSwag += 1
if AmoutOfSwag ==2:
TheSongName = TheSongName.erase(0,lenght)
print(TheSongName)
break
else:
lenght -= 1
Strin = Strin.erase(lenght)
OpenedSong = TheSongName
DirectorySelected(Strin)
PlaySongs()
#PlaySongs()
for child in get_children(true):
if child is Control:
child.focus_mode = child is LineEdit
if LoadingSaveFailed:
var file2 = FileAccess.open("user://playlists.dat", FileAccess.READ)
if !file2:
return
if (file2.get_error() != ERR_FILE_NOT_FOUND) or (file2.get_error() != ERR_FILE_BAD_PATH):
loading_failed_screen.Show()
ERR_PRINTER_ON_FIRE
func setUpDiscord():
DiscordRPC.app_id = 1276916292170809426
DiscordRPC.refresh()
print("stiff chicks ",DiscordRPC.get_current_user())
SplashStrings = ["the party just started!"]
var LText = SplashStrings.pick_random()
print(LText)
DiscordRPC.large_image_text = LText
DiscordRPC.large_image = "logo"
DiscordUsername = DiscordRPC.get_current_user().get("username")
DiscordRPC.refresh()
# this is boolean if everything worked
print("Discord working: " + str(DiscordRPC.get_is_discord_working()))
# Set the first custom text row of the activity here
if textSongs.size() >= CurrentIDX:
if textSongs.size() > CurrentIDX:
DiscordRPC.details = textSongs[CurrentIDX]
# Set the second custom text row of the activity here
DiscordRPC.state = ""
# Image key for small image from "Art Assets" from the Discord Developer website
# Tooltip text for the large image
# Image key for large image from "Art Assets" from the Discord Developer website
DiscordRPC.small_image = ""
# Tooltip text for the small image
DiscordRPC.small_image_text = "Nothing"
# "02:41 elapsed" timestamp for the activity
# Always refresh after changing the values!
DiscordRPC.refresh()
func deletesong(idx:int):
var currentDir:String= CurrentDir
currentDir += "/" + textSongs[idx]
delete_confirm.show()
delete_confirm.dialog_text = tr("DELETE_DIALOG") + textSongs[idx] +"?"
delete_confirm.confirmed.connect(deleteConfirmed)
delete_confirm.canceled.connect(deleteCancelled)
await ContinueDelete
delete_confirm.canceled.disconnect(deleteCancelled)
delete_confirm.confirmed.disconnect(deleteConfirmed)
if deleteSong:
print("deleted + " + currentDir)
deleteSong = false
var dir = DirAccess.remove_absolute(currentDir)
print("error code " +str(dir) + " (zero is good)")
if dir == 0:
textSongs.remove_at(idx)
if search_bar.visible:
search_bar.updateResults()
else:
songs_menu._pressed()
Playlists[CurrentPlaylist].erase(textSongs[idx])
func deleteCancelled():
deleteSong = false
ContinueDelete.emit()
func deleteConfirmed():
deleteSong = true
ContinueDelete.emit()
func SongDragStopped(Changed:bool):
if Changed:
music_player.play(current_progress.value * CurrentSongLenth / current_progress.max_value)
if Paused:
pausePlay()
UpdateProgressSlider = true
if DiscordRichPresenceEnabled:
DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system() - (current_progress.value * CurrentSongLenth / current_progress.max_value))
DiscordRPC.refresh()
func SongDragStarted():
UpdateProgressSlider = false
func LoopSong():
if LoopingSong == true:
LoopingSong = false
loop.icon = LoopNotPressed
else:
LoopingSong = true
loop.icon = LoopPressed
func SetSong(IDX:int):
if LoopingSong:
LoopingSong = false
ReactivateLoop = true
loop.icon = LoopNotPressed
CurrentIDX = IDX -1
PlaySongs()
music_player.stop()
if !LoadingSaveFailed:
SaveEverything()
print("SetSong")
func pausePlay():
if music_player.stream_paused == true:
music_player.stream_paused = false
else:
music_player.stream_paused = true
func Skip():
if LoopingSong:
LoopingSong = false
ReactivateLoop = true
loop.icon = LoopNotPressed
music_player.stop()
func GoBack():
if LoopingSong:
LoopingSong = false
ReactivateLoop = true
loop.icon = LoopNotPressed
CurrentIDX -=2
music_player.stop()
func SetVolume(Volume:float):
var volume = (-50 + (Volume/2))
if Volume >= 2:
AudioServer.set_bus_volume_db(1,volume)
else:
AudioServer.set_bus_volume_db(1,-1000)
volume_slider.value = Volume
func SelectPlaylistDir():
file_dialog.show()
if !LoadingSaveFailed:
SaveEverything()
print("Select Playtlist dir")
func DirectorySelected(dir:String):
Randomized = false
print(dir)
CurrentDir = dir
GetSongs(dir)
func PlaySongs():
if music_player.playing:
Paused = true
music_player.stream_paused = true
play_list.icon = PLAY
DiscordRPC.state = tr("DELETE_DIALOG")
print(DiscordRPC.get_current_user())
else:
DiscordRPC.start_timestamp = int(Time.get_unix_time_from_system() - (current_progress.value * CurrentSongLenth / current_progress.max_value))
print(DiscordRPC.get_current_user())
DiscordRPC.state = tr("STATE_LISTENING")
Paused = false
music_player.stream_paused = false
play_list.icon = PAUSE
if music_player.get_playback_position() == 0.0:
if LoopingSong:
music_player.play()
elif textSongs.size() != 0:
var index:int
if OpenedSong.is_empty():
if PlayAllLists:
if CurrentIDX >= (textSongs.size()):
CurrentPlaylist = Playlists.keys()[(Playlists.keys().find(CurrentPlaylist)+1) % Playlists.keys().size()]
print(CurrentPlaylist)
index = CurrentIDX % textSongs.size()
else:
if PlayAllLists:
if CurrentIDX+1 >= (textSongs.size()-1):
CurrentPlaylist = Playlists.keys()[(Playlists.keys().find(CurrentPlaylist)+1) % Playlists.keys().size()]
index = textSongs.find(OpenedSong) % textSongs.size()
if PlayAllLists:
if !CurrentDir.ends_with(CurrentPlaylist):
GetSongs(PlaylistsLocation[CurrentPlaylist])
var CurrentSongDir:String = PlaylistsLocation[CurrentPlaylist] + "/" + textSongs[index]
if DiscordRichPresenceEnabled:
DiscordRPC.details = textSongs[index].replace(".mp3","")
currentSongName = textSongs[index].replace(".mp3","")
print(CurrentSongDir)
var sonnname:String = textSongs[index]
sonnname = sonnname.replace(".mp3", "")
song_name.text = sonnname
var dat = FileAccess.get_file_as_bytes(CurrentSongDir)
var song:AudioStreamMP3
if CurrentSongDir.to_lower().ends_with(".mp3"):
song = AudioStreamMP3.new()
cover.ChangeCover(song)
song.data = dat
if CurrentSongDir.to_lower().ends_with(".mp3"):
cover.ChangeCover(song)
print(MusicMetadataAutoload.get_mp3_metadata(song).print_info())
if MusicMetadataAutoload.get_mp3_metadata(song).title != "":
song_name.text = MusicMetadataAutoload.get_mp3_metadata(song).title
if MusicMetadataAutoload.get_mp3_metadata(song).artist != "":
currentArtistName = MusicMetadataAutoload.get_mp3_metadata(song).artist
else: currentArtistName = ""
artist_name.text = currentArtistName
if MusicMetadataAutoload.get_mp3_metadata(song).album != "":
currentAlbumName = MusicMetadataAutoload.get_mp3_metadata(song).album
else: currentAlbumName = ""
album_name.text = currentAlbumName
if song != null:
CurrentSongLenth = song.get_length()
music_player.stream = song
music_player.play()
if !LoadingSaveFailed:
SaveEverything()
print("set stream")
SongChanged.emit()
func GetSongs(dir:String):
print("Selected dir: " + dir)
var Access = DirAccess.open(dir)
if Access != null:
CurrentDir = dir
@warning_ignore("static_called_on_instance")
var Read:Array = Access.get_files_at(dir)
var songs:Array
var WavDisclaimer:bool
for song:String in Read:
if song.contains(".mp3"):
songs.append(song)
elif song.contains(".wav"):
WavDisclaimer = true
if WavDisclaimer:
if !SeenWAVDisclaimer:
wav_disclaimer.show()
SeenWAVDisclaimer = true
#print(songs)
search_results.clear()
textSongs = songs
for song in textSongs:
var nam = song
search_results.add_item(nam)
func Randomize():
if textSongs.size() != 0:
var Access = DirAccess.open(CurrentDir)
var Read:Array = Access.get_files_at(CurrentDir)
var Ssong:String
for read:String in Read:
if textSongs.size() > CurrentIDX:
if read.contains(textSongs[CurrentIDX]):
Ssong = read
print("Ssong = " + str(read))
textSongs.shuffle()
if Ssong != null:
CurrentIDX = textSongs.find(Ssong) # % textSongs.size()
print(CurrentIDX)
Randomized = true
search_results.clear()
for song in textSongs:
var nam = song
search_results.add_item(nam)
#print(textSongs)
func PlaylistSelected(Playlist:String,PlaylistLocation:String):
print(PlaylistLocation)
if Playlists.get(Playlist) == null:
printerr("PlaylistSelected(Playlist:String):: you FUCKED, no playlist found")
return
else:
CurrentPlaylist = Playlist
PlaylistsLocation[Playlist] = PlaylistLocation
print(PlaylistsLocation[Playlist])
CurrentDir = PlaylistLocation
GetSongs(PlaylistsLocation[Playlist])
CurrentIDX = -1
music_player.stop()
print("Playlist selected")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
playing_now.visible = UsingPlayingNow
currentSaveTime -= _delta
if !BackroundSetup:
if CurrentCustomBackroundImageDirectory != null and CurrentCustomBackroundImageDirectory != "":
settings_menu_child._on_select_bg_dialog_file_selected(CurrentCustomBackroundImageDirectory)
BackroundSetup = true
if currentSaveTime < 0:
currentSaveTime = SaveInterval
if DiscordRichPresenceEnabled:
DiscordUsername = DiscordRPC.get_current_user().get("username")
if !LoadingSaveFailed:
SaveEverything()
@warning_ignore("integer_division")
if DiscordRichPresenceEnabled:
UpdateSplashes()
if DiscordRPC.get_is_discord_working():
print(DiscordRPC.get_current_user()["username"])
print(TimeSpentListening)
var LText = SplashStrings.pick_random()
DiscordRPC.large_image_text = LText
if DiscordRPC.get_is_discord_working():
DiscordRPC.refresh()
# "59:59 remaining" timestamp for the activity
if music_player.playing:
TimeSpentListening += _delta
CurrentPausedIndicatorShaderIntensity = lerp(CurrentPausedIndicatorShaderIntensity,0.0,0.1)
if DiscordRichPresenceEnabled:
DiscordRPC.state = tr("STATE_LISTENING")
else:
if DiscordRichPresenceEnabled:
DiscordRPC.start_timestamp = int(0)
DiscordRPC.state = tr("STATE_PAUSED")
if DiscordRPC.get_is_discord_working():
DiscordRPC.refresh()
CurrentPausedIndicatorShaderIntensity = lerp(CurrentPausedIndicatorShaderIntensity,1.0,0.1)
if DiscordRichPresenceEnabled:
DiscordRPC.run_callbacks()
var mat:ShaderMaterial = paused_indicator.material
mat.set_shader_parameter("intensity",CurrentPausedIndicatorShaderIntensity)
var CurrentLenght:float = music_player.get_playback_position() / CurrentSongLenth * current_progress.max_value
if UpdateProgressSlider == true:
current_progress.value = CurrentLenght
#print(CurrentLenght)
@warning_ignore("integer_division")
var mins = int(music_player.get_playback_position()) / 60
@warning_ignore("integer_division")
var Hours:String = str(mins/60)
if music_player.stream != null:
var Minutes:String = (str("0" + str(mins%60)) if !int(music_player.stream.get_length() / 60) < 10 else str(mins%60)) if (mins%60) < 10 else str(mins%60)
var Seconds:String = "0" + str(int(music_player.get_playback_position()) % 60) if int(music_player.get_playback_position()) % 60 < 10 else str(int(music_player.get_playback_position()) % 60)
time_listening_song.text = Hours + ":" + Minutes + ":" + Seconds if int(music_player.stream.get_length() /60 / 60) != 0 else Minutes + ":" + Seconds
else:
time_listening_song.text = "0:00"
#time_listening_song.text = str(music_player.get_playback_position())
if Input.is_key_pressed(KEY_DOWN):
volume_slider.value -= 1*_delta *50
if Input.is_key_pressed(KEY_UP):
volume_slider.value += 1*_delta *50
if CurrentLenght == 0:
if LoopingSong == false:
CurrentIDX +=1
PlaySongs()
if ReactivateLoop:
LoopingSong = true
ReactivateLoop = false
loop.icon = LoopPressed
if DiscordRichPresenceEnabled:
DiscordRPC.refresh()
func UpdateSplashes():
if DiscordRPC.get_is_discord_working() && DiscordRichPresenceEnabled:
SplashStrings = ["Total listening time: %s!" % str(str(int(TimeSpentListening/60)/60 )
+ "h : " + str((int(TimeSpentListening) / 60) % 60) + "m : " +
str(int(TimeSpentListening) % 60) + "s"),
"Version: %s" % version.text,"🤷‍♂️","This Changes every ~11 seconds",
"hello everybody my name is %s" % DiscordRPC.get_current_user()["username"],
"wash your dishes, i know you got some","Running on %s" % OS.get_distribution_name(),
"%s is cooking" % DiscordRPC.get_current_user()["username"], "debugging" if OS.has_feature("editor") else "Release build",
"this user chose to show you all this info","Playing a Banger",
":steamhappy:","This is a sign that crocodiles live in water",
"Space? SPACE?! SPAAAAAAAAAAAAACE!!!",
"i love gd colonge",
"listening with reverb" if settings_menu_child.reverb_check.button_pressed else
"not listening with reverb","the cake is edible",
"what a great song!","this message is useless",
"stop reading these","why are you reading these",
"hello from mars", "hello to mars","there is a fly in my room",
"yippee!","What, are they allergic to bathtubs or something",
"Did you know, a 737 can land with up to 33knots of wind!",
"Welcome to todays JahresSchau",
"ram is very useful","your cpu is tasty","main course: Nvidia GPU",
"SCHOTTLAND FUER IMMER","i eat airborne vehicles","linus trovalds",
"","\(〇_o)/","Nuh Uh!","Yuh Huh","Breaching.",
"I get a narcissistic injury when the wall ignores me","totally not using %s" % version.text]
func SaveEverything():
var Data:Dictionary = {
"Version" : version.text,
"Volume" : volume_slider.value,
"Directory" : CurrentDir,
"CurrIDX" : CurrentIDX,
"Randomized" : Randomized,
"Playing" : music_player.playing,
"SeenWAVDisclaimer" : SeenWAVDisclaimer,
"TimeSpentListening" : TimeSpentListening,
"DiscordRichPresenceEnabled" : DiscordRichPresenceEnabled,
"ReverbEnabled" : settings_menu_child.reverb_check.button_pressed,
"ReverbRoomSize" : settings_menu_child.room_size_slider.value,
"ReverbDampening" : settings_menu_child.dampening_size_slider.value,
"ReverbSpread" : settings_menu_child.spread_size_slider.value,
"CompressionEnabled" : settings_menu_child.compression_check.button_pressed,
"CompressionThreshold" : settings_menu_child.threshold_slider.value ,
"CompressionRatio" : settings_menu_child.ratio_slider.value ,
"CompressionGain" : settings_menu_child.gain_slider.value,
"CurrentCustomBackroundImageDirectory" : CurrentCustomBackroundImageDirectory,
"PlayAllLists" : PlayAllLists,
"DiscordUsername" : DiscordRPC.get_current_user().get("username"),
"UsingPlayingNow" : UsingPlayingNow,
"OverriddenLocale" : overridden_locale
}
print("saving")
saveUserdata(Data)
savePlaylists()
var saveRetrys:int =0
func savePlaylists():
var json = JSON.new()
var file = FileAccess.open("user://playlists.dat", FileAccess.WRITE)
var file2 = FileAccess.open("user://playlistsLocation.dat", FileAccess.WRITE)
@warning_ignore("static_called_on_instance")
if !(Playlists == null) or !(Playlists == {}):
file.store_string(str(json.stringify(Playlists)))
if !(PlaylistsLocation == null) or !(PlaylistsLocation == {}):
file2.store_string(str(json.stringify(PlaylistsLocation)))
if loadUserdata() == {}:
if saveRetrys < 3:
savePlaylists()
else:
printerr("saving failed")
func saveUserdata(content):
var json = JSON.new()
var file = FileAccess.open("user://data.dat", FileAccess.WRITE)
@warning_ignore("static_called_on_instance")
file.store_string(json.stringify(content))
file.close()
var saveLoadTries:int
func loadUserdata() -> Dictionary:
var json = JSON.new()
var file = FileAccess.open("user://data.dat", FileAccess.READ)
var filetext = file.get_as_text() if file != null else null
if file != null:
if file.get_as_text() == "":
return loadingFailed(true)
var content:Dictionary = {}
if json.parse_string(file.get_as_text()) != null:
content = json.parse_string(filetext)
else:
@warning_ignore("static_called_on_instance")
content = json.parse_string(Marshalls.base64_to_utf8(file.get_as_text()))
file.close()
if content != null:
LoadingSaveFailed = false
return content
else:
LoadingSaveFailed = true
return {}
else:
return loadingFailed(false)
func loadingFailed(fullfail:bool = false) -> Dictionary:
if fullfail:
printerr("loading save failed")
if saveLoadTries < 3:
print("retrying")
saveLoadTries +=1
return loadUserdata()
LoadingSaveFailed = fullfail
return {}
var playlistLoadTries:int
func loadPlaylists():
var json = JSON.new()
var file = FileAccess.open("user://playlistsLocation.dat", FileAccess.READ)
var file2 = FileAccess.open("user://playlists.dat", FileAccess.READ)
if !(file and file2):
return
var filetext = file.get_as_text()
print("Playlists")
print(filetext)
#print("shit " + json.parse_string(filetext))
if file.get_as_text() != "" and file2.get_as_text() != "":
var PlaylistsLocationTemp
var PlaylistsTemp
PlaylistsLocationTemp = json.parse_string(file.get_as_text())
PlaylistsTemp = json.parse_string(file2.get_as_text())
if (PlaylistsTemp == null) or (PlaylistsLocationTemp == null):
printerr("Loading playlists failed")
LoadingSaveFailed = true
else:
LoadingSaveFailed = false
Playlists = PlaylistsTemp
PlaylistsLocation = PlaylistsLocationTemp
print(PlaylistsLocation)
print(Playlists.keys())
print("Playlists")
file.close()
file2.close()
+1
View File
@@ -0,0 +1 @@
uid://cvqefw0g6ala7
+4
View File
@@ -0,0 +1,4 @@
extends Button
func _pressed() -> void:
OS.shell_open("https://notdraimdev.github.io/SimplSite/notes.html")
+1
View File
@@ -0,0 +1 @@
uid://bh3btjt2hkbs
+43
View File
@@ -0,0 +1,43 @@
extends Control
@export var ParentScene:MainScene
@export var SongImage:TextureRect
@export var SongNameLabel: RichTextLabel
@export var SongNameScroller:ScrollContainer
@export var SongAuthorScroller:ScrollContainer
@export var SongAuthorLabel: RichTextLabel
@onready var ParentWindow:Window = $".."
@export var update_tick:float = 0.1
@export var slider:HSlider
var ticktime:float
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
ParentScene.SongChanged.connect(SongChanged)
func scroll(scroller:ScrollContainer,incriment:float):
var scroll_h = scroller.get_h_scroll_bar().max_value - scroller.custom_minimum_size.x
if scroll_h !=0:
scroller.scroll_horizontal = wrapi(scroller.scroll_horizontal+incriment,0,\
scroll_h)
return scroller.scroll_horizontal == scroll_h-1 or scroller.scroll_horizontal == 0
return false
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
ticktime -= delta
ParentWindow.size = size
slider.value = ParentScene.current_progress.value
if ticktime <= 0:
ticktime = update_tick
if scroll(SongNameScroller,1):
ticktime = 2
scroll(SongAuthorScroller,1)
func SongChanged():
SongImage.texture = ParentScene.cover.texture
print("SongChanged: ", ParentScene.currentSongName)
SongNameLabel.text = ParentScene.currentSongName
if ParentScene.currentArtistName:
SongAuthorLabel.text = ParentScene.currentArtistName
else:
SongAuthorLabel.text = ""
#ParentWindow.size = size * 2
+1
View File
@@ -0,0 +1 @@
uid://q2gdlr10ncnb
+18
View File
@@ -0,0 +1,18 @@
shader_type canvas_item;
uniform sampler2D alpha;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
COLOR.a = texture(alpha,UV).a;
//COLOR.a = 1.0-((cos((UV.x)*PI*2.0)+1.0)/2.0);
//COLOR.a -= ((cos(UV.y*PI*2.0)+1.0)/2.0);
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}
+1
View File
@@ -0,0 +1 @@
uid://byan4wmg2pjl6
+76
View File
@@ -0,0 +1,76 @@
extends Control
@onready var nameLabel: RichTextLabel = $HSplitContainer/VBoxContainer/Name
@onready var directory: Label = $HSplitContainer/VBoxContainer/Directory
@onready var play_button: Button = $HSplitContainer/HBoxContainer/PlayButton
@onready var file_dialog: FileDialog = $FileDialog
@onready var options_dropdown: MenuButton = $HSplitContainer/HBoxContainer/OptionsDropdown
@onready var confirmation: ConfirmationDialog = $ConfirmationDialog
@onready var Parent:MainScene = get_tree().root.get_child(3)
@export var Current:bool
var PlaylistLocation:String = ""
var PlaylistName:String = ""
var PlaylistSongs:Array = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
CorrectlyName()
options_dropdown.get_popup().id_pressed.connect(dropdown_pressed)
func dropdown_pressed(Idx:int):
match options_dropdown.get_popup().get_item_text(Idx):
"Change Directory":
_on_select_directory_pressed()
"Delete":
confirmation.show()
"Rename":
pass
Parent.SaveEverything()
func Delete():
Parent.PlaylistsLocation.erase(nameLabel.text)
Parent.Playlists.erase(nameLabel.text)
queue_free()
Parent.SaveEverything()
func CorrectlyName():
nameLabel.text = PlaylistName
if !PlaylistLocation == "":
directory.text = PlaylistLocation
else:
directory.text = "Directory not found"
push_error("Directory not found!")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if Parent == null:
push_error("MisMatched REF PLAYLIST DISPLAY")
Parent = owner
if Current:
play_button.disabled = true
play_button.text = "Playing"
else:
play_button.disabled = false
play_button.text = "Play"
if Parent.CurrentPlaylist == PlaylistName:
play_button.disabled = true
func _on_play_button_pressed() -> void:
Parent.PlaylistSelected(PlaylistName,PlaylistLocation)
func _on_select_directory_pressed() -> void:
file_dialog.show()
func _on_file_dialog_dir_selected(dir: String) -> void:
PlaylistLocation = dir
Parent.PlaylistsLocation[PlaylistName] = PlaylistLocation
CorrectlyName()
func _on_confirmation_dialog_confirmed() -> void:
Delete()
+1
View File
@@ -0,0 +1 @@
uid://cs12qambyvou8
+25
View File
@@ -0,0 +1,25 @@
extends Control
@onready var create_playlist: Button = $PlaylistsContainer/VBoxContainer/HBoxContainer/CreatePlaylist
@onready var create_playlists_menu: Control = $"../../CreatePlaylistsMenu"
@onready var play_all: Button = $PlaylistsContainer/VBoxContainer/HBoxContainer/PlayAll
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_create_playlist_pressed() -> void:
create_playlists_menu.show()
func _on_play_all_toggled(toggled_on: bool) -> void:
if toggled_on:
owner.PlayAllLists = true
else:
owner.PlayAllLists = false
+1
View File
@@ -0,0 +1 @@
uid://bxc2fqwlm5ea5
+59
View File
@@ -0,0 +1,59 @@
extends LineEdit
@onready var search_results: SearchResults = $"../SearchResults"
var values:Dictionary = {}
var ErrorMargin:float = 0.9
var updatetime:float = 0.5
var currentTime:float
var TextChanged:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
currentTime -= delta
if TextChanged:
if currentTime < 0:
updateResults()
func updateResults():
release_focus()
TextChanged = false
search_results.clear()
values.clear()
currentTime = updatetime
var _i:int = 0
var _s:int = 0
for song:String in owner.textSongs:
var margin:float
var fragments:Array
#print(int((text.length() / 2.0) + 0.5))
for num in range(int((text.length() / 2.0) + 0.5)):
if text.to_lower().substr(int(num*2),2):
fragments.append(text.to_lower().substr(int(num*2),2))
elif text.to_lower().substr(int(num*2),1):
fragments.append(text.to_lower().substr(int(num*2),1))
var amountOfFrags:int
for fragment:String in fragments:
if song.to_lower().containsn(fragment):
amountOfFrags +=1
margin = float(amountOfFrags) / fragments.size()
if margin > ErrorMargin:
search_results.add_item(song)
values[_i] = _s
_i += 1
_s += 1
func _on_search_results_index_pressed(index: int) -> void:
print("index " + str(index))
owner.SetSong(values[index])
func _on_text_submitted(new_text: String) -> void:
TextChanged = true
if !search_results.visible:
search_results.show()
+1
View File
@@ -0,0 +1 @@
uid://cchutywgopaq4
+33
View File
@@ -0,0 +1,33 @@
extends Control
var SongName:String
var CurrentlyPlaying:bool
var songidx:int
@onready var songname: Button = $HBoxContainer/Songname
@onready var dropdown: Button = $HBoxContainer/Dropdown
@onready var popup_menu: PopupMenu = $PopupMenu
signal PlayPressed
signal DeletePressed
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
songname.text = SongName
popup_menu.index_pressed.connect(popupPressed)
func popupPressed(idx:int):
if idx == 0:
DeletePressed.emit(songidx)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
dropdown.visible = songname.is_hovered() or dropdown.is_hovered()
func _on_songname_pressed() -> void:
PlayPressed.emit(songidx)
func _on_dropdown_pressed() -> void:
popup_menu.show()
popup_menu.position = get_global_mouse_position()
+1
View File
@@ -0,0 +1 @@
uid://c3aaxhp0oim08
+48
View File
@@ -0,0 +1,48 @@
class_name SearchResults
extends Control
signal index_pressed
signal song_deleted
const SEARCH_ITEM = preload("res://Scenes/search_item.tscn")
@onready var item_container: VBoxContainer = $Control/ItemContainer
var SongsAmount:int
@onready var parent:MainScene = owner
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func add_item(text:String):
var child = SEARCH_ITEM.instantiate()
child.SongName = text.replace(".mp3", "")
child.songidx = parent.textSongs.find(text)
SongsAmount+=1
child.PlayPressed.connect(songSelected)
child.DeletePressed.connect(deletePressed)
item_container.add_child(child)
func clear():
SongsAmount = 0
for child in item_container.get_children():
child.queue_free()
func songSelected(idx:int):
index_pressed.emit(idx)
func _input(event):
if (event is InputEventMouseButton) and event.pressed:
var evLocal = make_input_local(event)
if !Rect2(Vector2(0,0),Vector2(size.x,size.y)).has_point(evLocal.position):
hide()
func deletePressed(idx:int):
song_deleted.emit(idx)
+1
View File
@@ -0,0 +1 @@
uid://d0hvudugo3d37
+28
View File
@@ -0,0 +1,28 @@
extends Button
@onready var search_bar: LineEdit = $"../SearchBar"
@onready var songs_menu: Button = $"../SongsMenu"
@export var PressedIcon:Texture2D
@export var NotPressedIcon:Texture2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
search_bar.hide()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_toggled(toggled_on: bool) -> void:
if toggled_on:
search_bar.clear()
search_bar.show()
songs_menu.hide()
icon = PressedIcon
else:
search_bar.hide()
songs_menu.show()
icon = NotPressedIcon
+1
View File
@@ -0,0 +1 @@
uid://c2t3ignwqoplj
+23
View File
@@ -0,0 +1,23 @@
extends Button
@onready var playlists_panel: Control = $"../PlaylistPanelHolder/PlaylistsPanel"
var currentlyExtending:bool
var Target:float = 50
func _process(delta: float) -> void:
if currentlyExtending:
playlists_panel.position.x = clamp(lerp(playlists_panel.position.x,Target,0.25),0,100)
else:
playlists_panel.position.x -=1
playlists_panel.position.x = clamp(lerp(Target,playlists_panel.position.x,1.25),0,100)
playlists_panel.modulate.a = playlists_panel.position.x / Target
if playlists_panel.position.x > 1:
playlists_panel.show()
else:
playlists_panel.hide()
func _on_toggled(toggled_on: bool) -> void:
if toggled_on:
currentlyExtending = true
playlists_panel.position.x = 1
else:
currentlyExtending = false
+1
View File
@@ -0,0 +1 @@
uid://dv2vjibopktug
+195
View File
@@ -0,0 +1,195 @@
class_name Settings
extends Control
@onready var exit: Button = $Exit
# do NOT think i dont hate this codebase, it sucks man 😭
@onready var discord_rich_presence_button: CheckBox = $ScrollContainer/VBoxContainer/DiscordRichPresenceButton
@onready var pitch_slider: HSlider = $ScrollContainer/VBoxContainer/PitchAdjustSettings/PitchSlider
@onready var pitch_value: Label = $ScrollContainer/VBoxContainer/PitchAdjustSettings/PitchAdjustSettings/PitchValue
@onready var reverb_check: CheckBox = $ScrollContainer/VBoxContainer/ReverbCheck
@onready var room_size_slider: HSlider = $ScrollContainer/VBoxContainer/ReverbSettings/SizeAdjustSettings/RoomSizeSlider
@onready var room_size_value: Label = $ScrollContainer/VBoxContainer/ReverbSettings/SizeAdjustSettings/PitchAdjustSettings/RoomSizeValue
@onready var dampening_size_slider: HSlider = $ScrollContainer/VBoxContainer/ReverbSettings/DampeningAdjustSettings/DampeningSizeSlider
@onready var dampening_value: Label = $ScrollContainer/VBoxContainer/ReverbSettings/DampeningAdjustSettings/DampaningAdjustSettings/DampeningValue
@onready var spread_size_slider: HSlider = $ScrollContainer/VBoxContainer/ReverbSettings/SpreadAdjustSettings2/SpreadSizeSlider
@onready var spread_value: Label = $ScrollContainer/VBoxContainer/ReverbSettings/SpreadAdjustSettings2/SpreadAdjustSettings/SpreadValue
@onready var compression_check: CheckBox = $ScrollContainer/VBoxContainer/CompressionCheck
@onready var threshold_slider: HSlider = $ScrollContainer/VBoxContainer/CompressionContainer/ThresholdSettings/ThresholdSlider
@onready var threshold_value: Label = $ScrollContainer/VBoxContainer/CompressionContainer/ThresholdSettings/ThresholdSettings/ThresholdValue
@onready var ratio_slider: HSlider = $ScrollContainer/VBoxContainer/CompressionContainer/RatioSettings/RatioSlider
@onready var ratio_value: Label = $ScrollContainer/VBoxContainer/CompressionContainer/RatioSettings/RatioSettings/RatioValue
@onready var gain_slider: HSlider = $ScrollContainer/VBoxContainer/CompressionContainer/GainSettings/GainSlider
@onready var gain_value: Label = $ScrollContainer/VBoxContainer/CompressionContainer/GainSettings/GainSettings/GainValue
@onready var eq_settings: VBoxContainer = $ScrollContainer/VBoxContainer/EQSettings
@onready var Parent:MainScene = get_parent().owner
@onready var reverb_settings: VBoxContainer = $ScrollContainer/VBoxContainer/ReverbSettings
@onready var compression_container: VBoxContainer = $ScrollContainer/VBoxContainer/CompressionContainer
@onready var time_listening_label: Label = $ScrollContainer/VBoxContainer/TimeListening
@onready var scroll_container: ScrollContainer = $ScrollContainer
@onready var select_bg_dialog: FileDialog = $ScrollContainer/VBoxContainer/SelectBGDialog
@onready var backround_dir_label: Label = $ScrollContainer/VBoxContainer/VBoxContainer/HBoxContainer2/BackroundDirLabel
@onready var select_bg: Button = $ScrollContainer/VBoxContainer/VBoxContainer/HBoxContainer/SelectBG
@onready var reset_bg: Button = $ScrollContainer/VBoxContainer/VBoxContainer/HBoxContainer/ResetBG
@onready var now_playing_window_button: CheckBox = $ScrollContainer/VBoxContainer/NowPlayingWindowButton
var CurrentBGImagePath:String
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
now_playing_window_button.button_pressed = Parent.UsingPlayingNow
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pitch_value.text = str(pitch_slider.value)
room_size_value.text = str(room_size_slider.value)
dampening_value.text = str(dampening_size_slider.value)
spread_value.text = str(spread_size_slider.value)
ratio_value.text ="1:" + str(ratio_slider.value)
gain_value.text = str(gain_slider.value)
threshold_value.text = str(threshold_slider.value)
if reverb_check.button_pressed:
reverb_settings.show()
else:
reverb_settings.hide()
if compression_check.button_pressed:
compression_container.show()
else:
compression_container.hide()
time_listening_label.text = tr("LISTENING_TIME") + " %s!" % str(str(int(Parent.TimeSpentListening/60)/60 )
+ "h : " + str((int(Parent.TimeSpentListening) / 60) % 60) + "m : " +
str(int(Parent.TimeSpentListening) % 60) + "s")
# VOLUME
func _on_h_slider_drag_ended(value_changed: bool) -> void:
get_parent().owner.music_player.pitch_scale = pitch_slider.value
Parent.SaveEverything()
func _on_exit_pressed() -> void:
Parent.find_child("SettingsButton").button_pressed = false
Parent.SaveEverything()
#region Reverb
func _on_reverb_check_toggled(toggled_on: bool) -> void:
if toggled_on:
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index("Music"),0,true)
else:
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index("Music"),0,false)
Parent.SaveEverything()
func _on_room_size_slider_drag_ended(value_changed: bool) -> void:
var Reverb:AudioEffectReverb = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),0)
Reverb.room_size = room_size_slider.value
Parent.SaveEverything()
func _on_dampening_size_slider_drag_ended(value_changed: bool) -> void:
var Reverb:AudioEffectReverb = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),0)
Reverb.damping = room_size_slider.value
Parent.SaveEverything()
func _on_spread_size_slider_drag_ended(value_changed: bool) -> void:
var Reverb:AudioEffectReverb = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),0)
Reverb.spread = room_size_slider.value
Parent.SaveEverything()
#endregion
#region Compression
func _on_compression_check_toggled(toggled_on: bool) -> void:
if toggled_on:
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index("Music"),2,true)
else:
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index("Music"),2,false)
Parent.SaveEverything()
func _on_gain_slider_drag_ended(value_changed: bool) -> void:
var Compression:AudioEffectCompressor = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),2)
Compression.gain = gain_slider.value
Parent.SaveEverything()
func _on_ratio_slider_drag_ended(value_changed: bool) -> void:
var Compression:AudioEffectCompressor = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),2)
Compression.ratio = ratio_slider.value
Parent.SaveEverything()
func _on_threshold_slider_drag_ended(value_changed: bool) -> void:
var Compression:AudioEffectCompressor = AudioServer.get_bus_effect(AudioServer.get_bus_index("Music"),2)
Compression.threshold = threshold_slider.value
Parent.SaveEverything()
#endregion
func _on_eq_check_box_toggled(toggled_on: bool) -> void:
eq_settings.visible = toggled_on
AudioServer.set_bus_effect_enabled(AudioServer.get_bus_index("Music"),1,toggled_on)
func _on_discord_rich_presence_button_toggled(toggled_on: bool) -> void:
if toggled_on:
Parent.DiscordRichPresenceEnabled = true
else:
Parent.DiscordRichPresenceEnabled = false
Parent.setUpDiscord()
Parent.SaveEverything()
func _on_reset_pressed() -> void:
gain_slider.value = 0
reverb_check.button_pressed = false
room_size_slider.value = 0.8
dampening_size_slider.value = 0.8
spread_size_slider.value = 0.8
compression_check.button_pressed = false
threshold_slider.value = -9.15
ratio_slider.value = 4
gain_slider.value = 0
pitch_slider.value = 1
get_parent().owner.music_player.pitch_scale = 1
func _on_select_bg_pressed() -> void:
select_bg_dialog.show()
Parent.SaveEverything()
func _on_select_bg_dialog_file_selected(path: String) -> void:
CurrentBGImagePath = path
Parent.CurrentCustomBackroundImageDirectory = path
backround_dir_label.text = path
#print(path)
if !path.ends_with(".gif"):
Parent.user_bg.texture = ImageTexture.create_from_image(Image.load_from_file(CurrentBGImagePath))
else:
Parent.user_bg.texture = GifManager.animated_texture_from_file(path)
Parent.SaveEverything()
func _on_reset_bg_pressed() -> void:
backround_dir_label.text = ""
Parent.user_bg.texture = null
Parent.CurrentCustomBackroundImageDirectory = ""
Parent.SaveEverything()
func _on_now_playing_window_button_toggled(toggled_on: bool) -> void:
Parent.UsingPlayingNow = toggled_on
Parent.SaveEverything()
+1
View File
@@ -0,0 +1 @@
uid://vnpslgl788du
+25
View File
@@ -0,0 +1,25 @@
extends Button
@onready var settings_popup: Control = $"../SettingsHolder/SettingsPopup"
var currentlyExtending:bool
var Target:float = 50
func _process(delta: float) -> void:
if currentlyExtending:
settings_popup.position.y = clamp(lerp(settings_popup.position.y,Target,0.25),0,100)
else:
settings_popup.position.y -=1
settings_popup.position.y = clamp(lerp(Target,settings_popup.position.y,1.25),0,100)
settings_popup.modulate.a = settings_popup.position.y / Target
if settings_popup.position.y > 1:
settings_popup.show()
else:
settings_popup.hide()
func _on_toggled(toggled_on: bool) -> void:
print("@@")
if toggled_on:
currentlyExtending = true
settings_popup.position.y = 1
else:
currentlyExtending = false
+1
View File
@@ -0,0 +1 @@
uid://xnlvpxy2jwxb
+20
View File
@@ -0,0 +1,20 @@
extends Button
@onready var search_results: SearchResults = $"../SearchResults"
@onready var parent:MainScene = owner
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _pressed() -> void:
if search_results.SongsAmount != parent.textSongs.size():
search_results.clear()
for song in parent.textSongs:
var nam = song
search_results.add_item(nam)
search_results.show()
+1
View File
@@ -0,0 +1 @@
uid://dkjp64f01dpf4
+134
View File
@@ -0,0 +1,134 @@
extends Control
@onready var Parent:MainScene = get_tree().root.get_child(3)
@onready var version: Label = $"../Version"
@onready var http_request := $HTTPRequest as HTTPRequest
@onready var download_request: HTTPRequest = $DownloadRequest
@onready var link_button: Button = $ColorRect/LinkButton
@onready var update_available_text: Label = $ColorRect/UpdateAvailableText
@onready var updating_notification: Control = $"../UpdatingNotification"
@onready var errorLabel: Label = $"../UpdatingNotification/Error"
@onready var updating_bg: ColorRect = $"../UpdatingBG"
@onready var paused_indicator: TextureRect = $"../PausedIndicator"
@onready var patchnotes: RichTextLabel = $ColorRect/Patchnotes
@onready var link_bttnbg: ColorRect = $ColorRect/LinkButton/LinkBTTNBG
@onready var patchnotes_bg: ColorRect = $ColorRect/Patchnotes/PatchnotesBG
@export var errorColor:Color
@export var IMPUpdateLinkColor:Color
@export var IMPUpdatePatchNotesColor:Color
var CheckForUpdates:bool = true
var updateLink:String
# The GitHub releases API only allows 60 unauthenticated requests per hour,
const UPDATE_THROTTLE = 600
func _ready() -> void:
hide()
if CheckForUpdates:
check_for_updates()
func check_for_updates() -> void:
print("! INFO: Checking for updates…")
var error := http_request.request(
"https://api.github.com/repos/realbucketofchicken/Simplaudio/releases/latest"
)
if error != OK:
push_error("! a client error occurred")
errorLabel.text = tr("UPD_ERR_CLT")
func _on_http_request_completed(result: int, _response_code: int, _headers: PackedStringArray, body: PackedByteArray) -> void:
if result != HTTPRequest.RESULT_SUCCESS:
# The request failed for any reason, abort
push_error("! Couldn't check for updates")
return
else:
print("! Update check successful")
var json = JSON.new()
var result2 = json.parse_string(str(body.get_string_from_utf8()))
print("! AHHH " + str(result2))
if result2.has("tag_name"):
if result2["tag_name"] != version.text:
update_available_text.text = result2["tag_name"] + tr("UPDT_OUT_END")
show()
updateLink = result2["html_url"]
if result2.has("body"):
patchnotes.text = str(result2["body"])
if patchnotes.text.contains("(!IT)"):
patchnotes.text = patchnotes.text.erase(patchnotes.text.find("(!IT)"),7)
print("import-aint update detected")
update_available_text.text = tr("IMPORTANT") + " " + result2["tag_name"] + tr("UPDT_OUT_END")
patchnotes_bg.color = IMPUpdatePatchNotesColor
link_bttnbg.color = IMPUpdateLinkColor
link_bttnbg.StandardColor = IMPUpdateLinkColor
func _on_close_buen_pressed() -> void:
hide()
func _on_link_button_pressed() -> void:
link_button.disabled = true
link_button.text = tr("UPD_UPDATING")
updating_notification.show()
updating_bg.show()
paused_indicator.hide()
var exepath:PackedStringArray = OS.get_executable_path().split("/")
var path:String = GetLocalPath()
print(OS.get_executable_path())
if !OS.has_feature("editor"):
download_request.download_file = path + "download.zip"
var DownloadLink:String
if OS.get_name() == "Windows":
DownloadLink = "https://github.com/notdraimdev/Simplaudio/releases/latest/download/Windows.zip"
elif OS.get_name() == "Linux":
DownloadLink = "https://github.com/notdraimdev/Simplaudio/releases/latest/download/Linux.zip"
if DownloadLink.is_empty() != true:
var error = download_request.request(DownloadLink
)
if error != OK:
print("! DOWNLOAD ERROR: " + str(error))
errorLabel.text = tr("UPD_ERR_CODE") + str(error)
errorLabel.label_settings.font_color = errorColor
else:
errorLabel.text = "downloading..."
else:
push_error("OS NOT SUPPORTED, you should not get this error but you did, congrat!")
OS.shell_open(updateLink)
func _on_download_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
if result != HTTPRequest.RESULT_SUCCESS:
print("! Something went wrong server side: " + str(result))
errorLabel.text = tr("UPD_ERR_CODE") + str(result)
errorLabel.label_settings.font_color = errorColor
return
else:
errorLabel.text = tr("UPD_UNZIP_PANT")
print("works as expected brotha")
var unzipper:ZIPReader = ZIPReader.new() # sus
unzipper.open(GetLocalPath()+"download.zip")
var files:PackedStringArray = unzipper.get_files()
for file in files:
var actualfile = file.replace("Linux/","").replace("Windows/","").replace("Android/","")
print("FILE: " + actualfile)
var FileAcess:FileAccess = FileAccess.open(GetLocalPath() + actualfile,FileAccess.WRITE_READ)
if FileAcess != null:
var downloadedfile = unzipper.read_file(file)
FileAcess.store_buffer(downloadedfile)
print("FOUND FILE: " + GetLocalPath()+file)
#FileAcess.store_string()
unzipper.close()
OS.shell_open(OS.get_executable_path())
get_tree().root.close_requested.emit()
get_tree().root.queue_free()
func GetLocalPath() -> String:
var exepath:PackedStringArray = OS.get_executable_path().split("/")
var path:String
for sting in (exepath.size()-1):
path += exepath[sting] + "/"
return path
+1
View File
@@ -0,0 +1 @@
uid://drqx8pjalsxqr
+33
View File
@@ -0,0 +1,33 @@
extends Button
@onready var volume_slider: VSlider = $"../VolumeSlider"
var BaseOffsetPX:int = 4
var Target:float = 200
var currentlyExtending:bool
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
volume_slider.hide()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if currentlyExtending:
volume_slider.size.y = lerp(volume_slider.size.y,Target,0.25)
else:
volume_slider.size.y -=3
volume_slider.size.y = lerp(Target,volume_slider.size.y,1.25)
volume_slider.position.y = (BaseOffsetPX- 90) - volume_slider.size.y + (owner.size.y)
volume_slider.self_modulate.a = volume_slider.size.y / 200
if volume_slider.size.y > 15:
volume_slider.show()
else:
volume_slider.hide()
func _on_toggled(toggled_on: bool) -> void:
if toggled_on:
volume_slider.show()
currentlyExtending = true
else:
currentlyExtending = false
volume_slider.size.y = 192
+1
View File
@@ -0,0 +1 @@
uid://ctj7miuviibin
+36
View File
@@ -0,0 +1,36 @@
extends Node2D
@export var Daytime:Control#1
@export var Evening:Control#2
@export var Nighttime:Control#3
var currentBG:int
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var timeInHours = Time.get_datetime_dict_from_system()["hour"]
if timeInHours < 6:
currentBG = 3
elif timeInHours >= 6 and timeInHours <= 9:
currentBG = 2
elif timeInHours >= 9 and timeInHours <= 17:
currentBG = 1
elif timeInHours >= 17 and timeInHours <= 21:
currentBG = 2
elif timeInHours > 21:
currentBG = 3
if currentBG == 1:
Daytime.show()
Nighttime.hide()
Evening.hide()
elif currentBG == 2:
Daytime.hide()
Nighttime.hide()
Evening.show()
elif currentBG == 3:
Daytime.hide()
Nighttime.show()
Evening.hide()
+1
View File
@@ -0,0 +1 @@
uid://b4mmbu4weiab5
+11
View File
@@ -0,0 +1,11 @@
extends Window
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
show()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
+1
View File
@@ -0,0 +1 @@
uid://cjjiclahlyxii
+90
View File
@@ -0,0 +1,90 @@
extends Button
@onready var youtube_menu_holder: Control = $"../YoutubeMenuHolder"
@onready var youtube_menu: Control = $"../YoutubeMenuHolder/Youtube menu"
@onready var yt_link: LineEdit = $"../YoutubeMenuHolder/Youtube menu/YTLink"
@onready var yt_download: Button = $"../YoutubeMenuHolder/Youtube menu/YTDownload"
@onready var loading_img: Sprite2D = $"../YoutubeMenuHolder/Youtube menu/LoadingIMG"
var currentlyExtending:bool
var Target:float = 50
var downloadList:bool = false
signal ContinueProcess
@onready var Parent:MainScene = get_tree().root.get_child(3)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
YtDlp.setup_completed.connect(YTSetupCompleted)
yt_download.pressed.connect(DownloadYTVidFromLink)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if currentlyExtending:
youtube_menu.position.x = clamp(lerp(youtube_menu.position.x,Target,0.25),0,100)
else:
youtube_menu.position.x -=1
youtube_menu.position.x = clamp(lerp(Target,youtube_menu.position.x,1.25),0,100)
youtube_menu.modulate.a = youtube_menu.position.x / Target
if youtube_menu.position.x > 1:
youtube_menu.show()
else:
youtube_menu.hide()
func YTSetupCompleted():
if owner.ShowInstallAlerts:
OS.alert("Youtube setup completed, from now on its safe to close the app","youtube setup")
loading_img.hide()
yt_download.disabled = false
func DownloadPlaylistConf():
downloadList = true
ContinueProcess.emit()
func DownloadSingleSongConf():
ContinueProcess.emit()
func DownloadYTVidFromLink():
if yt_link.text.is_empty():
OS.alert("please gimme a link")
return
if "list=" in yt_link.text:
Parent.playlist_or_song.show()
Parent.playlist_or_song.confirmed.connect(DownloadPlaylistConf)
Parent.playlist_or_song.canceled.connect(DownloadSingleSongConf)
await ContinueProcess
print(yt_link.text)
var download:YtDlp.Download = YtDlp.download(yt_link.text)
if download == null:
OS.alert("youtube setup has not finished, please wait for the finish notification")
return
loading_img.show()
yt_link.clear()
download.set_destination(owner.PlaylistsLocation[owner.CurrentPlaylist])
print(owner.PlaylistsLocation[owner.CurrentPlaylist])
download.convert_to_audio(YtDlp.Audio.MP3)
download._download_playlist = downloadList
download.start()
yt_download.disabled = true
download.completely_finished.connect(DownloadCompleted)
func DownloadCompleted():
yt_download.disabled = false
owner.GetSongs(owner.PlaylistsLocation[owner.CurrentPlaylist])
loading_img.hide()
func _on_toggled(toggled_on: bool) -> void:
if !YtDlp.is_setup():
yt_download.disabled = true
if YtDlp.FilesMissing():
print("Need to install")
owner.ShowInstallAlerts = true
OS.alert("ONE TIME SETUP, PLEASE DONT CLOSE THE MUSIC PLAYER","yt-dl and ffmpeg setup")
YtDlp.setup()
loading_img.show()
if toggled_on:
currentlyExtending = true
youtube_menu.position.x = 1
else:
currentlyExtending = false
+1
View File
@@ -0,0 +1 @@
uid://chdf40dyj73pq