Guest User

Untitled

a guest
Aug 30th, 2010
4,167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.95 KB | None | 0 0
  1. //====== Copyright © 1996-2005, 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.  
  10. #ifndef IBIK_H
  11. #define IBIK_H
  12.  
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16.  
  17. #include "appframework/IAppSystem.h"
  18.  
  19. //-----------------------------------------------------------------------------
  20. // Forward declarations
  21. //-----------------------------------------------------------------------------
  22. struct BGR888_t;
  23. class IMaterial;
  24.  
  25. //-----------------------------------------------------------------------------
  26. // Parameters for creating a new BINK
  27. //-----------------------------------------------------------------------------
  28. struct BIKParams_t
  29. {
  30.     BIKParams_t() :
  31.         m_nFrameRate( 0 ), m_nFrameScale( 1 ), m_nWidth( 0 ), m_nHeight( 0 ),
  32.         m_nSampleRate( 0 ), m_nSampleBits( 0 ), m_nNumChannels( 0 )
  33.     {
  34.         m_pFileName[ 0 ] = 0;
  35.     }
  36.  
  37.     char        m_pFileName[ 256 ];
  38.     char        m_pPathID[ 256 ];
  39.  
  40.     // fps = m_nFrameRate / m_nFrameScale
  41.     // for integer framerates, set framerate to the fps, and framescale to 1
  42.     // for ntsc-style framerates like 29.97 (or 23.976 or 59.94),
  43.     // set framerate to 30,000 (or 24,000 or 60,000) and framescale to 1001
  44.     // yes, framescale is an odd naming choice, but it matching MS's AVI api
  45.     int         m_nFrameRate;
  46.     int         m_nFrameScale;
  47.  
  48.     int         m_nWidth;
  49.     int         m_nHeight;
  50.  
  51.     // Sound/.wav info
  52.     int         m_nSampleRate;
  53.     int         m_nSampleBits;
  54.     int         m_nNumChannels;
  55. };
  56.  
  57. //-----------------------------------------------------------------------------
  58. // Handle to an BINK
  59. //-----------------------------------------------------------------------------
  60. typedef unsigned short BIKHandle_t;
  61. enum
  62. {
  63.     BIKHANDLE_INVALID = (BIKHandle_t)~0
  64. };
  65.  
  66.  
  67. //-----------------------------------------------------------------------------
  68. // Handle to an BINK material
  69. //-----------------------------------------------------------------------------
  70. typedef unsigned short BIKMaterial_t;
  71. enum
  72. {
  73.     BIKMATERIAL_INVALID = (BIKMaterial_t)~0
  74. };
  75.  
  76.  
  77. //-----------------------------------------------------------------------------
  78. // Main AVI interface
  79. //-----------------------------------------------------------------------------
  80. #define BIK_INTERFACE_VERSION "VBik001"
  81.  
  82. class IBik : public IAppSystem
  83. {
  84. public:
  85.     // Create/destroy a BINK material (a materialsystem IMaterial)
  86.     virtual BIKMaterial_t CreateMaterial( const char *pMaterialName, const char *pFileName, const char *pPathID ) = 0;
  87.     virtual void DestroyMaterial( BIKMaterial_t hMaterial ) = 0;
  88.    
  89.     // Update the frame (if necessary)
  90.     virtual bool Update( BIKMaterial_t hMaterial ) = 0;
  91.  
  92.     // Gets the IMaterial associated with an BINK material
  93.     virtual IMaterial* GetMaterial( BIKMaterial_t hMaterial ) = 0;
  94.  
  95.     // Returns the max texture coordinate of the BINK
  96.     virtual void GetTexCoordRange( BIKMaterial_t hMaterial, float *pMaxU, float *pMaxV ) = 0;
  97.  
  98.     // Returns the frame size of the BINK (stored in a subrect of the material itself)
  99.     virtual void GetFrameSize( BIKMaterial_t hMaterial, int *pWidth, int *pHeight ) = 0;
  100.  
  101.     // Returns the frame rate of the BINK
  102.     virtual int GetFrameRate( BIKMaterial_t hMaterial ) = 0;
  103.  
  104.     // Returns the total frame count of the BINK
  105.     virtual int GetFrameCount( BIKMaterial_t hMaterial ) = 0;
  106.  
  107.     // Sets the frame for an BINK material (use instead of SetTime)
  108.     virtual void SetFrame( BIKMaterial_t hMaterial, float flFrame ) = 0;
  109.  
  110. #if !defined( _X360 )
  111.     // Sets the direct sound device that Bink will decode to
  112.     virtual bool SetDirectSoundDevice( void *pDevice ) = 0;
  113. #else
  114.     //needs to be called after xaudio is initialized
  115.     virtual bool HookXAudio( void ) = 0;
  116. #endif
  117. };
  118.  
  119.  
  120.  
  121. #endif // IBIK_H
Advertisement
Add Comment
Please, Sign In to add comment