Commit 6a4b7c06 authored by Rocky Bernstein's avatar Rocky Bernstein

Add customizable playlist "author" field and set in the playlist.

parent 511ab83d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cddax.c : CD digital audio input module for vlc using libcdio * cddax.c : CD digital audio input module for vlc using libcdio
***************************************************************************** *****************************************************************************
* Copyright (C) 2000,2003 VideoLAN * Copyright (C) 2000,2003 VideoLAN
* $Id: access.c,v 1.14 2003/12/11 12:56:25 rocky Exp $ * $Id: access.c,v 1.15 2003/12/13 12:56:59 rocky Exp $
* *
* Authors: Rocky Bernstein <rocky@panix.com> * Authors: Rocky Bernstein <rocky@panix.com>
* Laurent Aimar <fenrir@via.ecp.fr> * Laurent Aimar <fenrir@via.ecp.fr>
...@@ -630,6 +630,7 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, ...@@ -630,6 +630,7 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
mtime_t i_duration = mtime_t i_duration =
(p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1]) (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1])
/ CDIO_CD_FRAMES_PER_SEC; / CDIO_CD_FRAMES_PER_SEC;
char *p_author;
char *p_title; char *p_title;
char *config_varname = MODULE_STRING "-title-format"; char *config_varname = MODULE_STRING "-title-format";
...@@ -648,8 +649,22 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda, ...@@ -648,8 +649,22 @@ CDDACreatePlayListItem(const input_thread_t *p_input, cdda_data_t *p_cdda,
dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d", dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d",
psz_mrl, p_title, (long int) i_duration, i_pos ); psz_mrl, p_title, (long int) i_duration, i_pos );
playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000, playlist_AddExt( p_playlist, psz_mrl, p_title, i_duration * 1000000,
0, 0, playlist_operation, i_pos ); 0, 0, playlist_operation, i_pos );
p_author =
CDDAFormatStr( p_input, p_cdda,
config_GetPsz( p_input, MODULE_STRING "-author-format" ),
psz_mrl, i_track );
/* FIXME: This is horrible, but until the playlist interface is fixed up
something like this has to be done for the "Author" field.
*/
if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1;
free(p_playlist->pp_items[i_pos]->psz_author);
p_playlist->pp_items[i_pos]->psz_author = strdup(p_author);
} }
static int static int
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cddax.c : CD digital audio input module for vlc using libcdio * cddax.c : CD digital audio input module for vlc using libcdio
***************************************************************************** *****************************************************************************
* Copyright (C) 2000,2003 VideoLAN * Copyright (C) 2000,2003 VideoLAN
* $Id: cdda.c,v 1.12 2003/12/11 13:20:20 rocky Exp $ * $Id: cdda.c,v 1.13 2003/12/13 12:56:59 rocky Exp $
* *
* Authors: Rocky Bernstein <rocky@panix.com> * Authors: Rocky Bernstein <rocky@panix.com>
* Laurent Aimar <fenrir@via.ecp.fr> * Laurent Aimar <fenrir@via.ecp.fr>
...@@ -125,6 +125,11 @@ vlc_module_begin(); ...@@ -125,6 +125,11 @@ vlc_module_begin();
N_("Caching value in ms"), N_("Caching value in ms"),
CACHING_LONGTEXT, VLC_TRUE ); CACHING_LONGTEXT, VLC_TRUE );
add_string( MODULE_STRING "-author-format",
"%A - %a %C %I", NULL,
N_("Format to use in playlist 'author' field"),
TITLE_FMT_LONGTEXT, VLC_TRUE );
add_string( MODULE_STRING "-title-format", add_string( MODULE_STRING "-title-format",
"%T %M", NULL, "%T %M", NULL,
N_("Format to use in playlist 'title' field when no CDDB"), N_("Format to use in playlist 'title' field when no CDDB"),
......
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