665 Commits

Author SHA1 Message Date
Vladimir Menshakov
0864699e5a AUDIO: Remove Tracker copy ctor
Tracker declares copy ctor for simple structure of POD types, but does not declare operator=.
Implicit copy/move/operator= is just fine.
2020-09-26 15:09:09 +01:00
Paweł Kołodziejski
8025fcd1d6 AUDIO: Increase number of audio mixer channels to 32 2020-09-23 22:58:53 +02:00
Kari Salminen
7ff9d16bf2 CINE: Loop Amiga music instead of playing it once
Make Amiga music loop until fade out when changing scene. This is
based on watching a video of Future Wars Amiga walkthrough, not on
playing the Amiga version or reading its disassembly. But it does seem
that the music loops instead of just playing once.
2020-09-10 00:34:32 +01:00
athrxx
38ddb196b3 AUDIO: (FM-TOWNS) - whitespace 2020-09-08 23:02:34 +02:00
athrxx
85755c893a AUDIO: (FM-TOWNS) - make use of Common::ObjectPool 2020-09-08 23:02:33 +02:00
Kari Salminen
d206dbcdae AUDIO: Add periodScaleDivisor to Paula and SoundFx
Add support for dividing the playing rate of Paula and SoundFx audio
by integers other than 1. This is going to be used in the Cine engine
for dividing the playing rate of music in the Amiga version of Operation
Stealth by 2 to get it to sound right. Otherwise it sounds too high
pitched.

This is groundwork for fixing bug #11676.
2020-09-05 22:57:03 +02:00
Kari Salminen
9098af1029 AUDIO: Fix Amiga's SoundFx instrument loading.
The instrument names are a maximum of 22 characters in length but
were previously shortened to a maximum of 8 characters. At least in
Amiga versions of Operation Stealth some of the instrument names are
longer than 8 characters and failed to be loaded because of this.
Raising the limit from 8 to 22 characters fixes this.

Addresses bug #11676.
2020-09-05 22:57:03 +02:00
Torbjörn Andersson
58a77abded FLUIDSYNTH: Prefer in-memory SoundFont data over global setting
When an engine provides in-memory SoundFont data, use that unless a
SoundFont has been explicitly configured on the current game. Otherwise
a global SoundFont setting will always override it. Even overriding the
MIDI settings for the game and leaving the SoundFont setting blank did
not work for me.
2020-09-02 10:01:33 +02:00
Thierry Crozat
0b0af686f2 AUDIO: Fix error using template function with anonymous struct
Old gcc versions do not like using template function with anonymous
struct and error out.
2020-09-01 05:03:50 +01:00
Vladimir Menshakov
201d2675ad AUDIO: Replace memsets on structures with ctors with ARRAYCLEAR() 2020-08-31 21:57:14 +01:00
Thierry Crozat
f3cfe11ee6 I18N: Consistency fix for SoundFont in messages 2020-08-31 16:35:56 +01:00
Eugene Sandulenko
8d27246a83 I18N: Adding full stops to the messages 2020-08-31 12:16:45 +02:00
aryanrawlani28
68d01321d6 GUI: U32: Downscale changes of U32, fix review issues
This commit addresses a range of changes, within scummvm subproject.

- Audio files, like mididrv, remove U32String based name and identifier, because ASCII only.
- mididrv.cpp had some wrong format for warning messages, fix those
- Message dialogs were modified to use default arguments more often, but reverting back to the orignal to minimize changes.
- SetTooltip has a fake constructor that takes in a string, and use it.
- U32Format had some break statements missing, add those.
- RemapWidget: Use fake constructor for setLabel and setTooltip, to make minimal changes
- SDL: setting text in clipboard no longer uses SDL_iconv_string
- TTS: Override base class "say" with strings, so tts->say can be used with normal strings too.
- About dialog: fix incorrect code for u32string variables
- Fix some extra brackets
- Some buttons were incorrectly removed from using translated labels, revert those
- Message Dialog: Pass default and alt buttons as const references
- Saveload Dialog: Use translations in missing places, use const-references. Also, use translations in a correct manner.
- Use const references for tooltip in GraphicsWidget, EditTextWidget, error.cpp
- DomainEditTextWidget: Use U32String for text
2020-08-30 14:43:41 +02:00
aryanrawlani28
4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +02:00
aryanrawlani28
185fb72783 GUI: U32: Improve U32 code
- Revert accidentally put translations in mt32.cpp
- Use U32::format in some places earlier missed
- Add %u and %i for u32::format
- Add support for GUIErrorMsgFormat to use u32::format internally
- Use the above whereever needed
- Improve linux tts by removing redundant code
- Some places I had changed nullptr -> "". Revert this
2020-08-30 14:43:41 +02:00
aryanrawlani28
a9bfe35216 GUI: U32: More issue fixes and general improvements
- Use the fake constructor for message dialog less often
- solve errors regarding comparision between string and u32string in midi
- solve errors in testbed/speech related to ttsMan->say
- fix unsigned comparision warning in tab.cpp
- fix issue with static strings and translations in sdl-graphics
2020-08-30 14:43:41 +02:00
aryanrawlani28
e22b32abfe GUI: U32: Use Common::U32String::format where necessary and GUIError to u32
- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28
b9a449480b GUI: U32: Remove u32::format references
- Removed because implicit conversion can simply handle this usecase
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
Eugene Sandulenko
858954eec1 AUDIO: Properly warn user and act gracefully when soundfont is not specified.
Fixes #7127
2020-08-29 17:55:33 +02:00
Eugene Sandulenko
30d67ced36 AUDIO: Added flag to skip rewinding in LoopingAudioStream 2020-08-29 02:17:18 +02:00
Eugene Sandulenko
d49a9870b7 AUDIO: Silence MSVC warning
Their code analysis does not catch the fact that we cover all possible
cases in the switch() statement, hence it produces the warning.
2020-08-27 15:02:59 +02:00
Cameron Cawley
b76652120b AUDIO: Separate the XA ADPCM decoder from the PSX video decoder 2020-08-24 14:21:00 +02:00
Eugene Sandulenko
ed82ccb95b BACKENDS: More mutexes 2020-08-20 00:53:23 +02:00
Eric Fry
bd4939a2a4 AUDIO: FluidSynth Don't accept soundfont data if using version 1.x 2020-08-19 23:51:04 +10:00
Eugene Sandulenko
44e21a499d AUDIO: Added override keywords 2020-08-19 12:34:58 +02:00
Eric Fry
d0aea31958 AUDIO: Fixed Soundfont Coverity issues 2020-08-15 14:17:42 +10:00
Eugene Sandulenko
3c5f17dca8 AUDIO: Plug memory leak 2020-08-10 10:54:34 +02:00
Cameron Cawley
b7e3a807e8
AUDIO: Fix compilation on DS and OpenPandora 2020-08-09 16:19:16 +01:00
Eugene Sandulenko
d9bcf03903 AUDIO: Fix warnings 2020-08-08 10:38:25 +02:00
Eric Fry
ea7faf3d20 DRAGONS: soundfont2 fix windows compile. 2020-08-08 15:16:36 +10:00
Eric Fry
cc1de3f102 AUDIO: Removed standard headers from soundfont2 code. Updated license comment. 2020-08-07 10:10:12 +02:00
Eric Fry
487e4ec27a AUDIO: soundfont2 Fix endian issues when creating sf2 file data 2020-08-07 10:10:12 +02:00
Eric Fry
428cadbe6a AUDIO: Soundfont: Added scummvm license headers. Renamed class variables. 2020-08-07 10:10:12 +02:00
Eric Fry
2b500c1124 AUDIO: Soundfont. replaced _t types. Replaces sprintf usage. 2020-08-07 10:10:12 +02:00
Eric Fry
f2e4cc35a6 AUDIO: SoundFont2 creation support 2020-08-07 10:10:12 +02:00
Cameron Cawley
65164e00d4 AUDIO: Fix unused functions with older FluidSynth versions 2020-08-01 20:32:09 +01:00
athrxx
b379b52938 AUDIO: preparations for SegaCD sound driver 2020-07-30 22:19:21 +02:00
athrxx
5e276286ae AUDIO/GUI: add SegaCD sound settings 2020-07-30 22:19:21 +02:00
athrxx
edc0c5dc91 AUDIO: (FM-TOWNS) - fix pcm rate 2020-07-30 22:19:12 +02:00
Eugene Sandulenko
c5e532f1ad AUDIO: Fix warning 2020-07-25 13:20:15 +02:00
NMIError
11c74aaef8 MIDI: Updated MidiParser documentation 2020-07-25 00:35:47 +02:00
NMIError
da64fdc3d1 MIDI: Fix MIDI parser tracker overflow
The MIDI parser tracks the number of ticks and microseconds since the start of
playback of the current track. If a track loops infinitely, the tracker
eventually overflows (after about 71 minutes). The parser would then go haywire,
sending out the MIDI events at full speed and not terminating hanging notes,
resulting in loads of polyphony overrun errors. This does not affect looping
using jumpToTick or autoLoop, because that resets the tracker.

This change fixes this for the XMIDI parser. processEvent implementations can
now set a bool flag on the event, indicating that the event has caused a loop.
The MIDI parser will then reset the ticks and microseconds on the tracker to 0,
maintaining the deltas between the previous event values and current values.
The absolute number of ticks and microseconds since track start do not seem to
be needed anywhere; only the difference with the previous event is relevant.

This should fix bugs #6275 and #4354.
2020-07-25 00:35:47 +02:00
NMIError
3ad8c85af2 MIDI: Prevent duplicate MIDI messages
The MIDI parser would send All Notes Off events on all MIDI channels as a
safety measure when stopping playback in various situations without first
checking if a track was actually playing. Depending on the specifics of the
code driving the MIDI parser, this could generate many duplicate All Notes Off,
Sustain off and/or Pitch Bend center messages. This is a problem for slow MIDI
hardware like the MT-32, which needs some time to process all these messages.
As a result, the timing at the beginning of the next track could be wrong.

I've introduced checks in stopPlaying, setTrack, unloadMusic and the MIDI
parser destructor so that allNotesOff is called once when a track is playing,
and not a second time when playback has already stopped. Similarly, unloadMusic
does not execute when no music is loaded to prevent duplicate Pitch Bend
messages.
2020-07-25 00:35:47 +02:00
NMIError
315bbc7b5b MIDI: Use driver-specific impl. for stopping all notes
When the MIDI parser wanted to stop all notes on a MIDI device, it would send
an All Notes Off message and, optionally, a Sustain off message on all 16 MIDI
channels. This is inefficient for devices like the MT-32, which uses only 9
channels. The MT-32 hardware is also quite slow, so it is more responsive if it
has to process less messages.

I've added a generic stopAllNotes message to the MIDI driver using the old
method, which can be overriden by more specific implementations in subclasses.
The Miles MIDI driver implementation sends All Notes Off only on the channels
used by the MT-32. There are probably also more efficient implementations
possible for f.e. AdLib.
2020-07-25 00:35:47 +02:00
NMIError
848d8315a6 MIDI/GROOVIE: Refactor XMIDI timbre chunk loading
XMIDI timbre chunk processing was implemented using a callback. This
reimplements this using an interface for the necessary driver method, which is
a somewhat cleaner solution.
2020-07-25 00:35:47 +02:00
NMIError
b38f1f00ac MIDI/GROOVIE: Fix MT-32 XMIDI timbre init delays
XMIDI data for the MT-32 can contain a timbre chunk which contains the custom
timbre numbers used for a track. Before starting playback of the track, the
timbres must be loaded into the MT-32 using SysEx messages. Each SysEx message
needs a delay before sending the next message to give the MT-32 enough time to
process it.

The delays between the messages were generated using the OSystem::delayMillis
function. This throws off the timing of the MidiParser, which causes MIDI
messages to "pile up", in this case at the start of the track. This change adds
a queue to the Miles MIDI driver, which can store the SysEx messages that must
be executed. The MidiParser suspends playback until the driver has sent all
messages in the queue.

This fixes the start of tracks in The 7th Guest, which had incorrect timing.

Because of the new SysEx queue, MT-32 initialization of The 7th Guest takes a
bit longer than it did before. The game plays an animation of a fixed length
and aborts the initialization if it is not done by the end of the animation.
This problem was already fixed for the GM initialization, so I've applied the
same fix for the MT-32.
2020-07-25 00:35:47 +02:00
NMIError
50772c1fbc MIDI: Fix XMIDI custom timbre loading
XMIDI files have an optional header defining custom timbres used for each
track. Before playback these timbres have to be sent to the MIDI device. The
old implementation of this functionality had two problems:

- The custom timbres were only sent during loading of the XMIDI data, for the
first track. If another track was played, the custom timbres for that track
would not be loaded.
- The custom timbres were sent after starting playback of the track. This
caused the sending of the timbres to sometimes overlap with the start of the
playback of the track, causing wrong instruments and bad timing.

If fixed these issues by moving the loading of the timbres to a new event
handler which is triggered during the setTrack function, before playback is
started.

This fixes problems with some MT-32 tracks in The 7th Guest, f.e. the second
track that plays on the main menu after starting the game.
2020-07-25 00:35:47 +02:00
NMIError
2f4937bd6d MIDI: Fix XMIDI SysEx Final Data controller
XMIDI defines controllers which allow the MIDI data to send controller changes
that build up SysEx messages. The last SysEx data byte is specified using the
Final Data controller, which should append the final byte to the SysEx message
and send it to the MIDI device. The old implementation did not append the last
byte. Additionally, when increasing the memory address for the SysEx, it did
not take into account that the MIDI bytes are 7 bit.

This commit fixes these issues. This restores a missing data byte in a SySex in
the MIDI initialization of The 7th Guest.
2020-07-25 00:35:47 +02:00
Michał Janiszewski
eed727474f AUDIO: Fix linking with vcpkg-provided FLAC 2020-07-15 15:30:55 +02:00