getting started with ios

Christopher Scott chris at phatfly.com
Wed Mar 26 18:52:30 UTC 2014


OK, I got taglib and cmake to work together and now have a library and headers files that work with armv6, armv7 and armv7s.  I thought I included i386 but I am getting errors when compiling for the sim.  Though, it works fine on the device and ultimately this is the goal … so I happy with this so far.  Later I will look at what is going on that i386 isn’t getting included.  I am new to cmake and it’s processes so I will leave this for a rainy day or if I need to support it later.

I have been able to bring id3 editing code to my iOS project that another coworker wrote for mac.  While his code works for his project, because I believe that he is not hitting the remove case, I have tested it and it’s bothering me that it’s not working correctly.  The code looks for a PRIV frame and is suppose to remove it.  I think what is going wrong with the code that my coworker wrote is it’s trying to remove the frameListMap entry and not the actual frame.

Does anyone know how to correctly remove the priv frame?  I have to inject a uits payload that is specific to my user.  If I comment out the "tag->removeFrame(l[i]);” line in the code below, I stop getting errors, but then if there is a previous priv frame with uits data, this code adds a second entry to the priv tag.  Chances are that the track files that my app downloads will never contain a priv tag or uits data (unless I put it there already), but it would be nice to know that the code is only allowing one entry in the priv frame.


Does this make sense?

Any ideas how to remove the priv frame?

Thanks!
Chris

Oh, I am able to write to the tag … just not remove the priv frame.

The code:



		TagLib::ID3v2::FrameList l = f.ID3v2Tag()->frameListMap()["PRIV"];
                
                for (int i = 0; i < l.size(); i++) {
               
                    
                 if (l[i]->toString() == “ownerEmailAddress")
                 {
                     
                     cout << l[i]->toString() << endl;
                     
                     const TagLib::ByteVector v = TagLib::ByteVector::fromCString(UITSPayload, (uint32_t) strlen(UITSPayload));
                     
                     l[i]->setData(UITSPayload);
                     tag->removeFrame(l[i]);
                     tag->addFrame(l[i]);
                     found = true;
                     break;
                 }
                }
                if (!found)
                {
                
                TagLib::ID3v2::PrivateFrame *frame = new TagLib::ID3v2::PrivateFrame ();
                 
                    frame->setOwner("ownerEmailAddress");
                   const TagLib::ByteVector v = TagLib::ByteVector::fromCString(UITSPayload, (uint32_t) strlen(UITSPayload));
                   frame->setData(v);
              
                  tag->addFrame(frame);
                    f.save();
                }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20140326/d96fd05a/attachment-0001.html>


More information about the taglib-devel mailing list