Make sample tracks playable from any position, respect tempo automation, time widget...

Ok there's lots of stuff here. I'll try to list them all.

- Firstly, I  changed the way we keep track of time in song.cpp: instead of counting milliseconds there,
we count frames, and then convert to milliseconds when needed. This is much more accurate and it
makes it simple to take tempo in account with the new globalAutomationValueAt() method.
- I added many additional helper functions in song: these are mostly related to tempo and getting frame positions in various miditime positions, and/or the other way around.
- Made time widget respect tempo automation. It should now be as accurate as possible.

Then, the sampletrack stuff:
- Playable from any position. Seems to work pretty robustly: You can start playback while in any position of the tco, you can move the playposition during playback, you can even delete the tco during playback. Updates flawlessly and accurately, the timing should be sample-accurate, thanks to the new frame-counting code in song. This is also tempo-aware and works with tempo-automation.
- Moved the actual play/stop code from the sampletrack to the tco, and the sampletrack only checks whether the tco should change state, and tells it to start/stop playback accordingly. 
- Sampletrack tco's can also be freely resized, and only the "visible" part of the sample will be played - iow,  you can cut a sample short. 
- Sampletrack TCO also has new paintevent, the waveform is painted also in a tempo-aware way, so if you have tempo automation overlapping the tco, it will affect how the tco is drawn. This should help people align their tco's with other song content.

TODOs:
- tempo automations in bb-tracks do not work yet... Meaning that any tempo automation in a bb-track may break the tempo-aware code in both the time widget and sample tracks.
Anyway they can be made to work with some additional code in AutomatableModel.
- The sampletrack drawing code (paintevent) could be optimized more. We could check if there is tempo automation overlapping with the tco, and if not, use a simpler painting algorithm.
- In cases where the TCO playback is cut short (tco length < sample length), we should maybe add a short release phase, a la instrument tracks, to prevent crackling.