diff options
author | David Robillard <d@drobilla.net> | 2008-10-13 02:43:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-10-13 02:43:14 +0000 |
commit | 1514039689555915c4cb1f17cc09dec43f6ea1e5 (patch) | |
tree | ca8c0bd5c3893a3fb2a4164d10c0d5e6b484edd0 /libs/evoral | |
parent | 8b951bb9ee65f3d530848c3c08b8b54e6571317f (diff) |
Fix pollution of global namespace by Evoral.
git-svn-id: svn://localhost/ardour2/branches/3.0@3947 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r-- | libs/evoral/evoral/Control.hpp | 4 | ||||
-rw-r--r-- | libs/evoral/evoral/ControlSet.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/evoral/SMF.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/evoral/Sequence.hpp | 2 | ||||
-rw-r--r-- | libs/evoral/evoral/types.hpp | 6 | ||||
-rw-r--r-- | libs/evoral/src/Control.cpp | 4 | ||||
-rw-r--r-- | libs/evoral/src/ControlSet.cpp | 6 | ||||
-rw-r--r-- | libs/evoral/src/SMF.cpp | 25 | ||||
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 2 | ||||
-rw-r--r-- | libs/evoral/wscript | 48 |
10 files changed, 51 insertions, 50 deletions
diff --git a/libs/evoral/evoral/Control.hpp b/libs/evoral/evoral/Control.hpp index 46532788f0..31ebe3cfde 100644 --- a/libs/evoral/evoral/Control.hpp +++ b/libs/evoral/evoral/Control.hpp @@ -36,8 +36,8 @@ public: Control(const Parameter& parameter, boost::shared_ptr<ControlList>); virtual ~Control() {} - virtual void set_float(float val, bool to_list=false, nframes_t frame=0); - virtual float get_float(bool from_list=false, nframes_t frame=0) const; + 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; virtual float user_float() const; void set_list(boost::shared_ptr<ControlList>); diff --git a/libs/evoral/evoral/ControlSet.hpp b/libs/evoral/evoral/ControlSet.hpp index 1b5edb92ac..9a8ea2efcd 100644 --- a/libs/evoral/evoral/ControlSet.hpp +++ b/libs/evoral/evoral/ControlSet.hpp @@ -56,7 +56,7 @@ public: virtual void add_control(boost::shared_ptr<Control>); - bool find_next_event(nframes_t start, nframes_t end, ControlEvent& ev) const; + bool find_next_event(FrameTime start, FrameTime end, ControlEvent& ev) const; virtual bool empty() const { return _controls.size() == 0; } virtual void clear(); diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp index e0ac91b515..5ae27131e3 100644 --- a/libs/evoral/evoral/SMF.hpp +++ b/libs/evoral/evoral/SMF.hpp @@ -43,7 +43,7 @@ public: EventTime last_event_time() const { return _last_ev_time; } - void begin_write(nframes_t start_time); + void begin_write(FrameTime start_time); void append_event_unlocked(uint32_t delta_t, const Evoral::Event& ev); void end_write(); diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp index a8cfe0cf13..f2bf24b254 100644 --- a/libs/evoral/evoral/Sequence.hpp +++ b/libs/evoral/evoral/Sequence.hpp @@ -198,7 +198,7 @@ private: ControlLists _dirty_controls; const const_iterator _end_iter; - mutable nframes_t _next_read; + mutable FrameTime _next_read; bool _percussive; uint8_t _lowest_note; diff --git a/libs/evoral/evoral/types.hpp b/libs/evoral/evoral/types.hpp index a722484186..fc1001c7d8 100644 --- a/libs/evoral/evoral/types.hpp +++ b/libs/evoral/evoral/types.hpp @@ -21,8 +21,10 @@ #include <stdint.h> +namespace Evoral { + /** Frame count (i.e. length of time in audio frames) */ -typedef uint32_t nframes_t; +typedef uint32_t FrameTime; /** Time-stamp of an event */ typedef double timestamp_t; @@ -39,4 +41,6 @@ typedef double EventLength; /** Type of an event (opaque, mapped by application) */ typedef uint32_t EventType; +} // namespace Evoral + #endif // EVORAL_TYPES_HPP diff --git a/libs/evoral/src/Control.cpp b/libs/evoral/src/Control.cpp index e5301b833c..499a40fd2c 100644 --- a/libs/evoral/src/Control.cpp +++ b/libs/evoral/src/Control.cpp @@ -35,7 +35,7 @@ Control::Control(const Parameter& parameter, boost::shared_ptr<ControlList> list /** Get the currently effective value (ie the one that corresponds to current output) */ float -Control::get_float(bool from_list, nframes_t frame) const +Control::get_float(bool from_list, FrameTime frame) const { if (from_list) return _list->eval(frame); @@ -45,7 +45,7 @@ Control::get_float(bool from_list, nframes_t frame) const void -Control::set_float(float value, bool to_list, nframes_t frame) +Control::set_float(float value, bool to_list, FrameTime frame) { _user_value = value; diff --git a/libs/evoral/src/ControlSet.cpp b/libs/evoral/src/ControlSet.cpp index 837810c727..06046347a6 100644 --- a/libs/evoral/src/ControlSet.cpp +++ b/libs/evoral/src/ControlSet.cpp @@ -70,11 +70,11 @@ ControlSet::control (const Parameter& parameter, bool create_if_missing) } bool -ControlSet::find_next_event (nframes_t now, nframes_t end, ControlEvent& next_event) const +ControlSet::find_next_event (FrameTime now, FrameTime end, ControlEvent& next_event) const { Controls::const_iterator li; - next_event.when = std::numeric_limits<nframes_t>::max(); + next_event.when = std::numeric_limits<FrameTime>::max(); for (li = _controls.begin(); li != _controls.end(); ++li) { ControlList::const_iterator i; @@ -95,7 +95,7 @@ ControlSet::find_next_event (nframes_t now, nframes_t end, ControlEvent& next_ev } } - return next_event.when != std::numeric_limits<nframes_t>::max(); + return next_event.when != std::numeric_limits<FrameTime>::max(); } void diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp index 4165a331cb..4996f16d6a 100644 --- a/libs/evoral/src/SMF.cpp +++ b/libs/evoral/src/SMF.cpp @@ -181,29 +181,6 @@ SMF::write_footer() fflush(_fd); } -/** Returns the offset of the first event in the file with a time past @a start, - * relative to the start of the source. - * - * Returns -1 if not found. - */ -/* -long -SMF::find_first_event_after(nframes_t start) -{ - // FIXME: obviously this is slooow - - fseek(_fd, _header_size, 0); - - while ( ! feof(_fd) ) { - const uint32_t delta_time = read_var_len(); - - if (delta_time > start) - return delta_time; - } - - return -1; -} -*/ /** Read an event from the current position in file. * @@ -303,7 +280,7 @@ SMF::append_event_unlocked(uint32_t delta_t, const Evoral::Event& ev) } void -SMF::begin_write(nframes_t start_frame) +SMF::begin_write(FrameTime start_frame) { _last_ev_time = 0; fseek(_fd, _header_size, SEEK_SET); diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 3980f46ae2..d746f470b6 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -342,7 +342,7 @@ Sequence::read(EventSink& dst, timestamp_t start, timedur_t nframes, timestamp_t debugout << "Using cached iterator at " << _next_read << endl; } - _next_read = (nframes_t) floor (start + nframes); + _next_read = (FrameTime) floor (start + nframes); while (_read_iter != end() && _read_iter->time() < start + nframes) { assert(_read_iter->size() > 0); diff --git a/libs/evoral/wscript b/libs/evoral/wscript index 1b05ce0bfa..3b44c01514 100644 --- a/libs/evoral/wscript +++ b/libs/evoral/wscript @@ -1,30 +1,46 @@ #!/usr/bin/env python import Params +import autowaf + +# Version of this package (even if built as a child) +EVORAL_VERSION = '0.0.0' + +# Library version (UNIX style major, minor, micro) +# major increment <=> incompatible changes +# minor increment <=> compatible changes (additions) +# micro increment <=> no interface changes +# Version history: +# 0.0.0 = 0,0,0 +EVORAL_LIB_VERSION = '0.0.0' # Variables for 'waf dist' -VERSION = '0.0.1' APPNAME = 'evoral' +VERSION = EVORAL_VERSION # Mandatory variables srcdir = '.' blddir = 'build' def set_options(opt): + autowaf.set_options(opt) + opt.tool_options('compiler_cc') opt.tool_options('compiler_cxx') def configure(conf): - if not conf.env['GLIBMM']: - conf.check_pkg('glibmm-2.4', destvar='GLIBMM', vnum='2.16.0', mandatory=True) - if not conf.env['GTHREAD']: - conf.check_pkg('gthread-2.0', destvar='GTHREAD', vnum='2.16.0', mandatory=True) - if not conf.env['CXX']: - conf.check_tool('compiler_cxx') + autowaf.configure(conf) + autowaf.check_tool(conf, 'compiler_cxx') + autowaf.check_pkg(conf, 'glibmm-2.4', destvar='GLIBMM', vnum='2.16.0', mandatory=True) + autowaf.check_pkg(conf, 'gthread-2.0', destvar='GTHREAD', vnum='2.16.0', mandatory=True) def build(bld): - # Headers (evoral) - install_files('PREFIX', 'include/evoral', 'evoral/*.hpp') + # Headers + #install_files('PREFIX', 'include/evoral', 'evoral/*.h') + #install_files('PREFIX', 'include/evoral', 'evoral/*.hpp') - # Library (src) + # Pkgconfig file + #autowaf.build_pc(bld, 'EVORAL', EVORAL_VERSION, 'GLIBMM GTHREAD') + + # Library obj = bld.create_obj('cpp', 'shlib') obj.source = ''' src/Control.cpp @@ -38,17 +54,21 @@ def build(bld): src/SMFReader.cpp src/Sequence.cpp ''' - obj.includes = '..' + obj.includes = ['.'] obj.name = 'libevoral' obj.target = 'evoral' obj.uselib = 'GLIBMM GTHREAD' - obj.vnum = '0.0.0' + obj.vnum = EVORAL_LIB_VERSION + obj.inst_var = 0 - # Test (test) - obj = bld.create_obj('cpp', 'program') + # Unit tests + obj = bld.create_obj('cpp', 'program') obj.source = 'test/sequence.cpp' obj.includes = '..' obj.uselib_local = 'libevoral' obj.target = 'sequence' obj.inst_var = 0 +def shutdown(): + autowaf.shutdown() + |