Documentation ¶
Index ¶
- Variables
- func GetKind(lk LabelKind) string
- func Mapkey(m map[string]LabelKind, value LabelKind) (key string, ok bool)
- func StandardOpener(opener int, windowSize int) int
- type Account
- type AccountQuality
- type Benchmark
- type Clip
- type ClipSelection
- type ClipWindow
- type Label
- type LabelKind
- type Playlist
- type PlaylistNumber
- type RecordingLabel
- func (lbl *RecordingLabel) GetFK() (string, string)
- func (lbl *RecordingLabel) GetID() (string, string)
- func (lbl *RecordingLabel) GetKind() string
- func (lbl *RecordingLabel) GetLiteral() interface{}
- func (lbl *RecordingLabel) GetValue() string
- func (lbl *RecordingLabel) Limits() (float64, float64)
- func (lbl *RecordingLabel) SetCreated()
- func (lbl *RecordingLabel) SetDisplay(disp string)
- func (lbl *RecordingLabel) SetKind(kind LabelKind)
- func (lbl *RecordingLabel) SetUpdated()
- func (lbl *RecordingLabel) TableName() (string, error)
- type RecordingLabelsTree
- type SelectionRetriever
- type Spectrogram
- type StepErr
- type Template
- type TemplateLabel
- func (lbl *TemplateLabel) GetFK() (string, string)
- func (lbl *TemplateLabel) GetID() (string, string)
- func (lbl *TemplateLabel) GetKind() string
- func (lbl *TemplateLabel) GetLiteral() interface{}
- func (lbl *TemplateLabel) GetValue() string
- func (lbl *TemplateLabel) SetCreated()
- func (lbl *TemplateLabel) SetDisplay(disp string)
- func (lbl *TemplateLabel) SetKind(kind LabelKind)
- func (lbl *TemplateLabel) SetUpdated()
- func (lbl *TemplateLabel) TableName() (string, error)
- type TemplateNumber
- type Templates
Constants ¶
This section is empty.
Variables ¶
var KindValue = map[string]LabelKind{
"UNDEFINED": 0,
"MOODS": 1,
"INSTRUMENTS": 2,
"GENRES": 3,
"INSTRUCTIONS": 4,
}
KindValue maps types and enum ints
Functions ¶
func GetKind ¶
GetKind returns the label kind as lowercase string and plural
func Mapkey ¶
Mapkey get a key from value
Types ¶
type Account ¶
type Account struct { AccountID string `json:"account_id" gorm:"primary_key;column:account_id"` Email string `json:"email"` Username string `json:"username"` Password string `json:"password,omitempty"` // must exist for bcrypt Verified bool `json:"-"` Temporary bool `json:"temp" gorm:"-"` Role string `json:"-"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` LabelQuality float64 `json:"-"` }
Account is a single user
type AccountQuality ¶
AccountQuality maps a string to benchmark quality value
type Benchmark ¶
type Benchmark map[string]RecordingLabelsTree
Benchmark represents a group of benchmarks by mapping a recording ID to an interval tree
type Clip ¶
type Clip struct { ClipID string `json:"clip_id" gorm:"primary_key;column:clip_id"` AccountID *string `json:"account_id" gorm:"column:account_id"` // pointer to allow null RecordingID string `json:"recording_id" gorm:"foreignkey:recording_id;association_foreignkey:recording_id;column:recording_id"` Opener int `json:"opener"` Closer int `json:"closer"` Duration int `json:"duration"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` Labels []RecordingLabel `json:"labels"` Windows []ClipWindow `json:"windows" gorm:"-"` }
Clip object is a partial or complete section of a specific recording.
func NewClipFrom ¶
NewClipFrom returns a new Clip using inputs from another
type ClipSelection ¶
type ClipSelection struct {
Selection []*string `json:"-" gorm:"-"`
}
ClipSelection contains possible clip options
type ClipWindow ¶
type ClipWindow struct { Opener int `json:"opener"` Closer int `json:"closer"` Labels []Label `json:"labels"` }
ClipWindow describes a window of labels
type Label ¶
type Label interface { GetValue() string GetKind() string TableName() (string, error) GetID() (string, string) GetFK() (string, string) GetLiteral() interface{} SetDisplay(string) SetKind(LabelKind) SetCreated() SetUpdated() }
Label defines the generic label interface
type Playlist ¶
type Playlist struct { PlaylistID string `json:"playlist_id" gorm:"primary_key;column:playlist_id"` TemplateID string `json:"template_id" gorm:"column:template_id"` AccountID string `json:"-" gorm:"column:account_id"` Name string `json:"name"` Tagline string `json:"tagline"` Created time.Time `json:"-"` Createz string `json:"-"` Updated time.Time `json:"-"` Updatez string `json:"-"` Ready bool `json:"-"` Status string `json:"-"` Unique bool `json:"-"` Numbers []PlaylistNumber `json:"numbers" gorm:"foreignkey:playlist_id;association_foreignkey:playlist_id"` Template *Template `json:"-" gorm:"-"` Set map[string]int `json:"-" gorm:"-"` TotalSet int `json:"-" gorm:"-"` }
Playlist is a playlist
func NewPlaylistFrom ¶
NewPlaylistFrom returns a new Playlist using inputs from another
func NewPlaylistFromTemplate ¶
NewPlaylistFromTemplate returns a new playlist based on a template
func (Playlist) GetError ¶
GetError gets the error for simulated annealing
func (Playlist) Print ¶
Print displays playlist error information
func (*Playlist) SetPlaylistNumber ¶
SetPlaylistNumber sets a playlist number
type PlaylistNumber ¶
type PlaylistNumber struct { PlaylistID string `json:"-" gorm:"primary_key;column:playlist_id"` Name string `json:"name" gorm:"-"` Artist string `json:"artist" gorm:"-"` Number int `json:"number" gorm:"primary_key"` Duration int `json:"duration" gorm:"-"` Tagline string `json:"tagline"` ClipID string `json:"clip_id" gorm:"column:clip_id"` Clip Clip `json:"-" gorm:"foreignkey:clip_id;association_foreignkey:clip_id"` }
PlaylistNumber is a track number in a playlist
func (*PlaylistNumber) GetError ¶
func (pln *PlaylistNumber) GetError(tpln *TemplateNumber) float64
GetError gets the error
func (*PlaylistNumber) TableName ¶
func (pln *PlaylistNumber) TableName() string
TableName sets the Gorm table name
type RecordingLabel ¶
type RecordingLabel struct { ID string `json:"id" gorm:"primary_key" sql:"AUTO_INCREMENT"` Node int `json:"-" gorm:"column:node"` Opener int `json:"opener"` Closer int `json:"closer"` RecordingID string `json:"recording_id" gorm:"column:recording_id"` AccountID *string `json:"account_id" gorm:"column:account_id"` Kind LabelKind `json:"kind" gorm:"-"` Display string `json:"display" gorm:"-"` Value string `json:"value"` Present string `json:"present"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` }
RecordingLabel describes a section of a clip.
func NewRecordingLabel ¶
func NewRecordingLabel() *RecordingLabel
NewRecordingLabel returns a new RecordingLabel object
func NewRecordingLabelFrom ¶
func NewRecordingLabelFrom(lbl *RecordingLabel) *RecordingLabel
NewRecordingLabelFrom returns a new RecordingLabel using inputs from another
func (*RecordingLabel) GetFK ¶
func (lbl *RecordingLabel) GetFK() (string, string)
GetFK gets the label association
func (*RecordingLabel) GetID ¶
func (lbl *RecordingLabel) GetID() (string, string)
GetID gets the label id
func (*RecordingLabel) GetKind ¶
func (lbl *RecordingLabel) GetKind() string
GetKind gets the label kind as string
func (*RecordingLabel) GetLiteral ¶
func (lbl *RecordingLabel) GetLiteral() interface{}
GetLiteral retrieves the literal
func (*RecordingLabel) GetValue ¶
func (lbl *RecordingLabel) GetValue() string
GetValue gets the label value
func (*RecordingLabel) Limits ¶
func (lbl *RecordingLabel) Limits() (float64, float64)
Limits returns limits for an interval tree
func (*RecordingLabel) SetCreated ¶
func (lbl *RecordingLabel) SetCreated()
SetCreated sets the created time
func (*RecordingLabel) SetDisplay ¶
func (lbl *RecordingLabel) SetDisplay(disp string)
SetDisplay changes the label display
func (*RecordingLabel) SetKind ¶
func (lbl *RecordingLabel) SetKind(kind LabelKind)
SetKind sets the label kind
func (*RecordingLabel) SetUpdated ¶
func (lbl *RecordingLabel) SetUpdated()
SetUpdated sets the created time
func (*RecordingLabel) TableName ¶
func (lbl *RecordingLabel) TableName() (string, error)
TableName sets the Gorm table name
type RecordingLabelsTree ¶
type RecordingLabelsTree struct { Recordings []intree.Bounds Tree *intree.INTree MinOpener int MaxCloser int }
RecordingLabelsTree represents a group of recording labels for a single recording using an interval tree
type SelectionRetriever ¶
type SelectionRetriever func(labels []TemplateLabel) []*string
SelectionRetriever defines a function that takes labels and returns matching clips
type Spectrogram ¶
type Spectrogram struct { RecordingID string `gorm:"primary_key;column:recording_id"` Filepath string `gorm:"column:filepath"` Opener int `gorm:"column:offset"` }
Spectrogram represents an image spectrogram
type Template ¶
type Template struct { TemplateID string `json:"template_id" gorm:"primary_key;column:template_id"` AccountID string `json:"account_id" gorm:"column:account_id"` Name string `json:"name"` Tagline string `json:"tagline"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` Numbers []TemplateNumber `json:"numbers" sql:"foreignkey:template_id;association_foreignkey:template_id"` Deprecated bool `json:"-"` }
Template is a template for a playlist
func (*Template) SetLabels ¶
func (tpl *Template) SetLabels(lbls interface{})
SetLabels sets the labels
func (*Template) SetSelection ¶
func (tpl *Template) SetSelection(selFunc SelectionRetriever)
SetSelection sets each template number's possible clips
type TemplateLabel ¶
type TemplateLabel struct { ID string `json:"id" gorm:"primary_key;column:id"` TemplateID string `json:"template_id" gorm:"column:template_id"` Number int `json:"number"` Kind LabelKind `json:"kind" gorm:"-"` Display string `json:"display" gorm:"-"` Value string `json:"value"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` }
TemplateLabel is a label for a template
func (*TemplateLabel) GetFK ¶
func (lbl *TemplateLabel) GetFK() (string, string)
GetFK gets the label association
func (*TemplateLabel) GetID ¶
func (lbl *TemplateLabel) GetID() (string, string)
GetID gets the label id
func (*TemplateLabel) GetKind ¶
func (lbl *TemplateLabel) GetKind() string
GetKind gets the label kind as string
func (*TemplateLabel) GetLiteral ¶
func (lbl *TemplateLabel) GetLiteral() interface{}
GetLiteral retrieves the literal
func (*TemplateLabel) GetValue ¶
func (lbl *TemplateLabel) GetValue() string
GetValue returns the template label value
func (*TemplateLabel) SetCreated ¶
func (lbl *TemplateLabel) SetCreated()
SetCreated sets the created time
func (*TemplateLabel) SetDisplay ¶
func (lbl *TemplateLabel) SetDisplay(disp string)
SetDisplay changes the label display
func (*TemplateLabel) SetKind ¶
func (lbl *TemplateLabel) SetKind(kind LabelKind)
SetKind sets the label kind
func (*TemplateLabel) SetUpdated ¶
func (lbl *TemplateLabel) SetUpdated()
SetUpdated sets the created time
func (*TemplateLabel) TableName ¶
func (lbl *TemplateLabel) TableName() (string, error)
TableName sets the Gorm table name
type TemplateNumber ¶
type TemplateNumber struct { TemplateID string `json:"template_id" gorm:"primary_key"` Number int `json:"number" gorm:"primary_key"` Duration int `json:"duration"` Tagline string `json:"tagline"` Created time.Time `json:"created"` Createz string `json:"createz"` Updated time.Time `json:"updated"` Updatez string `json:"updatez"` Labels []TemplateLabel `json:"labels"` ClipSelection }
TemplateNumber is a track number in a template
func (*TemplateNumber) SelectRandomClip ¶
func (tpn *TemplateNumber) SelectRandomClip() *string
SelectRandomClip returns a random clip from the possible selections
func (*TemplateNumber) TableName ¶
func (tpn *TemplateNumber) TableName() string
TableName sets the Gorm table name