99 Commits

Author SHA1 Message Date
Walter Agazzi
2f817634af AGS: Check sound sample rate before playing
Before playing a sound clip, check that the sample rate is acceptable for the sound system.
This avoids a crash to debugger in "The Excavation of Hob's
Barrow" which contains a sound effect that gets detected
at an incorrectly high sample rate.
2023-01-19 16:58:23 +01:00
Thierry Crozat
ccbe6f5419 AGS: Engine: in video_check_user_input() exceed all the keypress buffer
From upstream f7b90bbaaa242e4dc79d26fdddaf7e269e7ce600 and part of
upstream 66738a0c4550ec349dcf45ec39030b56332e1ea8
2022-12-17 22:10:55 +01:00
Thierry Crozat
f9e3580237 AGS: reimplemented clear division of clip position by sound type
Currently only MP3/OGG and WAVs are reporting correct sound type dependent pos.

Adapted from upstream 19bdee979c80f339d0ada0bee99b7517c8b595c5
2022-10-10 23:42:34 +01:00
Thierry Crozat
26716156af AGS: added AudioChannel.SeekMs() to coplement PositionMs
From upstream 59a5cacb8ed61e41dd8ef0641dd5de156caf8d32
2022-10-10 23:42:34 +01:00
Thierry Crozat
2f8d4cb072 AGS: PlayVideo supports playing game and video sound together
From commit f2a9f3043aac24b0e70b48602a664541ec12df8d
2022-10-10 00:16:16 +01:00
Thierry Crozat
5987bc5e6e AGS: rewrote eAGSMouseButton enum to sync with the script API
* Changed from -1 - based constants to 0 - based constants;
* These were purely internal values, therefore no API would be harmed;
* Removed necessity of converting from internal mouse button code to script and back all the time;
* On a side note, this fixes a bug where WaitMouse etc were returning incorrect values on mouse skip, because we forgot to convert from internal to script code.

From upstream 471098d239b076c494beb2d554572ccb69372667
2022-10-10 00:16:16 +01:00
Thierry Crozat
026d1e83ac AGS: don't start sound fadeout if skipping a cutscene
From upstream d742c415a898e9c52875098f3f40ecffa57b22ee
2022-10-09 17:58:53 +01:00
Thierry Crozat
025e89f6e3 AGS: Removed unused global variable
(could be remains of an old audio threading code)

From upstream a0424b98c6096da653824ec6fc03521f3583558e
2022-06-21 23:28:01 +01:00
Thierry Crozat
6690bfa5c7 AGS: Remove unused mutex variables in AGSEngine
The last use for those mutexes were removed respectively in:
a4569cb180d11edead179605148dc87e6f9d0198 - AGS: Properly remove sound caching
ce606cd25c73d63242ac663b05dfde0a4f958cd6 - AGS: Remove deprecated audio classes
c25b08448d6f0b3103b8cf3a0a619bdd42919f11 - AGS: Removed AudioChannelsLock as it's no longer needed
2022-06-16 23:16:20 +01:00
Paul Gilbert
d2b03800c6 AGS: Allow to place sounds on a crossfade channels for compatibility
From upstream 86564e983572b4ffb3cd12b00c116ae91c6fcbe4
2022-04-29 22:20:39 -07:00
Paul Gilbert
357679d2a8 AGS: Fixing unimplemented cases in switches
From upstream f2bb0d055344197b6e4ed537c3107fe0c9784e50
2022-04-25 21:50:33 -07:00
Paul Gilbert
a6f42ad1ab AGS: Fixing various "unused va/arg" warnings + removed empty funcs
From upstream 61771ecd638338806c40d0da2bf1addea06cac90
2022-04-25 21:44:40 -07:00
Paul Gilbert
4cab476394 AGS: in String use constant NoIndex instead of nps
From upstream aca0285937f96002b76d61f4c1cc6f3a11242c2c
2022-04-24 16:00:04 -07:00
Paul Gilbert
5060848b48 AGS: Support requesting particular audio driver
From upstream 076e675a3d031cd0a9d162f914e6d94c93a10d71
2022-04-21 21:20:58 -07:00
Paul Gilbert
b4b4110db6 AGS: Implement play_flc_video 2022-04-21 19:29:53 -07:00
Paul Gilbert
983de47d8b AGS: Added legacy support for Theora video positioning
From upstream 757335c55c2908c4a9a0c179415b834ca5cfce0c
2022-04-12 22:27:57 -07:00
Paul Gilbert
0b639b8f46 AGS: Implemented video pause/resume, react to window focus events
From upstream 5934c62be17e179607c3387ea31c70bfddaac399
Stuff in the VideoPlayer class not implemented
2022-04-12 22:27:57 -07:00
Paul Gilbert
8e3207b38b AGS: Moved frame wait and user input check outside of VideoPlayer
From upstream c5f815729792837b6b4a02c013c7c554942792d9
Only partially implemented, since ScummVM has it's own video player code
2022-04-12 22:27:57 -07:00
Paul Gilbert
27ad60df72 AGS: Unify video flags in VideoPlayer, convert in script functions
From upstream e5c8293a8c8350c38a8df338f56e3806fdc4f119
Plus changes to local video player implementation to reflect changes
2022-04-12 22:27:56 -07:00
Paul Gilbert
9f05a91eb5 AGS: Fixed engine crash in case of too many reserved channels
From upstream b954ad324b6d0bc6b981419093c53062fc11f1f5
2022-04-08 22:17:51 -07:00
Paul Gilbert
0e41656981 AGS: Fixed utility audio chans were missing a sync with audio core
From upstream 6560bb43ee8723c160c8ccaa1fcff007b99f1aeb
2022-03-27 19:14:54 -07:00
Paul Gilbert
2ef749739e AGS: Fixed SOUNDCLIP::set_volume_direct()
From upstream e2d8f727811c6ff58a0f05222c3007805abcf3ce
2022-03-21 19:13:00 -07:00
Paul Gilbert
0988fbbe78 AGS: Dispose SOUNDCLIP when stopped playing
From upstream 60d40072b429a641f6fcbf3cdb8c60809fc3f770
2022-03-19 21:25:09 -07:00
Paul Gilbert
16b89bd8ea AGS: tidy SOUNDCLIP's fields (volume, panning) and methods
From upstream 66514167d3463f8191b10ec13898df136e8e33ee
2022-03-19 21:25:08 -07:00
Paul Gilbert
699a72af3b AGS: Removed redundant sound destroy calls
From upstream c8bedc8838635381fc186c9f54e8789a8c276063
2022-03-19 21:25:08 -07:00
Paul Gilbert
a4bf82bd35 AGS: Removed "volume" param out of load clip factory functions
From upstream 903c4d7d69bf0400447b099cbd0b2818f3c1f7c7
2022-03-19 21:25:08 -07:00
Paul Gilbert
07f36ce19b AGS: Store clip's ID in SOUNDCLIP instead of a pointer to unknown type
From upstream 954e9bb27e7aea873931ba20ad89397d4dc004bd
2022-03-18 21:29:56 -07:00
Paul Gilbert
c25b08448d AGS: Removed AudioChannelsLock as it's no longer needed
From upstream 43f9320f66bb881920e6f812d1c642e793b134b6
2022-03-18 21:29:56 -07:00
Paul Gilbert
b09a7d3bde AGS: Fixed engine crash in case of too many reserved channels
From upstream 398783561b0079720950b117ba1db110100706f6
2022-03-18 21:29:55 -07:00
Paul Gilbert
59a93fa277 AGS: Implemented AudioChannel.Pause, Resume and IsPaused
From upstream 3fa95f18f732ced40738a4a79b51552361d2a865
2022-03-18 21:29:55 -07:00
Paul Gilbert
ee311d660f AGS: Make game audiochannels limit defined by a game version
From upstream 65f0b843dfd85967135eca1bda46976aa1ddcf26
2022-03-17 21:49:25 -07:00
Paul Gilbert
aa91cf1161 AGS: Increased the max number of audio channels to 16
From upstream ebddc45c2a2252f5eb927c96b5c6065eebea1ed4
2022-03-17 21:49:25 -07:00
Paul Gilbert
3167bac67b AGS: More clear use of the "max channels" constants
From upstream 2fd582a2a5fc9d38643277903854a977f8995e07
2022-03-17 21:49:25 -07:00
Paul Gilbert
74254fdcf4 AGS: Simplified couple of set_volume calls
From upstream 3d4187e64237a7fa6f7f7bf4fb6477369bae1af4
2022-03-17 21:49:25 -07:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert
f73034d55b AGS: Skip videos with unsupported video tracks rather than erroring 2021-09-25 10:28:47 -07:00
Paul Gilbert
7e7ac21f06 AGS: Delay starting sound playback until a channel is set
In AGS, setting the channel for music, sfx, or voice
frequently happens after the call to play has already been done.
This poses a problem for ScummVM, since I need the sound type
directly for the playStream call. And it's not feasible to
refactor everywhere that plays a clip to set the channel first.
With this change, any play call sets a flag, and defers calling
playStream until the channel is set. Hopefully there aren't
any places that call play without setting the channel before/after.
2021-08-28 12:18:02 -07:00
Paul Gilbert
e94b88f586 AGS: Properly maintain volume changes across savegames 2021-08-27 19:35:01 -07:00
Paul Gilbert
5845b7cbf2 AGS: Fix sound get_pos() to reutrn in ms, not secs 2021-08-01 12:13:36 -07:00
Paul Gilbert
465fbc19f0 AGS: Implement audio stream seeking and getting length 2021-07-11 14:45:16 -07:00
Paul Gilbert
ee75794504 AGS: Cleanup of usage of ScummVM Graphics::Screen 2021-07-11 14:06:26 -07:00
Paul Gilbert
73cd6b9215 AGS: Structure for passing events UTF8 text around along with the keycode
From upstream 9d65a68c61d0503e05e2cbe80447af0d619161e4

Note that ScummVM doesn't have a TEXT_INPUT event, so this change and following
ones will be mostly to keep in sync with the standalone codebase even if they're
not directly used
2021-07-10 14:33:36 -07:00
Paul Gilbert
4601631cbe AGS: Remove unneeded video_on_gfxmode_changed method 2021-07-01 20:49:01 -07:00
Paul Gilbert
c7365214d1 AGS: improved the way view clips are remapped for old audio system
From upstream 525e0bb3de701f1066ca7ff51cbb6a33877390fc
2021-06-13 21:09:05 -07:00
Paul Gilbert
46ddd20145 AGS: Fixed few type cast warnings
From upstream 3085660c96318f2fb4943aff6fc41dfcd6a00c3d
2021-06-13 21:09:01 -07:00
Paul Gilbert
87dba2e276 AGS: Re-added checks for SHOULD_QUIT and abort_engine 2021-06-13 21:08:52 -07:00
Paul Gilbert
a4569cb180 AGS: Properly remove sound caching 2021-06-13 21:08:51 -07:00
Paul Gilbert
701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00
Thierry Crozat
9dd74858e4 AGS: Remove assert when trying to create looping audio stream
When trying to create a looping stream from a non-seakable
stream the code was asserting. This happened for example
with MOD audio streams. Those are usually already looping
built-in, so we might be fine. But in any case even only
playing it once is better than a crash.

This also avoids the assert when we failed to create the
audio stream (for example for 24 bits WAV audio).
2021-04-11 02:21:39 +01:00
Thierry Crozat
a33c516266 AGS: Fix music type for MOD SOUNDCLIP 2021-04-07 00:40:43 +01:00