"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/scrubbar.cpp" between
shotcut-20.09.01.tar.gz and shotcut-20.09.13.tar.gz

About: Shotcut is a cross-platform (Qt) advanced video editor.

scrubbar.cpp  (shotcut-20.09.01):scrubbar.cpp  (shotcut-20.09.13)
/* /*
* Copyright (c) 2011-2019 Meltytech, LLC * Copyright (c) 2011-2020 Meltytech, LLC
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 56 skipping to change at line 56
{ {
if (!m_timecodeWidth) { if (!m_timecodeWidth) {
const int fontSize = font().pointSize() - (font().pointSize() > 10? 2 : (font().pointSize() > 8? 1 : 0)); const int fontSize = font().pointSize() - (font().pointSize() > 10? 2 : (font().pointSize() > 8? 1 : 0));
setFont(QFont(font().family(), fontSize * devicePixelRatio())); setFont(QFont(font().family(), fontSize * devicePixelRatio()));
m_timecodeWidth = fontMetrics().width("00:00:00:00") / devicePixelRatio( ); m_timecodeWidth = fontMetrics().width("00:00:00:00") / devicePixelRatio( );
} }
m_max = maximum; m_max = maximum;
/// m_scale is the pixels per frame ratio /// m_scale is the pixels per frame ratio
m_scale = (double) (width() - 2 * m_margin) / (double) maximum; m_scale = (double) (width() - 2 * m_margin) / (double) maximum;
if (m_scale == 0) m_scale = -1; if (m_scale == 0) m_scale = -1;
m_secondsPerTick = qRound(double(m_timecodeWidth * 1.8) / m_scale / m_fps); m_secondsPerTick = qMax(qRound(double(m_timecodeWidth * 1.8) / m_scale / m_f ps), 1);
if (m_secondsPerTick > 3600) if (m_secondsPerTick > 3600)
// force to a multiple of one hour // force to a multiple of one hour
m_secondsPerTick += 3600 - m_secondsPerTick % 3600; m_secondsPerTick += 3600 - m_secondsPerTick % 3600;
else if (m_secondsPerTick > 300) else if (m_secondsPerTick > 300)
// force to a multiple of 5 minutes // force to a multiple of 5 minutes
m_secondsPerTick += 300 - m_secondsPerTick % 300; m_secondsPerTick += 300 - m_secondsPerTick % 300;
else if (m_secondsPerTick > 60) else if (m_secondsPerTick > 60)
// force to a multiple of one minute // force to a multiple of one minute
m_secondsPerTick += 60 - m_secondsPerTick % 60; m_secondsPerTick += 60 - m_secondsPerTick % 60;
else if (m_secondsPerTick > 5) else if (m_secondsPerTick > 5)
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)