Hearts have confirmed defender Darren Barr and midfielder Gordon Smith will be leaving the club during the summer.