bridge

package
v0.0.0-...-aeae457 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMusicFilterTypeString

func GetMusicFilterTypeString(tp MusicFilterType) string

GetMusicFilterTypeString -

func ImageFormatGetExtString

func ImageFormatGetExtString(f ImageFormat) string

func MediaStateString

func MediaStateString(state MediaState) (st string)

MediaStateString -

func RegisterGob

func RegisterGob()

RegisterGob -

Types

type Astats

type Astats struct {
	Frame    int     `json:"frame"`
	Pts      int64   `json:"pts"`
	PtsTime  float64 `json:"pts_time"`
	RMSLevel float64 `json:"RMS_level"`
}

Astats -

type AudioParams

type AudioParams struct {
	SampleRate   int    `json:"samplerate,omitempty"`
	ChannelCount int    `json:"channel-count,omitempty"`
	Channels     string `json:"channels,omitempty"`
	HrChannels   string `json:"hr-channels,omitempty"`
	Format       string `json:"format,omitempty"`
}

AudioParams -

type AudioStatus

type AudioStatus struct {
	Volume float64
	Mute   bool
}

AudioStatus -

type BtnImage

type BtnImage struct {
	Icons             []string
	Button            *gtk.Button
	Image             *gtk.Image
	OnClick           func()
	RemoveAllListener func()
	SetImageList      func(string)
}

BtnImage -

type CSSSet

type CSSSet int

CSSSet -

const (
	//CSSSetADD -
	CSSSetADD CSSSet = iota + 1
	//CSSSetREMOVE -
	CSSSetREMOVE
)

type Config

type Config struct {
	Volume           float64
	SubtitleFontSize int
	Random           bool
	Repeat           bool
	RepeatOne        bool
	EnableAudiVis    bool
}

Config -

type CoverArt

type CoverArt struct {
	Cover string
}

CoverArt -

type EndFileReason

type EndFileReason int

EndFileReason -

const (
	//EndFileReasonEOF -
	EndFileReasonEOF EndFileReason = iota
	//EndFileReasonStop -
	EndFileReasonStop
	//EndFileReasonQuit -
	EndFileReasonQuit
	//EndFileReasonError -
	EndFileReasonError
	//EndFileReasonRedirect -
	EndFileReasonRedirect
)

type EntryBox

type EntryBox struct {
	MainBox     *gtk.Box
	Overlay     *gtk.Overlay
	Box         *gtk.Box
	Placeholder *gtk.Label
	Input       *gtk.Entry
}

EntryBox -

type EntryText

type EntryText struct {
	Box         *gtk.Entry
	Placeholder *gtk.Label
	OnChanged   func(*EntryText, string)
	Overlay     *gtk.Overlay
	HaveIcon    bool
	HaveSwitch  bool
	MarginEnd   int
	LabelText   string
}

EntryText -

type FilterMusic

type FilterMusic struct {
	Filtertype MusicFilterType
	Playlist   []string
	Artists    []string
	Albums     []string
	Ids        []string
	Sources    []string
	Search     bool
	SearchText string
}

FilterMusic -

type Format

type Format struct {
	URL              string            `json:"url,omitempty"`
	LyricsURL        string            `json:"lyricsURL,omitempty"`
	BackgroundURL    string            `json:"backgroundURL,omitempty"`
	Duration         time.Duration     `json:"duration,omitempty"`
	Tracks           []Track           `json:"track,omitempty"`
	Tags             map[string]string `json:"tags,omitempty"`
	UseInternalProxy bool              `json:"-"`
	sync.RWMutex     `json:"-"`
}

Format -

func (*Format) DefaultVideo

func (cc *Format) DefaultVideo(id int) (sm Track)

DefaultVideo -

type GeneralPage

type GeneralPage struct {
	IGeneralPage
}

GeneralPage -

type IGeneralPage

type IGeneralPage interface {
	Create(interface{})
	Mount()
	UnMount()
	Action(string)
}

IGeneralPage -

type IMediaLibrary

type IMediaLibrary interface {
	ID() string
	Name() string
	GetHeader() *gtk.Widget
	GetContextMenu() []LibraryContextMenu
	GetMusic(MusicFilterOption, func(MusicLibrary, error))
	GetMusicURL(ctx context.Context, trackID string) Format
	OnRequestCoverArt(id string, c context.Context, cf context.CancelFunc) CoverArt
	GetTitle(tp MusicFilterType, trackID string, base bool) string
	RemoveMusicPlaylist(id []string, callback func(error))
	InsetMusicTrackToPlaylist(id string, tracks []string, new bool, callback func(error))
	RemoveMusicTrackToPlaylist(id string, tracks []string, callback func(error))
	OnLibraryUpdated(func(string))
}

IMediaLibrary -

type IPlayerModule

type IPlayerModule interface {
	Init(interface{}, *logging.Logger, *PlayerCallback)
	Play(PlayerMessage)
	Pause(PlayerMessage)
	Stop(PlayerMessage)
	SeekMedia(PlayerMessage)
	AudioOnly(PlayerMessage)
	GetActiveTrack(PlayerMessage) int
	SetActiveTrack(PlayerMessage) error
	SetVolume(PlayerMessage) error
	AddSubMarginY(PlayerMessage) error
	GetSubtitleFontSize(PlayerMessage) int
	SetSubtitleFontSize(PlayerMessage) error
	Format(PlayerMessage)
	SetDelayRender(bool)
}

IPlayerModule -

type ImageFormat

type ImageFormat int
const (
	ImageFormatJPEG ImageFormat = iota + 1
	ImageFormatPNG
)

type Language

type Language struct {
	English string `json:"English"`
	Alpha2  string `json:"alpha2"`
	Alpha3B string `json:"alpha3-b"`
}

Language -

type LibraryContextMenu

type LibraryContextMenu struct {
	ID      string
	Name    string
	Onclick func()
}

LibraryContextMenu -

type ListBox

type ListBox struct {
	Container     *gtk.ScrolledWindow
	ContainerList *gtk.Box
	Child         map[string]*ListBoxChild
	Listener      *ListBoxListener
	sync.RWMutex
}

ListBox -

func (*ListBox) Add

func (cc *ListBox) Add(c *ListBoxChild)

Add -

func (*ListBox) Check

func (cc *ListBox) Check(id string) (already *ListBoxChild)

Check -

type ListBoxChild

type ListBoxChild struct {
	ID      string
	Box     *gtk.EventBox
	Builder *gtk.Builder
	Data    interface{}
}

ListBoxChild -

type ListBoxListener

type ListBoxListener struct {
	OnLeftClick  func(*ListBoxChild, *gdk.Event)
	OnRightClick func(*ListBoxChild, *gdk.Event)
}

ListBoxListener -

type MediaBufferState

type MediaBufferState struct {
	CacheEnd       float64                          `json:"cache-end"`
	ReaderPts      float64                          `json:"reader-pts"`
	CacheDuration  float64                          `json:"cache-duration"`
	EOF            bool                             `json:"eof"`
	Underrun       bool                             `json:"underrun"`
	Idle           bool                             `json:"idle"`
	TotalBytes     int64                            `json:"total-bytes"`
	FwBytes        int64                            `json:"fw-bytes"`
	RawInputRate   int64                            `json:"raw-input-rate"`
	SeekableRanges []MediaBufferStateSeekableRanges `json:"seekable-ranges"`
}

MediaBufferState -

type MediaBufferStateSeekableRanges

type MediaBufferStateSeekableRanges struct {
	Start float64 `json:"start"`
	End   float64 `json:"end"`
}

MediaBufferStateSeekableRanges -

type MediaLibraryHelper

type MediaLibraryHelper struct {
	Logger                     *logging.Logger
	DatabaseLocation           func(string) string
	Asset                      func(string) ([]byte, error)
	SetClass                   func(widget interface{}, mode CSSSet, class string)
	NewEntryBox                func(placeholder, id string) *EntryBox
	CrateEntryText             func(*EntryText)
	NewIdleAdd                 func(func()) glib.SourceHandle
	CreateBtnImage             func(interface{})
	GetLeftMenuBox             func(id string) *gtk.Box
	GetMainWindow              func() *gtk.Window
	AttachWindow               func(wi *gtk.Widget, w, h int, title string, onClose func())
	DeAttachWindow             func(wi *gtk.Widget)
	AttachCustomNotification   func(wi *gtk.Widget)
	DeAttachCustomNotification func(wi *gtk.Widget)
	NewListBox                 func(*gtk.Box) *ListBox
	CreateHashByte             func([]byte) string
	CreateHash                 func(string) string
}

MediaLibraryHelper -

type MediaLibraryPlugins

type MediaLibraryPlugins struct {
	IMediaLibrary
}

MediaLibraryPlugins -

type MediaState

type MediaState int

MediaState -

const (
	//MediaStatePlaying -
	MediaStatePlaying MediaState = iota
	//MediaStatePaused -
	MediaStatePaused
)

type MediaStats

type MediaStats struct {
	VideoFormat         string
	VideoResolution     string
	ViewPort            string
	AudioFormat         string
	StateString         string
	State               MediaState
	Buffering           bool
	Seekable            bool
	Duration            time.Duration
	Position            time.Duration
	PositionPercent     float64
	Remaining           time.Duration
	CacheSpeed          int64
	CacheBufferingState int
	BufferState         MediaBufferState
	FrameCount          int
	CurrentFrame        int
	DropFrame           int
}

MediaStats -

type MusicData

type MusicData struct {
	Hash          string
	Title         string
	ID            string
	ArtistID      string
	AlbumID       string
	Artist        string
	AlbumArtist   string
	Album         string
	Playlist      string
	Type          string
	Path          string
	SourceID      string
	Duration      int
	Container     string
	AudioChannels int
	AudioCodec    string
	Size          int64
	Bitrate       int
	Items         []string
	Others        interface{}
}

MusicData -

type MusicFilterIDs

type MusicFilterIDs struct {
	Playlist []string
	Artists  []string
	Albums   []string
	Tracks   []string
	Count    struct {
		AllTracks int
		Artists   int
		Albums    int
		Tracks    int
	}
}

MusicFilterIDs -

type MusicFilterOption

type MusicFilterOption struct {
	Type MusicFilterType
}

MusicFilterOption -

type MusicFilterType

type MusicFilterType int

MusicFilterType -

const (
	//MusicFilterTypeArtist -
	MusicFilterTypeArtist MusicFilterType = iota + 1
	//MusicFilterTypeAlbum -
	MusicFilterTypeAlbum
	//MusicFilterTypeTracks -
	MusicFilterTypeTracks
	//MusicFilterTypePlaylist -
	MusicFilterTypePlaylist
)

func GetMusicFilterFromString

func GetMusicFilterFromString(tp string) MusicFilterType

GetMusicFilterFromString -

type MusicLibrary

type MusicLibrary struct {
	Hash        string
	LastUpdated time.Time
	Tracks      []MusicData
	Albums      []MusicData
	Artists     []MusicData
	Playlist    []MusicData
}

MusicLibrary -

type PlayerCallback

type PlayerCallback struct {
	IsReady            func()
	FileLoaded         func()
	MetadataUpdate     func()
	TracksChanged      func()
	Seek               func()
	PlaybackRestart    func()
	Ended              func(error, EndFileReason)
	Stats              func(MediaStats)
	OnAstatsNormalise  func([]float64, []float64)
	AudioStatus        func(AudioStatus)
	OnSingleLeftPress  func(event *gdk.Event)
	OnSingleRightPress func(event *gdk.Event)
	OnDoubleLeftPress  func(event *gdk.Event)
	OnMotion           func(event *gdk.Event)
	OnEnter            func(event *gdk.Event)
	OnLeave            func(event *gdk.Event)
	OnMprisBtnAction   func(string)
	SetCover           func(string)
	OnRequestCoverArt  func(context.Context, context.CancelFunc) CoverArt
}

PlayerCallback -

type PlayerMessage

type PlayerMessage struct {
	ID               string
	File             string
	Scale            float64
	SeekMedia        float64
	Volume           float64
	AudioOnly        bool
	Pause            bool
	TrackType        TrackType
	Video            string
	Audio            string
	Subtitle         string
	SubtitleFontSize int
	ExternalSubtitle bool
	SubMarginY       int
	Format           *Format
	Track            PlaylistTracks
}

PlayerMessage -

type PlayerModule

type PlayerModule struct {
	IPlayerModule
}

PlayerModule -

type PlaylistTracks

type PlaylistTracks struct {
	SourceType        string
	SourceID          string
	ID                string
	GetTitle          func(PlaylistTracks) string
	GetFormat         func(PlaylistTracks) *Format
	OnTitlePress      func(PlaylistTracks)
	OnRequestCoverArt func(src PlaylistTracks, c context.Context, cf context.CancelFunc) CoverArt
}

type ScaleImage

type ScaleImage struct {
	OutputName string
	Format     ImageFormat
	Options    [][]string `json:"options"`
}

ScaleImage -

type SendMessage

type SendMessage struct {
	Origin      string      `json:"origin"`
	Destination []string    `json:"destination"`
	Channel     string      `json:"channel"`
	SubChannel  string      `json:"subChannel"`
	Msg         interface{} `json:"msg"`
	Time        time.Time   `json:"time"`
	GatewayTime time.Time   `json:"gatewayTime"`
	RequestID   string      `json:"requestID"`
	Error       []string    `json:"error"`
}

SendMessage -

type SetTimeout

type SetTimeout struct {
	StartTime time.Time
	Limit     time.Duration
	sync.Mutex
}

SetTimeout -

func NewTimeout

func NewTimeout() *SetTimeout

NewTimeout -

func (*SetTimeout) Start

func (cc *SetTimeout) Start(exp time.Duration)

Start -

func (*SetTimeout) Stop

func (cc *SetTimeout) Stop(callback func())

Stop -

type Track

type Track struct {
	ID                int         `json:"id"`
	Type              string      `json:"type,omitempty"`
	SrcID             int         `json:"src-id,omitempty"`
	Lang              string      `json:"lang,omitempty"`
	Title             string      `json:"title,omitempty"`
	Albumart          bool        `json:"albumart,omitempty"`
	Default           bool        `json:"default,omitempty"`
	Forced            bool        `json:"forced,omitempty"`
	Dependent         bool        `json:"dependent,omitempty"`
	VisualImpaired    bool        `json:"visual-impaired,omitempty"`
	HearingImpaired   bool        `json:"hearing-impaired,omitempty"`
	External          bool        `json:"external,omitempty"`
	ExternalFilename  string      `json:"external-filename,omitempty"`
	Selected          bool        `json:"selected,omitempty"`
	MainSelection     int         `json:"main-selection,omitempty"`
	FFindex           int         `json:"ff-index"`
	AudioChannel      int         `json:"audio-channels,omitempty"`
	Decoderdesc       string      `json:"decoder-desc,omitempty"`
	Codec             string      `json:"codec,omitempty"`
	DemuxW            int         `json:"demux-w,omitempty"`
	DemuxH            int         `json:"demux-h,omitempty"`
	DemuxFPS          float64     `json:"demux-fps,omitempty"`
	DemuxPar          float64     `json:"demux-par,omitempty"`
	DemuxChannelCount int         `json:"demux-channel-count,omitempty"`
	DemuxChannels     string      `json:"demux-channels,omitempty"`
	DemuxSamplerate   int         `json:"demux-samplerate,omitempty"`
	DemuxBitrate      int         `json:"demux-bitrate,omitempty"`
	AudioParams       AudioParams `json:"audio-params,omitempty"`
	VideoParams       VideoParams `json:"video-params,omitempty"`
}

Track -

type TrackType

type TrackType int

TrackType -

const (
	//TrackTypeVideo -
	TrackTypeVideo TrackType = iota
	//TrackTypeAudio -
	TrackTypeAudio
	//TrackTypeSubtitle -
	TrackTypeSubtitle
)

type VideoParams

type VideoParams struct {
	PixelFormat    string  `json:"pixelformat,omitempty"`
	AverageBpp     int     `json:"average-bpp,omitempty"`
	W              int     `json:"w,omitempty"`
	H              int     `json:"h,omitempty"`
	DW             int     `json:"dw,omitempty"`
	DH             int     `json:"dh,omitempty"`
	Aspect         float64 `json:"aspect,omitempty"`
	Par            int     `json:"par,omitempty"`
	ColorMatrix    string  `json:"colormatrix,omitempty"`
	ColorLevels    string  `json:"colorlevels,omitempty"`
	Primaries      string  `json:"primaries,omitempty"`
	Gamma          string  `json:"gamma,omitempty"`
	SigPeak        float64 `json:"sig-peak,omitempty"`
	Light          string  `json:"light,omitempty"`
	ChromaLocation string  `json:"chroma-location,omitempty"`
	StereoIn       string  `json:"stereo-in,omitempty"`
	Rotate         int     `json:"rotate,omitempty"`
}

VideoParams -

type VideoSource

type VideoSource struct {
	Border struct {
		Left   int
		Top    int
		Right  int
		Bottom int
	}
	Scale struct {
		X float64
		Y float64
	}
}

VideoSource -

type Youtube

type Youtube struct {
	Title   string          `json:"title"`
	Track   string          `json:"track"`
	Artist  string          `json:"artist"`
	Formats []YoutubeFormat `json:"formats"`
}

Youtube -

type YoutubeFormat

type YoutubeFormat struct {
	URL        string  `json:"url"`
	Ext        string  `json:"ext"`
	Acodec     string  `json:"acodec"`
	Vcodec     string  `json:"vcodec"`
	FormatNote string  `json:"format_note"`
	Format     string  `json:"format"`
	Width      int     `json:"width"`
	Height     int     `json:"height"`
	Fps        float64 `json:"fps"`
	Tbr        float64 `json:"tbr"`
}

YoutubeFormat -

Jump to

Keyboard shortcuts

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