WIP stubs for timecode string representation

This commit is contained in:
Fischlurch 2011-01-05 05:14:10 +01:00
parent 2edaae5c5b
commit e66bed65e4
3 changed files with 37 additions and 13 deletions

View file

@ -34,14 +34,12 @@
namespace lib {
namespace time {
/** writes time value, formatted as HH:MM:SS:mmm
* @see lumiera_tmpbuf_print_time */
inline std::ostream&
operator<< (std::ostream& os, Time const& t)
{
return os << std::string(t);
}
/* === shortcuts for diagnostic output === */
/** writes time value, formatted as HH:MM:SS:mmm */
inline std::ostream& operator<< (std::ostream& os, Time const& t) { return os << string(t); }
inline std::ostream& operator<< (std::ostream& os, TCode const& t) { return os << string(t); }

View file

@ -27,6 +27,7 @@
#include "lib/time/timevalue.hpp"
#include "lib/time/formats.hpp"
//#include <iostream>
//#include <boost/operators.hpp>
#include <string>
@ -48,9 +49,14 @@ namespace time {
public:
virtual ~TCode();
virtual string show() const =0;
virtual string describe() const =0;
virtual Time getTime() const =0;
operator string() const { return show(); }
string describe() const { return tcID(); }
Time getTime() const { return Time(calc()); }
protected:
virtual string show() const =0;
virtual string tcID() const =0;
virtual TimeValue calc() const =0;
};
@ -66,6 +72,10 @@ namespace time {
class FrameNr
: public TCode
{
virtual string show() const ;
virtual string tcID() const ;
virtual TimeValue calc() const ;
public:
FrameNr (QuTime const& quantisedTime);
@ -82,6 +92,10 @@ namespace time {
: public TCode
{
virtual string show() const ;
virtual string tcID() const ;
virtual TimeValue calc() const ;
public:
SmpteTC (QuTime const& quantisedTime);
@ -100,6 +114,10 @@ namespace time {
: public TCode
{
virtual string show() const ;
virtual string tcID() const ;
virtual TimeValue calc() const ;
public:
HmsTC (QuTime const& quantisedTime);
@ -118,13 +136,20 @@ namespace time {
: public TCode
{
virtual string show() const ;
virtual string tcID() const ;
virtual TimeValue calc() const ;
public:
Secs (QuTime const& quantisedTime);
operator FSecs() const;
};
/** writes time value, formatted as HH:MM:SS:mmm */
}} // lib::time
#endif

View file

@ -23,8 +23,9 @@
#include "lib/test/run.hpp"
#include "lib/test/test-helper.hpp"
#include "lib/time/timequant.hpp"
#include "proc/asset/meta/time-grid.hpp"
#include "lib/time/timequant.hpp"
#include "lib/time/display.hpp"
#include "lib/util.hpp"
#include <boost/lexical_cast.hpp>
@ -114,7 +115,7 @@ namespace test{
{
cout << timecodeValue.describe()
<< " time = "<< timecodeValue.getTime()
<< " code = "<< timecodeValue.show()
<< " code = "<< timecodeValue
<< endl;
}