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
Commit
69f741e8
authored
Aug 08, 2022
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 &)
...
@@ -338,6 +338,7 @@ handle_setvol(Client &client, Request args, Response &)
auto
&
partition
=
client
.
GetPartition
();
auto
&
partition
=
client
.
GetPartition
();
partition
.
mixer_memento
.
SetVolume
(
partition
.
outputs
,
level
);
partition
.
mixer_memento
.
SetVolume
(
partition
.
outputs
,
level
);
partition
.
EmitIdle
(
IDLE_MIXER
);
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
}
}
...
@@ -362,8 +363,10 @@ handle_volume(Client &client, Request args, Response &r)
...
@@ -362,8 +363,10 @@ handle_volume(Client &client, Request args, Response &r)
else
if
(
new_volume
>
100
)
else
if
(
new_volume
>
100
)
new_volume
=
100
;
new_volume
=
100
;
if
(
new_volume
!=
old_volume
)
if
(
new_volume
!=
old_volume
)
{
mixer_memento
.
SetVolume
(
outputs
,
new_volume
);
mixer_memento
.
SetVolume
(
outputs
,
new_volume
);
partition
.
EmitIdle
(
IDLE_MIXER
);
}
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
}
}
...
...
src/mixer/Memento.cxx
View file @
69f741e8
...
@@ -68,8 +68,6 @@ MixerMemento::SetVolume(MultipleOutputs &outputs, unsigned volume)
...
@@ -68,8 +68,6 @@ MixerMemento::SetVolume(MultipleOutputs &outputs, unsigned volume)
volume_software_set
=
volume
;
volume_software_set
=
volume
;
idle_add
(
IDLE_MIXER
);
SetHardwareVolume
(
outputs
,
volume
);
SetHardwareVolume
(
outputs
,
volume
);
}
}
...
...
src/mixer/Memento.hxx
View file @
69f741e8
...
@@ -49,6 +49,8 @@ public:
...
@@ -49,6 +49,8 @@ public:
/**
/**
* Throws on error.
* Throws on error.
*
* Note: the caller is responsible for emitting #IDLE_MIXER.
*/
*/
void
SetVolume
(
MultipleOutputs
&
outputs
,
unsigned
volume
);
void
SetVolume
(
MultipleOutputs
&
outputs
,
unsigned
volume
);
...
...
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