home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / immtime.inl < prev    next >
Encoding:
Text File  |  1996-02-22  |  2.2 KB  |  46 lines

  1. #ifndef _IMMTIME_INL_
  2.    #define _IMMTIME_INL_ 0
  3. /*******************************************************************************
  4. * FILE NAME: immtime.inl                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   This file contains the definition of the inline functions for the          *
  8. *   classes declared in immtime.hpp                                            *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #ifndef _IMMTIME_
  19.   #undef _IMMTIME_INL_
  20.   #define _IMMTIME_INL_ 1
  21.   #include <immtime.hpp>
  22. #endif
  23.  
  24. #if _IMMTIME_INL_
  25.   #define inline
  26. #endif
  27.  
  28. inline unsigned long IMMHourMinSecFrameTime::HourMinSecFrameToMM(unsigned long value, unsigned long fps)
  29. {
  30.   return ((((value) & 0x000000FFL) * 60L * 60L * 3000L) +
  31.           (((value) & 0x0000FF00L) / 0x100L * 60L * 3000L) +
  32.           (((value) & 0x00FF0000L) / 0x10000L * 3000L) +
  33.           (((value) & 0xFF000000L) / 0x1000000L * 3000L/fps));
  34. }
  35.  
  36. inline unsigned long IMMHourMinSecFrameTime::HourMinSecFrameFromMM(unsigned long value, unsigned long fps)
  37. {
  38.   return ((((value)+63L) >= 0x100UL*60UL*60UL*3000UL) ? 0L :
  39.           (((((((value)+63L) % 3000L)/(3000L/fps))  << 24) & 0xFF000000L) |
  40.            ((((((value)+63L) / 3000L) % 60L) << 16) & 0x00FF0000L)      |
  41.           (((((((value)+63L) / 3000L) / 60L) % 60L) << 8) & 0x0000FF00L) |
  42.            ((((((value)+63L) / 3000L) / 60L) / 60L)  & 0x000000FFL)));
  43. }
  44.  
  45. #endif // _IMMTIME_INL_
  46.