Skip to content
Snippets Groups Projects
Commit 2969e085 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Ajout des patterns

parent b29de6ee
No related branches found
No related tags found
No related merge requests found
debug = True
filesExtension = ".wav"
blankPauseDuration = 0.1
blankPauseDuration = 0
musicMinIntroDelay = 10
musicMaxIntroDelay = 20
introFolder = "intro"
# Regex
......@@ -10,3 +12,9 @@ generalPattern = "(general)|(GENERAL_([0-9]){2})"
musicPatten = "^(?:(?!(" + idPattern + "|" + monoSoloPattern + "|" + generalPattern + "|(.*([A-Z])_([0-9]){2})|intro|to|time)).)+$"
musicIntro = "REPLACEMEWITHMSUICTITLE_([0-9]){2}"
# Radio specific
musicPatterns = ["ID, GENERAL, (MUSIC, INTRO)", "ID, (MUSIC, INTRO)", "GENERAL, (MUSIC, INTRO)",
"ID, GENERAL, (MUSIC, INTRO)"]
adsAndNewsPatterns = ["AD, AD, NEWS", "NEWS", "MONO_SOLO, AD", "AD, MONO_SOLO", "MONO_SOLO, NEWS", "NEWS, MONO_SOLO"]
......@@ -23,9 +23,9 @@ class Radio:
self.musics = defs.getFilesByRegex(self.filesPath, config.musicPatten)
def play(self):
for id in self.ids:
defs.playSound(id)
defs.playSound(random.choice(self.monoSolos))
while True:
defs.playSound(random.choice(self.ids))
defs.playSound(random.choice(self.generals))
music = random.choice(self.musics)
# Get all after last / and before last .
......@@ -33,7 +33,8 @@ class Radio:
print("Playing: " + musicName)
defs.playSound(random.choice(defs.getMusicIntroFiles(self.filesPath, musicName)))
defs.playSound(music)
defs.playSound(random.choice(self.generals))
defs.playSound(random.choice(self.monoSolos))
radiosStations = ["non-stop-pop"]
chosenRadio = random.choice(radiosStations)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment