Added IOException to WaveformData constructor

Change-Id: Ic00b582beaa2701ffa72e99194693fd7cfa45a6d
This commit is contained in:
Gil Dobjanschi
2010-11-18 14:10:32 -08:00
parent 691da62bfe
commit b1fcb2abd3
4 changed files with 11 additions and 3 deletions

View File

@@ -450,7 +450,7 @@ public class AudioTrack {
/**
* @return The waveform data
*/
public WaveformData getWaveformData() {
public WaveformData getWaveformData() throws IOException {
if (mWaveformData == null) {
return null;
}

View File

@@ -372,7 +372,7 @@ public class MediaVideoItem extends MediaItem {
/**
* @return The waveform data
*/
public WaveformData getWaveformData() {
public WaveformData getWaveformData() throws IOException {
if (mWaveformData == null) {
return null;
}

View File

@@ -16,6 +16,9 @@
package android.media.videoeditor;
import java.io.File;
/**
* This class allows to render an "alpha blending" transition according to a
@@ -71,6 +74,7 @@ public class TransitionAlpha extends Transition {
* projects folder (the parent folder for all projects).
* @param blendingPercent The blending percent applied
* @param invert true to invert the direction of the alpha blending
*
* @throws IllegalArgumentException if behavior is not supported, or if
* direction are not supported.
*/
@@ -79,6 +83,10 @@ public class TransitionAlpha extends Transition {
int blendingPercent, boolean invert) {
super(transitionId, afterMediaItem, beforeMediaItem, durationMs, behavior);
if (!new File(maskFilename).exists()) {
throw new IllegalArgumentException("Invalid mask file name: " + maskFilename);
}
mMaskFilename = maskFilename;
mBlendingPercent = blendingPercent;
mIsInvert = invert;

View File

@@ -46,7 +46,7 @@ public class WaveformData {
*
* @param audioWaveformFilename The name of the audio waveform file
*/
WaveformData(String audioWaveformFilename) {
WaveformData(String audioWaveformFilename) throws IOException {
// TODO: Read these values from the file
mFrameDurationMs = 20;
mFramesCount = 300000 / mFrameDurationMs;