refactor some code, add lock for accessing/setting song gain