Help - Search - Members - Calendar
Full Version: retrieving config-data
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
kdx
hi smile.gif

well, one question:
is it possible to retrieve configuration-data from other (core-) plugins to use it in yours ? currently i'm interested in the default playlist font/color and i don't know, hot to get them ..

i tried something like that to get some "config_vars" (whatever they are wink.gif)
CODE

int count = service_enum_get_count_t( config_var );
config_var **p = new config_var*[count];
for (int a = 0; a < count; a++)
{
 p[a] = service_enum_create_t( config_var, a );
 _RPT1( 0, "%s\r\n", p[a]->get_name() );
}

but apparently the ones i need are not among them ..

thanks in advance for any info about this ;D
foosion
QUOTE(kdx @ Mar 12 2004, 12:06 AM)
is it possible to retrieve configuration-data from other (core-) plugins to use it in yours ?

Yes, though you can only use configuration data that is made publicly available by other components.

QUOTE
currently i'm interested in the default playlist font/color and i don't know, hot to get them ..

The playlist color and font settings are local to each of the current user interfaces and cannot be accessed from outside. There is no default playlist color and font in the core.

QUOTE
i tried something like that to get some "config_vars" (whatever they are wink.gif)

A more standard way to enumerate all config_var instances would be like this:
CODE
service_enum_t<config_var> e;
config_var * ptr;
for (ptr = e.first(); ptr; ptr = e.next() {
   console::info(ptr->get_name());
   ptr->service_release();
}

If you need to keep the config_var pointers for later use, you can store the pointer using the service_ptr_list_t<config_var> or service_ptr_list_autodel_t<config_var> template class instead of calling the service_release method immediately.
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.