Problems with Alps Rotary Encoder

Hi again

I have read the most of the site about encoders, and tried all the sketches, the one i got to work the best is the one i posted.
Maybe someone could show me some code, that dont use analog in, but just digital.

I want to use the encoders for volume and skip number functions on a car pc, so the arduino just need to have a couple of buttons mounted and maybe a couple relays, so it should have enough power to do that, and i dont think interupts will be a bad thing when it only need to do these things.