Documentation ¶
Overview ¶
Package tt enables a user to create a minimal ST 428-7 Subtitle XML Document in accordance with SMPTE Public CD of SMPTE RP 428-22 1ED - D-Cinema Distribution Master – Minimal Timed Text XML Requirements as per requirements stipulated in RDD 52 - SMPTE DCP Bv2.1 Application Profile available at 10.5594/SMPTE.RDD52.2020.
Copyright (c) 2020, Jack Watts. All rights reserved.
This program is free software : you can redistribute it and / or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
You should have received a copy of the GNU General Public License along with this program.If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Variables
- func CreateMXF(encrypt bool, frameRate, output, filename string, reel, duration int) error
- func CreateXML(Txt, Img, Track, Encrypt bool, Reel, Display, Duration int, ...) error
- type Font
- type Image
- type LoadFont
- type NestedFont
- type Rt
- type Ruby
- type Subtitle
- type SubtitleReel
- type Text
- type Timecode
Constants ¶
This section is empty.
Variables ¶
var ( // Text identifies that the Subtitle Text profile is to be used. Txt bool // Image identifies that the Subtitle Image profile is to be used. Img bool // Track signals that an MXF track file is to be created when using the CreateXML() function. Track bool // Encrypt is to be used in accordance with 'Track' as it signals that the resulting MXF is // to be encrypted. Encrypt bool // Reel is the reel number and shall be a positive integer reflecting the reel number the XML is to be used for Reel int // Duration is a positive integer value that maps to the ContainerDuration entry of the resulting MXF track file. Duration int // Display identifies what DisplayType value to be used. 0 = MainSubtitle, >= 1 = ClosedCaption. Display int // Framerate results in the EditRate of the Subtitle XML file and also translates to the TimeCodeRate element. Framerate string // Template is to be used when wanting to use an existing XML document to template the XML's general properties. Template string // Title is the value that populates the ContentTitleText element. Title string // Language is the RFC 5646 compliant subtag as per the IANA subtag registry. Language string // Output is the target output directory. Output string )
The proceeding list of exported variables are to be used when calling either CreateXML() or CreateXMF() functions.
Functions ¶
Types ¶
type Font ¶
type Font struct { ID string `xml:"ID,attr,omitempty"` Weight string `xml:"Weight,attr,omitempty"` Size string `xml:"Size,attr,omitempty"` Color string `xml:"Color,attr,omitempty"` Effect string `xml:"Effect,attr,omitempty"` EffectColor string `xml:"EffectColor,attr,omitempty"` EffectSize string `xml:"EffectSize,attr,omitempty"` Italic string `xml:"Italic,attr,omitempty"` Underline string `xml:"Underline,attr,omitempty"` AspectAdjust string `xml:"AspectAdjust,attr,omitempty"` Spacing string `xml:"Spacing,attr,omitempty"` Feather string `xml:"Feather,attr,omitempty"` Subtitle []*Subtitle `xml:"Subtitle"` }
Font as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Font
type Image ¶
type Image struct { XMLName xml.Name `xml:"Image"` Image string `xml:",chardata"` ImageType string `xml:"ImageType,omitempty"` Halign string `xml:"Halign,attr,omitempty"` Hposition string `xml:"Hposition,attr,omitempty"` Valign string `xml:"Valign,attr,omitempty"` Vposition string `xml:"Vposition,attr,omitempty"` Zposition string `xml:"Zposition,attr,omitempty"` VariableZ string `xml:"VariableZ,attr,omitempty"` }
Image as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Image
type LoadFont ¶
LoadFont as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#LoadFont
type NestedFont ¶
type NestedFont struct { ID string `xml:"ID,attr,omitempty"` Weight string `xml:"Weight,attr,omitempty"` Size string `xml:"Size,attr,omitempty"` Color string `xml:"Color,attr,omitempty"` Effect string `xml:"Effect,attr,omitempty"` EffectColor string `xml:"EffectColor,attr,omitempty"` EffectSize string `xml:"EffectSize,attr,omitempty"` Italic string `xml:"Italic,attr,omitempty"` Underline string `xml:"Underline,attr,omitempty"` AspectAdjust string `xml:"AspectAdjust,attr,omitempty"` Spacing string `xml:"Spacing,attr,omitempty"` Feather string `xml:"Feather,attr,omitempty"` Text string `xml:",chardata"` }
NestedFont as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#NestedFont
type Rt ¶
type Rt struct { Size string `xml:"Size,attr"` Position string `xml:"Position,attr"` Offset string `xml:"Offset,attr"` Spacing string `xml:"Spacing,attr"` AspectAdjust string `xml:"AspectAdjust,attr"` }
Rt as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Rt
type Ruby ¶
Ruby as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Ruby
type Subtitle ¶
type Subtitle struct { SpotNumber string `xml:"SpotNumber,attr,omitempty"` TimeIn string `xml:"TimeIn,attr"` TimeOut string `xml:"TimeOut,attr"` FadeUpTime string `xml:"FadeUpTime,attr,omitempty"` FadeDownTime string `xml:"FadeDownTime,attr,omitempty"` Text []*Text `xml:"Text,allowempty"` Image []*Image `xml:"Image,omitempty"` Font *NestedFont `xml:"Font,omitempty"` }
Subtitle as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Subtitle
type SubtitleReel ¶
type SubtitleReel struct { XMLName xml.Name `xml:"SubtitleReel"` Xmlns string `xml:"xmlns,attr,omitempty"` ID string `xml:"Id"` ContentTitleText string `xml:"ContentTitleText,omitempty"` IssueDate string `xml:"IssueDate"` ReelNumber int `xml:"ReelNumber"` Language string `xml:"Language"` EditRate string `xml:"EditRate"` TimeCodeRate string `xml:"TimeCodeRate"` StartTime string `xml:"StartTime"` DisplayType string `xml:"DisplayType"` LoadFont *LoadFont `xml:"LoadFont,omitempty"` SubtitleList *Font `xml:"SubtitleList>Font"` Filename string `xml:",omitempty"` }
SubtitleReel as per http://www.smpte-ra.org/schemas/428-7/2014/DCST
type Text ¶
type Text struct { Text string `xml:",chardata"` Halign string `xml:"Halign,attr,omitempty"` Hposition string `xml:"Hposition,attr,omitempty"` Valign string `xml:"Valign,attr,omitempty"` Vposition string `xml:"Vposition,attr,omitempty"` Direction string `xml:"Direction,attr,omitempty"` Zposition string `xml:"Zposition,attr,omitempty"` VariableZ string `xml:"VariableZ,attr,omitempty"` Font *NestedFont `xml:"Font,omitempty"` Ruby []*Ruby `xml:"Ruby,omitempty"` }
Text as per http://www.smpte-ra.org/schemas/428-7/2014/DCST#Text
type Timecode ¶
type Timecode struct {
// contains filtered or unexported fields
}
Timecode struct.
func NewTimecode ¶
NewTimecode initialises a new timecode type from a given framerate.
func (*Timecode) GetTimeCode ¶
GetTimeCode method generates a SMPTE timcode when called against type Timecode.