Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
ae922638
Commit
ae922638
authored
Sep 25, 2023
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
audio config: add speaker eq on/off setting
parent
581949a5
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
python_payload/apps/audio_config/__init__.py
+19
-1
19 additions, 1 deletion
python_payload/apps/audio_config/__init__.py
python_payload/st3m/settings.py
+5
-2
5 additions, 2 deletions
python_payload/st3m/settings.py
sim/fakes/audio.py
+4
-0
4 additions, 0 deletions
sim/fakes/audio.py
with
28 additions
and
3 deletions
python_payload/apps/audio_config/__init__.py
+
19
−
1
View file @
ae922638
...
...
@@ -21,7 +21,7 @@ class App(Application):
self
.
angle
=
0
self
.
focused_widget
=
1
self
.
active
=
False
self
.
num_widgets
=
1
1
self
.
num_widgets
=
1
2
self
.
overhang
=
-
70
self
.
line_height
=
24
self
.
input
.
buttons
.
app
.
left
.
repeat_enable
(
800
,
300
)
...
...
@@ -131,6 +131,19 @@ class App(Application):
ctx
.
text
(
str
(
no
)[:
4
]
+
unit
)
return
ret
def
draw_boolean
(
self
,
label
,
value
,
on_str
=
"
on
"
,
off_str
=
"
off
"
):
ctx
=
self
.
ctx
self
.
draw_widget
(
label
)
if
self
.
widget_no
==
self
.
focused_widget
and
self
.
active
:
value
=
not
value
self
.
active
=
False
if
value
:
ctx
.
text
(
on_str
)
else
:
ctx
.
text
(
off_str
)
return
value
def
draw_bg
(
self
):
ctx
=
self
.
ctx
ctx
.
gray
(
1.0
)
...
...
@@ -264,6 +277,11 @@ class App(Application):
audio
.
speaker_set_maximum_volume_dB
(
tmp
)
settings
.
num_speaker_max_db
.
set_value
(
audio
.
speaker_get_maximum_volume_dB
())
tmp
=
self
.
draw_boolean
(
"
speaker eq
"
,
settings
.
onoff_speaker_eq_on
.
value
)
if
settings
.
onoff_speaker_eq_on
.
value
!=
tmp
:
audio
.
speaker_set_eq_on
(
tmp
)
settings
.
onoff_speaker_eq_on
.
set_value
(
tmp
)
self
.
delta_ms
=
0
self
.
select_pressed
=
False
self
.
left_pressed
=
False
...
...
This diff is collapsed.
Click to expand it.
python_payload/st3m/settings.py
+
5
−
2
View file @
ae922638
...
...
@@ -231,15 +231,17 @@ num_headphones_min_db = StringTunable(
"
Min Headphone Volume dB
"
,
"
system.audio.headphones_min_dB
"
,
-
45
)
num_speaker_min_db
=
StringTunable
(
"
Min Speaker Volume dB
"
,
"
system.audio.speaker
s
_min_dB
"
,
-
40
"
Min Speaker Volume dB
"
,
"
system.audio.speaker_min_dB
"
,
-
40
)
num_headphones_max_db
=
StringTunable
(
"
Max Headphone Volume dB
"
,
"
system.audio.headphones_max_dB
"
,
3
)
num_speaker_max_db
=
StringTunable
(
"
Max Speaker Volume dB
"
,
"
system.audio.speaker
s
_max_dB
"
,
14
"
Max Speaker Volume dB
"
,
"
system.audio.speaker_max_dB
"
,
14
)
onoff_speaker_eq_on
=
StringTunable
(
"
Speaker EQ On
"
,
"
system.audio.speaker_eq_on
"
,
True
)
num_display_brightness
=
StringTunable
(
"
Display Brightness
"
,
"
system.appearance.display_brightness
"
,
100
)
...
...
@@ -275,6 +277,7 @@ load_save_settings: List[UnaryTunable] = [
num_speaker_min_db
,
num_headphones_max_db
,
num_speaker_max_db
,
onoff_speaker_eq_on
,
num_display_brightness
,
num_leds_brightness
,
num_leds_speed
,
...
...
This diff is collapsed.
Click to expand it.
sim/fakes/audio.py
+
4
−
0
View file @
ae922638
...
...
@@ -40,6 +40,10 @@ def speaker_set_maximum_volume_dB(v: float) -> None:
pass
def
speaker_set_eq_on
(
enable
:
bool
)
->
None
:
pass
def
adjust_volume_dB
(
v
)
->
float
:
global
_volume
_volume
+=
v
...
...
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