In this case, anything that you originally ripped from CD's, you would have to do so again.
You can re-download iTunes purchases free of charge, however.
Make sure you have downloaded and installed the latest version of iTunes before attempting this:http://www.apple.com/itunes/download/
Now, open iTunes
Click the "Store" option in the menubar and choose "Authorize this Computer..." and supply the Apple ID and password XXXXX used to purchase/download the lost music and apps.
Next, select the iTunes Store from the sidebar at the left. Sign in with the same Apple ID and Password, if you are not already.
In the iTunes Store, you should see a Quick Links sidebar at the right side of the page. Look for the "Purchased" option and click it.
On the Purchased page, you will see a toggle near the top-right of the page labeled as "All | Not In My Library". Select "Not In My Library".
Under Music, select "All Songs" from the listing at the left and then click "Download All" in the bottom right.
Repeat the above for "TV Shows", "Apps", and "Books"; making the appropriate choices as applicable.
Hopefully, this info will answer your question. If you continue to have questions on this topic, just reply back to this discussion. I will be more than happy to work with you further.
Thanks and good luck,