It sounds to me like your MacBook Pro is stuck in OPTICAL OUT mode, which is for connecting to DACs or separate receivers.
I have had a few issues like this with my MBP, basically I fixed it by inserting some headphones, switching off, switching back on again, removing the headphones and just generally mucking around with it. I think it's a glitch in the MBP's firmware...