Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Python-GTAV-Radios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Lasri
Python-GTAV-Radios
Commits
2969e085
Commit
2969e085
authored
2 years ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
Ajout des patterns
parent
b29de6ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config.py
+10
-2
10 additions, 2 deletions
config.py
radio.py
+5
-4
5 additions, 4 deletions
radio.py
with
15 additions
and
6 deletions
config.py
+
10
−
2
View file @
2969e085
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
"
]
This diff is collapsed.
Click to expand it.
radio.py
+
5
−
4
View file @
2969e085
...
...
@@ -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
.
monoSolo
s
))
while
True
:
defs
.
playSound
(
random
.
choice
(
self
.
ids
)
)
defs
.
playSound
(
random
.
choice
(
self
.
general
s
))
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment