Improved triplet support in piano roll

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1506 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Paul Giblock
2008-08-27 09:05:37 +00:00
parent 48c8bce9c6
commit f539fce7e1

View File

@@ -1866,23 +1866,20 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
// draw vertical raster
bool triplets = m_quantizeModel.value() > NUM_EVEN_LENGTHS;
int tact_16th = m_currentPosition / (triplets?8:DefaultBeatsPerTact);
// TODO: FIX OFFSET
//int spt = 2 * midiTime::stepsPerTact();
int spt = midiTime::stepsPerTact();
float pp16th = m_ppt / spt;
int bpt = DefaultBeatsPerTact;
if ( triplets ) {
spt = static_cast<int>(1.5 * spt);
bpt = static_cast<int>(bpt * 2.0/3.0);
pp16th *= 2.0/3.0;
}
printf("%d %d\n", (m_currentPosition% DefaultBeatsPerTact ), DefaultBeatsPerTact);
int tact_16th = m_currentPosition / bpt;
const int offset = ( m_currentPosition % (triplets?8:DefaultBeatsPerTact) ) *
m_ppt * (triplets?3.0/3.0:1.0) / midiTime::ticksPerTact();
const int offset = ( m_currentPosition % bpt ) *
m_ppt / midiTime::ticksPerTact();
bool show32nds = ( m_zoomingModel.value() > 3 );