diff options
author | Max Kellermann <max@duempel.org> | 2012-08-07 21:32:08 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-07 21:32:08 +0200 |
commit | 1a75abffa531d67f3c76f8cdc0423623d1324a95 (patch) | |
tree | d6172bad2b8a3012b4ceb224081eead06db954c1 /src/DatabaseQueue.cxx | |
parent | c6a0f5d3f9d70b890dfdc3ae0474dbcf72fe0499 (diff) | |
download | mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.tar.gz mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.tar.xz mpd-1a75abffa531d67f3c76f8cdc0423623d1324a95.zip |
Database{Plugin,Visitor}: pass references
Diffstat (limited to 'src/DatabaseQueue.cxx')
-rw-r--r-- | src/DatabaseQueue.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/DatabaseQueue.cxx b/src/DatabaseQueue.cxx index ce66b7f30..dbf9ad79a 100644 --- a/src/DatabaseQueue.cxx +++ b/src/DatabaseQueue.cxx @@ -32,11 +32,10 @@ extern "C" { #include <functional> static bool -AddToQueue(struct player_control *pc, struct song *song, - GError **error_r) +AddToQueue(struct player_control *pc, song &song, GError **error_r) { enum playlist_result result = - playlist_append_song(&g_playlist, pc, song, NULL); + playlist_append_song(&g_playlist, pc, &song, NULL); if (result != PLAYLIST_RESULT_SUCCESS) { g_set_error(error_r, playlist_quark(), result, "Playlist error"); @@ -54,15 +53,15 @@ addAllIn(struct player_control *pc, const char *uri, GError **error_r) using namespace std::placeholders; const auto f = std::bind(AddToQueue, pc, _1, _2); - return GetDatabase()->Visit(&selection, f, error_r); + return GetDatabase()->Visit(selection, f, error_r); } static bool MatchAddSong(struct player_control *pc, const struct locate_item_list *criteria, - struct song *song, GError **error_r) + song &song, GError **error_r) { - return !locate_song_match(song, criteria) || + return !locate_song_match(&song, criteria) || AddToQueue(pc, song, error_r); } @@ -75,15 +74,15 @@ findAddIn(struct player_control *pc, const char *uri, using namespace std::placeholders; const auto f = std::bind(MatchAddSong, pc, criteria, _1, _2); - return GetDatabase()->Visit(&selection, f, error_r); + return GetDatabase()->Visit(selection, f, error_r); } static bool SearchAddSong(struct player_control *pc, const struct locate_item_list *criteria, - struct song *song, GError **error_r) + song &song, GError **error_r) { - return !locate_song_search(song, criteria) || + return !locate_song_search(&song, criteria) || AddToQueue(pc, song, error_r); } @@ -100,7 +99,7 @@ search_add_songs(struct player_control *pc, const char *uri, using namespace std::placeholders; const auto f = std::bind(SearchAddSong, pc, new_list, _1, _2); - bool success = GetDatabase()->Visit(&selection, f, error_r); + bool success = GetDatabase()->Visit(selection, f, error_r); locate_item_list_free(new_list); |