<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Nov 14, 2018, at 13:44, Scott Wheeler <<a href="mailto:scott@taglib.org" class="">scott@taglib.org</a>> wrote:<div class=""><br class=""><div><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">The problem is that the result of file->tag() *isn't* an ID3v2::Tag, so casting it to that fails.  (It's a special class that's a union of the available tag types for that file.)  To get the ID3v2 tag, you have to use the ID3v2Tag() method:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Ah, a union. I somehow had the idea that the relationship was a virtual inheritance.</div><div><br class=""></div><div>So, the corrected code block now reads:</div><div><br class=""></div><div><div class="">*** snip snip ***</div><div class="">TagLib::MPEG::File *file=new TabLib::MPEG::File(“my_file.mp3”,false);</div><div class="">TagLib::ID3v2::Tag *tag=file->ID3v2Tag();</div><div class=""><br class=""></div><div class="">TagLib::ID3v2::UserTextIdentificationFrame *frame=new TagLib::ID3v2::UserTextIdentificationFrame(TagLib::String::UTF8);</div><div class="">frame->setDescription(“foo”);</div><div class="">frame->setText(“some structured text”);</div><div class="">tag->addFrame(frame);</div><div class="">*** snip snip ***</div><div class=""><br class=""></div><div class="">Thank you.</div><div class=""><br class=""></div><div class="">Cheers!</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|----------------------------------------------------------------------|</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">| Frederick F. Gleason, Jr. |              Chief Developer             |</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|                           |              Paravel Systems             |</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|----------------------------------------------------------------------|</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|          A room without books is like a body without a soul.         |</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|                                         -- Cicero                    |</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">|----------------------------------------------------------------------|</span></div></div></div></div></div></body></html>