Move beat_distance calculation after buffer processing to keep them in sync.

Otherwise, during syncs, some beat_distances are pre-processing and
others are post-processing.  This leads to misaligned phase syncs.
Fix phase syncing
remove debugging messages
Merge branch 'master' into sync_fix
Use enums instead of munged ints
Move more state updating into the post process test.

This fixes phase-sync when master sync is not active
Since order doesn't matter, a qset will be faster
Fix enginesync tests now that sync state change is a queued event.
Also fix code that tests revealed was broken!
No need to process master first now that all channels are processed "simultaneously"
No need for this variable any more
Merge branch 'master' into sync_fix
Fix explicit master not updating beat_distance.
Rename beat distance setting funcs to be clearer.
Remove anonymous namespace, which breaks FRIEND_TEST
Merge branch 'master' into sync_fix
Merge branch 'master' into sync_fix
Make sure enable_sync works even if the track is paused or ejected.
Change some of the unit tests to confirm this behavior.
Merge pull request #307 from ywwg/sync_fix

Fix Phase Syncing