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
864d26cd
Commit
864d26cd
authored
May 06, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bind' of
git://github.com/neheb/MPD
parents
ba576ffa
e6a77e12
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
41 additions
and
45 deletions
+41
-45
Count.cxx
src/db/Count.cxx
+8
-10
DatabasePlaylist.cxx
src/db/DatabasePlaylist.cxx
+0
-1
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+17
-10
DatabaseQueue.cxx
src/db/DatabaseQueue.cxx
+2
-2
Helpers.cxx
src/db/Helpers.cxx
+3
-4
Mount.cxx
src/db/plugins/simple/Mount.cxx
+6
-8
DecoderPrint.cxx
src/decoder/DecoderPrint.cxx
+2
-2
Thread.cxx
src/decoder/Thread.cxx
+3
-5
Dop.cxx
src/pcm/Dop.cxx
+0
-1
Dsd16.cxx
src/pcm/Dsd16.cxx
+0
-1
Dsd32.cxx
src/pcm/Dsd32.cxx
+0
-1
No files found.
src/db/Count.cxx
View file @
864d26cd
...
@@ -89,10 +89,8 @@ GroupCountVisitor(TagCountMap &map, TagType group,
...
@@ -89,10 +89,8 @@ GroupCountVisitor(TagCountMap &map, TagType group,
const
LightSong
&
song
)
noexcept
const
LightSong
&
song
)
noexcept
{
{
const
Tag
&
tag
=
song
.
tag
;
const
Tag
&
tag
=
song
.
tag
;
VisitTagWithFallbackOrEmpty
(
tag
,
group
,
VisitTagWithFallbackOrEmpty
(
tag
,
group
,
[
&
](
const
auto
&
val
)
std
::
bind
(
CollectGroupCounts
,
std
::
ref
(
map
),
{
return
CollectGroupCounts
(
map
,
tag
,
val
);
});
std
::
cref
(
tag
),
std
::
placeholders
::
_1
));
}
}
void
void
...
@@ -109,9 +107,9 @@ PrintSongCount(Response &r, const Partition &partition, const char *name,
...
@@ -109,9 +107,9 @@ PrintSongCount(Response &r, const Partition &partition, const char *name,
SearchStats
stats
;
SearchStats
stats
;
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
](
const
auto
&
song
)
const
auto
f
=
std
::
bind
(
stats_visitor_song
,
std
::
ref
(
stats
),
{
return
stats_visitor_song
(
stats
,
song
);
};
_1
);
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
PrintSearchStats
(
r
,
stats
);
PrintSearchStats
(
r
,
stats
);
...
@@ -121,9 +119,9 @@ PrintSongCount(Response &r, const Partition &partition, const char *name,
...
@@ -121,9 +119,9 @@ PrintSongCount(Response &r, const Partition &partition, const char *name,
TagCountMap
map
;
TagCountMap
map
;
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
map
,
group
](
const
auto
&
song
)
const
auto
f
=
std
::
bind
(
GroupCountVisitor
,
std
::
ref
(
map
),
{
return
GroupCountVisitor
(
map
,
group
,
song
);
};
group
,
_1
);
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
Print
(
r
,
group
,
map
);
Print
(
r
,
group
,
map
);
...
...
src/db/DatabasePlaylist.cxx
View file @
864d26cd
...
@@ -38,7 +38,6 @@ search_add_to_playlist(const Database &db, const Storage *storage,
...
@@ -38,7 +38,6 @@ search_add_to_playlist(const Database &db, const Storage *storage,
const
char
*
playlist_path_utf8
,
const
char
*
playlist_path_utf8
,
const
DatabaseSelection
&
selection
)
const
DatabaseSelection
&
selection
)
{
{
using
namespace
std
::
placeholders
;
const
auto
f
=
[
=
](
auto
&&
arg1
)
{
return
AddSong
(
storage
,
playlist_path_utf8
,
arg1
);
};
const
auto
f
=
[
=
](
auto
&&
arg1
)
{
return
AddSong
(
storage
,
playlist_path_utf8
,
arg1
);
};
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
}
}
src/db/DatabasePrint.cxx
View file @
864d26cd
...
@@ -146,16 +146,23 @@ db_selection_print(Response &r, Partition &partition,
...
@@ -146,16 +146,23 @@ db_selection_print(Response &r, Partition &partition,
{
{
const
Database
&
db
=
partition
.
GetDatabaseOrThrow
();
const
Database
&
db
=
partition
.
GetDatabaseOrThrow
();
using
namespace
std
::
placeholders
;
const
auto
d
=
selection
.
filter
==
nullptr
const
auto
d
=
selection
.
filter
==
nullptr
?
std
::
bind
(
full
?
PrintDirectoryFull
:
PrintDirectoryBrief
,
?
[
&
,
base
](
const
auto
&
dir
)
std
::
ref
(
r
),
base
,
_1
)
{
return
full
?
PrintDirectoryFull
(
r
,
base
,
dir
)
:
PrintDirectoryBrief
(
r
,
base
,
dir
);
}
:
VisitDirectory
();
:
VisitDirectory
();
VisitSong
s
=
std
::
bind
(
full
?
PrintSongFull
:
PrintSongBrief
,
std
::
ref
(
r
),
base
,
_1
);
VisitSong
s
=
[
&
,
base
](
const
auto
&
song
)
{
return
full
?
PrintSongFull
(
r
,
base
,
song
)
:
PrintSongBrief
(
r
,
base
,
song
);
};
const
auto
p
=
selection
.
filter
==
nullptr
const
auto
p
=
selection
.
filter
==
nullptr
?
std
::
bind
(
full
?
PrintPlaylistFull
:
PrintPlaylistBrief
,
?
[
&
,
base
](
const
auto
&
playlist
,
const
auto
&
dir
)
std
::
ref
(
r
),
base
,
_1
,
_2
)
{
return
full
?
PrintPlaylistFull
(
r
,
base
,
playlist
,
dir
)
:
PrintPlaylistBrief
(
r
,
base
,
playlist
,
dir
);
}
:
VisitPlaylist
();
:
VisitPlaylist
();
db
.
Visit
(
selection
,
d
,
s
,
p
);
db
.
Visit
(
selection
,
d
,
s
,
p
);
...
@@ -175,9 +182,9 @@ PrintSongUris(Response &r, Partition &partition,
...
@@ -175,9 +182,9 @@ PrintSongUris(Response &r, Partition &partition,
const
DatabaseSelection
selection
(
""
,
true
,
filter
);
const
DatabaseSelection
selection
(
""
,
true
,
filter
);
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
](
const
auto
&
song
)
const
auto
f
=
std
::
bind
(
PrintSongURIVisitor
,
{
return
PrintSongURIVisitor
(
r
,
song
);
};
std
::
ref
(
r
),
_1
);
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
}
}
...
...
src/db/DatabaseQueue.cxx
View file @
864d26cd
...
@@ -40,7 +40,7 @@ AddFromDatabase(Partition &partition, const DatabaseSelection &selection)
...
@@ -40,7 +40,7 @@ AddFromDatabase(Partition &partition, const DatabaseSelection &selection)
{
{
const
Database
&
db
=
partition
.
instance
.
GetDatabaseOrThrow
();
const
Database
&
db
=
partition
.
instance
.
GetDatabaseOrThrow
();
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
](
const
auto
&
song
)
const
auto
f
=
std
::
bind
(
AddToQueue
,
std
::
ref
(
partition
),
_1
)
;
{
return
AddToQueue
(
partition
,
song
);
}
;
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
}
}
src/db/Helpers.cxx
View file @
864d26cd
...
@@ -75,10 +75,9 @@ GetStats(const Database &db, const DatabaseSelection &selection)
...
@@ -75,10 +75,9 @@ GetStats(const Database &db, const DatabaseSelection &selection)
stats
.
Clear
();
stats
.
Clear
();
StringSet
artists
,
albums
;
StringSet
artists
,
albums
;
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
](
const
auto
&
song
)
const
auto
f
=
std
::
bind
(
StatsVisitSong
,
{
return
StatsVisitSong
(
stats
,
artists
,
albums
,
song
);
};
std
::
ref
(
stats
),
std
::
ref
(
artists
),
std
::
ref
(
albums
),
_1
);
db
.
Visit
(
selection
,
f
);
db
.
Visit
(
selection
,
f
);
stats
.
artist_count
=
artists
.
size
();
stats
.
artist_count
=
artists
.
size
();
...
...
src/db/plugins/simple/Mount.cxx
View file @
864d26cd
...
@@ -70,22 +70,20 @@ WalkMount(std::string_view base, const Database &db,
...
@@ -70,22 +70,20 @@ WalkMount(std::string_view base, const Database &db,
const
VisitDirectory
&
visit_directory
,
const
VisitSong
&
visit_song
,
const
VisitDirectory
&
visit_directory
,
const
VisitSong
&
visit_song
,
const
VisitPlaylist
&
visit_playlist
)
const
VisitPlaylist
&
visit_playlist
)
{
{
using
namespace
std
::
placeholders
;
VisitDirectory
vd
;
VisitDirectory
vd
;
if
(
visit_directory
)
if
(
visit_directory
)
vd
=
std
::
bind
(
PrefixVisitDirectory
,
vd
=
[
base
,
&
visit_directory
](
const
auto
&
dir
)
base
,
std
::
ref
(
visit_directory
),
_1
)
;
{
return
PrefixVisitDirectory
(
base
,
visit_directory
,
dir
);
}
;
VisitSong
vs
;
VisitSong
vs
;
if
(
visit_song
)
if
(
visit_song
)
vs
=
std
::
bind
(
PrefixVisitSong
,
vs
=
[
base
,
&
visit_song
](
const
auto
&
song
)
base
,
std
::
ref
(
visit_song
),
_1
)
;
{
return
PrefixVisitSong
(
base
,
visit_song
,
song
);
}
;
VisitPlaylist
vp
;
VisitPlaylist
vp
;
if
(
visit_playlist
)
if
(
visit_playlist
)
vp
=
std
::
bind
(
PrefixVisitPlaylist
,
vp
=
[
base
,
&
visit_playlist
](
const
auto
&
playlist
,
const
auto
&
dir
)
base
,
std
::
ref
(
visit_playlist
),
_1
,
_2
)
;
{
return
PrefixVisitPlaylist
(
base
,
visit_playlist
,
playlist
,
dir
);
}
;
DatabaseSelection
selection
(
old_selection
);
DatabaseSelection
selection
(
old_selection
);
selection
.
uri
=
uri
;
selection
.
uri
=
uri
;
...
...
src/decoder/DecoderPrint.cxx
View file @
864d26cd
...
@@ -47,7 +47,7 @@ decoder_plugin_print(Response &r,
...
@@ -47,7 +47,7 @@ decoder_plugin_print(Response &r,
void
void
decoder_list_print
(
Response
&
r
)
decoder_list_print
(
Response
&
r
)
{
{
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
](
const
auto
&
plugin
)
const
auto
f
=
std
::
bind
(
decoder_plugin_print
,
std
::
ref
(
r
),
_1
)
;
{
return
decoder_plugin_print
(
r
,
plugin
);
}
;
decoder_plugins_for_each_enabled
(
f
);
decoder_plugins_for_each_enabled
(
f
);
}
}
src/decoder/Thread.cxx
View file @
864d26cd
...
@@ -183,11 +183,9 @@ decoder_run_stream_locked(DecoderBridge &bridge, InputStream &is,
...
@@ -183,11 +183,9 @@ decoder_run_stream_locked(DecoderBridge &bridge, InputStream &is,
UriSuffixBuffer
suffix_buffer
;
UriSuffixBuffer
suffix_buffer
;
const
char
*
const
suffix
=
uri_get_suffix
(
uri
,
suffix_buffer
);
const
char
*
const
suffix
=
uri_get_suffix
(
uri
,
suffix_buffer
);
using
namespace
std
::
placeholders
;
const
auto
f
=
[
&
,
suffix
](
const
auto
&
plugin
)
const
auto
f
=
std
::
bind
(
decoder_run_stream_plugin
,
{
return
decoder_run_stream_plugin
(
bridge
,
is
,
lock
,
suffix
,
plugin
,
tried_r
);
};
std
::
ref
(
bridge
),
std
::
ref
(
is
),
std
::
ref
(
lock
),
suffix
,
_1
,
std
::
ref
(
tried_r
));
return
decoder_plugins_try
(
f
);
return
decoder_plugins_try
(
f
);
}
}
...
...
src/pcm/Dop.cxx
View file @
864d26cd
...
@@ -91,7 +91,6 @@ DsdToDopConverter::Open(unsigned _channels) noexcept
...
@@ -91,7 +91,6 @@ DsdToDopConverter::Open(unsigned _channels) noexcept
ConstBuffer
<
uint32_t
>
ConstBuffer
<
uint32_t
>
DsdToDopConverter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
DsdToDopConverter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
{
{
using
namespace
std
::
placeholders
;
return
rest_buffer
.
Process
<
uint32_t
>
(
buffer
,
src
,
2
*
channels
,
return
rest_buffer
.
Process
<
uint32_t
>
(
buffer
,
src
,
2
*
channels
,
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
DsdToDop
(
arg1
,
arg2
,
arg3
,
channels
);
});
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
DsdToDop
(
arg1
,
arg2
,
arg3
,
channels
);
});
}
}
src/pcm/Dsd16.cxx
View file @
864d26cd
...
@@ -63,7 +63,6 @@ Dsd16Converter::Open(unsigned _channels) noexcept
...
@@ -63,7 +63,6 @@ Dsd16Converter::Open(unsigned _channels) noexcept
ConstBuffer
<
uint16_t
>
ConstBuffer
<
uint16_t
>
Dsd16Converter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
Dsd16Converter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
{
{
using
namespace
std
::
placeholders
;
return
rest_buffer
.
Process
<
uint16_t
>
(
buffer
,
src
,
channels
,
return
rest_buffer
.
Process
<
uint16_t
>
(
buffer
,
src
,
channels
,
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
Dsd8To16
(
arg1
,
arg2
,
arg3
,
channels
);
});
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
Dsd8To16
(
arg1
,
arg2
,
arg3
,
channels
);
});
}
}
src/pcm/Dsd32.cxx
View file @
864d26cd
...
@@ -65,7 +65,6 @@ Dsd32Converter::Open(unsigned _channels) noexcept
...
@@ -65,7 +65,6 @@ Dsd32Converter::Open(unsigned _channels) noexcept
ConstBuffer
<
uint32_t
>
ConstBuffer
<
uint32_t
>
Dsd32Converter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
Dsd32Converter
::
Convert
(
ConstBuffer
<
uint8_t
>
src
)
noexcept
{
{
using
namespace
std
::
placeholders
;
return
rest_buffer
.
Process
<
uint32_t
>
(
buffer
,
src
,
channels
,
return
rest_buffer
.
Process
<
uint32_t
>
(
buffer
,
src
,
channels
,
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
Dsd8To32
(
arg1
,
arg2
,
arg3
,
channels
);
});
[
=
](
auto
&&
arg1
,
auto
&&
arg2
,
auto
&&
arg3
)
{
return
Dsd8To32
(
arg1
,
arg2
,
arg3
,
channels
);
});
}
}
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