ixml

package
v0.0.0-...-93023be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package ixml implements the iXML audio chunk metadata standard for broadcast wave audio.

Index

Constants

This section is empty.

Variables

View Source
var (
	NsIXML = xmp.NewNamespace("iXML", "http://ns.adobe.com/ixml/1.0/", NewModel)
)

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type Bool

type Bool bool

func (Bool) MarshalText

func (x Bool) MarshalText() ([]byte, error)

func (*Bool) UnmarshalText

func (x *Bool) UnmarshalText(data []byte) error

func (Bool) Value

func (x Bool) Value() bool

type DefaultMix

type DefaultMix struct {
	XMLName xml.Name `xml:"DEFAULT_MIX"      xmp:"-"`
	Level   string   `xml:"LEVEL,omitempty"  xmp:"iXML:level"` // Gain in dB as float, 'OFF' is an allowed value (e.g. -3.5)
	Pan     string   `xml:"PAN,omitempty"    xmp:"iXML:pan"`   // Pan angle in degrees L or R of centre (e.g. 23.5R)
}

extended attribute for tracks: http://www.gallery.co.uk/ixml/defaultmix.html

type FileSet

type FileSet struct {
	XMLName      xml.Name `xml:"FILE_SET"                  xmp:"-"`
	TotalFiles   int      `xml:"TOTAL_FILES,omitempty"     xmp:"iXML:totalFiles"`
	FamilyUID    string   `xml:"FAMILY_UID,omitempty"      xmp:"iXML:familyUID"`
	FamilyName   string   `xml:"FAMILY_NAME,omitempty"     xmp:"iXML:familyName"`
	FileSetIndex string   `xml:"FILE_SET_INDEX,omitempty"  xmp:"iXML:fileSetIndex"`
}

type FunctionType

type FunctionType string
const (
	FunctionMS_M         FunctionType = "M-MID_SIDE"
	FunctionMS_S         FunctionType = "S-MID_SIDE"
	FunctionXY_X         FunctionType = "X-X_Y "
	FunctionXY_Y         FunctionType = "Y-X_Y"
	FunctionMix_L        FunctionType = "L-MIX"
	FunctionMix_R        FunctionType = "R-MIX"
	FunctionMix          FunctionType = "MIX"
	FunctionLeft         FunctionType = "LEFT"
	FunctionRight        FunctionType = "RIGHT"
	FunctionDMS_F        FunctionType = "F-DMS"
	FunctionDMS_8        FunctionType = "8-DMS"
	FunctionDMS_R        FunctionType = "R-DMS"
	FunctionLCR_L        FunctionType = "L-LCR"
	FunctionLCR_C        FunctionType = "C-LCR"
	FunctionLCR_R        FunctionType = "R-LCR"
	FunctionLCRS_L       FunctionType = "L-LCRS"
	FunctionLCRS_C       FunctionType = "C-LCRS"
	FunctionLCRS_R       FunctionType = "R-LCRS"
	FunctionLCRS_S       FunctionType = "S-LCRS"
	Function51_L         FunctionType = "L-5.1"
	Function51_C         FunctionType = "C-5.1"
	Function51_R         FunctionType = "R-5.1"
	Function51_Ls        FunctionType = "Ls-5.1"
	Function51_Rs        FunctionType = "Rs-5.1"
	Function51_LFE       FunctionType = "LFE-5.1"
	Function71_L         FunctionType = "L-7.1"
	Function71_Lc        FunctionType = "Lc-7.1"
	Function71_C         FunctionType = "C-7.1"
	Function71_Rc        FunctionType = "Rc-7.1"
	Function71_R         FunctionType = "R-7.1"
	Function71_Ls        FunctionType = "Ls-7.1"
	Function71_Rs        FunctionType = "Rs-7.1"
	Function71_LFE       FunctionType = "LFE-7.1"
	FunctionSurroundL    FunctionType = "L-GENERIC"    // Main Layer Front Left
	FunctionSurroundLc   FunctionType = "Lc-GENERIC"   // Main Layer Front Left Center
	FunctionSurroundC    FunctionType = "C-GENERIC"    // Main Layer Front Center
	FunctionSurroundRc   FunctionType = "Rc-GENERIC"   // Main Layer Front Right Center
	FunctionSurroundR    FunctionType = "R-GENERIC"    // Main Layer Front Right
	FunctionSurroundLs   FunctionType = "Ls-GENERIC"   // Main Layer Rear Left
	FunctionSurroundCs   FunctionType = "Cs-GENERIC"   // Main Layer Rear Center
	FunctionSurroundRs   FunctionType = "Rs-GENERIC"   // Main Layer Rear Right
	FunctionSurroundLFE  FunctionType = "LFE-GENERIC"  // LFE
	FunctionSurroundSl   FunctionType = "Sl-GENERIC"   // Main Layer Side Left
	FunctionSurroundSr   FunctionType = "Sr-GENERIC"   // Main Layer Side Right
	FunctionSurroundLcs  FunctionType = "Lcs-GENERIC"  // Main Layer Rear Left Center
	FunctionSurroundRcs  FunctionType = "Rcs-GENERIC"  // Main Layer Rear Right Center
	FunctionSurroundLFE2 FunctionType = "LFE2-GENERIC" // LFE 2
	FunctionSurroundVoG  FunctionType = "VoG-GENERIC"  // Top Layer Voice of God
	FunctionSurroundTl   FunctionType = "Tl-GENERIC"   // Top Layer Front Left
	FunctionSurroundTc   FunctionType = "Tc-GENERIC"   // Top Layer Front Center
	FunctionSurroundTr   FunctionType = "Tr-GENERIC"   // Top Layer Front Right
	FunctionSurroundTrl  FunctionType = "Trl-GENERIC"  // Top Layer Rear Left
	FunctionSurroundTrc  FunctionType = "Trc-GENERIC"  // Top Layer Rear Center
	FunctionSurroundTrr  FunctionType = "Trr-GENERIC"  // Top Layer Rear Right
	FunctionSurroundTsl  FunctionType = "Tsl-GENERIC"  // Top Layer Side Left
	FunctionSurroundTsr  FunctionType = "Tsr-GENERIC"  // Top Layer Side Right
	FunctionSurroundVoD  FunctionType = "VoD-GENERIC"  // Bottom Layer Voice of Devil
	FunctionSurroundBl   FunctionType = "Bl-GENERIC"   // Bottom Layer Front Left
	FunctionSurroundBc   FunctionType = "Bc-GENERIC"   // Bottom Layer Front Center
	FunctionSurroundBr   FunctionType = "Br-GENERIC"   // Bottom Layer Front Right
	FunctionSurroundBrl  FunctionType = "Brl-GENERIC"  // Bottom Layer Rear Left
	FunctionSurroundBrc  FunctionType = "Brc-GENERIC"  // Bottom Layer Rear Center
	FunctionSurroundBrr  FunctionType = "Brr-GENERIC"  // Bottom Layer Rear Right
	FunctionSurroundBsl  FunctionType = "Bsl-GENERIC"  // Bottom Layer Side Left
	FunctionSurroundBsr  FunctionType = "Bsr-GENERIC"  // Bottom Layer Side Right
	FunctionSoundfield_W FunctionType = "W-SOUNDFIELD"
	FunctionSoundfield_X FunctionType = "X-SOUNDFIELD"
	FunctionSoundfield_Y FunctionType = "Y-SOUNDFIELD"
	FunctionSoundfield_Z FunctionType = "Z-SOUNDFIELD"
	FunctionVideo        FunctionType = "VIDEO"
)

type History

type History struct {
	XMLName          xml.Name `xml:"HISTORY"                      xmp:"-"`
	OriginalFilename string   `xml:"ORIGINAL_FILENAME,omitempty"  xmp:"iXML:originalFilename"`
	ParentFilename   string   `xml:"PARENT_FILENAME,omitempty"    xmp:"iXML:parentFilename"`
	ParentUID        string   `xml:"PARENT_UID,omitempty"         xmp:"iXML:parentUID"`
}

type IXML

type IXML struct {
	XMLName              xml.Name                `xml:"BWFXML"                            xmp:"-"`
	Version              string                  `xml:"IXML_VERSION"                      xmp:"iXML:version"`
	Project              string                  `xml:"PROJECT,omitempty"                 xmp:"iXML:project"`
	SceneName            string                  `xml:"SCENE,omitempty"                   xmp:"iXML:sceneName"`
	SoundRoll            string                  `xml:"TAPE,omitempty"                    xmp:"iXML:soundRoll"`
	Take                 int                     `xml:"TAKE,omitempty"                    xmp:"iXML:take"`
	TakeType             TakeTypeList            `xml:"TAKE_TYPE,omitempty"               xmp:"iXML:takeType"` // v2.0+
	IsNotGood            Bool                    `xml:"NO_GOOD,omitempty"                 xmp:"-"`             // v1.9-
	IsFalseStart         Bool                    `xml:"FALSE_START,omitempty"             xmp:"-"`             // v1.9-
	IsWildTrack          Bool                    `xml:"WILD_TRACK,omitempty"              xmp:"-"`             // v1.9-
	PreRecordSamplecount int                     `xml:"PRE_RECORD_SAMPLECOUNT,omitempty"  xmp:"-"`             // v1.3-
	IsCircled            Bool                    `xml:"CIRCLED,omitempty"                 xmp:"iXML:circled"`
	FileUID              string                  `xml:"FILE_UID,omitempty"                xmp:"iXML:fileUid"`
	UserBits             string                  `xml:"UBITS,omitempty"                   xmp:"iXML:userBits"`
	Note                 string                  `xml:"NOTE,omitempty"                    xmp:"iXML:note"`
	SyncPoints           SyncPointList           `xml:"SYNC_POINT_LIST,omitempty"         xmp:"iXML:syncPoints"`
	Speed                *Speed                  `xml:"SPEED,omitempty"                   xmp:"iXML:speed"`
	History              *History                `xml:"HISTORY,omitempty"                 xmp:"iXML:history"`
	FileSet              *FileSet                `xml:"FILE_SET,omitempty"                xmp:"iXML:fileSet"`
	TrackList            TrackList               `xml:"TRACK_LIST,omitempty"              xmp:"iXML:trackList"`
	UserData             *UserData               `xml:"USER,omitempty"                    xmp:"iXML:userData"`
	Location             *Location               `xml:"LOCATION,omitempty"                xmp:"iXML:location"`
	Extension            xmp.NamedExtensionArray `xml:",any"                              xmp:"iXML:extension,any"`
}

func FindModel

func FindModel(d *xmp.Document) *IXML

func MakeModel

func MakeModel(d *xmp.Document) (*IXML, error)

func (*IXML) Can

func (m *IXML) Can(nsName string) bool

func (*IXML) CanTag

func (x *IXML) CanTag(tag string) bool

func (*IXML) GetTag

func (x *IXML) GetTag(tag string) (string, error)

func (*IXML) Namespaces

func (m *IXML) Namespaces() xmp.NamespaceList

func (*IXML) ParseXML

func (x *IXML) ParseXML(data []byte) error

func (*IXML) SetTag

func (x *IXML) SetTag(tag, value string) error

func (*IXML) SyncFromXMP

func (x *IXML) SyncFromXMP(d *xmp.Document) error

func (*IXML) SyncModel

func (x *IXML) SyncModel(d *xmp.Document) error

func (*IXML) SyncToXMP

func (x *IXML) SyncToXMP(d *xmp.Document) error

func (*IXML) UnmarshalText

func (x *IXML) UnmarshalText(data []byte) error

type Location

type Location struct {
	XMLName          xml.Name         `xml:"LOCATION"                     xmp:"-"`
	LocationName     string           `xml:"LOCATION_NAME,omitempty"      xmp:"iXML:locationName"`     //  Human readable description of location
	LocationGps      string           `xml:"LOCATION_GPS,omitempty"       xmp:"iXML:locationGps"`      //  47.756787, -123.729977
	LocationAltitude string           `xml:"LOCATION_ALTITUDE,omitempty"  xmp:"iXML:locationAltitude"` //
	LocationType     LocationTypeList `xml:"LOCATION_TYPE,omitempty"      xmp:"iXML:locationType"`     //  [dictionary]
	LocationTime     LocationTimeList `xml:"LOCATION_TIME,omitempty"      xmp:"iXML:locationTime"`     //  [dictionary]
}

type LocationTime

type LocationTime string

Location Time

const (
	LocationTimeSunrise   LocationTime = "SUNRISE"
	LocationTimeMorning   LocationTime = "MORNING"
	LocationTimeMidday    LocationTime = "MIDDAY"
	LocationTimeDay       LocationTime = "DAY"
	LocationTimeAfternoon LocationTime = "AFTERNOON"
	LocationTimeEvening   LocationTime = "EVENING"
	LocationTimeSunset    LocationTime = "SUNSET"
	LocationTimeNight     LocationTime = "NIGHT"
)

func ParseLocationTime

func ParseLocationTime(s string) LocationTime

allow future extensions

type LocationTimeList

type LocationTimeList []LocationTime

func (*LocationTimeList) Add

func (x *LocationTimeList) Add(t LocationTime)

func (LocationTimeList) Contains

func (x LocationTimeList) Contains(t LocationTime) bool

func (*LocationTimeList) Del

func (x *LocationTimeList) Del(t LocationTime)

func (LocationTimeList) MarshalText

func (x LocationTimeList) MarshalText() ([]byte, error)

func (*LocationTimeList) UnmarshalText

func (x *LocationTimeList) UnmarshalText(data []byte) error

type LocationType

type LocationType string

Location Type

const (
	LocationTypeInterior LocationType = "INT"
	LocationTypeExterior LocationType = "EXT"
)

func ParseLocationType

func ParseLocationType(s string) LocationType

allow future extensions

type LocationTypeList

type LocationTypeList []LocationType

func (*LocationTypeList) Add

func (x *LocationTypeList) Add(t LocationType)

func (LocationTypeList) Contains

func (x LocationTypeList) Contains(t LocationType) bool

func (*LocationTypeList) Del

func (x *LocationTypeList) Del(t LocationType)

func (LocationTypeList) MarshalText

func (x LocationTypeList) MarshalText() ([]byte, error)

func (*LocationTypeList) UnmarshalText

func (x *LocationTypeList) UnmarshalText(data []byte) error

type Speed

type Speed struct {
	XMLName                         xml.Name     `xml:"SPEED"                                          xmp:"-"`
	Note                            string       `xml:"NOTE,omitempty"                                 xmp:"iXML:note"`
	MasterSpeed                     xmp.Rational `xml:"MASTER_SPEED,omitempty"                         xmp:"iXML:masterSpeed"`
	CurrentSpeed                    xmp.Rational `xml:"CURRENT_SPEED,omitempty"                        xmp:"iXML:currentSpeed"`
	TimecodeRate                    xmp.Rational `xml:"TIMECODE_RATE,omitempty"                        xmp:"iXML:timecodeRate"`
	TimecodeFlag                    TimecodeFlag `xml:"TIMECODE_FLAG,omitempty"                        xmp:"iXML:timecodeFlag"`
	FileSampleRate                  xmp.Rational `xml:"FILE_SAMPLE_RATE,omitempty"                     xmp:"iXML:fileSampleRate"`
	AudioBitDepth                   int          `xml:"AUDIO_BIT_DEPTH,omitempty"                      xmp:"iXML:audioBitDepth"`
	DigitizerSampleRate             int          `xml:"DIGITIZER_SAMPLE_RATE,omitempty"                xmp:"iXML:digitizerSampleRate"`
	TimestampSamplesSinceMidnightHI int          `xml:"TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_HI,omitempty"  xmp:"iXML:timestampSamplesSinceMidnightHI"`
	TimestampSamplesSinceMidnightLO int          `xml:"TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO,omitempty"  xmp:"iXML:timestampSamplesSinceMidnightLO"`
	TimestampSampleRate             int          `xml:"TIMESTAMP_SAMPLE_RATE,omitempty"                xmp:"iXML:timestampSampleRate"`
}

func (Speed) XmpTimecode

func (x Speed) XmpTimecode() xmpdm.Timecode

type SyncPoint

type SyncPoint struct {
	XMLName       xml.Name              `xml:"SYNC_POINT"                            xmp:"-"`
	Type          SyncPointType         `xml:"SYNC_POINT_TYPE"                       xmp:"iXML:syncPointType"`
	Function      SyncPointFunctionType `xml:"SYNC_POINT_FUNCTION"                   xmp:"iXML:syncPointFunction"`
	Comment       string                `xml:"SYNC_POINT_COMMENT,omitempty"          xmp:"iXML:syncPointComment"`
	Low           int                   `xml:"SYNC_POINT_LOW,omitempty"              xmp:"iXML:syncPointLow"`
	High          int                   `xml:"SYNC_POINT_HIGH,omitempty"             xmp:"iXML:syncPointHigh"`
	EventDuration int64                 `xml:"SYNC_POINT_EVENT_DURATION,omitempty"   xmp:"iXML:syncPointEventDuration"`
}

type SyncPointFunctionType

type SyncPointFunctionType string
const (
	SyncPointPreRecordSamplecount SyncPointFunctionType = "PRE_RECORD_SAMPLECOUNT"
	SyncPointSlateGeneric         SyncPointFunctionType = "SLATE_GENERIC"
	SyncPointHeadSlate            SyncPointFunctionType = "HEAD_SLATE"
	SyncPointTailSlate            SyncPointFunctionType = "TAIL_SLATE"
	SyncPointMarkerGeneric        SyncPointFunctionType = "MARKER_GENERIC"
	SyncPointMarkerAutoplay       SyncPointFunctionType = "MARKER_AUTOPLAY"
	SyncPointMarkerAutoplayStop   SyncPointFunctionType = "MARKER_AUTOPLAYSTOP"
	SyncPointMarkerAutoplayLoop   SyncPointFunctionType = "MARKER_AUTOPLAYLOOP"
	SyncPointGroupOffset          SyncPointFunctionType = "GROUP_OFFSET"
)

type SyncPointList

type SyncPointList []SyncPoint

func (SyncPointList) ContainsFunc

func (x SyncPointList) ContainsFunc(f SyncPointFunctionType) (int, bool)

func (SyncPointList) MarshalXML

func (x SyncPointList) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (SyncPointList) MarshalXMP

func (x SyncPointList) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (SyncPointList) Typ

func (x SyncPointList) Typ() xmp.ArrayType

func (*SyncPointList) UnmarshalXML

func (x *SyncPointList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*SyncPointList) UnmarshalXMP

func (x *SyncPointList) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type SyncPointType

type SyncPointType string
const (
	SyncPointRelative SyncPointType = "RELATIVE"
	SyncPointAbsolute SyncPointType = "ABSOLUTE"
)

type TakeType

type TakeType string
const (
	TakeTypeDefault      TakeType = "DEFAULT"
	TakeTypeNoGood       TakeType = "NO_GOOD"
	TakeTypeFalseStart   TakeType = "FALSE_START"
	TakeTypeWildTrack    TakeType = "WILD_TRACK"
	TakeTypePickup       TakeType = "PICKUP"
	TakeTypeRehearsal    TakeType = "REHEARSAL"
	TakeTypeAnnouncement TakeType = "ANNOUNCEMENT"
	TakeTypeSoundGuide   TakeType = "SOUND_GUIDE"
)

func ParseTakeType

func ParseTakeType(s string) TakeType

allow future extensions

type TakeTypeList

type TakeTypeList []TakeType

func (*TakeTypeList) Add

func (x *TakeTypeList) Add(t TakeType)

func (TakeTypeList) Contains

func (x TakeTypeList) Contains(t TakeType) bool

func (*TakeTypeList) Del

func (x *TakeTypeList) Del(t TakeType)

func (TakeTypeList) IsDefault

func (x TakeTypeList) IsDefault() bool

func (TakeTypeList) MarshalText

func (x TakeTypeList) MarshalText() ([]byte, error)

func (*TakeTypeList) UnmarshalText

func (x *TakeTypeList) UnmarshalText(data []byte) error

type TimecodeFlag

type TimecodeFlag string
const (
	TimecodeFlagInvalid TimecodeFlag = ""
	TimecodeFlagDF      TimecodeFlag = "DF"
	TimecodeFlagNDF     TimecodeFlag = "NDF"
)

func ParseTimecodeFlag

func ParseTimecodeFlag(s string) TimecodeFlag

func (*TimecodeFlag) UnmarshalText

func (x *TimecodeFlag) UnmarshalText(data []byte) error

type Track

type Track struct {
	XMLName         xml.Name     `xml:"TRACK"                       xmp:"-"`
	ChannelIndex    int          `xml:"CHANNEL_INDEX,omitempty"     xmp:"iXML:channelIndex"`
	InterleaveIndex int          `xml:"INTERLEAVE_INDEX,omitempty"  xmp:"iXML:interleaveIndex"`
	Name            string       `xml:"NAME,omitempty"              xmp:"iXML:name"`
	Function        FunctionType `xml:"FUNCTION,omitempty"          xmp:"iXML:function"`
	DefaultMix      DefaultMix   `xml:"DEFAULT_MIX,omitempty"       xmp:"iXML:defaultMix"`
}

type TrackList

type TrackList []Track

func (TrackList) MarshalXML

func (x TrackList) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (TrackList) MarshalXMP

func (x TrackList) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (TrackList) Typ

func (x TrackList) Typ() xmp.ArrayType

func (*TrackList) UnmarshalXML

func (x *TrackList) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*TrackList) UnmarshalXMP

func (x *TrackList) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type UserData

type UserData struct {
	XMLName                   xml.Name `xml:"USER"                                    xmp:"-"`
	Comment                   string   `xml:",chardata"                               xmp:"iXML:comment"`
	FullTitle                 string   `xml:"FULL_TITLE,omitempty"                    xmp:"iXML:fullTitle"`
	DirectorName              string   `xml:"DIRECTOR_NAME,omitempty"                 xmp:"iXML:directorName"`
	ProductionName            string   `xml:"PRODUCTION_NAME,omitempty"               xmp:"iXML:productionName"`
	ProductionAddress         string   `xml:"PRODUCTION_ADDRESS,omitempty"            xmp:"iXML:productionAddress"`
	ProductionEmail           string   `xml:"PRODUCTION_EMAIL,omitempty"              xmp:"iXML:productionEmail"`
	ProductionPhone           string   `xml:"PRODUCTION_PHONE,omitempty"              xmp:"iXML:productionPhone"`
	ProductionNote            string   `xml:"PRODUCTION_NOTE,omitempty"               xmp:"iXML:productionNote"`
	SoundMixerName            string   `xml:"SOUND_MIXER_NAME,omitempty"              xmp:"iXML:soundMixerName"`
	SoundMixerAddress         string   `xml:"SOUND_MIXER_ADDRESS,omitempty"           xmp:"iXML:soundMixerAddress"`
	SoundMixerEmail           string   `xml:"SOUND_MIXER_EMAIL,omitempty"             xmp:"iXML:soundMixerEmail"`
	SoundMixerPhone           string   `xml:"SOUND_MIXER_PHONE,omitempty"             xmp:"iXML:soundMixerPhone"`
	SoundMixerNote            string   `xml:"SOUND_MIXER_NOTE,omitempty"              xmp:"iXML:soundMixerNote"`
	AudioRecorderModel        string   `xml:"AUDIO_RECORDER_MODEL,omitempty"          xmp:"iXML:audioRecorderModel"`
	AudioRecorderSerialNumber string   `xml:"AUDIO_RECORDER_SERIAL_NUMBER,omitempty"  xmp:"iXML:audioRecorderSerialNumber"`
	AudioRecorderFirmware     string   `xml:"AUDIO_RECORDER_FIRMWARE,omitempty"       xmp:"iXML:audioRecorderFirmware"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL