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
This commit is contained in:
Fischlurch 2010-12-21 02:05:13 +01:00
parent 1294926508
commit cce72e611e
6 changed files with 193 additions and 4 deletions

View file

@ -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

View file

@ -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<int64_t>::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
{

View file

@ -0,0 +1,39 @@
/*
Quantiser - aligning time values to a time grid
Copyright (C) Lumiera.org
2010, Hermann Vosseler <Ichthyostega@web.de>
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

View file

@ -0,0 +1,49 @@
/*
QUANTISER.hpp - aligning time values to a time grid
Copyright (C) Lumiera.org
2010, Hermann Vosseler <Ichthyostega@web.de>
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 <boost/operators.hpp>
#include <string>
namespace lib {
namespace time {
/**
* Facility to create grid-aligned time values.
*
* @todo WIP-WIP-WIP
*/
class Quantiser
{
public:
};
}} // lib::time
#endif

49
src/lib/time/timecode.hpp Normal file
View file

@ -0,0 +1,49 @@
/*
TIMECODE.hpp - grid aligned and fixed format time specifications
Copyright (C) Lumiera.org
2010, Hermann Vosseler <Ichthyostega@web.de>
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 <boost/operators.hpp>
#include <string>
namespace lib {
namespace time {
/**
* fixed format time specification.
*
* @todo WIP-WIP-WIP
*/
class TCode
{
public:
};
}} // lib::time
#endif

View file

@ -0,0 +1,49 @@
/*
TIMEVALUE.hpp - basic definitions for time values and time intervals
Copyright (C) Lumiera.org
2010, Hermann Vosseler <Ichthyostega@web.de>
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 <boost/operators.hpp>
#include <string>
namespace lib {
namespace time {
/**
* fixed format time specification.
*
* @todo WIP-WIP-WIP
*/
class TimeValue
{
public:
};
}} // lib::time
#endif