SWILIB API (X75)    
Loading...
Searching...
No Matches
sound.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef __IN_SWILIB__
4#include "base.h"
5#include "wstring.h"
6#endif
7
9
22typedef struct PLAY_VOLUME PLAY_VOLUME;
23
29 uint8_t level;
30 uint8_t unk1[3];
31 uint32_t unk2;
32};
33
37#ifdef NEWSGOLD
38struct GBS_PSOUND_MSG {
39 int pid_from;
40 int msg;
41 uint16_t cmd;
42 short handler;
43 void *data0;
44 void *data1;
45};
46#else
48 short pid_from;
49 short msg;
50 uint16_t cmd;
51 short handler;
52 void *data0;
53 void *data1;
54};
55#endif
56
61#ifdef NEWSGOLD
72 M_SAE_EQUALIZER_UPDATED = 0xA,
73 M_SAE_EQUALIZER_ERROR = 0xB,
74 M_SAE_3DAUDIO_UPDATED = 0xC,
75 M_SAE_3DAUDIO_ERROR = 0xD,
76 M_SAE_UNKNOWN_EVENT = 0xE,
77 M_SAE_UNKNOWN_EVENT_1 = 0xF,
83 M_SAE_RECORD_ERROR = 0x15,
84 M_SAE_RECORD_DONE = 0x16,
85 M_SAE_STOP_OK = 0x17,
86 M_SAE_STOP_FAIL = 0x18,
87 M_SAE_CANCEL_OK = 0x19,
88 M_SAE_CANCEL_FAIL = 0x1A,
89 M_SAE_PAUSE_OK = 0x1B,
90 M_SAE_PAUSE_FAIL = 0x1C,
91 M_SAE_RESUME_OK = 0x1D,
92 M_SAE_RESUME_FAIL = 0x1E,
97 M_SAE_UNKNOWN_EVENT_2 = 0x23,
98 M_SAE_UNKNOWN_EVENT_3 = 0x24,
102 M_SAE_VISUALIZATION_STOPPED = 0x28,
103 M_SAE_VISUALIZATION_STARTED = 0x29,
104 M_SAE_UNKNOWN_EVENT_4 = 0x2A,
105 M_SAE_VISUALIZATION_DATA = 0x2B,
106 M_SAE_STREAM_READY = 0x2C,
107 M_SAE_STREAM_STALLED = 0x2D,
108 M_SAE_STREAM_UNSTALLED = 0x2E,
109 M_SAE_STREAM_LOW_WATERMARK = 0x2F,
110 M_SAE_STREAM_HIGH_WATERMARK = 0x30,
111 M_SAE_BUFFER_CONSUMED = 0x31,
112 M_SAE_BUFFER_AVAILABLE = 0x32,
113 M_SAE_RESERVE_OK = 0x33,
114 M_SAE_RESERVE_FAIL = 0x34,
115 M_SAE_RELEASE_OK = 0x35,
116 M_SAE_RELEASE_FAIL = 0x36,
117 M_SAE_RELEASED = 0x37,
118 M_SAE_VOLUME_CHANGED = 0x38,
119 M_SAE_SOUNDSTATE_CHANGED = 0x39,
120 M_SAE_SOUNDSYSTEM_IDLE = 0x3A,
121 M_SAE_EVENT_IN_STACK = 0x3B,
122#else
157#endif
158};
159
164#ifdef NEWSGOLD
165 Job_NoJob = 0,
166 Job_RecFile = 1,
167 Job_RecBuffer = 2,
168 Job_PlayFile = 3,
169 Job_PlayBuffer = 5,
170 Job_GetInfo = 0xF,
172#else
180#endif
181};
182
190// VOLUME_SYSTEM = 3,
192// VOLUME_MESSAGES = 5,
194// VOLUME_SYSTEM = 7,
195// VOLUME_SYSTEM = 8,
198// VOLUME_SYSTEM = 0xB,
200// VOLUME_SYSTEM = 0xD,
201// VOLUME_SYSTEM = 0xE,
202// VOLUME_SYSTEM = 0xF,
203// VOLUME_SYSTEM = 0x10,
204// VOLUME_SYSTEM = 0x11,
205// VOLUME_SYSTEM = 0x12,
206// VOLUME_SYSTEM = 0x13,
207// VOLUME_SYSTEM = 0x14,
208// VOLUME_SYSTEM = 0x15,
209};
210
215#ifdef NEWSGOLD
216 uint16_t repeat_num;
217 uint16_t unk;
219 int play_first;
220 int volume;
221 int unk5;
222 int unk6;
223 int unk7;
224 int unk8;
225 int unk9;
226#else
227#ifdef X75
228 uint16_t repeat_num;
229 uint16_t unk;
232 int volume;
233 int unk4;
234 int unk5;
235 int unk6;
236 int unk7;
237#else
238 uint16_t repeat_num;
239 uint16_t unk;
241 int play_first;
242 int volume;
243 int unk5;
244 int unk6;
245#endif
246#endif
247};
248
253__swi_begin(0x81FA)
255__swi_end(0x81FA, RamVolumeLevel, ());
256
265__swi_begin(0x81FB)
267__swi_end(0x81FB, RamMediaIsPlaying, ());
268
273__swi_begin(0x07F)
275__swi_end(0x07F, IsPlayerOn, ());
276
281__swi_begin(0x1F8)
283__swi_end(0x1F8, GetPlayStatus, ());
284
293__swi_begin(0x032)
294void PlaySound(long volume, long cepid, long unk1, long tone_type, long unk2)
295__swi_end(0x032, PlaySound, (volume, cepid, unk1, tone_type, unk2));
296
308__swi_begin(0x099)
309int PlayMelodyInMem(char unk1, const void *buffer, int size, int cepid, int msg, int unk2)
310__swi_end(0x099, PlayMelodyInMem, (unk1, buffer, size, cepid, msg, unk2));
311
332__swi_begin(0x225)
333#ifdef NEWSGOLD
334int PlayMelody_ChangeVolume(int handle, PLAY_VOLUME volume)
335#else
336int PlayMelody_ChangeVolume(int handle, int volume)
337#endif
338__swi_end(0x225, PlayMelody_ChangeVolume, (handle, volume));
339
340#ifdef NEWSGOLD
345__swi_begin(0x225)
346int PlayMelody_SetVolume(int handle, PLAY_VOLUME volume)
347__swi_end(0x225, PlayMelody_SetVolume, (handle, volume));
348
356__swi_begin(0x4E4)
357int PlayMelody_GetVolume(int handle, PLAY_VOLUME *volume)
358__swi_end(0x4E4, PlayMelody_GetVolume, (handle, volume));
359#else
366__swi_begin(0x4E4)
367int PlayMelody_GetVolume(int handle, int *volume)
368__swi_end(0x4E4, PlayMelody_GetVolume, (handle, volume));
369#endif
370
376__swi_begin(0x226)
378__swi_end(0x226, PlayMelody_StopPlayback, (handle));
379
385__swi_begin(0x227)
387__swi_end(0x227, PlayMelody_PausePlayback, (handle));
388
394__swi_begin(0x228)
396__swi_end(0x228, PlayMelody_ResumePlayBack, (handle));
397
404__swi_begin(0x24D)
405int PlayMelody_SetPosition(int handle, int position)
406__swi_end(0x24D, PlayMelody_SetPosition, (handle, position));
407
413__swi_begin(0x24E)
414void *GetPlayObjById(int handle)
415__swi_end(0x24E, GetPlayObjById, (handle));
416
423__swi_begin(0x24F)
424int GetPlayObjPosition(void *obj, int *position)
425__swi_end(0x24F, GetPlayObjPosition, (obj, position));
426
433__swi_begin(0x250)
434int GetPlayObjDuration(void *obj, int *duration)
435__swi_end(0x250, GetPlayObjDuration, (obj, duration));
436
443static inline int PlayMelody_GetPosition(int handle, int *position) {
444 return GetPlayObjPosition(GetPlayObjById(handle), position);
445}
446
453static inline int PlayMelody_GetDuration(int handle, int *duration) {
454 return GetPlayObjDuration(GetPlayObjById(handle), duration);
455}
456
457#ifdef X75
471__swi_begin(0x04A)
472short PlayFile(int flags, const WSHDR *folder, const WSHDR *file, int zero, int cepid, int msgid, const PLAYFILE_OPT *sfo)
473__swi_end(0x04A, PlayFile, (flags, folder, file, zero, cepid, msgid, sfo));
474#else
487__swi_begin(0x04A)
488short PlayFile(int flags, const WSHDR *folder, const WSHDR *file, int cepid, int msgid, const PLAYFILE_OPT *sfo)
489__swi_end(0x04A, PlayFile, (flags, folder, file, cepid, msgid, sfo));
490#endif
491
492
493
499__swi_begin(0x288)
502
507__swi_begin(0x29B)
510
517__swi_begin(0x29A)
518int AACC_AudioTransferReq(int oh, uint32_t type_and_conn)
519__swi_end(0x29A, AACC_AudioTransferReq, (oh, type_and_conn));
520
529__swi_begin(0x034)
530void PlaySoundLoop(int unk1, int unk2, int duration)
531__swi_end(0x034, PlaySoundLoop, (unk1, unk2, duration));
532
539__swi_begin(0x09A)
540int ChangeVolume(uint8_t volume)
541__swi_end(0x09A, ChangeVolume, (volume));
542
553__swi_begin(0x033)
554short SoundAE_PlayFileAsEvent(int event_id, int cepid, int msg_id, const WSHDR *folder, const WSHDR *file)
555__swi_end(0x033, SoundAE_PlayFileAsEvent, (event_id, cepid, msg_id, folder, file));
556
562__swi_begin(0x838A)
564__swi_end(0x838A, RamAudioHook, ());
565
570__swi_begin(0x8297)
573
578__swi_begin(0x8298)
581
583
#define __swilib_begin
Definition doxygen.h:29
#define __swi_end(number, func, call)
Definition doxygen.h:33
#define __swi_begin(number)
Definition doxygen.h:32
#define __swilib_end
Definition doxygen.h:30
int play_first
Unknown, set to 0.
Definition sound.h:231
uint32_t unk2
Definition sound.h:31
uint16_t cmd
Definition sound.h:50
uint16_t unk
Definition sound.h:229
short msg
MSG_PLAYFILE_REPORT
Definition sound.h:49
short handler
Definition sound.h:51
void * data0
Definition sound.h:52
void * data1
Definition sound.h:53
uint8_t level
volume level 0..5 (Obs 0, 1, 4, 8, 12, 15), 6 = the level from the profile
Definition sound.h:29
uint8_t unk1[3]
Definition sound.h:30
short pid_from
sender cepid
Definition sound.h:48
int time_between_play
Delay between each repeat.
Definition sound.h:230
int volume
Volume level (1-5)
Definition sound.h:232
int unk6
Unknown, set to 0.
Definition sound.h:235
int unk4
Unknown, set to 0x80000000.
Definition sound.h:233
uint16_t repeat_num
Number of repeat (0: unlimited)
Definition sound.h:228
int unk7
Unknown, set to 0.
Definition sound.h:236
int unk5
Unknown, set to 1.
Definition sound.h:234
void * RamAudioHook()
Pointer to the AudioHook.
PlaySoundEventID
Event IDs for the GBS_PSOUND_MSG.
Definition sound.h:60
int IsPlayerOn()
Check if the radio or player is active.
char * RamMediaIsPlaying()
Copy of a PASIC audio register, historically used to check if a sound is played.
static int PlayMelody_GetDuration(int handle, int *duration)
Get the duration of the playing melody.
Definition sound.h:453
PlaySoundVolumeID
Volume (=category) for tones (PlaySound).
Definition sound.h:186
void PlaySound(long volume, long cepid, long unk1, long tone_type, long unk2)
Play tone by id.
int GetPlayObjPosition(void *obj, int *position)
Get the current position from Obs or PlayObj (generic).
int AACC_AudioTransferReq(int oh, uint32_t type_and_conn)
Change audio output.
int PlayMelody_PausePlayback(int handle)
Pause the playback of the melody.
short SoundAE_PlayFileAsEvent(int event_id, int cepid, int msg_id, const WSHDR *folder, const WSHDR *file)
Play custom sound.
char * RamIsSoundRecordingActive()
Check if active recording of the sound.
char * RamSoundRecordingQuality()
Quality of the current sound recording.
int PlayMelody_StopPlayback(int handle)
Stop the playback of the melody.
int ChangeVolume(uint8_t volume)
Change the current audio volume.
int Audio_GetCurrAudioPath(void)
Get current audio path.
int Audio_GetObjectHandle()
Get current object handle.
int GetPlayStatus(void)
Get status of the MediaPlayer.
int PlayMelodyInMem(char unk1, const void *buffer, int size, int cepid, int msg, int unk2)
Play melody from memory.
void * GetPlayObjById(int handle)
Get a pointer to the PlayObject by PlayObject handle.
int GetPlayObjDuration(void *obj, int *duration)
Get the duration of from Obs or PlayObj (generic).
short PlayFile(int flags, const WSHDR *folder, const WSHDR *file, int zero, int cepid, int msgid, const PLAYFILE_OPT *sfo)
Play file from filesystem (path=folder\file).
int PlayMelody_GetVolume(int handle, int *volume)
Get the volume of the playing melody.
int PlayMelody_SetPosition(int handle, int position)
Set the position of the playing melody.
void PlaySoundLoop(int unk1, int unk2, int duration)
Play vibra tone (???).
static int PlayMelody_GetPosition(int handle, int *position)
Get the current position of the playing melody.
Definition sound.h:443
PlaySoundJobID
Job IDs for the GBS_PSOUND_MSG.
Definition sound.h:163
char * RamVolumeLevel()
Get current volume level.
int PlayMelody_ResumePlayBack(int handle)
Resume the playback of the melody.
int PlayMelody_ChangeVolume(int handle, int volume)
Change the volume of the playing melody.
@ M_SAE_EVENT_STARTED
Definition sound.h:123
@ M_SAE_PAUSE_FAIL
Definition sound.h:145
@ M_SAE_INFO_DATA_AVAILABLE
Definition sound.h:148
@ M_SAE_INFO_REQUEST_FAIL
Definition sound.h:149
@ M_SAE_MAX_RECORDING_TIME_AVAILABLE
Definition sound.h:150
@ M_SAE_PLAYBACK_ERROR
Definition sound.h:128
@ M_SAE_CANCEL_OK
Definition sound.h:142
@ M_SAE_EVENT_ERROR
Definition sound.h:126
@ M_SAE_HANDSFREE_ERROR
Definition sound.h:136
@ M_SAE_MAX_RECORDING_TIME_ERROR
Definition sound.h:151
@ M_SAE_PLAYTIME_UPDATED
Definition sound.h:133
@ M_SAE_PLAYBACK_NEXTCYCLE
Definition sound.h:129
@ M_SAE_PLAYBACK_STARTED
Definition sound.h:127
@ M_SAE_RECORD_DONE
Definition sound.h:139
@ M_SAE_EVENT_DONE
Definition sound.h:125
@ M_SAE_RECORD_STARTED
Definition sound.h:137
@ M_SAE_STOP_OK
Definition sound.h:140
@ M_SAE_STOP_FAIL
Definition sound.h:141
@ M_SAE_PLAYTIME_ERROR
Definition sound.h:134
@ M_SAE_PLAYBACK_DONE
Definition sound.h:130
@ M_SAE_RESUME_OK
Definition sound.h:146
@ M_SAE_AUDIO_EVENT_PAUSED
Definition sound.h:155
@ M_SAE_EVENT_STOPPED
Definition sound.h:124
@ M_SAE_CANCEL_FAIL
Definition sound.h:143
@ M_SAE_VOLUME_UPDATED
Definition sound.h:131
@ M_SAE_AUDIO_EVENT_RESUMED
Definition sound.h:156
@ M_SAE_PAUSE_OK
Definition sound.h:144
@ M_SAE_HANDSFREE_UPDATED
Definition sound.h:135
@ M_SAE_VOLUME_ERROR
Definition sound.h:132
@ M_SAE_AUDIO_EVENT_UPDATED_MS
Definition sound.h:153
@ M_SAE_AUDIO_EVENT_STOPPED
Definition sound.h:154
@ M_SAE_AUDIO_EVENT_UPDATED
Definition sound.h:152
@ M_SAE_RESUME_FAIL
Definition sound.h:147
@ M_SAE_RECORD_ERROR
Definition sound.h:138
@ VOLUME_SYSTEM
Definition sound.h:188
@ VOLUME_ALARM_CLOCK
Definition sound.h:196
@ VOLUME_MESSAGES
Definition sound.h:191
@ VOLUME_APPLICATIONS
Definition sound.h:199
@ VOLUME_WALKY_TALKY
Definition sound.h:189
@ VOLUME_CALLS
Definition sound.h:187
@ VOLUME_ORGANISER
Definition sound.h:197
@ VOLUME_CB_SERVICES
Definition sound.h:193
@ Job_RecBuffer
Definition sound.h:175
@ Job_NoJob
Definition sound.h:173
@ Job_GetRecordingTimeMax
Definition sound.h:179
@ Job_RecFile
Definition sound.h:174
@ Job_PlayFile
Definition sound.h:176
@ Job_PlayBuffer
Definition sound.h:177
@ Job_GetInfo
Definition sound.h:178
GBS event (MSG_PLAYFILE_REPORT) for the PlayFile or PlayMelodyInMem.
Definition sound.h:47
Volume of a play object (NSG/ELKA), passed by value to PlayMelody_ChangeVolume.
Definition sound.h:28
Options for the PlayFile.
Definition sound.h:214
Wide-string header.
Definition wstring.h:35
#define const
Definition zconf.h:115