Controlled two-mode emission from the interplay of driving and thermalization in a dye-filled photonic cavity