vlc_linux/vlc-3.0.16/modules/meta_engine/taglib.cpp
/**
 * Write the meta information to XiphComments
 * @param tag: the Xiph Comment
 * @param p_input: the input item
 */
Write the meta information to XiphComments
@param tag: the Xiph Comment
@param p_input: the input item
Write the meta information to XiphComments @param tag : the Xiph Comment @param p_input : the input item
static void WriteMetaToXiph( Ogg::XiphComment* tag, input_item_t* p_item )
{
    char* psz_meta;
#define WRITE( metaName, keyName )                      \
    psz_meta = input_item_Get##metaName( p_item );      \
    if( psz_meta )                                      \
    {                                                   \
        String key( keyName, String::UTF8 );            \
        String value( psz_meta, String::UTF8 );         \
        tag->addField( key, value, true );              \
    }                                                   \
    free( psz_meta );
    WRITE( TrackNum, "TRACKNUMBER" );
    WRITE( TrackTotal, "TRACKTOTAL" );
    WRITE( Copyright, "COPYRIGHT" );
    WRITE( Publisher, "ORGANIZATION" );
    WRITE( Date, "DATE" );
    WRITE( EncodedBy, "ENCODER" );
    WRITE( Rating, "RATING" );
    WRITE( Language, "LANGUAGE" );
    WRITE( TrackID, "MUSICBRAINZ_TRACKID" );
#undef WRITE
}
static void WriteMetaToXiph ( Ogg :: XiphComment * tag , input_item_t * p_item ) { char * psz_meta ; #define WRITE ( metaName , keyName )                       \
    psz_meta = input_item_Get##metaName( p_item );      \
    if( psz_meta )                                      \
    {                                                   \
        String key( keyName, String::UTF8 );            \
        String value( psz_meta, String::UTF8 );         \
        tag->addField( key, value, true );              \
    }                                                   \
    free( psz_meta ); WRITE ( TrackNum , " " ) ; WRITE ( TrackTotal , " " ) ; WRITE ( Copyright , " " ) ; WRITE ( Publisher , " " ) ; WRITE ( Date , " " ) ; WRITE ( EncodedBy , " " ) ; WRITE ( Rating , " " ) ; WRITE ( Language , " " ) ; WRITE ( TrackID , " " ) ; #undef  WRITE }
Write the meta information to XiphComments
 @param tag: the Xiph Comment
 @param p_input: the input item
Write the meta information to XiphComments @param tag : the Xiph Comment @param p_input : the input item