media

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package media contains low-level media accessors and modifier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioBlockGetter

type AudioBlockGetter interface {
	ModifiedBlock(lang resource.Language, id resource.ID, index int) []byte
}

AudioBlockGetter provides raw data of blocks.

type AudioBlockSetter

type AudioBlockSetter interface {
	SetResourceBlocks(lang resource.Language, id resource.ID, data [][]byte)
	DelResource(lang resource.Language, id resource.ID)
}

AudioBlockSetter modifies storage of raw resource data.

type AudioSetterService

type AudioSetterService struct{}

AudioSetterService provides methods to change audio resources.

func NewAudioSetterService

func NewAudioSetterService() AudioSetterService

NewAudioSetterService returns a new instance.

func (AudioSetterService) Clear

func (service AudioSetterService) Clear(setter AudioBlockSetter, key resource.Key)

Clear resets the identified audio resource to a silent one-sample audio.

func (AudioSetterService) Remove

func (service AudioSetterService) Remove(setter AudioBlockSetter, key resource.Key)

Remove deletes any audio resource for given key.

func (AudioSetterService) Set

func (service AudioSetterService) Set(setter AudioBlockSetter, key resource.Key, sound audio.L8)

Set stores the given sound as the identified resource.

type AudioViewerService

type AudioViewerService struct {
	// contains filtered or unexported fields
}

AudioViewerService provides read-only access to audio resources.

func NewAudioViewerService

func NewAudioViewerService(movieCache *movie.Cache, getter AudioBlockGetter) AudioViewerService

NewAudioViewerService returns a new instance.

func (AudioViewerService) Audio

func (service AudioViewerService) Audio(key resource.Key) audio.L8

Audio returns the sound data associated with the given key.

func (AudioViewerService) Modified

func (service AudioViewerService) Modified(key resource.Key) bool

Modified returns true if the identified audio resource is marked as modified.

type MovieBlockGetter

type MovieBlockGetter interface {
	ModifiedBlock(lang resource.Language, id resource.ID, index int) []byte
}

MovieBlockGetter provides raw data of blocks.

type MovieBlockSetter

type MovieBlockSetter interface {
	SetResourceBlocks(lang resource.Language, id resource.ID, data [][]byte)
	DelResource(lang resource.Language, id resource.ID)
}

MovieBlockSetter modifies storage of raw resource data.

type MovieSetterService

type MovieSetterService struct {
	// contains filtered or unexported fields
}

MovieSetterService can be used to set movie data.

func NewMovieSetterService

func NewMovieSetterService(cp text.Codepage) MovieSetterService

NewMovieSetterService returns a new instance.

func (MovieSetterService) Remove

func (service MovieSetterService) Remove(setter MovieBlockSetter, key resource.Key)

Remove deletes any movie resource for given key.

func (MovieSetterService) Set

func (service MovieSetterService) Set(setter MovieBlockSetter, key resource.Key, container movie.Container)

Set exports the given container.

type MovieViewerService

type MovieViewerService struct {
	// contains filtered or unexported fields
}

MovieViewerService provides read-only access to movie resources.

func NewMovieViewerService

func NewMovieViewerService(movieCache *movie.Cache, getter MovieBlockGetter) MovieViewerService

NewMovieViewerService returns a new instance.

func (MovieViewerService) Audio

func (service MovieViewerService) Audio(key resource.Key) audio.L8

Audio returns the audio data associated with the given key.

func (MovieViewerService) Container

func (service MovieViewerService) Container(key resource.Key) (movie.Container, error)

Container returns the base container of the movie.

func (MovieViewerService) Modified

func (service MovieViewerService) Modified(key resource.Key) bool

Modified returns true if the identified text resource is marked as modified.

func (MovieViewerService) SizeWarning

func (service MovieViewerService) SizeWarning(key resource.Key) bool

SizeWarning returns true if the given movie is larger than the underlying archive would support.

func (MovieViewerService) Subtitles

func (service MovieViewerService) Subtitles(key resource.Key, language resource.Language) movie.SubtitleList

Subtitles returns the subtitles associated with the given key.

func (MovieViewerService) Video

func (service MovieViewerService) Video(key resource.Key) []movie.Scene

Video returns the visual component associated with the given key.

type SoundEffectBlockGetter

type SoundEffectBlockGetter interface {
	ModifiedBlock(lang resource.Language, id resource.ID, index int) []byte
}

SoundEffectBlockGetter provides raw data of blocks.

type SoundEffectBlockSetter

type SoundEffectBlockSetter interface {
	SetResourceBlocks(lang resource.Language, id resource.ID, data [][]byte)
	DelResource(lang resource.Language, id resource.ID)
}

SoundEffectBlockSetter modifies storage of raw resource data.

type SoundEffectSetterService

type SoundEffectSetterService struct{}

SoundEffectSetterService provides methods to change sound resources.

func NewSoundSetterService

func NewSoundSetterService() SoundEffectSetterService

NewSoundSetterService returns a new instance.

func (SoundEffectSetterService) Clear

func (service SoundEffectSetterService) Clear(setter SoundEffectBlockSetter, key resource.Key)

Clear resets the identified audio resource to a silent one-sample audio.

func (SoundEffectSetterService) Remove

func (service SoundEffectSetterService) Remove(setter SoundEffectBlockSetter, key resource.Key)

Remove deletes any audio resource for given key.

func (SoundEffectSetterService) Set

func (service SoundEffectSetterService) Set(setter SoundEffectBlockSetter, key resource.Key, data audio.L8)

Set stores the given sound as the identified resource.

type SoundEffectViewerService

type SoundEffectViewerService struct {
	// contains filtered or unexported fields
}

SoundEffectViewerService provides read-only access to audio resources.

func NewSoundViewerService

func NewSoundViewerService(soundCache *sound.EffectCache, getter SoundEffectBlockGetter) SoundEffectViewerService

NewSoundViewerService returns a new instance.

func (SoundEffectViewerService) Audio

func (service SoundEffectViewerService) Audio(key resource.Key) audio.L8

Audio returns the audio data associated with the given key.

func (SoundEffectViewerService) Modified

func (service SoundEffectViewerService) Modified(key resource.Key) bool

Modified returns true if the identified sound resource is marked as modified.

type TextBlockGetter

type TextBlockGetter interface {
	ModifiedBlock(lang resource.Language, id resource.ID, index int) []byte
	ModifiedBlocks(lang resource.Language, id resource.ID) [][]byte
}

TextBlockGetter provides raw data of blocks.

type TextBlockSetter

type TextBlockSetter interface {
	SetResourceBlock(lang resource.Language, id resource.ID, index int, data []byte)
	SetResourceBlocks(lang resource.Language, id resource.ID, data [][]byte)
	DelResource(lang resource.Language, id resource.ID)
}

TextBlockSetter modifies storage of raw resource data.

type TextSetterService

type TextSetterService struct {
	// contains filtered or unexported fields
}

TextSetterService provides methods to change text resources.

func NewTextSetterService

func NewTextSetterService(cp text.Codepage) TextSetterService

NewTextSetterService returns a new instance.

func (TextSetterService) Clear

func (service TextSetterService) Clear(setter TextBlockSetter, key resource.Key)

Clear resets the identified text resource to an empty string.

func (TextSetterService) Remove

func (service TextSetterService) Remove(setter TextBlockSetter, key resource.Key)

Remove deletes any text resource for given key.

func (TextSetterService) Set

func (service TextSetterService) Set(setter TextBlockSetter, key resource.Key, value string)

Set stores the given text as the identified resource.

type TextViewerService

type TextViewerService struct {
	// contains filtered or unexported fields
}

TextViewerService provides read-only access to text resources.

func NewTextViewerService

func NewTextViewerService(lineCache, pageCache *text.Cache, getter TextBlockGetter) TextViewerService

NewTextViewerService returns a new instance.

func (TextViewerService) Modified

func (service TextViewerService) Modified(key resource.Key) bool

Modified returns true if the identified text resource is marked as modified.

func (TextViewerService) Text

func (service TextViewerService) Text(key resource.Key) string

Text returns the text data associated with the given key.

Jump to

Keyboard shortcuts

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