gupnp

package module
v0.0.0-...-366e4d7 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2016 License: GPL-2.0 Imports: 3 Imported by: 1

README

gupnp

gupnp provides an API and GUI to control DLNA/UPnP devices like network TV and radio.

It's a go (golang) binding for gupnp and gupnp-av C libraries.

See documentation on http://godoc.org/github.com/sqp/gupnp

Requirements

C libraries: libgupnp-av, libgupnp, libgssdp, glib-2.0

go libraries: github.com/clbanning/mxj github.com/conformal/gotk3 github.com/sqp/godock

Documentation

Overview

Package gupnp provides an API and GUI to control DLNA/UPnP devices like network TV and radio.

Its goal is to locate media servers (with files) and media players. You can then send commands to players (volume, pause...) and let them play the selected music or video content. Can also be used as just a limited remote controler for supported renderers.

Digital media servers - DMS

A database of multimedia content, that other devices can play media from.

Digital media renderers - DMR

Plays stuff, that is it makes sound and in required cases shows moving images.

Digital media controllers - DMC

A device that works as a remote control, can play stop, skip, pause, change loudness, brightness etcetera.

The manager keeps a server and a renderer as current target devices to use for fast user actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MediaControl

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

MediaControl manages media renderers and servers on the UPnP network.

func New

func New(log upnptype.Logger) (*MediaControl, error)

New creates a new MediaControl manager.

func (*MediaControl) Action

func (cp *MediaControl) Action(action upnptype.Action) error

Action sends an action to the selected renderer.

func (*MediaControl) AddURIToQueue

AddURIToQueue is TODO.

func (*MediaControl) Browse

func (cp *MediaControl) Browse(container string, startingIndex uint32) ([]upnptype.Container, []upnptype.Object, uint, uint)

Browse lists files on a server.

func (*MediaControl) BrowseMetadata

func (cp *MediaControl) BrowseMetadata(container string, startingIndex uint) error

BrowseMetadata starts the playback of the given file on the selected renderer.

func (*MediaControl) DefineEvents

func (cp *MediaControl) DefineEvents() upnptype.ControlPointEvents

DefineEvents returns pointers to control events callbacks.

func (*MediaControl) GetCurrentTime

func (cp *MediaControl) GetCurrentTime() int

GetCurrentTime returns the current track position on selected server in seconds.

func (*MediaControl) GetRenderer

func (cp *MediaControl) GetRenderer(udn string) upnptype.Renderer

GetRenderer return the renderer referenced by the udn argument.

func (*MediaControl) GetServer

func (cp *MediaControl) GetServer(udn string) upnptype.Server

GetServer return the server referenced by the udn argument.

func (*MediaControl) Renderer

func (cp *MediaControl) Renderer() upnptype.Renderer

Renderer return the current renderer if any.

func (*MediaControl) RendererExists

func (cp *MediaControl) RendererExists() bool

RendererExists return true if a renderer is selected.

func (*MediaControl) RendererIsActive

func (cp *MediaControl) RendererIsActive(rend upnptype.Renderer) bool

RendererIsActive return true if the provided server is the one selected.

func (*MediaControl) Renderers

func (cp *MediaControl) Renderers() upnptype.Renderers

Renderers return the list of all known renderers.

func (*MediaControl) Seek

func (cp *MediaControl) Seek(unit, target string) error

Seek seeks to new time in track. Input in seconds.

func (*MediaControl) SeekPercent

func (cp *MediaControl) SeekPercent(value float64) error

SeekPercent seeks to new time in track. Input is the percent position in track. Range 0 to 100.

func (*MediaControl) Server

func (cp *MediaControl) Server() upnptype.Server

Server return the current server if any.

func (*MediaControl) ServerExists

func (cp *MediaControl) ServerExists() bool

ServerExists return true if a server is selected.

func (*MediaControl) ServerIsActive

func (cp *MediaControl) ServerIsActive(srv upnptype.Server) bool

ServerIsActive return true if the provided server is the one selected.

func (*MediaControl) Servers

func (cp *MediaControl) Servers() map[string]upnptype.Server

Servers return the list of all known servers.

func (*MediaControl) SetNextAVTransportURI

func (cp *MediaControl) SetNextAVTransportURI(nextURI, nextURIMetaData string) error

SetNextAVTransportURI sets the next playback URI,

func (*MediaControl) SetPreferredRenderer

func (cp *MediaControl) SetPreferredRenderer(name string)

SetPreferredRenderer sets the renderer that will be selected if found (unless anoter is selected).

func (*MediaControl) SetPreferredServer

func (cp *MediaControl) SetPreferredServer(name string)

SetPreferredServer sets the server that will be selected if found (unless anoter is selected)..

func (*MediaControl) SetRenderer

func (cp *MediaControl) SetRenderer(udn string)

SetRenderer sets the current renderer by its udn reference.

func (*MediaControl) SetSeekDelta

func (cp *MediaControl) SetSeekDelta(delta int)

SetSeekDelta configures the default seek delta for user actions.

func (*MediaControl) SetServer

func (cp *MediaControl) SetServer(udn string)

SetServer sets the current server by its udn reference.

func (*MediaControl) SetVolumeDelta

func (cp *MediaControl) SetVolumeDelta(delta int)

SetVolumeDelta configures the default volume delta for user actions.

func (*MediaControl) SubscribeHook

func (cp *MediaControl) SubscribeHook(id string) *upnptype.MediaHook

SubscribeHook register a new hook client and returns the MediaHook to connect to.

func (*MediaControl) UnsubscribeHook

func (cp *MediaControl) UnsubscribeHook(id string)

UnsubscribeHook removes a client hook.

Directories

Path Synopsis
Package backendgupnp provides interaction with UPnP ressources on the network using the C gupnp backend.
Package backendgupnp provides interaction with UPnP ressources on the network using the C gupnp backend.
Package example is a demo for the UPnP control point GUI.
Package example is a demo for the UPnP control point GUI.
Package guigtk provides a simple GTK3 GUI to interact with UPnP media players.
Package guigtk provides a simple GTK3 GUI to interact with UPnP media players.
Package gupnp provides the low level binding for the C gupnp-av library.
Package gupnp provides the low level binding for the C gupnp-av library.
Package upnptype defines common types for the upnp package.
Package upnptype defines common types for the upnp package.

Jump to

Keyboard shortcuts

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