Leaked source code of windows server 2003
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.

228 lines
9.3 KiB

  1. //------------------------------------------------------------------------------
  2. // File: MedParam.idl
  3. //
  4. // Desc: Definition of the IMediaParams and associated interfaces. These
  5. // interfaces are designed to allow communication of curve-following
  6. // behaviors for parameters of objects which require dynamic changes
  7. // to their parameters at run time. All changes are specified by
  8. // timestamp and curve type to ensure the parameters can be set
  9. // at sufficient accuracy with predictable behavior on subsequent
  10. // playback of the same curves.
  11. //
  12. // Copyright (c) 1999 - 2000, Microsoft Corporation. All rights reserved.
  13. //------------------------------------------------------------------------------
  14. import "oaidl.idl";
  15. import "ocidl.idl";
  16. import "strmif.idl";
  17. //------------------------------------------------------------------------------
  18. // Define the semantic type to be used for each parameter. All values passed
  19. // into this interface are 32-bit floats, but the interface can specify that
  20. // the values must be integer, or booleans or enumerated types
  21. //------------------------------------------------------------------------------
  22. typedef float MP_DATA; // All data is 32-bit floats
  23. typedef enum _MP_Type {
  24. MPT_INT, // data is signed 23 bit integer (mantissa)
  25. MPT_FLOAT, // data is 32bit IEEE float
  26. MPT_BOOL, // data is true or false (using ANSI C++ definition)
  27. MPT_ENUM, // data is a set (represented by consecutive integers)
  28. MPT_MAX,
  29. } MP_TYPE;
  30. const MP_DATA MPBOOL_TRUE = 1.0; // Value of true
  31. const MP_DATA MPBOOL_FALSE = 0.0; // Value of false
  32. //------------------------------------------------------------------------------
  33. // Define the types of curves which are supported
  34. //------------------------------------------------------------------------------
  35. typedef enum _MP_CURVE_TYPE {
  36. MP_CURVE_JUMP = 0x0001, // No interpolation, just jump to next point
  37. MP_CURVE_LINEAR = 0x0002, // Linear interpolation (y follows x from 0.0 to 1.0)
  38. MP_CURVE_SQUARE = 0x0004, // y follow x^2 from 0.0 to 1.0
  39. MP_CURVE_INVSQUARE = 0x0008, // y follows 1-(x^2) from 0.0 to 1.0
  40. MP_CURVE_SINE = 0x0010, // y follows sin(x) from -pi/2 to pi/2
  41. } MP_CURVE_TYPE;
  42. //------------------------------------------------------------------------------
  43. // Capability bits. Used by the object to specify what capabilities it has.
  44. //------------------------------------------------------------------------------
  45. typedef DWORD MP_CAPS;
  46. // Curve capabilities - If the cap bit is set, that type of curve is supported
  47. const MP_CAPS MP_CAPS_CURVE_JUMP = MP_CURVE_JUMP;
  48. const MP_CAPS MP_CAPS_CURVE_LINEAR = MP_CURVE_LINEAR;
  49. const MP_CAPS MP_CAPS_CURVE_SQUARE = MP_CURVE_SQUARE;
  50. const MP_CAPS MP_CAPS_CURVE_INVSQUARE = MP_CURVE_INVSQUARE;
  51. const MP_CAPS MP_CAPS_CURVE_SINE = MP_CURVE_SINE;
  52. //------------------------------------------------------------------------------
  53. // Structure used to return information about the type and limits of a parameter
  54. //------------------------------------------------------------------------------
  55. typedef struct _MP_PARAMINFO {
  56. MP_TYPE mpType; // One of MP_TYPE_xxx codes
  57. MP_CAPS mopCaps; // A collection of MP_CAPS flags
  58. // Minimum and maximum values
  59. MP_DATA mpdMinValue; // minimum legal value
  60. MP_DATA mpdMaxValue; // maximum legal value
  61. MP_DATA mpdNeutralValue; // default or 'center' value
  62. // Defualt Unit and Label text. These strings will ALWAYS be English
  63. // strings in the UNICODE character set. For international text
  64. // use the GetParamText member function
  65. WCHAR szUnitText[32]; // units of the parameter
  66. WCHAR szLabel[32]; // name of the parameter
  67. } MP_PARAMINFO;
  68. //------------------------------------------------------------------------------
  69. // Parameter Index types
  70. //------------------------------------------------------------------------------
  71. typedef DWORD DWORD;
  72. const DWORD DWORD_ALLPARAMS = -1; // Apply this operation to all params
  73. //------------------------------------------------------------------------------
  74. // Defined list of timestamp types
  75. //------------------------------------------------------------------------------
  76. typedef DWORD MP_TIMEDATA; // Extra data to further define type
  77. // REFERENCE_TIME (1 tick = 100 nanoseconds, MP_TIMEDATA ignored)
  78. cpp_quote("DEFINE_GUID(GUID_TIME_REFERENCE,")
  79. cpp_quote("0x93ad712b, 0xdaa0, 0x4ffe, 0xbc, 0x81, 0xb0, 0xce, 0x50, 0xf, 0xcd, 0xd9);")
  80. // Music Time (MP_TIMEDATA = parts/quarter note)
  81. cpp_quote("DEFINE_GUID(GUID_TIME_MUSIC,")
  82. cpp_quote("0x574c49d, 0x5b04, 0x4b15, 0xa5, 0x42, 0xae, 0x28, 0x20, 0x30, 0x11, 0x7b);")
  83. // Time is measures in samples. MP_TIMEDATA = Samples/sec)
  84. cpp_quote("DEFINE_GUID(GUID_TIME_SAMPLES,")
  85. cpp_quote("0xa8593d05, 0xc43, 0x4984, 0x9a, 0x63, 0x97, 0xaf, 0x9e, 0x2, 0xc4, 0xc0);")
  86. //------------------------------------------------------------------------------
  87. // The value of a given parameter at a specific point in time
  88. //------------------------------------------------------------------------------
  89. typedef DWORD MP_FLAGS;
  90. const MP_FLAGS MPF_ENVLP_STANDARD = 0x0000; // Use all data provided
  91. const MP_FLAGS MPF_ENVLP_BEGIN_CURRENTVAL = 0x0001;
  92. // Ignore valStart value, use current value as the staring point
  93. const MP_FLAGS MPF_ENVLP_BEGIN_NEUTRALVAL = 0x0002;
  94. // Ignore valStart value, use neutral value as the staring point
  95. typedef struct _MP_ENVELOPE_SEGMENT {
  96. REFERENCE_TIME rtStart; // Start time in current time format
  97. REFERENCE_TIME rtEnd; // End time in current time format
  98. MP_DATA valStart; // Initial Value
  99. MP_DATA valEnd; // Final Value
  100. MP_CURVE_TYPE iCurve; // One of MP_CURVE_TYPE codes
  101. MP_FLAGS flags; // Special cases
  102. } MP_ENVELOPE_SEGMENT;
  103. //------------------------------------------------------------------------------
  104. // Define flags for Punch-in timing
  105. //------------------------------------------------------------------------------
  106. const MP_FLAGS MPF_PUNCHIN_REFTIME = 0; // Use the reference time as the PI time
  107. const MP_FLAGS MPF_PUNCHIN_NOW = 0x0001; // Punch in at the current clock time
  108. const MP_FLAGS MPF_PUNCHIN_STOPPED = 0x0002; // Return change notifications during
  109. // author time
  110. //------------------------------------------------------------------------------
  111. // IMediaParamInfo - Interface used to determine the names, data types and
  112. // units of the parameters which are exposed by the object. This interface
  113. // is used at discovery time, and is not required during run-time since the
  114. // objects parameters are a fixed set and this data can be cached by the
  115. // calling applicaiton
  116. //------------------------------------------------------------------------------
  117. [
  118. object,
  119. uuid(6d6cbb60-a223-44aa-842f-a2f06750be6d),
  120. version(1.0)
  121. ]
  122. interface IMediaParamInfo : IUnknown
  123. {
  124. HRESULT GetParamCount (
  125. [out] DWORD * pdwParams
  126. );
  127. HRESULT GetParamInfo (
  128. [in] DWORD dwParamIndex,
  129. [out] MP_PARAMINFO * pInfo
  130. );
  131. // returns a series of null terminated strings. strings are in the
  132. // following order:
  133. // Param Label, Units Text, 1st Enum Text, 2nd Enum Text, etc...
  134. HRESULT GetParamText (
  135. [in] DWORD dwParamIndex, // which param to get text for
  136. [out] WCHAR **ppwchText // returns ptr to CoTaskMemAlloc'd string
  137. );
  138. // Returns the number of diffrent time formats this object understands
  139. HRESULT GetNumTimeFormats (
  140. [out] DWORD * pdwNumTimeFormats
  141. );
  142. // Returns the GUID for the ith supported time format
  143. HRESULT GetSupportedTimeFormat(
  144. [in] DWORD dwFormatIndex,
  145. [out] GUID *pguidTimeFormat
  146. );
  147. // Returns the current time format
  148. HRESULT GetCurrentTimeFormat (
  149. [out] GUID *pguidTimeFormat,
  150. [out] MP_TIMEDATA *pTimeData
  151. );
  152. }
  153. //------------------------------------------------------------------------------
  154. // IMediaParams - Interfaes used to actually set the media params and the
  155. // envelopes to follow
  156. //------------------------------------------------------------------------------
  157. [
  158. object,
  159. uuid(6d6cbb61-a223-44aa-842f-a2f06750be6e),
  160. version(1.0)
  161. ]
  162. interface IMediaParams : IUnknown
  163. {
  164. // Single param Get/Set methods
  165. HRESULT GetParam (
  166. [in] DWORD dwParamIndex,
  167. [out] MP_DATA *pValue
  168. );
  169. HRESULT SetParam (
  170. [in] DWORD dwParamIndex,
  171. [in] MP_DATA value
  172. );
  173. // Envelope methods (param change over time)
  174. HRESULT AddEnvelope (
  175. [in] DWORD dwParamIndex,
  176. [in] DWORD cSegments,
  177. [in] MP_ENVELOPE_SEGMENT * pEnvelopeSegments
  178. );
  179. // Flush all of the envelope information for the given paramter between
  180. // the timestamps specified
  181. HRESULT FlushEnvelope (
  182. [in] DWORD dwParamIndex,
  183. [in] REFERENCE_TIME refTimeStart,
  184. [in] REFERENCE_TIME refTimeEnd
  185. );
  186. // Change the time format being used by the object
  187. HRESULT SetTimeFormat (
  188. [in] GUID guidTimeFormat,
  189. [in] MP_TIMEDATA mpTimeData
  190. );
  191. }