autoeq

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package autoeq is a generated GoMock package.

Package autoeq is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ErrBadPreampFormat = errors.New("bad preamp line format")

ErrBadPreampFormat is returned when the preamp line can't be parsed.

Functions

This section is empty.

Types

type Doer

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

Doer defines the behavior of a component capable of doing an HTTP request, returning an HTTP response and an error.

type EQGetter

type EQGetter interface {
	GetEQ(meta *EQMetadata) ([]byte, error)
	GetFixedBandGlobalPreamp(meta *EQMetadata) (float64, error)
}

EQGetter defines the behavior of a component capable of retrieving EQ information.

type EQHTTPGetter

type EQHTTPGetter struct {
	Client Doer
}

EQHTTPGetter is an HTTP based implementation of an EQGetter.

func (EQHTTPGetter) GetEQ

func (g EQHTTPGetter) GetEQ(meta *EQMetadata) ([]byte, error)

GetEQ returns the raw bytes that represent the EQ described by the input EQ metadata. Returns an error if any.

func (EQHTTPGetter) GetFixedBandGlobalPreamp

func (g EQHTTPGetter) GetFixedBandGlobalPreamp(meta *EQMetadata) (float64, error)

GetFixedBandGlobalPreamp returns the global preamp value in dB for the input EQ. Returns an error if any.

type EQMetadata

type EQMetadata struct {
	ID     string
	Name   string
	Author string
	Link   string
	// Deprecated: this field has been deprecated in favor of autoeq.FixedBandEQ.Preamp.
	Global float64
}

EQMetadata represents EQ metadata.

type FixedBandEQ

type FixedBandEQ struct {
	Filters []*FixedBandFilter
	Preamp  float64
}

FixedBandEQ represents a simple fixed bands EQ.

func ToFixedBandEQs

func ToFixedBandEQs(data []byte) (*FixedBandEQ, error)

ToFixedBandEQs transforms the raw EQ data into a fixed band EQ. Returns an error if any.

type FixedBandFilter added in v0.1.6

type FixedBandFilter struct {
	Frequency int     // Hz
	Gain      float64 // dB
	Q         float64 // fixed
}

FixedBandFilter represents a single EQ band.

type MarkDownParser

type MarkDownParser interface {
	ParseMetadata([]byte) ([]*EQMetadata, error)
}

MarkDownParser defines the behavior of a component capable of parsing raw bytes containing MarkDown text.

type MetadataParser

type MetadataParser struct {
	LinkPrefix        string
	FixedBandEQSuffix string
}

MetadataParser is an implementation of a MarkDownParser that parses MarkDown coming from GitHub.

func NewMetadataParser

func NewMetadataParser() MetadataParser

NewMetadataParser returns a MetadataParser with populated fields.

func (MetadataParser) ParseMetadata

func (p MetadataParser) ParseMetadata(data []byte) ([]*EQMetadata, error)

ParseMetadata returns a slice of EQ metadata parsed from the input raw bytes. Returns an error if any.

type MockDoer

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

MockDoer is a mock of Doer interface

func NewMockDoer

func NewMockDoer(ctrl *gomock.Controller) *MockDoer

NewMockDoer creates a new mock instance

func (*MockDoer) Do

func (m *MockDoer) Do(arg0 *http.Request) (*http.Response, error)

Do mocks base method

func (*MockDoer) EXPECT

func (m *MockDoer) EXPECT() *MockDoerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

type MockDoerMockRecorder

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

MockDoerMockRecorder is the mock recorder for MockDoer

func (*MockDoerMockRecorder) Do

func (mr *MockDoerMockRecorder) Do(arg0 interface{}) *gomock.Call

Do indicates an expected call of Do

type MockEQGetter

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

MockEQGetter is a mock of EQGetter interface

func NewMockEQGetter

func NewMockEQGetter(ctrl *gomock.Controller) *MockEQGetter

NewMockEQGetter creates a new mock instance

func (*MockEQGetter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockEQGetter) GetEQ

func (m *MockEQGetter) GetEQ(meta EQMetadata) ([]byte, error)

GetEQ mocks base method

func (*MockEQGetter) GetFixedBandGlobalPreamp

func (m *MockEQGetter) GetFixedBandGlobalPreamp(meta EQMetadata) (float64, error)

GetFixedBandGlobalPreamp mocks base method

type MockEQGetterMockRecorder

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

MockEQGetterMockRecorder is the mock recorder for MockEQGetter

func (*MockEQGetterMockRecorder) GetEQ

func (mr *MockEQGetterMockRecorder) GetEQ(meta interface{}) *gomock.Call

GetEQ indicates an expected call of GetEQ

func (*MockEQGetterMockRecorder) GetFixedBandGlobalPreamp

func (mr *MockEQGetterMockRecorder) GetFixedBandGlobalPreamp(meta interface{}) *gomock.Call

GetFixedBandGlobalPreamp indicates an expected call of GetFixedBandGlobalPreamp

type MockMarkDownParser

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

MockMarkDownParser is a mock of MarkDownParser interface

func NewMockMarkDownParser

func NewMockMarkDownParser(ctrl *gomock.Controller) *MockMarkDownParser

NewMockMarkDownParser creates a new mock instance

func (*MockMarkDownParser) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockMarkDownParser) ParseMetadata

func (m *MockMarkDownParser) ParseMetadata(arg0 []byte) ([]EQMetadata, error)

ParseMetadata mocks base method

type MockMarkDownParserMockRecorder

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

MockMarkDownParserMockRecorder is the mock recorder for MockMarkDownParser

func (*MockMarkDownParserMockRecorder) ParseMetadata

func (mr *MockMarkDownParserMockRecorder) ParseMetadata(arg0 interface{}) *gomock.Call

ParseMetadata indicates an expected call of ParseMetadata

Jump to

Keyboard shortcuts

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