home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / include / libpurple / sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-04  |  4.2 KB  |  138 lines

  1. /**
  2.  * @file sound.h Sound API
  3.  * @ingroup core
  4.  *
  5.  * purple
  6.  *
  7.  * Purple is the legal property of its developers, whose names are too numerous
  8.  * to list here.  Please refer to the COPYRIGHT file distributed with this
  9.  * source distribution.
  10.  *
  11.  * This program is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the Free Software
  23.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  24.  */
  25. #ifndef _PURPLE_SOUND_H_
  26. #define _PURPLE_SOUND_H_
  27.  
  28. #include "account.h"
  29.  
  30. /**************************************************************************/
  31. /** Data Structures                                                       */
  32. /**************************************************************************/
  33.  
  34.  
  35. /**
  36.  * A type of sound.
  37.  */
  38.  
  39. typedef enum _PurpleSoundEventID
  40. {
  41.     PURPLE_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on.                       */
  42.     PURPLE_SOUND_BUDDY_LEAVE,      /**< Buddy signs off.                      */
  43.     PURPLE_SOUND_RECEIVE,          /**< Receive an IM.                        */
  44.     PURPLE_SOUND_FIRST_RECEIVE,    /**< Receive an IM that starts a conv.     */
  45.     PURPLE_SOUND_SEND,             /**< Send an IM.                           */
  46.     PURPLE_SOUND_CHAT_JOIN,        /**< Someone joins a chat.                 */
  47.     PURPLE_SOUND_CHAT_LEAVE,       /**< Someone leaves a chat.                */
  48.     PURPLE_SOUND_CHAT_YOU_SAY,     /**< You say something in a chat.          */
  49.     PURPLE_SOUND_CHAT_SAY,         /**< Someone else says somthing in a chat. */
  50.     PURPLE_SOUND_POUNCE_DEFAULT,   /**< Default sound for a buddy pounce.     */
  51.     PURPLE_SOUND_CHAT_NICK,        /**< Someone says your name in a chat.     */
  52.     PURPLE_NUM_SOUNDS              /**< Total number of sounds.               */
  53.  
  54. } PurpleSoundEventID;
  55.  
  56. typedef struct _PurpleSoundUiOps
  57. {
  58.     void (*init)(void);
  59.     void (*uninit)(void);
  60.     void (*play_file)(const char *filename);
  61.     void (*play_event)(PurpleSoundEventID event);
  62.  
  63.     void (*_purple_reserved1)(void);
  64.     void (*_purple_reserved2)(void);
  65.     void (*_purple_reserved3)(void);
  66.     void (*_purple_reserved4)(void);
  67. } PurpleSoundUiOps;
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73. /**************************************************************************/
  74. /** @name Sound API                                                       */
  75. /**************************************************************************/
  76. /*@{*/
  77.  
  78. /**
  79.  * Plays the specified sound file.
  80.  *
  81.  * @param filename The file to play.
  82.  * @param account The account that this sound is associated with, or
  83.  *        NULL if the sound is not associated with any specific
  84.  *        account.  This is needed for the "sounds while away?"
  85.  *        preference to work correctly.
  86.  */
  87. void purple_sound_play_file(const char *filename, const PurpleAccount *account);
  88.  
  89. /**
  90.  * Plays the sound associated with the specified event.
  91.  *
  92.  * @param event The event.
  93.  * @param account The account that this sound is associated with, or
  94.  *        NULL if the sound is not associated with any specific
  95.  *        account.  This is needed for the "sounds while away?"
  96.  *        preference to work correctly.
  97.  */
  98. void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account);
  99.  
  100. /**
  101.  * Sets the UI sound operations
  102.  *
  103.  * @param ops The UI sound operations structure.
  104.  */
  105. void purple_sound_set_ui_ops(PurpleSoundUiOps *ops);
  106.  
  107. /**
  108.  * Gets the UI sound operations
  109.  *
  110.  * @return The UI sound operations structure.
  111.  */
  112. PurpleSoundUiOps *purple_sound_get_ui_ops(void);
  113.  
  114. /**
  115.  * Initializes the sound subsystem
  116.  */
  117. void purple_sound_init(void);
  118.  
  119. /**
  120.  * Shuts down the sound subsystem
  121.  */
  122. void purple_sound_uninit(void);
  123.  
  124. /**
  125.  * Returns the sound subsystem handle.
  126.  *
  127.  * @return The sound subsystem handle.
  128.  */
  129. void *purple_sounds_get_handle(void);
  130.  
  131. /*@}*/
  132.  
  133. #ifdef __cplusplus
  134. }
  135. #endif
  136.  
  137. #endif /* _PURPLE_SOUND_H_ */
  138.