Equilibrium statistical mechanics of waves in inhomogeneous moving media