On-chip control of light emission by single-photon sources