rmaausvc.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:38k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /****************************************************************************
  2.  * 
  3.  *  $Id: rmaausvc.h,v 1.1 2003/05/30 02:17:36 gabest Exp $
  4.  * 
  5.  *  Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
  6.  *  
  7.  *  http://www.real.com/devzone
  8.  *
  9.  *  This program contains proprietary 
  10.  *  information of Progressive Networks, Inc, and is licensed
  11.  *  subject to restrictions on use and distribution.
  12.  *
  13.  *
  14.  *  RealMedia Architecture Audio Services Interfaces.
  15.  *
  16.  */
  17. #ifndef _RMAAUSVC_H_
  18. #define _RMAAUSVC_H_
  19. /****************************************************************************
  20.  *
  21.  * Forward declarations of some interfaces defined here-in.
  22.  */
  23. typedef _INTERFACE   IRMAAudioPlayer     IRMAAudioPlayer;
  24. typedef _INTERFACE   IRMAAudioPlayerResponse     IRMAAudioPlayerResponse;
  25. typedef _INTERFACE   IRMAAudioStream     IRMAAudioStream;
  26. typedef _INTERFACE   IRMAAudioStream2     IRMAAudioStream2;
  27. typedef _INTERFACE   IRMAAudioDevice     IRMAAudioDevice;
  28. typedef _INTERFACE   IRMAAudioDeviceResponse     IRMAAudioDeviceResponse;
  29. typedef _INTERFACE   IRMAAudioHook     IRMAAudioHook;
  30. typedef _INTERFACE   IRMAAudioStreamInfoResponse    IRMAAudioStreamInfoResponse;
  31. typedef _INTERFACE   IRMAVolume     IRMAVolume;
  32. typedef _INTERFACE   IRMAVolumeAdviseSink     IRMAVolumeAdviseSink;
  33. typedef _INTERFACE   IRMADryNotification     IRMADryNotification;
  34. typedef _INTERFACE   IRMABuffer     IRMABuffer;
  35. typedef _INTERFACE   IRMAValues     IRMAValues;
  36. /****************************************************************************
  37.  *
  38.  * Audio Services Data Structures
  39.  */
  40. typedef struct _RMAAudioFormat
  41. {
  42.     UINT16 uChannels; /* Num. of Channels (1=Mono, 2=Stereo, etc. */
  43.     UINT16 uBitsPerSample; /* 8 or 16     */
  44.     ULONG32 ulSamplesPerSec;/* Sampling Rate     */
  45.     UINT16 uMaxBlockSize; /* Max Blocksize     */
  46. } RMAAudioFormat;
  47. typedef enum _AudioStreamType
  48. {
  49.     STREAMING_AUDIO = 0,
  50.     INSTANTANEOUS_AUDIO = 1,
  51.     TIMED_AUDIO = 2
  52. } AudioStreamType;
  53. typedef struct _RMAAudioData
  54. {
  55.     IRMABuffer*     pData; /* Audio data     */ 
  56.     ULONG32     ulAudioTime; /* Start time in milliseconds     */
  57.     AudioStreamType uAudioStreamType;
  58. } RMAAudioData;
  59. /****************************************************************************
  60.  * 
  61.  *  Interface:
  62.  * 
  63.  *  IRMAAudioPlayer
  64.  * 
  65.  *  Purpose:
  66.  * 
  67.  *  This interface provides access to the Audio Player services. Use this
  68.  *  interface to create audio streams, "hook" post-mixed audio data, and to
  69.  *  control volume levels.
  70.  * 
  71.  *  IID_IRMAAudioPlayer:
  72.  * 
  73.  *  {00000700-0901-11d1-8B06-00A024406D59}
  74.  * 
  75.  */
  76. DEFINE_GUID(IID_IRMAAudioPlayer, 0x00000700, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  77.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  78. #undef  INTERFACE
  79. #define INTERFACE   IRMAAudioPlayer
  80. DECLARE_INTERFACE_(IRMAAudioPlayer, IUnknown)
  81. {
  82.     /*
  83.      *  IUnknown methods
  84.      */
  85.     STDMETHOD(QueryInterface)       (THIS_
  86.                     REFIID riid,
  87.                     void** ppvObj) PURE;
  88.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  89.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  90.     /*
  91.      *  IRMAAudioPlayer methods
  92.      */
  93.     /************************************************************************
  94.     *  Method:
  95.     *      IRMAAudioPlayer::CreateAudioStream
  96.     *  Purpose:
  97.     * Call this to create an audio stream.
  98.     */
  99.     STDMETHOD(CreateAudioStream)    (THIS_
  100.     IRMAAudioStream** /*OUT*/ pAudioStream
  101.     ) PURE;
  102.     /************************************************************************
  103.     *  Method:
  104.     *      IRMAAudioPlayer::AddPostMixHook
  105.     *  Purpose:
  106.     * Call this to hook audio data after all audio streams in this
  107.     * have been mixed.
  108.     */
  109.     STDMETHOD(AddPostMixHook) (THIS_
  110. IRMAAudioHook*     /*IN*/ pHook,
  111. const BOOL     /*IN*/ bDisableWrite,
  112. const BOOL     /*IN*/ bFinal
  113. ) PURE;
  114.     /************************************************************************
  115.     *  Method:
  116.     *      IRMAAudioPlayer::RemovePostMixHook
  117.     *  Purpose:
  118.     * Call this to remove an already added post hook.
  119.     */
  120.     STDMETHOD(RemovePostMixHook)    (THIS_
  121.     IRMAAudioHook*    /*IN*/ pHook
  122.     ) PURE;
  123.     /************************************************************************
  124.     *  Method:
  125.     *      IRMAAudioPlayer::GetAudioStreamCount
  126.     *  Purpose:
  127.     * Get the number of audio streams currently active in the 
  128.     * audio player. Since streams can be added mid-presentation
  129.     * this function may return different values on different calls.
  130.     * If the user needs to know about all the streams as they get
  131.     * get added to the player, IRMAAudioStreamInfoResponse should
  132.     * be implemented and passed in SetStreamInfoResponse.
  133.     */
  134.     STDMETHOD_(UINT16,GetAudioStreamCount) (THIS) PURE;
  135.     /************************************************************************
  136.     *  Method:
  137.     *      IRMAAudioPlayer::GetAudioStream
  138.     *  Purpose:
  139.     * Get an audio stream at position given. 
  140.     */
  141.     STDMETHOD_(IRMAAudioStream*,GetAudioStream) (THIS_
  142. UINT16 /*IN*/ uIndex
  143. ) PURE;
  144.     /************************************************************************
  145.     *  Method:
  146.     *      IRMAAudioPlayer::SetStreamInfoResponse
  147.     *  Purpose:
  148.     * Set a stream info response interface. A client must implement
  149.     * an IRMAAudioStreamInfoResponse and then call this method with
  150.     * the IRMAAudioStreamInfoResponse as the parameter. The audio
  151.     * player will call IRMAAudioStreamInfoResponse::OnStreamsReady
  152.     * with the total number of audio streams associated with this 
  153.     * audio player.
  154.     */
  155.     STDMETHOD(SetStreamInfoResponse) (THIS_
  156. IRMAAudioStreamInfoResponse* /*IN*/ pResponse
  157. ) PURE;
  158.     /************************************************************************
  159.     *  Method:
  160.     *      IRMAAudioPlayer::RemoveStreamInfoResponse
  161.     *  Purpose:
  162.     * Remove stream info response that was added earlier
  163.     */
  164.     STDMETHOD(RemoveStreamInfoResponse) (THIS_
  165. IRMAAudioStreamInfoResponse* /*IN*/ pResponse
  166. ) PURE;
  167.     /************************************************************************
  168.     *  Method:
  169.     *      IRMAAudioPlayer::GetAudioVolume
  170.     *  Purpose:
  171.     * Get the audio player's volume interface. This volume controls
  172.     * the volume level of all the mixed audio streams for this 
  173.     * audio player.
  174.     */
  175.     STDMETHOD_(IRMAVolume*,GetAudioVolume) (THIS) PURE;
  176.     /************************************************************************
  177.     *  Method:
  178.     *      IRMAAudioPlayer::GetDeviceVolume
  179.     *  Purpose:
  180.     * Get the audio device volume interface. This volume controls
  181.     * the audio device volume levels.
  182.     */
  183.     STDMETHOD_(IRMAVolume*,GetDeviceVolume) (THIS) PURE;
  184. };
  185. /****************************************************************************
  186.  * 
  187.  *  Interface:
  188.  * 
  189.  *  IRMAAudioPlayerResponse
  190.  * 
  191.  *  Purpose:
  192.  * 
  193.  *  This interface provides access to the Audio Player Response. Use this 
  194.  *  to receive audio player playback notifications. Your implementation of
  195.  *  OnTimeSync() is called with the current audio playback time (millisecs).
  196.  *  This interface is currently to be used ONLY by the RMA engine internally.
  197.  * 
  198.  *  IID_IRMAAudioPlayerResponse:
  199.  * 
  200.  *  {00000701-0901-11d1-8B06-00A024406D59}
  201.  * 
  202.  */
  203. DEFINE_GUID(IID_IRMAAudioPlayerResponse, 0x00000701, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  204.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  205. #undef  INTERFACE
  206. #define INTERFACE   IRMAAudioPlayerResponse
  207. DECLARE_INTERFACE_(IRMAAudioPlayerResponse, IUnknown)
  208. {
  209.     /*
  210.      *  IUnknown methods
  211.      */
  212.     STDMETHOD(QueryInterface)       (THIS_
  213.                     REFIID riid,
  214.                     void** ppvObj) PURE;
  215.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  216.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  217.     /*
  218.      *  IRMAAudioPlayerResponse methods
  219.      */
  220.     /************************************************************************
  221.      *  Method:
  222.      *      IRMAAudioPlayerResponse::OnTimeSync
  223.      *  Purpose:
  224.      *     This method is called with the current audio playback time.
  225.      */
  226.     STDMETHOD(OnTimeSync)   (THIS_
  227.     ULONG32 /*IN*/ ulTimeEnd
  228.     ) PURE;
  229. };
  230. /****************************************************************************
  231.  * 
  232.  *  Interface:
  233.  * 
  234.  *      IRMAAudioStream
  235.  * 
  236.  *  Purpose:
  237.  * 
  238.  *  This interface provides access to an Audio Stream. Use this to play
  239.  *  audio, "hook" audio stream data, and to get audio stream information.
  240.  * 
  241.  *  IID_IRMAAudioStream:
  242.  * 
  243.  *      {00000702-0901-11d1-8B06-00A024406D59}
  244.  * 
  245.  */
  246. DEFINE_GUID(IID_IRMAAudioStream, 0x00000702, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  247.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  248. #undef  INTERFACE
  249. #define INTERFACE   IRMAAudioStream
  250. DECLARE_INTERFACE_(IRMAAudioStream, IUnknown)
  251. {
  252.     /*
  253.      *  IUnknown methods
  254.      */
  255.     STDMETHOD(QueryInterface) (THIS_
  256. REFIID riid,
  257. void** ppvObj) PURE;
  258.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  259.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  260.     
  261.     /*
  262.      *  IRMAAudioStream methods
  263.      */
  264.     /************************************************************************
  265.      *  Method:
  266.      *      IRMAAudioStream::Init
  267.      *  Purpose:
  268.      *     Initialize an audio stream with the given audio format. The 
  269.      *     IRMAValues contains stream identification information. 
  270.      */
  271.     STDMETHOD(Init) (THIS_
  272. const RMAAudioFormat* /*IN*/ pAudioFormat,
  273. IRMAValues* /*IN*/  pValues
  274. ) PURE;
  275.     /************************************************************************
  276.      *  Method:
  277.      *      IRMAAudioStream::Write
  278.      *  Purpose:
  279.      *     Write audio data to Audio Services. 
  280.      *     
  281.      *     NOTE: If the renderer loses packets and there is no loss
  282.      *     correction, then the renderer should write the next packet 
  283.      *     using a meaningful start time.  Audio Services will play 
  284.      *      silence where packets are missing.
  285.      */
  286.     STDMETHOD(Write) (THIS_
  287. RMAAudioData* /*IN*/ pAudioData
  288. ) PURE;
  289.     /************************************************************************
  290.     *  Method:
  291.     *      IRMAAudioStream::AddPreMixHook
  292.     *  Purpose:
  293.     * Use this to "hook" audio stream data prior to the mixing.
  294.     * Set bDisableWrite to TRUE to prevent this audio stream data
  295.     * from being mixed with other audio stream data associated
  296.     * with this audio player.
  297.     */
  298.     STDMETHOD(AddPreMixHook) (THIS_
  299.                              IRMAAudioHook*     /*IN*/ pHook,
  300.      const BOOL        /*IN*/ bDisableWrite
  301.      ) PURE;
  302.     /************************************************************************
  303.     *  Method:
  304.     *      IRMAAudioStream::RemovePreMixHook
  305.     *  Purpose:
  306.     * Use this to remove an already added "hook".
  307.     */
  308.     STDMETHOD(RemovePreMixHook) (THIS_
  309.                              IRMAAudioHook*     /*IN*/ pHook
  310.       ) PURE;
  311.     /************************************************************************
  312.     *  Method:
  313.     *      IRMAAudioStream::AddDryNotification
  314.     *  Purpose:
  315.     *     Use this to add a notification response object to get 
  316.     *     notifications when audio stream is running dry.
  317.     */
  318.     STDMETHOD(AddDryNotification)   (THIS_
  319.                                  IRMADryNotification* /*IN*/ pNotification
  320.           ) PURE;
  321.     /************************************************************************
  322.     *  Method:
  323.     *      IRMAAudioStream::GetStreamInfo
  324.     *  Purpose:
  325.     * Use this to get information specific to this audio stream.
  326.     */
  327.     STDMETHOD_(IRMAValues*,GetStreamInfo)       (THIS) PURE;
  328.     /************************************************************************
  329.     *  Method:
  330.     *      IRMAAudioStream::GetAudioVolume
  331.     *  Purpose:
  332.     * Get the audio stream's volume interface. This volume controls
  333.     * the volume level for this audio stream.
  334.     */
  335.     STDMETHOD_(IRMAVolume*,GetAudioVolume) (THIS) PURE;
  336. };
  337. /****************************************************************************
  338.  * 
  339.  *  Interface:
  340.  * 
  341.  * IRMAAudioDevice
  342.  * 
  343.  *  Purpose:
  344.  * 
  345.  * Object that exports audio device API
  346.  * This interface is currently to be used ONLY by the RMA engine 
  347.  * internally.
  348.  * 
  349.  *  IID_IRMAAudioDevice:
  350.  * 
  351.  * {00000703-0901-11d1-8B06-00A024406D59}
  352.  * 
  353.  */
  354. DEFINE_GUID(IID_IRMAAudioDevice, 0x00000703, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 
  355.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  356. #undef  INTERFACE
  357. #define INTERFACE   IRMAAudioDevice
  358. DECLARE_INTERFACE_(IRMAAudioDevice, IUnknown)
  359. {
  360.     /*
  361.      *  IUnknown methods
  362.      */
  363.     STDMETHOD(QueryInterface)       (THIS_
  364.                     REFIID riid,
  365.                     void** ppvObj) PURE;
  366.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  367.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  368.     /*
  369.      *  IRMAAudioDevice methods
  370.      */
  371.     /************************************************************************
  372.     *  Method:
  373.     *     IRMAAudioDevice::Open
  374.     *  Purpose:
  375.     *     The caller calls this to open the audio device using the audio
  376.     *     format given.
  377.     */
  378.     STDMETHOD(Open) (THIS_
  379.     const RMAAudioFormat* /*IN*/ pAudioFormat,
  380.     IRMAAudioDeviceResponse* /*IN*/ pStreamResponse) PURE;
  381.     /************************************************************************
  382.     *  Method:
  383.     *      IRMAAudioDevice::Close
  384.     *  Purpose:
  385.     * The caller calls this to close the audio device.
  386.     */
  387.     STDMETHOD(Close) (THIS_
  388. const BOOL  /*IN*/ bFlush ) PURE;
  389.     /************************************************************************
  390.     *  Method:
  391.     *     IRMAAudioDevice::Resume
  392.     *  Purpose:
  393.     *     The caller calls this to start or resume audio playback.
  394.     */
  395.     STDMETHOD(Resume)         (THIS) PURE;
  396.     /************************************************************************
  397.     *  Method:
  398.     *     IRMAAudioDevice::Pause
  399.     *  Purpose:
  400.     *     The caller calls this to pause the audio device. If bFlush is
  401.     *     TRUE, any buffers in the audio device will be flushed; otherwise,
  402.     *     the buffers are played.
  403.     */
  404.     STDMETHOD(Pause)         (THIS) PURE;
  405.     /************************************************************************
  406.     *  Method:
  407.     *     IRMAAudioDevice::Write
  408.     *  Purpose:
  409.     *     The caller calls this to write an audio buffer.
  410.     */
  411.     STDMETHOD(Write)         (THIS_
  412.      const RMAAudioData* /*IN*/ pAudioData) PURE;
  413.     /************************************************************************
  414.     *  Method:
  415.     *      IRMAAudioDevice::InitVolume
  416.     *  Purpose:
  417.     *     The caller calls this to inform the audio stream of the client's
  418.     *     volume range. The audio stream maps the client's volume range
  419.     *     into the audio device volume range. 
  420.     *     NOTE: This function returns TRUE if volume is supported by this 
  421.     *     audio device.
  422.     */
  423.     STDMETHOD_(BOOL,InitVolume)  (THIS_
  424.  const UINT16 /*IN*/ uMinVolume,
  425.  const UINT16 /*IN*/ uMaxVolume) PURE;
  426.     /************************************************************************
  427.     *  Method:
  428.     *     IRMAAudioDevice::SetVolume
  429.     *  Purpose:
  430.     *     The caller calls this to set the audio device volume level.
  431.     */
  432.     STDMETHOD(SetVolume)         (THIS_
  433.  const UINT16    /*IN*/ uVolume) PURE;
  434.     /************************************************************************
  435.     *  Method:
  436.     *     IRMAAudioDevice::GetVolume
  437.     *  Purpose:
  438.     *     The caller calls this to get the audio device volume level.
  439.     */
  440.     STDMETHOD_(UINT16,GetVolume) (THIS) PURE;
  441.     /************************************************************************
  442.     *  Method:
  443.     *     IRMAAudioDevice::Reset
  444.     *  Purpose:
  445.     *     The caller calls this to reset the audio device.
  446.     */
  447.     STDMETHOD(Reset) (THIS) PURE;
  448.     /************************************************************************
  449.     *  Method:
  450.     *     IRMAAudioDevice::Drain
  451.     *  Purpose:
  452.     *     The caller calls this to drain the audio device.
  453.     */
  454.     STDMETHOD(Drain) (THIS) PURE;
  455.     /************************************************************************
  456.     *  Method:
  457.     *     IRMAAudioDevice::CheckFormat
  458.     *  Purpose:
  459.     *     The caller calls this to check the input format with the
  460.     *     audio device format.
  461.     */
  462.     STDMETHOD(CheckFormat)  (THIS_
  463.     const RMAAudioFormat* /*IN*/ pAudioFormat ) PURE;
  464.     /************************************************************************
  465.     *  Method:
  466.     *     IRMAAudioDevice::GetCurrentAudioTime
  467.     *  Purpose:
  468.     *     The caller calls this to get current system audio time.
  469.     */
  470.     STDMETHOD(GetCurrentAudioTime)  (THIS_
  471.     REF(ULONG32) /*OUT*/ ulCurrentTime) PURE;
  472. };
  473. /****************************************************************************
  474.  * 
  475.  *  Interface:
  476.  * IRMAAudioDeviceResponse
  477.  * 
  478.  *  Purpose:
  479.  * 
  480.  * Object that exports audio device Response API
  481.  * This interface is currently to be used ONLY by the RMA engine 
  482.  * internally.
  483.  * 
  484.  *  IID_IRMAAudioDeviceResponse:
  485.  * 
  486.  *  {00000704-0901-11d1-8B06-00A024406D59}
  487.  * 
  488.  */
  489. DEFINE_GUID(IID_IRMAAudioDeviceResponse, 0x00000704, 0x901, 0x11d1, 0x8b, 0x6, 
  490.     0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);
  491. #undef  INTERFACE
  492. #define INTERFACE   IRMAAudioDeviceResponse
  493. DECLARE_INTERFACE_(IRMAAudioDeviceResponse, IUnknown)
  494. {
  495.     /*
  496.      *  IUnknown methods
  497.      */
  498.     STDMETHOD(QueryInterface)       (THIS_
  499.                     REFIID riid,
  500.                     void** ppvObj) PURE;
  501.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  502.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  503.     /*
  504.      *  IRMAAudioDeviceResponse methods
  505.      */
  506.     /************************************************************************
  507.      *  Method:
  508.      *      IRMAAudioDeviceResponse::OnTimeSync
  509.      *  Purpose:
  510.      *      Notification interface provided by users of the IRMAAudioDevice
  511.      *      interface. This method is called by the IRMAAudioDevice when
  512.      *      audio playback occurs.
  513.      */
  514.     STDMETHOD(OnTimeSync)         (THIS_
  515.                      ULONG32          /*IN*/ ulTimeEnd) PURE;
  516. };
  517. /****************************************************************************
  518.  * 
  519.  *  Interface:
  520.  * 
  521.  *  IRMAAudioHook
  522.  * 
  523.  *  Purpose:
  524.  * 
  525.  *  Clients must implement this interface to access pre- or post-mixed 
  526.  *  audio data. Use this interface to get post processed audio buffers and
  527.  *  their associated audio format.
  528.  *
  529.  *  IID_IRMAAudioHook:
  530.  * 
  531.  *  {00000705-0901-11d1-8B06-00A024406D59}
  532.  * 
  533.  */
  534. DEFINE_GUID(IID_IRMAAudioHook, 0x00000705, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  535.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  536. #undef  INTERFACE
  537. #define INTERFACE   IRMAAudioHook
  538. DECLARE_INTERFACE_(IRMAAudioHook, IUnknown)
  539. {
  540.     /*
  541.      *  IUnknown methods!
  542.      */
  543.     STDMETHOD(QueryInterface) (THIS_
  544.                     REFIID riid,
  545.                     void** ppvObj) PURE;
  546.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  547.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  548.     /*
  549.      *  IRMAAudioHook methods
  550.      */
  551.     /************************************************************************
  552.      *  Method:
  553.      *      IRMAAudioHook::OnInit
  554.      *  Purpose:
  555.      *      Audio Services calls OnInit() with the audio data format of the
  556.      *     audio data that will be provided in the OnBuffer() method.
  557.      */
  558.     STDMETHOD(OnInit) (THIS_
  559.                      RMAAudioFormat* /*IN*/ pFormat) PURE;
  560.     /************************************************************************
  561.      *  Method:
  562.      *      IRMAAudioHook::OnBuffer
  563.      *  Purpose:
  564.      *      Audio Services calls OnBuffer() with audio data packets. The
  565.      *     renderer should not modify the data in the IRMABuffer part of
  566.      *     pAudioInData.  If the renderer wants to write a modified
  567.      *     version of the data back to Audio Services, then it should 
  568.      *     create its own IRMABuffer, modify the data and then associate 
  569.      *     this buffer with the pAudioOutData->pData member.
  570.      */
  571.     STDMETHOD(OnBuffer) (THIS_
  572.                      RMAAudioData* /*IN*/   pAudioInData,
  573.                      RMAAudioData* /*OUT*/  pAudioOutData) PURE;
  574. };
  575. /****************************************************************************
  576.  * 
  577.  *  Interface:
  578.  * 
  579.  *  IRMAAudioStreamInfoResponse
  580.  * 
  581.  *  Purpose:
  582.  * 
  583.  *  Clients must implement this interface when interested in receiving
  584.  *  notification of the total number of streams associated with this
  585.  *  audio player.
  586.  *
  587.  *  IID_IRMAAudioStreamInfoResponse:
  588.  * 
  589.  *  {00000706-0901-11d1-8B06-00A024406D59}
  590.  * 
  591.  */
  592. DEFINE_GUID(IID_IRMAAudioStreamInfoResponse, 0x00000706, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  593.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  594. #undef  INTERFACE
  595. #define INTERFACE   IRMAAudioStreamInfoResponse
  596. DECLARE_INTERFACE_(IRMAAudioStreamInfoResponse, IUnknown)
  597. {
  598.     /*
  599.      *  IUnknown methods
  600.      */
  601.     STDMETHOD(QueryInterface)       (THIS_
  602.                     REFIID riid,
  603.                     void** ppvObj) PURE;
  604.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  605.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  606.     /*
  607.      *  IRMAAudioStreamInfoResponse methods
  608.      */
  609.     /************************************************************************
  610.      *  Method:
  611.      *      IRMAAudioStreamInfoResponse::OnStream
  612.      *  Purpose:
  613.      *     The client implements this to get notification of streams 
  614.      *     associated with this player. Use 
  615.      *     AudioPlayer::SetStreamInfoResponse() to register your 
  616.      *     implementation with the AudioPlayer. Once player has been 
  617.      *     initialized, it will call OnStream() multiple times to pass all 
  618.      *     the streams. Since a stream can be added mid-presentation, 
  619.      *     IRMAAudioStreamInfoResponse object should be written to handle 
  620.      *     OnStream() in the midst of the presentation as well.
  621.      */
  622.     STDMETHOD(OnStream) (THIS_
  623. IRMAAudioStream* /*IN*/ pAudioStream) PURE;
  624. };
  625. /****************************************************************************
  626.  * 
  627.  *  Interface:
  628.  * 
  629.  *  IRMAVolume
  630.  * 
  631.  *  Purpose:
  632.  * 
  633.  *  This interface provides access to Audio Services volume control. Use this
  634.  *  interface to get, set, or receive notifications of volume changes. Audio
  635.  *  Services implements IRMAVolume for IRMAAudioPlayer, IRMAAudioStream and 
  636.  *  for the audio device. Clients can use the IRMAVolume interface to get/set
  637.  *  volume levels of each audio stream, to get/set volume levels for the 
  638.  *  audio player's mixed data, or to get/set the volume levels of the audio 
  639.  *  device. See AudioStream::GetStreamVolume() (TBD), AudioPlayer::
  640.  *  GetAudioVolume() and AudioPlayer::GetDeviceVolume().
  641.  *
  642.  *  IID_IRMAVolume:
  643.  * 
  644.  *  {00000707-0901-11d1-8B06-00A024406D59}
  645.  * 
  646.  */
  647. DEFINE_GUID(IID_IRMAVolume, 0x00000707, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  648.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  649. #undef  INTERFACE
  650. #define INTERFACE   IRMAVolume
  651. DECLARE_INTERFACE_(IRMAVolume, IUnknown)
  652. {
  653.     /*
  654.      *  IUnknown methods
  655.      */
  656.     STDMETHOD(QueryInterface)       (THIS_
  657.                     REFIID riid,
  658.                     void** ppvObj) PURE;
  659.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  660.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  661.     /*
  662.      *  IRMAVolume methods
  663.      */
  664.     /************************************************************************
  665.      *  Method:
  666.      *      IRMAVolume::SetVolume
  667.      *  Purpose:
  668.      *     Call this to set the volume level.
  669.      */
  670.     STDMETHOD(SetVolume) (THIS_
  671.                          const UINT16 /*IN*/ uVolume ) PURE;
  672.     /************************************************************************
  673.      *  Method:
  674.      *      IRMAVolume::GetVolume
  675.      *  Purpose:
  676.      *     Call this to get the current volume level.
  677.      */
  678.     STDMETHOD_(UINT16,GetVolume)   (THIS) PURE;
  679.      /************************************************************************
  680.      *  Method:
  681.      *      IRMAVolume::SetMute
  682.      *  Purpose:
  683.      *     Call this to mute the volume.
  684.      */
  685.     STDMETHOD(SetMute)   (THIS_
  686.                          const BOOL /*IN*/ bMute ) PURE;
  687.      /************************************************************************
  688.      *  Method:
  689.      *      IRMAVolume::GetMute
  690.      *  Purpose:
  691.      *     Call this to determine if the volume is muted.
  692.      *   
  693.      */
  694.     STDMETHOD_(BOOL,GetMute)       (THIS) PURE;
  695.      /************************************************************************
  696.      *  Method:
  697.      *      IRMAVolume::AddAdviseSink
  698.      *  Purpose:
  699.      *     Call this to register an IRMAVolumeAdviseSink. The advise sink
  700.      *     methods: OnVolumeChange() and OnMuteChange() are called when
  701.      *     ever IRMAVolume::SetVolume() and IRMAVolume::SetMute() are
  702.      *     called.
  703.      */
  704.     STDMETHOD(AddAdviseSink) (THIS_
  705.  IRMAVolumeAdviseSink* /*IN*/ pSink
  706. ) PURE;
  707.      /************************************************************************
  708.      *  Method:
  709.      *      IRMAVolume::RemoveAdviseSink
  710.      *  Purpose:
  711.      *     Call this to unregister an IRMAVolumeAdviseSink. Use this when
  712.      *     you are no longer interested in receiving volume or mute change
  713.      *     notifications.
  714.      */
  715.     STDMETHOD(RemoveAdviseSink) (THIS_
  716.  IRMAVolumeAdviseSink* /*IN*/ pSink
  717. ) PURE;
  718. };
  719. /****************************************************************************
  720.  * 
  721.  *  Interface:
  722.  * 
  723.  *  IRMAVolumeAdviseSink
  724.  * 
  725.  *  Purpose:
  726.  * 
  727.  *  This interface provides access to notifications of volume changes. A 
  728.  *  client must implement this interface if they are interested in receiving 
  729.  *  notifications of volume level changes or mute state changes. A client must 
  730.  *  register their volume advise sink using IRMAVolume::AddAdviseSink().
  731.  *  See the IRMAVolume interface.
  732.  * 
  733.  *  IID_IRMAVolumeAdviseSink:
  734.  * 
  735.  *  {00000708-0901-11d1-8B06-00A024406D59}
  736.  * 
  737.  */
  738. DEFINE_GUID(IID_IRMAVolumeAdviseSink, 0x00000708, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  739.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  740. #undef  INTERFACE
  741. #define INTERFACE   IRMAVolumeAdviseSink
  742. DECLARE_INTERFACE_(IRMAVolumeAdviseSink, IUnknown)
  743. {
  744.     /*
  745.      *  IUnknown methods
  746.      */
  747.     STDMETHOD(QueryInterface)       (THIS_
  748.                     REFIID riid,
  749.                     void** ppvObj) PURE;
  750.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  751.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  752.     /*
  753.      *  IRMAVolumeAdviseSink methods
  754.      */
  755.     /************************************************************************
  756.      *  Method:
  757.      *      IRMAVolumeAdviseSink::OnVolumeChange
  758.      *  Purpose:
  759.      *     This interface is called whenever the associated IRMAVolume
  760.      *     SetVolume() is called.
  761.      */
  762.     STDMETHOD(OnVolumeChange) (THIS_ 
  763. const UINT16 uVolume
  764. ) PURE;
  765.     /************************************************************************
  766.      *  Method:
  767.      *      IRMAVolumeAdviseSink::OnMuteChange
  768.      *  Purpose:
  769.      *     This interface is called whenever the associated IRMAVolume
  770.      *     SetMute() is called.
  771.      *    
  772.      */
  773.     STDMETHOD(OnMuteChange)     (THIS_
  774. const BOOL bMute
  775. ) PURE;
  776. };
  777. /****************************************************************************
  778.  * 
  779.  *  Interface:
  780.  * 
  781.  *  IRMADryNotification
  782.  * 
  783.  *  Purpose:
  784.  * 
  785.  *  Audio Renderer should implement this if it needs notification when the 
  786.  *  audio stream is running dry. 
  787.  *
  788.  *  IID_IRMADryNotification:
  789.  * 
  790.  *  {00000709-0901-11d1-8B06-00A024406D59}
  791.  * 
  792.  */
  793. DEFINE_GUID(IID_IRMADryNotification, 0x00000709, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  794.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  795. #undef  INTERFACE
  796. #define INTERFACE   IRMADryNotification
  797. DECLARE_INTERFACE_(IRMADryNotification, IUnknown)
  798. {
  799.     /*
  800.      *  IUnknown methods
  801.      */
  802.     STDMETHOD(QueryInterface)       (THIS_
  803.     REFIID riid,
  804.     void** ppvObj) PURE;
  805.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  806.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  807.     /*
  808.      *  IRMADryNotification methods
  809.      */
  810.     /************************************************************************
  811.      *  Method:
  812.      *      IRMADryNotification::OnDryNotification
  813.      *  Purpose:
  814.      *     This function is called when it is time to write to audio device 
  815.      *     and there is not enough data in the audio stream. The renderer can
  816.      *     then decide to add more data to the audio stream. This should be 
  817.      *     done synchronously within the call to this function.
  818.      *     It is OK to not write any data. Silence will be played instead.
  819.      */
  820.     STDMETHOD(OnDryNotification)    (THIS_
  821.     UINT32 /*IN*/ ulCurrentStreamTime,
  822.     UINT32 /*IN*/ ulMinimumDurationRequired
  823.     ) PURE;
  824. };
  825. /****************************************************************************
  826.  * 
  827.  *  Interface:
  828.  * 
  829.  *  IRMAAudioDeviceManager
  830.  * 
  831.  *  Purpose:
  832.  * 
  833.  *  Allows the default audio device to be replaced.
  834.  *
  835.  *  IID_IRMAAudioDeviceManager:
  836.  * 
  837.  *  {0000070A-0901-11d1-8B06-00A024406D59}
  838.  * 
  839.  */
  840. DEFINE_GUID(IID_IRMAAudioDeviceManager, 0x0000070A, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  841.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  842. #undef  INTERFACE
  843. #define INTERFACE   IRMAAudioDeviceManager
  844. DECLARE_INTERFACE_(IRMAAudioDeviceManager, IUnknown)
  845. {
  846.     /*
  847.      *  IUnknown methods
  848.      */
  849.     STDMETHOD(QueryInterface)       (THIS_
  850.     REFIID riid,
  851.     void** ppvObj) PURE;
  852.     STDMETHOD_(ULONG,AddRef)      (THIS) PURE;
  853.     STDMETHOD_(ULONG,Release)     (THIS) PURE;
  854.     /*
  855.      *  IRMAAudioDeviceManager methods
  856.      */
  857.     /**********************************************************************
  858.      *  Method:
  859.      *      IRMAAudioDeviceManager::Replace
  860.      *  Purpose:
  861.      *  This is used to replace the default implementation of the audio
  862.      *  device by the given audio device interface. 
  863.      */
  864.     STDMETHOD(Replace)         (THIS_
  865.     IRMAAudioDevice*    /*IN*/ pAudioDevice) PURE;
  866.     /**********************************************************************
  867.      *  Method:
  868.      *      IRMAAudioDeviceManager::Remove
  869.      *  Purpose:
  870.      *  This is used to remove the audio device given to the manager in
  871.      *  the earlier call to Replace.
  872.      */
  873.     STDMETHOD(Remove)         (THIS_
  874.     IRMAAudioDevice*    /*IN*/ pAudioDevice) PURE;
  875.     /************************************************************************
  876.     *  Method:
  877.     *   IRMAAudioDeviceManager::AddFinalHook
  878.     *  Purpose:
  879.     * One last chance to modify data being written to the audio device.
  880.     * This hook allows the user to change the audio format that
  881.     *   is to be written to the audio device. This can be done in call
  882.     *   to OnInit() in IRMAAudioHook.
  883.     */
  884.     STDMETHOD(SetFinalHook) (THIS_
  885. IRMAAudioHook*     /*IN*/ pHook
  886. ) PURE;
  887.     /************************************************************************
  888.     *  Method:
  889.     *   IRMAAudioDeviceManager::RemoveFinalHook
  890.     *  Purpose:
  891.     * Remove final hook
  892.     */
  893.     STDMETHOD(RemoveFinalHook) (THIS_
  894. IRMAAudioHook*    /*IN*/ pHook
  895. ) PURE;
  896.    /************************************************************************
  897.     *  Method:
  898.     *   IRMAAudioDeviceManager::GetAudioFormat
  899.     *  Purpose:
  900.     * Returns the audio format in which the audio device is opened.
  901.     * This function will fill in the pre-allocated RMAAudioFormat 
  902.     * structure passed in.
  903.     */
  904.     STDMETHOD(GetAudioFormat)   (THIS_
  905.         RMAAudioFormat* /*IN/OUT*/pAudioFormat) PURE;
  906. };
  907. /****************************************************************************
  908.  * 
  909.  *  Interface:
  910.  * 
  911.  *      IRMAAudioCrossFade
  912.  * 
  913.  *  Purpose:
  914.  *
  915.  *  This interface can be used to cross-fade two audio streams. It is exposed 
  916.  *  by IRMAAudioPlayer
  917.  * 
  918.  *  IID_IRMAAudioCrossFade:
  919.  * 
  920.  *  {0000070B-0901-11d1-8B06-00A024406D59}
  921.  * 
  922.  */
  923. DEFINE_GUID(IID_IRMAAudioCrossFade, 0x0000070B, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  924.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  925. #undef  INTERFACE
  926. #define INTERFACE   IRMAAudioCrossFade
  927. DECLARE_INTERFACE_(IRMAAudioCrossFade, IUnknown)
  928. {
  929.     /*
  930.      *  IUnknown methods
  931.      */
  932.     STDMETHOD(QueryInterface) (THIS_
  933. REFIID riid,
  934. void** ppvObj) PURE;
  935.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  936.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  937.     
  938.     /*
  939.      *  IRMAAudioCrossFade methods
  940.      */
  941.     /************************************************************************
  942.      *  Method:
  943.      *      IRMAAudioCrossFade::CrossFade
  944.      *  Purpose:
  945.      *     Cross-fade two audio streams.
  946.      *     pStreamFrom     - Stream to be cross faded from
  947.      *     pStreamTo     - Stream to be cross faded to
  948.      *     ulFromCrossFadeStartTime- "From" Stream time when cross fade is 
  949.      *       to be started
  950.      *     ulToCrossFadeStartTime  - "To" Stream time when cross fade is to 
  951.      *       be started
  952.      *     ulCrossFadeDuration     - Duration over which cross-fade needs
  953.      *       to be done
  954.      *     
  955.      */
  956.     STDMETHOD(CrossFade) (THIS_
  957. IRMAAudioStream* pStreamFrom,
  958. IRMAAudioStream* pStreamTo,
  959. UINT32  ulFromCrossFadeStartTime,
  960. UINT32  ulToCrossFadeStartTime,
  961. UINT32  ulCrossFadeDuration) PURE;
  962. };
  963. /****************************************************************************
  964.  * 
  965.  *  Interface:
  966.  * 
  967.  *      IRMAAudioStream2
  968.  * 
  969.  *  Purpose:
  970.  *
  971.  *  This interface contains some last-minute added audio stream functions
  972.  * 
  973.  *  IID_IRMAAudioStream2:
  974.  * 
  975.  *  {0000070C-0901-11d1-8B06-00A024406D59}
  976.  * 
  977.  */
  978. DEFINE_GUID(IID_IRMAAudioStream2, 0x0000070C, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  979.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  980. #undef  INTERFACE
  981. #define INTERFACE   IRMAAudioStream2
  982. DECLARE_INTERFACE_(IRMAAudioStream2, IUnknown)
  983. {
  984.     /*
  985.      *  IUnknown methods
  986.      */
  987.     STDMETHOD(QueryInterface) (THIS_
  988. REFIID riid,
  989. void** ppvObj) PURE;
  990.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  991.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  992.     
  993.     /*
  994.      *  IRMAAudioStream2 methods
  995.      */
  996.    /************************************************************************
  997.     *  Method:
  998.     *      IRMAAudioStream2::RemoveDryNotification
  999.     *  Purpose:
  1000.     *     Use this to remove itself from the notification response object
  1001.     *     during the stream switching.
  1002.     */
  1003.     STDMETHOD(RemoveDryNotification)   (THIS_
  1004.    IRMADryNotification* /*IN*/ pNotification
  1005.       ) PURE;
  1006.    /************************************************************************
  1007.     *  Method:
  1008.     *      IRMAAudioStream2::GetAudioFormat
  1009.     *  Purpose:
  1010.     *     Returns the input audio format of the data written by the 
  1011.     *     renderer. This function will fill in the pre-allocated 
  1012.     *     RMAAudioFormat structure passed in.
  1013.     */
  1014.     STDMETHOD(GetAudioFormat)   (THIS_
  1015.         RMAAudioFormat* /*IN/OUT*/pAudioFormat) PURE;
  1016. };
  1017. /****************************************************************************
  1018.  * 
  1019.  *  Interface:
  1020.  * 
  1021.  *      IRMAAudioPushdown
  1022.  * 
  1023.  *  Purpose:
  1024.  *
  1025.  *  This interface can be used to setup the audio pushdown time.
  1026.  * 
  1027.  *  IID_IRMAAudioPushdown:
  1028.  * 
  1029.  *  {0000070D-0901-11d1-8B06-00A024406D59}
  1030.  * 
  1031.  */
  1032. DEFINE_GUID(IID_IRMAAudioPushdown, 0x0000070D, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1033.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  1034. #undef  INTERFACE
  1035. #define INTERFACE   IRMAAudioPushdown
  1036. DECLARE_INTERFACE_(IRMAAudioPushdown, IUnknown)
  1037. {
  1038.     /*
  1039.      *  IUnknown methods
  1040.      */
  1041.     STDMETHOD(QueryInterface) (THIS_
  1042. REFIID riid,
  1043. void** ppvObj) PURE;
  1044.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1045.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1046.     
  1047.     /*
  1048.      *  IRMAAudioPushdown methods
  1049.      */
  1050.    /************************************************************************
  1051.     *  Method:
  1052.     *      IRMAAudioPushdown::SetAudioPushdown
  1053.     *  Purpose:
  1054.     *     Use this to set the minimum audio pushdown value in ms.
  1055.     *     This is the amount of audio data that is being written 
  1056.     *     to the audio device before starting playback.
  1057.     */
  1058.     STDMETHOD(SetAudioPushdown)   (THIS_
  1059.    UINT32 /*IN*/ ulAudioPushdown
  1060.         ) PURE;
  1061. };
  1062. /****************************************************************************
  1063.  * 
  1064.  *  Interface:
  1065.  * 
  1066.  *      IRMAAudioHookManager
  1067.  * 
  1068.  *  Purpose:
  1069.  *
  1070.  *  This interface can be used to add a hook at the audio device layer.
  1071.  * 
  1072.  *  IID_IRMAAudioHookManager:
  1073.  * 
  1074.  *  {0000070E-0901-11d1-8B06-00A024406D59}
  1075.  * 
  1076.  */
  1077. DEFINE_GUID(IID_IRMAAudioHookManager, 0x0000070E, 0x901, 0x11d1, 0x8b, 0x6, 0x0,
  1078.             0xa0, 0x24, 0x40, 0x6d, 0x59);
  1079. #undef  INTERFACE
  1080. #define INTERFACE   IRMAAudioHookManager
  1081. DECLARE_INTERFACE_(IRMAAudioHookManager, IUnknown)
  1082. {
  1083.     /*
  1084.      *  IUnknown methods
  1085.      */
  1086.     STDMETHOD(QueryInterface) (THIS_
  1087. REFIID riid,
  1088. void** ppvObj) PURE;
  1089.     STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1090.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1091.     
  1092.    /*
  1093.     *  IRMAAudioHookManager methods
  1094.     */
  1095.    /************************************************************************
  1096.     *  Method:
  1097.     *      IRMAAudioHookManager::AddHook
  1098.     *  Purpose:
  1099.     *     Use this to add a hook 
  1100.     */
  1101.     STDMETHOD(AddHook)   (THIS_
  1102.   IRMAAudioHook* /*IN*/ pHook
  1103.   ) PURE;
  1104.    /************************************************************************
  1105.     *  Method:
  1106.     *      IRMAAudioHookManager::RemoveHook
  1107.     *  Purpose:
  1108.     *     Use this to remove a hook 
  1109.     */
  1110.     STDMETHOD(RemoveHook) (THIS_
  1111.   IRMAAudioHook* /*IN*/ pHook
  1112.   ) PURE;
  1113. };
  1114. #endif  /* _RMAAUSVC_H_ */