Combining the ensemble and Franck-Condon approaches for calculating spectral shapes of molecules in solution