gainref_flip_rotate is currently typed as a string. It should be restricted to an enum at least, or perhaps a composite type.