I messed up the merge, so pushing it over to another repo so I don't lose it. Will tidy up and remove later

Dependencies:   BufferedSerial FatFileSystemCpp mbed

frameclock.h

Committer:
JamieB
Date:
17 months ago
Revision:
85:0cc5931bb9ef
Parent:
9:7214e3c3e5f8
Child:
84:8094a1e64ecf

File content as of revision 85:0cc5931bb9ef:

#ifndef __frameclock_h__
#define __frameclock_h__

#include "LTCApp.h"

class frameclock
{
public:
    frameclock();
    frameclock(int hour, int minute, int second, int frame, int rate, bool drop);

    void setMode(int rate, bool drop);
    void setTime(int hour, int minute, int second, int frame);

    inline void getTime(int *hour, int *minute, int *second, int *frame)
    {
        *hour = _hour;
        *minute = _minute;
        *second = _second;
        *frame = _frame;
    }

    uint32_t getTimeMS() {
       return (_hour*3600+_minute*60+_second)*1000 + (1000*_frame)/_rate;
    }

    void nextFrame();
    inline int hours(){return _hour;}
    inline int minutes(){return _minute;}
    inline int seconds(){return _second;}
    inline int frame() {return _frame;}

private:

    int _hour;
    int _minute;
    int _second;
    int _frame;
    int _rate;
    bool _drop;


};



#endif