# BlueALSA integration setup

# By default the predefined "bluealsa" PCM will use
# the most recently connected Bluetooth device.
defaults.bluealsa.device "00:00:00:00:00:00"
# Default to A2DP connection because that is what
# most people want to use - high quality audio.
defaults.bluealsa.profile "a2dp"
# By default allow BlueALSA to negotiate the "best"
# codec for each PCM.
defaults.bluealsa.codec "unchanged"
# By default do not change the volume or mute state
# when a PCM is opened.
defaults.bluealsa.volume "unchanged"
# By default do not modify the software volume state
# when a PCM is opened.
defaults.bluealsa.softvol "unchanged"
# If Bluetooth sink device (e.g. headphones) supports
# A2DP v1.3 or later it will report delay by itself,
# so there is no need to set the delay manually.
defaults.bluealsa.delay 0
defaults.bluealsa.service "org.bluealsa"
# Default for mixer is to show all PCMs
defaults.bluealsa.ctl.device "FF:FF:FF:FF:FF:FF"
# By default do not show additional controls. It is advised to
# read the documentation for "bluealsa" control plugin before
# enabling this option.
defaults.bluealsa.ctl.extended "no"
defaults.bluealsa.ctl.battery "no"
defaults.bluealsa.ctl.bttransport "no"
defaults.bluealsa.ctl.dynamic "yes"

ctl.bluealsa {
	@args [ DEV EXT BAT BTT DYN SRV ]
	@args.DEV {
		type string
		default {
			@func refer
			name defaults.bluealsa.ctl.device
		}
	}
	@args.EXT {
		type string
		default {
			@func refer
			name defaults.bluealsa.ctl.extended
		}
	}
	@args.BAT {
		type string
		default {
			@func refer
			name defaults.bluealsa.ctl.battery
		}
	}
	@args.BTT {
		type string
		default {
			@func refer
			name defaults.bluealsa.ctl.bttransport
		}
	}
	@args.DYN {
		type string
		default {
			@func refer
			name defaults.bluealsa.ctl.dynamic
		}
	}
	@args.SRV {
		type string
		default {
			@func refer
			name defaults.bluealsa.service
		}
	}
	type bluealsa
	device $DEV
	extended $EXT
	battery $BAT
	bttransport $BTT
	dynamic $DYN
	service $SRV
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Bluetooth Audio Control Device"
	}
}

pcm.bluealsa {
	@args [ DEV PROFILE CODEC VOL SOFTVOL DELAY SRV ]
	@args.DEV {
		type string
		default {
			@func refer
			name defaults.bluealsa.device
		}
	}
	@args.PROFILE {
		type string
		default {
			@func refer
			name defaults.bluealsa.profile
		}
	}
	@args.CODEC {
		type string
		default {
			@func refer
			name defaults.bluealsa.codec
		}
	}
	@args.VOL {
		type string
		default {
			@func refer
			name defaults.bluealsa.volume
		}
	}
	@args.SOFTVOL {
		type string
		default {
			@func refer
			name defaults.bluealsa.softvol
		}
	}
	@args.DELAY {
		type integer
		default {
			@func refer
			name defaults.bluealsa.delay
		}
	}
	@args.SRV {
		type string
		default {
			@func refer
			name defaults.bluealsa.service
		}
	}
	type plug
	slave.pcm {
		type bluealsa
		device $DEV
		profile $PROFILE
		codec $CODEC
		volume $VOL
		softvol $SOFTVOL
		delay $DELAY
		service $SRV
	}
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Bluetooth Audio"
	}
}
