SampleBuffer, AFP: implement ping-pong loop mode

This should now work mostly fine. May be some remaining small bugs, but we fixes them when we finds them.

The AFP button graphics are temporary placeholders, as Tres is working on the actual graphics.