mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 16:36:15 +00:00
Merge branch 'develop' into zip-proper-filename-decoding
This commit is contained in:
commit
828e5eb0e4
@ -84,9 +84,11 @@ MediaViewImagePanel.zoomTextField.text=
|
|||||||
MediaViewImagePanel.rotationTextField.text=
|
MediaViewImagePanel.rotationTextField.text=
|
||||||
MediaViewImagePanel.rotateLeftButton.toolTipText=
|
MediaViewImagePanel.rotateLeftButton.toolTipText=
|
||||||
HtmlPanel.showImagesToggleButton.text=Download Images
|
HtmlPanel.showImagesToggleButton.text=Download Images
|
||||||
MediaPlayerPanel.audioSlider.toolTipText=
|
MediaViewImagePanel.tagsMenu.text_1=Tags Menu
|
||||||
MediaPlayerPanel.VolumeIcon.text=\ \ \ \ \ Volume
|
|
||||||
MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00
|
MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00
|
||||||
|
MediaPlayerPanel.audioSlider.toolTipText=
|
||||||
|
MediaPlayerPanel.rewindButton.text=\u2bc7\u2bc7
|
||||||
|
MediaPlayerPanel.fastForwardButton.text=\u25ba\u25ba
|
||||||
MediaPlayerPanel.playButton.text=\u25ba
|
MediaPlayerPanel.playButton.text=\u25ba
|
||||||
MediaPlayerPanel.infoLabel.text=No Errors
|
MediaPlayerPanel.infoLabel.text=No Errors
|
||||||
MediaViewImagePanel.tagsMenu.text_1=Tags Menu
|
MediaPlayerPanel.VolumeIcon.text=\ \ \ \ \ Volume
|
||||||
|
@ -154,12 +154,14 @@ MediaViewImagePanel.zoomTextField.text=
|
|||||||
MediaViewImagePanel.rotationTextField.text=
|
MediaViewImagePanel.rotationTextField.text=
|
||||||
MediaViewImagePanel.rotateLeftButton.toolTipText=
|
MediaViewImagePanel.rotateLeftButton.toolTipText=
|
||||||
HtmlPanel.showImagesToggleButton.text=Download Images
|
HtmlPanel.showImagesToggleButton.text=Download Images
|
||||||
MediaPlayerPanel.audioSlider.toolTipText=
|
MediaViewImagePanel.tagsMenu.text_1=Tags Menu
|
||||||
MediaPlayerPanel.VolumeIcon.text=\ \ \ \ \ Volume
|
|
||||||
MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00
|
MediaPlayerPanel.progressLabel.text=00:00:00/00:00:00
|
||||||
|
MediaPlayerPanel.audioSlider.toolTipText=
|
||||||
|
MediaPlayerPanel.rewindButton.text=\u2bc7\u2bc7
|
||||||
|
MediaPlayerPanel.fastForwardButton.text=\u25ba\u25ba
|
||||||
MediaPlayerPanel.playButton.text=\u25ba
|
MediaPlayerPanel.playButton.text=\u25ba
|
||||||
MediaPlayerPanel.infoLabel.text=No Errors
|
MediaPlayerPanel.infoLabel.text=No Errors
|
||||||
MediaViewImagePanel.tagsMenu.text_1=Tags Menu
|
MediaPlayerPanel.VolumeIcon.text=\ \ \ \ \ Volume
|
||||||
# {0} - tableName
|
# {0} - tableName
|
||||||
SQLiteViewer.readTable.errorText=Error getting rows for table: {0}
|
SQLiteViewer.readTable.errorText=Error getting rows for table: {0}
|
||||||
# {0} - tableName
|
# {0} - tableName
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
@ -41,7 +41,7 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<EmptySpace min="0" pref="259" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="124" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
@ -51,47 +51,33 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Component id="infoLabel" max="32767" attributes="0"/>
|
||||||
<Component id="playButton" min="-2" pref="64" max="-2" attributes="0"/>
|
<Component id="buttonPanel" alignment="1" pref="738" max="32767" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="progressSlider" pref="680" max="32767" attributes="0"/>
|
<Component id="progressSlider" max="32767" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="progressLabel" min="-2" max="-2" attributes="0"/>
|
<Component id="progressLabel" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" attributes="0">
|
|
||||||
<Component id="infoLabel" max="32767" attributes="0"/>
|
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
|
||||||
<Component id="VolumeIcon" min="-2" pref="64" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
|
||||||
<Component id="audioSlider" min="-2" pref="229" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="progressLabel" max="32767" attributes="0"/>
|
<Component id="progressLabel" max="32767" attributes="0"/>
|
||||||
<Component id="progressSlider" max="32767" attributes="0"/>
|
<Component id="progressSlider" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="playButton" min="-2" max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
<Component id="buttonPanel" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Component id="infoLabel" pref="28" max="32767" attributes="0"/>
|
||||||
<Component id="audioSlider" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="VolumeIcon" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
|
|
||||||
<Component id="infoLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -112,16 +98,17 @@
|
|||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="infoLabel">
|
<Component class="javax.swing.JLabel" name="progressLabel">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.infoLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.progressLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
|
||||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
|
||||||
<Color id="Default Cursor"/>
|
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="buttonPanel">
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||||
|
<SubComponents>
|
||||||
<Component class="javax.swing.JButton" name="playButton">
|
<Component class="javax.swing.JButton" name="playButton">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
@ -131,27 +118,60 @@
|
|||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="playButtonActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="playButtonActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
|
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="21" ipadY="0" insetsTop="5" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="progressLabel">
|
<Component class="javax.swing.JButton" name="fastForwardButton">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.progressLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.fastForwardButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fastForwardButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
|
<GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="rewindButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.rewindButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rewindButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
|
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="0" insetsBottom="1" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="VolumeIcon">
|
<Component class="javax.swing.JLabel" name="VolumeIcon">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.VolumeIcon.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.VolumeIcon.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="2"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
|
<GridBagConstraints gridX="3" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="8" ipadY="7" insetsTop="6" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JSlider" name="audioSlider">
|
<Component class="javax.swing.JSlider" name="audioSlider">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="majorTickSpacing" type="int" value="10"/>
|
<Property name="majorTickSpacing" type="int" value="10"/>
|
||||||
<Property name="maximum" type="int" value="50"/>
|
<Property name="maximum" type="int" value="50"/>
|
||||||
<Property name="minorTickSpacing" type="int" value="5"/>
|
<Property name="minorTickSpacing" type="int" value="5"/>
|
||||||
<Property name="paintTicks" type="boolean" value="true"/>
|
|
||||||
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.audioSlider.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.audioSlider.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
@ -163,6 +183,24 @@
|
|||||||
<Dimension value="[200, 21]"/>
|
<Dimension value="[200, 21]"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<Constraints>
|
||||||
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
|
<GridBagConstraints gridX="4" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="-116" ipadY="7" insetsTop="3" insetsLeft="1" insetsBottom="0" insetsRight="10" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||||
|
</Constraint>
|
||||||
|
</Constraints>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JLabel" name="infoLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/contentviewers/Bundle.properties" key="MediaPlayerPanel.infoLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||||
|
<Color id="Default Cursor"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -24,6 +24,7 @@ import java.awt.event.ActionListener;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
@ -37,7 +38,6 @@ import javax.swing.SwingWorker;
|
|||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
import javax.swing.event.ChangeEvent;
|
import javax.swing.event.ChangeEvent;
|
||||||
import org.freedesktop.gstreamer.Bus;
|
import org.freedesktop.gstreamer.Bus;
|
||||||
import org.freedesktop.gstreamer.ClockTime;
|
|
||||||
import org.freedesktop.gstreamer.Gst;
|
import org.freedesktop.gstreamer.Gst;
|
||||||
import org.freedesktop.gstreamer.GstObject;
|
import org.freedesktop.gstreamer.GstObject;
|
||||||
import org.freedesktop.gstreamer.State;
|
import org.freedesktop.gstreamer.State;
|
||||||
@ -53,7 +53,11 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import javafx.embed.swing.JFXPanel;
|
import javafx.embed.swing.JFXPanel;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
|
import org.freedesktop.gstreamer.ClockTime;
|
||||||
|
import org.freedesktop.gstreamer.Format;
|
||||||
import org.freedesktop.gstreamer.GstException;
|
import org.freedesktop.gstreamer.GstException;
|
||||||
|
import org.freedesktop.gstreamer.event.SeekFlags;
|
||||||
|
import org.freedesktop.gstreamer.event.SeekType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a video player that is part of the Media View layered pane. It uses
|
* This is a video player that is part of the Media View layered pane. It uses
|
||||||
@ -175,10 +179,12 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
private Bus.ERROR errorListener;
|
private Bus.ERROR errorListener;
|
||||||
private Bus.STATE_CHANGED stateChangeListener;
|
private Bus.STATE_CHANGED stateChangeListener;
|
||||||
private Bus.EOS endOfStreamListener;
|
private Bus.EOS endOfStreamListener;
|
||||||
|
private double playBackRate;
|
||||||
|
|
||||||
//Update progress bar and time label during video playback
|
//Update progress bar and time label during video playback
|
||||||
private final Timer timer = new Timer(75, new VideoPanelUpdater());
|
private final Timer timer = new Timer(75, new VideoPanelUpdater());
|
||||||
private static final int PROGRESS_SLIDER_SIZE = 2000;
|
private static final int PROGRESS_SLIDER_SIZE = 2000;
|
||||||
|
private static final int SKIP_IN_SECONDS = 30;
|
||||||
|
|
||||||
private ExtractMedia extractMediaWorker;
|
private ExtractMedia extractMediaWorker;
|
||||||
|
|
||||||
@ -195,6 +201,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
progressSlider.setMinimum(0);
|
progressSlider.setMinimum(0);
|
||||||
progressSlider.setMaximum(PROGRESS_SLIDER_SIZE);
|
progressSlider.setMaximum(PROGRESS_SLIDER_SIZE);
|
||||||
progressSlider.setValue(0);
|
progressSlider.setValue(0);
|
||||||
|
playBackRate = 1.0;
|
||||||
//Manage the gstreamer video position when a user is dragging the slider in the panel.
|
//Manage the gstreamer video position when a user is dragging the slider in the panel.
|
||||||
progressSlider.addChangeListener(new ChangeListener() {
|
progressSlider.addChangeListener(new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -202,11 +209,19 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
if (progressSlider.getValueIsAdjusting()) {
|
if (progressSlider.getValueIsAdjusting()) {
|
||||||
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
|
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
|
||||||
double relativePosition = progressSlider.getValue() * 1.0 / PROGRESS_SLIDER_SIZE;
|
double relativePosition = progressSlider.getValue() * 1.0 / PROGRESS_SLIDER_SIZE;
|
||||||
long newPos = (long) (relativePosition * duration);
|
long newStartTime = (long) (relativePosition * duration);
|
||||||
gstPlayBin.seek(newPos, TimeUnit.NANOSECONDS);
|
gstPlayBin.seek(playBackRate,
|
||||||
|
Format.TIME,
|
||||||
|
//FLUSH - flushes the pipeline
|
||||||
|
//ACCURATE - video will seek exactly to the position requested
|
||||||
|
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
|
||||||
|
//Set the start position to newTime
|
||||||
|
SeekType.SET, newStartTime,
|
||||||
|
//Do nothing for the end position
|
||||||
|
SeekType.NONE, -1);
|
||||||
//Keep constantly updating the time label so users have a sense of
|
//Keep constantly updating the time label so users have a sense of
|
||||||
//where the slider they are dragging is in relation to the video time
|
//where the slider they are dragging is in relation to the video time
|
||||||
updateTimeLabel(newPos, duration);
|
updateTimeLabel(newStartTime, duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -301,8 +316,8 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
if (gstPlayBin != null) {
|
if (gstPlayBin != null) {
|
||||||
gstPlayBin.stop();
|
gstPlayBin.stop();
|
||||||
gstPlayBin.getBus().disconnect(endOfStreamListener);
|
gstPlayBin.getBus().disconnect(endOfStreamListener);
|
||||||
gstPlayBin.getBus().disconnect(endOfStreamListener);
|
gstPlayBin.getBus().disconnect(stateChangeListener);
|
||||||
gstPlayBin.getBus().disconnect(endOfStreamListener);
|
gstPlayBin.getBus().disconnect(errorListener);
|
||||||
gstPlayBin.dispose();
|
gstPlayBin.dispose();
|
||||||
fxAppSink.clear();
|
fxAppSink.clear();
|
||||||
gstPlayBin = null;
|
gstPlayBin = null;
|
||||||
@ -317,6 +332,8 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
progressSlider.setEnabled(isEnabled);
|
progressSlider.setEnabled(isEnabled);
|
||||||
videoPanel.setEnabled(isEnabled);
|
videoPanel.setEnabled(isEnabled);
|
||||||
audioSlider.setEnabled(isEnabled);
|
audioSlider.setEnabled(isEnabled);
|
||||||
|
rewindButton.setEnabled(isEnabled);
|
||||||
|
fastForwardButton.setEnabled(isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -373,7 +390,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
* @param total
|
* @param total
|
||||||
*/
|
*/
|
||||||
private void updateTimeLabel(long start, long total) {
|
private void updateTimeLabel(long start, long total) {
|
||||||
progressLabel.setText(formatTime(start, false) + "/" + formatTime(total, true));
|
progressLabel.setText(formatTime(start) + "/" + formatTime(total));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -383,24 +400,18 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
"MediaPlayerPanel.unknownTime=Unknown",
|
"MediaPlayerPanel.unknownTime=Unknown",
|
||||||
"MediaPlayerPanel.timeFormat=%02d:%02d:%02d"
|
"MediaPlayerPanel.timeFormat=%02d:%02d:%02d"
|
||||||
})
|
})
|
||||||
private String formatTime(long ns, boolean ceiling) {
|
private String formatTime(long ns) {
|
||||||
if (ns == -1) {
|
if (ns == -1) {
|
||||||
return Bundle.MediaPlayerPanel_unknownTime();
|
return Bundle.MediaPlayerPanel_unknownTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
double millis = ns / 1000000.0;
|
long seconds = TimeUnit.SECONDS.convert(ns, TimeUnit.NANOSECONDS);
|
||||||
double seconds;
|
long hours = TimeUnit.HOURS.convert(seconds, TimeUnit.SECONDS);
|
||||||
if (ceiling) {
|
seconds -= TimeUnit.SECONDS.convert(hours, TimeUnit.HOURS);
|
||||||
seconds = Math.ceil(millis / 1000);
|
long minutes = TimeUnit.MINUTES.convert(seconds, TimeUnit.SECONDS);
|
||||||
} else {
|
seconds -= TimeUnit.SECONDS.convert(minutes, TimeUnit.MINUTES);
|
||||||
seconds = millis / 1000;
|
|
||||||
}
|
|
||||||
double hours = seconds / 3600;
|
|
||||||
seconds -= (int) hours * 3600;
|
|
||||||
double minutes = seconds / 60;
|
|
||||||
seconds -= (int) minutes * 60;
|
|
||||||
|
|
||||||
return String.format(Bundle.MediaPlayerPanel_timeFormat(), (int) hours, (int) minutes, (int) seconds);
|
return String.format(Bundle.MediaPlayerPanel_timeFormat(), hours, minutes, seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -444,7 +455,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
try {
|
try {
|
||||||
super.get();
|
super.get();
|
||||||
|
|
||||||
if(this.isCancelled()) {
|
if (this.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +472,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
playBinBus.connect(stateChangeListener);
|
playBinBus.connect(stateChangeListener);
|
||||||
playBinBus.connect(errorListener);
|
playBinBus.connect(errorListener);
|
||||||
|
|
||||||
if(this.isCancelled()) {
|
if (this.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +483,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
fxAppSink = new JavaFxAppSink("JavaFxAppSink", fxPanel);
|
fxAppSink = new JavaFxAppSink("JavaFxAppSink", fxPanel);
|
||||||
gstPlayBin.setVideoSink(fxAppSink);
|
gstPlayBin.setVideoSink(fxAppSink);
|
||||||
|
|
||||||
if(this.isCancelled()) {
|
if (this.isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,7 +517,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
* pipeline. We start this updater when data-flow has just been
|
* pipeline. We start this updater when data-flow has just been
|
||||||
* initiated so buffering may still be in progress.
|
* initiated so buffering may still be in progress.
|
||||||
*/
|
*/
|
||||||
if (duration != -1) {
|
if (duration >= 0 && position >= 0) {
|
||||||
double relativePosition = (double) position / duration;
|
double relativePosition = (double) position / duration;
|
||||||
progressSlider.setValue((int) (relativePosition * PROGRESS_SLIDER_SIZE));
|
progressSlider.setValue((int) (relativePosition * PROGRESS_SLIDER_SIZE));
|
||||||
}
|
}
|
||||||
@ -524,15 +535,19 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
java.awt.GridBagConstraints gridBagConstraints;
|
||||||
|
|
||||||
videoPanel = new javax.swing.JPanel();
|
videoPanel = new javax.swing.JPanel();
|
||||||
controlPanel = new javax.swing.JPanel();
|
controlPanel = new javax.swing.JPanel();
|
||||||
progressSlider = new javax.swing.JSlider();
|
progressSlider = new javax.swing.JSlider();
|
||||||
infoLabel = new javax.swing.JLabel();
|
|
||||||
playButton = new javax.swing.JButton();
|
|
||||||
progressLabel = new javax.swing.JLabel();
|
progressLabel = new javax.swing.JLabel();
|
||||||
|
buttonPanel = new javax.swing.JPanel();
|
||||||
|
playButton = new javax.swing.JButton();
|
||||||
|
fastForwardButton = new javax.swing.JButton();
|
||||||
|
rewindButton = new javax.swing.JButton();
|
||||||
VolumeIcon = new javax.swing.JLabel();
|
VolumeIcon = new javax.swing.JLabel();
|
||||||
audioSlider = new javax.swing.JSlider();
|
audioSlider = new javax.swing.JSlider();
|
||||||
|
infoLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
javax.swing.GroupLayout videoPanelLayout = new javax.swing.GroupLayout(videoPanel);
|
javax.swing.GroupLayout videoPanelLayout = new javax.swing.GroupLayout(videoPanel);
|
||||||
videoPanel.setLayout(videoPanelLayout);
|
videoPanel.setLayout(videoPanelLayout);
|
||||||
@ -542,7 +557,7 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
);
|
);
|
||||||
videoPanelLayout.setVerticalGroup(
|
videoPanelLayout.setVerticalGroup(
|
||||||
videoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
videoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGap(0, 259, Short.MAX_VALUE)
|
.addGap(0, 124, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
|
|
||||||
progressSlider.setValue(0);
|
progressSlider.setValue(0);
|
||||||
@ -551,8 +566,9 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
progressSlider.setMinimumSize(new java.awt.Dimension(36, 21));
|
progressSlider.setMinimumSize(new java.awt.Dimension(36, 21));
|
||||||
progressSlider.setPreferredSize(new java.awt.Dimension(200, 21));
|
progressSlider.setPreferredSize(new java.awt.Dimension(200, 21));
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(infoLabel, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.infoLabel.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(progressLabel, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.progressLabel.text")); // NOI18N
|
||||||
infoLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
|
||||||
|
buttonPanel.setLayout(new java.awt.GridBagLayout());
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(playButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.playButton.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(playButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.playButton.text")); // NOI18N
|
||||||
playButton.addActionListener(new java.awt.event.ActionListener() {
|
playButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
@ -560,56 +576,97 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
playButtonActionPerformed(evt);
|
playButtonActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 1;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.ipadx = 21;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 0);
|
||||||
|
buttonPanel.add(playButton, gridBagConstraints);
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(progressLabel, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.progressLabel.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(fastForwardButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.fastForwardButton.text")); // NOI18N
|
||||||
|
fastForwardButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
fastForwardButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 2;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(5, 6, 0, 0);
|
||||||
|
buttonPanel.add(fastForwardButton, gridBagConstraints);
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(rewindButton, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.rewindButton.text")); // NOI18N
|
||||||
|
rewindButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
rewindButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 0;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(5, 0, 1, 0);
|
||||||
|
buttonPanel.add(rewindButton, gridBagConstraints);
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(VolumeIcon, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.VolumeIcon.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(VolumeIcon, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.VolumeIcon.text")); // NOI18N
|
||||||
|
VolumeIcon.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 3;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.ipadx = 8;
|
||||||
|
gridBagConstraints.ipady = 7;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
|
||||||
|
buttonPanel.add(VolumeIcon, gridBagConstraints);
|
||||||
|
|
||||||
audioSlider.setMajorTickSpacing(10);
|
audioSlider.setMajorTickSpacing(10);
|
||||||
audioSlider.setMaximum(50);
|
audioSlider.setMaximum(50);
|
||||||
audioSlider.setMinorTickSpacing(5);
|
audioSlider.setMinorTickSpacing(5);
|
||||||
audioSlider.setPaintTicks(true);
|
|
||||||
audioSlider.setToolTipText(org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.audioSlider.toolTipText")); // NOI18N
|
audioSlider.setToolTipText(org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.audioSlider.toolTipText")); // NOI18N
|
||||||
audioSlider.setValue(25);
|
audioSlider.setValue(25);
|
||||||
audioSlider.setMinimumSize(new java.awt.Dimension(200, 21));
|
audioSlider.setMinimumSize(new java.awt.Dimension(200, 21));
|
||||||
audioSlider.setPreferredSize(new java.awt.Dimension(200, 21));
|
audioSlider.setPreferredSize(new java.awt.Dimension(200, 21));
|
||||||
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
|
gridBagConstraints.gridx = 4;
|
||||||
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.ipadx = -116;
|
||||||
|
gridBagConstraints.ipady = 7;
|
||||||
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||||
|
gridBagConstraints.insets = new java.awt.Insets(3, 1, 0, 10);
|
||||||
|
buttonPanel.add(audioSlider, gridBagConstraints);
|
||||||
|
|
||||||
|
infoLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(infoLabel, org.openide.util.NbBundle.getMessage(MediaPlayerPanel.class, "MediaPlayerPanel.infoLabel.text")); // NOI18N
|
||||||
|
infoLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||||
|
|
||||||
javax.swing.GroupLayout controlPanelLayout = new javax.swing.GroupLayout(controlPanel);
|
javax.swing.GroupLayout controlPanelLayout = new javax.swing.GroupLayout(controlPanel);
|
||||||
controlPanel.setLayout(controlPanelLayout);
|
controlPanel.setLayout(controlPanelLayout);
|
||||||
controlPanelLayout.setHorizontalGroup(
|
controlPanelLayout.setHorizontalGroup(
|
||||||
controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPanelLayout.createSequentialGroup()
|
.addGroup(controlPanelLayout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(controlPanelLayout.createSequentialGroup()
|
|
||||||
.addComponent(playButton, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
||||||
.addComponent(progressSlider, javax.swing.GroupLayout.DEFAULT_SIZE, 680, Short.MAX_VALUE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
||||||
.addComponent(progressLabel))
|
|
||||||
.addGroup(controlPanelLayout.createSequentialGroup()
|
|
||||||
.addComponent(infoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(infoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGap(18, 18, 18)
|
.addComponent(buttonPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 738, Short.MAX_VALUE)
|
||||||
.addComponent(VolumeIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, controlPanelLayout.createSequentialGroup()
|
||||||
.addGap(2, 2, 2)
|
.addComponent(progressSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(audioSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(progressLabel)))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
controlPanelLayout.setVerticalGroup(
|
controlPanelLayout.setVerticalGroup(
|
||||||
controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(controlPanelLayout.createSequentialGroup()
|
.addGroup(controlPanelLayout.createSequentialGroup()
|
||||||
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGap(0, 0, 0)
|
||||||
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
.addComponent(progressLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(progressLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(progressSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
.addComponent(progressSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.addComponent(playButton))
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
.addComponent(buttonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(audioSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(controlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addComponent(infoLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
|
||||||
.addComponent(VolumeIcon, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addComponent(infoLabel)))
|
|
||||||
.addGap(13, 13, 13))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
@ -628,6 +685,46 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void rewindButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rewindButtonActionPerformed
|
||||||
|
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
|
||||||
|
//Skip 30 seconds.
|
||||||
|
long rewindDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
|
||||||
|
//Ensure new video position is within bounds
|
||||||
|
long newTime = Math.max(currentTime - rewindDelta, 0);
|
||||||
|
gstPlayBin.seek(playBackRate,
|
||||||
|
Format.TIME,
|
||||||
|
//FLUSH - flushes the pipeline
|
||||||
|
//ACCURATE - video will seek exactly to the position requested
|
||||||
|
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
|
||||||
|
//Set the start position to newTime
|
||||||
|
SeekType.SET, newTime,
|
||||||
|
//Do nothing for the end position
|
||||||
|
SeekType.NONE, -1);
|
||||||
|
}//GEN-LAST:event_rewindButtonActionPerformed
|
||||||
|
|
||||||
|
private void fastForwardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fastForwardButtonActionPerformed
|
||||||
|
long duration = gstPlayBin.queryDuration(TimeUnit.NANOSECONDS);
|
||||||
|
long currentTime = gstPlayBin.queryPosition(TimeUnit.NANOSECONDS);
|
||||||
|
//Skip 30 seconds.
|
||||||
|
long fastForwardDelta = TimeUnit.NANOSECONDS.convert(SKIP_IN_SECONDS, TimeUnit.SECONDS);
|
||||||
|
|
||||||
|
//Ignore fast forward requests if there are less than 30 seconds left.
|
||||||
|
if(currentTime + fastForwardDelta >= duration) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
long newTime = currentTime + fastForwardDelta;
|
||||||
|
gstPlayBin.seek(playBackRate,
|
||||||
|
Format.TIME,
|
||||||
|
//FLUSH - flushes the pipeline
|
||||||
|
//ACCURATE - video will seek exactly to the position requested
|
||||||
|
EnumSet.of(SeekFlags.FLUSH, SeekFlags.ACCURATE),
|
||||||
|
//Set the start position to newTime
|
||||||
|
SeekType.SET, newTime,
|
||||||
|
//Do nothing for the end position
|
||||||
|
SeekType.NONE, -1);
|
||||||
|
}//GEN-LAST:event_fastForwardButtonActionPerformed
|
||||||
|
|
||||||
private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
|
private void playButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_playButtonActionPerformed
|
||||||
if (gstPlayBin.isPlaying()) {
|
if (gstPlayBin.isPlaying()) {
|
||||||
gstPlayBin.pause();
|
gstPlayBin.pause();
|
||||||
@ -636,15 +733,17 @@ public class MediaPlayerPanel extends JPanel implements MediaFileViewer.MediaVie
|
|||||||
}
|
}
|
||||||
}//GEN-LAST:event_playButtonActionPerformed
|
}//GEN-LAST:event_playButtonActionPerformed
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JLabel VolumeIcon;
|
private javax.swing.JLabel VolumeIcon;
|
||||||
private javax.swing.JSlider audioSlider;
|
private javax.swing.JSlider audioSlider;
|
||||||
|
private javax.swing.JPanel buttonPanel;
|
||||||
private javax.swing.JPanel controlPanel;
|
private javax.swing.JPanel controlPanel;
|
||||||
|
private javax.swing.JButton fastForwardButton;
|
||||||
private javax.swing.JLabel infoLabel;
|
private javax.swing.JLabel infoLabel;
|
||||||
private javax.swing.JButton playButton;
|
private javax.swing.JButton playButton;
|
||||||
private javax.swing.JLabel progressLabel;
|
private javax.swing.JLabel progressLabel;
|
||||||
private javax.swing.JSlider progressSlider;
|
private javax.swing.JSlider progressSlider;
|
||||||
|
private javax.swing.JButton rewindButton;
|
||||||
private javax.swing.JPanel videoPanel;
|
private javax.swing.JPanel videoPanel;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user