iMac in a home Hi-Fi system.

Help the correct integration of iMac into a Home hi-fi system. The question of setting import music iTunes: what format to choose for music downloaded from the Internet-Apple lossless or AAC and what have ripped CD - AIFF? Next, how to get music from iMac and how to properly configure the audio-midi input and output?