digipi/.cache/go-build/a5/a52ee28a86fda889c59cd355222...

304 wiersze
16 KiB
Plaintext

// Code generated by cmd/cgo; DO NOT EDIT.
//line /home/pi/go/src/github.com/mesilliac/pulse-simple/channelmap.go:1:1
package pulse
import (
"errors"
"fmt"
"strings"
"unsafe"
)
/*
#cgo pkg-config: libpulse-simple
#include <stdlib.h>
#include <pulse/channelmap.h>
*/
import _ "unsafe"
type ChannelPosition /*line :18:22*/_Ctype_pa_channel_position_t /*line :18:45*/
const (
CHANNEL_POSITION_INVALID ChannelPosition = ( /*line :21:45*/_Ciconst_PA_CHANNEL_POSITION_INVALID /*line :21:73*/)
CHANNEL_POSITION_MONO ChannelPosition = ( /*line :22:45*/_Ciconst_PA_CHANNEL_POSITION_MONO /*line :22:70*/)
CHANNEL_POSITION_FRONT_LEFT ChannelPosition = ( /*line :24:50*/_Ciconst_PA_CHANNEL_POSITION_FRONT_LEFT /*line :24:81*/)
CHANNEL_POSITION_FRONT_RIGHT ChannelPosition = ( /*line :25:50*/_Ciconst_PA_CHANNEL_POSITION_FRONT_RIGHT /*line :25:82*/)
CHANNEL_POSITION_FRONT_CENTER ChannelPosition = ( /*line :26:50*/_Ciconst_PA_CHANNEL_POSITION_FRONT_CENTER /*line :26:83*/)
CHANNEL_POSITION_LEFT ChannelPosition = ( /*line :28:44*/_Ciconst_PA_CHANNEL_POSITION_LEFT /*line :28:69*/)
CHANNEL_POSITION_RIGHT ChannelPosition = ( /*line :29:44*/_Ciconst_PA_CHANNEL_POSITION_RIGHT /*line :29:70*/)
CHANNEL_POSITION_CENTER ChannelPosition = ( /*line :30:44*/_Ciconst_PA_CHANNEL_POSITION_CENTER /*line :30:71*/)
CHANNEL_POSITION_REAR_CENTER ChannelPosition = ( /*line :32:49*/_Ciconst_PA_CHANNEL_POSITION_REAR_CENTER /*line :32:81*/)
CHANNEL_POSITION_REAR_LEFT ChannelPosition = ( /*line :33:49*/_Ciconst_PA_CHANNEL_POSITION_REAR_LEFT /*line :33:79*/)
CHANNEL_POSITION_REAR_RIGHT ChannelPosition = ( /*line :34:49*/_Ciconst_PA_CHANNEL_POSITION_REAR_RIGHT /*line :34:80*/)
CHANNEL_POSITION_LFE ChannelPosition = ( /*line :36:47*/_Ciconst_PA_CHANNEL_POSITION_LFE /*line :36:71*/)
CHANNEL_POSITION_SUBWOOFER ChannelPosition = ( /*line :37:47*/_Ciconst_PA_CHANNEL_POSITION_SUBWOOFER /*line :37:77*/)
CHANNEL_POSITION_FRONT_LEFT_OF_CENTER ChannelPosition = ( /*line :39:59*/_Ciconst_PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER /*line :39:100*/)
CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER ChannelPosition = ( /*line :40:59*/_Ciconst_PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER /*line :40:101*/)
CHANNEL_POSITION_SIDE_LEFT ChannelPosition = ( /*line :42:48*/_Ciconst_PA_CHANNEL_POSITION_SIDE_LEFT /*line :42:78*/)
CHANNEL_POSITION_SIDE_RIGHT ChannelPosition = ( /*line :43:48*/_Ciconst_PA_CHANNEL_POSITION_SIDE_RIGHT /*line :43:79*/)
CHANNEL_POSITION_AUX0 ChannelPosition = ( /*line :45:43*/_Ciconst_PA_CHANNEL_POSITION_AUX0 /*line :45:68*/)
CHANNEL_POSITION_AUX1 ChannelPosition = ( /*line :46:43*/_Ciconst_PA_CHANNEL_POSITION_AUX1 /*line :46:68*/)
CHANNEL_POSITION_AUX2 ChannelPosition = ( /*line :47:43*/_Ciconst_PA_CHANNEL_POSITION_AUX2 /*line :47:68*/)
CHANNEL_POSITION_AUX3 ChannelPosition = ( /*line :48:43*/_Ciconst_PA_CHANNEL_POSITION_AUX3 /*line :48:68*/)
CHANNEL_POSITION_AUX4 ChannelPosition = ( /*line :49:43*/_Ciconst_PA_CHANNEL_POSITION_AUX4 /*line :49:68*/)
CHANNEL_POSITION_AUX5 ChannelPosition = ( /*line :50:43*/_Ciconst_PA_CHANNEL_POSITION_AUX5 /*line :50:68*/)
CHANNEL_POSITION_AUX6 ChannelPosition = ( /*line :51:43*/_Ciconst_PA_CHANNEL_POSITION_AUX6 /*line :51:68*/)
CHANNEL_POSITION_AUX7 ChannelPosition = ( /*line :52:43*/_Ciconst_PA_CHANNEL_POSITION_AUX7 /*line :52:68*/)
CHANNEL_POSITION_AUX8 ChannelPosition = ( /*line :53:43*/_Ciconst_PA_CHANNEL_POSITION_AUX8 /*line :53:68*/)
CHANNEL_POSITION_AUX9 ChannelPosition = ( /*line :54:43*/_Ciconst_PA_CHANNEL_POSITION_AUX9 /*line :54:68*/)
CHANNEL_POSITION_AUX10 ChannelPosition = ( /*line :55:43*/_Ciconst_PA_CHANNEL_POSITION_AUX10 /*line :55:69*/)
CHANNEL_POSITION_AUX11 ChannelPosition = ( /*line :56:43*/_Ciconst_PA_CHANNEL_POSITION_AUX11 /*line :56:69*/)
CHANNEL_POSITION_AUX12 ChannelPosition = ( /*line :57:43*/_Ciconst_PA_CHANNEL_POSITION_AUX12 /*line :57:69*/)
CHANNEL_POSITION_AUX13 ChannelPosition = ( /*line :58:43*/_Ciconst_PA_CHANNEL_POSITION_AUX13 /*line :58:69*/)
CHANNEL_POSITION_AUX14 ChannelPosition = ( /*line :59:43*/_Ciconst_PA_CHANNEL_POSITION_AUX14 /*line :59:69*/)
CHANNEL_POSITION_AUX15 ChannelPosition = ( /*line :60:43*/_Ciconst_PA_CHANNEL_POSITION_AUX15 /*line :60:69*/)
CHANNEL_POSITION_AUX16 ChannelPosition = ( /*line :61:43*/_Ciconst_PA_CHANNEL_POSITION_AUX16 /*line :61:69*/)
CHANNEL_POSITION_AUX17 ChannelPosition = ( /*line :62:43*/_Ciconst_PA_CHANNEL_POSITION_AUX17 /*line :62:69*/)
CHANNEL_POSITION_AUX18 ChannelPosition = ( /*line :63:43*/_Ciconst_PA_CHANNEL_POSITION_AUX18 /*line :63:69*/)
CHANNEL_POSITION_AUX19 ChannelPosition = ( /*line :64:43*/_Ciconst_PA_CHANNEL_POSITION_AUX19 /*line :64:69*/)
CHANNEL_POSITION_AUX20 ChannelPosition = ( /*line :65:43*/_Ciconst_PA_CHANNEL_POSITION_AUX20 /*line :65:69*/)
CHANNEL_POSITION_AUX21 ChannelPosition = ( /*line :66:43*/_Ciconst_PA_CHANNEL_POSITION_AUX21 /*line :66:69*/)
CHANNEL_POSITION_AUX22 ChannelPosition = ( /*line :67:43*/_Ciconst_PA_CHANNEL_POSITION_AUX22 /*line :67:69*/)
CHANNEL_POSITION_AUX23 ChannelPosition = ( /*line :68:43*/_Ciconst_PA_CHANNEL_POSITION_AUX23 /*line :68:69*/)
CHANNEL_POSITION_AUX24 ChannelPosition = ( /*line :69:43*/_Ciconst_PA_CHANNEL_POSITION_AUX24 /*line :69:69*/)
CHANNEL_POSITION_AUX25 ChannelPosition = ( /*line :70:43*/_Ciconst_PA_CHANNEL_POSITION_AUX25 /*line :70:69*/)
CHANNEL_POSITION_AUX26 ChannelPosition = ( /*line :71:43*/_Ciconst_PA_CHANNEL_POSITION_AUX26 /*line :71:69*/)
CHANNEL_POSITION_AUX27 ChannelPosition = ( /*line :72:43*/_Ciconst_PA_CHANNEL_POSITION_AUX27 /*line :72:69*/)
CHANNEL_POSITION_AUX28 ChannelPosition = ( /*line :73:43*/_Ciconst_PA_CHANNEL_POSITION_AUX28 /*line :73:69*/)
CHANNEL_POSITION_AUX29 ChannelPosition = ( /*line :74:43*/_Ciconst_PA_CHANNEL_POSITION_AUX29 /*line :74:69*/)
CHANNEL_POSITION_AUX30 ChannelPosition = ( /*line :75:43*/_Ciconst_PA_CHANNEL_POSITION_AUX30 /*line :75:69*/)
CHANNEL_POSITION_AUX31 ChannelPosition = ( /*line :76:43*/_Ciconst_PA_CHANNEL_POSITION_AUX31 /*line :76:69*/)
CHANNEL_POSITION_TOP_CENTER ChannelPosition = ( /*line :78:48*/_Ciconst_PA_CHANNEL_POSITION_TOP_CENTER /*line :78:79*/)
CHANNEL_POSITION_TOP_FRONT_LEFT ChannelPosition = ( /*line :80:54*/_Ciconst_PA_CHANNEL_POSITION_TOP_FRONT_LEFT /*line :80:89*/)
CHANNEL_POSITION_TOP_FRONT_RIGHT ChannelPosition = ( /*line :81:54*/_Ciconst_PA_CHANNEL_POSITION_TOP_FRONT_RIGHT /*line :81:90*/)
CHANNEL_POSITION_TOP_FRONT_CENTER ChannelPosition = ( /*line :82:54*/_Ciconst_PA_CHANNEL_POSITION_TOP_FRONT_CENTER /*line :82:91*/)
CHANNEL_POSITION_TOP_REAR_LEFT ChannelPosition = ( /*line :84:53*/_Ciconst_PA_CHANNEL_POSITION_TOP_REAR_LEFT /*line :84:87*/)
CHANNEL_POSITION_TOP_REAR_RIGHT ChannelPosition = ( /*line :85:53*/_Ciconst_PA_CHANNEL_POSITION_TOP_REAR_RIGHT /*line :85:88*/)
CHANNEL_POSITION_TOP_REAR_CENTER ChannelPosition = ( /*line :86:53*/_Ciconst_PA_CHANNEL_POSITION_TOP_REAR_CENTER /*line :86:89*/)
CHANNEL_POSITION_MAX ChannelPosition = ( /*line :88:41*/_Ciconst_PA_CHANNEL_POSITION_MAX /*line :88:65*/)
)
type ChannelPositionMask uint64
// ChannelPosition.Mask makes a bitmask from a ChannelPosition.
func (p ChannelPosition) Mask() ChannelPositionMask {
return 1 << uint(p)
}
type ChannelMapDef /*line :98:20*/_Ctype_pa_channel_map_def_t /*line :98:42*/
const (
CHANNEL_MAP_AIFF ChannelMapDef = ( /*line :101:38*/_Ciconst_PA_CHANNEL_MAP_AIFF /*line :101:58*/)
CHANNEL_MAP_ALSA ChannelMapDef = ( /*line :102:38*/_Ciconst_PA_CHANNEL_MAP_ALSA /*line :102:58*/)
CHANNEL_MAP_AUX ChannelMapDef = ( /*line :103:38*/_Ciconst_PA_CHANNEL_MAP_AUX /*line :103:57*/)
CHANNEL_MAP_WAVEEX ChannelMapDef = ( /*line :104:38*/_Ciconst_PA_CHANNEL_MAP_WAVEEX /*line :104:60*/)
CHANNEL_MAP_OSS ChannelMapDef = ( /*line :105:38*/_Ciconst_PA_CHANNEL_MAP_OSS /*line :105:57*/)
CHANNEL_MAP_DEF_MAX ChannelMapDef = ( /*line :106:38*/_Ciconst_PA_CHANNEL_MAP_DEF_MAX /*line :106:61*/)
CHANNEL_MAP_DEFAULT ChannelMapDef = ( /*line :107:38*/_Ciconst_PA_CHANNEL_MAP_DEFAULT /*line :107:61*/)
)
// ChannelMap can be used to attach labels to specific channels of a stream.
//
// These values are relevant for conversion and mixing of streams.
type ChannelMap struct {
Channels uint8
Map [CHANNELS_MAX]ChannelPosition
}
func (m *ChannelMap) fromC(cmap * /*line :118:34*/_Ctype_pa_channel_map /*line :118:50*/) {
m.Channels = uint8(cmap.channels)
for i := 0; i < CHANNELS_MAX; i++ {
m.Map[i] = ChannelPosition(cmap._map[i])
}
}
func (m *ChannelMap) toC() * /*line :125:29*/_Ctype_pa_channel_map /*line :125:45*/ {
if m == nil {
return nil
}
cmap := & /*line :129:11*/_Ctype_pa_channel_map /*line :129:27*/{}
cmap.channels = /*line :130:18*/_Ctype_uint8_t /*line :130:27*/(m.Channels)
for i := 0; i < CHANNELS_MAX; i++ {
cmap._map[i] = /*line :132:18*/_Ctype_pa_channel_position_t /*line :132:41*/(m.Map[i])
}
return cmap
}
// ChannelMap.Init initializes the ChannelMp to a defined state,
// for which ChannelMap.Valid() will return false.
//
// calling Init() on a ChannelMap is not necessary,
// but this method is included for compatibility.
func (m *ChannelMap) Init() {
m.fromC(( /*line :143:10*/_Cfunc_pa_channel_map_init /*line :143:30*/)(m.toC()))
}
// ChannelMap.InitMono initializes the channel map for monaural audio.
func (m *ChannelMap) InitMono() {
cmap := & /*line :148:11*/_Ctype_pa_channel_map /*line :148:27*/{}
( /*line :149:2*/_Cfunc_pa_channel_map_init_mono /*line :149:27*/)(cmap)
m.fromC(cmap)
}
// ChannelMap.InitStereo initializes the channel map for stereophonic audio.
func (m *ChannelMap) InitStereo() {
cmap := & /*line :155:11*/_Ctype_pa_channel_map /*line :155:27*/{}
( /*line :156:2*/_Cfunc_pa_channel_map_init_stereo /*line :156:29*/)(cmap)
m.fromC(cmap)
}
// ChannelMap.InitAuto initializes the ChannelMap using the given mapping
// and number of channels.
//
// If there is no default channel map known for the given number of channels
// and mapping, then the ChannelMap remains unchanged and an error is returned.
func (m *ChannelMap) InitAuto(channels uint, mapping ChannelMapDef) error {
cmap := & /*line :166:11*/_Ctype_pa_channel_map /*line :166:27*/{}
mapped := ( /*line :167:12*/_Cfunc_pa_channel_map_init_auto /*line :167:37*/)(cmap, /*line :167:45*/_Ctype_unsigned /*line :167:55*/(channels), /*line :167:67*/_Ctype_pa_channel_map_def_t /*line :167:89*/(mapping))
if mapped == nil {
return fmt.Errorf("Could not map %d channels with ChannelMapDef %v", channels, mapping)
}
m.fromC(cmap)
return nil
}
// ChannelMap.InitExtend initializes the ChannelMap using the given mapping
// and number of channels.
//
// If there is no default channel map known for the given number of channels
// and mapping, then it will synthesize a mapping based on a known mapping
// with fewer channels, and fill up the rest with AUX0...AUX31 channels.
func (m *ChannelMap) InitExtend(channels uint, mapping ChannelMapDef) {
cmap := & /*line :182:11*/_Ctype_pa_channel_map /*line :182:27*/{}
( /*line :183:2*/_Cfunc_pa_channel_map_init_extend /*line :183:29*/)(cmap, /*line :183:37*/_Ctype_unsigned /*line :183:47*/(channels), /*line :183:59*/_Ctype_pa_channel_map_def_t /*line :183:81*/(mapping))
m.fromC(cmap)
}
// ChannelPosition.String returns a text label for the channel position.
func (p ChannelPosition) String() string {
cstr := ( /*line :189:10*/_Cfunc_pa_channel_position_to_string /*line :189:40*/)( /*line :189:42*/_Ctype_pa_channel_position_t /*line :189:65*/(p))
return ( /*line :190:9*/_Cfunc_GoString /*line :190:18*/)(cstr)
}
// ChannelPositionFromString returns the ChannelPosition described
// by the given string.
//
// The string should be as returned by ChannelPosition.String().
func ChannelPositionFromString(s string) ChannelPosition {
cstr := ( /*line :198:10*/_Cfunc_CString /*line :198:18*/)(s)
defer func() func() { _cgo0 := /*line :199:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); _Cfunc_free(_cgo0); }}()()
return ChannelPosition(( /*line :200:25*/_Cfunc_pa_channel_position_from_string /*line :200:57*/)(cstr))
}
// ChannelPosition.PrettyString returns a human-readable text label
// for the channel position.
func (p ChannelPosition) PrettyString() string {
cstr := ( /*line :206:10*/_Cfunc_pa_channel_position_to_pretty_string /*line :206:47*/)( /*line :206:49*/_Ctype_pa_channel_position_t /*line :206:72*/(p))
return ( /*line :207:9*/_Cfunc_GoString /*line :207:18*/)(cstr)
}
// ChannelMap.String returns a string describing the mapping.
func (m *ChannelMap) String() string {
s := strings.Repeat(" ", int(( /*line :212:31*/_Ciconst_PA_CHANNEL_MAP_SNPRINT_MAX /*line :212:58*/)))
cstr := ( /*line :213:10*/_Cfunc_CString /*line :213:18*/)(s)
defer func() func() { _cgo0 := /*line :214:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); _Cfunc_free(_cgo0); }}()()
( /*line :215:2*/_Cfunc_pa_channel_map_snprint /*line :215:25*/)(cstr, /*line :215:33*/_Ctype_size_t /*line :215:41*/(( /*line :215:42*/_Ciconst_PA_CHANNEL_MAP_SNPRINT_MAX /*line :215:69*/)), m.toC())
return ( /*line :216:9*/_Cfunc_GoString /*line :216:18*/)(cstr)
}
// ChannelMap.Parse parses a channel position list or well-known mapping name
// into a channel map structure.
//
// Input should be as returned by ChannelMap.Name() or ChannelMap.String().
func (m *ChannelMap) Parse(s string) {
cstr := ( /*line :224:10*/_Cfunc_CString /*line :224:18*/)(s)
defer func() func() { _cgo0 := /*line :225:15*/unsafe.Pointer(cstr); return func() { _cgoCheckPointer(_cgo0, nil); _Cfunc_free(_cgo0); }}()()
m.fromC(( /*line :226:10*/_Cfunc_pa_channel_map_parse /*line :226:31*/)(m.toC(), cstr))
}
// ChannelMap.Equal compares two channel maps, returning true iff they match.
func (m *ChannelMap) Equal(other *ChannelMap) bool {
cmap1 := m.toC()
cmap2 := other.toC()
return ( /*line :233:9*/_Cfunc_pa_channel_map_equal /*line :233:30*/)(cmap1, cmap2) == 1
}
// ChannelMap.Valid returns true iff the channel map is considered valid.
func (m *ChannelMap) Valid() bool {
cmap := m.toC()
return ( /*line :239:9*/_Cfunc_pa_channel_map_valid /*line :239:30*/)(cmap) != 0
}
// ChannelMap.Compatible returns true iff compatible with the given sample spec.
func (m *ChannelMap) Compatible(spec *SampleSpec) bool {
return ( /*line :244:9*/_Cfunc_pa_channel_map_compatible /*line :244:35*/)(m.toC(), spec.toC()) != 0
}
// TODO: fix terminology
// ChannelMap.Superset returns true iff every channel defined in "other"
// is also defined in the ChannelMap.
func (m *ChannelMap) Superset(other *ChannelMap) bool {
return ( /*line :252:9*/_Cfunc_pa_channel_map_superset /*line :252:33*/)(m.toC(), other.toC()) != 0
}
// ChannelMap.CanBalance returns true iff applying a volume 'balance' makes sense
// with this mapping, i.e. there are left/right channels available.
func (m *ChannelMap) CanBalance() bool {
return ( /*line :258:9*/_Cfunc_pa_channel_map_can_balance /*line :258:36*/)(m.toC()) != 0
}
// ChannelMap.CanFade returns true iff applying a volume 'fade' makes sense
// with this mapping, i.e. there are front/rear channels available.
func (m *ChannelMap) CanFade() bool {
return ( /*line :264:9*/_Cfunc_pa_channel_map_can_fade /*line :264:33*/)(m.toC()) != 0
}
// ChannelMap.Name tries to find a well-known name for this channel mapping,
// i.e. "stereo", "surround-71" and so on.
//
// If the channel mapping is unknown, an error will be returned.
func (m *ChannelMap) Name() (string, error) {
cstr := ( /*line :272:10*/_Cfunc_pa_channel_map_to_name /*line :272:33*/)(m.toC())
if cstr == nil {
return "", errors.New("No name found for channel mapping.")
}
return ( /*line :276:9*/_Cfunc_GoString /*line :276:18*/)(cstr), nil
}
// ChannelMap.PrettyName tries to find a human-readable text label
// for this channel mapping, i.e. "Stereo", "Surround 7.1" and so on.
//
// If the channel mapping is unknown, an error will be returned.
func (m *ChannelMap) PrettyName() (string, error) {
cstr := ( /*line :284:10*/_Cfunc_pa_channel_map_to_pretty_name /*line :284:40*/)(m.toC())
if cstr == nil {
return "", errors.New("No name found for channel mapping.")
}
return ( /*line :288:9*/_Cfunc_GoString /*line :288:18*/)(cstr), nil
}
// ChannelMap.HasPosition returns true iff the specified channel position
// is available at least once in the channel map.
func (m *ChannelMap) HasPosition(p ChannelPosition) bool {
return ( /*line :294:9*/_Cfunc_pa_channel_map_has_position /*line :294:37*/)(m.toC(), /*line :294:48*/_Ctype_pa_channel_position_t /*line :294:71*/(p)) != 0
}
// ChannelMap.Mask generates a bitmask from a ChannelMap.
func (m *ChannelMap) Mask() ChannelPositionMask {
return ChannelPositionMask(( /*line :299:29*/_Cfunc_pa_channel_map_mask /*line :299:49*/)(m.toC()))
}