Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: How to use track_property_provider (Read 2580 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to use track_property_provider

Please teach the usage of track_property_provider.

How to use track_property_provider

Reply #1
Warning: Code is untested.
Code: [Select]
class custom_track_property_provider : public track_property_provider_v2
{
public:
virtual void enumerate_properties(metadb_handle_list_cref p_tracks, track_property_callback & p_out)
{
// Compute value based on p_tracks.
pfc::string8 value;

if (compute_property_value(p_tracks, value))
{
p_out.set_property("XYZ Group", 0.0, "XYZ Property", value);
}
}

virtual bool is_our_tech_info(const char * p_name)
{
// Remove "xyz" and "uvw" from unknown tech info section.
if ((0 == stricmp_utf_8(p_name, "xyz")) || (0 == stricmp_utf_8(p_name, "uvw")))
{
return true;
}
else
{
return false;
}
}

virtual void enumerate_properties_v2(metadb_handle_list_cref p_tracks, track_property_callback_v2 & p_out)
{
if (p_out.is_group_wanted("XYZ Group"))
{
enumerate_properties(p_track, p_out);
}
}

private:
bool compute_property_value(metadb_handle_list_cref p_track, pfc::string_base & p_out);
};

namespace {
track_property_provider_factory<custom_track_property_provider> g_custom_track_property_provider;
}