# @(#) kenwood.dat 1.1 1992-01-14
# John H. DuBois III 1991-12-21

# Lines beginning with # are comments

name=Kenwood Remote Control Unit RC-6010

# Kenwood remote sensor works fine with a transmitter rate of 1600
# transitions/sec

# carrier is the carrier frequency required, in Hz.
# This information may be used by a driver that has access to more than
# one transmitter, or with a system that can set the transmitter frequency.
carrier=40000

# Transmitter codes are given as a string of 1s and 0s in the function code
# table.  The actual IR pulse codes emitted for each 1 and 0 are given by the
# value that "one" and "zero" are set to.  Each character of the values of 
# "one" and "zero" indicates whether the 40 kHz IR transmitter is on for a unit
# of time.  The duration of the unit of time represented by each character of
# the values of "one" and "zero" is given by the value of "cycles".

# cycles is the number of 40 kHz cycles (25 uS periods) represented by each
# character in the definitions of "one" and "zero".
cycles=22

# repeat is the number of times the code should be sent
repeat=1

# pause is the length of time to wait between code repeats.
# It is given in the units given by the definition of "cycles"
# instead of in mS so that equipment that requires a very short
# pause can be accommodated.

# The Kenwood remote only sends the function code once.
# It then sends a button-pressed code that is the same for all buttons
# until the button is released.
# Functions for which a button would be held down (like volume up/down)
# continue for as long as the button-pressed code is sent.
# However, continually transmitting the function code also works,
# so no provision is made here for sending the button-pressed code.
# The following value is the pause between the remote code and the first
# transmission of the button-pressed code.
pause=7

# sleep is the length of time to wait between sending different codes, 
# in milliseconds
# Actual minimum measured at 50 mS
sleep=65

# zero and one describe the waveform used to transmit a zero and one as given
# in the function table.  A '~' represents a period of tranmitter "on" time,
# during which time the emitter will be modulated by a 40 kHz square wave.
# For each '~', <cycles> IR pulses will be transmitted.  A '_' (underscore)
# represents a period of transmitter "off" time.  The period is given by the
# value of cycles.  
zero=~_
one=~___

# start and stop give start and stop codes, if any, that cannot be described
# using ones and zeros as used in the function table and so cannot be given
# as prefixes and suffixes.
# start and stop are given in the same representation as zero and one.
# start and stop are the first and last codes transmitted (they are sent
# before and after prefix and suffix, respectively).
start=~~~~~~~~~~~~~~~~________
stop=

# prefix and suffix give the standard preamble and postamble, if any,
# that come immediately before and after the function code.
# Prefix and suffix are given in the same representation as function codes.
prefix=0001110111100010
suffix=

# Remote functions are given as a line of tab-separated fields:
# Code	Key	Word	Label	Vars	Description
# Code is given as a string of 0's and 1's whose meaning is
# in turn given by the definitions of "zero" and "one".
# Remote is the name of the remote that this function is for.
# Key and Word are the key and word that can be used to send this code.
# If Word is a single character, it should be the same as Key.
# Label is the label to put on a button representation of this function.
# Variable assignments that should only have effect for one function
# are given in the Vars field.
# Description is a description of what this function does.
# Any further fields are appended to Description preceded by a newline.
# A function line can be extended onto multiple lines by beginning the
# extension lines with a tab.
# The tab is included in the value, so a field boundary always exists
# between extention lines.

#Code			Key	Word	Label		Vars	Description
component=amp
# long sleep for power to give switched components a chance to power up
10111001010001100	P	power	power		sleep=500
	Tuner, amp, and switched outlet power on/off
# Selecting a source stops play of all other sources that are Kenwood
# controlled equipment
00101001110101100	1	tape	select tape 1	*
	Select tape deck 1 as amp input & start play (if a Kenwood tape deck)
10101001010101100	2	tape2	select tape 2	*
	Select/Unselect tape deck 2 as amp input
01001001101101100	c	cd	select cd	*
	Select cd player as amp input & start play (if a Kenwood cd player)
00001001111101100	h	phono	select phono	*
	Select turntable as amp input & start play (if a Kenwood turntable)
10001001011101100	t	tuner	select tuner	*
	Select tuner as amp input
01101001100101100	v	video1	select video 1	*
	Select video source 1 as amp input & video monitor output
11001001001101100	V	video2	select video 2	*
	Select video source 2 as amp input & video monitor output
00111001110001100	m	mute	mute		*
	Mute output/Unmute output
# Volume changing on the Kenwood amp is slow because it is electromechanical.
# Set sleep to 135 mS so that a bunch of volume up/downs don't accumulate
# in the tty output buffer!  It would be better to just wait for the buffer
# to drain after each write but awk can't do that.
01011001101001100	d	down	volume down	sleep=%135
	Unmute output & adjust volume down (~67 steps, 135 mS/step)
amp:d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d	q	qtrdown	vol 1/4 down
	*	Set volume 1/4 further down
amp:q,q,q,q		D	zerovol	zero volume	*
	Set volume at zero
amp:u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u	Q	qtrup	vol 1/4 up
	*	Set volume 1/4 further up
11011001001001100	u	up	volume up	sleep=%135
	Unmute output & adjust volume up (~67 steps, 135 mS/step)
10100011010111000	e	eq	equalization	*
	Graphic equalizer enabled/bypassed
11101011000101000	s	surround	surround	*
	Dolby surround sound decoder on/off
#00010000111011110	d	disk	select disk	*
#	Cycle between disk 1-2-3-4-5-6-P
#component=cd
#01100000100111110	<	reverse	reverse search	*
#01110011100011000	l	last	last selection	*
#10010011011011000	.	stop	stop		*
#11010011001011000	p	play	play/pause	*
#11100000000111110	>	forward	forward search	*
#11110011000011000	n	next	next selection	*
#component=phono
#00000011111111000	.	stop	stop		*
#10000011011111000	p	play	play		*
component=tape
10011011011001000	p	play	play side 1	sleep=1000
	Unpause & play side 1; repeat-play single tune if pressed in play mode.
00011011111001000	2	play2	play side 2	sleep=1000
	Unpause & play side 2; repeat-play single tune if pressed in play mode.
00111011110001000	"	pause	pause		sleep=500
	Pause if playing
# Up to 16 selections can be skipped by sending fast rev/fwd multiple times.
01011011101001000	<	reverse	fast reverse	sleep=500
	Wind side 1 reverse/side 2 forward; search for selection if playing
11011011001001000	>	forward	fast forward	sleep=500
	Wind side 1 forward/side 2 reverse; search for selection if playing
10111011010001000	.	stop	stop		*
	Stop playing or winding
01111011100001000	R	record	record		sleep=700
	Begin recording
component=tuner
01110001100011100	a	am	am		*
	Select tuner as amp input and select AM reception
10011001011001100	s	scan	preset scan	*
	Start/stop scanning 20 preset channels; pause 5 sec. on active stations
11110001000011100	f	fm	fm		*
	 Select tuner as amp input and select FM reception
tuner:s,s		n	next	next station	*
	Go to next preset station