Skip to content

Commit

Permalink
Merge pull request #65 from Fred-Redstone-2/fix-spam-gen
Browse files Browse the repository at this point in the history
Fix spam gen
  • Loading branch information
Fred-Redstone-2 authored May 21, 2024
2 parents ea028a3 + 6a6db78 commit 3ef5907
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/ca/qc/bdeb/sim204/smartsounds/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
composition = Composition()
partitionGeneree = False
midi_genere = False
en_gen = False
partition_raw = Image
titreComposition = ""

Expand Down Expand Up @@ -170,21 +171,24 @@ def tonalite_change(event):
## GÉNÉRATION DE PARTITION
# Assigne un Thread à la génération de partition, pour que l'interface ne gèle pas
def commande_generer():
t = Thread(target=generer)
t.start()
if not en_gen:
t = Thread(target=generer)
t.start()


# Génère la partition à partir de la composition générée
def generer():
global partitionGeneree, titreComposition
global partitionGeneree, titreComposition, en_gen
if titre.get("1.0", "end-1c") == "":
tk.messagebox.showinfo("Attention!", "Le titre ne peut pas être vide!")
else:
en_gen = True
titreComposition = titre.get("1.0", "end-1c")
generer_composition()
GenerateurPartition.generer_png(composition)
partitionGeneree = True
rafraichir_image()
en_gen = False


# Convertit la tonalité en format international, puis appelle la génération de partition
Expand Down

0 comments on commit 3ef5907

Please sign in to comment.