Commit Graph

11 Commits

Author SHA1 Message Date
Johannes Lorenz
63d03fa3a7 Fix Uninitialized Value Conditional Jump
Introduced in #5970 , `CPULoadWidget::m_stepSize` is uninitialized,
leading to valgrind warnings:

```
==9429== Conditional jump or move depends on uninitialised value(s)
==9429==    at 0x3715A9: int const& std::max<int>(int const&, int const&) (stl_algobase.h:262)
==9429==    by 0x59E3BB: lmms::gui::CPULoadWidget::stepSize() const (CPULoadWidget.h:59)
==9429==    by 0x59DA2E: lmms::gui::CPULoadWidget::paintEvent(QPaintEvent*) (CPULoadWidget.cpp:78)
```

Even though `grep` shows:

```
data/themes/classic/style.css:  qproperty-stepSize: 4;
data/themes/default/style.css:  qproperty-stepSize: 1;
```

It seems like the issue is caused by paint events occurring even before
the style sheet has been applied. In order to fix this, and to be future
proof with style sheets which do not set it, we initialize
`CPULoadWidget::m_stepSize` to `1`.
2023-10-21 18:21:21 +02:00
Martin Pavelek
de062d6c54 Show detailed CPU load information in a tool-tip (#5970)
* Profiler rework

* Workaround for GCC bug

* Rollback QFile removal

* Use enum instead of a plain index to describe detailed stats

* Use the GCC workaround code for all compilers to avoid redundancy

* Update and fix comments

* Implement suggestions from review

* Split AudioEngine::renderNextBuffer() into separate functions, fix old formatting

* Remove QFile include

* Revert formatting changes

* Apply suggestion from review (remove unnecessary template parameter)

* Revert more formatting changes

* Convert DetailType to enum class

* DetailType enum class improvements suggested in review

* Use std::atomic for m_detailLoad

* RAII-style profiler probes

* Apply suggestions from code review

Co-authored-by: Dominic Clark <mrdomclark@gmail.com>

* Fix namespace comment

* Improve CPU load widget precision and use floats for load computations

* Atomic m_cpuLoad

* Add custom step size support for CPULoadWidget

* Apply suggestions from review (convert the profiler probe into a nested class, other small changes)

* Do not limit stored load averages to 100%

---------

Co-authored-by: sakertooth <sakertooth@gmail.com>
Co-authored-by: Dominic Clark <mrdomclark@gmail.com>
2023-09-04 19:33:42 -04:00
Dalton Messmer
2c6d88f799 Add GUARD_H closing comments 2023-01-05 17:58:49 -05:00
Dalton Messmer
fe6df8dbaf Add namespace prefix to include guards 2023-01-02 19:51:32 -05:00
Levin Oehlmann
28ec71f91a clang-tidy: Apply modernize-use-equals-default everywhere (#6450) 2022-06-26 08:48:24 +02:00
Levin Oehlmann
5904b249c0 clang-tidy: Apply modernize-use-override everywhere (#6439)
... to mark overriding functions `override` instead of `virtual`.
2022-06-19 23:03:55 +02:00
Levin Oehlmann
7227c89847 Namespace lmms (#6174)
This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules.

Also, this PR changes back `LmmsCore` to `Engine`, reverting c519921306 .

Co-authored-by: allejok96 <allejok96@gmail.com>
2022-06-19 20:08:46 +02:00
Johannes Lorenz
7db3fa94a1 Improve includes (#6320)
* Update ringbuffer submodule to fix includes

* Remove cyclic includes

* Remove Qt include prefixes

* Include C++ versions of C headers

E.g.: assert.h -> cassert

* Move CLIP_BORDER_WIDTH into ClipView

This allows to remove includes to TrackView.h in ClipView cpp files.

* Elliminate useless includes

This improves the include structure by elliminating includes that are
not used. Most of this was done by using `include-what-you-use` with
`CMAKE_C_INCLUDE_WHAT_YOU_USE` and `CMAKE_CXX_INCLUDE_WHAT_YOU_USE`
set to (broken down here):

```
include-what-you-use;
    -Xiwyu;--mapping_file=/usr/share/include-what-you-use/qt5_11.imp;
    -Xiwyu;--keep=*/xmmintrin.h;
    -Xiwyu;--keep=*/lmmsconfig.h;
    -Xiwyu;--keep=*/weak_libjack.h;
    -Xiwyu;--keep=*/sys/*;
    -Xiwyu;--keep=*/debug.h;
    -Xiwyu;--keep=*/SDL/*;
    -Xiwyu;--keep=*/alsa/*;
    -Xiwyu;--keep=*/FL/x.h;
    -Xiwyu;--keep=*/MidiApple.h;
    -Xiwyu;--keep=*/MidiWinMM.h;
    -Xiwyu;--keep=*/AudioSoundIo.h
```

* Fixup: Remove empty #if-#ifdef pairs

* Remove LMMS_HAVE_STD(LIB|INT)_H
2022-03-02 13:30:43 +01:00
David CARLIER
dac59a5fa0 C++11 inheritance updates
Add `override` and remove `virtual` where applicable
2019-10-31 20:05:33 +01:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Lukas W
1bbf7455a4 Rename a lot… 2014-11-26 10:09:49 +01:00