Package com.jogamp.graph.ui.shapes
Class MediaButton
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.GraphShape
-
- com.jogamp.graph.ui.shapes.BaseButton
-
- com.jogamp.graph.ui.shapes.TexSeqButton
-
- com.jogamp.graph.ui.shapes.MediaButton
-
public class MediaButton extends TexSeqButton
A GraphUIGLMediaPlayer
basedTexSeqButton
GraphShape
.GraphUI is GPU based and resolution independent.
This button is rendered with a round oval shape. To render it rectangular,
BaseButton.setCorner(float)
to zero.Default colors (toggle-on is full color): - non-toggle: 1 * color - pressed: 0.9 * color - toggle-off: 0.8 * color - toggle-on: 1.0 * color
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
Fields Modifier and Type Field Description static Alignment
DEFAULT_ASS_SUB_ALIGNMENT
Default text/ASS subtitle alignment, defaults toAlignment.CenterHoriz
.static float
DEFAULT_ASS_SUB_BLEND
Default blending alpha (darkness) for the text/ASS subtitles, defaults to 0.30000001192092896f.static com.jogamp.math.Vec4f
DEFAULT_ASS_SUB_COLOR
Default color for the text/ASS subtitles, defaults to RGBA1, 1, 1, 1
.static float
DEFAULT_ASS_SUB_HEIGHT
Default text/ASS subtitle line height percentage, 0.07500000298023224f.static float
DEFAULT_ASS_SUB_POS
Default text/ASS subtitle y-axis offset to bottom in line-height percentage, 0.25f.-
Fields inherited from class com.jogamp.graph.ui.shapes.BaseButton
PERP_CORNER, ROUND_CORNER
-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description MediaButton(int renderModes, float width, float height, GLMediaPlayer mPlayer)
Constructs aMediaButton
withFontFactory.getDefaultFont()
for subtitles.MediaButton(int renderModes, float width, float height, GLMediaPlayer mPlayer, Font subFont)
Constructs aMediaButton
prepared for using subtitles
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaButton
addDefaultEventListener()
Add the defaultGLMediaPlayer.GLMediaEventListener
tothis class's GLMediaPlayer
.AudioSink
getAudioSink()
GLMediaPlayer
getGLMediaPlayer()
SubtitleEventListener
getSubEventListener()
void
setSubtitleColor(com.jogamp.math.Vec4f color, float blend)
Sets text/ASS subtitle colorsvoid
setSubtitleParams(Font subFont, float subLineHeightPct, float subLineDY, Alignment subAlignment)
Sets text/ASS subtitle parameter, enabling subtitle renderingvoid
setSubtitlesEnabled(boolean v)
Toggle enabling subtitle renderingMediaButton
setVerbose(boolean v)
-
Methods inherited from class com.jogamp.graph.ui.shapes.TexSeqButton
getARatioLetterboxBackColor, getTextureSequence, setARatioAdjustment, setARatioLetterbox, useARatioAdjustment, useARatioLetterbox
-
Methods inherited from class com.jogamp.graph.ui.shapes.BaseButton
getCorner, getHeight, getSubString, getWidth, setCorner, setPerp, setSize
-
Methods inherited from class com.jogamp.graph.ui.GraphShape
getRegion, getRenderModes, getRenderModesReq, getSharpness, hasColorChannel, setSharpness, setTextureUnit
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isGroup, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Field Detail
-
DEFAULT_ASS_SUB_HEIGHT
public static final float DEFAULT_ASS_SUB_HEIGHT
Default text/ASS subtitle line height percentage, 0.07500000298023224f.- See Also:
- Constant Field Values
-
DEFAULT_ASS_SUB_POS
public static final float DEFAULT_ASS_SUB_POS
Default text/ASS subtitle y-axis offset to bottom in line-height percentage, 0.25f.- See Also:
- Constant Field Values
-
DEFAULT_ASS_SUB_COLOR
public static final com.jogamp.math.Vec4f DEFAULT_ASS_SUB_COLOR
Default color for the text/ASS subtitles, defaults to RGBA1, 1, 1, 1
.
-
DEFAULT_ASS_SUB_BLEND
public static final float DEFAULT_ASS_SUB_BLEND
Default blending alpha (darkness) for the text/ASS subtitles, defaults to 0.30000001192092896f.- See Also:
- Constant Field Values
-
DEFAULT_ASS_SUB_ALIGNMENT
public static final Alignment DEFAULT_ASS_SUB_ALIGNMENT
Default text/ASS subtitle alignment, defaults toAlignment.CenterHoriz
.
-
-
Constructor Detail
-
MediaButton
public MediaButton(int renderModes, float width, float height, GLMediaPlayer mPlayer)
Constructs aMediaButton
withFontFactory.getDefaultFont()
for subtitles.
-
MediaButton
public MediaButton(int renderModes, float width, float height, GLMediaPlayer mPlayer, Font subFont)
Constructs aMediaButton
prepared for using subtitles- Parameters:
renderModes
-width
-height
-mPlayer
-subFont
- text/ASS subtitle font, passnull
forFontFactory.getDefaultFont()
.FontFactory.getFallbackFont()
is usedif providing a better coverage
of a Text/ASS subtitle line.- See Also:
setSubtitleParams(Font, float, float, Alignment)
,setSubtitleColor(Vec4f, float)
-
-
Method Detail
-
setSubtitlesEnabled
public void setSubtitlesEnabled(boolean v)
Toggle enabling subtitle rendering
-
setSubtitleParams
public void setSubtitleParams(Font subFont, float subLineHeightPct, float subLineDY, Alignment subAlignment)
Sets text/ASS subtitle parameter, enabling subtitle rendering- Parameters:
subFont
- text/ASS subtitle font, passnull
forFontFactory.getDefaultFont()
FontFactory.getFallbackFont()
is usedif providing a better coverage
of a Text/ASS subtitle line.subLineHeightPct
- text/ASS subtitle line height percentage, defaults toDEFAULT_ASS_SUB_HEIGHT
subLineDY
- text/ASS y-axis offset to bottom in line-height, defaults toDEFAULT_ASS_SUB_POS
subAlignment
- text/ASS subtitle alignment, defaults toDEFAULT_ASS_SUB_ALIGNMENT
-
setSubtitleColor
public void setSubtitleColor(com.jogamp.math.Vec4f color, float blend)
Sets text/ASS subtitle colors- Parameters:
color
- color for the text/ASS, defaults toDEFAULT_ASS_SUB_COLOR
blend
- blending alpha (darkness), defaults toDEFAULT_ASS_SUB_BLEND
-
getSubEventListener
public final SubtitleEventListener getSubEventListener()
-
setVerbose
public MediaButton setVerbose(boolean v)
-
addDefaultEventListener
public MediaButton addDefaultEventListener()
Add the defaultGLMediaPlayer.GLMediaEventListener
tothis class's GLMediaPlayer
.
-
getGLMediaPlayer
public final GLMediaPlayer getGLMediaPlayer()
-
getAudioSink
public final AudioSink getAudioSink()
-
-