Sayonara Player
MetaDataList.h
1  /* MetaDataList.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef METADATALIST_H
22 #define METADATALIST_H
23 
24 #include "MetaData.h"
25 #include "MetaDataFwd.h"
26 #include "Utils/typedefs.h"
27 #include "Utils/SetFwd.h"
28 #include "Utils/Pimpl.h"
29 #include "Utils/Library/Sortorder.h"
30 
31 #include <vector>
32 
38 class MetaDataList :
39  public std::vector<MetaData>
40 {
41  PIMPL(MetaDataList)
42 
43 public:
44  MetaDataList();
45  explicit MetaDataList(const MetaData& md);
46 
47  MetaDataList(const MetaDataList&);
48  MetaDataList(MetaDataList&& other);
49 
50  MetaDataList& operator=(const MetaDataList& other);
51  MetaDataList& operator=(MetaDataList&& other);
52 
53  ~MetaDataList();
54 
55 
56  void set_current_track(int idx);
57  int current_track() const;
58 
59  bool contains(const MetaData& md) const;
60  MetaDataList& remove_track(int idx);
61  MetaDataList& remove_tracks(const IndexSet& rows);
62  MetaDataList& remove_tracks(int first, int last);
63 
64  MetaDataList& move_tracks(const IndexSet& indexes, int tgt_idx);
65  MetaDataList& copy_tracks(const IndexSet& indexes, int tgt_idx);
66  MetaDataList& insert_track(const MetaData& md, int tgt_idx);
67  MetaDataList& insert_tracks(const MetaDataList& v_md, int tgt_idx);
68 
69  IdxList findTracks(Id id) const;
70  IdxList findTracks(const QString& filepath) const;
71 
72  QStringList toStringList() const;
73 
74  MetaDataList& operator <<(const MetaDataList& v_md);
75  MetaDataList& operator <<(const MetaData& md);
76 
77  MetaDataList& append(const MetaDataList& v_md);
78  MetaDataList& append(const MetaData& md);
79 
80  bool contains(TrackID id) const;
81  void remove_duplicates();
82  MetaData take_at(int idx);
83  bool isEmpty() const;
84  MetaDataList& append_unique(const MetaDataList& other);
85 
86  const MetaData& first() const;
87  const MetaData& last() const;
88 
89  int count() const;
90 
91  void sort(Library::SortOrder so);
92 };
93 
94 
95 #endif // METADATALIST_H
The MetaData class.
Definition: MetaData.h:48
The MetaDataList class.
Definition: MetaDataList.h:38
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: AbstractPlaylist.h:38
Definition: org_mpris_media_player2_adaptor.h:20