progress.h 512 B

1234567891011121314151617181920212223242526272829
  1. #ifndef __PROGRESS_H
  2. #define __PROGRESS_H
  3. #include "subsecond_time.h"
  4. class Progress
  5. {
  6. public:
  7. Progress();
  8. ~Progress();
  9. void setProgress(float progress);
  10. private:
  11. static SInt64 __record(UInt64 arg, UInt64 val)
  12. { ((Progress *)arg)->record(val); return 0; }
  13. void record(UInt64 time);
  14. bool m_enabled;
  15. FILE * m_fp;
  16. time_t m_t_last;
  17. static const time_t m_interval = 2;
  18. bool m_manual;
  19. float m_manual_value;
  20. };
  21. #endif // __PROGRESS_H