aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-26 09:56:21 +0530
committerEugene Sandulenko2019-09-03 17:17:29 +0200
commitd3eacb7e0fefbd9cde5b17fcfc5727eaf0143ad5 (patch)
tree9feb40563a83d98f17a9025d15a0e4e433b2a0a4 /engines/hdb
parent85b922895aee317631e07c5ece5ed908ee17952e (diff)
downloadscummvm-rg350-d3eacb7e0fefbd9cde5b17fcfc5727eaf0143ad5.tar.gz
scummvm-rg350-d3eacb7e0fefbd9cde5b17fcfc5727eaf0143ad5.tar.bz2
scummvm-rg350-d3eacb7e0fefbd9cde5b17fcfc5727eaf0143ad5.zip
HDB: Add playSound(), playSoundEx(), stopChannel()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/mpc.h310
-rw-r--r--engines/hdb/sound.cpp87
-rw-r--r--engines/hdb/sound.h10
3 files changed, 242 insertions, 165 deletions
diff --git a/engines/hdb/mpc.h b/engines/hdb/mpc.h
index b90deb8546..71481e246f 100644
--- a/engines/hdb/mpc.h
+++ b/engines/hdb/mpc.h
@@ -696,161 +696,161 @@ namespace HDB {
#define PIC_SNOWFLAKE "pic_snowflake"
#define PIC_INFOBAR "pic_infobar"
#define PIC_LOADSCREEN "pic_loadscreen"
-#define BUZZFLY_AMBIENT_WAV "buzzfly_ambient.wav"
-#define CHICKEN_AMBIENT_WAV "chicken_ambient.wav"
-#define CHICKEN_BAGAWK_WAV "chicken_bagawk.wav"
-#define CHICKEN_DEATH_WAV "chicken_death.wav"
-#define FERRET_SQUEAK_WAV "ferret_squeak.wav"
-#define MBOT_HMMM_WAV "mbot_hmmm.wav"
-#define MBOT_HMMM2_WAV "mbot_hmmm2.wav"
-#define MBOT_HYEAH_WAV "mbot_hyeah.wav"
-#define MBOT_YEAH_WAV "mbot_yeah.wav"
-#define MBOT_DEATH_WAV "mbot_death.wav"
-#define MBOT_WHISTLE1_WAV "mbot_whistle1.wav"
-#define MBOT_WHISTLE2_WAV "mbot_whistle2.wav"
-#define MBOT_WHISTLE3_WAV "mbot_whistle3.wav"
-#define DEADEYE_AMBIENT01_WAV "deadeye_ambient01.wav"
-#define DEADEYE_AMBIENT02_WAV "deadeye_ambient02.wav"
-#define DEADEYE_GROWL01_WAV "deadeye_growl01.wav"
-#define DEADEYE_GROWL02_WAV "deadeye_growl02.wav"
-#define FROG_LICK_WAV "frog_lick.wav"
-#define FROG_RIBBIT1_WAV "frog_ribbit1.wav"
-#define FROG_RIBBIT2_WAV "frog_ribbit2.wav"
-#define FATFROG_STUNNED_WAV "fatfrog_stunned.wav"
-#define RIGHTBOT_TURN_WAV "rightbot_turn.wav"
-#define RIGHTBOT_STUNNED_WAV "rightbot_stunned.wav"
-#define OMNIBOT_AMBIENT_WAV "omnibot_ambient.wav"
-#define OMNIBOT_FIRE_WAV "omnibot_fire.wav"
-#define OMNIBOT_STUNNED_WAV "omnibot_stunned.wav"
-#define FOURFIRE_TURN_WAV "fourfire_turn.wav"
-#define FOUR_FIRE_WAV "four_fire.wav"
-#define SHOCKBOT_AMBIENT_WAV "shockbot_ambient.wav"
-#define SHOCKBOT_SHOCK_WAV "shockbot_shock.wav"
-#define RAILRIDER_ONTRACK_WAV "railrider_ontrack.wav"
-#define RAILRIDER_EXIT_WAV "railrider_exit.wav"
-#define RAILRIDER_TASTE_WAV "railrider_taste.wav"
-#define BUZZFLY_STUNNED_WAV "buzzfly_stunned.wav"
-#define BUZZFLY_STING_WAV "buzzfly_sting.wav"
-#define ROBOT_STUNNED_WAV "robot_stunned.wav"
-#define FART_WAV "fart.wav"
-#define FART2_WAV "fart2.wav"
-#define PUSHBOT_STRAIN_WAV "pushbot_strain.wav"
-#define PUSHBOT_STUNNED_WAV "pushbot_stunned.wav"
-#define MEERKAT_BITE_WAV "meerkat_bite.wav"
-#define MEERKAT_WARNING_WAV "meerkat_warning.wav"
-#define MEERKAT_APPEAR_WAV "meerkat_appear.wav"
-#define MEERKAT_STUNNED_WAV "meerkat_stunned.wav"
-#define TURNBOT_TURN_WAV "turnbot_turn.wav"
-#define TURNBOT_STUNNED_WAV "turnbot_stunned.wav"
-#define DRAGON_WAKE_WAV "dragon_wake.wav"
-#define DRAGON_FALL_ASLEEP_WAV "dragon_fall_asleep.wav"
-#define DRAGON_BREATHE_FIRE_WAV "dragon_breathe_fire.wav"
-#define GOOD_FAERIE_AMBIENT_WAV "good_faerie_ambient.wav"
-#define GOOD_FAERIE_SPELL_WAV "good_faerie_spell.wav"
-#define GOOD_FAERIE_STUNNED_WAV "good_faerie_stunned.wav"
-#define BAD_FAERIE_AMBIENT_WAV "bad_faerie_ambient.wav"
-#define BAD_FAERIE_SPELL_WAV "bad_faerie_spell.wav"
-#define BAD_FAERIE_STUNNED_WAV "bad_faerie_stunned.wav"
-#define ICEPUFF_APPEAR_WAV "icepuff_appear.wav"
-#define ICEPUFF_WARNING_WAV "icepuff_warning.wav"
-#define ICEPUFF_THROW_WAV "icepuff_throw.wav"
-#define ICEPUFF_STUNNED_WAV "icepuff_stunned.wav"
-#define DEMIGOD_AMBIENT_WAV "demigod_ambient.wav"
-#define DEMIGOD_HOLYSPEECH_WAV "demigod_holyspeech.wav"
-#define DEMIGOD_UNHAPPY_WAV "demigod_unhappy.wav"
-#define GATEPUDDLE_AMBIENT_WAV "gatepuddle_ambient.wav"
-#define GATEPUDDLE_DISSIPATE_WAV "gatepuddle_dissipate.wav"
-#define GATEPUDDLE_SPAWN_WAV "gatepuddle_spawn.wav"
-#define MANNY_CRASH_WAV "manny_crash.wav"
-#define FOOTSTEPS_WAV "footsteps.wav"
-#define STEPS_ICE_WAV "steps_ice.wav"
-#define GUY_DROWN_WAV "guy_drown.wav"
-#define GUY_FRIED_WAV "guy_fried.wav"
-#define GUY_GRABBED_WAV "guy_grabbed.wav"
-#define GUY_DYING_WAV "guy_dying.wav"
-#define GUY_UHUH_WAV "guy_uhuh.wav"
-#define GUY_PLUMMET_WAV "guy_plummet.wav"
-#define GET_STUNNER_WAV "get_stunner.wav"
-#define GET_THING_WAV "get_thing.wav"
-#define GET_CLUB_WAV "get_club.wav"
-#define GET_SLUG_WAV "get_slug.wav"
-#define GET_MONKEYSTONE_WAV "get_monkeystone.wav"
-#define GET_GEM_WAV "get_gem.wav"
-#define GET_GOO_WAV "get_goo.wav"
-#define CLUB_MISS_WAV "club_miss.wav"
-#define CLUB_HIT_METAL_WAV "club_hit_metal.wav"
-#define CLUB_HIT_FLESH_WAV "club_hit_flesh.wav"
-#define STUNNER_BUZZ_WAV "stunner_buzz.wav"
-#define STUNNER_ZAP_WAV "stunner_zap.wav"
-#define SLUG_FIRE_WAV "slug_fire.wav"
-#define SLUG_HIT_WAV "slug_hit.wav"
-#define GEM_THROW_WAV "gem_throw.wav"
-#define MONKEYSTONE_SECRET_STAR_WAV "monkeystone_secret_star.wav"
-#define CRATE_SLIDE_WAV "crate_slide.wav"
-#define HEAVY_SLIDE_WAV "heavy_slide.wav"
-#define LIGHT_SLIDE_WAV "light_slide.wav"
-#define BARREL_EXPLODE_WAV "barrel_explode.wav"
-#define BARREL_MELTING_WAV "barrel_melting.wav"
-#define GUY_NOPUSH_SIZZLE_WAV "guy_nopush_sizzle.wav"
-#define SPLASH_WAV "splash.wav"
-#define TELEPORT3_WAV "teleport3.wav"
-#define FALL_DOWN_HOLE_WAV "fall_down_hole.wav"
-#define SLIME_BURN_WAV "slime_burn.wav"
-#define PLASMAFLOOR_SLIDE_WAV "plasmafloor_slide.wav"
-#define LASERD_PUSH_WAV "laserd_push.wav"
-#define MENU_ACCEPT_WAV "menu_accept.wav"
-#define MENU_BACKOUT_WAV "menu_backout.wav"
-#define MENU_SLIDER_WAV "menu_slider.wav"
-#define POP_WAV "pop.wav"
-#define BURP_WAV "burp.wav"
-#define TELEPORT3_WAV "teleport3.wav"
-#define DIALOG_OPEN_WAV "dialog_open.wav"
-#define DIALOG_CLOSE_WAV "dialog_close.wav"
-#define FUTUREBEEP2_WAV "futurebeep2.wav"
-#define INV_SELECT_WAV "inv_select.wav"
-#define MOVE_SELECTION_WAV "move_selection.wav"
-#define CELLHOLDER_USE_REJECT_WAV "cellholder_use_reject.wav"
-#define DOOR_OPEN_CLOSE_WAV "door_open_close.wav"
-#define SWITCH_USE_WAV "switch_use.wav"
-#define AIRLOCK_CLOSE_WAV "airlock_close.wav"
-#define TOUCHPLATE_CLICK_WAV "touchplate_click.wav"
-#define INSERT_CELL_WAV "insert_cell.wav"
-#define CABINET_OPEN_WAV "cabinet_open.wav"
-#define CABINET_CLOSE_WAV "cabinet_close.wav"
-#define BRIDGE_EXTEND_WAV "bridge_extend.wav"
-#define BRIDGE_START_WAV "bridge_start.wav"
-#define BRIDGE_END_WAV "bridge_end.wav"
-#define COMPUTERPROCESS_WAV "computerprocess.wav"
-#define MAILSORTER_HAPPY_WAV "mailsorter_happy.wav"
-#define MAILSORTER_UNHAPPY_WAV "mailsorter_unhappy.wav"
-#define NOTICE_WAV "notice.wav"
-#define MAINTBOT_WHOOSH1_WAV "maintbot_whoosh1.wav"
-#define MAINTBOT_WHOOSH2_WAV "maintbot_whoosh2.wav"
-#define SHIP_MOVING_INTRO_WAV "ship_moving_intro.wav"
-#define LASER_LOOP_WAV "laser_loop.wav"
-#define INFOCOMP_WAV "infocomp.wav"
-#define SLOT_SPIN_WAV "slot_spin.wav"
-#define SLOT_STOP_WAV "slot_stop.wav"
-#define SLOT_WIN_WAV "slot_win.wav"
-#define CLOCK_BONK_WAV "clock_bonk.wav"
-#define PASSCODE_CORRECT_WAV "passcode_correct.wav"
-#define SLOTMACHINE_SPINS_WAV "slotmachine_spins.wav"
-#define SLOTMACHINE_STOP_WAV "slotmachine_stop.wav"
-#define SLOTMACHINE_WIN_WAV "slotmachine_win.wav"
-#define PANIC_WAV "panic.wav"
-#define PANIC_TIMER_WAV "panic_timer.wav"
-#define PANIC_DEATH_WAV "panic_death.wav"
-#define QUEST_COMPLETE_WAV "quest_complete.wav"
-#define QUEST_FAILED_WAV "quest_failed.wav"
-#define TRY_AGAIN_WAV "try_again.wav"
-#define MONKEY_OOHOOH_WAV "monkey_oohooh.wav"
-#define MONKEY_WIN_WAV "monkey_win.wav"
-#define BYE_WAV "bye.wav"
-#define HDB_WAV "hdb.wav"
-#define VORTEXIAN_SAVE_WAV "VORTEXIAN_SAVE.WAV"
-#define UNLOCKED_ITEM_WAV "UNLOCKED_ITEM.WAV"
-#define BEEPBEEPBEEP_WAV "BEEPBEEPBEEP.WAV"
-#define MACHINE_AMBIENT1_WAV "MACHINE_AMBIENT1.WAV"
+#define BUZZFLY_AMBIENT_WAV "BUZZFLY_AMBIENT_WAV"
+#define CHICKEN_AMBIENT_WAV "CHICKEN_AMBIENT_WAV"
+#define CHICKEN_BAGAWK_WAV "CHICKEN_BAGAWK_WAV"
+#define CHICKEN_DEATH_WAV "CHICKEN_DEATH_WAV"
+#define FERRET_SQUEAK_WAV "FERRET_SQUEAK_WAV"
+#define MBOT_HMMM_WAV "MBOT_HMMM_WAV"
+#define MBOT_HMMM2_WAV "MBOT_HMMM2_WAV"
+#define MBOT_HYEAH_WAV "MBOT_HYEAH_WAV"
+#define MBOT_YEAH_WAV "MBOT_YEAH_WAV"
+#define MBOT_DEATH_WAV "MBOT_DEATH_WAV"
+#define MBOT_WHISTLE1_WAV "MBOT_WHISTLE1_WAV"
+#define MBOT_WHISTLE2_WAV "MBOT_WHISTLE2_WAV"
+#define MBOT_WHISTLE3_WAV "MBOT_WHISTLE3_WAV"
+#define DEADEYE_AMBIENT01_WAV "DEADEYE_AMBIENT01_WAV"
+#define DEADEYE_AMBIENT02_WAV "DEADEYE_AMBIENT02_WAV"
+#define DEADEYE_GROWL01_WAV "DEADEYE_GROWL01_WAV"
+#define DEADEYE_GROWL02_WAV "DEADEYE_GROWL02_WAV"
+#define FROG_LICK_WAV "FROG_LICK_WAV"
+#define FROG_RIBBIT1_WAV "FROG_RIBBIT1_WAV"
+#define FROG_RIBBIT2_WAV "FROG_RIBBIT2_WAV"
+#define FATFROG_STUNNED_WAV "FATFROG_STUNNED_WAV"
+#define RIGHTBOT_TURN_WAV "RIGHTBOT_TURN_WAV"
+#define RIGHTBOT_STUNNED_WAV "RIGHTBOT_STUNNED_WAV"
+#define OMNIBOT_AMBIENT_WAV "OMNIBOT_AMBIENT_WAV"
+#define OMNIBOT_FIRE_WAV "OMNIBOT_FIRE_WAV"
+#define OMNIBOT_STUNNED_WAV "OMNIBOT_STUNNED_WAV"
+#define FOURFIRE_TURN_WAV "FOURFIRE_TURN_WAV"
+#define FOUR_FIRE_WAV "FOUR_FIRE_WAV"
+#define SHOCKBOT_AMBIENT_WAV "SHOCKBOT_AMBIENT_WAV"
+#define SHOCKBOT_SHOCK_WAV "SHOCKBOT_SHOCK_WAV"
+#define RAILRIDER_ONTRACK_WAV "RAILRIDER_ONTRACK_WAV"
+#define RAILRIDER_EXIT_WAV "RAILRIDER_EXIT_WAV"
+#define RAILRIDER_TASTE_WAV "RAILRIDER_TASTE_WAV"
+#define BUZZFLY_STUNNED_WAV "BUZZFLY_STUNNED_WAV"
+#define BUZZFLY_STING_WAV "BUZZFLY_STING_WAV"
+#define ROBOT_STUNNED_WAV "ROBOT_STUNNED_WAV"
+#define FART_WAV "FART_WAV"
+#define FART2_WAV "FART2_WAV"
+#define PUSHBOT_STRAIN_WAV "PUSHBOT_STRAIN_WAV"
+#define PUSHBOT_STUNNED_WAV "PUSHBOT_STUNNED_WAV"
+#define MEERKAT_BITE_WAV "MEERKAT_BITE_WAV"
+#define MEERKAT_WARNING_WAV "MEERKAT_WARNING_WAV"
+#define MEERKAT_APPEAR_WAV "MEERKAT_APPEAR_WAV"
+#define MEERKAT_STUNNED_WAV "MEERKAT_STUNNED_WAV"
+#define TURNBOT_TURN_WAV "TURNBOT_TURN_WAV"
+#define TURNBOT_STUNNED_WAV "TURNBOT_STUNNED_WAV"
+#define DRAGON_WAKE_WAV "DRAGON_WAKE_WAV"
+#define DRAGON_FALL_ASLEEP_WAV "DRAGON_FALL_ASLEEP_WAV"
+#define DRAGON_BREATHE_FIRE_WAV "DRAGON_BREATHE_FIRE_WAV"
+#define GOOD_FAERIE_AMBIENT_WAV "GOOD_FAERIE_AMBIENT_WAV"
+#define GOOD_FAERIE_SPELL_WAV "GOOD_FAERIE_SPELL_WAV"
+#define GOOD_FAERIE_STUNNED_WAV "GOOD_FAERIE_STUNNED_WAV"
+#define BAD_FAERIE_AMBIENT_WAV "BAD_FAERIE_AMBIENT_WAV"
+#define BAD_FAERIE_SPELL_WAV "BAD_FAERIE_SPELL_WAV"
+#define BAD_FAERIE_STUNNED_WAV "BAD_FAERIE_STUNNED_WAV"
+#define ICEPUFF_APPEAR_WAV "ICEPUFF_APPEAR_WAV"
+#define ICEPUFF_WARNING_WAV "ICEPUFF_WARNING_WAV"
+#define ICEPUFF_THROW_WAV "ICEPUFF_THROW_WAV"
+#define ICEPUFF_STUNNED_WAV "ICEPUFF_STUNNED_WAV"
+#define DEMIGOD_AMBIENT_WAV "DEMIGOD_AMBIENT_WAV"
+#define DEMIGOD_HOLYSPEECH_WAV "DEMIGOD_HOLYSPEECH_WAV"
+#define DEMIGOD_UNHAPPY_WAV "DEMIGOD_UNHAPPY_WAV"
+#define GATEPUDDLE_AMBIENT_WAV "GATEPUDDLE_AMBIENT_WAV"
+#define GATEPUDDLE_DISSIPATE_WAV "GATEPUDDLE_DISSIPATE_WAV"
+#define GATEPUDDLE_SPAWN_WAV "GATEPUDDLE_SPAWN_WAV"
+#define MANNY_CRASH_WAV "MANNY_CRASH_WAV"
+#define FOOTSTEPS_WAV "FOOTSTEPS_WAV"
+#define STEPS_ICE_WAV "STEPS_ICE_WAV"
+#define GUY_DROWN_WAV "GUY_DROWN_WAV"
+#define GUY_FRIED_WAV "GUY_FRIED_WAV"
+#define GUY_GRABBED_WAV "GUY_GRABBED_WAV"
+#define GUY_DYING_WAV "GUY_DYING_WAV"
+#define GUY_UHUH_WAV "GUY_UHUH_WAV"
+#define GUY_PLUMMET_WAV "GUY_PLUMMET_WAV"
+#define GET_STUNNER_WAV "GET_STUNNER_WAV"
+#define GET_THING_WAV "GET_THING_WAV"
+#define GET_CLUB_WAV "GET_CLUB_WAV"
+#define GET_SLUG_WAV "GET_SLUG_WAV"
+#define GET_MONKEYSTONE_WAV "GET_MONKEYSTONE_WAV"
+#define GET_GEM_WAV "GET_GEM_WAV"
+#define GET_GOO_WAV "GET_GOO_WAV"
+#define CLUB_MISS_WAV "CLUB_MISS_WAV"
+#define CLUB_HIT_METAL_WAV "CLUB_HIT_METAL_WAV"
+#define CLUB_HIT_FLESH_WAV "CLUB_HIT_FLESH_WAV"
+#define STUNNER_BUZZ_WAV "STUNNER_BUZZ_WAV"
+#define STUNNER_ZAP_WAV "STUNNER_ZAP_WAV"
+#define SLUG_FIRE_WAV "SLUG_FIRE_WAV"
+#define SLUG_HIT_WAV "SLUG_HIT_WAV"
+#define GEM_THROW_WAV "GEM_THROW_WAV"
+#define MONKEYSTONE_SECRET_STAR_WAV "MONKEYSTONE_SECRET_STAR_WAV"
+#define CRATE_SLIDE_WAV "CRATE_SLIDE_WAV"
+#define HEAVY_SLIDE_WAV "HEAVY_SLIDE_WAV"
+#define LIGHT_SLIDE_WAV "LIGHT_SLIDE_WAV"
+#define BARREL_EXPLODE_WAV "BARREL_EXPLODE_WAV"
+#define BARREL_MELTING_WAV "BARREL_MELTING_WAV"
+#define GUY_NOPUSH_SIZZLE_WAV "GUY_NOPUSH_SIZZLE_WAV"
+#define SPLASH_WAV "SPLASH_WAV"
+#define TELEPORT3_WAV "TELEPORT3_WAV"
+#define FALL_DOWN_HOLE_WAV "FALL_DOWN_HOLE_WAV"
+#define SLIME_BURN_WAV "SLIME_BURN_WAV"
+#define PLASMAFLOOR_SLIDE_WAV "PLASMAFLOOR_SLIDE_WAV"
+#define LASERD_PUSH_WAV "LASERD_PUSH_WAV"
+#define MENU_ACCEPT_WAV "MENU_ACCEPT_WAV"
+#define MENU_BACKOUT_WAV "MENU_BACKOUT_WAV"
+#define MENU_SLIDER_WAV "MENU_SLIDER_WAV"
+#define POP_WAV "POP_WAV"
+#define BURP_WAV "BURP_WAV"
+#define TELEPORT3_WAV "TELEPORT3_WAV"
+#define DIALOG_OPEN_WAV "DIALOG_OPEN_WAV"
+#define DIALOG_CLOSE_WAV "DIALOG_CLOSE_WAV"
+#define FUTUREBEEP2_WAV "FUTUREBEEP2_WAV"
+#define INV_SELECT_WAV "INV_SELECT_WAV"
+#define MOVE_SELECTION_WAV "MOVE_SELECTION_WAV"
+#define CELLHOLDER_USE_REJECT_WAV "CELLHOLDER_USE_REJECT_WAV"
+#define DOOR_OPEN_CLOSE_WAV "DOOR_OPEN_CLOSE_WAV"
+#define SWITCH_USE_WAV "SWITCH_USE_WAV"
+#define AIRLOCK_CLOSE_WAV "AIRLOCK_CLOSE_WAV"
+#define TOUCHPLATE_CLICK_WAV "TOUCHPLATE_CLICK_WAV"
+#define INSERT_CELL_WAV "INSERT_CELL_WAV"
+#define CABINET_OPEN_WAV "CABINET_OPEN_WAV"
+#define CABINET_CLOSE_WAV "CABINET_CLOSE_WAV"
+#define BRIDGE_EXTEND_WAV "BRIDGE_EXTEND_WAV"
+#define BRIDGE_START_WAV "BRIDGE_START_WAV"
+#define BRIDGE_END_WAV "BRIDGE_END_WAV"
+#define COMPUTERPROCESS_WAV "COMPUTERPROCESS_WAV"
+#define MAILSORTER_HAPPY_WAV "MAILSORTER_HAPPY_WAV"
+#define MAILSORTER_UNHAPPY_WAV "MAILSORTER_UNHAPPY_WAV"
+#define NOTICE_WAV "NOTICE_WAV"
+#define MAINTBOT_WHOOSH1_WAV "MAINTBOT_WHOOSH1_WAV"
+#define MAINTBOT_WHOOSH2_WAV "MAINTBOT_WHOOSH2_WAV"
+#define SHIP_MOVING_INTRO_WAV "SHIP_MOVING_INTRO_WAV"
+#define LASER_LOOP_WAV "LASER_LOOP_WAV"
+#define INFOCOMP_WAV "INFOCOMP_WAV"
+#define SLOT_SPIN_WAV "SLOT_SPIN_WAV"
+#define SLOT_STOP_WAV "SLOT_STOP_WAV"
+#define SLOT_WIN_WAV "SLOT_WIN_WAV"
+#define CLOCK_BONK_WAV "CLOCK_BONK_WAV"
+#define PASSCODE_CORRECT_WAV "PASSCODE_CORRECT_WAV"
+#define SLOTMACHINE_SPINS_WAV "SLOTMACHINE_SPINS_WAV"
+#define SLOTMACHINE_STOP_WAV "SLOTMACHINE_STOP_WAV"
+#define SLOTMACHINE_WIN_WAV "SLOTMACHINE_WIN_WAV"
+#define PANIC_WAV "PANIC_WAV"
+#define PANIC_TIMER_WAV "PANIC_TIMER_WAV"
+#define PANIC_DEATH_WAV "PANIC_DEATH_WAV"
+#define QUEST_COMPLETE_WAV "QUEST_COMPLETE_WAV"
+#define QUEST_FAILED_WAV "QUEST_FAILED_WAV"
+#define TRY_AGAIN_WAV "TRY_AGAIN_WAV"
+#define MONKEY_OOHOOH_WAV "MONKEY_OOHOOH_WAV"
+#define MONKEY_WIN_WAV "MONKEY_WIN_WAV"
+#define BYE_WAV "BYE_WAV"
+#define HDB_WAV "HDB_WAV"
+#define VORTEXIAN_SAVE_WAV "VORTEXIAN_SAVE_WAV"
+#define UNLOCKED_ITEM_WAV "UNLOCKED_ITEM_WAV"
+#define BEEPBEEPBEEP_WAV "BEEPBEEPBEEP_WAV"
+#define MACHINE_AMBIENT1_WAV "MACHINE_AMBIENT1_WAV"
#define M00_AIRLOCK_01_MP3 "M00_AIRLOCK_01_MP3"
#define M00_ARNIE_01_MP3 "M00_ARNIE_01_MP3"
#define M00_BRAD_01_MP3 "M00_BRAD_01_MP3"
diff --git a/engines/hdb/sound.cpp b/engines/hdb/sound.cpp
index c4ff8369bf..4fa5e2b117 100644
--- a/engines/hdb/sound.cpp
+++ b/engines/hdb/sound.cpp
@@ -1464,12 +1464,91 @@ void Sound::setMusicVolume(int volume) {
}
bool Sound::playSound(int index) {
- debug(9, "STUB: Play Sound");
+
+ if (index > _numSounds || !_sfxVolume)
+ return false;
+
+ // is sound in memory at least?
+ if (_soundCache[index].loaded == -1)
+ _soundCache[index].loaded = 1;
+
+ // is sound marked as cached?
+ if (!_soundCache[index].loaded) {
+
+ Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(_soundCache[index].name, TYPE_BINARY);
+ if (stream == nullptr)
+ return false;
+
+ if (_soundCache[index].ext) {
+#ifdef USE_MAD
+ _soundCache[index].audioStream = Audio::makeMP3Stream(stream, DisposeAfterUse::YES);
+ _soundCache[index].loaded = 1;
+#endif // USE_MAD
+ } else {
+ _soundCache[index].audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
+ _soundCache[index].loaded = 1;
+ }
+ }
+
+ int soundChannel = 0;
+
+ // Select Free Audio Handle
+ for (int i = 0; i < kLaserChannel; i++) {
+ if (!g_hdb->_mixer->isSoundHandleActive(_handles[i])) {
+ soundChannel = i;
+ break;
+ }
+ }
+
+ // If no free handles found
+ if (soundChannel == kLaserChannel)
+ return false;
+
+ g_hdb->_mixer->setChannelVolume(_handles[soundChannel], _sfxVolume);
+
+ g_hdb->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_handles[soundChannel], _soundCache[index].audioStream);
+
return true;
}
bool Sound::playSoundEx(int index, int channel, bool loop) {
- debug(9, "STUB: Play SoundEx");
+ if (g_hdb->_mixer->isSoundHandleActive(_handles[channel]))
+ return false;
+
+ if (index > _numSounds || !_sfxVolume)
+ return false;
+
+ // is sound in memory at least?
+ if (_soundCache[index].loaded == -1)
+ _soundCache[index].loaded = 1;
+
+ // is sound marked as cached?
+ if (!_soundCache[index].loaded) {
+
+ Common::SeekableReadStream *stream = g_hdb->_fileMan->findFirstData(_soundCache[index].name, TYPE_BINARY);
+ if (stream == nullptr)
+ return false;
+
+ if (_soundCache[index].ext) {
+#ifdef USE_MAD
+ _soundCache[index].audioStream = Audio::makeMP3Stream(stream, DisposeAfterUse::YES);
+ _soundCache[index].loaded = 1;
+#endif // USE_MAD
+ } else {
+ _soundCache[index].audioStream = Audio::makeWAVStream(stream, DisposeAfterUse::YES);
+ _soundCache[index].loaded = 1;
+ }
+ }
+
+ g_hdb->_mixer->setChannelVolume(_handles[channel], _sfxVolume);
+
+ if (loop) {
+ Audio::AudioStream *loopingStream = new Audio::LoopingAudioStream(_soundCache[index].audioStream, 0, DisposeAfterUse::YES);
+ g_hdb->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_handles[channel], loopingStream);
+ } else {
+ g_hdb->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_handles[channel], _soundCache[index].audioStream);
+ }
+
return true;
}
@@ -1549,7 +1628,7 @@ bool Sound::songPlaying(SoundType song) {
}
bool Sound::stopChannel(int channel) {
- debug(9, "STUB: Stop Channel");
+ g_hdb->_mixer->stopHandle(_handles[channel]);
return true;
}
@@ -1674,7 +1753,7 @@ int Sound::registerSound(const char *name) {
bool Sound::freeSound(int index) {
if (_soundCache[index].loaded == 1) {
- warning("STUB: Free the audio stream in cache");
+ delete _soundCache[index].audioStream;
_soundCache[index].loaded = 0;
_soundCache[index].ext = 0;
return true;
diff --git a/engines/hdb/sound.h b/engines/hdb/sound.h
index 1ed279df96..7984ab1b22 100644
--- a/engines/hdb/sound.h
+++ b/engines/hdb/sound.h
@@ -58,8 +58,6 @@ enum {
kMaxSNDChannels = 32,
kMaxSounds = 5000,
kLaserChannel = kMaxSNDChannels - 1,
- kMusicChannel = kMaxSNDChannels - 2,
- kVoiceChannel = kMaxSNDChannels - 5
};
enum SoundType {
@@ -1429,11 +1427,10 @@ struct SoundCache {
int32 size; // size of sound
const char *name; // filename / MSD name
const char *luaName; // name used by Lua for i.d.
- int ext; // 0 = Uninitialized, -1 = WAV, 1 = MP3
- //void *data; // actual file data
- //FSOUND_SAMPLE *sample; // used to play sound in FMOD
+ int ext; // 0 = Uninitialized, -1 = WAV, 1 = MP3
+ Audio::SeekableAudioStream *audioStream;
- SoundCache() : loaded(0), size(0), name(nullptr), luaName(nullptr), ext(0) {}
+ SoundCache() : loaded(0), size(0), name(nullptr), luaName(nullptr), ext(0), audioStream(nullptr) {}
};
struct Song {
@@ -1534,6 +1531,7 @@ public:
SoundCache _soundCache[kMaxSounds];
int _numSounds;
int _sfxVolume;
+ Audio::SoundHandle _handles[kMaxSNDChannels];
};