From cce72e611ef6e2ae68e122ba3cc21cf39954b4d4 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 21 Dec 2010 02:05:13 +0100 Subject: [PATCH] WIP: new namespace and compliation units for time quantisation namespace lib::time lumitime.cpp will define the basic time wrapper quantiser.cpp the grid alitnment and formatting wrapper header for - timevalues / ranges - quantised time valuse - timecode valuse "lumitime.hpp" will contain the interface facilities --- src/lib/Makefile.am | 3 +- src/lib/{ => time}/lumitime.cpp | 8 ++++-- src/lib/time/quantiser.cpp | 39 ++++++++++++++++++++++++++ src/lib/time/quantiser.hpp | 49 +++++++++++++++++++++++++++++++++ src/lib/time/timecode.hpp | 49 +++++++++++++++++++++++++++++++++ src/lib/time/timevalue.hpp | 49 +++++++++++++++++++++++++++++++++ 6 files changed, 193 insertions(+), 4 deletions(-) rename src/lib/{ => time}/lumitime.cpp (97%) create mode 100644 src/lib/time/quantiser.cpp create mode 100644 src/lib/time/quantiser.hpp create mode 100644 src/lib/time/timecode.hpp create mode 100644 src/lib/time/timevalue.hpp diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 9837f7da3..a00b4bdc2 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -44,7 +44,6 @@ liblumiera_la_SOURCES = \ $(liblumiera_la_srcdir)/lockerror.c \ $(liblumiera_la_srcdir)/logging.cpp \ $(liblumiera_la_srcdir)/luid.c \ - $(liblumiera_la_srcdir)/lumitime.cpp \ $(liblumiera_la_srcdir)/mpool.c \ $(liblumiera_la_srcdir)/mrucache.c \ $(liblumiera_la_srcdir)/mutex.c \ @@ -61,6 +60,8 @@ liblumiera_la_SOURCES = \ $(liblumiera_la_srcdir)/test/test-helper.cpp \ $(liblumiera_la_srcdir)/test/testoption.cpp \ $(liblumiera_la_srcdir)/time.c \ + $(liblumiera_la_srcdir)/time/lumitime.cpp \ + $(liblumiera_la_srcdir)/time/quantiser.cpp \ $(liblumiera_la_srcdir)/tmpbuf.c \ $(liblumiera_la_srcdir)/util.cpp diff --git a/src/lib/lumitime.cpp b/src/lib/time/lumitime.cpp similarity index 97% rename from src/lib/lumitime.cpp rename to src/lib/time/lumitime.cpp index bae855539..6f1a7ac23 100644 --- a/src/lib/lumitime.cpp +++ b/src/lib/time/lumitime.cpp @@ -22,6 +22,8 @@ #include "lib/lumitime.hpp" +#include "lib/time/timevalue.hpp" + extern "C" { #include "lib/time.h" } @@ -39,7 +41,7 @@ namespace lumiera { const Time Time::MIN ( -std::numeric_limits::max() ); - + Time::Time ( long millis , uint secs , uint mins @@ -47,7 +49,7 @@ namespace lumiera { ) : t_(lumiera_build_time (millis,secs,mins,hours)) { } - + int Time::getMillis() const { @@ -81,7 +83,7 @@ namespace lumiera { // TODO return 0; } - + Time::operator string() const { diff --git a/src/lib/time/quantiser.cpp b/src/lib/time/quantiser.cpp new file mode 100644 index 000000000..48b24979c --- /dev/null +++ b/src/lib/time/quantiser.cpp @@ -0,0 +1,39 @@ +/* + Quantiser - aligning time values to a time grid + + Copyright (C) Lumiera.org + 2010, Hermann Vosseler + + This program 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. + + This program 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 more 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "lib/lumitime.hpp" +#include "lib/time/timevalue.hpp" + +using std::string; + + +namespace lib { +namespace time { + + + /** */ + + + +}} // lib::time + diff --git a/src/lib/time/quantiser.hpp b/src/lib/time/quantiser.hpp new file mode 100644 index 000000000..b511ed53f --- /dev/null +++ b/src/lib/time/quantiser.hpp @@ -0,0 +1,49 @@ +/* + QUANTISER.hpp - aligning time values to a time grid + + Copyright (C) Lumiera.org + 2010, Hermann Vosseler + + This program 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. + + This program 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 more 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef LIB_TIME_QUANTISER_H +#define LIB_TIME_QUANTISER_H + +//#include +#include + + +namespace lib { +namespace time { + + + /** + * Facility to create grid-aligned time values. + * + * @todo WIP-WIP-WIP + */ + class Quantiser + { + + public: + }; + + + +}} // lib::time +#endif diff --git a/src/lib/time/timecode.hpp b/src/lib/time/timecode.hpp new file mode 100644 index 000000000..2a8ef6750 --- /dev/null +++ b/src/lib/time/timecode.hpp @@ -0,0 +1,49 @@ +/* + TIMECODE.hpp - grid aligned and fixed format time specifications + + Copyright (C) Lumiera.org + 2010, Hermann Vosseler + + This program 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. + + This program 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 more 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef LIB_TIME_TIMECODE_H +#define LIB_TIME_TIMECODE_H + +//#include +#include + + +namespace lib { +namespace time { + + + /** + * fixed format time specification. + * + * @todo WIP-WIP-WIP + */ + class TCode + { + + public: + }; + + + +}} // lib::time +#endif diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp new file mode 100644 index 000000000..d81c7f283 --- /dev/null +++ b/src/lib/time/timevalue.hpp @@ -0,0 +1,49 @@ +/* + TIMEVALUE.hpp - basic definitions for time values and time intervals + + Copyright (C) Lumiera.org + 2010, Hermann Vosseler + + This program 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. + + This program 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 more 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef LIB_TIME_TIMEVALUE_H +#define LIB_TIME_TIMEVALUE_H + +//#include +#include + + +namespace lib { +namespace time { + + + /** + * fixed format time specification. + * + * @todo WIP-WIP-WIP + */ + class TimeValue + { + + public: + }; + + + +}} // lib::time +#endif