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
4cca75b2
Commit
4cca75b2
authored
Apr 25, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DatabasePrint: refactor variable/function names
parent
6d616e55
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
DatabaseCommands.cxx
src/command/DatabaseCommands.cxx
+2
-2
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+15
-15
DatabasePrint.hxx
src/db/DatabasePrint.hxx
+6
-6
No files found.
src/command/DatabaseCommands.cxx
View file @
4cca75b2
...
...
@@ -159,7 +159,7 @@ handle_count(Client &client, int argc, char *argv[])
}
Error
error
;
return
searchStatsForSongsIn
(
client
,
""
,
&
filter
,
error
)
return
PrintSongCount
(
client
,
""
,
&
filter
,
error
)
?
CommandResult
::
OK
:
print_error
(
client
,
error
);
}
...
...
@@ -243,7 +243,7 @@ handle_list(Client &client, int argc, char *argv[])
Error
error
;
CommandResult
ret
=
listAll
UniqueTags
(
client
,
tagType
,
group_mask
,
filter
,
error
)
Print
UniqueTags
(
client
,
tagType
,
group_mask
,
filter
,
error
)
?
CommandResult
::
OK
:
print_error
(
client
,
error
);
...
...
src/db/DatabasePrint.cxx
View file @
4cca75b2
...
...
@@ -169,32 +169,32 @@ db_selection_print(Client &client, const DatabaseSelection &selection,
}
struct
SearchStats
{
unsigned
n
umberOfS
ongs
;
unsigned
long
playTime
;
unsigned
n
_s
ongs
;
unsigned
long
total_time_s
;
};
static
void
p
rintSearchStats
(
Client
&
client
,
const
SearchStats
&
stats
)
P
rintSearchStats
(
Client
&
client
,
const
SearchStats
&
stats
)
{
client_printf
(
client
,
"songs: %u
\n
"
"playtime: %lu
\n
"
,
stats
.
n
umberOfSongs
,
stats
.
playTime
);
stats
.
n
_songs
,
stats
.
total_time_s
);
}
static
bool
stats_visitor_song
(
SearchStats
&
stats
,
const
LightSong
&
song
)
{
stats
.
n
umberOfS
ongs
++
;
stats
.
playTime
+=
song
.
GetDuration
();
stats
.
n
_s
ongs
++
;
stats
.
total_time_s
+=
song
.
GetDuration
();
return
true
;
}
bool
searchStatsForSongsIn
(
Client
&
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
Error
&
error
)
PrintSongCount
(
Client
&
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
Error
&
error
)
{
const
Database
*
db
=
client
.
GetDatabase
(
error
);
if
(
db
==
nullptr
)
...
...
@@ -203,8 +203,8 @@ searchStatsForSongsIn(Client &client, const char *name,
const
DatabaseSelection
selection
(
name
,
true
,
filter
);
SearchStats
stats
;
stats
.
n
umberOfS
ongs
=
0
;
stats
.
playTime
=
0
;
stats
.
n
_s
ongs
=
0
;
stats
.
total_time_s
=
0
;
using
namespace
std
::
placeholders
;
const
auto
f
=
std
::
bind
(
stats_visitor_song
,
std
::
ref
(
stats
),
...
...
@@ -212,7 +212,7 @@ searchStatsForSongsIn(Client &client, const char *name,
if
(
!
db
->
Visit
(
selection
,
f
,
error
))
return
false
;
p
rintSearchStats
(
client
,
stats
);
P
rintSearchStats
(
client
,
stats
);
return
true
;
}
...
...
@@ -243,9 +243,9 @@ PrintUniqueTag(Client &client, TagType tag_type,
}
bool
listAll
UniqueTags
(
Client
&
client
,
unsigned
type
,
uint32_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
)
Print
UniqueTags
(
Client
&
client
,
unsigned
type
,
uint32_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
)
{
const
Database
*
db
=
client
.
GetDatabase
(
error
);
if
(
db
==
nullptr
)
...
...
src/db/DatabasePrint.hxx
View file @
4cca75b2
...
...
@@ -39,13 +39,13 @@ db_selection_print(Client &client, const DatabaseSelection &selection,
gcc_nonnull
(
2
)
bool
searchStatsForSongsIn
(
Client
&
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
Error
&
error
);
PrintSongCount
(
Client
&
client
,
const
char
*
name
,
const
SongFilter
*
filter
,
Error
&
error
);
bool
listAll
UniqueTags
(
Client
&
client
,
unsigned
type
,
uint32_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
);
Print
UniqueTags
(
Client
&
client
,
unsigned
type
,
uint32_t
group_mask
,
const
SongFilter
*
filter
,
Error
&
error
);
#endif
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