Changeset a3576a2716c6ea17349b9dbeea4757d2198b40e6
- Timestamp:
- 12/12/07 20:29:02
(9 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1197487742 +0000
- git-parent:
[9cda1945bc9239beea6bb644498058564520302a]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1197487742 +0000
- Message:
- Remove config_FindModule as module_Find nowadays does the same thing
- Use module_Exists as appropriate
- Rename module_FindName as module_Find
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4ff5e96 |
ra3576a2 |
|
| 211 | 211 | |
|---|
| 212 | 212 | VLC_EXPORT( module_config_t *, config_FindConfig,( vlc_object_t *, const char * ) ); |
|---|
| 213 | | VLC_EXPORT( module_t *, config_FindModule,( vlc_object_t *, const char * ) ); |
|---|
| 214 | 213 | |
|---|
| 215 | 214 | VLC_EXPORT( int, config_Duplicate,( module_t *, const module_config_t *, size_t )); |
|---|
| r6181746 |
ra3576a2 |
|
| 36 | 36 | VLC_EXPORT( vlc_bool_t, __module_Exists, ( vlc_object_t *, const char * ) ); |
|---|
| 37 | 37 | |
|---|
| 38 | | /* Use only if you know what you're doing... */ |
|---|
| 39 | | #define module_FindName(a,b) __module_FindName(VLC_OBJECT(a),b) |
|---|
| 40 | | VLC_EXPORT( module_t *, __module_FindName, ( vlc_object_t *, const char * ) ); |
|---|
| | 38 | #define module_Find(a,b) __module_Find(VLC_OBJECT(a),b) |
|---|
| | 39 | VLC_EXPORT( module_t *, __module_Find, ( vlc_object_t *, const char * ) ); |
|---|
| 41 | 40 | VLC_EXPORT( void, module_Put, ( module_t *module ) ); |
|---|
| 42 | 41 | |
|---|
| r2067ae4 |
ra3576a2 |
|
| 140 | 140 | /* HACK: Don't use this codec if we don't have an mpga audio filter */ |
|---|
| 141 | 141 | if( p_dec->i_object_type == VLC_OBJECT_DECODER && |
|---|
| 142 | | !config_FindModule( p_this, "mpgatofixed32" ) ) |
|---|
| | 142 | !module_Exists( p_this, "mpgatofixed32" ) ) |
|---|
| 143 | 143 | { |
|---|
| 144 | 144 | return VLC_EGENERIC; |
|---|
| r9cda194 |
ra3576a2 |
|
| 337 | 337 | return; |
|---|
| 338 | 338 | else if( data->i_type == TYPE_MODULE ) |
|---|
| 339 | | p_module = module_FindName( VLC_OBJECT(p_intf), data->psz_name ); |
|---|
| | 339 | p_module = module_Find( VLC_OBJECT(p_intf), data->psz_name ); |
|---|
| 340 | 340 | else |
|---|
| 341 | 341 | { |
|---|
| 342 | | p_module = module_FindName( VLC_OBJECT(p_intf), "main" ); |
|---|
| | 342 | p_module = module_Find( VLC_OBJECT(p_intf), "main" ); |
|---|
| 343 | 343 | assert( p_module ); |
|---|
| 344 | 344 | } |
|---|
| r37af31a |
ra3576a2 |
|
| 213 | 213 | /* Please leave p_libvlc_global. This is where cached modules are |
|---|
| 214 | 214 | * stored. We're not trying to find a module instance. */ |
|---|
| 215 | | module_t *p_obj = module_FindName( p_intf, psz_name ); |
|---|
| | 215 | module_t *p_obj = module_Find( p_intf, psz_name ); |
|---|
| 216 | 216 | if( !p_obj ) |
|---|
| 217 | 217 | { |
|---|
| r6181746 |
ra3576a2 |
|
| 1032 | 1032 | table->setAlternatingRowColors( true ); |
|---|
| 1033 | 1033 | |
|---|
| 1034 | | module_t *p_main = config_FindModule( p_this, "main" ); |
|---|
| | 1034 | module_t *p_main = module_Find( p_this, "main" ); |
|---|
| 1035 | 1035 | assert( p_main ); |
|---|
| 1036 | 1036 | |
|---|
| … | … | |
| 1057 | 1057 | } |
|---|
| 1058 | 1058 | module_PutConfig (p_config); |
|---|
| | 1059 | module_Put (p_module); |
|---|
| 1059 | 1060 | |
|---|
| 1060 | 1061 | table->resizeColumnToContents( 0 ); |
|---|
| rd79eca2 |
ra3576a2 |
|
| 85 | 85 | if( var_Type( p_aout, "visual" ) == 0 ) |
|---|
| 86 | 86 | { |
|---|
| 87 | | module_t *p_module; |
|---|
| 88 | 87 | var_Create( p_aout, "visual", VLC_VAR_STRING | VLC_VAR_HASCHOICE ); |
|---|
| 89 | 88 | text.psz_string = _("Visualizations"); |
|---|
| … | … | |
| 99 | 98 | |
|---|
| 100 | 99 | /* Look for goom plugin */ |
|---|
| 101 | | p_module = config_FindModule( VLC_OBJECT(p_aout), "goom" ); |
|---|
| 102 | | if( p_module ) |
|---|
| | 100 | if( module_Exists( VLC_OBJECT(p_aout), "goom" ) ) |
|---|
| 103 | 101 | { |
|---|
| 104 | 102 | val.psz_string = "goom"; text.psz_string = "Goom"; |
|---|
| … | … | |
| 107 | 105 | |
|---|
| 108 | 106 | /* Look for galaktos plugin */ |
|---|
| 109 | | p_module = config_FindModule( VLC_OBJECT(p_aout), "galaktos" ); |
|---|
| 110 | | if( p_module ) |
|---|
| | 107 | if( module_Exists( VLC_OBJECT(p_aout), "galaktos" ) ) |
|---|
| 111 | 108 | { |
|---|
| 112 | 109 | val.psz_string = "galaktos"; text.psz_string = "GaLaktos"; |
|---|
| r2d9c9ee |
ra3576a2 |
|
| 482 | 482 | |
|---|
| 483 | 483 | return NULL; |
|---|
| 484 | | } |
|---|
| 485 | | |
|---|
| 486 | | /***************************************************************************** |
|---|
| 487 | | * config_FindModule: find a specific module structure. |
|---|
| 488 | | *****************************************************************************/ |
|---|
| 489 | | module_t *config_FindModule( vlc_object_t *p_this, const char *psz_name ) |
|---|
| 490 | | { |
|---|
| 491 | | vlc_list_t *p_list; |
|---|
| 492 | | module_t *p_module, *p_result = NULL; |
|---|
| 493 | | int i_index; |
|---|
| 494 | | |
|---|
| 495 | | if( !psz_name ) return NULL; |
|---|
| 496 | | |
|---|
| 497 | | p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE ); |
|---|
| 498 | | |
|---|
| 499 | | for( i_index = 0; i_index < p_list->i_count; i_index++ ) |
|---|
| 500 | | { |
|---|
| 501 | | p_module = (module_t *)p_list->p_values[i_index].p_object; |
|---|
| 502 | | if( !strcmp( p_module->psz_object_name, psz_name ) ) |
|---|
| 503 | | { |
|---|
| 504 | | p_result = p_module; |
|---|
| 505 | | break; |
|---|
| 506 | | } |
|---|
| 507 | | } |
|---|
| 508 | | |
|---|
| 509 | | vlc_list_release( p_list ); |
|---|
| 510 | | |
|---|
| 511 | | return p_result; |
|---|
| 512 | 484 | } |
|---|
| 513 | 485 | |
|---|
| r1b87440 |
ra3576a2 |
|
| 49 | 49 | config_Duplicate |
|---|
| 50 | 50 | config_FindConfig |
|---|
| 51 | | config_FindModule |
|---|
| 52 | 51 | config_GetDataDir |
|---|
| 53 | 52 | __config_GetFloat |
|---|
| … | … | |
| 146 | 145 | mdate |
|---|
| 147 | 146 | __module_Exists |
|---|
| 148 | | __module_FindName |
|---|
| | 147 | __module_Find |
|---|
| 149 | 148 | module_GetConfig |
|---|
| 150 | 149 | module_GetHelp |
|---|
| r1b87440 |
ra3576a2 |
|
| 687 | 687 | |
|---|
| 688 | 688 | /***************************************************************************** |
|---|
| 689 | | * module_FindName: get a pointer to a module_t given it's name. |
|---|
| 690 | | *****************************************************************************/ |
|---|
| 691 | | module_t *__module_FindName( vlc_object_t *p_this, const char * psz_name ) |
|---|
| | 689 | * module_Find: get a pointer to a module_t given it's name. |
|---|
| | 690 | *****************************************************************************/ |
|---|
| | 691 | module_t *__module_Find( vlc_object_t *p_this, const char * psz_name ) |
|---|
| 692 | 692 | { |
|---|
| 693 | 693 | vlc_list_t *p_list; |
|---|
| … | … | |
| 712 | 712 | |
|---|
| 713 | 713 | /***************************************************************************** |
|---|
| 714 | | * module_Put: release a module_t pointer from module_FindName(). |
|---|
| | 714 | * module_Put: release a module_t pointer from module_Find(). |
|---|
| 715 | 715 | *****************************************************************************/ |
|---|
| 716 | 716 | void module_Put ( module_t *module ) |
|---|
| … | … | |
| 727 | 727 | vlc_bool_t __module_Exists( vlc_object_t *p_this, const char * psz_name ) |
|---|
| 728 | 728 | { |
|---|
| 729 | | module_t *p_module = __module_FindName( p_this, psz_name ); |
|---|
| | 729 | module_t *p_module = __module_Find( p_this, psz_name ); |
|---|
| 730 | 730 | if( p_module ) |
|---|
| 731 | 731 | { |
|---|