Quantum and classical control of single photon states via a mechanical resonator