diff options
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 4 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlSet.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/evoral/Range.hpp | 10 | ||||
-rw-r--r-- | libs/evoral/evoral/TimeConverter.hpp | 4 | ||||
-rw-r--r-- | libs/evoral/evoral/midi_util.h | 2 | ||||
-rw-r--r-- | libs/evoral/src/Control.cpp | 4 | ||||
-rw-r--r-- | libs/evoral/src/ControlList.cpp | 64 | ||||
-rw-r--r-- | libs/evoral/src/Curve.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/Event.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/Note.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 24 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smf.c | 2 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smf_decode.c | 6 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smf_load.c | 18 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smf_save.c | 2 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smf_tempo.c | 6 | ||||
-rw-r--r-- | libs/evoral/src/libsmf/smfsh.c | 6 | ||||
-rw-r--r-- | libs/evoral/test/CurveTest.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/test/RangeTest.hpp | 2 |
19 files changed, 82 insertions, 82 deletions
diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index 82868cd24c..3784b25720 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -108,7 +108,7 @@ public: void set_descriptor(const ParameterDescriptor& d) { _desc = d; } EventList::size_type size() const { return _events.size(); } - double length() const { + double length() const { Glib::Threads::RWLock::ReaderLock lm (_lock); return _events.empty() ? 0.0 : _events.back()->when; } @@ -126,7 +126,7 @@ public: virtual void add (double when, double value, bool with_guards=true, bool with_initial=true); virtual void editor_add (double when, double value, bool with_guard); - + void fast_simple_add (double when, double value); void erase_range (double start, double end); diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp index 57a77afe71..b7d50d7d2e 100644 --- a/libs/evoral/evoral/ControlSet.hpp +++ b/libs/evoral/evoral/ControlSet.hpp @@ -77,7 +77,7 @@ protected: Controls _controls; PBD::ScopedConnectionList _list_connections; - + private: PBD::ScopedConnectionList _control_connections; diff --git a/libs/evoral/evoral/Range.hpp b/libs/evoral/evoral/Range.hpp index 230b289747..9d47faf30d 100644 --- a/libs/evoral/evoral/Range.hpp +++ b/libs/evoral/evoral/Range.hpp @@ -140,7 +140,7 @@ struct /*LIBEVORAL_API*/ Range { bool empty() const { return from == to; } }; -template<typename T> +template<typename T> bool operator== (Range<T> a, Range<T> b) { return a.from == b.from && a.to == b.to; } @@ -149,7 +149,7 @@ template<typename T> class /*LIBEVORAL_API*/ RangeList { public: RangeList () : _dirty (false) {} - + typedef std::list<Range<T> > List; List const & get () { @@ -171,7 +171,7 @@ public: return; } - restart: + restart: for (typename List::iterator i = _list.begin(); i != _list.end(); ++i) { for (typename List::iterator j = _list.begin(); j != _list.end(); ++j) { @@ -192,7 +192,7 @@ public: } private: - + List _list; bool _dirty; }; @@ -225,7 +225,7 @@ RangeList<T> subtract (Range<T> range, RangeList<T> sub) /* The basic idea here is to keep a list of the result ranges, and subtract the bits of `sub' from them one by one. */ - + for (typename RangeList<T>::List::const_iterator i = s.begin(); i != s.end(); ++i) { /* Here's where we'll put the new current result after subtracting *i from it */ diff --git a/libs/evoral/evoral/TimeConverter.hpp b/libs/evoral/evoral/TimeConverter.hpp index 23e0823ac9..6c02507c17 100644 --- a/libs/evoral/evoral/TimeConverter.hpp +++ b/libs/evoral/evoral/TimeConverter.hpp @@ -50,7 +50,7 @@ public: B origin_b () const { return _origin_b; } - + void set_origin_b (B o) { _origin_b = o; } @@ -68,7 +68,7 @@ template<typename A, typename B> class LIBEVORAL_TEMPLATE_API IdentityConverter : public TimeConverter<A,B> { public: IdentityConverter() {} - + B to(A a) const; A from(B b) const; }; diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h index 9341e1afb2..2ad5b3f328 100644 --- a/libs/evoral/evoral/midi_util.h +++ b/libs/evoral/evoral/midi_util.h @@ -93,7 +93,7 @@ midi_event_size(const uint8_t* buffer) // see http://www.midi.org/techspecs/midimessages.php if (status == MIDI_CMD_COMMON_SYSEX) { int end; - + for (end = 1; buffer[end] != MIDI_CMD_COMMON_SYSEX_END; end++) { if ((buffer[end] & 0x80) != 0) { return -1; diff --git a/libs/evoral/src/Control.cpp b/libs/evoral/src/Control.cpp index 68858cd145..a6cd374c54 100644 --- a/libs/evoral/src/Control.cpp +++ b/libs/evoral/src/Control.cpp @@ -54,7 +54,7 @@ void Control::set_double (double value, double frame, bool to_list) { _user_value = value; - + /* if we're in a write pass, the automation watcher will determine the values and add them to the list, so we we don't need to bother. */ @@ -69,7 +69,7 @@ void Control::set_list(boost::shared_ptr<ControlList> list) { _list_marked_dirty_connection.disconnect (); - + _list = list; if (_list) { diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp index 0755bd27d2..d8665d3396 100644 --- a/libs/evoral/src/ControlList.cpp +++ b/libs/evoral/src/ControlList.cpp @@ -165,7 +165,7 @@ ControlList::operator= (const ControlList& other) _interpolation = other._interpolation; _default_value = other._default_value; - + copy_events (other); } @@ -269,49 +269,49 @@ ControlList::thin (double thinning_factor) { Glib::Threads::RWLock::WriterLock lm (_lock); - + ControlEvent* prevprev = 0; ControlEvent* cur = 0; ControlEvent* prev = 0; iterator pprev; int counter = 0; - + DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 thin from %2 events\n", this, _events.size())); - + for (iterator i = _events.begin(); i != _events.end(); ++i) { - + cur = *i; counter++; - + if (counter > 2) { - + /* compute the area of the triangle formed by 3 points */ - + double area = fabs ((prevprev->when * (prev->value - cur->value)) + (prev->when * (cur->value - prevprev->value)) + (cur->when * (prevprev->value - prev->value))); - + if (area < thinning_factor) { iterator tmp = pprev; - + /* pprev will change to current i is incremented to the next event as we loop. */ - + pprev = i; _events.erase (tmp); changed = true; continue; } } - + prevprev = prev; prev = cur; pprev = i; } - + DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 thin => %2 events\n", this, _events.size())); if (changed) { @@ -358,12 +358,12 @@ ControlList::start_write_pass (double when) new_write_pass = true; did_write_during_pass = false; insert_position = when; - + /* leave the insert iterator invalid, so that we will do the lookup of where it should be in a "lazy" way - deferring it until we actually add the first point (which may never happen). */ - + unlocked_invalidate_insert_iterator (); } @@ -382,9 +382,9 @@ ControlList::write_pass_finished (double /*when*/, double thinning_factor) void ControlList::set_in_write_pass (bool yn, bool add_point, double when) -{ +{ DEBUG_TRACE (DEBUG::ControlList, string_compose ("now in write pass @ %1, add point ? %2\n", when, add_point)); - + _in_write_pass = yn; if (yn && add_point) { @@ -401,19 +401,19 @@ ControlList::add_guard_point (double when) double eval_value = unlocked_eval (insert_position); if (most_recent_insert_iterator == _events.end()) { - + DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert iterator at end, adding eval-value there %2\n", this, eval_value)); _events.push_back (new ControlEvent (when, eval_value)); /* leave insert iterator at the end */ - + } else if ((*most_recent_insert_iterator)->when == when) { DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert iterator at existing point, setting eval-value there %2\n", this, eval_value)); - + /* most_recent_insert_iterator points to a control event already at the insert position, so there is nothing to do. - + ... except ... advance most_recent_insert_iterator so that the "real" @@ -426,22 +426,22 @@ ControlList::add_guard_point (double when) /* insert a new control event at the right spot */ - + DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 insert eval-value %2 just before iterator @ %3\n", this, eval_value, (*most_recent_insert_iterator)->when)); - + most_recent_insert_iterator = _events.insert (most_recent_insert_iterator, new ControlEvent (when, eval_value)); /* advance most_recent_insert_iterator so that the "real" * insert occurs in the right place, since it * points to the control event just inserted. */ - + ++most_recent_insert_iterator; } - + /* don't do this again till the next write pass */ - + new_write_pass = false; } @@ -458,7 +458,7 @@ ControlList::editor_add (double when, double value, bool with_guard) */ if (_events.empty()) { - + /* as long as the point we're adding is not at zero, * add an "anchor" point there. */ @@ -570,7 +570,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial iterator insertion_point; if (_events.empty() && with_initial) { - + /* empty: add an "anchor" point if the point we're adding past time 0 */ if (when >= 1) { @@ -609,7 +609,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial } } else if (!_in_write_pass) { - + /* not in a write pass: figure out the iterator we should insert in front of */ DEBUG_TRACE (DEBUG::ControlList, string_compose ("compute(b) MRI for position %1\n", when)); @@ -621,7 +621,7 @@ ControlList::add (double when, double value, bool with_guards, bool with_initial if (most_recent_insert_iterator == _events.end()) { DEBUG_TRACE (DEBUG::ControlList, string_compose ("@%1 appending new point at end\n", this)); - + const bool done = maybe_insert_straight_line (when, value); if (!done) { _events.push_back (new ControlEvent (when, value)); @@ -1032,7 +1032,7 @@ ControlList::truncate_end (double last_coordinate) _events.back()->when = last_coordinate; _events.back()->value = last_val; } - + unlocked_invalidate_insert_iterator (); mark_dirty(); } @@ -1767,7 +1767,7 @@ ControlList::operator!= (ControlList const & other) const if (i != _events.end ()) { return true; } - + return ( _parameter != other._parameter || _interpolation != other._interpolation || diff --git a/libs/evoral/src/Curve.cpp b/libs/evoral/src/Curve.cpp index aed972659b..8a4aa470c1 100644 --- a/libs/evoral/src/Curve.cpp +++ b/libs/evoral/src/Curve.cpp @@ -221,7 +221,7 @@ Curve::_get_vector (double x0, double x1, float *vec, int32_t veclen) min_x = _list.events().front()->when; if (x0 > max_x) { - /* totally past the end - just fill the entire array with the final value */ + /* totally past the end - just fill the entire array with the final value */ for (int32_t i = 0; i < veclen; ++i) { vec[i] = _list.events().back()->value; } diff --git a/libs/evoral/src/Event.cpp b/libs/evoral/src/Event.cpp index a1dc24ff0d..86b70da87d 100644 --- a/libs/evoral/src/Event.cpp +++ b/libs/evoral/src/Event.cpp @@ -167,7 +167,7 @@ Event<Timestamp>::set_original_time (Timestamp t) { _original_time = t; } - + #endif // EVORAL_EVENT_ALLOC template class Event<Evoral::Beats>; diff --git a/libs/evoral/src/Note.cpp b/libs/evoral/src/Note.cpp index 7e4f58d73f..afd7330325 100644 --- a/libs/evoral/src/Note.cpp +++ b/libs/evoral/src/Note.cpp @@ -68,7 +68,7 @@ Note<Time>::Note(const Note<Time>& copy) _off_event.buffer = _off_event_buffer; memcpy(_off_event_buffer, copy._off_event_buffer, 3); */ - + assert(time() == copy.time()); assert(end_time() == copy.end_time()); assert(length() == copy.length()); diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 0b3d4ac8e1..7f032487b1 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -723,7 +723,7 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) */ typename Sequence<Time>::Notes::iterator i; - + for (i = note_lower_bound(note->time()); i != _notes.end() && (*i)->time() == note->time(); ++i) { if (*i == note) { @@ -763,19 +763,19 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) * in this scenario, we have no choice other than to linear * search the list of notes and find the note by ID. */ - + for (i = _notes.begin(); i != _notes.end(); ++i) { if ((*i)->id() == note->id()) { - + DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\tID-based pass, erasing note #%2 %3 @ %4\n", this, (*i)->id(), (int)(*i)->note(), (*i)->time())); _notes.erase (i); - + if (note->note() == _lowest_note || note->note() == _highest_note) { - + _lowest_note = 127; _highest_note = 0; - + for (typename Sequence<Time>::Notes::iterator ii = _notes.begin(); ii != _notes.end(); ++ii) { if ((*ii)->note() < _lowest_note) _lowest_note = (*ii)->note(); @@ -783,18 +783,18 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) _highest_note = (*ii)->note(); } } - + erased = true; id_matched = true; break; } } } - + if (erased) { Pitches& p (pitches (note->channel())); - + typename Pitches::iterator j; /* if we had to ID-match above, we can't expect to find it in @@ -818,11 +818,11 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) * notes by channel+time. We care only about its note number * so the search_note has all other properties unset. */ - + NotePtr search_note (new Note<Time>(0, Time(), Time(), note->note(), 0)); for (j = p.lower_bound (search_note); j != p.end() && (*j)->note() == note->note(); ++j) { - + if ((*j) == note) { DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\terasing pitch %2 @ %3\n", this, (int)(*j)->note(), (*j)->time())); p.erase (j); @@ -836,7 +836,7 @@ Sequence<Time>::remove_note_unlocked(const constNotePtr note) } _edited = true; - + } else { cerr << "Unable to find note to erase matching " << *note.get() << endmsg; } diff --git a/libs/evoral/src/libsmf/smf.c b/libs/evoral/src/libsmf/smf.c index 67cc7b889e..9117751f54 100644 --- a/libs/evoral/src/libsmf/smf.c +++ b/libs/evoral/src/libsmf/smf.c @@ -180,7 +180,7 @@ smf_add_track(smf_t *smf, smf_track_t *track) #else smf_set_format(smf, 1); #endif - + } } diff --git a/libs/evoral/src/libsmf/smf_decode.c b/libs/evoral/src/libsmf/smf_decode.c index d527cf178a..5555fdcace 100644 --- a/libs/evoral/src/libsmf/smf_decode.c +++ b/libs/evoral/src/libsmf/smf_decode.c @@ -58,7 +58,7 @@ smf_event_is_metadata(const smf_event_t *event) { assert(event->midi_buffer); assert(event->midi_buffer_length > 0); - + if (event->midi_buffer[0] == 0xFF) return (1); @@ -76,7 +76,7 @@ smf_event_is_system_realtime(const smf_event_t *event) if (smf_event_is_metadata(event)) return (0); - + if (event->midi_buffer[0] >= 0xF8) return (1); @@ -105,7 +105,7 @@ smf_event_is_sysex(const smf_event_t *event) { assert(event->midi_buffer); assert(event->midi_buffer_length > 0); - + if (event->midi_buffer[0] == 0xF0) return (1); diff --git a/libs/evoral/src/libsmf/smf_load.c b/libs/evoral/src/libsmf/smf_load.c index 96b36fdbb5..a23a88fa49 100644 --- a/libs/evoral/src/libsmf/smf_load.c +++ b/libs/evoral/src/libsmf/smf_load.c @@ -126,7 +126,7 @@ parse_mthd_header(smf_t *smf) if (!chunk_signature_matches(tmp_mthd, "MThd")) { g_critical("SMF error: MThd signature not found, is that a MIDI file?"); - + return (-2); } @@ -199,7 +199,7 @@ parse_mthd_chunk(smf_t *smf) g_critical("SMF file uses FPS timing instead of PPQN, no support for that yet."); return (-4); } - + return (0); } @@ -372,7 +372,7 @@ expected_message_length(unsigned char status, const unsigned char *second_byte, case 0xA0: /* AfterTouch. */ case 0xB0: /* Control Change. */ case 0xE0: /* Pitch Wheel. */ - return (3); + return (3); case 0xC0: /* Program Change. */ case 0xD0: /* Channel Pressure. */ @@ -388,7 +388,7 @@ static int extract_sysex_event(const unsigned char *buf, const size_t buffer_length, smf_event_t *event, uint32_t *len, int last_status) { (void) last_status; - + int status; int32_t vlq_length, message_length; const unsigned char *c = buf; @@ -433,7 +433,7 @@ static int extract_escaped_event(const unsigned char *buf, const size_t buffer_length, smf_event_t *event, uint32_t *len, int last_status) { (void) last_status; - + int status; int32_t message_length = 0; int32_t vlq_length = 0; @@ -709,7 +709,7 @@ parse_mtrk_header(smf_track_t *track) if (!chunk_signature_matches(mtrk, "MTrk")) { g_warning("SMF warning: Expected MTrk signature, got %c%c%c%c instead; ignoring this chunk.", mtrk->id[0], mtrk->id[1], mtrk->id[2], mtrk->id[3]); - + return (-2); } @@ -741,7 +741,7 @@ smf_event_length_is_valid(const smf_event_t *event) { assert(event); assert(event->midi_buffer); - + int32_t expected; if (event->midi_buffer_length < 1) @@ -854,7 +854,7 @@ load_file_into_buffer(void **file_buffer, size_t *file_buffer_length, FILE* stre *file_buffer = malloc(*file_buffer_length); if (*file_buffer == NULL) { g_critical("malloc(3) failed: %s", strerror(errno)); - + return (-5); } @@ -864,7 +864,7 @@ load_file_into_buffer(void **file_buffer, size_t *file_buffer_length, FILE* stre *file_buffer = NULL; return (-6); } - + return (0); } diff --git a/libs/evoral/src/libsmf/smf_save.c b/libs/evoral/src/libsmf/smf_save.c index 7c5747a3d5..6463955dba 100644 --- a/libs/evoral/src/libsmf/smf_save.c +++ b/libs/evoral/src/libsmf/smf_save.c @@ -539,7 +539,7 @@ smf_validate(smf_t *smf) return (-6); } } - + } return (0); diff --git a/libs/evoral/src/libsmf/smf_tempo.c b/libs/evoral/src/libsmf/smf_tempo.c index fb38ad0933..c172314815 100644 --- a/libs/evoral/src/libsmf/smf_tempo.c +++ b/libs/evoral/src/libsmf/smf_tempo.c @@ -241,7 +241,7 @@ smf_create_tempo_map_and_compute_seconds(smf_t *smf) for (;;) { event = smf_get_next_event(smf); - + if (event == NULL) return; @@ -275,7 +275,7 @@ smf_get_tempo_by_pulses(const smf_t *smf, size_t pulses) return (smf_get_tempo_by_number(smf, 0)); assert(smf->tempo_array != NULL); - + for (i = smf->tempo_array->len; i > 0; i--) { tempo = smf_get_tempo_by_number(smf, i - 1); @@ -302,7 +302,7 @@ smf_get_tempo_by_seconds(const smf_t *smf, double seconds) return (smf_get_tempo_by_number(smf, 0)); assert(smf->tempo_array != NULL); - + for (i = smf->tempo_array->len; i > 0; i--) { tempo = smf_get_tempo_by_number(smf, i - 1); diff --git a/libs/evoral/src/libsmf/smfsh.c b/libs/evoral/src/libsmf/smfsh.c index 139b676eaf..493c664bd2 100644 --- a/libs/evoral/src/libsmf/smfsh.c +++ b/libs/evoral/src/libsmf/smfsh.c @@ -177,7 +177,7 @@ cmd_ppqn(char *new_ppqn) g_message("Pulses Per Quarter Note changed to %d.", smf->ppqn); } - + return (0); } @@ -208,7 +208,7 @@ cmd_format(char *new_format) g_message("Forma changed to %d.", smf->format); } - + return (0); } @@ -343,7 +343,7 @@ show_event(smf_event_t *event) type = "Metadata"; else type = "Event"; - + decoded = smf_event_decode(event); if (decoded == NULL) { diff --git a/libs/evoral/test/CurveTest.cpp b/libs/evoral/test/CurveTest.cpp index e7634f3602..07b4184833 100644 --- a/libs/evoral/test/CurveTest.cpp +++ b/libs/evoral/test/CurveTest.cpp @@ -334,7 +334,7 @@ CurveTest::constrainedCubic () f"2(x2) = 2*(2*f'2(x2) + f'2(x1))/(x2 – x1) - 6*(y2 – y1)/ (x2 – x1)^2 = 2*(2*0 + 1.8181)/(30 – 10) – 6*(150 – 130)/(30 – 10)^2 = -0.11818 - + d2 = 1/6 * (f"2(x2) - f"2(x1))/(x2 – x1) = 1/6 * (-0.11818 + 0.063636)/(30 – 10) = -0.0004545 diff --git a/libs/evoral/test/RangeTest.hpp b/libs/evoral/test/RangeTest.hpp index 2caea410e6..b06a477b4d 100644 --- a/libs/evoral/test/RangeTest.hpp +++ b/libs/evoral/test/RangeTest.hpp @@ -23,4 +23,4 @@ public: void coverageTest (); }; - + |