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