Help - Search - Members - Calendar
Full Version: preferences_branch_factory help
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
Alexi
Hello!

I am trying to figure out how to create a branch of prefrence pages. I notice there's a preferences_branch_factory class for doing such a thing, but I can't wrap my head around it. Does anyone know of any example source code out there? or have any pointers?

I hope I can dynamically choose the contents of the branch, or at least dynamically at startup.

Thanks for any help.

Cheers,
Alex
foosion
Preference branches work much like preference pages, for example their GUID and name is fixed at compile-time, but they have no associated page and two or more branches with the same GUID are merged into one, so the same branch can be declared in multiple DLLs.

Here is a code example (taken from foo_freedb2/foo_tradersfriend):
CODE
static const GUID guid_prefs_tagging =
{ 0x563107c3, 0xfc7d, 0x4022, { 0xa8, 0x72, 0xa8, 0x2a, 0x2b, 0x3f, 0xd5, 0x25 } };

static preferences_branch_factory g_preferences_branch_tagging(
    // GUID of the branch.
    guid_prefs_tagging,
    // GUID of the parent branch.
    preferences_page::guid_tools,
    // Name of the branch.
    "Tagging");


Perhaps what you are trying to do is better solved with a single preference page with a tab control.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.