asingcrow/godot/Components/BundlePost.gd

92 lines
2.4 KiB
GDScript3
Raw Normal View History

2020-09-27 20:58:03 +00:00
extends Node
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var SongTitle = ""
var SongArtist = ""
var CompletionType
var Tags = ""
var OriginalURL = ""
var PartsURLs = []
var PartsVolumes = []
var PartsDelays = []
var PartsOthers = []
var BackVolume = 0
enum CompletionTypeOptions {
OpenSeed,
SoloCompletion,
DuetCompletion,
AllHarmony,
AllMelody
}
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func setSongTitle(value):
SongTitle = value
func setSongArtist(value):
SongArtist = value
func setCompletionType(value):
CompletionType = value
func setTags(value):
Tags = value
func setOriginalURL(value):
OriginalURL = value
func setPartsURLs(value):
PartsURLs = value
func setPartsVolumes(value):
PartsVolumes = value
func setPartsDelays(value):
PartsDelays = value
func setBackVolume(value):
BackVolume = value
func getFinalText():
var completiontext = ""
var partof = ""
match CompletionType :
CompletionTypeOptions.OpenSeed:
completiontext = " and it's not complete until you sing the rest of it with me!"
partof = "part of "
CompletionTypeOptions.SoloCompletion:
completiontext = " let me know what you think!"
CompletionTypeOptions.DuetCompletion:
completiontext = " with "+PartsOthers+" and it sounds great, don't you think!?"
CompletionTypeOptions.AllHarmony:
partof = "only the harmonies of "
completiontext = " and would love someone to put the melody on top!"
CompletionTypeOptions.AllMelody:
partof = "only the melody of "
completiontext = " and would love someone to put some harmonies underneath!"
var partstext = "The audio track are attached"
if len(PartsURLs) > 0:
partstext = "The audio track urls are :"
for parturl in PartsURLs:
partstext += " "+parturl
partstext += ".\n"
var volumetext = "Backing volume recommendation: "+String(BackVolume)+"db. Parts volume recommendations: "
for partvolume in PartsVolumes:
volumetext += String(partvolume)+"db, "
volumetext += ".\n"
var partdelaytext = "Audio delay recommendations: "
for partDelay in PartsDelays:
partdelaytext += String(partDelay)+"s, "
return "Hey, I sang "+partof+SongTitle+" by "+SongArtist+" at "+OriginalURL+completiontext+" "+\
"\nWith #ASingCrow, you can join it and other songs.\n"+partstext+volumetext+partdelaytext+" "+Tags
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass