The terminal is about a 25 minute taxi drive from the airport and costs 25-30 euros. Normally embarkation starts around midday and the ship sails between 5.00 - 7.00 depending on ports of call. So you have time, but will need to be quic.
Agree with above info, but it's only 6 mins by taxi (about 5 euro)from Barcelona to the port or 30mins walk so if you check in early, you'll have an afternoon to visit the place.
It depends on what time of day you arrive, the jurney from the airport is usualy 25mins but can take an hour or more at rush hour, I think I paid 18€ earlier this year.
Its a long walk from the terminal into town but taxies are coming and going all the time, just wait at the terminal door.
Don't take all your money and cards ashore, just enough cash for the afternoon, there are pick pockets about.
Have a nice cruise.