On the stationary bike at home, I use the time for 2 different things. I may prefer to listen to music at one time and have several CDs available for this, including exercise type music that encourages you to work at a pace that is just right. At other times, I want to learn something, so I use the time to listen to something available on what I want to do. For instance, I have audio tapes on personal development and on language learning. Depending on my targets, I choose one of those. There are lots of audio tapes available, you can borrow them from your local library, so you could listen to a book if you choose.
In the gym, I use the treadmill for warming up, so keep the time down to 15 minutes, I don't bother with tapes, so try to set myself targets for time or distance and watch the display, while trying to keep good form. It's more difficult to do anything requiring concentration on the treadmill as you need to keep your wits about you!
In terms of swimming, I don't do much these days, but I tried to change stroke, using overarm, breaststroke, back stroke, "Old English / lifesavers' stroke, etc. I also had difficulty keeping in the lane when on my back, so tried to devise methods to work on that.
HOWEVER, instead of doing endurance training, why not move over to high intensity training? There is research that shows that high intensity training can be just as effective and takes less time that endurance training. It can also be used by people recovering from heart attacks because it doesn't stress the heart too much. Here's 1 page on high intensity training from the UK's BBC