Commit graph

7832 commits

Author SHA1 Message Date
Robin Gareus
8ddeb712f6 make debug message more useful 2014-11-23 23:57:55 +01:00
Robin Gareus
5aba4df252 fix/silence various compiler warnings.
* ifdef unused static functions
* brackets around assignment and comparision
* no return statement in function returning non-void
* boost concept_checks.hpp unused-local-typedefs
2014-11-23 23:57:55 +01:00
David Robillard
f1926dc863 Fix build with a certain awful broken compiler. 2014-11-23 16:31:59 -05:00
Robin Gareus
ec01682714 -Wunused-function on windows 2014-11-23 21:01:39 +01:00
Robin Gareus
40764f4cb3 use NULL not 0 for c-functions (even in c++ code)
4.3 KBytes less compiler warnings.
2014-11-23 21:01:39 +01:00
Paul Davis
bfe49540b9 remove use of CrossThreadChannel::selectable() to allow cross-platform implementation of CrossThreadChannel via Glib::IOSource 2014-11-23 17:37:13 +02:00
David Robillard
57c1b6e261 Fix quantization and other time-related ops. 2014-11-22 21:49:42 -05:00
David Robillard
231e0009b4 Max is max and min is min and I am dumb. 2014-11-22 16:33:32 -05:00
David Robillard
42b5ed3904 Fix clang and MSVC build. 2014-11-22 15:26:41 -05:00
David Robillard
c1cfa12d6e Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main
step towards using actual beat:tick time and getting away from floating point
precision problems.
2014-11-22 04:05:42 -05:00
David Robillard
cae74309a5 Fix assert failure in control list interpolation.
How we never hit this before is beyond me, it's in some ooooold code.
2014-11-22 00:46:15 -05:00
David Robillard
01493b14cf Fix const violation warnings in tempo.cc. 2014-11-22 00:46:15 -05:00
David Robillard
4bc0d1c475 Fix lost MIDI note offs and controllers.
Fix initial read of discrete MIDI controllers.

Fix spurious note offs when starting to play in the middle of a note.

Faster search for initial event when cached iterator is invalid.

So much for dropping the cached iterator.  The iterator is responsible for
handling note offs, so that doesn't work.  This design means we have some stuck
note issues at the source read level, but they should be taken care of by the
state tracker anyway.
2014-11-20 15:36:11 -05:00
David Robillard
8bba63282a Reduce unnecessary non-const MIDI buffer access. 2014-11-20 15:32:06 -05:00
David Robillard
8f8a4878f3 Clean up some MIDI code. 2014-11-20 11:31:31 -05:00
Robin Gareus
0c4869dc35 debug trace lost midi-messages 2014-11-20 02:46:30 +01:00
David Robillard
a9936205b1 Fix dropped MIDI events, especially with record enabled.
I am not precisely sure why the cached iterator was causing this problem, it
shouldn't be invalidated, and the times make sense.  It may be some lock
related issue since the iterator holds a lock on the source.

In any case, this cached iterator was just to avoid repeated linear search of
the model, but since the model has a logarithmic search, instead just scrap all
this problematic persistent state and search for the appropriate start time
every read.  No need to be careful about invalidating when anything changes.
2014-11-19 19:24:16 -05:00
Robin Gareus
e3e85a92db some const'ness and hints for clang 2014-11-19 20:38:50 +01:00
Ben Loftis
0fb91e10b4 allow dummy backend for any product 2014-11-18 17:04:23 -06:00
David Robillard
bd577a0663 Avoid possible use of uninitialized values.
This could only happen with a broken widget, but it shuts up clang and doesn't
hurt.
2014-11-18 02:55:03 -05:00
David Robillard
976a150e6b Remove obviously dead/redundant code. 2014-11-18 02:55:03 -05:00
David Robillard
07d4f50689 Clean up funny code and initialize variables. 2014-11-18 02:55:03 -05:00
David Robillard
881d77f1e5 Constrain variable scopen and avoid uninitialized values existing at all.
Note: dead assignments trigger scan-build dead code warnings, which
initializations do not.
2014-11-18 02:55:03 -05:00
David Robillard
6e482b3488 Remove unused variable and redundant arithmetic. 2014-11-18 02:55:03 -05:00
David Robillard
8dde26da7b Gracefully avoid importing audio that somehow has 0 channels. 2014-11-18 02:55:03 -05:00
David Robillard
e5d9fd1aac Fix potential use of uninitialized value. 2014-11-18 02:53:28 -05:00
David Robillard
fed4e8446b Fix NULL pointer dereference on malformed Playlist XML. 2014-11-18 02:53:28 -05:00
David Robillard
afd67800b9 Avoid potential division by zero. 2014-11-18 02:53:28 -05:00
David Robillard
c4c7598adb Fix broken logic and possible NULL pointer dereference for Bundle XML. 2014-11-18 02:53:28 -05:00
David Robillard
26f6f80a53 Fix incredibly unlikely NULL pointer dereference. 2014-11-18 02:53:28 -05:00
David Robillard
9aec0c627d Fix Region::verify_length() so it actually does something. 2014-11-18 02:53:27 -05:00
Robin Gareus
b6db707989 amend 484e38053 2014-11-18 05:28:27 +01:00
Robin Gareus
484e380536 silence clang "dead assignment" warnings 2014-11-18 04:46:37 +01:00
Robin Gareus
37937d9c69 synchronize preferences and monitor-section 2014-11-18 03:49:20 +01:00
Robin Gareus
5e90b97c42 files should have at least one channel. 2014-11-18 02:15:07 +01:00
Robin Gareus
f2273dc3b6 remove dead assignment 2014-11-18 02:15:06 +01:00
Robin Gareus
c194e4df18 remove superfluous if-branch (_session is checked a few lines above) 2014-11-18 02:15:06 +01:00
David Robillard
f7ebae85a7 Fix "maybe" rounding bug.
Introduced in d63161426f.
2014-11-17 19:53:30 -05:00
Robin Gareus
02d735ff00 waves/coreaudio PPC support 2014-11-17 09:07:39 +01:00
Robin Gareus
bd46de779f check alsa midi ringbuffer 2014-11-17 06:50:48 +01:00
David Robillard
b4fcdbb100 Don't add origin value to MIDI controller regions on initial insert.
This should probably hijack the same modifier as the guard points and work the
same on all automation tracks, but I did it this way to not change behaviour of
track automation where a default is much more reasonable.
2014-11-16 22:35:45 -05:00
David Robillard
d63161426f Add "maybe" rounding modes for rounding only if necessary. 2014-11-16 22:35:45 -05:00
David Robillard
fd9ccc7058 Use an enum for RoundMode instead of magic numbers.
No functional changes in this one (for easier auditing), but towards having
round up/down only if necessary modes, rather than kludging around that
situation with a double round as we do currently.
2014-11-16 22:35:45 -05:00
David Robillard
9d4f43fa7d Make ControlList::paste const-correct. 2014-11-16 22:35:45 -05:00
Robin Gareus
df40782b62 prevent segfault if in/out property is missing 2014-11-17 04:05:00 +01:00
Robin Gareus
ad739cd018 add some assert() messages.
as hints clang static analyzer "Called C++ object pointer is null"
2014-11-17 03:49:19 +01:00
David Robillard
333c776e0e Fix MIDI region keyboard editing (add key handling to canvas). 2014-11-15 02:04:28 -05:00
David Robillard
b52407043c Fix crash when copying MIDI regions with midi-copy-is-fork is on (#6002). 2014-11-14 23:53:59 -05:00
David Robillard
94954f852e Fix out of order event errors on save with overlapping notes.
Another consequence of fuzzy Sequence timing, but if the difference is less
than a tick this should handle things correctly.  If the difference is more
than a tick, something's wrong, and it might be okay to just bump forward
anyway, but I can't reproduce this and it could lead to corruption so I'm
leaving that case noisy.
2014-11-14 21:19:09 -05:00
Robin Gareus
6b3a8915f3 add abort() to non-reached code
This cleans up a lot of false-positives in static analysis
and also helps compilers to optimize code paths in general.
(tagging the fatal stingstream operator as ‘noreturn’ is
far less trivial)
2014-11-14 11:30:08 +01:00