private void parseMetadataItem ( Message item ) { switch ( item . getMenuItemType ( ) ) { case TRACK_TITLE : title = ( ( StringField ) item . arguments . get ( 3 ) ) . getValue ( ) ; artworkId = ( int ) ( ( NumberField ) item . arguments . get ( 8 ) ) . getValue ( ) ; break ; case ARTIST : artist = buildSearchableItem ( item ) ; break ; case ORIGINAL_ARTIST : originalArtist = buildSearchableItem ( item ) ; break ; case REMIXER : remixer = buildSearchableItem ( item ) ; case ALBUM_TITLE : album = buildSearchableItem ( item ) ; break ; case LABEL : label = buildSearchableItem ( item ) ; break ; case DURATION : duration = ( int ) ( ( NumberField ) item . arguments . get ( 1 ) ) . getValue ( ) ; break ; case TEMPO : tempo = ( int ) ( ( NumberField ) item . arguments . get ( 1 ) ) . getValue ( ) ; break ; case COMMENT : comment = ( ( StringField ) item . arguments . get ( 3 ) ) . getValue ( ) ; break ; case KEY : key = buildSearchableItem ( item ) ; break ; case RATING : rating = ( int ) ( ( NumberField ) item . arguments . get ( 1 ) ) . getValue ( ) ; break ; case COLOR_NONE : case COLOR_AQUA : case COLOR_BLUE : case COLOR_GREEN : case COLOR_ORANGE : case COLOR_PINK : case COLOR_PURPLE : case COLOR_RED : case COLOR_YELLOW : color = buildColorItem ( item ) ; break ; case GENRE : genre = buildSearchableItem ( item ) ; break ; case DATE_ADDED : dateAdded = ( ( StringField ) item . arguments . get ( 3 ) ) . getValue ( ) ; break ; case YEAR : year = ( int ) ( ( NumberField ) item . arguments . get ( 1 ) ) . getValue ( ) ; break ; case BIT_RATE : bitRate = ( int ) ( ( NumberField ) item . arguments . get ( 1 ) ) . getValue ( ) ; break ; default : logger . warn ( "Ignoring track metadata item with unknown type: {}" , item ) ; } }
Processes one of the menu responses that jointly constitute the track metadata updating our fields accordingly .