soapcalls

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMatchingFileType = errors.New("no matching file type")
	ErrZombieCallbacks    = errors.New("zombie callbacks, we should ignore those")
)
View Source
var (
	ErrSetMuteInput = errors.New("setMuteSoapBuild input error. Was expecting 0 or 1.")
)
View Source
var (
	ErrWrongDMR = errors.New("something broke somewhere - wrong DMR URL?")
)

Functions

func EventNotifyParser

func EventNotifyParser(xmlbody string) (string, string, error)

EventNotifyParser parses the Notify messages from the DMR device.

func GetFriendlyName

func GetFriendlyName(ctx context.Context, dmr string) (string, error)

GetFriendlyName returns the friendly name value for a the specific DMR url.

Types

type DMRextracted

type DMRextracted struct {
	AvtransportControlURL  string
	AvtransportEventSubURL string
	RenderingControlURL    string
	ConnectionManagerURL   string
}

DMRextracted stored the services urls

func DMRextractor

func DMRextractor(ctx context.Context, dmrurl string) (*DMRextracted, error)

DMRextractor extracts the services URLs from the main DMR xml.

type Options

type Options struct {
	LogOutput io.Writer

	DMR        string
	Media      string
	Subs       string
	Mtype      string
	ListenAddr string
	Transcode  bool
	Seek       bool
	// contains filtered or unexported fields
}

type States

type States struct {
	PreviousState string
	NewState      string
	ProcessStop   bool
}

type TVPayload

type TVPayload struct {
	Logger    zerolog.Logger
	LogOutput io.Writer

	CurrentTimers               map[string]*time.Timer
	InitialMediaRenderersStates map[string]bool
	MediaRenderersStates        map[string]*States
	EventURL                    string
	ControlURL                  string
	MediaURL                    string
	MediaType                   string
	MediaPath                   string
	SubtitlesURL                string
	CallbackURL                 string
	ConnectionManagerURL        string
	RenderingControlURL         string

	Transcode bool
	Seekable  bool
	// contains filtered or unexported fields
}

TVPayload is the heart of Go2TV. We pass that type to the webserver. We need to explicitly initialize it.

func NewTVPayload

func NewTVPayload(o *Options) (*TVPayload, error)

func (*TVPayload) CreateMRstate

func (p *TVPayload) CreateMRstate(uuid string)

CreateMRstate .

func (*TVPayload) DeleteMRstate

func (p *TVPayload) DeleteMRstate(uuid string)

DeleteMRstate deletes the state entries for the specific UUID.

func (*TVPayload) Gapless

func (p *TVPayload) Gapless() (string, error)

Gapless requests our device's media info and returns the Next URI.

func (*TVPayload) GetMuteSoapCall

func (p *TVPayload) GetMuteSoapCall() (string, error)

GetMuteSoapCall returns the mute status for our device

func (*TVPayload) GetPositionInfo

func (p *TVPayload) GetPositionInfo() ([]string, error)

GetPositionInfo .

func (*TVPayload) GetProcessStop

func (p *TVPayload) GetProcessStop(uuid string) (bool, error)

GetProcessStop returns the processStop value of the specific UUID.

func (*TVPayload) GetProtocolInfo

func (p *TVPayload) GetProtocolInfo() error

GetProtocolInfo requests our device's protocol info.

func (*TVPayload) GetTransportInfo

func (p *TVPayload) GetTransportInfo() ([]string, error)

GetTransportInfo .

func (*TVPayload) GetVolumeSoapCall

func (p *TVPayload) GetVolumeSoapCall() (int, error)

GetVolumeSoapCall returns tue volume level for our device.

func (*TVPayload) ListenAddress

func (p *TVPayload) ListenAddress() string

func (*TVPayload) Log

func (p *TVPayload) Log() *zerolog.Logger

func (*TVPayload) PlayPauseStopSoapCall

func (p *TVPayload) PlayPauseStopSoapCall(action string) error

PlayPauseStopSoapCall builds and sends the AVTransport actions for Play Pause and Stop.

func (*TVPayload) RefreshLoopUUIDSoapCall

func (p *TVPayload) RefreshLoopUUIDSoapCall(uuid, timeout string)

RefreshLoopUUIDSoapCall refreshes the UUID.

func (*TVPayload) SeekSoapCall

func (p *TVPayload) SeekSoapCall(reltime string) error

SeekSoapCall builds and sends the AVTransport actions for Seek.

func (*TVPayload) SendtoTV

func (p *TVPayload) SendtoTV(action string) error

SendtoTV is a higher level method that gracefully handles the various states when communicating with the DMR devices.

func (*TVPayload) SetMuteSoapCall

func (p *TVPayload) SetMuteSoapCall(number string) error

SetMuteSoapCall returns true if muted and false if not muted.

func (*TVPayload) SetProcessStopTrue

func (p *TVPayload) SetProcessStopTrue(uuid string)

SetProcessStopTrue set the stop process to true

func (*TVPayload) SetVolumeSoapCall

func (p *TVPayload) SetVolumeSoapCall(v string) error

SetVolumeSoapCall sets the desired volume level.

func (*TVPayload) SubscribeSoapCall

func (p *TVPayload) SubscribeSoapCall(uuidInput string) error

SubscribeSoapCall send a SUBSCRIBE request to the DMR device. If we explicitly pass the UUID, then we refresh it instead.

func (*TVPayload) UnsubscribeSoapCall

func (p *TVPayload) UnsubscribeSoapCall(uuid string) error

UnsubscribeSoapCall sends an UNSUBSCRIBE request to the DMR device and cleans up any stored states for the provided UUID.

func (*TVPayload) UpdateMRstate

func (p *TVPayload) UpdateMRstate(previous, new, uuid string) bool

UpdateMRstate updates the mediaRenderersStates map with the state. Returns true or false to verify that the actual update took place.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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