Commits

shuerhaaken committed c14898d

clean up a little bit

Comments (0)

Files changed (21)

 Jörn Magens <shuerhaaken@googlemail.com>
+J.Rios
+
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
                 {
                     return flags;
                 }
-                
-//                bool operator==(const Item &other);
         };
         
         
                 
                 String get_item_value(const String &key) const;
                 
-                void set_item(const String &key, const String &value, uint flags = 0/*CONTENT_TEXT*/);
+                void set_item(const String &key, const String &value, uint flags = 0);
                 void set_item(const String &key, char * data, uint len);
                 
                 uint get_file_length(void) const;

taginfo/ape_common.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     if(apetag->itemListMap().contains(description))
         apetag->removeItem(description);
     if(!value.isEmpty()) {
-            apetag->addValue(description, value);//.c_str());
+            apetag->addValue(description, value);
     }
 }
 
 
 bool get_ape_item_image(const TagLib::APE::Item &item, char*& data, int &data_length, ImageType &image_type) {
-//    String mime = "";
     image_type = IMAGE_TYPE_UNKNOWN;
     if(item.type() == TagLib::APE::Item::Binary) {
         TagLib::ByteVector CoverData = item.value();
             data_length = CoverData.size();
             data = new char[data_length];
             memcpy(data, CoverData.data(), CoverData.size());
-//            mime = "image/jpeg";
             return true;
         }
     }
             apetag->removeItem("UNSYNCED LYRICS");
         }
         if(!lyrics.isEmpty()) {
-//            const TagLib::String Lyrics = lyrics.data();
             apetag->addValue("Lyrics", lyrics);
         }
         return true;
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 }
 
 
-//static void write_little_endian_uint32(char * cp, long i)
-//{
-//    cp[0] = i & 0xff;
-//    i >>= 8;
-//    cp[1] = i & 0xff;
-//    i >>= 8;
-//    cp[2] = i & 0xff;
-//    i >>= 8;
-//    cp[3] = i & 0xff;
-//}
-
-
-//int compare_items(Item * item1, Item * item2)
-//{
-//    return item1->get_key() > item2->get_key();
-//}
-
-
-
 
 
 
 }
 
 void ApeFile::write_header_footer(const uint flags) {
-    //printf(wxT("Writing header/footer at %08X"), m_File->Tell());
     write_number(APE_MAGIC_0);
     write_number(APE_MAGIC_1);
     write_number(APE_VERSION_2);
 
 void ApeFile::write_items(void) {
     int index;
-    int count = apetag->get_item_count();//items.size();
+    int count = apetag->get_item_count();
 
     char pad = 0;
     for(index = 0; index < count; index++) {
     stream.seekg(0, ios::end);
     end = stream.tellg();
     const uint TagOffset = !apetag->get_offset() ?  apetag->get_file_length() : apetag->get_offset();
-
+    
     stream.seekp(TagOffset, ios::beg);
     // write header
     if(stream.tellp() != TagOffset) {
             char subbuff[ValueLen + 1];
             memcpy( subbuff, CurBufPos, ValueLen );
             subbuff[ValueLen] = '\0';
-            Value = (char*)&subbuff;//::strdup(Value.toCString(true));
+            Value = (char*)&subbuff;
         }
         else {
             Value = String(::strndup(CurBufPos, ValueLen));

taginfo/ape_internal.h

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 using namespace TagInfo::Ape;
 
 
-ApeTag::ApeTag(uint _length, uint _offset, uint _nitems)
-{
+ApeTag::ApeTag(uint _length, uint _offset, uint _nitems) {
     this->file_length = _length;
     this->offset = _offset;
     this->item_count = _nitems;
     this->items.clear();
-//    items = new ItemArray(compare_items);
 }
 
-ApeTag::~ApeTag()
-{
+ApeTag::~ApeTag() {
     if(items.size() > 0) {
         for (std::vector<Item*>::iterator it = items.begin() ; it != items.end(); ++it)
             delete *it;
     items.clear();
 }
 
-void ApeTag::remove_items()
-{
+void ApeTag::remove_items() {
     for (std::vector<Item*>::iterator it = items.begin() ; it != items.end(); ++it)
         delete *it;
     items.clear();
 }
 
-void ApeTag::remove_item(Item * item)
-{
+void ApeTag::remove_item(Item * item){
     int j = 0;
     for (std::vector<Item*>::iterator it = items.begin() ; it != items.end(); ++it) {
         if(*it == item) {
     delete item;
 }
 
-void ApeTag::add_item(TagInfo::Ape::Item * item)
-{
+void ApeTag::add_item(TagInfo::Ape::Item * item) {
     items.push_back(item);
 }
 
-Item * ApeTag::get_item(const int pos) const
-{
+Item * ApeTag::get_item(const int pos) const {
     return items.at(pos);
 }
 
-Item * ApeTag::get_item(const String &key) const
-{
+Item * ApeTag::get_item(const String &key) const {
     Item * item;
     int index;
     int count = items.size();
     for(index = 0; index < count; index++) {
         item = items.at(index);
-//        String str1Cpy(key);
-//        String str2Cpy(item->key);
-//        std::transform(str1Cpy.begin(), str1Cpy.end(), str1Cpy.begin(), ::tolower);
-//        std::transform(str2Cpy.begin(), str2Cpy.end(), str2Cpy.begin(), ::tolower);
         if(key == item->key)
             return item;
     }
     return NULL;
 }
 
-String ApeTag::get_item_value(const String &key) const
-{
+String ApeTag::get_item_value(const String &key) const {
     String RetVal = "";
     Item * item = get_item(key);
     if(item) {
     }
 }
 
-void ApeTag::set_item(const String &key, char * data, uint len)
-{
+void ApeTag::set_item(const String &key, char * data, uint len){
     Item * item = get_item(key);
     if(item) {
         String ustr = data;
         ustr = ustr.substr(0, len);
-        item->value = ustr;//wxString::From8BitData(data, len);
+        item->value = ustr;
     }
     else {
         String ustr = data;
     }
 }
 
-uint ApeTag::get_file_length(void) const
-{
+uint ApeTag::get_file_length(void) const {
     return file_length;
 }
 
-uint ApeTag::get_offset(void) const
-{
+uint ApeTag::get_offset(void) const {
     return offset;
 }
 
-uint ApeTag::get_item_length(void) const
-{
+uint ApeTag::get_item_length(void) const {
     uint RetVal = 0;
     int index;
     int count = items.size();
     return RetVal;
 }
 
-uint ApeTag::get_item_count(void) const
-{
+uint ApeTag::get_item_count(void) const {
     uint RetVal = 0;
     int Index;
     int Count = items.size();
     return RetVal;
 }
 
-String ApeTag::get_title(void) const
-{
+String ApeTag::get_title(void) const {
     return get_item_value(APE_TAG_TITLE);
 }
 
-void ApeTag::set_title(const String &title)
-{
+void ApeTag::set_title(const String &title) {
     set_item(APE_TAG_TITLE, title, 0);
 }
 
-String ApeTag::get_artist(void) const
-{
+String ApeTag::get_artist(void) const {
     return get_item_value(APE_TAG_ARTIST);
 }
 
-void ApeTag::set_artist(const String &artist)
-{
+void ApeTag::set_artist(const String &artist) {
     set_item(APE_TAG_ARTIST, artist, 0);
 }
 
-String ApeTag::get_album(void) const
-{
+String ApeTag::get_album(void) const {
     return get_item_value(APE_TAG_ALBUM);
 }
 
-void ApeTag::set_album(const String &album)
-{
+void ApeTag::set_album(const String &album) {
     set_item(APE_TAG_ALBUM, album, 0);
 }
 
-String ApeTag::get_genre(void) const
-{
+String ApeTag::get_genre(void) const {
     return get_item_value(APE_TAG_GENRE);
 }
 
-void ApeTag::set_genre(const String &genre)
-{
+void ApeTag::set_genre(const String &genre) {
     set_item(APE_TAG_GENRE, genre, 0);
 }
 
-uint ApeTag::get_tracknumber(void) const
-{
+uint ApeTag::get_tracknumber(void) const {
     String ret = get_item_value(APE_TAG_TRACK);
     int i = 0;
     unsigned long Track;
     }
 }
 
-void ApeTag::set_tracknumber(uint track)//(const uint track)
-{
-//    char* trck;
-//    if(asprintf (&trck, "%u", track) >= 0) {
-//        String tstr = trck;
-//        set_item(APE_TAG_TRACK, tstr, 0);
-//        free(trck);
-//    }
-    
+void ApeTag::set_tracknumber(uint track) {
     set_item(APE_TAG_TRACK, format("%u", track).c_str(), 0);
 }
 
-uint ApeTag::get_year(void) const
-{
+uint ApeTag::get_year(void) const{
     unsigned long Year;
     Year = strtoul(get_item_value(APE_TAG_YEAR).toCString(true), NULL, 0); //JM ******
     return (uint)Year;
 }
 
-void ApeTag::set_year(const uint year)
-{
-//    char* yr;
-//    if(asprintf (&yr, "%u", year) >= 0) {
-//        String ystr = yr;
-//        set_item(APE_TAG_YEAR, ystr, 0);
-//        free(yr);
-//    }
+void ApeTag::set_year(const uint year){
     set_item(APE_TAG_YEAR, format("%u", year).c_str(), 0);
 }
 
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify

taginfo/asftaginfo.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     return false;
 }
 
-//
-//bool set_asf_image(ASF::Tag * asftag, const wxImage * image)
-//{
-//    return NULL;
-//}
-
-
 ASFTagInfo::ASFTagInfo(const string &filename) : Info(filename) {
     if(taglib_file && !taglib_file->isNull()) {
             m_ASFTag = ((TagLib::ASF::File *) taglib_file->file())->tag();
 
 
 void check_asf_label_frame(ASF::Tag * asftag, const char * description, const String &value) {
-    //guLogMessage(wxT("USERTEXT[ %s ] = '%s'"), wxString(description, wxConvISO8859_1).c_str(), value.c_str());
     if(asftag->attributeListMap().contains(description))
         asftag->removeItem(description);
     if(!value.isEmpty()) {
             m_ASFTag->removeItem("WM/SharedUserRating");
             int WMRatings[] = { 0, 0, 1, 25, 50, 75, 99 };
             
-//            char* str;
-//            if(asprintf (&str, "%i", WMRatings[ rating + 1 ]) >= 0) {
-//                m_ASFTag->setAttribute("WM/SharedUserRating", str);
-//                free(str);
-//            }
-            
             m_ASFTag->setAttribute("WM/SharedUserRating", format("%i", WMRatings[ rating + 1 ]).c_str());
         }
         
     return false;
 }
 
-//bool ASFTagInfo::can_handle_images(void)
-//{
-//    return false;
-//}
-
-//
-//wxImage * ASFTagInfo::get_image(void)
-//{
-//    if(m_ASFTag)
-//    {
-//        return get_asf_image(m_ASFTag);
-//    }
-//    return NULL;
-//}
-
-//
-//bool ASFTagInfo::set_image(const wxImage * image)
-//{
-//    if(m_ASFTag)
-//    {
-//        set_asf_image(m_ASFTag, image);
-//    }
-//    else
-//        return false;
-
-//    return true;
-//}
-
 
 bool ASFTagInfo::can_handle_lyrics(void) {
     return true;
 }
 
 
-
-
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
             if(m_XiphComment->fieldListMap().contains("PLAY_COUNTER")) {
                 long PlayCount = 0;
                 PlayCount = atol(m_XiphComment->fieldListMap()["PLAY_COUNTER"].front().toCString(false));
-//                if(m_XiphComment->fieldListMap()["PLAY_COUNTER"].front().toCString(true).ToLong(&PlayCount))
-// {
                 playcount = PlayCount;
-//                }
             }
             // Labels
             if(track_labels.size() == 0) {
         if(changedflag & CHANGED_DATA_RATING) {
             m_XiphComment->addField("RATING", format("%u", rating_to_popularity(rating)).c_str());
             m_XiphComment->addField("PLAY_COUNTER", format("%u", playcount).c_str());
-//            char* str;
-//            if(asprintf (&str, "%u" , rating_to_popularity(rating)) >= 0) {
-//                m_XiphComment->addField("RATING", str);
-//                free(str);
-//            }
-//            
-//            if(asprintf (&str, "%u" , playcount) >= 0) {
-//                m_XiphComment->addField("PLAY_COUNTER", str);
-//                free(str);
-//            }
         }
 
         if(changedflag & CHANGED_DATA_LABELS) {
     return false;
 }
 
-//
-//bool FlacInfo::set_image(const wxImage * image)
-//{
-//    bool RetVal = false;
-//    FLAC__Metadata_Chain * Chain;
-//    FLAC__Metadata_Iterator * Iter;
-
-//    Chain = FLAC__metadata_chain_new();
-//    if(Chain)
-//    {
-//        if(FLAC__metadata_chain_read(Chain, file_name.data()))
-//        {
-//            Iter = FLAC__metadata_iterator_new();
-//            if(Iter)
-//            {
-//                FLAC__metadata_iterator_init(Iter, Chain);
-
-//                while(FLAC__metadata_iterator_next(Iter))
-// {
-//                    if(FLAC__metadata_iterator_get_block_type(Iter) == FLAC__METADATA_TYPE_PICTURE)
-//     {
-//                        FLAC__StreamMetadata * Picture = FLAC__metadata_iterator_get_block(Iter);
-//                        if(Picture->data.picture.type ==  FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER)
-//         {
-//                            //
-//                            FLAC__metadata_iterator_delete_block(Iter, true);
-//                        }
-//                    }
-//                }
-
-//                wxMemoryOutputStream ImgOutputStream;
-//                if(image && image->SaveFile(ImgOutputStream, wxBITMAP_TYPE_JPEG))
-// {
-//                    FLAC__byte * CoverData = (FLAC__byte *) malloc(ImgOutputStream.GetSize());
-//                    if(CoverData)
-//     {
-//                        const char * PicErrStr;
-
-//                        ImgOutputStream.CopyTo(CoverData, ImgOutputStream.GetSize());
-
-//                        //
-//                        FLAC__StreamMetadata * Picture;
-//                        Picture = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE);
-//                        Picture->data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER;
-//                        FLAC__metadata_object_picture_set_mime_type(Picture,  (char *) "image/jpeg", TRUE);
-
-//                        //FLAC__metadata_object_picture_set_description(Picture, (char *) "", TRUE);
-//                        Picture->data.picture.width  = image->GetWidth();
-//                        Picture->data.picture.height = image->GetHeight();
-//                        Picture->data.picture.depth  = 0;
-
-//                        FLAC__metadata_object_picture_set_data(Picture, CoverData, (FLAC__uint32) ImgOutputStream.GetSize(), FALSE);
-
-//                        if(FLAC__metadata_object_picture_is_legal(Picture, &PicErrStr))
-//         {
-//                            FLAC__metadata_iterator_insert_block_after(Iter, Picture);
-//                        }
-//                        else
-//         {
-//                            FLAC__metadata_object_delete(Picture);
-//                        }
-//                    }
-//                }
-
-//                FLAC__metadata_chain_sort_padding(Chain);
-//                if(!FLAC__metadata_chain_write(Chain, TRUE, TRUE))
-// {
-//                    guLogError(wxT("Could not save the FLAC file"));
-//                }
-//                else
-// {
-//                    RetVal = true;
-//                }
-//            }
-//            else
-//            {
-//                guLogError(wxT("Could not create the FLAC Iterator."));
-//            }
-//        }
-//        else
-//        {
-//            guLogError(wxT("Could not read the FLAC metadata."));
-//        }
-
-//        FLAC__metadata_chain_delete(Chain);
-//    }
-//    else
-//    {
-//        guLogError(wxT("Could not create a FLAC chain."));
-//    }
-//    return RetVal;
-//}
-
 
 bool FlacInfo::can_handle_lyrics(void) {
     return true;

taginfo/id3_common.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 
 void id3v2_check_label_frame(ID3v2::Tag * tagv2, const String& description, const String &value) {
     ID3v2::UserTextIdentificationFrame * frame;
-    //guLogMessage(wxT("USERTEXT[ '%s' ] = '%s'"), wxString(description, wxConvUTF8).c_str(), value.c_str());
     frame = ID3v2::UserTextIdentificationFrame::find(tagv2, description);
     if(!frame) {
         frame = new ID3v2::UserTextIdentificationFrame(TagLib::String::UTF8);
         TagLib::ID3v2::UnsynchronizedLyricsFrame * LyricsFrame = 
             static_cast<TagLib::ID3v2::UnsynchronizedLyricsFrame * >(frameList.front());
         if(LyricsFrame) {
-            //guLogMessage(wxT("Found lyrics"));
-            return LyricsFrame->text();//String(LyricsFrame->text().toCString(true));
+            return LyricsFrame->text();
         }
     }
     return String("");
     TagLib::ID3v2::FrameList PopMList = tag->frameList("POPM");
     for(TagLib::ID3v2::FrameList::Iterator it = PopMList.begin(); it != PopMList.end(); ++it) {
             TagLib::ID3v2::PopularimeterFrame * PopMFrame = static_cast<TagLib::ID3v2::PopularimeterFrame *>(* it);
-        //printf("PopM e: '%s'  r: %i  c: %i", TStringTowxString(PopMFrame->email()).c_str(), PopMFrame->rating(), PopMFrame->counter());
         if(email.isEmpty() || (PopMFrame->email() == email)) {
             return PopMFrame;
         }
 
 
 void set_id3v2_lyrics(ID3v2::Tag * tagv2, const String &lyrics) {
-    //guLogMessage(wxT("Saving lyrics..."));
     TagLib::ID3v2::UnsynchronizedLyricsFrame * LyricsFrame;
     
     TagLib::ID3v2::FrameList FrameList = tagv2->frameListMap()["USLT"];
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-
+#include <algorithm>
+#include <string> 
 #include "taginfo.h"
 #include "taginfo_internal.h"
 
 
 
 Info * Info::create_tag_info(const string & filename) {
-    map<string,int> ext_map;
+    map<String,int> ext_map;
+    
+    ext_map["MP3"]  = MEDIA_FILE_TYPE_MP3;
+    ext_map["FLAC"] = MEDIA_FILE_TYPE_FLAC;
+    ext_map["OGG"]  = MEDIA_FILE_TYPE_OGG;
+    ext_map["OGA"]  = MEDIA_FILE_TYPE_OGA;
+    ext_map["MP4"]  = MEDIA_FILE_TYPE_MP4;
+    ext_map["M4A"]  = MEDIA_FILE_TYPE_M4A;
+    ext_map["M4B"]  = MEDIA_FILE_TYPE_M4B;
+    ext_map["M4P"]  = MEDIA_FILE_TYPE_M4P;
+    ext_map["AAC"]  = MEDIA_FILE_TYPE_AAC;
+    ext_map["WMA"]  = MEDIA_FILE_TYPE_WMA;
+    ext_map["ASF"]  = MEDIA_FILE_TYPE_ASF;
+    ext_map["APE"]  = MEDIA_FILE_TYPE_APE;
+    ext_map["WAV"]  = MEDIA_FILE_TYPE_WAV;
+    ext_map["AIF"]  = MEDIA_FILE_TYPE_AIF;
+    ext_map["WV"]   = MEDIA_FILE_TYPE_WV;
+    ext_map["TTA"]  = MEDIA_FILE_TYPE_TTA;
+    ext_map["MPC"]  = MEDIA_FILE_TYPE_MPC;
     
-    ext_map["mp3"]  = MEDIA_FILE_TYPE_MP3;
-    ext_map["flac"] = MEDIA_FILE_TYPE_FLAC;
-    ext_map["ogg"]  = MEDIA_FILE_TYPE_OGG;
-    ext_map["oga"]  = MEDIA_FILE_TYPE_OGA;
-    ext_map["mp4"]  = MEDIA_FILE_TYPE_MP4;
-    ext_map["m4a"]  = MEDIA_FILE_TYPE_M4A;
-    ext_map["m4b"]  = MEDIA_FILE_TYPE_M4B;
-    ext_map["m4p"]  = MEDIA_FILE_TYPE_M4P;
-    ext_map["aac"]  = MEDIA_FILE_TYPE_AAC;
-    ext_map["wma"]  = MEDIA_FILE_TYPE_WMA;
-    ext_map["asf"]  = MEDIA_FILE_TYPE_ASF;
-    ext_map["ape"]  = MEDIA_FILE_TYPE_APE;
-    ext_map["wav"]  = MEDIA_FILE_TYPE_WAV;
-    ext_map["aif"]  = MEDIA_FILE_TYPE_AIF;
-    ext_map["wv"]   = MEDIA_FILE_TYPE_WV;
-    ext_map["tta"]  = MEDIA_FILE_TYPE_TTA;
-    ext_map["mpc"]  = MEDIA_FILE_TYPE_MPC;
+    String fnex = filename.substr(filename.find_last_of(".") + 1).c_str();
+    fnex = fnex.upper();
     
-    string fnex = filename.substr(filename.find_last_of(".") + 1);
     if(ext_map[fnex] == 0)
         return NULL;
     
     int format = ext_map[fnex];
     switch(format) {
-            case  MEDIA_FILE_TYPE_MP3 :
+        case  MEDIA_FILE_TYPE_MP3 :
             return new Mp3Info(filename);
         case  MEDIA_FILE_TYPE_FLAC :
             return new FlacInfo(filename);
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 
 
 Mp3Info::~Mp3Info() {
-
 }
 
 
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "TRACK_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guTRLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Track Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
-                    // [guTRLABELS] guTRLABELS labels
+                if(Frame) {
                     StringList TrLabelsList = Frame->fieldList();
                     if(TrLabelsList.size())
                     {
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "ARTIST_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guARLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Artist Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
+                if(Frame) {
                     StringList ArLabelsList = Frame->fieldList();
                     if(ArLabelsList.size())
                     {
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "ALBUM_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guALLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Album Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
+                if(Frame) {
                     StringList AlLabelsList = Frame->fieldList();
                     if(AlLabelsList.size())
                     {
         
     }
     else {
-          cout  << "Error: Could not read tags from file '" << file_name.toCString(true) << "'" <<  endl;//printf("Error: Could not read tags from file '%s'\n", file_name.data());
+          cout  << "Error: Could not read tags from file '" << file_name.toCString(true) << "'" <<  endl;
         return false; //JM
     }
     return true;
 }
 
 
-//bool Mp3Info::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * Mp3Info::get_image(void)
-//{
-//    if(taglib_tagId3v2)
-//    {
-//        return get_id3v2_image(taglib_tagId3v2);
-//    }
-//    return NULL;
-//}
-
-//
-//bool Mp3Info::set_image(const wxImage * image)
-//{
-//    if(taglib_tagId3v2)
-//    {
-//        SetID3v2Image(taglib_tagId3v2, image);
-//    }
-//    else
-//        return false;
-
-//    return true;
-//}
-
-
 bool Mp3Info::can_handle_lyrics(void) {
     return true;
 }

taginfo/mp4_common.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     return false;
 }
 
-//
-//bool set_mp4_cover_art(TagLib::MP4::Tag * mp4tag, const wxImage * image)
-//{
-//    if(mp4tag)
-//    {
-//        if(mp4tag->itemListMap().contains("covr"))
-//        {
-//            mp4tag->itemListMap().erase("covr");
-//        }
-
-//        if(image)
-//        {
-//            wxMemoryOutputStream ImgOutputStream;
-//            if(image && image->SaveFile(ImgOutputStream, wxBITMAP_TYPE_JPEG))
-//            {
-//                ByteVector ImgData((TagLib::uint) ImgOutputStream.GetSize());
-//                ImgOutputStream.CopyTo(ImgData.data(), ImgOutputStream.GetSize());
-
-//                TagLib::MP4::CoverArtList CoverList;
-//                TagLib::MP4::CoverArt Cover(TagLib::MP4::CoverArt::JPEG, ImgData);
-//                CoverList.append(Cover);
-//                mp4tag->itemListMap()[ "covr" ] = CoverList;
-
-//                return true;
-//            }
-//            return false;
-//        }
-//        return true;
-//    }
-//    return false;
-//}
-//#endif
-
 
 String get_mp4_lyrics(TagLib::MP4::Tag * mp4tag) {
     if(mp4tag) {
             if(mp4tag->itemListMap().contains("\xa9lyr"))
-            return mp4tag->itemListMap()[ "\xa9lyr" ].toStringList().front();//.toCString(true);
+            return mp4tag->itemListMap()[ "\xa9lyr" ].toStringList().front();
     }
     return "";
 }
             mp4tag->itemListMap().erase("\xa9lyr");
         }
         if(!lyrics.isEmpty()) {
-//            const TagLib::String Lyrics = lyrics.c_str();
             mp4tag->itemListMap()[ "\xa9lyr" ] = TagLib::StringList(lyrics);
         }
         return true;
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
                 composer = m_Mp4Tag->itemListMap()["\xa9wrt"].toStringList().front();
             }
             if(m_Mp4Tag->itemListMap().contains("disk")) {
-//                char* c_disk_str;
                 disk_str = format("%i/%i", m_Mp4Tag->itemListMap()["disk"].toIntPair().first,
                                            m_Mp4Tag->itemListMap()["disk"].toIntPair().second).c_str();
-//                if(asprintf(&c_disk_str, "%i/%i", m_Mp4Tag->itemListMap()["disk"].toIntPair().first,
-//                                                m_Mp4Tag->itemListMap()["disk"].toIntPair().second) >= 0) {
-//                    disk_str = c_disk_str;
-//                    free(c_disk_str);
-//                }
-//                disk_str = wxString::Format(wxT("%i/%i"),
-//                    m_Mp4Tag->itemListMap()["disk"].toIntPair().first,
-//                    m_Mp4Tag->itemListMap()["disk"].toIntPair().second);
             }
             if(m_Mp4Tag->itemListMap().contains("cpil")) {
                 is_compilation = m_Mp4Tag->itemListMap()["cpil"].toBool();
             if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:RATING")) {
                 long Rating = 0;
                 Rating = atol(m_Mp4Tag->itemListMap()["----:com.apple.iTunes:RATING"].toStringList().front().toCString(true));
-                if(Rating)
-                {
-                    if(Rating > 5)
-                    {
+                if(Rating) {
+                    if(Rating > 5) {
                         rating = popularity_to_rating(Rating);
                     }
-                    else
-                    {
+                    else {
                         rating = Rating;
                     }
                 }
             }
             // Labels
             if(track_labels.size() == 0) {
-                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:TRACK_LABELS"))
-                {
+                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:TRACK_LABELS")) {
                     track_labels_str = m_Mp4Tag->itemListMap()["----:com.apple.iTunes:TRACK_LABELS"].toStringList().front();
                     track_labels = split(track_labels_str, "|");
                 }
             }
             if(artist_labels.size() == 0) {
-                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:ARTIST_LABELS"))
-                {
+                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:ARTIST_LABELS")) {
                     artist_labels_str = m_Mp4Tag->itemListMap()["----:com.apple.iTunes:ARTIST_LABELS"].toStringList().front();
                     artist_labels = split(artist_labels_str, "|");
                 }
             }
             if(album_labels.size() == 0) {
-                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:ALBUM_LABELS"))
-                {
+                if(m_Mp4Tag->itemListMap().contains("----:com.apple.iTunes:ALBUM_LABELS")) {
                     album_labels_str = m_Mp4Tag->itemListMap()["----:com.apple.iTunes:ALBUM_LABELS"].toStringList().front();
                     album_labels = split(album_labels_str, "|");
                 }
 
 
 void mp4_check_label_frame(TagLib::MP4::Tag * mp4tag, const char * description, const String &value) {
-    //guLogMessage(wxT("USERTEXT[ %s ] = '%s'"), wxString(description, wxConvISO8859_1).c_str(), value.c_str());
     if(mp4tag->itemListMap().contains(description)) {
             if(!value.isEmpty()) {
             mp4tag->itemListMap()[ description ] = TagLib::MP4::Item(TagLib::StringList(value));
         }
         
         if(changedflag & CHANGED_DATA_RATING) {
-//            char* c_rating;
-//            if(asprintf (&c_rating, "%u", rating_to_popularity(rating)) >= 0) {
-//                m_Mp4Tag->itemListMap()["----:com.apple.iTunes:RATING" ] = TagLib::MP4::Item(c_rating);
-//                free(c_rating);
-//            }
             m_Mp4Tag->itemListMap()["----:com.apple.iTunes:RATING" ] = 
                 TagLib::MP4::Item(format("%u", rating_to_popularity(rating)).c_str());
             
-//            char* c_count;
-//            if(asprintf (&c_count, "%u", playcount) >= 0) {
-//                m_Mp4Tag->itemListMap()[ "----:com.apple.iTunes:PLAY_COUNTER" ] = TagLib::MP4::Item(c_count);
-//                free(c_count);
-//            }
             m_Mp4Tag->itemListMap()[ "----:com.apple.iTunes:PLAY_COUNTER" ] = 
                 TagLib::MP4::Item(format("%u", playcount).c_str());
         }
     return Info::write(changedflag);
 }
 
-//#ifdef TAGLIB_WITH_MP4_COVERS
 bool Mp4Info::can_handle_images(void) {
     return true;
 }
     return false;
 }
 
-//
-//bool Mp4Info::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * Mp4Info::get_image(void)
-//{
-//    return get_mp4_cover_art(m_Mp4Tag);
-//}
-
-//
-//bool Mp4Info::set_image(const wxImage * image)
-//{
-//    return set_mp4_cover_art(m_Mp4Tag, image);
-//}
-//#endif
-
-
 bool Mp4Info::can_handle_lyrics(void) {
     return true;
 }
 
 
 String Mp4Info::get_lyrics(void) {
-    //TagLib::MP4::File tagfile(file_name.mb_str(wxConvFile));
     return get_mp4_lyrics(((TagLib::MP4::File *) taglib_file->file())->tag());
 }
 
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     return false;
 }
 
-//bool MpcInfo::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * MpcInfo::get_image(void)
-//{
-//    return get_ape_image(taglib_apetag);
-//}
-
-//
-//bool MpcInfo::set_image(const wxImage * image)
-//{
-//    //return taglib_apetag && set_ape_image(taglib_apetag, image) && write();
-//    return taglib_apetag && set_ape_image(taglib_apetag, image);
-//}
-
-
-
-
 bool MpcInfo::read(void) {
     if(Info::read()) {
         if(taglib_apetag) {
             if(track_labels.size() == 0) {
                 if(taglib_apetag->itemListMap().contains("TRACK_LABELS")) {
                     track_labels_str = taglib_apetag->itemListMap()["TRACK_LABELS"].toStringList().front();
-                    //guLogMessage(wxT("*Track Label: '%s'\n"), track_labels_str.c_str());
                     track_labels = split(track_labels_str, "|");
 //                    track_labels = Regex::split_simple("|", track_labels_str);//(track_labels_str, wxT("|"));
                 }
     return Info::write(changedflag);
 }
 
-//
-//bool MpcInfo::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * MpcInfo::get_image(void)
-//{
-//    return get_ape_image();
-//}
-
-//
-//bool MpcInfo::set_image(const wxImage * image)
-//{
-//    //return  && set_ape_image(, image) && write();
-//    return  && set_ape_image(, image);
-//}
-
 
 
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
                         rating = Rating;
                     }
                 }
-//                }
             }
             if(m_XiphComment->fieldListMap().contains("PLAY_COUNTER")) {
                 long PlayCount = 0;
                 PlayCount = atol(m_XiphComment->fieldListMap()["PLAY_COUNTER"].front().toCString(true));
-//                {
                 playcount = PlayCount;
-//                }
             }
             // Labels
             if(track_labels.size() == 0) {
                 if(m_XiphComment->fieldListMap().contains("TRACK_LABELS"))
                 {
                     track_labels_str = m_XiphComment->fieldListMap()["TRACK_LABELS"].front();
-                    //guLogMessage(wxT("*Track Label: '%s'\n"), track_labels_str.c_str());
                     track_labels = split(track_labels_str, "|");
                 }
             }
                 if(m_XiphComment->fieldListMap().contains("ARTIST_LABELS"))
                 {
                     artist_labels_str = m_XiphComment->fieldListMap()["ARTIST_LABELS"].front();
-                    //guLogMessage(wxT("*Artist Label: '%s'\n"), artist_labels_str.c_str());
                     artist_labels = split(artist_labels_str, "|");
                 }
             }
                 if(m_XiphComment->fieldListMap().contains("ALBUM_LABELS"))
                 {
                     album_labels_str = m_XiphComment->fieldListMap()["ALBUM_LABELS"].front();
-                    //guLogMessage(wxT("*Album Label: '%s'\n"), album_labels_str.c_str());
                     album_labels = split(album_labels_str, "|");
                 }
             }
                 free(str);
             }
         }
-
         if(changedflag & CHANGED_DATA_LABELS) {
             // The Labels
             check_xiph_label_frame(m_XiphComment, "ARTIST_LABELS", artist_labels_str);
     return set_xiph_comment_cover_art(m_XiphComment, data, data_length, image_type);
 }
 
-//bool OggInfo::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * OggInfo::get_image(void)
-//{
-//    return get_xiph_comment_cover_art(m_XiphComment);
-//}
-
-//
-//bool OggInfo::set_image(const wxImage * image)
-//{
-//    return set_xiph_comment_cover_art(m_XiphComment, image);
-//}
-
-
 bool OggInfo::can_handle_lyrics(void) {
     return true;
 }
 
-
 String OggInfo::get_lyrics(void) {
     return get_xiph_comment_lyrics(m_XiphComment);
 }
 
-
 bool OggInfo::set_lyrics(const String &lyrics) {
     return set_xiph_comment_lyrics(m_XiphComment, lyrics);
 }
 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     };
     
     
-    class Info
-    {
+    class Info {
         protected :
-            FileRef *       taglib_file;
-            Tag *           taglib_tag;
+            FileRef *  taglib_file;
+            Tag *       taglib_tag;
             
             void set_file_name(const string &filename);
-        
-        
+            
+            
         public:
             String file_name;
             String track_name;
     class Mp3Info : public Info {
         protected :
             ID3v2::Tag * taglib_tagId3v2;
-
+            
         public :
             Mp3Info(const string &filename = "");
             ~Mp3Info();
             FlacInfo(const string &filename = "");
             ~FlacInfo();
             
-            virtual bool        read(void);
-            virtual bool        write(const int changedflag);
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
             
-            virtual bool        can_handle_images(void);
+            virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
             virtual bool set_image(char* data, int data_length, ImageType image_type);
             
-            virtual bool        can_handle_lyrics(void);
-            virtual String    get_lyrics(void);
-            virtual bool        set_lyrics(const String &lyrics);
+            virtual bool  can_handle_lyrics(void);
+            virtual String get_lyrics(void);
+            virtual bool set_lyrics(const String &lyrics);
     };
-
+    
     
     class OggInfo : public Info {
         protected :
             Ogg::XiphComment * m_XiphComment;
-        
+            
         public :
             OggInfo(const string &filename = "");
             ~OggInfo();
             virtual String    get_lyrics(void);
             virtual bool        set_lyrics(const String &lyrics);
     };
-
+    
     
     class Mp4Info : public Info {
         protected :
-            TagLib::MP4::Tag *  m_Mp4Tag;
-        
+            TagLib::MP4::Tag * m_Mp4Tag;
+            
         public :
             Mp4Info(const string &filename = "");
             ~Mp4Info();
             
-            virtual bool        read(void);
-            virtual bool        write(const int changedflag);
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
             
-            virtual bool        can_handle_images(void);
+            virtual bool can_handle_images(void);
             virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
             virtual bool set_image(char* data, int data_length, ImageType image_type);
             
             virtual String get_lyrics(void);
             virtual bool set_lyrics(const String &lyrics);
     };
-
+    
     
     class ApeInfo : public Info {
         protected:
-            Ape::ApeFile       ape_file;
-        
+            Ape::ApeFile ape_file;
+            
         public:
             ApeInfo(const string &filename = "");
             ~ApeInfo();
             virtual bool set_lyrics(const String &lyrics);
     };
     
-    class MpcInfo : public Info
-    {
-      protected :
-        TagLib::APE::Tag * taglib_apetag;
-        
-      public :
-        MpcInfo(const string &filename = "");
-        ~MpcInfo();
-        
-        virtual bool read(void);
-        virtual bool write(const int changedflag);
-
-        virtual bool can_handle_images(void);
-//        virtual bool get_image(char*& data, int &data_length) const;
-//        virtual bool set_image(char* data, int data_length);
-        virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-        virtual bool set_image(char* data, int data_length, ImageType image_type);
-    //    virtual bool can_handle_images(void);
-    //    virtual wxImage * get_image(void);
-    //    virtual bool set_image(const String * image);
+    
+    class MpcInfo : public Info {
+        protected :
+            TagLib::APE::Tag * taglib_apetag;
+            
+        public :
+            MpcInfo(const string &filename = "");
+            ~MpcInfo();
+            
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
+            
+            virtual bool can_handle_images(void);
+            virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
+            virtual bool set_image(char* data, int data_length, ImageType image_type);
     };
-
     
-    class WavPackInfo : public Info
-    {
-      protected :
-        TagLib::APE::Tag * taglib_apetag;
-
-      public :
-        WavPackInfo(const string &filename = "");
-        ~WavPackInfo();
-
-        virtual bool read(void);
-        virtual bool write(const int changedflag);
-
-        virtual bool can_handle_images(void);
-        virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-        virtual bool set_image(char* data, int data_length, ImageType image_type);
-//        virtual bool get_image(char*& data, int &data_length) const;
-//        virtual bool set_image(char* data, int data_length);
-    //    virtual bool can_handle_images(void);
-    //    virtual wxImage * get_image(void);
-    //    virtual bool set_image(const wxImage * image);
-        
-        virtual bool can_handle_lyrics(void);
-        virtual String get_lyrics(void);
-        virtual bool set_lyrics(const String &lyrics);
+    
+    class WavPackInfo : public Info {
+        protected :
+            TagLib::APE::Tag * taglib_apetag;
+            
+        public :
+            WavPackInfo(const string &filename = "");
+            ~WavPackInfo();
+            
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
+            
+            virtual bool can_handle_images(void);
+            virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
+            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            
+            virtual bool can_handle_lyrics(void);
+            virtual String get_lyrics(void);
+            virtual bool set_lyrics(const String &lyrics);
     };
-
     
-    class TrueAudioInfo : public Info
-    {
-      protected :
-        ID3v2::Tag * taglib_tagId3v2;
-        
-      public :
-        TrueAudioInfo(const string &filename = "");
-        ~TrueAudioInfo();
-        
-        virtual bool read(void);
-        virtual bool write(const int changedflag);
-        
-        virtual bool can_handle_images(void);
-        virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-        virtual bool set_image(char* data, int data_length, ImageType image_type);
-//        virtual bool get_image(char*& data, int &data_length) const;
-//        virtual bool set_image(char* data, int data_length);
-    //    virtual bool        can_handle_images(void);
-    //    virtual wxImage *   get_image(void);
-    //    virtual bool        set_image(const wxImage * image);
+    
+    class TrueAudioInfo : public Info {
+        protected :
+            ID3v2::Tag * taglib_tagId3v2;
         
-        virtual bool can_handle_lyrics(void);
-        virtual String get_lyrics(void);
-        virtual bool set_lyrics(const String &lyrics);
+        public :
+            TrueAudioInfo(const string &filename = "");
+            ~TrueAudioInfo();
+            
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
+            
+            virtual bool can_handle_images(void);
+            virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
+            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            
+            virtual bool can_handle_lyrics(void);
+            virtual String get_lyrics(void);
+            virtual bool set_lyrics(const String &lyrics);
     };
-
     
-    class ASFTagInfo : public Info
-    {
-      protected :
-        ASF::Tag *        m_ASFTag;
-
-      public :
-        ASFTagInfo(const string &filename = "");
-        ~ASFTagInfo();
-
-        virtual bool read(void);
-        virtual bool write(const int changedflag);
-
-        virtual bool can_handle_images(void);
-        virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
-        virtual bool set_image(char* data, int data_length, ImageType image_type);
-//        virtual bool get_image(char*& data, int &data_length) const;
-//        virtual bool set_image(char* data, int data_length);
-    //    virtual bool        can_handle_images(void);
-    //    virtual wxImage *   get_image(void);
-    //    virtual bool        set_image(const wxImage * image);
+    
+    class ASFTagInfo : public Info {
+        protected :
+            ASF::Tag * m_ASFTag;
         
-        virtual bool can_handle_lyrics(void);
-        virtual String get_lyrics(void);
-        virtual bool set_lyrics(const String &lyrics);
+        public :
+            ASFTagInfo(const string &filename = "");
+            ~ASFTagInfo();
+            
+            virtual bool read(void);
+            virtual bool write(const int changedflag);
+            
+            virtual bool can_handle_images(void);
+            virtual bool get_image(char*& data, int &data_length, ImageType &image_type);
+            virtual bool set_image(char* data, int data_length, ImageType image_type);
+            
+            virtual bool can_handle_lyrics(void);
+            virtual String get_lyrics(void);
+            virtual bool set_lyrics(const String &lyrics);
     };
 }
 #endif

taginfo/taginfo_internal.h

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
     disknum = 0;
     disktotal = 0;
     string DiskNum = diskstr.substr(0, diskstr.find_first_of("/"));
-//    string DiskNum = diskstr.BeforeFirst(wxT('/'));
     if(!DiskNum.empty()) {
         Number = strtoul(DiskNum.data(), NULL, 0);
         
             disknum = Number;
             if(diskstr.find("/") != string::npos) {
                 DiskNum = diskstr.substr(diskstr.find_first_of("/") + 1);
-                //diskstr.AfterFirst(wxT('/'));
                 Number = strtoul(DiskNum.data(), NULL, 0);
-//                if(DiskNum.ToULong(&Number))
-//                {
                 disktotal = Number;
-//                }
             }
             return true;
         }

taginfo/trueaudioinfo.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
             PopMFrame = get_popularity_frame(taglib_tagId3v2, "LibTagInfo");
             if(!PopMFrame)
                 PopMFrame = get_popularity_frame(taglib_tagId3v2, "");
-
             if(PopMFrame) {
                 rating = popularity_to_rating(PopMFrame->rating());
                 playcount = PopMFrame->counter();
             }
-
-
             if(track_labels.size() == 0) {
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "TRACK_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guTRLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Track Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
-                    // [guTRLABELS] guTRLABELS labels
+                if(Frame) {
                     track_labels_str = Frame->fieldList()[ 1 ];
                     track_labels = split(track_labels_str, "|");
 //                    track_labels = Regex::split_simple("|", track_labels_str);//(track_labels_str, wxT("|"));
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "ARTIST_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guARLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Artist Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
+                if(Frame) {
                     artist_labels_str = Frame->fieldList()[ 1 ];
                     artist_labels = split(artist_labels_str, "|");
 //                    artist_labels = Regex::split_simple("|", artist_labels_str);//(artist_labels_str, wxT("|"));
                 ID3v2::UserTextIdentificationFrame * Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "ALBUM_LABELS");
                 if(!Frame)
                     Frame = ID3v2::UserTextIdentificationFrame::find(taglib_tagId3v2, "guALLABELS");
-                if(Frame)
-                {
-                    //guLogMessage(wxT("*Album Label: '%s'"), TStringTowxString(Frame->fieldList()[ 1 ]).c_str());
+                if(Frame) {
                     album_labels_str = Frame->fieldList()[ 1 ];
                     album_labels = split(album_labels_str, "|");
 //                    album_labels = Regex::split_simple("|", album_labels_str);//(album_labels_str, wxT("|"));
     return true;
 }
 
-//bool TrueAudioInfo::can_handle_images(void)
-//{
-//    return true;
-//}
-
-//
-//wxImage * TrueAudioInfo::get_image(void)
-//{
-//    if(taglib_tagId3v2)
-//    {
-//        return get_id3v2_image(taglib_tagId3v2);
-//    }
-//    return NULL;
-//}
-
-//
-//bool TrueAudioInfo::set_image(const wxImage * image)
-//{
-//    if(taglib_tagId3v2)
-//    {
-//        SetID3v2Image(taglib_tagId3v2, image);
-//    }
-//    else
-//        return false;
-
-//    return true;
-//}
-
-
 bool TrueAudioInfo::can_handle_lyrics(void) {
     return true;
 }

taginfo/wavpackinfo.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify
 
 bool WavPackInfo::write(const int changedflag) {
     if(taglib_apetag) {
-            if(changedflag & CHANGED_DATA_TAGS) {
+        if(changedflag & CHANGED_DATA_TAGS) {
             taglib_apetag->addValue("COMPOSER", composer);
             taglib_apetag->addValue("DISCNUMBER", disk_str);
             
 bool WavPackInfo::set_image(char* data, int data_length, ImageType image_type) {
     return set_ape_image(taglib_apetag, data, data_length, image_type);
 }
-//
-//bool WavPackInfo::can_handle_images(void)
-//{
-//    return true;
-//}
-
-
-//wxImage * WavPackInfo::get_image(void)
-//{
-//    return get_ape_image(taglib_apetag);
-//}
-
-//
-//bool WavPackInfo::set_image(const wxImage * image)
-//{
-//    return taglib_apetag && set_ape_image(taglib_apetag, image);
-//}
-
 
 bool WavPackInfo::can_handle_lyrics(void) {
     return true;
     return set_ape_lyrics(taglib_apetag, lyrics);
 }
 
-

taginfo/xiph_common.cc

 /* Original Author 2008-2012: J.Rios
  * 
- * Edited by: Jörn Magens <shuerhaaken@googlemail.com>
+ * Edited by: 2012-2013 Jörn Magens <shuerhaaken@googlemail.com>
  * 
  * 
  * This Program is free software; you can redistribute it and/or modify