proto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 17 Imported by: 16

Documentation

Index

Constants

View Source
const (
	OpError   = 0
	OpTimeout = 1
	OpReply   = 2

	OpCreatePlaybackStream = 3
	OpDeletePlaybackStream = 4
	OpCreateRecordStream   = 5
	OpDeleteRecordStream   = 6

	OpExit          = 7
	OpAuth          = 8
	OpSetClientName = 9

	OpLookupSink          = 10
	OpLookupSource        = 11
	OpDrainPlaybackStream = 12
	OpStat                = 13
	OpGetPlaybackLatency  = 14
	OpCreateUploadStream  = 15
	OpDeleteUploadStream  = 16
	OpFinishUploadStream  = 17
	OpPlaySample          = 18
	OpRemoveSample        = 19

	OpGetServerInfo           = 20
	OpGetSinkInfo             = 21
	OpGetSinkInfoList         = 22
	OpGetSourceInfo           = 23
	OpGetSourceInfoList       = 24
	OpGetModuleInfo           = 25
	OpGetModuleInfoList       = 26
	OpGetClientInfo           = 27
	OpGetClientInfoList       = 28
	OpGetSinkInputInfo        = 29
	OpGetSinkInputInfoList    = 30
	OpGetSourceOutputInfo     = 31
	OpGetSourceOutputInfoList = 32
	OpGetSampleInfo           = 33
	OpGetSampleInfoList       = 34
	OpSubscribe               = 35

	OpSetSinkVolume         = 36
	OpSetSinkInputVolume    = 37
	OpSetSourceVolume       = 38
	OpSetSinkMute           = 39
	OpSetSourceMute         = 40
	OpCorkPlaybackStream    = 41
	OpFlushPlaybackStream   = 42
	OpTriggerPlaybackStream = 43

	OpSetDefaultSink        = 44
	OpSetDefaultSource      = 45
	OpSetPlaybackStreamName = 46
	OpSetRecordStreamName   = 47
	OpKillClient            = 48
	OpKillSinkInput         = 49
	OpKillSourceOutput      = 50

	OpLoadModule   = 51
	OpUnloadModule = 52

	OpGetRecordLatency     = 57
	OpCorkRecordStream     = 58
	OpFlushRecordStream    = 59
	OpPrebufPlaybackStream = 60

	OpRequest              = 61 // server -> client
	OpOverflow             = 62 // server -> client
	OpUnderflow            = 63 // server -> client
	OpPlaybackStreamKilled = 64 // server -> client
	OpRecordStreamKilled   = 65 // server -> client
	OpSubscribeEvent       = 66 // server -> client

	OpMoveSinkInput                  = 67
	OpMoveSourceOutput               = 68
	OpSetSinkInputMute               = 69
	OpSuspendSink                    = 70
	OpSuspendSource                  = 71
	OpSetPlaybackStreamBufferAttr    = 72
	OpSetRecordStreamBufferAttr      = 73
	OpUpdatePlaybackStreamSampleRate = 74
	OpUpdateRecordStreamSampleRate   = 75

	OpPlaybackStreamSuspended = 76 // server -> client
	OpRecordStreamSuspended   = 77 // server -> client
	OpPlaybackStreamMoved     = 78 // server -> client
	OpRecordStreamMoved       = 79 // server -> client

	OpUpdateRecordStreamProplist   = 80
	OpUpdatePlaybackStreamProplist = 81
	OpUpdateClientProplist         = 82
	OpRemoveRecordStreamProplist   = 83
	OpRemovePlaybackStreamProplist = 84
	OpRemoveClientProplist         = 85

	OpStarted = 86 // server -> client

	OpExtension = 87

	OpGetCardInfo     = 88
	OpGetCardInfoList = 89
	OpSetCardProfile  = 90

	OpClientEvent               = 91 // server -> client
	OpPlaybackStreamEvent       = 92 // server -> client
	OpRecordStreamEvent         = 93 // server -> client
	OpPlaybackBufferAttrChanged = 94 // server -> client
	OpRecordBufferAttrChanged   = 95 // server -> client

	OpSetSinkPort           = 96
	OpSetSourcePort         = 97
	OpSetSourceOutputVolume = 98
	OpSetSourceOutputMute   = 99

	OpSetPortLatencyOffset = 100

	OpEnableSRBChannel  = 101
	OpDisableSRBChannel = 102

	OpRegisterMemfdShmid = 103
)
View Source
const (
	FormatUint8     = 0
	FormatInt16LE   = 3
	FormatInt16BE   = 4
	FormatFloat32LE = 5
	FormatFloat32BE = 6
	FormatInt32LE   = 7
	FormatInt32BE   = 8
)
View Source
const (
	ChannelMono           = 0
	ChannelLeft           = 1
	ChannelRight          = 2
	ChannelCenter         = 3
	ChannelFrontLeft      = 1
	ChannelFrontRight     = 2
	ChannelFrontCenter    = 3
	ChannelRearCenter     = 4
	ChannelRearLeft       = 5
	ChannelRearRight      = 6
	ChannelLFE            = 7
	ChannelLeftCenter     = 8
	ChannelRightCenter    = 9
	ChannelLeftSide       = 10
	ChannelRightSide      = 11
	ChannelAux0           = 12
	ChannelAux31          = 43
	ChannelTopCenter      = 44
	ChannelTopFrontLeft   = 45
	ChannelTopFrontRight  = 46
	ChannelTopFrontCenter = 47
	ChannelTopRearLeft    = 48
	ChannelTopRearRight   = 49
	ChannelTopRearCenter  = 50
)
View Source
const (
	EncodingPCM = 1
)
View Source
const Undefined = 0xFFFFFFFF

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Version Version
	Cookie  []byte
}

type AuthReply

type AuthReply struct {
	Version Version
}

func (*AuthReply) IsReplyTo

func (*AuthReply) IsReplyTo() uint32

type AwaitReply

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

type ChannelMap

type ChannelMap []byte

type ChannelVolumes

type ChannelVolumes []uint32

type Client

type Client struct {
	Callback func(interface{})
	// contains filtered or unexported fields
}

func Connect

func Connect(server string) (*Client, net.Conn, error)

Connect connects to the pulse server.

For the server string format see https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/ If the server string is empty, the environment variable PULSE_SERVER will be used.

func (*Client) Open

func (c *Client) Open(rw io.ReadWriter)

func (*Client) Request

func (c *Client) Request(req RequestArgs, rpl Reply) error

func (*Client) Send

func (c *Client) Send(index uint32, data []byte) error

func (*Client) SetTimeout added in v0.1.1

func (c *Client) SetTimeout(t time.Duration)

func (*Client) SetVersion

func (c *Client) SetVersion(v Version)

func (*Client) Version

func (c *Client) Version() Version

type ClientEvent

type ClientEvent struct {
	Event      string
	Properties PropList
}

type ConnectionClosed

type ConnectionClosed struct{}

type CorkPlaybackStream

type CorkPlaybackStream struct {
	StreamIndex uint32
	Corked      bool
}

type CorkRecordStream

type CorkRecordStream struct {
	StreamIndex uint32
	Corked      bool
}

type CreatePlaybackStream

type CreatePlaybackStream struct {
	SampleSpec
	ChannelMap ChannelMap
	SinkIndex  uint32
	SinkName   string

	BufferMaxLength       uint32
	Corked                bool
	BufferTargetLength    uint32
	BufferPrebufferLength uint32
	BufferMinimumRequest  uint32

	SyncID uint32

	ChannelVolumes ChannelVolumes

	NoRemap      bool "12"
	NoRemix      bool "12"
	FixFormat    bool "12"
	FixRate      bool "12"
	FixChannels  bool "12"
	NoMove       bool "12"
	VariableRate bool "12"

	Muted         bool     "13"
	AdjustLatency bool     "13"
	Properties    PropList "13"

	VolumeSet     bool "14"
	EarlyRequests bool "14"

	MutedSet               bool "15"
	DontInhibitAutoSuspend bool "15"
	FailOnSuspend          bool "15"

	RelativeVolume bool "17"

	Passthrough bool "18"

	Formats []FormatInfo "21"
}

type CreatePlaybackStreamReply

type CreatePlaybackStreamReply struct {
	StreamIndex    uint32
	SinkInputIndex uint32
	Missing        uint32

	BufferMaxLength       uint32 "9"
	BufferTargetLength    uint32 "9"
	BufferPrebufferLength uint32 "9"
	BufferMinimumRequest  uint32 "9"

	SampleSpec "12"
	ChannelMap []byte "12"

	SinkIndex     uint32 "12"
	SinkName      string "12"
	SinkSuspended bool   "12"

	SinkLatency Microseconds "13"

	FormatInfo "21"
}

func (*CreatePlaybackStreamReply) IsReplyTo

func (*CreatePlaybackStreamReply) IsReplyTo() uint32

type CreateRecordStream

type CreateRecordStream struct {
	SampleSpec
	ChannelMap      ChannelMap
	SourceIndex     uint32
	SourceName      string
	BufferMaxLength uint32
	Corked          bool
	BufferFragSize  uint32

	NoRemap      bool "12"
	NoRemix      bool "12"
	FixFormat    bool "12"
	FixRate      bool "12"
	FixChannels  bool "12"
	NoMove       bool "12"
	VariableRate bool "12"

	PeakDetect         bool     "13"
	AdjustLatency      bool     "13"
	Properties         PropList "13"
	DirectOnInputIndex uint32   "13"

	EarlyRequests bool "14"

	DontInhibitAutoSuspend bool "15"
	FailOnSuspend          bool "15"

	Formats        []FormatInfo   "22"
	ChannelVolumes ChannelVolumes "22"
	Muted          bool           "22"
	VolumeSet      bool           "22"
	MutedSet       bool           "22"
	RelativeVolume bool           "22"
	Passthrough    bool           "22"
}

type CreateRecordStreamReply

type CreateRecordStreamReply struct {
	StreamIndex       uint32
	SourceOutputIndex uint32

	BufferMaxLength uint32 "9"
	BufferFragSize  uint32 "9"

	SampleSpec      "12"
	ChannelMap      ChannelMap "12"
	SourceIndex     uint32     "12"
	SourceName      string     "12"
	SourceSuspended bool       "12"

	SourceLatency Microseconds "13"

	FormatInfo "22"
}

func (*CreateRecordStreamReply) IsReplyTo

func (*CreateRecordStreamReply) IsReplyTo() uint32

type CreateUploadStream

type CreateUploadStream struct {
	Name string
	SampleSpec
	ChannelMap ChannelMap
	Length     uint32

	Properties PropList "13"
}

type CreateUploadStreamReply

type CreateUploadStreamReply struct {
	StreamIndex uint32
	Length      uint32
}

func (*CreateUploadStreamReply) IsReplyTo

func (*CreateUploadStreamReply) IsReplyTo() uint32

type DataPacket

type DataPacket struct {
	StreamIndex uint32
	Data        []byte
}

type DeletePlaybackStream

type DeletePlaybackStream struct{ StreamIndex uint32 }

type DeleteRecordStream

type DeleteRecordStream struct{ StreamIndex uint32 }

type DeleteUploadStream

type DeleteUploadStream struct{ StreamIndex uint32 }

type DrainPlaybackStream

type DrainPlaybackStream struct {
	StreamIndex uint32
}

type Error

type Error uint32
const (
	ErrAccessDenied Error
	ErrUnknownCommand
	ErrInvalidArgument
	ErrEntityExists
	ErrNoSuchEntity
	ErrConnectionRefused
	ErrProtocolError
	ErrTimeout
	ErrNoAuthenticationKey
	ErrInternalError
	ErrConnectionTerminated
	ErrEntityKilled
	ErrInvalidServer
	ErrModuleInitializationFailed
	ErrBadState
	ErrNoData
	ErrIncompatibleProtocolVersion
	ErrTooLarge
	ErrNotSupported
	ErrUnknownErrorCode
	ErrNoSuchExtension
	ErrObsoleteFunctionality
	ErrMissingImplementation
	ErrClientForked
	ErrInputOutputError
	ErrDeviceOrEesourceBusy
)

func (Error) Error

func (e Error) Error() string

type Exit

type Exit struct{}

type Extension

type Extension struct {
	Index uint32
	Name  string
}

The reply type for this command is extension-specific

type FinishUploadStream

type FinishUploadStream struct {
	StreamIndex uint32
}

type FlushPlaybackStream

type FlushPlaybackStream struct{ StreamIndex uint32 }

type FlushRecordStream

type FlushRecordStream struct{ StreamIndex uint32 }

type FormatInfo

type FormatInfo struct {
	Encoding   byte
	Properties PropList
}

type GetCardInfo

type GetCardInfo struct{ CardIndex uint32 }

type GetCardInfoList

type GetCardInfoList struct{}

type GetCardInfoListReply

type GetCardInfoListReply []*GetCardInfoReply

func (*GetCardInfoListReply) IsReplyTo

func (*GetCardInfoListReply) IsReplyTo() uint32

type GetCardInfoReply

type GetCardInfoReply struct {
	CardIndex   uint32
	CardName    string
	ModuleIndex uint32
	Driver      string

	Profiles []struct {
		Name        string
		Description string
		NumSinks    uint32
		NumSources  uint32
		Priority    uint32
		Available   uint32 "29"
	}
	ActiveProfileName string
	Properties        PropList

	Ports []struct {
		Name        string
		Description string
		Priority    uint32
		Available   uint32
		Direction   byte
		Properties  PropList
		Profiles    []struct {
			Name string
		}
		LatencyOffset int64 "27"
	} "26"
}

func (*GetCardInfoReply) IsReplyTo

func (*GetCardInfoReply) IsReplyTo() uint32

type GetClientInfo

type GetClientInfo struct{ ClientIndex uint32 }

type GetClientInfoList

type GetClientInfoList struct{}

type GetClientInfoListReply

type GetClientInfoListReply []*GetClientInfoReply

func (*GetClientInfoListReply) IsReplyTo

func (*GetClientInfoListReply) IsReplyTo() uint32

type GetClientInfoReply

type GetClientInfoReply struct {
	ClientIndex uint32
	Application string
	ModuleIndex uint32
	Driver      string

	Properties PropList "13"
}

func (*GetClientInfoReply) IsReplyTo

func (*GetClientInfoReply) IsReplyTo() uint32

type GetModuleInfo

type GetModuleInfo struct{ ModuleIndex uint32 }

type GetModuleInfoList

type GetModuleInfoList struct{}

type GetModuleInfoListReply

type GetModuleInfoListReply []*GetModuleInfoReply

func (*GetModuleInfoListReply) IsReplyTo

func (*GetModuleInfoListReply) IsReplyTo() uint32

type GetModuleInfoReply

type GetModuleInfoReply struct {
	ModuleIndex uint32
	ModuleName  string
	ModuleArgs  string
	Users       uint32

	Properties PropList "15"
	AutoLoad   bool     "<15"
}

func (*GetModuleInfoReply) IsReplyTo

func (*GetModuleInfoReply) IsReplyTo() uint32

type GetPlaybackLatency

type GetPlaybackLatency struct {
	StreamIndex uint32
	Time        Time
}

type GetPlaybackLatencyReply

type GetPlaybackLatencyReply struct {
	Latency     Microseconds
	Unused      Microseconds // always 0
	Running     bool
	RequestTime Time
	ReplyTime   Time
	WriteIndex  int64
	ReadIndex   int64

	UnderrunFor uint64 "13"
	PlayingFor  uint64 "13"
}

func (*GetPlaybackLatencyReply) IsReplyTo

func (*GetPlaybackLatencyReply) IsReplyTo() uint32

type GetRecordLatency

type GetRecordLatency struct {
	StreamIndex uint32
	Time        Time
}

type GetRecordLatencyReply

type GetRecordLatencyReply struct {
	MonitorLatency Microseconds
	Latency        Microseconds
	Running        bool
	RequestTime    Time
	ReplyTime      Time
	WriteIndex     int64
	ReadIndex      int64
}

func (*GetRecordLatencyReply) IsReplyTo

func (*GetRecordLatencyReply) IsReplyTo() uint32

type GetSampleInfo

type GetSampleInfo struct {
	SampleIndex uint32
	SampleName  string
}

type GetSampleInfoList

type GetSampleInfoList struct{}

type GetSampleInfoListReply

type GetSampleInfoListReply []*GetSampleInfoReply

func (*GetSampleInfoListReply) IsReplyTo

func (*GetSampleInfoListReply) IsReplyTo() uint32

type GetSampleInfoReply

type GetSampleInfoReply struct {
	SampleIndex    uint32
	SampleName     string
	ChannelVolumes ChannelVolumes
	Duration       Microseconds
	SampleSpec
	ChannelMap ChannelMap
	Length     uint32
	Lazy       bool
	Filename   string

	Properties PropList "13"
}

func (*GetSampleInfoReply) IsReplyTo

func (*GetSampleInfoReply) IsReplyTo() uint32

type GetServerInfo

type GetServerInfo struct{}

type GetServerInfoReply

type GetServerInfoReply struct {
	PackageName    string
	PackageVersion string
	Username       string
	Hostname       string

	DefaultSampleSpec SampleSpec
	DefaultSinkName   string
	DefaultSourceName string

	Cookie uint32

	DefaultChannelMap ChannelMap "15"
}

func (*GetServerInfoReply) IsReplyTo

func (*GetServerInfoReply) IsReplyTo() uint32

type GetSinkInfo

type GetSinkInfo struct {
	SinkIndex uint32
	SinkName  string
}

type GetSinkInfoList

type GetSinkInfoList struct{}

type GetSinkInfoListReply

type GetSinkInfoListReply []*GetSinkInfoReply

func (*GetSinkInfoListReply) IsReplyTo

func (*GetSinkInfoListReply) IsReplyTo() uint32

type GetSinkInfoReply

type GetSinkInfoReply struct {
	SinkIndex uint32
	SinkName  string
	Device    string
	SampleSpec
	ChannelMap         ChannelMap
	ModuleIndex        uint32
	ChannelVolumes     ChannelVolumes
	Mute               bool
	MonitorSourceIndex uint32
	MonitorSourceName  string
	Latency            Microseconds
	Driver             string
	Flags              uint32

	Properties       PropList     "13"
	RequestedLatency Microseconds "13"

	BaseVolume     Volume "15"
	State          uint32 "15"
	NumVolumeSteps uint32 "15"
	CardIndex      uint32 "15"

	Ports []struct {
		Name        string
		Description string
		Priority    uint32
		Available   uint32 "24"
	} "16"
	ActivePortName string "16"

	Formats []FormatInfo "21"
}

func (*GetSinkInfoReply) IsReplyTo

func (*GetSinkInfoReply) IsReplyTo() uint32

type GetSinkInputInfo

type GetSinkInputInfo struct{ SinkInputIndex uint32 }

type GetSinkInputInfoList

type GetSinkInputInfoList struct{}

type GetSinkInputInfoListReply

type GetSinkInputInfoListReply []*GetSinkInputInfoReply

func (*GetSinkInputInfoListReply) IsReplyTo

func (*GetSinkInputInfoListReply) IsReplyTo() uint32

type GetSinkInputInfoReply

type GetSinkInputInfoReply struct {
	SinkInputIndex uint32
	MediaName      string
	ModuleIndex    uint32
	ClientIndex    uint32
	SinkIndex      uint32
	SampleSpec
	ChannelMap     ChannelMap
	ChannelVolumes ChannelVolumes

	SinkInputLatency Microseconds
	SinkLatency      Microseconds
	ResampleMethod   string
	Driver           string

	Muted bool "11"

	Properties PropList "13"

	Corked bool "19"

	VolumeReadable bool "20"
	VolumeWritable bool "20"

	FormatInfo "21"
}

func (*GetSinkInputInfoReply) IsReplyTo

func (*GetSinkInputInfoReply) IsReplyTo() uint32

type GetSourceInfo

type GetSourceInfo struct {
	SourceIndex uint32
	SourceName  string
}

type GetSourceInfoList

type GetSourceInfoList struct{}

type GetSourceInfoListReply

type GetSourceInfoListReply []*GetSourceInfoReply

func (*GetSourceInfoListReply) IsReplyTo

func (*GetSourceInfoListReply) IsReplyTo() uint32

type GetSourceInfoReply

type GetSourceInfoReply struct {
	SourceIndex uint32
	SourceName  string
	Device      string
	SampleSpec
	ChannelMap         ChannelMap
	ModuleIndex        uint32
	ChannelVolumes     ChannelVolumes
	Mute               bool
	MonitorSourceIndex uint32
	MonitorSourceName  string
	Latency            Microseconds
	Driver             string
	Flags              uint32

	Properties       PropList     "13"
	RequestedLatency Microseconds "13"

	BaseVolume     Volume "15"
	State          uint32 "15"
	NumVolumeSteps uint32 "15"
	CardIndex      uint32 "15"

	Ports []struct {
		Name        string
		Description string
		Priority    uint32
		Available   uint32 "24"
	} "16"
	ActivePortName string "16"

	Formats []FormatInfo "21"
}

func (*GetSourceInfoReply) IsReplyTo

func (*GetSourceInfoReply) IsReplyTo() uint32

type GetSourceOutputInfo

type GetSourceOutputInfo struct{ SourceOutpuIndex uint32 }

type GetSourceOutputInfoList

type GetSourceOutputInfoList struct{}

type GetSourceOutputInfoListReply

type GetSourceOutputInfoListReply []*GetSourceOutputInfoReply

func (*GetSourceOutputInfoListReply) IsReplyTo

func (*GetSourceOutputInfoListReply) IsReplyTo() uint32

type GetSourceOutputInfoReply

type GetSourceOutputInfoReply struct {
	SourceOutpuIndex uint32
	MediaName        string
	ModuleIndex      uint32
	ClientIndex      uint32
	SourceIndex      uint32
	SampleSpec
	ChannelMap ChannelMap

	SourceOutpuLatency Microseconds
	SourceLatency      Microseconds
	ResampleMethod     string
	Driver             string

	Properties PropList "13"

	Corked bool "19"

	ChannelVolumes ChannelVolumes "22"
	Muted          bool           "22"
	VolumeReadable bool           "22"
	VolumeWritable bool           "22"
	FormatInfo     "22"
}

func (*GetSourceOutputInfoReply) IsReplyTo

func (*GetSourceOutputInfoReply) IsReplyTo() uint32

type KillClient

type KillClient struct{ ClientIndex uint32 }

type KillSinkInput

type KillSinkInput struct{ SinkInputIndex uint32 }

type KillSourceOutput

type KillSourceOutput struct{ SourceOutputIndex uint32 }

type LoadModule

type LoadModule struct {
	Name string
	Args string
}

type LoadModuleReply

type LoadModuleReply struct {
	ModuleIndex uint32
}

func (*LoadModuleReply) IsReplyTo

func (*LoadModuleReply) IsReplyTo() uint32

type LookupSink

type LookupSink struct{ SinkName string }

type LookupSinkReply

type LookupSinkReply struct{ SinkIndex uint32 }

func (*LookupSinkReply) IsReplyTo

func (*LookupSinkReply) IsReplyTo() uint32

type LookupSource

type LookupSource struct{ SourceName string }

type LookupSourceReply

type LookupSourceReply struct{ SourceIndex uint32 }

func (*LookupSourceReply) IsReplyTo

func (*LookupSourceReply) IsReplyTo() uint32

type Microseconds

type Microseconds uint64

type MoveSinkInput

type MoveSinkInput struct {
	SinkInputIndex uint32
	DeviceIndex    uint32
	DeviceName     string
}

type MoveSourceOutput

type MoveSourceOutput struct {
	SourceOutputIndex uint32
	DeviceIndex       uint32
	DeviceName        string
}

type Overflow

type Overflow struct {
	StreamIndex uint32
}

type PlaySample

type PlaySample struct {
	SinkIndex uint32
	SinkName  string
	Volume    uint32
	Name      string

	Properties PropList "13"
}

type PlaybackBufferAttrChanged

type PlaybackBufferAttrChanged struct {
	StreamIndex           uint32
	BufferMaxLength       uint32
	BufferTargetLength    uint32
	BufferPrebufferLength uint32
	BufferMinimumRequest  uint32
	SinkLatency           Microseconds
}

type PlaybackStreamEvent

type PlaybackStreamEvent struct {
	StreamIndex uint32
	Event       string
	Properties  PropList
}

type PlaybackStreamKilled

type PlaybackStreamKilled struct{ StreamIndex uint32 }

type PlaybackStreamMoved

type PlaybackStreamMoved struct {
	StreamIndex uint32
	DestIndex   uint32
	DestName    string
	Suspended   bool

	BufferMaxLength       uint32       "13"
	BufferTargetLength    uint32       "13"
	BufferPrebufferLength uint32       "13"
	BufferMinimumRequest  uint32       "13"
	SinkLatency           Microseconds "13"
}

type PlaybackStreamSuspended

type PlaybackStreamSuspended struct {
	StreamIndex uint32
	Suspended   bool
}

type PrebufPlaybackStream

type PrebufPlaybackStream struct{ StreamIndex uint32 }

type PropList

type PropList map[string]PropListEntry

type PropListEntry

type PropListEntry []byte

func PropListString

func PropListString(s string) PropListEntry

func (PropListEntry) String

func (e PropListEntry) String() string

type ProtocolReader

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

type ProtocolWriter

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

type RecordStreamEvent

type RecordStreamEvent struct {
	StreamIndex uint32
	Event       string
	Properties  PropList
}

type RecordStreamKilled

type RecordStreamKilled struct{ StreamIndex uint32 }

type RecordStreamMoved

type RecordStreamMoved struct {
	StreamIndex uint32
	DestIndex   uint32
	DestName    string
	Suspended   bool

	BufferMaxLength uint32       "13"
	BufferFragSize  uint32       "13"
	SourceLatency   Microseconds "13"
}

type RecordStreamSuspended

type RecordStreamSuspended struct {
	StreamIndex uint32
	Suspended   bool
}

type RemoveClientProplist

type RemoveClientProplist struct {
	Properties PropList // ignored
}

type RemovePlaybackStreamProplist

type RemovePlaybackStreamProplist struct {
	StreamIndex uint32
	Properties  PropList // ignored
}

type RemoveRecordStreamProplist

type RemoveRecordStreamProplist struct {
	StreamIndex uint32
	Properties  PropList // ignored
}

type RemoveSample

type RemoveSample struct {
	Name string
}

type Reply

type Reply interface{ IsReplyTo() uint32 }

type Request

type Request struct {
	StreamIndex uint32
	Length      uint32
}

type RequestArgs

type RequestArgs interface {
	// contains filtered or unexported methods
}

type SampleSpec

type SampleSpec struct {
	Format   byte
	Channels byte
	Rate     uint32
}

type SetCardProfile

type SetCardProfile struct {
	CardIndex   uint32
	CardName    string
	ProfileName string
}

type SetClientName

type SetClientName struct {
	Props PropList
}

type SetClientNameReply

type SetClientNameReply struct {
	ClientIndex uint32
}

func (*SetClientNameReply) IsReplyTo

func (*SetClientNameReply) IsReplyTo() uint32

type SetDefaultSink

type SetDefaultSink struct{ SinkName string }

type SetDefaultSource

type SetDefaultSource struct{ SourceName string }

type SetPlaybackStreamBufferAttr

type SetPlaybackStreamBufferAttr struct {
	StreamIndex           uint32
	BufferMaxLength       uint32
	BufferTargetLength    uint32
	BufferPrebufferLength uint32
	BufferMinimumRequest  uint32

	AdjustLatency bool "13"

	EarlyRequests bool "14"
}

type SetPlaybackStreamBufferAttrReply

type SetPlaybackStreamBufferAttrReply struct {
	BufferMaxLength       uint32
	BufferTargetLength    uint32
	BufferPrebufferLength uint32
	BufferMinimumRequest  uint32

	SinkLatency Microseconds "13"
}

func (*SetPlaybackStreamBufferAttrReply) IsReplyTo

type SetPlaybackStreamName

type SetPlaybackStreamName struct {
	StreamIndex uint32
	Name        string
}

type SetPortLatencyOffset

type SetPortLatencyOffset struct {
	CardIndex uint32
	CardName  string
	PortName  string
	Offset    int64
}

type SetRecordStreamBufferAttr

type SetRecordStreamBufferAttr struct {
	StreamIndex     uint32
	BufferMaxLength uint32
	BufferFragSize  uint32

	AdjustLatency bool "13"

	EarlyRequests bool "14"
}

type SetRecordStreamBufferAttrReply

type SetRecordStreamBufferAttrReply struct {
	BufferMaxLength uint32
	BufferFragSize  uint32

	SourceLatency Microseconds "13"
}

func (*SetRecordStreamBufferAttrReply) IsReplyTo

type SetRecordStreamName

type SetRecordStreamName struct {
	StreamIndex uint32
	Name        string
}

type SetSinkInputMute

type SetSinkInputMute struct {
	SinkInputIndex uint32
	Mute           bool
}

type SetSinkInputVolume

type SetSinkInputVolume struct {
	SinkInputIndex uint32
	ChannelVolumes ChannelVolumes
}

type SetSinkMute

type SetSinkMute struct {
	SinkIndex uint32
	SinkName  string
	Mute      bool
}

type SetSinkPort

type SetSinkPort struct {
	SinkIndex uint32
	SinkName  string
	Port      string
}

type SetSinkVolume

type SetSinkVolume struct {
	SinkIndex      uint32
	SinkName       string
	ChannelVolumes ChannelVolumes
}

type SetSourceMute

type SetSourceMute struct {
	SourceIndex uint32
	SourceName  string
	Mute        bool
}

type SetSourceOutputMute

type SetSourceOutputMute struct {
	SourceOutputIndex uint32
	Mute              bool
}

type SetSourceOutputVolume

type SetSourceOutputVolume struct {
	SourceOutputIndex uint32
	ChannelVolumes    ChannelVolumes
}

type SetSourcePort

type SetSourcePort struct {
	SourceIndex uint32
	SourceName  string
	Port        string
}

type SetSourceVolume

type SetSourceVolume struct {
	SourceIndex    uint32
	SourceName     string
	ChannelVolumes ChannelVolumes
}

type Started

type Started struct{ StreamIndex uint32 }

type Stat

type Stat struct{}

type StatReply

type StatReply struct {
	NumAllocated    uint32
	AllocatedSize   uint32
	NumAccumulated  uint32
	AccumulatedSize uint32
	SampleCacheSize uint32
}

func (*StatReply) IsReplyTo

func (*StatReply) IsReplyTo() uint32

type Subscribe

type Subscribe struct{ Mask SubscriptionMask }

type SubscribeEvent

type SubscribeEvent struct {
	Event SubscriptionEventType
	Index uint32
}

type SubscriptionEventType added in v0.1.1

type SubscriptionEventType uint32
const (
	EventSink SubscriptionEventType = iota
	EventSource
	EventSinkSinkInput
	EventSinkSourceOutput
	EventModule
	EventClient
	EventSampleCache
	EventServer
	EventAutoload
	EventCard
	EventFacilityMask SubscriptionEventType = 0xf

	EventNew      SubscriptionEventType = 0x0000
	EventChange   SubscriptionEventType = 0x0010
	EventRemove   SubscriptionEventType = 0x0020
	EventTypeMask SubscriptionEventType = 0x0030
)

func (SubscriptionEventType) GetFacility added in v0.1.1

func (SubscriptionEventType) GetType added in v0.1.1

func (SubscriptionEventType) String added in v0.1.1

func (e SubscriptionEventType) String() string

type SubscriptionMask added in v0.1.1

type SubscriptionMask uint32
const (
	SubscriptionMaskSink SubscriptionMask = 1 << iota
	SubscriptionMaskSource
	SubscriptionMaskSinkInput
	SubscriptionMaskSourceInput
	SubscriptionMaskModule
	SubscriptionMaskClient
	SubscriptionMaskSampleCache
	SubscriptionMaskServer
	SubscriptionMaskAutoload
	SubscriptionMaskCard

	SubscriptionMaskNull SubscriptionMask = 0
	SubscriptionMaskAll  SubscriptionMask = 0x02ff
)

type SuspendSink

type SuspendSink struct {
	SinkIndex uint32
	SinkName  string
	Suspend   bool
}

type SuspendSource

type SuspendSource struct {
	SourceIndex uint32
	SourceName  string
	Suspend     bool
}

type Time

type Time struct {
	Seconds      uint32
	Microseconds uint32
}

type TriggerPlaybackStream

type TriggerPlaybackStream struct{ StreamIndex uint32 }

type Underflow

type Underflow struct {
	StreamIndex uint32
	Offset      int64 "23"
}

type UnloadModule

type UnloadModule struct{ ModuleIndex uint32 }

type UpdateClientProplist

type UpdateClientProplist struct {
	Mode       uint32
	Properties PropList
}

type UpdatePlaybackStreamProplist

type UpdatePlaybackStreamProplist struct {
	StreamIndex uint32
	Mode        uint32
	Properties  PropList
}

type UpdatePlaybackStreamSampleRate

type UpdatePlaybackStreamSampleRate struct {
	StreamIndex uint32
	SampleRate  uint32
}

type UpdateRecordStreamProplist

type UpdateRecordStreamProplist struct {
	StreamIndex uint32
	Mode        uint32
	Properties  PropList
}

type UpdateRecordStreamSampleRate

type UpdateRecordStreamSampleRate struct {
	StreamIndex uint32
	SampleRate  uint32
}

type Version

type Version uint32

func (Version) Min

func (v Version) Min(u Version) Version

func (Version) Version

func (v Version) Version() int

type Volume

type Volume uint32
const (
	// Muted (minimal valid) volume (0%, -inf dB)
	VolumeMuted Volume = 0
	// Normal volume (100%, 0 dB)
	VolumeNorm Volume = 0x10000
	// Maximum valid volume we can store.
	VolumeMax Volume = math.MaxUint32 / 2
	// Special 'invalid' volume.
	VolumeInvalid Volume = math.MaxUint32
)

Jump to

Keyboard shortcuts

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