1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/sound.h Fri Aug 21 13:25:11 2009 -0700
1.3 @@ -0,0 +1,142 @@
1.4 +/**
1.5 + * @file sound.h Sound API
1.6 + * @ingroup core
1.7 + * @see @ref sound-signals
1.8 + */
1.9 +
1.10 +/* purple
1.11 + *
1.12 + * Purple is the legal property of its developers, whose names are too numerous
1.13 + * to list here. Please refer to the COPYRIGHT file distributed with this
1.14 + * source distribution.
1.15 + *
1.16 + * This program is free software; you can redistribute it and/or modify
1.17 + * it under the terms of the GNU General Public License as published by
1.18 + * the Free Software Foundation; either version 2 of the License, or
1.19 + * (at your option) any later version.
1.20 + *
1.21 + * This program is distributed in the hope that it will be useful,
1.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 + * GNU General Public License for more details.
1.25 + *
1.26 + * You should have received a copy of the GNU General Public License
1.27 + * along with this program; if not, write to the Free Software
1.28 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.29 + */
1.30 +#ifndef _PURPLE_SOUND_H_
1.31 +#define _PURPLE_SOUND_H_
1.32 +
1.33 +#include "account.h"
1.34 +
1.35 +/**************************************************************************/
1.36 +/** Data Structures */
1.37 +/**************************************************************************/
1.38 +
1.39 +
1.40 +/**
1.41 + * A type of sound.
1.42 + */
1.43 +
1.44 +typedef enum _PurpleSoundEventID
1.45 +{
1.46 + PURPLE_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */
1.47 + PURPLE_SOUND_BUDDY_LEAVE, /**< Buddy signs off. */
1.48 + PURPLE_SOUND_RECEIVE, /**< Receive an IM. */
1.49 + PURPLE_SOUND_FIRST_RECEIVE, /**< Receive an IM that starts a conv. */
1.50 + PURPLE_SOUND_SEND, /**< Send an IM. */
1.51 + PURPLE_SOUND_CHAT_JOIN, /**< Someone joins a chat. */
1.52 + PURPLE_SOUND_CHAT_LEAVE, /**< Someone leaves a chat. */
1.53 + PURPLE_SOUND_CHAT_YOU_SAY, /**< You say something in a chat. */
1.54 + PURPLE_SOUND_CHAT_SAY, /**< Someone else says somthing in a chat. */
1.55 + PURPLE_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */
1.56 + PURPLE_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */
1.57 + PURPLE_NUM_SOUNDS /**< Total number of sounds. */
1.58 +
1.59 +} PurpleSoundEventID;
1.60 +
1.61 +/** Operations used by the core to request that particular sound files, or the
1.62 + * sound associated with a particular event, should be played.
1.63 + */
1.64 +typedef struct _PurpleSoundUiOps
1.65 +{
1.66 + void (*init)(void);
1.67 + void (*uninit)(void);
1.68 + void (*play_file)(const char *filename);
1.69 + void (*play_event)(PurpleSoundEventID event);
1.70 +
1.71 + void (*_purple_reserved1)(void);
1.72 + void (*_purple_reserved2)(void);
1.73 + void (*_purple_reserved3)(void);
1.74 + void (*_purple_reserved4)(void);
1.75 +} PurpleSoundUiOps;
1.76 +
1.77 +#ifdef __cplusplus
1.78 +extern "C" {
1.79 +#endif
1.80 +
1.81 +/**************************************************************************/
1.82 +/** @name Sound API */
1.83 +/**************************************************************************/
1.84 +/*@{*/
1.85 +
1.86 +/**
1.87 + * Plays the specified sound file.
1.88 + *
1.89 + * @param filename The file to play.
1.90 + * @param account The account that this sound is associated with, or
1.91 + * NULL if the sound is not associated with any specific
1.92 + * account. This is needed for the "sounds while away?"
1.93 + * preference to work correctly.
1.94 + */
1.95 +void purple_sound_play_file(const char *filename, const PurpleAccount *account);
1.96 +
1.97 +/**
1.98 + * Plays the sound associated with the specified event.
1.99 + *
1.100 + * @param event The event.
1.101 + * @param account The account that this sound is associated with, or
1.102 + * NULL if the sound is not associated with any specific
1.103 + * account. This is needed for the "sounds while away?"
1.104 + * preference to work correctly.
1.105 + */
1.106 +void purple_sound_play_event(PurpleSoundEventID event, const PurpleAccount *account);
1.107 +
1.108 +/**
1.109 + * Sets the UI sound operations
1.110 + *
1.111 + * @param ops The UI sound operations structure.
1.112 + */
1.113 +void purple_sound_set_ui_ops(PurpleSoundUiOps *ops);
1.114 +
1.115 +/**
1.116 + * Gets the UI sound operations
1.117 + *
1.118 + * @return The UI sound operations structure.
1.119 + */
1.120 +PurpleSoundUiOps *purple_sound_get_ui_ops(void);
1.121 +
1.122 +/**
1.123 + * Initializes the sound subsystem
1.124 + */
1.125 +void purple_sound_init(void);
1.126 +
1.127 +/**
1.128 + * Shuts down the sound subsystem
1.129 + */
1.130 +void purple_sound_uninit(void);
1.131 +
1.132 +/**
1.133 + * Returns the sound subsystem handle.
1.134 + *
1.135 + * @return The sound subsystem handle.
1.136 + */
1.137 +void *purple_sounds_get_handle(void);
1.138 +
1.139 +/*@}*/
1.140 +
1.141 +#ifdef __cplusplus
1.142 +}
1.143 +#endif
1.144 +
1.145 +#endif /* _PURPLE_SOUND_H_ */