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

Ajout des patterns

parent b29de6ee
Branches
No related tags found
No related merge requests found
debug = True debug = True
filesExtension = ".wav" filesExtension = ".wav"
blankPauseDuration = 0.1 blankPauseDuration = 0
musicMinIntroDelay = 10
musicMaxIntroDelay = 20
introFolder = "intro" introFolder = "intro"
# Regex # Regex
...@@ -10,3 +12,9 @@ generalPattern = "(general)|(GENERAL_([0-9]){2})" ...@@ -10,3 +12,9 @@ generalPattern = "(general)|(GENERAL_([0-9]){2})"
musicPatten = "^(?:(?!(" + idPattern + "|" + monoSoloPattern + "|" + generalPattern + "|(.*([A-Z])_([0-9]){2})|intro|to|time)).)+$" musicPatten = "^(?:(?!(" + idPattern + "|" + monoSoloPattern + "|" + generalPattern + "|(.*([A-Z])_([0-9]){2})|intro|to|time)).)+$"
musicIntro = "REPLACEMEWITHMSUICTITLE_([0-9]){2}" 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: ...@@ -23,9 +23,9 @@ class Radio:
self.musics = defs.getFilesByRegex(self.filesPath, config.musicPatten) self.musics = defs.getFilesByRegex(self.filesPath, config.musicPatten)
def play(self): def play(self):
for id in self.ids: while True:
defs.playSound(id) defs.playSound(random.choice(self.ids))
defs.playSound(random.choice(self.monoSolos)) defs.playSound(random.choice(self.generals))
music = random.choice(self.musics) music = random.choice(self.musics)
# Get all after last / and before last . # Get all after last / and before last .
...@@ -33,7 +33,8 @@ class Radio: ...@@ -33,7 +33,8 @@ class Radio:
print("Playing: " + musicName) print("Playing: " + musicName)
defs.playSound(random.choice(defs.getMusicIntroFiles(self.filesPath, musicName))) defs.playSound(random.choice(defs.getMusicIntroFiles(self.filesPath, musicName)))
defs.playSound(music) defs.playSound(music)
defs.playSound(random.choice(self.generals)) defs.playSound(random.choice(self.monoSolos))
radiosStations = ["non-stop-pop"] radiosStations = ["non-stop-pop"]
chosenRadio = random.choice(radiosStations) 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