diff options
author | David Robillard <d@drobilla.net> | 2009-10-14 16:10:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-14 16:10:01 +0000 |
commit | bb9cc45cd22af67ac275a5e73accbe14fee664d8 (patch) | |
tree | e52977d3eae6ff07b856088041a080a2fa3e5b79 /libs/evoral/evoral | |
parent | 8c4ce1e2ce35571aed5a686671431fdfffae7f8c (diff) |
Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing). Whitespace changes only.
Vimmers, try let c_space_errors = 1 in your .vimrc to highlight this kind of stuff in red. I don't know the emacs equivalent...
git-svn-id: svn://localhost/ardour2/branches/3.0@5773 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/evoral')
-rw-r--r-- | libs/evoral/evoral/Control.hpp | 8 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlList.hpp | 30 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlSet.hpp | 14 | ||||
-rw-r--r-- | libs/evoral/evoral/Curve.hpp | 8 | ||||
-rw-r--r-- | libs/evoral/evoral/Event.hpp | 22 | ||||
-rw-r--r-- | libs/evoral/evoral/EventRingBuffer.hpp | 10 | ||||
-rw-r--r-- | libs/evoral/evoral/EventSink.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/evoral/MIDIEvent.hpp | 12 | ||||
-rw-r--r-- | libs/evoral/evoral/MIDIParameters.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/evoral/Note.hpp | 22 | ||||
-rw-r--r-- | libs/evoral/evoral/OldSMF.hpp | 20 | ||||
-rw-r--r-- | libs/evoral/evoral/Parameter.hpp | 38 | ||||
-rw-r--r-- | libs/evoral/evoral/RingBuffer.hpp | 42 | ||||
-rw-r--r-- | libs/evoral/evoral/SMF.hpp | 20 | ||||
-rw-r--r-- | libs/evoral/evoral/SMFReader.hpp | 14 | ||||
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 44 | ||||
-rw-r--r-- | libs/evoral/evoral/TimeConverter.hpp | 8 | ||||
-rw-r--r-- | libs/evoral/evoral/TypeMap.hpp | 10 | ||||
-rw-r--r-- | libs/evoral/evoral/midi_util.h | 10 | ||||
-rw-r--r-- | libs/evoral/evoral/types.hpp | 10 |
20 files changed, 177 insertions, 177 deletions
diff --git a/libs/evoral/evoral/Control.hpp b/libs/evoral/evoral/Control.hpp index 806125d973..d79ef25b5a 100644 --- a/libs/evoral/evoral/Control.hpp +++ b/libs/evoral/evoral/Control.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -38,7 +38,7 @@ public: virtual void set_float(float val, bool to_list=false, FrameTime frame=0); virtual float get_float(bool from_list=false, FrameTime frame=0) const; - + /** Get the latest user-set value * (which may not equal get_value() when automation is playing back). diff --git a/libs/evoral/evoral/ControlList.hpp b/libs/evoral/evoral/ControlList.hpp index ce5a98261b..b4c8590cb6 100644 --- a/libs/evoral/evoral/ControlList.hpp +++ b/libs/evoral/evoral/ControlList.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -38,7 +38,7 @@ struct ControlEvent { : when (w), value (v), coeff (0) {} - ControlEvent (const ControlEvent& other) + ControlEvent (const ControlEvent& other) : when (other.when), value (other.value), coeff (0) { if (other.coeff) { @@ -49,11 +49,11 @@ struct ControlEvent { } ~ControlEvent() { if (coeff) delete[] coeff; } - + void create_coeffs() { if (!coeff) coeff = new double[4]; - + coeff[0] = coeff[1] = coeff[2] = coeff[3] = 0.0; } @@ -88,12 +88,12 @@ public: ControlList (const ControlList&); ControlList (const ControlList&, double start, double end); virtual ~ControlList(); - + virtual boost::shared_ptr<ControlList> create(Parameter id); - + ControlList& operator= (const ControlList&); bool operator== (const ControlList&); - + void freeze(); void thaw (); @@ -133,7 +133,7 @@ public: void clear (iterator, iterator); bool paste (ControlList&, double position, float times); - + void set_yrange (double min, double max) { _min_yval = min; _max_yval = max; @@ -180,7 +180,7 @@ public: } } - static inline bool time_comparator (const ControlEvent* a, const ControlEvent* b) { + static inline bool time_comparator (const ControlEvent* a, const ControlEvent* b) { return a->when < b->when; } @@ -209,7 +209,7 @@ public: /** Called by locked entry point and various private * locations where we already hold the lock. - * + * * FIXME: Should this be private? Curve needs it.. */ double unlocked_eval (double x) const; @@ -222,7 +222,7 @@ public: Curve& curve() { assert(_curve); return *_curve; } const Curve& curve() const { assert(_curve); return *_curve; } - + virtual void mark_dirty () const; enum InterpolationStyle { @@ -237,7 +237,7 @@ public: protected: /** Called by unlocked_eval() to handle cases of 3 or more control points. */ - double multipoint_eval (double x) const; + double multipoint_eval (double x) const; void build_search_cache_if_necessary(double start, double end) const; @@ -248,7 +248,7 @@ protected: bool erase_range_internal (double start, double end, EventList &); virtual void maybe_signal_changed (); - + void _x_scale (double factor); mutable LookupCache _lookup_cache; diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp index e039332920..39c3eba344 100644 --- a/libs/evoral/evoral/ControlSet.hpp +++ b/libs/evoral/evoral/ControlSet.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -37,10 +37,10 @@ class ControlSet : public boost::noncopyable { public: ControlSet(); virtual ~ControlSet() {} - + virtual boost::shared_ptr<Evoral::Control> control_factory(const Evoral::Parameter& id) = 0; - + boost::shared_ptr<Control> control (const Parameter& id, bool create_if_missing=false); @@ -57,12 +57,12 @@ public: virtual void add_control(boost::shared_ptr<Control>); bool find_next_event(FrameTime start, FrameTime end, ControlEvent& ev) const; - + virtual bool controls_empty() const { return _controls.size() == 0; } virtual void clear_controls(); void what_has_data(std::set<Parameter>&) const; - + Glib::Mutex& control_lock() const { return _control_lock; } protected: diff --git a/libs/evoral/evoral/Curve.hpp b/libs/evoral/evoral/Curve.hpp index 7cfc6bcb69..096ace6c81 100644 --- a/libs/evoral/evoral/Curve.hpp +++ b/libs/evoral/evoral/Curve.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -35,7 +35,7 @@ public: void get_vector (double x0, double x1, float *arg, int32_t veclen); void solve (); - + void mark_dirty() const { _dirty = true; } private: diff --git a/libs/evoral/evoral/Event.hpp b/libs/evoral/evoral/Event.hpp index cc24ac87f7..2f53185c09 100644 --- a/libs/evoral/evoral/Event.hpp +++ b/libs/evoral/evoral/Event.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -29,7 +29,7 @@ /** If this is not defined, all methods of MidiEvent are RT safe * but MidiEvent will never deep copy and (depending on the scenario) - * may not be usable in STL containers, signals, etc. + * may not be usable in STL containers, signals, etc. */ #define EVORAL_EVENT_ALLOC 1 @@ -44,15 +44,15 @@ template<typename Time> struct Event { #ifdef EVORAL_EVENT_ALLOC Event(EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false); - + /** Copy \a copy. - * + * * If \a alloc is true, the buffer will be copied and this method * is NOT REALTIME SAFE. Otherwise both events share a buffer and * memory management semantics are the caller's problem. */ Event(const Event& copy, bool alloc); - + ~Event(); inline const Event& operator=(const Event& copy) { @@ -90,7 +90,7 @@ struct Event { _size = copy._size; _buf = copy._buf; } - + inline void set(uint8_t* buf, uint32_t size, Time t) { if (_owns_buf) { if (_size < size) { @@ -128,11 +128,11 @@ struct Event { return true; } - + inline bool operator!=(const Event& other) const { return ! operator==(other); } inline bool owns_buffer() const { return _owns_buf; } - + inline void set_buffer(uint32_t size, uint8_t* buf, bool own) { if (_owns_buf) { free(_buf); @@ -154,7 +154,7 @@ struct Event { _size = size; } - + inline void clear() { _type = 0; _original_time = 0; diff --git a/libs/evoral/evoral/EventRingBuffer.hpp b/libs/evoral/evoral/EventRingBuffer.hpp index 1ff1a8fe15..714d8d6f4c 100644 --- a/libs/evoral/evoral/EventRingBuffer.hpp +++ b/libs/evoral/evoral/EventRingBuffer.hpp @@ -1,15 +1,15 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -44,7 +44,7 @@ public: {} size_t capacity() const { return _size; } - + bool peek_time(Time* time); uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf); @@ -72,7 +72,7 @@ EventRingBuffer<Time>::read(Time* time, EventType* type, uint32_t* size, uint8_t success = RingBuffer<uint8_t>::full_read(sizeof(uint32_t), (uint8_t*)size); if (success) success = RingBuffer<uint8_t>::full_read(*size, buf); - + return success; } diff --git a/libs/evoral/evoral/EventSink.hpp b/libs/evoral/evoral/EventSink.hpp index 2fd2e7591a..3c44095816 100644 --- a/libs/evoral/evoral/EventSink.hpp +++ b/libs/evoral/evoral/EventSink.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/libs/evoral/evoral/MIDIEvent.hpp b/libs/evoral/evoral/MIDIEvent.hpp index f7df4980fe..fee07a41d7 100644 --- a/libs/evoral/evoral/MIDIEvent.hpp +++ b/libs/evoral/evoral/MIDIEvent.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -40,7 +40,7 @@ struct MIDIEvent : public Event<Time> { MIDIEvent(EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false) : Event<Time>(type, time, size, buf, alloc) {} - + MIDIEvent(const Event<Time>& copy, bool alloc) : Event<Time>(copy, alloc) {} @@ -48,7 +48,7 @@ struct MIDIEvent : public Event<Time> { #ifdef EVORAL_MIDI_XML /** Event from XML ala http://www.midi.org/dtds/MIDIEvents10.dtd */ MIDIEvent(const XMLNode& event); - + /** Event to XML ala http://www.midi.org/dtds/MIDIEvents10.dtd */ boost::shared_ptr<XMLNode> to_xml() const; #endif @@ -70,7 +70,7 @@ struct MIDIEvent : public Event<Time> { inline uint8_t note() const { return (this->_buf[1]); } inline uint8_t velocity() const { return (this->_buf[2]); } inline void set_velocity(uint8_t value) { this->_buf[2] = value; } - inline void scale_velocity(float factor) { + inline void scale_velocity(float factor) { if (factor < 0) factor = 0; this->_buf[2] = (uint8_t) lrintf (this->_buf[2]*factor); if (this->_buf[2] > 127) this->_buf[2] = 127; diff --git a/libs/evoral/evoral/MIDIParameters.hpp b/libs/evoral/evoral/MIDIParameters.hpp index 1375100929..e1f11202a5 100644 --- a/libs/evoral/evoral/MIDIParameters.hpp +++ b/libs/evoral/evoral/MIDIParameters.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/libs/evoral/evoral/Note.hpp b/libs/evoral/evoral/Note.hpp index b636df46e2..6110ad42fe 100644 --- a/libs/evoral/evoral/Note.hpp +++ b/libs/evoral/evoral/Note.hpp @@ -1,22 +1,22 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef EVORAL_NOTE_HPP +#ifndef EVORAL_NOTE_HPP #define EVORAL_NOTE_HPP #include <stdint.h> @@ -38,9 +38,9 @@ public: const Note<Time>& operator=(const Note<Time>& copy); inline bool operator==(const Note<Time>& other) { - return musical_time_equal (time(), other.time()) && - note() == other.note() && - musical_time_equal (length(), other.length()) && + return musical_time_equal (time(), other.time()) && + note() == other.note() && + musical_time_equal (length(), other.length()) && velocity() == other.velocity() && channel() == other.channel(); } @@ -51,8 +51,8 @@ public: inline uint8_t velocity() const { return _on_event.velocity(); } inline Time length() const { return _off_event.time() - _on_event.time(); } inline uint8_t channel() const { - assert(_on_event.channel() == _off_event.channel()); - return _on_event.channel(); + assert(_on_event.channel() == _off_event.channel()); + return _on_event.channel(); } inline void set_time(Time t) { _off_event.time() = t + length(); _on_event.time() = t; } @@ -77,8 +77,8 @@ private: template<typename Time> std::ostream& operator<<(std::ostream& o, const Evoral::Note<Time>& n) { o << "Note: pitch = " << (int) n.note() - << " @ " << n.time() << " .. " << n.end_time() - << " velocity " << (int) n.velocity() + << " @ " << n.time() << " .. " << n.end_time() + << " velocity " << (int) n.velocity() << " chn " << (int) n.channel(); return o; } diff --git a/libs/evoral/evoral/OldSMF.hpp b/libs/evoral/evoral/OldSMF.hpp index 6f265cc313..0a92ac323d 100644 --- a/libs/evoral/evoral/OldSMF.hpp +++ b/libs/evoral/evoral/OldSMF.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright(C) 2008 Dave Robillard <http://drobilla.net> * Copyright(C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or(at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -20,7 +20,7 @@ #define EVORAL_OLD_SMF_HPP namespace Evoral { - + template<typename Time> class Event; template<typename Time> class EventRingBuffer; @@ -34,17 +34,17 @@ public: virtual ~SMF(); void seek_to_start() const; - + uint16_t ppqn() const { return _ppqn; } bool is_empty() const { return _empty; } bool eof() const { return feof(_fd); } - + Time last_event_time() const { return _last_ev_time; } - + void begin_write(); void append_event_delta(uint32_t delta_t, const Event<Time>& ev); void end_write() THROW_FILE_ERROR; - + void flush(); int flush_header(); int flush_footer(); @@ -52,13 +52,13 @@ public: protected: int open(const std::string& path) THROW_FILE_ERROR; void close() THROW_FILE_ERROR; - + int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const; private: /** Used by flush_footer() to find the position to write the footer */ void seek_to_footer_position(); - + /** Write the track footer at the current seek position */ void write_footer(); diff --git a/libs/evoral/evoral/Parameter.hpp b/libs/evoral/evoral/Parameter.hpp index 48701c876f..8ffa5d30c7 100644 --- a/libs/evoral/evoral/Parameter.hpp +++ b/libs/evoral/evoral/Parameter.hpp @@ -2,16 +2,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -45,9 +45,9 @@ public: Parameter(uint32_t type, uint8_t channel=0, uint32_t id=0) : _type(type), _id(id), _channel(channel) {} - + virtual ~Parameter() {} - + inline uint32_t type() const { return _type; } inline uint8_t channel() const { return _channel; } inline uint32_t id() const { return _id; } @@ -60,26 +60,26 @@ public: inline bool operator==(const Parameter& id) const { return (_type == id._type && _channel == id._channel && _id == id._id ); } - + /** Strict weak ordering * See: http://www.sgi.com/tech/stl/StrictWeakOrdering.html * Sort Parameters first according to type then to id and lastly to channel. - * + * * Proof: * <ol> * <li>Irreflexivity: f(x, x) is false because of the irreflexivity of \c < in each branch.</li> - * <li>Antisymmetry: given x != y, f(x, y) implies !f(y, x) because of the same + * <li>Antisymmetry: given x != y, f(x, y) implies !f(y, x) because of the same * property of \c < in each branch and the symmetry of operator==. </li> * <li>Transitivity: let f(x, y) and f(y, z) => f(x, z) be true. * We prove by contradiction, assuming the contrary: - * f(x, y) and f(x, z) hold => !f(x, z) - * + * f(x, y) and f(x, z) hold => !f(x, z) + * * That implies one of the following: * <ol> * <li> x == z which contradicts the assumption f(x, y) and f(y, x) * because of antisymmetry. * </li> - * <li> f(z, x) is true. That would imply that one of the ivars (we call it i) + * <li> f(z, x) is true. That would imply that one of the ivars (we call it i) * of x is greater than the same ivar in z while all "previous" ivars * are equal. That would imply that also in y all those "previous" * ivars are equal and because if x.i > z.i it is impossible @@ -87,7 +87,7 @@ public: * time which contradicts the assumption. * </li> * Therefore f(x, z) is true (transitivity) - * </ol> + * </ol> * </li> * </ol> */ @@ -99,12 +99,12 @@ public: } else if (_type == other._type && _channel == other._channel && _id < other._id ) { return true; } - + return false; } - + inline operator bool() const { return (_type != 0); } - + /** Not used in indentity/comparison */ struct Metadata { Metadata(double low=0.0, double high=1.0, double mid=0.0) @@ -114,11 +114,11 @@ public: double max; double normal; }; - + inline static void set_range(uint32_t type, double min, double max, double normal) { _type_metadata[type] = Metadata(min, max, normal); } - + inline void set_range(double min, double max, double normal) { _metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal)); } @@ -136,12 +136,12 @@ public: protected: // Default copy constructor is ok - + // ID (used in comparison) uint32_t _type; uint32_t _id; uint8_t _channel; - + boost::shared_ptr<Metadata> _metadata; typedef std::map<uint32_t, Metadata> TypeMetadata; diff --git a/libs/evoral/evoral/RingBuffer.hpp b/libs/evoral/evoral/RingBuffer.hpp index 3e47042679..37a7096511 100644 --- a/libs/evoral/evoral/RingBuffer.hpp +++ b/libs/evoral/evoral/RingBuffer.hpp @@ -1,15 +1,15 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -43,7 +43,7 @@ public: assert(read_space() == 0); assert(write_space() == size - 1); } - + virtual ~RingBuffer() { delete[] _buf; } @@ -61,7 +61,7 @@ public: size_t write_space() const { const size_t w = g_atomic_int_get(&_write_ptr); const size_t r = g_atomic_int_get(&_read_ptr); - + if (w > r) { return ((r - w + _size) % _size) - 1; } else if (w < r) { @@ -70,13 +70,13 @@ public: return _size - 1; } } - + /** Calculate how much still can be read */ size_t read_space() const { const size_t w = g_atomic_int_get(&_write_ptr); const size_t r = g_atomic_int_get(&_read_ptr); - + if (w > r) { return w - r; } else { @@ -89,7 +89,7 @@ public: size_t capacity() const { return _size; } /** Peek at the ringbuffer (read w/o advancing read pointer). - * @return how much has been peeked (read cannot exceed the end + * @return how much has been peeked (read cannot exceed the end * of the buffer): * <pre> * |-------------------------R=============================| @@ -109,7 +109,7 @@ public: bool full_peek(size_t size, Time* dst); /** Read from the ringbuffer. (advances read pointer) - * @return how much has been read (read cannot exceed the end + * @return how much has been read (read cannot exceed the end * of the buffer): */ size_t read(size_t size, Time* dst); @@ -123,13 +123,13 @@ public: /** Advance read pointer by size */ bool skip(size_t size); - + void write(size_t size, const Time* src); protected: mutable int _write_ptr; mutable int _read_ptr; - + size_t _size; ///< Size (capacity) in bytes Time* _buf; ///< size, event, size, event... }; @@ -138,7 +138,7 @@ protected: /** Peek at the ringbuffer (read w/o advancing read pointer). * * Note that a full read may not be done if the data wraps around. - * Caller must check return value and call again if necessary, or use the + * Caller must check return value and call again if necessary, or use the * full_peek method which does this automatically. */ template<typename Time> @@ -150,7 +150,7 @@ RingBuffer<Time>::peek(size_t size, Time* dst) const size_t read_size = (priv_read_ptr + size < _size) ? size : _size - priv_read_ptr; - + memcpy(dst, &_buf[priv_read_ptr], read_size); return read_size; @@ -166,7 +166,7 @@ RingBuffer<Time>::full_peek(size_t size, Time* dst) } const size_t read_size = peek(size, dst); - + if (read_size < size) { peek(size - read_size, dst + read_size); } @@ -178,7 +178,7 @@ RingBuffer<Time>::full_peek(size_t size, Time* dst) /** Read from the ringbuffer. * * Note that a full read may not be done if the data wraps around. - * Caller must check return value and call again if necessary, or use the + * Caller must check return value and call again if necessary, or use the * full_read method which does this automatically. */ template<typename Time> @@ -190,9 +190,9 @@ RingBuffer<Time>::read(size_t size, Time* dst) const size_t read_size = (priv_read_ptr + size < _size) ? size : _size - priv_read_ptr; - + memcpy(dst, &_buf[priv_read_ptr], read_size); - + g_atomic_int_set(&_read_ptr, (priv_read_ptr + read_size) % _size); return read_size; @@ -208,7 +208,7 @@ RingBuffer<Time>::full_read(size_t size, Time* dst) } const size_t read_size = read(size, dst); - + if (read_size < size) { read(size - read_size, dst + read_size); } @@ -225,7 +225,7 @@ RingBuffer<Time>::skip(size_t size) std::cerr << "WARNING: Attempt to skip past end of MIDI ring buffer" << std::endl; return false; } - + const size_t priv_read_ptr = g_atomic_int_get(&_read_ptr); g_atomic_int_set(&_read_ptr, (priv_read_ptr + size) % _size); @@ -238,7 +238,7 @@ inline void RingBuffer<Time>::write(size_t size, const Time* src) { const size_t priv_write_ptr = g_atomic_int_get(&_write_ptr); - + if (priv_write_ptr + size <= _size) { memcpy(&_buf[priv_write_ptr], src, size); g_atomic_int_set(&_write_ptr, (priv_write_ptr + size) % _size); @@ -252,7 +252,7 @@ RingBuffer<Time>::write(size_t size, const Time* src) } } - + } // namespace Evoral #endif // EVORAL_RING_BUFFER_HPP diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp index b921a80e6d..e9c4a0fc49 100644 --- a/libs/evoral/evoral/SMF.hpp +++ b/libs/evoral/evoral/SMF.hpp @@ -2,16 +2,16 @@ * Copyright(C) 2008 Dave Robillard <http://drobilla.net> * Copyright(C) 2000-2008 Paul Davis * Author: Hans Baier - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or(at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -28,7 +28,7 @@ typedef smf_struct smf_t; typedef smf_track_struct smf_track_t; namespace Evoral { - + #define THROW_FILE_ERROR throw(FileError) /** Standard Midi File. @@ -42,26 +42,26 @@ public: SMF() : _smf(0), _smf_track(0), _empty(true) {}; virtual ~SMF(); - + int open(const std::string& path, int track=1) THROW_FILE_ERROR; int create(const std::string& path, int track=1, uint16_t ppqn=19200) THROW_FILE_ERROR; void close() THROW_FILE_ERROR; - + const std::string& file_path() const { return _file_path; }; void seek_to_start() const; int seek_to_track(int track); - + int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf) const; - + uint16_t num_tracks() const; uint16_t ppqn() const; bool is_empty() const { return _empty; } - + void begin_write(); void append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf); void end_write() THROW_FILE_ERROR; - + void flush() {}; double round_to_file_precision (double val) const; diff --git a/libs/evoral/evoral/SMFReader.hpp b/libs/evoral/evoral/SMFReader.hpp index b977f71dca..7009ca16b1 100644 --- a/libs/evoral/evoral/SMFReader.hpp +++ b/libs/evoral/evoral/SMFReader.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright(C) 2008 Dave Robillard <http://drobilla.net> * Copyright(C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or(at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -49,21 +49,21 @@ public: bool open(const std::string& filename) throw (std::logic_error, UnsupportedTime); bool seek_to_track(unsigned track) throw (std::logic_error); - + const std::string& filename() const { return _filename; }; uint16_t type() const { return _type; } uint16_t ppqn() const { return _ppqn; } uint16_t num_tracks() const { return _num_tracks; } - + int read_event(size_t buf_len, uint8_t* buf, uint32_t* ev_size, uint32_t* ev_delta_time) throw (std::logic_error, PrematureEOF, CorruptFile); - + void close(); - + static uint32_t read_var_len(FILE* fd) throw (PrematureEOF); protected: diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index df8c48a1b6..026a8ab74f 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -58,11 +58,11 @@ public: /** This is a higher level view of events, with separate representations for * notes (instead of just unassociated note on/off events) and controller data. * Controller data is represented as a list of time-stamped float values. */ -template<typename Time> +template<typename Time> class Sequence : virtual public ControlSet { public: Sequence(const TypeMap& type_map, size_t size=0); - + void write_lock(); void write_unlock(); @@ -80,7 +80,7 @@ public: /** Resizes vector if necessary (NOT realtime safe) */ void append(const Event<Time>& ev); - + inline const boost::shared_ptr< const Note<Time> > note_at(size_t i) const { return _notes[i]; } inline const boost::shared_ptr< Note<Time> > note_at(size_t i) { return _notes[i]; } @@ -88,14 +88,14 @@ public: inline bool empty() const { return _notes.size() == 0 && ControlSet::controls_empty(); } inline static bool note_time_comparator(const boost::shared_ptr< const Note<Time> >& a, - const boost::shared_ptr< const Note<Time> >& b) { + const boost::shared_ptr< const Note<Time> >& b) { return a->time() < b->time(); } struct LaterNoteComparator { typedef const Note<Time>* value_type; inline bool operator()(const boost::shared_ptr< const Note<Time> > a, - const boost::shared_ptr< const Note<Time> > b) const { + const boost::shared_ptr< const Note<Time> > b) const { return a->time() > b->time(); } }; @@ -103,7 +103,7 @@ public: struct LaterNoteEndComparator { typedef const Note<Time>* value_type; inline bool operator()(const boost::shared_ptr< const Note<Time> > a, - const boost::shared_ptr< const Note<Time> > b) const { + const boost::shared_ptr< const Note<Time> > b) const { return a->end_time() > b->end_time(); } }; @@ -131,10 +131,10 @@ public: const_iterator(); const_iterator(const Sequence<Time>& seq, Time t); ~const_iterator(); - + inline bool valid() const { return !_is_end && _event; } inline bool locked() const { return _locked; } - + void invalidate(); const Event<Time>& operator*() const { return *_event; } @@ -145,12 +145,12 @@ public: bool operator==(const const_iterator& other) const; bool operator!=(const const_iterator& other) const { return ! operator==(other); } - + const_iterator& operator=(const const_iterator& other); private: friend class Sequence<Time>; - + typedef std::vector<ControlIterator> ControlIterators; enum MIDIMessageType { NIL, NOTE_ON, NOTE_OFF, CONTROL, SYSEX }; @@ -165,28 +165,28 @@ public: ControlIterators _control_iters; ControlIterators::iterator _control_iter; }; - + const_iterator begin(Time t=0) const { return const_iterator(*this, t); } const const_iterator& end() const { return _end_iter; } - + bool control_to_midi_event(boost::shared_ptr< Event<Time> >& ev, const ControlIterator& iter) const; - + bool edited() const { return _edited; } void set_edited(bool yn) { _edited = yn; } void add_note_unlocked(const boost::shared_ptr< Note<Time> > note); void remove_note_unlocked(const boost::shared_ptr< const Note<Time> > note); - + uint8_t lowest_note() const { return _lowest_note; } uint8_t highest_note() const { return _highest_note; } - + protected: bool _edited; private: friend class const_iterator; - + void append_note_on_unlocked(uint8_t chan, Time time, uint8_t note, uint8_t velocity); void append_note_off_unlocked(uint8_t chan, Time time, uint8_t note); void append_control_unlocked(const Parameter& param, Time time, double value); @@ -195,14 +195,14 @@ private: mutable Glib::RWLock _lock; const TypeMap& _type_map; - + Notes _notes; SysExes _sysexes; - + typedef std::vector<size_t> WriteNotes; WriteNotes _write_notes[16]; bool _writing; - + typedef std::vector< boost::shared_ptr<const ControlList> > ControlLists; ControlLists _dirty_controls; diff --git a/libs/evoral/evoral/TimeConverter.hpp b/libs/evoral/evoral/TimeConverter.hpp index eabe0e4762..9c53d0370c 100644 --- a/libs/evoral/evoral/TimeConverter.hpp +++ b/libs/evoral/evoral/TimeConverter.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2009 Dave Robillard <http://drobilla.net> * Copyright (C) 2009 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -33,7 +33,7 @@ public: /** Convert A time to B time (A to B) */ virtual B to(A a) const = 0; - + /** Convert B time to A time (A from B) */ virtual A from(B b) const = 0; }; diff --git a/libs/evoral/evoral/TypeMap.hpp b/libs/evoral/evoral/TypeMap.hpp index 642735134d..baf9b2b487 100644 --- a/libs/evoral/evoral/TypeMap.hpp +++ b/libs/evoral/evoral/TypeMap.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -41,11 +41,11 @@ public: * parameter, or 0 if parameter can not be expressed as a MIDI event */ virtual uint8_t parameter_midi_type(const Parameter& param) const = 0; - + /** The type ID for a MIDI event with the given status byte */ virtual uint32_t midi_event_type(uint8_t status) const = 0; - + /** Return true iff parameter should be locked to integer boundaries */ virtual bool is_integer(const Evoral::Parameter& param) const = 0; diff --git a/libs/evoral/evoral/midi_util.h b/libs/evoral/evoral/midi_util.h index 6dee894546..27049f5c8a 100644 --- a/libs/evoral/evoral/midi_util.h +++ b/libs/evoral/evoral/midi_util.h @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright(C) 2008 Dave Robillard <http://drobilla.net> * Copyright(C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or(at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -64,7 +64,7 @@ midi_event_size(uint8_t status) case MIDI_CMD_COMMON_SENSING: case MIDI_CMD_COMMON_RESET: return 1; - + case MIDI_CMD_COMMON_SYSEX: return -1; } @@ -79,7 +79,7 @@ static inline int midi_event_size(const uint8_t* buffer) { uint8_t status = buffer[0]; - + // Mask off channel if applicable if (status >= 0x80 && status < 0xF0) { status &= 0xF0; diff --git a/libs/evoral/evoral/types.hpp b/libs/evoral/evoral/types.hpp index 9e48a68e3c..06f29b341e 100644 --- a/libs/evoral/evoral/types.hpp +++ b/libs/evoral/evoral/types.hpp @@ -1,16 +1,16 @@ /* This file is part of Evoral. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> * Copyright (C) 2000-2008 Paul Davis - * + * * Evoral is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Evoral is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -33,13 +33,13 @@ typedef double MusicalTime; static inline bool musical_time_equal (MusicalTime a, MusicalTime b) { /* acceptable tolerance is 1 tick. Nice if there was no magic number here */ - return fabs (a - b) <= (1.0/1920.0); + return fabs (a - b) <= (1.0/1920.0); } /** Type of an event (opaque, mapped by application) */ typedef uint32_t EventType; -/** Type to describe the movement of a time range */ +/** Type to describe the movement of a time range */ template<typename T> struct RangeMove { RangeMove (T f, FrameTime l, T t) : from (f), length (l), to (t) {} |