/** * Obtain the theorical filename of a song, i mean, the location that sould be, based on the track number and song * name (the location is the filename for songs) * * @param song {@link MDOSong} song to get the theorical file name * @param extension {@link String} extension for the fileName * @return {@link String} the theorical location */ public final String calculateSongTheoricalFileName( String extension, char illegalCharacterReplacement ) { String result = Util.leftZeroPadding( getTrack(), 2 ) + "-" + getName(); result = Util.replaceIllegalFilenameCharactersNew( result, illegalCharacterReplacement ); String resultExtension = Util.replaceIllegalFilenameCharactersNew( extension, illegalCharacterReplacement ); result = result + "." + resultExtension; return result; }
r.setName( song.getName() ); resources.add( r );
boolean nameChanged = !song.getName().equals( mdosong.getName() );
ssong.name = mdoSong.getName();
/** * copy constructor * * @param mdosong {@link MDOSong} * @param album {@link Album} this is not an {@link MDOAlbum} to avoid cross references */ public Song( MDOSong mdosong, Album album ) { setSid( mdosong.getSid() ); setTrack( mdosong.getTrack() ); setName( mdosong.getName() ); setAlbum( album ); setFileName( mdosong.getLocation() ); setRate( mdosong.getRate() ); setVolume( mdosong.getVolume() ); }
ai.setId( song.getOwner().getSid() + MessicContainer.SEPARATOR + song.getAlbum().getAuthor().getSid() + MessicContainer.SEPARATOR + song.getAlbum().getSid() + MessicContainer.SEPARATOR + song.getSid() ); ai.setTitle( song.getName() ); ai.setOriginalTrackNumber( song.getTrack() );
public void playSong( String username, long sidSong, int clientQueuePosition ) throws IOException { MDOSong song = daoSong.get( username, sidSong ); if ( song != null ) { MessicRadioPlugin mrp = getPlugin(); File mp3song = new File( song.calculateAbsolutePath( daoSettings.getSettings() ) ); if ( mp3song.exists() ) { MessicRadioSong mrs = new MessicRadioSong(); mrs.songFile = mp3song; mrs.authorName = song.getAlbum().getAuthor().getName(); mrs.albumName = song.getAlbum().getName(); mrs.albumyear = song.getAlbum().getYear(); MDOAlbumResource mar = song.getAlbum().getCover(); if ( mar != null ) { mrs.coverImage = new File( mar.calculateAbsolutePath( daoSettings.getSettings() ) ); } mrs.songSid = song.getSid(); mrs.songName = song.getName(); mrs.trackNumber = song.getTrack(); mrs.albumGenre = ( song.getAlbum().getGenre() != null ? song.getAlbum().getGenre().getName() : "" ); mrs.albumComments = song.getAlbum().getComments(); mrs.clientQueuePosition = clientQueuePosition; mrp.castSong( mrs ); } } }
/** * copy constructor * * @param mdosong {@link MDOSong} */ public Song( MDOSong mdosong, boolean includeAlbumInfo, boolean includeAuthorInfo ) { if ( mdosong != null ) { setSid( mdosong.getSid() ); setTrack( mdosong.getTrack() ); setName( mdosong.getName() ); setVolume( mdosong.getVolume() ); if ( includeAlbumInfo ) { Album album = new Album( mdosong.getAlbum(), includeAuthorInfo, false, false ); setAlbum( album ); } setFileName( mdosong.getLocation() ); setRate( mdosong.getRate() ); } }