SWILIB API (NSG)    
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
40 int msg;
41 uint16_t cmd;
42 short handler;
43 void *data0;
44 void *data1;
45};
46#else
47struct GBS_PSOUND_MSG {
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
122#else
138 M_SAE_RECORD_ERROR = 0xF,
139 M_SAE_RECORD_DONE = 0x10,
140 M_SAE_STOP_OK = 0x11,
141 M_SAE_STOP_FAIL = 0x12,
142 M_SAE_CANCEL_OK = 0x13,
143 M_SAE_CANCEL_FAIL = 0x14,
144 M_SAE_PAUSE_OK = 0x15,
145 M_SAE_PAUSE_FAIL = 0x16,
146 M_SAE_RESUME_OK = 0x17,
147 M_SAE_RESUME_FAIL = 0x18,
152 M_SAE_AUDIO_EVENT_UPDATED = 0x1D,
153 M_SAE_AUDIO_EVENT_UPDATED_MS = 0x1E,
157#endif
158};
159
164#ifdef NEWSGOLD
172#else
173 Job_NoJob = 0,
174 Job_RecFile = 1,
175 Job_RecBuffer = 2,
176 Job_PlayFile = 3,
177 Job_PlayBuffer = 4,
178 Job_GetInfo = 5,
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;
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;
231 int play_first;
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
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 pid_from
sender cepid
Definition sound.h:39
int play_first
Unknown, set to 0.
Definition sound.h:219
uint32_t unk2
Definition sound.h:31
uint16_t cmd
Definition sound.h:41
uint16_t unk
Unknown, set to 0.
Definition sound.h:217
int unk8
Unknown, set to 0.
Definition sound.h:224
short handler
Definition sound.h:42
void * data0
Definition sound.h:43
void * data1
Definition sound.h:44
uint8_t level
volume level 0..5 (Obs 0, 1, 4, 8, 12, 15), 6 = the level from the profile
Definition sound.h:29
int msg
MSG_PLAYFILE_REPORT
Definition sound.h:40
uint8_t unk1[3]
Definition sound.h:30
int time_between_play
Delay between each repeat.
Definition sound.h:218
int volume
Volume level (1-15)
Definition sound.h:220
int unk6
Unknown, set to 0.
Definition sound.h:222
uint16_t repeat_num
Number of repeat (0: unlimited)
Definition sound.h:216
int unk9
Unknown, set to 0.
Definition sound.h:225
int unk7
Unknown, set to 0.
Definition sound.h:223
int unk5
Unknown, set to 0.
Definition sound.h:221
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
int PlayMelody_ChangeVolume(int handle, PLAY_VOLUME volume)
Change the volume of the playing melody.
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 PlayMelody_SetVolume(int handle, PLAY_VOLUME volume)
Change the volume of the playing melody.
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).
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
int PlayMelody_GetVolume(int handle, PLAY_VOLUME *volume)
Get the volume of the playing melody.
PlaySoundJobID
Job IDs for the GBS_PSOUND_MSG.
Definition sound.h:163
char * RamVolumeLevel()
Get current volume level.
short PlayFile(int flags, const WSHDR *folder, const WSHDR *file, int cepid, int msgid, const PLAYFILE_OPT *sfo)
Play file from filesystem (path=folder\file).
int PlayMelody_ResumePlayBack(int handle)
Resume the playback of the melody.
@ M_SAE_EVENT_STARTED
Definition sound.h:62
@ M_SAE_PAUSE_FAIL
Definition sound.h:90
@ M_SAE_INFO_DATA_AVAILABLE
Definition sound.h:93
@ M_SAE_EQUALIZER_UPDATED
Definition sound.h:72
@ M_SAE_UNKNOWN_EVENT_3
Definition sound.h:98
@ M_SAE_INFO_REQUEST_FAIL
Definition sound.h:94
@ M_SAE_VISUALIZATION_STOPPED
Definition sound.h:102
@ M_SAE_MAX_RECORDING_TIME_AVAILABLE
Definition sound.h:95
@ M_SAE_PLAYBACK_ERROR
Definition sound.h:67
@ M_SAE_EVENT_IN_STACK
Definition sound.h:121
@ M_SAE_STREAM_STALLED
Definition sound.h:107
@ M_SAE_CANCEL_OK
Definition sound.h:87
@ M_SAE_UNKNOWN_EVENT_2
Definition sound.h:97
@ M_SAE_RELEASE_OK
Definition sound.h:115
@ M_SAE_BUFFER_AVAILABLE
Definition sound.h:112
@ M_SAE_RELEASED
Definition sound.h:117
@ M_SAE_VISUALIZATION_DATA
Definition sound.h:105
@ M_SAE_STREAM_LOW_WATERMARK
Definition sound.h:109
@ M_SAE_EVENT_ERROR
Definition sound.h:65
@ M_SAE_HANDSFREE_ERROR
Definition sound.h:81
@ M_SAE_RESERVE_FAIL
Definition sound.h:114
@ M_SAE_MAX_RECORDING_TIME_ERROR
Definition sound.h:96
@ M_SAE_UNKNOWN_EVENT_4
Definition sound.h:104
@ M_SAE_PLAYTIME_UPDATED
Definition sound.h:78
@ M_SAE_BUFFER_CONSUMED
Definition sound.h:111
@ M_SAE_3DAUDIO_UPDATED
Definition sound.h:74
@ M_SAE_STREAM_HIGH_WATERMARK
Definition sound.h:110
@ M_SAE_PLAYBACK_NEXTCYCLE
Definition sound.h:68
@ M_SAE_RELEASE_FAIL
Definition sound.h:116
@ M_SAE_PLAYBACK_STARTED
Definition sound.h:66
@ M_SAE_STREAM_UNSTALLED
Definition sound.h:108
@ M_SAE_RECORD_DONE
Definition sound.h:84
@ M_SAE_EQUALIZER_ERROR
Definition sound.h:73
@ M_SAE_EVENT_DONE
Definition sound.h:64
@ M_SAE_RECORD_STARTED
Definition sound.h:82
@ M_SAE_STOP_OK
Definition sound.h:85
@ M_SAE_UNKNOWN_EVENT_1
Definition sound.h:77
@ M_SAE_STOP_FAIL
Definition sound.h:86
@ M_SAE_VISUALIZATION_STARTED
Definition sound.h:103
@ M_SAE_PLAYTIME_ERROR
Definition sound.h:79
@ M_SAE_PLAYBACK_DONE
Definition sound.h:69
@ M_SAE_RESUME_OK
Definition sound.h:91
@ M_SAE_AUDIO_EVENT_PAUSED
Definition sound.h:100
@ M_SAE_3DAUDIO_ERROR
Definition sound.h:75
@ M_SAE_EVENT_STOPPED
Definition sound.h:63
@ M_SAE_CANCEL_FAIL
Definition sound.h:88
@ M_SAE_VOLUME_UPDATED
Definition sound.h:70
@ M_SAE_AUDIO_EVENT_RESUMED
Definition sound.h:101
@ M_SAE_RESERVE_OK
Definition sound.h:113
@ M_SAE_STREAM_READY
Definition sound.h:106
@ M_SAE_PAUSE_OK
Definition sound.h:89
@ M_SAE_SOUNDSTATE_CHANGED
Definition sound.h:119
@ M_SAE_SOUNDSYSTEM_IDLE
Definition sound.h:120
@ M_SAE_HANDSFREE_UPDATED
Definition sound.h:80
@ M_SAE_VOLUME_ERROR
Definition sound.h:71
@ M_SAE_UNKNOWN_EVENT
Definition sound.h:76
@ M_SAE_AUDIO_EVENT_STOPPED
Definition sound.h:99
@ M_SAE_RESUME_FAIL
Definition sound.h:92
@ M_SAE_VOLUME_CHANGED
Definition sound.h:118
@ M_SAE_RECORD_ERROR
Definition sound.h:83
@ 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:167
@ Job_NoJob
Definition sound.h:165
@ Job_GetRecordingTimeMax
Definition sound.h:171
@ Job_RecFile
Definition sound.h:166
@ Job_PlayFile
Definition sound.h:168
@ Job_PlayBuffer
Definition sound.h:169
@ Job_GetInfo
Definition sound.h:170
GBS event (MSG_PLAYFILE_REPORT) for the PlayFile or PlayMelodyInMem.
Definition sound.h:38
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