23 #ifndef ABSTRACT_MP4_FRAME_H_ 24 #define ABSTRACT_MP4_FRAME_H_ 26 #include "Utils/Tagging/AbstractFrame.h" 28 #include <taglib/tag.h> 29 #include <taglib/tstring.h> 30 #include <taglib/tstringlist.h> 31 #include <taglib/mp4tag.h> 35 template<
typename Model_t>
40 TagLib::MP4::ItemListMap::ConstIterator find_key(
const TagLib::MP4::ItemListMap& ilm)
const 42 for(TagLib::MP4::ItemListMap::ConstIterator it=ilm.begin(); it!=ilm.end(); it++){
43 QString key = this->key();
44 if( this->cvt_string(it->first).compare(key, Qt::CaseInsensitive) == 0){
52 virtual bool map_tag_to_model(Model_t& model)=0;
53 virtual bool map_model_to_tag(
const Model_t& model)=0;
57 MP4Frame(TagLib::Tag* tag,
const QString& identifier) :
62 bool read(Model_t& model)
64 TagLib::MP4::Tag* key = this->tag();
69 const TagLib::MP4::ItemListMap& ilm = key->itemListMap();
71 bool found = (find_key(ilm) != ilm.end());
76 bool success = map_tag_to_model(model);
81 bool write(
const Model_t& model)
83 TagLib::MP4::Tag* tag = this->tag();
88 TagLib::MP4::ItemListMap& ilm = tag->itemListMap();
90 auto itcopy=ilm.begin();
91 for(
auto it=ilm.begin(); it!=ilm.end(); it++)
93 QString key = this->key();
94 if( this->cvt_string(it->first).compare(key, Qt::CaseInsensitive) == 0)
105 return map_model_to_tag(model);
110 #endif // ABSTRACT_MP4_FRAME_H_ Definition: AlbumArtist.h:29
Definition: MP4Frame.h:36
Definition: AbstractFrame.h:57