Hi Michael, It's good to have You back.
I was working a little in the component and I'll like to show You my advances:
- Looking at the code from original component, It's a real mess. I think It needs to be fully rewritten.
- Regarding to DUI support, I Implement It by declaring public the member "StaticWnd" of "uie_lyrics" class.
.......- Edit mode enable/disable is implemented and Right click works
.......- When the component isn't visible, It disables redraw for minimize CPU utilization
.......- The implementation is Single instance
- I really don't see the point of allowing a multi instance element.
- The current version (0.4.5.2) has a High CPU usage, even when foobar window is minimized.
- I've rewritten the function "ReadLyricFromTag" and now It can found tags in UPnP files as requested by user gebla.
bool ReadLyricFromTag(const metadb_handle_ptr & track, tstring & out)
{
//if (strnicmp("file://", path, _countof("file://") - 1)) /* Removed: Permits Query Tags From UPnP Component (http) */
// return false;
if (wildcard_helper::test_path( track->get_path(), t2u(cfg_skipbyfiletype.get_value()),true) )
return false;
pfc::string8 tag_list = pfc::stringcvt::string_utf8_from_wide( cfg_lyric_tag.get_string_ref().c_str() ); /* Suggestion: Change Config Variables To cfg_string */
tag_list.replace_char( ';', '\0' );
track->metadb_lock();
service_ptr_t<titleformat_object> script_tag;
pfc::string8 tag, raw_tag, out_tmp;
for( unsigned int length = 0; length < tag_list.get_length(); length += raw_tag.get_length()+1 )
{
raw_tag.set_string( tag_list.get_ptr()+length );
if( !raw_tag.get_length() ) /* Empty Tag */
continue;
tag.set_string( "[%" );
tag.add_string( raw_tag );
tag.add_string( "%]" );
static_api_ptr_t<titleformat_compiler>()->compile_safe( script_tag, tag );
track->format_title( NULL, out_tmp, script_tag, NULL ); /* Query For Tag Content */
if( out_tmp.get_length() > 0 ) /* Tag Content Found */
{
out = u2t( out_tmp.get_ptr() );
track->metadb_unlock();
return true;
}
}
track->metadb_unlock();
return false;
}
- I would like to help You developing the component, but the source published is too old.
I'll hope my code can help You.
DUI Implementation Code