return true;
}
@Override
public DcObject parse(String filename, int directoryUsage) {
DcObject movie = DcModules.get(DcModules._MOVIE).getItem();
movie.setValue(Movie._SYS_FILENAME, filename);
movie.setValue(Movie._A_TITLE, getName(filename, directoryUsage));
try {
Hash.getInstance().calculateHash(movie);
FilePropertiesMovie fpm = new FilePropertiesMovie(filename);
Long playlength = Long.valueOf(fpm.getDuration());
if (playlength.intValue() <= 0 && fpm.getVideoWidth() <= 0)
return movie;
if (directoryUsage != 1 && fpm.getName() != null && fpm.getName().trim().length() > 0)
movie.setValue(Movie._A_TITLE, fpm.getName());
DataManager.createReference(movie, Movie._D_LANGUAGE, fpm.getLanguage());
long frames = (long) (fpm.getDuration() * fpm.getVideoRate());
movie.setValue(Movie._L_PLAYLENGTH, playlength);
movie.setValue(Movie._N_VIDEOCODEC, fpm.getVideoCodec());
movie.setValue(Movie._O_AUDIOCODEC, fpm.getAudioCodec());
movie.setValue(Movie._P_WIDTH, fpm.getVideoWidth() <= 0 ? null : Long.valueOf(fpm.getVideoWidth()));
movie.setValue(Movie._Q_HEIGHT, fpm.getVideoHeight() <= 0 ? null : Long.valueOf(fpm.getVideoHeight()));
movie.setValue(Movie._R_FPS, fpm.getVideoRate() <= 0 ? null : Double.valueOf(fpm.getVideoRate()));
movie.setValue(Movie._S_FRAMES, frames <= 0 ? null : frames);
movie.setValue(Movie._T_AUDIOBITRATE, fpm.getAudioBitRate() <= 0 ? null : Long.valueOf(fpm.getAudioBitRate()));
movie.setValue(Movie._U_AUDIOSAMPLINGRATE, fpm.getAudioRate() <= 0 ? null : Long.valueOf(fpm.getAudioRate()));
movie.setValue(Movie._V_AUDIOCHANNEL, fpm.getAudioChannels() <= 0 ? null : Long.valueOf(fpm.getAudioChannels()));
DataManager.createReference(movie, Movie._2_SUBTITLELANGUAGE, fpm.getSubtitles());
setImages(filename, movie, Movie._X_PICTUREFRONT, Movie._Y_PICTUREBACK, Movie._Z_PICTURECD);
int bitrate = fpm.getVideoBitRate();
if (bitrate <= 0) {
MovieFile mf = new MovieFile(filename);
bitrate = (int) mf.getVideoBitrate();
}
movie.setValue(Movie._W_VIDEOBITRATE, bitrate <= 0 ? null : Long.valueOf(bitrate));
} catch (Exception exp) {
getClient().addMessage(DcResources.getText("msgCouldNotReadInfoFrom", filename));
}