Commit 3a9b48da authored by Clément Stenac's avatar Clément Stenac

CDDAX:

    - coding style fixes
    - adapted to new playlist API
    - only put generic things in Meta-information

wxWidgets:
    - Fixed playlist updating

core:
    - added playlist_ItemGetByInput
    - implemented input_item_t.b_fixed name : if this is set, the interface should not try to "improve" the display string.
parent 180ca722
...@@ -62,6 +62,8 @@ struct input_item_t ...@@ -62,6 +62,8 @@ struct input_item_t
int i_es; /**< Number of es format descriptions */ int i_es; /**< Number of es format descriptions */
es_format_t **es; /**< Pointer to an array of es formats */ es_format_t **es; /**< Pointer to an array of es formats */
vlc_bool_t b_fixed_name; /**< Can the interface change the name ?*/
vlc_mutex_t lock; /**< Item cannot be changed without this lock */ vlc_mutex_t lock; /**< Item cannot be changed without this lock */
}; };
...@@ -85,6 +87,7 @@ static inline void vlc_input_item_Init( vlc_object_t *p_o, input_item_t *p_i ) ...@@ -85,6 +87,7 @@ static inline void vlc_input_item_Init( vlc_object_t *p_o, input_item_t *p_i )
p_i->pp_categories = 0; p_i->pp_categories = 0;
p_i->es = 0; p_i->es = 0;
p_i->i_type = ITEM_TYPE_UNKNOWN; p_i->i_type = ITEM_TYPE_UNKNOWN;
p_i->b_fixed_name = VLC_TRUE;
vlc_mutex_init( p_o, &p_i->lock ); vlc_mutex_init( p_o, &p_i->lock );
} }
......
This diff is collapsed.
...@@ -26,20 +26,21 @@ ...@@ -26,20 +26,21 @@
int int
E_(CDDADebugCB) ( vlc_object_t *p_this, const char *psz_name, E_(CDDADebugCB) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, void *p_data ) vlc_value_t oldval, vlc_value_t val, void *p_data )
{ {
cdda_data_t *p_cdda; cdda_data_t *p_cdda;
if (NULL == p_cdda_input) return VLC_EGENERIC; if (NULL == p_cdda_input) return VLC_EGENERIC;
p_cdda = (cdda_data_t *)p_cdda_input->p_sys; p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d", {
p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int); msg_Dbg( p_cdda_input, "Old debug (x%0x) %d, new debug (x%0x) %d",
} p_cdda->i_debug, p_cdda->i_debug, val.i_int, val.i_int);
p_cdda->i_debug = val.i_int; }
return VLC_SUCCESS; p_cdda->i_debug = val.i_int;
return VLC_SUCCESS;
} }
/* FIXME: could probably shorten some of the below boilerplate code... /* FIXME: could probably shorten some of the below boilerplate code...
...@@ -48,86 +49,90 @@ int ...@@ -48,86 +49,90 @@ int
E_(CDDBEnabledCB) ( vlc_object_t *p_this, const char *psz_name, E_(CDDBEnabledCB) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, void *p_data ) vlc_value_t oldval, vlc_value_t val, void *p_data )
{ {
cdda_data_t *p_cdda; cdda_data_t *p_cdda;
if (NULL == p_cdda_input) return VLC_EGENERIC; if (NULL == p_cdda_input) return VLC_EGENERIC;
p_cdda = (cdda_data_t *)p_cdda_input->p_sys; p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d", {
p_cdda->b_cddb_enabled, p_cdda->b_cddb_enabled, msg_Dbg( p_cdda_input, "Old CDDB Enabled (x%0x) %d, new (x%0x) %d",
val.b_bool, val.b_bool); p_cdda->b_cddb_enabled, p_cdda->b_cddb_enabled,
} val.b_bool, val.b_bool);
p_cdda->b_cddb_enabled = val.b_bool; }
p_cdda->b_cddb_enabled = val.b_bool;
#endif #endif
return VLC_SUCCESS; return VLC_SUCCESS;
} }
int int
E_(CDTextEnabledCB) ( vlc_object_t *p_this, const char *psz_name, E_(CDTextEnabledCB) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, void *p_data ) vlc_value_t oldval, vlc_value_t val, void *p_data )
{ {
cdda_data_t *p_cdda; cdda_data_t *p_cdda;
if (NULL == p_cdda_input) return VLC_EGENERIC; if (NULL == p_cdda_input) return VLC_EGENERIC;
p_cdda = (cdda_data_t *)p_cdda_input->p_sys; p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
msg_Dbg( p_cdda_input, "Old CDText Enabled (x%0x) %d, new (x%0x) %d", {
p_cdda->b_cdtext_enabled, p_cdda->b_cdtext_enabled, msg_Dbg( p_cdda_input, "Old CDText Enabled (x%0x) %d, new (x%0x) %d",
val.b_bool, val.b_bool); p_cdda->b_cdtext_enabled, p_cdda->b_cdtext_enabled,
} val.b_bool, val.b_bool);
p_cdda->b_cdtext_enabled = val.b_bool; }
return VLC_SUCCESS; p_cdda->b_cdtext_enabled = val.b_bool;
return VLC_SUCCESS;
} }
int int
E_(CDTextPreferCB) ( vlc_object_t *p_this, const char *psz_name, E_(CDTextPreferCB) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, void *p_data ) vlc_value_t oldval, vlc_value_t val, void *p_data )
{ {
cdda_data_t *p_cdda; cdda_data_t *p_cdda;
if (NULL == p_cdda_input) return VLC_EGENERIC; if (NULL == p_cdda_input) return VLC_EGENERIC;
p_cdda = (cdda_data_t *)p_cdda_input->p_sys; p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
#ifdef HAVE_LIBCDDB #ifdef HAVE_LIBCDDB
if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { if ( p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
msg_Dbg( p_cdda_input, "Old CDText Prefer (x%0x) %d, new (x%0x) %d", {
p_cdda->b_cdtext_prefer, p_cdda->b_cdtext_prefer, msg_Dbg( p_cdda_input, "Old CDText Prefer (x%0x) %d, new (x%0x) %d",
val.b_bool, val.b_bool); p_cdda->b_cdtext_prefer, p_cdda->b_cdtext_prefer,
} val.b_bool, val.b_bool);
p_cdda->b_cdtext_prefer = val.b_bool; }
p_cdda->b_cdtext_prefer = val.b_bool;
#endif #endif
return VLC_SUCCESS; return VLC_SUCCESS;
} }
int int
E_(CDDABlocksPerReadCB) ( vlc_object_t *p_this, const char *psz_name, E_(CDDABlocksPerReadCB) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, void *p_data ) vlc_value_t oldval, vlc_value_t val, void *p_data )
{ {
cdda_data_t *p_cdda; cdda_data_t *p_cdda;
if (NULL == p_cdda_input) return VLC_EGENERIC; if (NULL == p_cdda_input) return VLC_EGENERIC;
p_cdda = (cdda_data_t *)p_cdda_input->p_sys; p_cdda = (cdda_data_t *)p_cdda_input->p_sys;
if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT)) { if (p_cdda->i_debug & (INPUT_DBG_CALL|INPUT_DBG_EXT))
msg_Dbg( p_cdda_input, "Old blocks per read: %d, new %d", {
p_cdda->i_blocks_per_read, val.i_int); msg_Dbg( p_cdda_input, "Old blocks per read: %d, new %d",
} p_cdda->i_blocks_per_read, val.i_int);
}
if (0 == val.i_int) val.i_int = DEFAULT_BLOCKS_PER_READ;
if ( val.i_int >= MIN_BLOCKS_PER_READ && val.i_int <= MAX_BLOCKS_PER_READ ) if (0 == val.i_int) val.i_int = DEFAULT_BLOCKS_PER_READ;
p_cdda->i_blocks_per_read = val.i_int; if ( val.i_int >= MIN_BLOCKS_PER_READ && val.i_int <= MAX_BLOCKS_PER_READ )
else { p_cdda->i_blocks_per_read = val.i_int;
msg_Warn( p_cdda_input, else
"Number of blocks (%d) has to be between %d and %d. No change.", {
val.i_int, MIN_BLOCKS_PER_READ, MAX_BLOCKS_PER_READ ); msg_Warn( p_cdda_input,
} "Number of blocks (%d) has to be between %d and %d. No change.",
val.i_int, MIN_BLOCKS_PER_READ, MAX_BLOCKS_PER_READ );
return VLC_SUCCESS; }
return VLC_SUCCESS;
} }
This diff is collapsed.
...@@ -23,27 +23,25 @@ ...@@ -23,27 +23,25 @@
/* /*
Fills out playlist information. Fills out playlist information.
*/ */
int CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda, int CDDAFixupPlaylist( access_t *p_access, cdda_data_t *p_cdda,
const char *psz_source, const char *psz_source,
vlc_bool_t b_single_track ); vlc_bool_t b_single_track );
/* /*
Gets and saves CDDA Meta Information. In the Control routine, Gets and saves CDDA Meta Information. In the Control routine,
we handle Meta Information requests and basically copy what we've we handle Meta Information requests and basically copy what we've
saved here. saved here.
*/ */
void CDDAMetaInfo( access_t *p_access ); void CDDAMetaInfo( access_t *p_access, int );
/* /*
Creates a playlist item filling the meta information about that playlist Creates a playlist item filling the meta information about that playlist
item. item.
*/ */
void CDDACreatePlaylistItem(const access_t *p_access, playlist_item_t *
cdda_data_t *p_cdda, CDDACreatePlaylistItem( const access_t *p_access, cdda_data_t *p_cdda,
playlist_t *p_playlist, playlist_t *p_playlist, playlist_item_t *p_item,
track_t i_track, track_t i_track, char *psz_mrl, int psz_mrl_max,
char *psz_mrl, int psz_mrl_max, const char *psz_source );
const char *psz_source,
int playlist_operation,
int i_pos);
...@@ -1560,7 +1560,8 @@ static int UpdateMeta( input_thread_t *p_input ) ...@@ -1560,7 +1560,8 @@ static int UpdateMeta( input_thread_t *p_input )
msg_Dbg( p_input, " - '%s' = '%s'", msg_Dbg( p_input, " - '%s' = '%s'",
_(p_meta->name[i]), p_meta->value[i] ); _(p_meta->name[i]), p_meta->value[i] );
if( !strcmp(p_meta->name[i], VLC_META_TITLE) && p_meta->value[i] ) if( !strcmp(p_meta->name[i], VLC_META_TITLE) && p_meta->value[i] &&
!p_input->input.p_item->b_fixed_name )
input_Control( p_input, INPUT_SET_NAME, p_meta->value[i] ); input_Control( p_input, INPUT_SET_NAME, p_meta->value[i] );
if( !strcmp( p_meta->name[i], VLC_META_AUTHOR ) ) if( !strcmp( p_meta->name[i], VLC_META_AUTHOR ) )
......
...@@ -436,6 +436,11 @@ playlist_item_t * playlist_ItemGetByInput( playlist_t * p_playlist , ...@@ -436,6 +436,11 @@ playlist_item_t * playlist_ItemGetByInput( playlist_t * p_playlist ,
input_item_t *p_item ) input_item_t *p_item )
{ {
int i; int i;
if( &p_playlist->status.p_item->input == p_item )
{
return p_playlist->status.p_item;
}
for( i = 0 ; i < p_playlist->i_size ; i++ ) for( i = 0 ; i < p_playlist->i_size ; i++ )
{ {
if( &p_playlist->pp_items[i]->input == p_item ) if( &p_playlist->pp_items[i]->input == p_item )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment