summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/browser.cpp18
-rw-r--r--src/browser.h2
-rw-r--r--src/interfaces.h2
-rw-r--r--src/media_library.cpp6
-rw-r--r--src/media_library.h2
-rw-r--r--src/mpdpp.cpp2
-rw-r--r--src/mpdpp.h4
-rw-r--r--src/playlist.cpp4
-rw-r--r--src/playlist.h2
-rw-r--r--src/playlist_editor.cpp6
-rw-r--r--src/playlist_editor.h2
-rw-r--r--src/search_engine.cpp6
-rw-r--r--src/search_engine.h2
-rw-r--r--src/sel_items_adder.h2
-rw-r--r--src/song.h2
-rw-r--r--src/sort_playlist.cpp4
-rw-r--r--src/tag_editor.cpp4
-rw-r--r--src/tag_editor.h2
18 files changed, 33 insertions, 39 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index dcffb933..bfc82a0f 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -63,8 +63,8 @@ bool isRootDirectory(const std::string &directory);
bool isHidden(const fs::directory_iterator &entry);
bool hasSupportedExtension(const fs::directory_entry &entry);
MPD::Song getLocalSong(const fs::directory_entry &entry, bool read_tags);
-void getLocalDirectory(MPD::ItemList &items, const std::string &directory);
-void getLocalDirectoryRecursively(MPD::SongList &songs, const std::string &directory);
+void getLocalDirectory(std::vector<MPD::Item> &items, const std::string &directory);
+void getLocalDirectoryRecursively(std::vector<MPD::Song> &songs, const std::string &directory);
void clearDirectory(const std::string &directory);
std::string itemToString(const MPD::Item &item);
@@ -144,7 +144,7 @@ void Browser::enterPressed()
}
case MPD::Item::Type::Playlist:
{
- MPD::SongList list(
+ std::vector<MPD::Song> list(
std::make_move_iterator(Mpd.GetPlaylistContentNoInfo(item.playlist().path())),
std::make_move_iterator(MPD::SongIterator())
);
@@ -183,7 +183,7 @@ void Browser::spacePressed()
bool success = true;
if (m_local_browser)
{
- MPD::SongList songs;
+ std::vector<MPD::Song> songs;
getLocalDirectoryRecursively(songs, item.directory().path());
success = addSongsToPlaylist(songs.begin(), songs.end(), false, -1);
}
@@ -338,9 +338,9 @@ void Browser::reverseSelection()
reverseSelectionHelper(w.begin()+offset, w.end());
}
-MPD::SongList Browser::getSelectedSongs()
+std::vector<MPD::Song> Browser::getSelectedSongs()
{
- MPD::SongList songs;
+ std::vector<MPD::Song> songs;
auto item_handler = [this, &songs](const MPD::Item &item) {
switch (item.type())
{
@@ -437,7 +437,7 @@ void Browser::getDirectory(std::string directory)
if (directory.empty())
directory = "/";
- MPD::ItemList items;
+ std::vector<MPD::Item> items;
if (m_local_browser)
getLocalDirectory(items, directory);
else
@@ -620,7 +620,7 @@ MPD::Song getLocalSong(const fs::directory_entry &entry, bool read_tags)
return s;
}
-void getLocalDirectory(MPD::ItemList &items, const std::string &directory)
+void getLocalDirectory(std::vector<MPD::Item> &items, const std::string &directory)
{
for (fs::directory_iterator entry(directory), end; entry != end; ++entry)
{
@@ -639,7 +639,7 @@ void getLocalDirectory(MPD::ItemList &items, const std::string &directory)
}
}
-void getLocalDirectoryRecursively(MPD::SongList &songs, const std::string &directory)
+void getLocalDirectoryRecursively(std::vector<MPD::Song> &songs, const std::string &directory)
{
size_t sort_offset = songs.size();
for (fs::directory_iterator entry(directory), end; entry != end; ++entry)
diff --git a/src/browser.h b/src/browser.h
index 1d06b3fa..b76698de 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -60,7 +60,7 @@ struct Browser: Screen<NC::Menu<MPD::Item>>, Filterable, HasSongs, Searchable, T
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// private members
bool inRootDirectory();
diff --git a/src/interfaces.h b/src/interfaces.h
index 797849bd..edf804b3 100644
--- a/src/interfaces.h
+++ b/src/interfaces.h
@@ -48,7 +48,7 @@ struct HasSongs
virtual bool allowsSelection() = 0;
virtual void reverseSelection() = 0;
- virtual MPD::SongList getSelectedSongs() = 0;
+ virtual std::vector<MPD::Song> getSelectedSongs() = 0;
};
struct HasColumns
diff --git a/src/media_library.cpp b/src/media_library.cpp
index 083c9175..a095877e 100644
--- a/src/media_library.cpp
+++ b/src/media_library.cpp
@@ -733,9 +733,9 @@ void MediaLibrary::reverseSelection()
reverseSelectionHelper(Songs.begin(), Songs.end());
}
-MPD::SongList MediaLibrary::getSelectedSongs()
+std::vector<MPD::Song> MediaLibrary::getSelectedSongs()
{
- MPD::SongList result;
+ std::vector<MPD::Song> result;
if (isActiveWindow(Tags))
{
auto tag_handler = [&result](const std::string &tag) {
@@ -1059,7 +1059,7 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
{
Mpd.StartSearch(true);
Mpd.AddSearch(Config.media_lib_primary_tag, Tags.current().value().tag());
- MPD::SongList list(
+ std::vector<MPD::Song> list(
std::make_move_iterator(Mpd.CommitSearchSongs()),
std::make_move_iterator(MPD::SongIterator())
);
diff --git a/src/media_library.h b/src/media_library.h
index e9d0fe22..825a40cd 100644
--- a/src/media_library.h
+++ b/src/media_library.h
@@ -63,7 +63,7 @@ struct MediaLibrary: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, Sea
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;
diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp
index b09458ab..089bab97 100644
--- a/src/mpdpp.cpp
+++ b/src/mpdpp.cpp
@@ -551,7 +551,7 @@ bool Connection::AddRandomTag(mpd_tag_type tag, size_t number)
bool Connection::AddRandomSongs(size_t number)
{
prechecksNoCommandsList();
- StringList files;
+ std::vector<std::string> files;
mpd_send_list_all(m_connection.get(), "/");
while (mpd_pair *item = mpd_recv_pair_named(m_connection.get(), "file"))
{
diff --git a/src/mpdpp.h b/src/mpdpp.h
index 08427ed1..093290b2 100644
--- a/src/mpdpp.h
+++ b/src/mpdpp.h
@@ -325,10 +325,6 @@ private:
std::shared_ptr<mpd_output> m_output;
};
-typedef std::vector<Item> ItemList;
-typedef std::vector<std::string> StringList;
-typedef std::vector<Output> OutputList;
-
template <typename ObjectT>
struct Iterator: std::iterator<std::input_iterator_tag, ObjectT>
{
diff --git a/src/playlist.cpp b/src/playlist.cpp
index f85b126e..7478183f 100644
--- a/src/playlist.cpp
+++ b/src/playlist.cpp
@@ -232,9 +232,9 @@ void Playlist::reverseSelection()
reverseSelectionHelper(w.begin(), w.end());
}
-MPD::SongList Playlist::getSelectedSongs()
+std::vector<MPD::Song> Playlist::getSelectedSongs()
{
- MPD::SongList result;
+ std::vector<MPD::Song> result;
for (auto it = w.begin(); it != w.end(); ++it)
if (it->isSelected())
result.push_back(it->value());
diff --git a/src/playlist.h b/src/playlist.h
index 2df8f881..35ba77d4 100644
--- a/src/playlist.h
+++ b/src/playlist.h
@@ -63,7 +63,7 @@ struct Playlist: Screen<NC::Menu<MPD::Song>>, Filterable, HasSongs, Searchable,
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// private members
MPD::Song nowPlayingSong();
diff --git a/src/playlist_editor.cpp b/src/playlist_editor.cpp
index 6bc324b7..4846a9b0 100644
--- a/src/playlist_editor.cpp
+++ b/src/playlist_editor.cpp
@@ -241,7 +241,7 @@ ProxySongList PlaylistEditor::contentProxyList()
void PlaylistEditor::AddToPlaylist(bool add_n_play)
{
- MPD::SongList list;
+ std::vector<MPD::Song> list;
if (isActiveWindow(Playlists) && !Playlists.empty())
{
@@ -475,9 +475,9 @@ void PlaylistEditor::reverseSelection()
reverseSelectionHelper(Content.begin(), Content.end());
}
-MPD::SongList PlaylistEditor::getSelectedSongs()
+std::vector<MPD::Song> PlaylistEditor::getSelectedSongs()
{
- MPD::SongList result;
+ std::vector<MPD::Song> result;
if (isActiveWindow(Playlists))
{
bool any_selected = false;
diff --git a/src/playlist_editor.h b/src/playlist_editor.h
index 0bf2191b..e1d4bc10 100644
--- a/src/playlist_editor.h
+++ b/src/playlist_editor.h
@@ -63,7 +63,7 @@ struct PlaylistEditor: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, S
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;
diff --git a/src/search_engine.cpp b/src/search_engine.cpp
index 4d65ffaf..89d2f23f 100644
--- a/src/search_engine.cpp
+++ b/src/search_engine.cpp
@@ -345,9 +345,9 @@ void SearchEngine::reverseSelection()
reverseSelectionHelper(w.begin()+std::min(StaticOptions, w.size()), w.end());
}
-MPD::SongList SearchEngine::getSelectedSongs()
+std::vector<MPD::Song> SearchEngine::getSelectedSongs()
{
- MPD::SongList result;
+ std::vector<MPD::Song> result;
for (auto it = w.begin(); it != w.end(); ++it)
{
if (it->isSelected())
@@ -444,7 +444,7 @@ void SearchEngine::Search()
return;
}
- MPD::SongList list;
+ std::vector<MPD::Song> list;
if (Config.search_in_db)
{
std::copy(
diff --git a/src/search_engine.h b/src/search_engine.h
index e28df51e..ed96c970 100644
--- a/src/search_engine.h
+++ b/src/search_engine.h
@@ -62,7 +62,7 @@ struct SearchEngine: Screen<NC::Menu<struct SEItem>>, Filterable, HasSongs, Sear
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// private members
void reset();
diff --git a/src/sel_items_adder.h b/src/sel_items_adder.h
index 9366d819..525705a9 100644
--- a/src/sel_items_adder.h
+++ b/src/sel_items_adder.h
@@ -77,7 +77,7 @@ private:
Component m_playlist_selector;
Component m_position_selector;
- MPD::SongList m_selected_items;
+ std::vector<MPD::Song> m_selected_items;
};
extern SelectedItemsAdder *mySelectedItemsAdder;
diff --git a/src/song.h b/src/song.h
index 58a05b50..047064d5 100644
--- a/src/song.h
+++ b/src/song.h
@@ -114,8 +114,6 @@ private:
size_t m_hash;
};
-typedef std::vector<Song> SongList;
-
}
#endif // NCMPCPP_SONG_H
diff --git a/src/sort_playlist.cpp b/src/sort_playlist.cpp
index 2b04e91c..084e1a58 100644
--- a/src/sort_playlist.cpp
+++ b/src/sort_playlist.cpp
@@ -160,12 +160,12 @@ void SortPlaylistDialog::sort() const
std::tie(begin, end) = getSelectedRange(begin, end);
size_t start_pos = begin - pl.begin();
- MPD::SongList playlist;
+ std::vector<MPD::Song> playlist;
playlist.reserve(end - begin);
for (; begin != end; ++begin)
playlist.push_back(begin->value());
- typedef MPD::SongList::iterator Iterator;
+ typedef std::vector<MPD::Song>::iterator Iterator;
LocaleStringComparison cmp(std::locale(), Config.ignore_leading_the);
std::function<void(Iterator, Iterator)> iter_swap, quick_sort;
auto song_cmp = [this, &cmp](const MPD::Song &a, const MPD::Song &b) -> bool {
diff --git a/src/tag_editor.cpp b/src/tag_editor.cpp
index 22eb40d6..6b94db93 100644
--- a/src/tag_editor.cpp
+++ b/src/tag_editor.cpp
@@ -848,9 +848,9 @@ void TagEditor::reverseSelection()
reverseSelectionHelper(Tags->begin(), Tags->end());
}
-MPD::SongList TagEditor::getSelectedSongs()
+std::vector<MPD::Song> TagEditor::getSelectedSongs()
{
- MPD::SongList result;
+ std::vector<MPD::Song> result;
if (w == Tags)
{
for (auto it = Tags->begin(); it != Tags->end(); ++it)
diff --git a/src/tag_editor.h b/src/tag_editor.h
index 0cefbf64..8d7fac93 100644
--- a/src/tag_editor.h
+++ b/src/tag_editor.h
@@ -67,7 +67,7 @@ struct TagEditor: Screen<NC::Window *>, Filterable, HasColumns, HasSongs, Search
virtual bool allowsSelection() OVERRIDE;
virtual void reverseSelection() OVERRIDE;
- virtual MPD::SongList getSelectedSongs() OVERRIDE;
+ virtual std::vector<MPD::Song> getSelectedSongs() OVERRIDE;
// HasColumns implementation
virtual bool previousColumnAvailable() OVERRIDE;