Fix broken whitespace.
git-svn-id: svn://localhost/ardour2/branches/3.0@8341 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -47,7 +47,7 @@ public:
|
||||
* Automation write/touch works by periodically sampling this value
|
||||
* and adding it to the ControlList.
|
||||
*/
|
||||
double user_double() const { return _user_value; }
|
||||
double user_double() const { return _user_value; }
|
||||
|
||||
void set_list(boost::shared_ptr<ControlList>);
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
protected:
|
||||
Parameter _parameter;
|
||||
boost::shared_ptr<ControlList> _list;
|
||||
double _user_value;
|
||||
double _user_value;
|
||||
PBD::ScopedConnection _list_marked_dirty_connection;
|
||||
|
||||
private:
|
||||
|
||||
@@ -96,8 +96,8 @@ public:
|
||||
bool operator== (const ControlList&);
|
||||
|
||||
virtual void freeze();
|
||||
virtual void thaw ();
|
||||
bool frozen() const { return _frozen; }
|
||||
virtual void thaw ();
|
||||
bool frozen() const { return _frozen; }
|
||||
|
||||
const Parameter& parameter() const { return _parameter; }
|
||||
void set_parameter(const Parameter& p) { _parameter = p; }
|
||||
@@ -113,12 +113,12 @@ public:
|
||||
void x_scale (double factor);
|
||||
bool extend_to (double);
|
||||
void slide (iterator before, double distance);
|
||||
void shift (double before, double distance);
|
||||
void shift (double before, double distance);
|
||||
|
||||
void rt_add (double when, double value);
|
||||
void add (double when, double value);
|
||||
void fast_simple_add (double when, double value);
|
||||
void merge_nascent (double when);
|
||||
void merge_nascent (double when);
|
||||
|
||||
void reset_range (double start, double end);
|
||||
void erase_range (double start, double end);
|
||||
@@ -235,10 +235,10 @@ public:
|
||||
InterpolationStyle interpolation() const { return _interpolation; }
|
||||
void set_interpolation (InterpolationStyle);
|
||||
|
||||
virtual bool touching() const { return false; }
|
||||
virtual bool writing() const { return false; }
|
||||
virtual bool touch_enabled() const { return false; }
|
||||
void write_pass_finished (double when);
|
||||
virtual bool touching() const { return false; }
|
||||
virtual bool writing() const { return false; }
|
||||
virtual bool touch_enabled() const { return false; }
|
||||
void write_pass_finished (double when);
|
||||
|
||||
/** Emitted when mark_dirty() is called on this object */
|
||||
mutable PBD::Signal0<void> Dirty;
|
||||
@@ -276,20 +276,20 @@ protected:
|
||||
|
||||
Curve* _curve;
|
||||
|
||||
struct NascentInfo {
|
||||
EventList events;
|
||||
bool is_touch;
|
||||
double start_time;
|
||||
double end_time;
|
||||
struct NascentInfo {
|
||||
EventList events;
|
||||
bool is_touch;
|
||||
double start_time;
|
||||
double end_time;
|
||||
|
||||
NascentInfo (bool touching, double start = -1.0)
|
||||
: is_touch (touching)
|
||||
, start_time (start)
|
||||
, end_time (-1.0)
|
||||
{}
|
||||
};
|
||||
NascentInfo (bool touching, double start = -1.0)
|
||||
: is_touch (touching)
|
||||
, start_time (start)
|
||||
, end_time (-1.0)
|
||||
{}
|
||||
};
|
||||
|
||||
std::list<NascentInfo*> nascent;
|
||||
std::list<NascentInfo*> nascent;
|
||||
};
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
@@ -37,7 +37,7 @@ class ControlEvent;
|
||||
class ControlSet : public boost::noncopyable {
|
||||
public:
|
||||
ControlSet();
|
||||
ControlSet (const ControlSet&);
|
||||
ControlSet (const ControlSet&);
|
||||
virtual ~ControlSet() {}
|
||||
|
||||
virtual boost::shared_ptr<Evoral::Control>
|
||||
|
||||
@@ -45,7 +45,7 @@ void init_event_id_counter (event_id_t n);
|
||||
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);
|
||||
Event (EventType type=0, Time time=0, uint32_t size=0, uint8_t* buf=NULL, bool alloc=false);
|
||||
|
||||
/** Copy \a copy.
|
||||
*
|
||||
@@ -58,7 +58,7 @@ struct Event {
|
||||
~Event();
|
||||
|
||||
inline const Event& operator=(const Event& copy) {
|
||||
_id = copy.id(); // XXX is this right? do we want ID copy semantics?
|
||||
_id = copy.id(); // XXX is this right? do we want ID copy semantics?
|
||||
_type = copy._type;
|
||||
_original_time = copy._original_time;
|
||||
_nominal_time = copy._nominal_time;
|
||||
@@ -173,8 +173,8 @@ struct Event {
|
||||
void set_time (Time);
|
||||
void set_original_time (Time);
|
||||
|
||||
inline event_id_t id() const { return _id; }
|
||||
inline void set_id (event_id_t n) { _id = n; }
|
||||
inline event_id_t id() const { return _id; }
|
||||
inline void set_id (event_id_t n) { _id = n; }
|
||||
|
||||
protected:
|
||||
EventType _type; /**< Type of event (application relative, NOT MIDI 'type') */
|
||||
@@ -186,7 +186,7 @@ protected:
|
||||
#ifdef EVORAL_EVENT_ALLOC
|
||||
bool _owns_buf; /**< Whether buffer is locally allocated */
|
||||
#endif
|
||||
event_id_t _id; /** UUID for each event, should probably be 64bit or at least unsigned */
|
||||
event_id_t _id; /** UUID for each event, should probably be 64bit or at least unsigned */
|
||||
};
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
@@ -35,9 +35,9 @@ class EventList : public std::list<Evoral::Event<Time> *>, public Evoral::EventS
|
||||
public:
|
||||
EventList() {}
|
||||
|
||||
uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf) {
|
||||
uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf) {
|
||||
push_back(new Evoral::Event<Time>(
|
||||
type, time, size, const_cast<uint8_t*>(buf), true)); // Event copies buffer
|
||||
type, time, size, const_cast<uint8_t*>(buf), true)); // Event copies buffer
|
||||
return size;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
bool peek_time(Time* time);
|
||||
|
||||
uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf);
|
||||
uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf);
|
||||
bool read (Time* time, EventType* type, uint32_t* size, uint8_t* buf);
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ template<typename Time>
|
||||
class EventSink {
|
||||
public:
|
||||
virtual ~EventSink() {}
|
||||
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf) = 0;
|
||||
virtual uint32_t write(Time time, EventType type, uint32_t size, const uint8_t* buf) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace Evoral {
|
||||
*/
|
||||
template<typename Time>
|
||||
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(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)
|
||||
@@ -68,7 +68,7 @@ struct MIDIEvent : public Event<Time> {
|
||||
inline bool is_aftertouch() const { return (type() == MIDI_CMD_NOTE_PRESSURE); }
|
||||
inline bool is_channel_pressure() const { return (type() == MIDI_CMD_CHANNEL_PRESSURE); }
|
||||
inline uint8_t note() const { return (this->_buf[1]); }
|
||||
inline void set_note(uint8_t n) { this->_buf[1] = n; }
|
||||
inline void set_note(uint8_t n) { this->_buf[1] = n; }
|
||||
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) {
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Evoral {
|
||||
template<typename Time>
|
||||
class Note {
|
||||
public:
|
||||
Note(uint8_t chan=0, Time time=0, Time len=0, uint8_t note=0, uint8_t vel=0x40);
|
||||
Note(uint8_t chan=0, Time time=0, Time len=0, uint8_t note=0, uint8_t vel=0x40);
|
||||
Note(const Note<Time>& copy);
|
||||
~Note();
|
||||
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
channel() == other.channel();
|
||||
}
|
||||
|
||||
inline event_id_t id() const { return _on_event.id(); }
|
||||
void set_id (event_id_t);
|
||||
inline event_id_t id() const { return _on_event.id(); }
|
||||
void set_id (event_id_t);
|
||||
|
||||
inline Time time() const { return _on_event.time(); }
|
||||
inline Time end_time() const { return _off_event.time(); }
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
inline void set_time(Time t) { _off_event.time() = t + length(); _on_event.time() = t; }
|
||||
inline void set_note(uint8_t n) { _on_event.buffer()[1] = n; _off_event.buffer()[1] = n; }
|
||||
inline void set_velocity(uint8_t n) { _on_event.buffer()[2] = n; }
|
||||
inline void set_off_velocity(uint8_t n) { _off_event.buffer()[2] = n; }
|
||||
inline void set_off_velocity(uint8_t n) { _off_event.buffer()[2] = n; }
|
||||
inline void set_length(Time l) { _off_event.time() = _on_event.time() + l; }
|
||||
inline void set_channel(uint8_t c) { _on_event.set_channel(c); _off_event.set_channel(c); }
|
||||
|
||||
|
||||
@@ -79,21 +79,21 @@ public:
|
||||
|
||||
/** Not used in indentity/comparison */
|
||||
struct Metadata {
|
||||
Metadata(double low=0.0, double high=1.0, double mid=0.0, bool tog=false)
|
||||
: min(low), max(high), normal(mid), toggled(tog)
|
||||
Metadata(double low=0.0, double high=1.0, double mid=0.0, bool tog=false)
|
||||
: min(low), max(high), normal(mid), toggled(tog)
|
||||
{}
|
||||
double min;
|
||||
double max;
|
||||
double normal;
|
||||
bool toggled;
|
||||
bool toggled;
|
||||
};
|
||||
|
||||
inline static void set_range(uint32_t type, double min, double max, double normal, bool toggled) {
|
||||
inline static void set_range(uint32_t type, double min, double max, double normal, bool toggled) {
|
||||
_type_metadata[type] = Metadata(min, max, normal, toggled);
|
||||
}
|
||||
|
||||
inline void set_range(double min, double max, double normal, bool toggled) {
|
||||
_metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal, toggled));
|
||||
inline void set_range(double min, double max, double normal, bool toggled) {
|
||||
_metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal, toggled));
|
||||
}
|
||||
|
||||
inline Metadata& metadata() const {
|
||||
|
||||
@@ -53,14 +53,14 @@ public:
|
||||
void seek_to_start() const;
|
||||
int seek_to_track(int track);
|
||||
|
||||
int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf, event_id_t* note_id) const;
|
||||
int read_event(uint32_t* delta_t, uint32_t* size, uint8_t** buf, event_id_t* note_id) 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, event_id_t note_id);
|
||||
void append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf, event_id_t note_id);
|
||||
void end_write() THROW_FILE_ERROR;
|
||||
|
||||
void flush() {};
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
double round_to_file_precision (double val) const;
|
||||
|
||||
protected:
|
||||
void set_path (const std::string& p);
|
||||
void set_path (const std::string& p);
|
||||
|
||||
private:
|
||||
std::string _file_path;
|
||||
|
||||
@@ -62,7 +62,7 @@ template<typename Time>
|
||||
class Sequence : virtual public ControlSet {
|
||||
public:
|
||||
Sequence(const TypeMap& type_map);
|
||||
Sequence(const Sequence<Time>& other);
|
||||
Sequence(const Sequence<Time>& other);
|
||||
|
||||
protected:
|
||||
struct WriteLockImpl {
|
||||
@@ -80,8 +80,8 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr;
|
||||
typedef typename boost::shared_ptr<const Evoral::Note<Time> > constNotePtr;
|
||||
typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr;
|
||||
typedef typename boost::shared_ptr<const Evoral::Note<Time> > constNotePtr;
|
||||
|
||||
typedef boost::shared_ptr<Glib::RWLock::ReaderLock> ReadLock;
|
||||
typedef boost::shared_ptr<WriteLockImpl> WriteLock;
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
bool writing() const { return _writing; }
|
||||
void end_write(bool delete_stuck=false);
|
||||
|
||||
void append(const Event<Time>& ev, Evoral::event_id_t evid);
|
||||
void append(const Event<Time>& ev, Evoral::event_id_t evid);
|
||||
|
||||
inline size_t n_notes() const { return _notes.size(); }
|
||||
inline bool empty() const { return _notes.size() == 0 && ControlSet::controls_empty(); }
|
||||
@@ -142,34 +142,34 @@ public:
|
||||
inline Notes& notes() { return _notes; }
|
||||
inline const Notes& notes() const { return _notes; }
|
||||
|
||||
enum NoteOperator {
|
||||
PitchEqual,
|
||||
PitchLessThan,
|
||||
PitchLessThanOrEqual,
|
||||
PitchGreater,
|
||||
PitchGreaterThanOrEqual,
|
||||
VelocityEqual,
|
||||
VelocityLessThan,
|
||||
VelocityLessThanOrEqual,
|
||||
VelocityGreater,
|
||||
VelocityGreaterThanOrEqual,
|
||||
};
|
||||
enum NoteOperator {
|
||||
PitchEqual,
|
||||
PitchLessThan,
|
||||
PitchLessThanOrEqual,
|
||||
PitchGreater,
|
||||
PitchGreaterThanOrEqual,
|
||||
VelocityEqual,
|
||||
VelocityLessThan,
|
||||
VelocityLessThanOrEqual,
|
||||
VelocityGreater,
|
||||
VelocityGreaterThanOrEqual,
|
||||
};
|
||||
|
||||
void get_notes (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
void get_notes (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
|
||||
void remove_overlapping_notes ();
|
||||
void trim_overlapping_notes ();
|
||||
void remove_duplicate_notes ();
|
||||
void remove_overlapping_notes ();
|
||||
void trim_overlapping_notes ();
|
||||
void remove_duplicate_notes ();
|
||||
|
||||
enum OverlapPitchResolution {
|
||||
LastOnFirstOff,
|
||||
FirstOnFirstOff
|
||||
};
|
||||
enum OverlapPitchResolution {
|
||||
LastOnFirstOff,
|
||||
FirstOnFirstOff
|
||||
};
|
||||
|
||||
bool overlapping_pitches_accepted() const { return _overlapping_pitches_accepted; }
|
||||
void overlapping_pitches_accepted(bool yn) { _overlapping_pitches_accepted = yn; }
|
||||
OverlapPitchResolution overlap_pitch_resolution() const { return _overlap_pitch_resolution; }
|
||||
void set_overlap_pitch_resolution(OverlapPitchResolution opr);
|
||||
bool overlapping_pitches_accepted() const { return _overlapping_pitches_accepted; }
|
||||
void overlapping_pitches_accepted(bool yn) { _overlapping_pitches_accepted = yn; }
|
||||
OverlapPitchResolution overlap_pitch_resolution() const { return _overlap_pitch_resolution; }
|
||||
void set_overlap_pitch_resolution(OverlapPitchResolution opr);
|
||||
|
||||
void set_notes (const Sequence<Time>::Notes& n);
|
||||
|
||||
@@ -223,10 +223,14 @@ public:
|
||||
bool _force_discrete;
|
||||
};
|
||||
|
||||
const_iterator begin (Time t = 0, bool force_discrete = false, std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const {
|
||||
const_iterator begin (
|
||||
Time t = 0,
|
||||
bool force_discrete = false,
|
||||
std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const {
|
||||
return const_iterator (*this, t, force_discrete, f);
|
||||
}
|
||||
const const_iterator& end() const { return _end_iter; }
|
||||
|
||||
const const_iterator& end() const { return _end_iter; }
|
||||
|
||||
typename Notes::const_iterator note_lower_bound (Time t) const;
|
||||
|
||||
@@ -236,11 +240,11 @@ public:
|
||||
bool edited() const { return _edited; }
|
||||
void set_edited(bool yn) { _edited = yn; }
|
||||
|
||||
bool overlaps (const NotePtr& ev,
|
||||
const NotePtr& ignore_this_note) const;
|
||||
bool contains (const NotePtr& ev) const;
|
||||
bool overlaps (const NotePtr& ev,
|
||||
const NotePtr& ignore_this_note) const;
|
||||
bool contains (const NotePtr& ev) const;
|
||||
|
||||
bool add_note_unlocked (const NotePtr note, void* arg = 0);
|
||||
bool add_note_unlocked (const NotePtr note, void* arg = 0);
|
||||
void remove_note_unlocked(const constNotePtr note);
|
||||
|
||||
uint8_t lowest_note() const { return _lowest_note; }
|
||||
@@ -249,39 +253,39 @@ public:
|
||||
|
||||
protected:
|
||||
bool _edited;
|
||||
bool _overlapping_pitches_accepted;
|
||||
OverlapPitchResolution _overlap_pitch_resolution;
|
||||
bool _overlapping_pitches_accepted;
|
||||
OverlapPitchResolution _overlap_pitch_resolution;
|
||||
mutable Glib::RWLock _lock;
|
||||
bool _writing;
|
||||
|
||||
virtual int resolve_overlaps_unlocked (const NotePtr, void* /* arg */ = 0) {
|
||||
return 0;
|
||||
}
|
||||
virtual int resolve_overlaps_unlocked (const NotePtr, void* /* arg */ = 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef std::multiset<NotePtr, NoteNumberComparator> Pitches;
|
||||
inline Pitches& pitches(uint8_t chan) { return _pitches[chan&0xf]; }
|
||||
inline const Pitches& pitches(uint8_t chan) const { return _pitches[chan&0xf]; }
|
||||
inline const Pitches& pitches(uint8_t chan) const { return _pitches[chan&0xf]; }
|
||||
|
||||
private:
|
||||
friend class const_iterator;
|
||||
|
||||
bool overlaps_unlocked (const NotePtr& ev, const NotePtr& ignore_this_note) const;
|
||||
bool contains_unlocked (const NotePtr& ev) const;
|
||||
bool overlaps_unlocked (const NotePtr& ev, const NotePtr& ignore_this_note) const;
|
||||
bool contains_unlocked (const NotePtr& ev) const;
|
||||
|
||||
void append_note_on_unlocked (NotePtr, Evoral::event_id_t);
|
||||
void append_note_off_unlocked(NotePtr);
|
||||
void append_control_unlocked(const Parameter& param, Time time, double value, Evoral::event_id_t);
|
||||
void append_sysex_unlocked(const MIDIEvent<Time>& ev, Evoral::event_id_t);
|
||||
void append_note_on_unlocked (NotePtr, Evoral::event_id_t);
|
||||
void append_note_off_unlocked(NotePtr);
|
||||
void append_control_unlocked(const Parameter& param, Time time, double value, Evoral::event_id_t);
|
||||
void append_sysex_unlocked(const MIDIEvent<Time>& ev, Evoral::event_id_t);
|
||||
|
||||
void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||
|
||||
void control_list_marked_dirty ();
|
||||
|
||||
const TypeMap& _type_map;
|
||||
|
||||
Notes _notes; // notes indexed by time
|
||||
Pitches _pitches[16]; // notes indexed by channel+pitch
|
||||
Notes _notes; // notes indexed by time
|
||||
Pitches _pitches[16]; // notes indexed by channel+pitch
|
||||
SysExes _sysexes;
|
||||
|
||||
typedef std::multiset<NotePtr, EarlierNoteComparator> WriteNotes;
|
||||
|
||||
@@ -52,17 +52,17 @@ template<typename T>
|
||||
struct RangeMove {
|
||||
RangeMove (T f, double l, T t) : from (f), length (l), to (t) {}
|
||||
T from; ///< start of the range
|
||||
double length; ///< length of the range
|
||||
double length; ///< length of the range
|
||||
T to; ///< new start of the range
|
||||
};
|
||||
|
||||
} // namespace Evoral
|
||||
|
||||
namespace PBD {
|
||||
namespace DEBUG {
|
||||
extern uint64_t Sequence;
|
||||
extern uint64_t Note;
|
||||
}
|
||||
namespace DEBUG {
|
||||
extern uint64_t Sequence;
|
||||
extern uint64_t Note;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // EVORAL_TYPES_HPP
|
||||
|
||||
Reference in New Issue
Block a user