Changeset b96154a2673604c3550a0ff0296a48d16420800a
- Timestamp:
- 03/03/08 19:57:43
(6 months ago)
- Author:
- André Weber <WeberAndre@gmx.de>
- git-committer:
- André Weber <WeberAndre@gmx.de> 1204570663 +0100
- git-parent:
[487b2b1e7439028935350ce5550afcac098bd5f3]
- git-author:
- André Weber <WeberAndre@gmx.de> 1204570663 +0100
- Message:
Enable the last parameter of the macros change_integer_list, change_string_list to supply a method to initialize update dynamic selectionlists inside the settings GUI allready on showing the gui. (f.e. the audio device list)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r262c049 |
rb96154a |
|
| 170 | 170 | char **ppsz_list_text; /* Friendly names for list values */ |
|---|
| 171 | 171 | int i_list; /* Options list size */ |
|---|
| | 172 | vlc_callback_t pf_update_list; /*callback to initialize dropdownlists */ |
|---|
| 172 | 173 | |
|---|
| 173 | 174 | /* Actions list */ |
|---|
| … | … | |
| 436 | 437 | (size_t)(sizeof (list) / sizeof (char *)), \ |
|---|
| 437 | 438 | (const char *const *)(list), \ |
|---|
| 438 | | (const char *const *)(list_text)) |
|---|
| | 439 | (const char *const *)(list_text), \ |
|---|
| | 440 | list_update_func) |
|---|
| 439 | 441 | |
|---|
| 440 | 442 | #define change_integer_list( list, list_text, list_update_func ) \ |
|---|
| … | … | |
| 442 | 444 | (size_t)(sizeof (list) / sizeof (int)), \ |
|---|
| 443 | 445 | (const int *)(list), \ |
|---|
| 444 | | (const char *const *)(list_text)) |
|---|
| | 446 | (const char *const *)(list_text), \ |
|---|
| | 447 | list_update_func) |
|---|
| 445 | 448 | |
|---|
| 446 | 449 | #define change_float_list( list, list_text, list_update_func ) \ |
|---|
| … | … | |
| 448 | 451 | (size_t)(sizeof (list) / sizeof (float)), \ |
|---|
| 449 | 452 | (const float *)(list), \ |
|---|
| 450 | | (const char *const *)(list_text)) |
|---|
| | 453 | (const char *const *)(list_text), \ |
|---|
| | 454 | list_update_func) |
|---|
| 451 | 455 | |
|---|
| 452 | 456 | #define change_integer_range( minv, maxv ) \ |
|---|
| rcc6e3d0 |
rb96154a |
|
| 36 | 36 | * Current plugin ABI version |
|---|
| 37 | 37 | */ |
|---|
| 38 | | # define MODULE_SYMBOL 0_9_0g |
|---|
| 39 | | # define MODULE_SUFFIX "__0_9_0g" |
|---|
| | 38 | # define MODULE_SYMBOL 0_9_0h |
|---|
| | 39 | # define MODULE_SUFFIX "__0_9_0h" |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | /***************************************************************************** |
|---|
| r9ab3a05 |
rb96154a |
|
| 374 | 374 | combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred ); |
|---|
| 375 | 375 | |
|---|
| 376 | | module_config_t *p_module_config = config_FindConfig( p_this, getName() ); |
|---|
| | 376 | module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); |
|---|
| | 377 | if(p_module_config && p_module_config->pf_update_list) |
|---|
| | 378 | { |
|---|
| | 379 | vlc_value_t val; |
|---|
| | 380 | val.psz_string = strdup(p_module_config->value.psz); |
|---|
| | 381 | |
|---|
| | 382 | p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); |
|---|
| | 383 | |
|---|
| | 384 | // assume in a×y case that dirty was set to VLC_TRUE |
|---|
| | 385 | // because lazy programmes will use the same callback for |
|---|
| | 386 | // this, like the one behind the refresh push button? |
|---|
| | 387 | p_module_config->b_dirty = VLC_FALSE; |
|---|
| | 388 | |
|---|
| | 389 | if(val.psz_string) free(val.psz_string); |
|---|
| | 390 | } |
|---|
| 377 | 391 | |
|---|
| 378 | 392 | finish( p_module_config, bycat ); |
|---|
| … | … | |
| 474 | 488 | if( p_config ) |
|---|
| 475 | 489 | { |
|---|
| | 490 | if(p_config->pf_update_list) |
|---|
| | 491 | { |
|---|
| | 492 | vlc_value_t val; |
|---|
| | 493 | val.i_int = p_config->value.i; |
|---|
| | 494 | p_config->pf_update_list(VLC_OBJECT(p_intf), configname, val, val, NULL); |
|---|
| | 495 | // assume in any case that dirty was set to VLC_TRUE |
|---|
| | 496 | // because lazy programmes will use the same callback for |
|---|
| | 497 | // this, like the one behind the refresh push button? |
|---|
| | 498 | p_config->b_dirty = VLC_FALSE; |
|---|
| | 499 | } |
|---|
| | 500 | |
|---|
| 476 | 501 | for ( int i_index = 0; i_index < p_config->i_list; i_index++ ) |
|---|
| 477 | 502 | { |
|---|
| … | … | |
| 838 | 863 | combo->setMinimumWidth( MINWIDTH_BOX ); |
|---|
| 839 | 864 | |
|---|
| 840 | | module_config_t *p_module_config = config_FindConfig( p_this, getName() ); |
|---|
| | 865 | module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); |
|---|
| | 866 | if(p_module_config && p_module_config->pf_update_list) |
|---|
| | 867 | { |
|---|
| | 868 | vlc_value_t val; |
|---|
| | 869 | val.i_int = p_module_config->value.i; |
|---|
| | 870 | |
|---|
| | 871 | p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); |
|---|
| | 872 | |
|---|
| | 873 | // assume in any case that dirty was set to VLC_TRUE |
|---|
| | 874 | // because lazy programmes will use the same callback for |
|---|
| | 875 | // this, like the one behind the refresh push button? |
|---|
| | 876 | p_module_config->b_dirty = VLC_FALSE; |
|---|
| | 877 | } |
|---|
| | 878 | |
|---|
| 841 | 879 | |
|---|
| 842 | 880 | finish( p_module_config, bycat ); |
|---|
| reb918f1 |
rb96154a |
|
| 564 | 564 | wxDefaultPosition, wxDefaultSize, |
|---|
| 565 | 565 | 0, NULL, wxCB_READONLY ); |
|---|
| 566 | | UpdateCombo( p_item ); |
|---|
| | 566 | |
|---|
| | 567 | // was required to do so - because local p_item is a memcpy of |
|---|
| | 568 | // this one, so it won't see the change done by pf_updat_list |
|---|
| | 569 | module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); |
|---|
| | 570 | if(p_module_config && p_module_config->pf_update_list) |
|---|
| | 571 | { |
|---|
| | 572 | vlc_value_t val; |
|---|
| | 573 | val.psz_string = strdup(p_module_config->value.psz); |
|---|
| | 574 | |
|---|
| | 575 | p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); |
|---|
| | 576 | |
|---|
| | 577 | // assume in a� case that dirty was set to VLC_TRUE |
|---|
| | 578 | // because lazy programmes will use the same callback for |
|---|
| | 579 | // this, like the one behind the refresh push button? |
|---|
| | 580 | p_module_config->b_dirty = VLC_FALSE; |
|---|
| | 581 | |
|---|
| | 582 | if(val.psz_string) free(val.psz_string); |
|---|
| | 583 | } |
|---|
| | 584 | |
|---|
| | 585 | UpdateCombo( p_module_config ); |
|---|
| 567 | 586 | |
|---|
| 568 | 587 | combo->SetToolTip( wxU(p_item->psz_longtext) ); |
|---|
| … | … | |
| 794 | 813 | 0, NULL, wxCB_READONLY ); |
|---|
| 795 | 814 | |
|---|
| 796 | | UpdateCombo( p_item ); |
|---|
| | 815 | module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); |
|---|
| | 816 | if(p_module_config && p_module_config->pf_update_list) |
|---|
| | 817 | { |
|---|
| | 818 | vlc_value_t val; |
|---|
| | 819 | val.i_int = p_module_config->value.i; |
|---|
| | 820 | |
|---|
| | 821 | p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); |
|---|
| | 822 | |
|---|
| | 823 | // assume in any case that dirty was set to VLC_TRUE |
|---|
| | 824 | // because lazy programmes will use the same callback for |
|---|
| | 825 | // this, like the one behind the refresh push button? |
|---|
| | 826 | p_module_config->b_dirty = VLC_FALSE; |
|---|
| | 827 | } |
|---|
| | 828 | |
|---|
| | 829 | UpdateCombo( p_module_config ); |
|---|
| 797 | 830 | |
|---|
| 798 | 831 | combo->SetToolTip( wxU(p_item->psz_longtext) ); |
|---|
| rb803dd3 |
rb96154a |
|
| 369 | 369 | |
|---|
| 370 | 370 | item->i_list = len; |
|---|
| | 371 | item->pf_update_list = va_arg (ap, vlc_callback_t); |
|---|
| 371 | 372 | ret = 0; |
|---|
| 372 | 373 | break; |
|---|