update for new API

rewrite scanner to loudness detector sink
loudness detector: implement attach method

also implement signaling and waiting on cond for events in loudness
detector and player
add cond signaling and waiting to encoder

and add forgotten cond cleanup to player