chunk

package
Version: v2.0.0-pre1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk interface {
	fmt.Stringer
	Read(io.Reader) error
	Traverse(func(Chunk))
}

type ChunkHeader

type ChunkHeader struct {
	Signature Signature `json:"signature"`
	Size      uint32    `json:"-"`
}

func (*ChunkHeader) CreateChunk

func (hdr *ChunkHeader) CreateChunk(rdr io.Reader, formatType enums.ScoreTrackFormatType) (Chunk, error)

func (*ChunkHeader) Read

func (hdr *ChunkHeader) Read(rdr io.Reader, rest *int) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*ChunkHeader) String

func (hdr *ChunkHeader) String() string

type CollectedExclusives

type CollectedExclusives struct {
	Exclusives []*subtypes.Exclusive `json:"voices"`
}

func (*CollectedExclusives) String

func (v *CollectedExclusives) String() string

func (*CollectedExclusives) Voices

func (v *CollectedExclusives) Voices() *CollectedVoices

type CollectedVoices

type CollectedVoices struct {
	Voices []*voice.VM35FMVoice `json:"voices"`
}

func (*CollectedVoices) String

func (v *CollectedVoices) String() string

type ContentsInfoChunk

type ContentsInfoChunk struct {
	*ChunkHeader
	Header struct {
		ContentsClass    uint8 `json:"contents_class"`
		ContentsType     uint8 `json:"contents_type"`
		ContentsCodeType uint8 `json:"contents_code_type"`
		CopyStatus       uint8 `json:"copy_status"`
		CopyCounts       uint8 `json:"copy_counts"`
	} `json:"header"`
	Stream     []uint8 `json:"stream"`
	HasOptions bool    `json:"has_options"`
	Options    struct {
		Vendor          string `json:"vendor,omitempty"`
		Carrier         string `json:"carrier,omitempty"`
		Category        string `json:"category,omitempty"`
		Title           string `json:"title,omitempty"`
		Artist          string `json:"artist,omitempty"`
		LyricWriter     string `json:"lyric_writer,omitempty"`
		Composer        string `json:"composer,omitempty"`
		Arranger        string `json:"arranger,omitempty"`
		Copyright       string `json:"copyright,omitempty"`
		ManagementGroup string `json:"management_group,omitempty"`
		ManagementInfo  string `json:"management_info,omitempty"`
		CreatedDate     string `json:"created_date,omitempty"`
		UpdatedDate     string `json:"updated_date,omitempty"`
	} `json:"options,omitempty"`
}

func (*ContentsInfoChunk) Read

func (c *ContentsInfoChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*ContentsInfoChunk) String

func (c *ContentsInfoChunk) String() string

func (*ContentsInfoChunk) Traverse

func (c *ContentsInfoChunk) Traverse(fn func(Chunk))

type DataChunk

type DataChunk struct {
	*ChunkHeader
	Stream     []uint8 `json:"stream"`
	HasOptions bool    `json:"has_options"`
	Options    struct {
		Vendor          string `json:"vendor,omitempty"`
		Carrier         string `json:"carrier,omitempty"`
		Category        string `json:"category,omitempty"`
		Title           string `json:"title,omitempty"`
		Artist          string `json:"artist,omitempty"`
		LyricWriter     string `json:"lyric_writer,omitempty"`
		Composer        string `json:"composer,omitempty"`
		Arranger        string `json:"arranger,omitempty"`
		Copyright       string `json:"copyright,omitempty"`
		ManagementGroup string `json:"management_group,omitempty"`
		ManagementInfo  string `json:"management_info,omitempty"`
		CreatedDate     string `json:"created_date,omitempty"`
		UpdatedDate     string `json:"updated_date,omitempty"`
		EditStatus      string `json:"edit_status,omitempty"`
		VCard           string `json:"vcard,omitempty"`
	} `json:"options,omitempty"`
}

func (*DataChunk) CodeType

func (c *DataChunk) CodeType() int

func (*DataChunk) Read

func (c *DataChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*DataChunk) String

func (c *DataChunk) String() string

func (*DataChunk) Traverse

func (c *DataChunk) Traverse(fn func(Chunk))

type ExclusiveContainer

type ExclusiveContainer interface {
	GetExclusives() []*subtypes.Exclusive
}

type FileChunk

type FileChunk struct {
	*ChunkHeader
	SubChunks []Chunk `json:"sub_chunks"`
	CRCGot    uint16  `json:"-"`
	CRCWant   uint16  `json:"-"`
}

func NewFileChunk

func NewFileChunk(file string) (*FileChunk, error)

NewFileChunk は、新しい FileChunk を作成します。

func (*FileChunk) CollectExclusives

func (c *FileChunk) CollectExclusives() *CollectedExclusives

func (*FileChunk) Read

func (c *FileChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*FileChunk) String

func (c *FileChunk) String() string

func (*FileChunk) Traverse

func (c *FileChunk) Traverse(fn func(Chunk))

type MMMGChunk

type MMMGChunk struct {
	*ChunkHeader
	Enigma    uint16  `json:"-"`
	SubChunks []Chunk `json:"sub_chunks"`
}

func (*MMMGChunk) Read

func (c *MMMGChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*MMMGChunk) String

func (c *MMMGChunk) String() string

func (*MMMGChunk) Traverse

func (c *MMMGChunk) Traverse(fn func(Chunk))

type MMMGEXVOChunk

type MMMGEXVOChunk struct {
	*ChunkHeader
	Stream    []uint8             `json:"stream"`
	Exclusive *subtypes.Exclusive `json:"exclusive"`
}

func (*MMMGEXVOChunk) Read

func (c *MMMGEXVOChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*MMMGEXVOChunk) String

func (c *MMMGEXVOChunk) String() string

func (*MMMGEXVOChunk) Traverse

func (c *MMMGEXVOChunk) Traverse(fn func(Chunk))

type MMMGVoiceChunk

type MMMGVoiceChunk struct {
	*ChunkHeader
	SubChunks []Chunk `json:"sub_chunks"`
}

func (*MMMGVoiceChunk) GetExclusives

func (c *MMMGVoiceChunk) GetExclusives() []*subtypes.Exclusive

func (*MMMGVoiceChunk) Read

func (c *MMMGVoiceChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*MMMGVoiceChunk) String

func (c *MMMGVoiceChunk) String() string

func (*MMMGVoiceChunk) Traverse

func (c *MMMGVoiceChunk) Traverse(fn func(Chunk))

type OptionalDataChunk

type OptionalDataChunk struct {
	*ChunkHeader
	SubChunks []Chunk `json:"sub_chunks"`
}

func (*OptionalDataChunk) Read

func (c *OptionalDataChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*OptionalDataChunk) String

func (c *OptionalDataChunk) String() string

func (*OptionalDataChunk) Traverse

func (c *OptionalDataChunk) Traverse(fn func(Chunk))

type ScoreTrackChunk

type ScoreTrackChunk struct {
	*ChunkHeader     `json:"chunk_header"`
	FormatType       enums.ScoreTrackFormatType                `json:"format_type"`
	SequenceType     enums.ScoreTrackSequenceType              `json:"sequence_type"`
	DurationTimeBase int                                       `json:"duration_time_base"`
	GateTimeBase     int                                       `json:"gate_time_base"`
	ChannelStatus    map[enums.Channel]*subtypes.ChannelStatus `json:"channel_status"`
	SubChunks        []Chunk                                   `json:"sub_chunks"`
}

func (*ScoreTrackChunk) Read

func (c *ScoreTrackChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*ScoreTrackChunk) String

func (c *ScoreTrackChunk) String() string

func (*ScoreTrackChunk) Traverse

func (c *ScoreTrackChunk) Traverse(fn func(Chunk))

type ScoreTrackSequenceDataChunk

type ScoreTrackSequenceDataChunk struct {
	*ChunkHeader      `json:"chunk_header"`
	FormatType        enums.ScoreTrackFormatType           `json:"format_type"`
	Events            []event.DurationEventPair            `json:"events"`
	IsChannelUsed     map[enums.Channel]bool               `json:"-"`
	UsedChannelCount  int                                  `json:"-"`
	UsedNoteCount     map[enums.Channel]int                `json:"-"`
	NoteToChannel     map[enums.Channel]map[enums.Note]int `json:"-"`
	ChannelToChannels map[enums.Channel][]int              `json:"-"`
	UsedPC            map[uint32]bool                      `json:"-"`
	IgnoredPC         map[uint32]bool                      `json:"-"`
}

func (*ScoreTrackSequenceDataChunk) AggregateUsage

func (c *ScoreTrackSequenceDataChunk) AggregateUsage(channelsToSplit []enums.Channel)

func (*ScoreTrackSequenceDataChunk) ChannelTo

func (c *ScoreTrackSequenceDataChunk) ChannelTo(orgCh enums.Channel, note enums.Note) int

func (*ScoreTrackSequenceDataChunk) ChannelsTo

func (c *ScoreTrackSequenceDataChunk) ChannelsTo(orgCh enums.Channel) []int

func (*ScoreTrackSequenceDataChunk) IsIgnoredPC

func (c *ScoreTrackSequenceDataChunk) IsIgnoredPC(bankMSB, bankLSB, PC int, drumNote enums.Note) bool

func (*ScoreTrackSequenceDataChunk) Read

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*ScoreTrackSequenceDataChunk) String

func (c *ScoreTrackSequenceDataChunk) String() string

func (*ScoreTrackSequenceDataChunk) Traverse

func (c *ScoreTrackSequenceDataChunk) Traverse(fn func(Chunk))

type ScoreTrackSetupDataChunk

type ScoreTrackSetupDataChunk struct {
	*ChunkHeader  `json:"chunk_header"`
	Exclusives    []*subtypes.Exclusive `json:"exclusives"`
	UnknownStream []uint8               `json:"unknown_stream,omitempty"`
}

func (*ScoreTrackSetupDataChunk) GetExclusives

func (c *ScoreTrackSetupDataChunk) GetExclusives() []*subtypes.Exclusive

func (*ScoreTrackSetupDataChunk) Read

func (c *ScoreTrackSetupDataChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*ScoreTrackSetupDataChunk) String

func (c *ScoreTrackSetupDataChunk) String() string

func (*ScoreTrackSetupDataChunk) Traverse

func (c *ScoreTrackSetupDataChunk) Traverse(fn func(Chunk))

type SeekPhraseInfoChunk

type SeekPhraseInfoChunk struct {
	*ChunkHeader
	Stream []uint8 `json:"stream"`
}

func (*SeekPhraseInfoChunk) Read

func (c *SeekPhraseInfoChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*SeekPhraseInfoChunk) String

func (c *SeekPhraseInfoChunk) String() string

func (*SeekPhraseInfoChunk) Traverse

func (c *SeekPhraseInfoChunk) Traverse(fn func(Chunk))

type Signature

type Signature uint32

func (Signature) MarshalJSON

func (s Signature) MarshalJSON() ([]byte, error)

func (Signature) String

func (s Signature) String() string

type UnknownChunk

type UnknownChunk struct {
	*ChunkHeader
	Stream []uint8 `json:"stream"`
}

func (*UnknownChunk) Read

func (c *UnknownChunk) Read(rdr io.Reader) error

Read は、バイト列を読み取ってパースした結果をこの構造体に格納します。

func (*UnknownChunk) String

func (c *UnknownChunk) String() string

func (*UnknownChunk) Traverse

func (c *UnknownChunk) Traverse(fn func(Chunk))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL