Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
69f741e8
You need to sign in or sign up before continuing.
Commit
69f741e8
authored
2 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mixer/Memento: move IDLE_MIXER out of SetVolume()
Make this idle event per-partition.
parent
4b4f4700
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
OtherCommands.cxx
src/command/OtherCommands.cxx
+4
-1
Memento.cxx
src/mixer/Memento.cxx
+0
-2
Memento.hxx
src/mixer/Memento.hxx
+2
-0
No files found.
src/command/OtherCommands.cxx
View file @
69f741e8
...
...
@@ -338,6 +338,7 @@ handle_setvol(Client &client, Request args, Response &)
auto
&
partition
=
client
.
GetPartition
();
partition
.
mixer_memento
.
SetVolume
(
partition
.
outputs
,
level
);
partition
.
EmitIdle
(
IDLE_MIXER
);
return
CommandResult
::
OK
;
}
...
...
@@ -362,8 +363,10 @@ handle_volume(Client &client, Request args, Response &r)
else
if
(
new_volume
>
100
)
new_volume
=
100
;
if
(
new_volume
!=
old_volume
)
if
(
new_volume
!=
old_volume
)
{
mixer_memento
.
SetVolume
(
outputs
,
new_volume
);
partition
.
EmitIdle
(
IDLE_MIXER
);
}
return
CommandResult
::
OK
;
}
...
...
This diff is collapsed.
Click to expand it.
src/mixer/Memento.cxx
View file @
69f741e8
...
...
@@ -68,8 +68,6 @@ MixerMemento::SetVolume(MultipleOutputs &outputs, unsigned volume)
volume_software_set
=
volume
;
idle_add
(
IDLE_MIXER
);
SetHardwareVolume
(
outputs
,
volume
);
}
...
...
This diff is collapsed.
Click to expand it.
src/mixer/Memento.hxx
View file @
69f741e8
...
...
@@ -49,6 +49,8 @@ public:
/**
* Throws on error.
*
* Note: the caller is responsible for emitting #IDLE_MIXER.
*/
void
SetVolume
(
MultipleOutputs
&
outputs
,
unsigned
volume
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment