comparison src/sound.h @ 5684:b61520e71679

[gaim-migrate @ 6104] sound is now really core/ui split. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 03 Jun 2003 03:33:20 +0000
parents 7a64114641c3
children 158196b2db19
comparison
equal deleted inserted replaced
5683:9befba33f7c8 5684:b61520e71679
27 /** Data Structures */ 27 /** Data Structures */
28 /**************************************************************************/ 28 /**************************************************************************/
29 29
30 30
31 /** 31 /**
32 * A type of conversation. 32 * A type of sound.
33 */ 33 */
34 34
35 typedef enum _GaimSoundEventID 35 typedef enum _GaimSoundEventID
36 { 36 {
37 GAIM_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */ 37 GAIM_SOUND_BUDDY_ARRIVE = 0, /**< Buddy signs on. */
46 GAIM_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */ 46 GAIM_SOUND_POUNCE_DEFAULT, /**< Default sound for a buddy pounce. */
47 GAIM_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */ 47 GAIM_SOUND_CHAT_NICK, /**< Someone says your name in a chat. */
48 GAIM_NUM_SOUNDS /**< Total number of sounds. */ 48 GAIM_NUM_SOUNDS /**< Total number of sounds. */
49 } GaimSoundEventID; 49 } GaimSoundEventID;
50 50
51 typedef struct _GaimSoundUiOps
52 {
53 void (*init)(void);
54 void (*shutdown)(void);
55 void (*play_file)(const char *filename);
56 void (*play_event)(GaimSoundEventID event);
57
58 } GaimSoundUiOps;
59
51 /**************************************************************************/ 60 /**************************************************************************/
52 /** @name Sound API */ 61 /** @name Sound API */
53 /**************************************************************************/ 62 /**************************************************************************/
54 /*@{*/ 63 /*@{*/
55 64
56 /** 65 /**
57 * Lets the sound subsystem know when the sound output method has changed. 66 * Sets the UI sound operations
67 *
68 * @param ops The UI sound operations structure.
58 */ 69 */
59 void gaim_sound_change_output_method(); 70 void gaim_set_sound_ui_ops(GaimSoundUiOps *ops);
60 71
61 /** 72 /**
62 * Properly shuts down the sound system. 73 * Gets the UI sound operations
74 *
75 * @return The UI sound operations structure.
63 */ 76 */
64 void gaim_sound_quit(); 77 GaimSoundUiOps *gaim_get_sound_ui_ops(void);
78
79 /**
80 * Initializes the sound subsystem
81 */
82 void gaim_sound_init(void);
83
84 /**
85 * Shuts down the sound subsystem
86 */
87 void gaim_sound_shutdown(void);
65 88
66 /** 89 /**
67 * Plays the specified sound file. 90 * Plays the specified sound file.
68 * 91 *
69 * @param filename The file to play. 92 * @param filename The file to play.
70 */ 93 */
71 void gaim_sound_play_file(char *filename); 94 void gaim_sound_play_file(const char *filename);
72 95
73 /** 96 /**
74 * Plays the sound associated with the specified event. 97 * Plays the sound associated with the specified event.
75 * 98 *
76 * @param event The event. 99 * @param event The event.
77 */ 100 */
78 void gaim_sound_play_event(GaimSoundEventID event); 101 void gaim_sound_play_event(GaimSoundEventID event);
79 102
80 /**
81 * Mutes or un-mutes sounds.
82 *
83 * @param mute The mute state.
84 */
85 void gaim_sound_set_mute(gboolean mute);
86
87 /**
88 * Gets mute state for sounds.
89 *
90 * @return The mute state.
91 */
92 gboolean gaim_sound_get_mute();
93
94 /**
95 * Mutes or un-mutes login sounds.
96 *
97 * @param mute The mute state.
98 */
99 void gaim_sound_set_login_mute(gboolean mute);
100
101 /**
102 * Set sound file for an event.
103 *
104 * @param event The event.
105 * @param filename The sound file.
106 */
107 void gaim_sound_set_event_file(GaimSoundEventID event, const char *filename);
108
109 /** Get sound file for an event.
110 *
111 * @param event The event.
112 * @return The filename if set, otherwise @c NULL.
113 */
114 char *gaim_sound_get_event_file(GaimSoundEventID event);
115
116 /**
117 * Get the prefs option for an event.
118 *
119 * @param event The event.
120 * @return The option.
121 */
122 const char *gaim_sound_get_event_option(GaimSoundEventID event);
123
124 /**
125 * Get the label for an event.
126 *
127 * @param event The event.
128 * @return The label.
129 */
130 char *gaim_sound_get_event_label(GaimSoundEventID event);
131
132 /**
133 * Set sound command for command mode.
134 *
135 * @param cmd The command.
136 */
137 void gaim_sound_set_command(const char *cmd);
138
139 /**
140 * Get sound command for command mode.
141 *
142 * @return The command if set, otherwise @c NULL.
143 */
144 char *gaim_sound_get_command();
145
146 /*@}*/ 103 /*@}*/
147 104
148 #endif /* _GAIM_SOUND_H_ */ 105 #endif /* _GAIM_SOUND_H_ */