Running through the bicycle drive system can be done with a shift kit. The bike in the picture was built by the late KC Vale. You can also use an internal geared hub.
It has a freewheel inside of it so the pedals don't spin when the engine is powering the rear wheel. The Staton shift kit could actually hold up to 3 chainrings.
My bike uses a shift kit and can also shift the gears automatically.