Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Gitea
2019-09-17 22:17:50 +02:00
3 changed files with 39 additions and 2 deletions

31
.travis.yml Normal file
View File

@@ -0,0 +1,31 @@
language: cpp
os: linux
sudo: false
dist: trusty
compiler:
- gcc
- clang
cache:
directories:
- ~/.ccache
- qt5
install:
- mkdir -p qt5
- if [ ! -d qt5/.git ] ; then rm qt5 -Rf ; git clone --branch=5.10 git://code.qt.io/qt/qt5.git ; fi
- pushd qt5
- if [ ! -d qtbase/.git ] ; then perl init-repository --module-subset=qtbase,qtimageformats,qtmultimedia,qttools ; fi
- if [ ! -f config.summary ] ; then ./configure -prefix `pwd`/build -opensource -confirm-license -nomake examples -nomake tests ; fi
- if [ ! -d build ] ; then make -j2 > /dev/null && make install ; fi
- popd
- ccache -s
script:
- mkdir -p build
- pushd build
- ../qt5/build/bin/qmake CONFIG+=ccache .. -config release
- make -j2
- make install
- popd

View File

@@ -47,6 +47,8 @@ void OsciWidget::renderSamples(const SamplePair *begin, const SamplePair *end)
{
m_callbacksCounter++;
m_samplesCounter += std::distance(begin, end);
m_buffer.insert(m_buffer.end(), begin, end);
}
@@ -57,9 +59,10 @@ void OsciWidget::paintEvent(QPaintEvent *event)
m_frameCounter++;
if (m_statsTimer.hasExpired(1000))
{
emit statusUpdate(QString("%0FPS (%1 audio callbacks)").arg(m_frameCounter).arg(m_callbacksCounter));
emit statusUpdate(QString("%0FPS (%1 callbacks, %2 samples, %3 avg per callback)").arg(m_frameCounter).arg(m_callbacksCounter).arg(m_samplesCounter).arg(m_callbacksCounter>0?m_samplesCounter/m_callbacksCounter:0));
m_frameCounter = 0;
m_callbacksCounter = 0;
m_samplesCounter = 0;
m_statsTimer.restart();
}
@@ -73,7 +76,10 @@ void OsciWidget::updateFrameBuffer()
if(m_buffer.empty()) return;
if (m_pixmap.size() != size())
{
m_pixmap = QPixmap(size());
m_pixmap.fill(Qt::black);
}
QPainter painter(&m_pixmap);

View File

@@ -50,7 +50,7 @@ private:
std::vector<SamplePair> m_buffer;
int m_frameCounter{0}, m_callbacksCounter{0};
int m_frameCounter{0}, m_callbacksCounter{0}, m_samplesCounter{0};
QElapsedTimer m_statsTimer;
int m_redrawTimerId;