예제 #1
0
파일: channelmap.go 프로젝트: shazow/mog
// 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 := &C.pa_channel_map{}
	mapped := C.pa_channel_map_init_auto(cmap, C.unsigned(channels), C.pa_channel_map_def_t(mapping))
	if mapped == nil {
		return fmt.Errorf("Could not map %d channels with ChannelMapDef %v", channels, mapping)
	}
	m.fromC(cmap)
	return nil
}
예제 #2
0
파일: channelmap.go 프로젝트: shazow/mog
// 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 := &C.pa_channel_map{}
	C.pa_channel_map_init_extend(cmap, C.unsigned(channels), C.pa_channel_map_def_t(mapping))
	m.fromC(cmap)
}