Commit Graph

35 Commits

Author SHA1 Message Date
Lukas W
966bf1c6de Use CMake GenerateExportHeader 2018-07-07 11:20:54 +02:00
Matt Kline
ebed0296b3 Axe atomic int (#4326)
* ThreadableJob: Move from AtomicInt to std::atomic

This is the first in a series of commits that migrates away from
AtomicInt towards the C++11 standard library types.
This would allow the removal of AtomicInt and related Qt
version-specific code.

While we're at it, also make ProcessingState an `enum class` so that
it's not implicitly convertible to integers.

* LocklessAllocator: Switch from AtomicInt to std::atomic_int

If it looks like some assignments around the Compare & Swap loops went
missing, it's because compare_exchange_weak() updates the first argument
to the current value when it fails (i.e., returns false).

* BufferManager: Remove extra AtomicInt include

* MixerWorkerThread: AtomicInt to std::atomic_int

* NotePlayHandle: AtomicInt to std::atomic_int

* Remove AtomicInt.h

* Move from QAtomicPointer to std::atomic<T*>

This removes some #ifdef trickery that was being used to get
load-acquire and store-release from Qt5 and "plain" (presumably
sequentially-consistent) loads and stores from Qt4.
2018-04-28 12:54:46 -07:00
Colin Wallace
b706ee208d Replace more instances new/delete with owning types (#4245)
* Use owning types when possible.

Note: the QByteArray s is detached to mimic previous behavior;
detach() guarantees that the QByteArray uniquely owns its data, since
otherwise it's COW. This may be relevant in case Plugin:instantiate
modifies s.data() -- this way the original QString is safe.

* Make m_filter a unique_ptr.

* Make m_activeRenderer a unique_ptr

* use std::string instead of strcpy + buffers
2018-03-15 18:46:55 -07:00
Lukas W
8f3ab4b1b0 Merge branch 'master' into fix/msvc
# Conflicts:
#	plugins/LadspaEffect/CMakeLists.txt
#	plugins/Xpressive/Xpressive.cpp
#	plugins/opl2/CMakeLists.txt
#	plugins/papu/CMakeLists.txt
#	plugins/xpressive/CMakeLists.txt
#	src/CMakeLists.txt
2017-11-22 17:34:22 +01:00
Lukas W
852708863a Fix Linux compilation issues caused by MSVC fixes 2017-11-22 16:36:51 +01:00
Hyunin Song
2d07efd1dd Replace NotePlayHandle::done() to the actual destructor 2017-10-16 15:26:05 +09:00
Andrés
31126b0aa4 Midi sustain working when envelope is on (#3730)
* midi sustain working when envelope is on

* pressing sustain pedal again doesn't pause release

[cherry-picked from master]
2017-08-02 07:39:00 +02:00
Andrés
44028c8594 Midi sustain working when envelope is on (#3730)
* midi sustain working when envelope is on

* pressing sustain pedal again doesn't pause release
2017-08-02 07:20:09 +02:00
Lukas W
29f832034a Remove unused includes (#3429) 2017-03-16 11:35:18 +00:00
grejppi
9e85d7c66e update all copyright headers to the proper url (#3326) 2017-02-06 02:41:15 +02:00
Oskar Wallgren
a4f5834019 Extended arpeggiator functions (#2130) 2016-09-10 03:40:27 +00:00
Fastigium
eec7f634a8 Update two NotePlayHandle methods to ignore child NotePlayHandles
The methods NotePlayHandle::index and NotePlayHandle::nphsOfInstrumentTrack
had not yet been brought up-to-date with the new system of attaching child
NotePlayHandles directly to the mixer. This caused strange glitches when
arpeggio was used in sort mode.
2016-02-23 10:36:35 +01:00
Lukas W
8b0b2df38e Fix compilation for Qt 5.0 2015-06-21 15:41:26 +02:00
Lukas W
df9d495571 Some #include cleanups 2015-01-22 16:28:41 +01:00
Lukas W
d57b51142d Rename basicFilters/basic_filters.h 2014-11-26 10:59:35 +01:00
Lukas W
aaeb5216ad Rename note to Note 2014-11-26 01:14:52 +01:00
Lukas W
d318cbb1e7 Move track.h -> Track.h, track.cpp -> Track.cpp 2014-11-25 17:10:49 +01:00
Lukas W
9dfb1385cd Rename track class to Track 2014-11-25 17:03:39 +01:00
Vesa
311d33d648 Implement BufferManager
Also, apply things learned while writing BufferManager to the similar NotePlayHandleManager
2014-11-18 13:58:38 +02:00
Vesa
a8211873b5 Fix arpeggio to work better with the new way to handle note offsets
Ok, not really related to memory management, but was something that needed doing and it's easier to test things when things work properly
2014-11-18 13:58:37 +02:00
Vesa
8fb8c683f9 Changing and fixing some stuff
- QHash is better to use than QMap in MemoryManager: faster lookups, able to reserve memory in advance
- Also: reserve memory in advance for the QVector and QHash, so we don't get needles allocs for them
- No need to do cleanup for the nph manager, as it uses the generic manager for allocs, and that already gets cleaned up
2014-11-18 13:58:37 +02:00
Vesa
42e67d27a1 Add dedicated manager for noteplayhandles
This caches and reuses nph's independently of the generic memory manager.
2014-11-18 13:58:37 +02:00
Vesa
5e4308507b More fixes 2014-11-18 13:58:37 +02:00
Vesa
9c25be1bde LMMS Memory Manager 2014-11-18 13:58:36 +02:00
Lukas W
8e8879f735 Merge stable-1.1
Conflicts:
	include/ConfigManager.h
	include/MidiTime.h
	include/string_pair_drag.h
	src/gui/string_pair_drag.cpp
	src/gui/widgets/rubberband.cpp
2014-11-10 19:26:59 +01:00
Umcaruje
6fb923cba2 Correct the program name and site in the descriptions. 2014-11-04 22:56:50 +01:00
Vesa
079a54e159 More fixing of teh playhandles 2014-08-03 22:09:27 +03:00
Vesa
270af579b8 Revision of handling of frameoffset for NPH, SPH
Change in handling of frameoffset for multistreamed instruments and sampletracks.
- Instead of holding the offset for the lifetime of the playhandle, negate the offset in the first period
- Multistream-instruments require some small changes: they have to now check for the offset and accordingly leave empty space in the start of the period (already done in this commit)
- There are possibly optimizations that can be done later
- This change is necessary so that we can have sample-exact models, and sample-exact vol/pan knobs for all instruments. Earlier multistream instruments were always rendering some frames ahead-of-time, so applying sample-exact data for them would have been impossible, since we don't have the future-values yet...
2014-06-29 23:13:00 +03:00
Vesa
a172783cd0 3-in-1 bugfix special
Fixes bugs: #568, #289 and the incorrect timing for midi-noteoffs (see mailing list)
2014-06-14 14:37:07 +03:00
Tobias Doerffel
6650dd356d NotePlayHandle, InstrumentFunctions: reworked stacking and arpeggio handling
Instead of having various flags for realizing the arpeggion functionality
use a more generic approach here using the recently introduced "origin"
property.
2014-03-26 11:40:32 +01:00
Tobias Doerffel
0ca3901ab8 Normalize volume 100% to MIDI velocity 63
Furthermore moved midiVelocity() to Note and removed global volumeToMidi()
helper method.

Closes #280.
2014-03-08 12:13:42 +01:00
Tobias Doerffel
9eafca3615 Note, NotePlayHandle: no default arguments for setVolume() and setPanning() 2014-02-25 00:27:11 +01:00
Tobias Doerffel
7e680abf13 InstrumentTrack, NotePlayHandle: ignore volume of InstrumentTrack for MIDI events
The volume of an InstrumentTrack is applied separately when post-processing
the audio buffer and is not related to MIDI processing. It therefore should
not be included into MIDI velocity calculation.

Closes #301.
2014-02-13 01:35:49 +01:00
Tobias Doerffel
9852cb9a57 NotePlayHandle, InstrumentTrack: removed obsolete singerbot support
The singerbot plugin doesn't exist anymore and thus any support in the
code base just adds complexity and confusion, therefore remove it.
2014-01-29 23:56:07 +01:00
Tobias Doerffel
ca0e413fd3 Renamed PlayHandle classes and some functions with bool return values
Next big coding style update - this time all PlayHandle classes are
affected. Functions like done() and released() were renamed to
isFinished() and isReleased().
2014-01-29 23:54:47 +01:00