001: /*
002: * Apollo - Motion capture and animation system
003: * Copyright (c) 2005 Apollo
004: *
005: * This program is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU General Public License
007: * as published by the Free Software Foundation; either version 2
008: * of the License, or (at your option) any later version.
009: *
010: * This program is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013: * GNU General Public License for more details.
014: *
015: * You should have received a copy of the GNU General Public License
016: * along with this program; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
018: *
019: * http://www.gnu.org/copyleft/gpl.html
020: *
021: * @author Giovane.Kuhn - brain@netuno.com.br
022: *
023: */
024: package org.apollo.datamodel;
025:
026: import java.awt.Dimension;
027: import java.io.File;
028: import java.io.IOException;
029: import java.io.Serializable;
030:
031: import org.apollo.ApolloUtil;
032:
033: /**
034: * Class represents a video that can be analyzed.
035: * @author Giovane.Kuhn on 03/05/2005
036: */
037: public final class Video implements Serializable {
038:
039: private static final long serialVersionUID = 1L;
040:
041: /** Video file name */
042: private String relativeVideoFile;
043:
044: /** Video size */
045: private Dimension size;
046:
047: /** Video frameRate (frames per second) */
048: private float frameRate;
049:
050: /** Video where the collection of effects was applied */
051: private EffectingVideo effectingVideo;
052:
053: /** Tracking info for this video */
054: private TrackingVideo trackingVideo;
055:
056: /** Video that containts animation */
057: private MotionVideo motionVideo;
058:
059: /** Project that's owner */
060: private Project project;
061:
062: public MotionVideo getMotionVideo() {
063: return motionVideo;
064: }
065:
066: public void setMotionVideo(MotionVideo motionVideo) {
067: this .motionVideo = motionVideo;
068: }
069:
070: public float getFrameRate() {
071: return frameRate;
072: }
073:
074: public void setFrameRate(float frameRate) {
075: this .frameRate = frameRate;
076: }
077:
078: public Dimension getSize() {
079: return size;
080: }
081:
082: public void setSize(Dimension size) {
083: this .size = size;
084: }
085:
086: public Project getProject() {
087: return project;
088: }
089:
090: public void setProject(Project project) {
091: this .project = project;
092: if (effectingVideo != null) {
093: effectingVideo.setProject(project);
094: }
095: }
096:
097: public EffectingVideo getEffectingVideo() {
098: return effectingVideo;
099: }
100:
101: public void setEffectingVideo(EffectingVideo effectingVideo) {
102: this .effectingVideo = effectingVideo;
103: if (effectingVideo != null) {
104: effectingVideo.setProject(project);
105: }
106: }
107:
108: public String getCanonicalVideoFile() {
109: try {
110: return new File(ApolloUtil.getPathName(project
111: .getProjectFile()), relativeVideoFile)
112: .getCanonicalPath();
113: } catch (IOException e) {
114: try {
115: return new File(relativeVideoFile).getCanonicalPath();
116: } catch (IOException e1) {
117: throw new RuntimeException(e1);
118: }
119: }
120: }
121:
122: public String getRelativeVideoFile() {
123: return relativeVideoFile;
124: }
125:
126: public void setRelativeVideoFile(String relativeVideoFile) {
127: this .relativeVideoFile = relativeVideoFile;
128: }
129:
130: public TrackingVideo getTrackingVideo() {
131: return trackingVideo;
132: }
133:
134: public void setTrackingVideo(TrackingVideo tracking) {
135: this .trackingVideo = tracking;
136: }
137:
138: public String toString() {
139: return ApolloUtil.getFileName(relativeVideoFile, true);
140: }
141:
142: }
|