Quantum-state diffusion with a moving basis: Computing quantum-optical spectra.