Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

121 lines
4.0 KiB

  1. //====== Copyright 2010, Valve Corporation, All rights reserved. ==============
  2. //
  3. // The copyright to the contents herein is the property of Valve, L.L.C.
  4. // The contents may be used and/or copied only with the written permission of
  5. // Valve, L.L.C., or in accordance with the terms and conditions stipulated in
  6. // the agreement/contract under which the contents have been supplied.
  7. //
  8. //=============================================================================
  9. #ifndef IQUICKTIME_H
  10. #define IQUICKTIME_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "appframework/iappsystem.h"
  15. #define QUICKTIME_LOOP_MOVIE 0x01
  16. #define QUICKTIME_PRELOAD 0x02
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. struct BGR888_t;
  21. class IMaterial;
  22. //-----------------------------------------------------------------------------
  23. // Parameters for creating a new BINK
  24. //-----------------------------------------------------------------------------
  25. struct QuickTimeParams_t
  26. {
  27. QuickTimeParams_t() :
  28. m_nFrameRate( 0 ), m_nFrameScale( 1 ), m_nWidth( 0 ), m_nHeight( 0 ),
  29. m_nSampleRate( 0 ), m_nSampleBits( 0 ), m_nNumChannels( 0 )
  30. {
  31. m_pFileName[ 0 ] = 0;
  32. }
  33. char m_pFileName[ 256 ];
  34. char m_pPathID[ 256 ];
  35. // fps = m_nFrameRate / m_nFrameScale
  36. // for integer framerates, set framerate to the fps, and framescale to 1
  37. // for ntsc-style framerates like 29.97 (or 23.976 or 59.94),
  38. // set framerate to 30,000 (or 24,000 or 60,000) and framescale to 1001
  39. // yes, framescale is an odd naming choice, but it matching MS's AVI api
  40. int m_nFrameRate;
  41. int m_nFrameScale;
  42. int m_nWidth;
  43. int m_nHeight;
  44. // Sound/.wav info
  45. int m_nSampleRate;
  46. int m_nSampleBits;
  47. int m_nNumChannels;
  48. };
  49. //-----------------------------------------------------------------------------
  50. // Handle to an QUICKTIME
  51. //-----------------------------------------------------------------------------
  52. typedef unsigned short QUICKTIMEHandle_t;
  53. enum
  54. {
  55. QUICKTIMEHANDLE_INVALID = (QUICKTIMEHandle_t)~0
  56. };
  57. //-----------------------------------------------------------------------------
  58. // Handle to an QUICKTIME material
  59. //-----------------------------------------------------------------------------
  60. typedef unsigned short QUICKTIMEMaterial_t;
  61. enum
  62. {
  63. QUICKTIMEMATERIAL_INVALID = (QUICKTIMEMaterial_t)~0
  64. };
  65. //-----------------------------------------------------------------------------
  66. // Main QUICKTIME interface
  67. //-----------------------------------------------------------------------------
  68. #define QUICKTIME_INTERFACE_VERSION "IQuickTime001"
  69. class IQuickTime : public IAppSystem
  70. {
  71. public:
  72. // Create/destroy a QUICKTIME material (a materialsystem IMaterial)
  73. virtual QUICKTIMEMaterial_t CreateMaterial( const char *pMaterialName, const char *pFileName, const char *pPathID, int flags = 0 ) = 0;
  74. virtual void DestroyMaterial( QUICKTIMEMaterial_t hMaterial ) = 0;
  75. // Update the frame (if necessary)
  76. virtual bool Update( QUICKTIMEMaterial_t hMaterial ) = 0;
  77. // Determines if a new frame of the movie is ready for display
  78. virtual bool ReadyForSwap( QUICKTIMEMaterial_t hMaterial ) = 0;
  79. // Gets the IMaterial associated with an BINK material
  80. virtual IMaterial* GetMaterial( QUICKTIMEMaterial_t hMaterial ) = 0;
  81. // Returns the max texture coordinate of the BINK
  82. virtual void GetTexCoordRange( QUICKTIMEMaterial_t hMaterial, float *pMaxU, float *pMaxV ) = 0;
  83. // Returns the frame size of the QUICKTIME Image Frame (stored in a subrect of the material itself)
  84. virtual void GetFrameSize( QUICKTIMEMaterial_t hMaterial, int *pWidth, int *pHeight ) = 0;
  85. // Returns the frame rate of the QUICKTIME
  86. virtual int GetFrameRate( QUICKTIMEMaterial_t hMaterial ) = 0;
  87. // Sets the frame for an BINK material (use instead of SetTime)
  88. virtual void SetFrame( QUICKTIMEMaterial_t hMaterial, float flFrame ) = 0;
  89. // Returns the total frame count of the BINK
  90. virtual int GetFrameCount( QUICKTIMEMaterial_t hMaterial ) = 0;
  91. virtual bool SetSoundDevice( void *pDevice ) = 0;
  92. };
  93. #endif // IQUICKTIME_H