forked from kitodo/kitodo-production
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kitodo#5504 from markusweigelt/video-editor
Add media partials for audio and video
- Loading branch information
Showing
38 changed files
with
1,893 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
Kitodo-API/src/main/java/org/kitodo/api/dataformat/MediaPartial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* (c) Kitodo. Key to digital objects e. V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo project. | ||
* | ||
* It is licensed under GNU General Public License version 3 or later. | ||
* | ||
* For the full copyright and license information, please read the | ||
* GPL3-License.txt file that was distributed with this source code. | ||
*/ | ||
|
||
package org.kitodo.api.dataformat; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* MediaPartial is part of a {@link PhysicalDivision} of type | ||
* {@link PhysicalDivision#TYPE_TRACK} and contains additional | ||
* information about the start and length. | ||
*/ | ||
public class MediaPartial { | ||
|
||
private String begin; | ||
|
||
private String extent; | ||
|
||
/** | ||
* Constructs a media partial object. | ||
* | ||
* @param begin | ||
* The begin as formatted time in form of | ||
* {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} | ||
*/ | ||
public MediaPartial(String begin) { | ||
this.begin = begin; | ||
} | ||
|
||
/** | ||
* Constructs a media partial object. | ||
* | ||
* @param begin | ||
* The begin as formatted time in form of | ||
* {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} | ||
* @param extent | ||
* The extent as formatted time in form of | ||
* {@link org.kitodo.production.helper.metadata.MediaPartialHelper#FORMATTED_TIME_PATTERN} | ||
*/ | ||
public MediaPartial(String begin, String extent) { | ||
this(begin); | ||
this.extent = extent; | ||
} | ||
|
||
public void setBegin(String begin) { | ||
this.begin = begin; | ||
} | ||
|
||
public String getBegin() { | ||
return begin; | ||
} | ||
|
||
public String getExtent() { | ||
return extent; | ||
} | ||
|
||
public void setExtent(String extent) { | ||
this.extent = extent; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!getClass().isInstance(o)) { | ||
return false; | ||
} | ||
|
||
MediaPartial mediaPartial = (MediaPartial) o; | ||
|
||
return (Objects.isNull(begin) && Objects.isNull(mediaPartial.begin)) || begin.equals(mediaPartial.getBegin()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
return prime * super.hashCode() + Objects.hash(begin, extent); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.