1083 Commits

Author SHA1 Message Date
sergm
f8bc0be842 Fixed packaging of libmt32emu with RPM generator
The pkgconfig directory is no longer marked for creation assuming that
the system directory is specified in libmt32emu_PKGCONFIG_INSTALL_PREFIX
property so to avoid conflicts
2021-03-20 20:23:58 +02:00
sergm
59a4a0e30d Further improved pkg-config file generated for libmt32emu
- More of the package metadata fields are now filled from the CMake script
  thus reducing duplications
- When the library is build with external sample rate conversion,
  field Requires.private is now filled with the related dependency
  (either soxr or samplerate) thus fixing build of user applications
  that link against statically built libmt32emu in such cases
- Along the way, variable MT32EMU_EXT_LIBS is now unset when building
  a shared library to avoid pollution of variable MT32EMU_LIBRARIES
  with unnecessary dependencies
2021-03-14 19:21:36 +02:00
sergm
70fae811c7 Fixed various cases of UB in libmt32emu, related to (#51)
- In TVP::process, UB was possible due to right shifts with counter values
  exceeding the maximum permitted limit of 31 (similarly to the original
  hardware); we now attempt to emulate that in the same way as in
  calcVeloMult implemented in 41980704d2
- In TVP::setupPitchChange spotted by clang static analyzer, a negative
  value could be shifted left
2021-03-13 13:04:02 +02:00
sergm
f4498e6efe libmt32emu: Updated NEWS.txt 2021-03-07 23:08:43 +02:00
sergm
066f0884a7 Extended the C API to simplify handling of ROM images (#47)
- mt32emu_get_machine_ids enables to retrieve a list of all supported
  hardware configurations as opposed to individual ROM images
- mt32emu_get_rom_ids to retrieve a list of identifiers of all supported
  ROMs, optionally for a specific machine
- A couple of convenience functions to identify a given ROM image
  without applying any changes to the emulation context
- New function mt32emu_add_machine_rom_file facilitates implementation
  of a ROM scanner that traverses files in a given directory and adds
  to the emulation context those compatible with a specific machine
2021-03-07 23:08:18 +02:00
sergm
575774ee0f Added three new convenience methods to ROMInfo
These provide for retrieving a list of all known / full / partial ROMInfos
with less overhead than using ROMInfo::getROMInfoList
2021-03-06 20:56:44 +02:00
sergm
d398d1695a Made const the two instance methods of MachineConfiguration as intended 2021-03-06 20:51:28 +02:00
sergm
67a8139b3f libmt32emu: Introduced notion of machine configuration
That is currently concerns of a set of relevant ROMs only, thus making it
possible to find all ROMs for a desired machine configuration that are
mutually compatible and can be used in the emulation engine.
2021-02-21 18:51:29 +02:00
sergm
42825660e9 libmt32emu: Introduced a global header mt32emu.h
that now merely wraps <mt32emu/mt32emu.h> for convenience.
This file is autogenerated by the build system.

Although, a reorganisation of public headers is rather imminent,
but it will only happen on next major release.
2021-02-21 14:08:24 +02:00
Patryk Obara
eb34afc2e8 Fix effc++ warnings in libmt32emu interface
When users of the library compile code with -Weffc++, this class
triggers warning:

  ‘class MT32Emu::Service’ has pointer data members
  but does not declare ‘MT32Emu::Service(const MT32Emu::Service&)’
  or ‘operator=(const MT32Emu::Service&)’

Class Service aggregates an owning raw pointer (mt32emu_context), which
is being taken over via constructor and freed in destructor - this might
lead user to accidentally double free the pointed object if a Service
object was accidentally copied through default copy c-tor or default
assignment operator.

Declare copy c-tor and operator= private to prevent creation of
accidental copy (this fixes the warning).

When upgrading this code to C++11, these declarations should be
marked with '= delete' (and won't need to be private any more).
2021-02-16 23:39:49 +01:00
sergm
17ccc4bf7b Fixed a memory leak in method ROMImage::makeROMImage(File *, File *) 2021-02-13 20:38:48 +02:00
sergm
a53acf4cd3 Added support for merging partial ROM images in the C API (#44)
- New functions mt32emu_merge_and_add_rom_data and
  mt32emu_merge_and_add_rom_files accept a pair of ROMs to be merged
  and added to the emulation context upon success
- Improved descriptions of functions mt32emu_add_rom_data and
  mt32emu_add_rom_file to mention the fact that they only handle full
  ROM images yet to highlight the requirement wrt. memory allocation
  of the ROM data array
2021-02-11 23:56:47 +02:00
sergm
3d94173733 Further extended ROMImage API (#44)
- Added method ROMImage::isFileUserProvided to make memory cleanup easier
  wrt. freeing the File of a ROMImage which may not be created internally
  as with ROMImages merged from partial ones
- Minor formatting fix in ROMImage
- Mentioned that full ROMImages are required in description of Synth::open
2021-02-11 23:12:21 +02:00
sergm
5a44b4dc57 libmt32emu: fixed Cflags definition in the pkg-config file
that apparently advertised wrong directory, making all the public
headers global. This is never the intended way and the consumer application
is instead supposed to include headers from the library directory, likewise:

#include <mt32emu/mt32emu.h>
2021-02-10 19:18:56 +02:00
sergm
9b9a7d3388 Made shortName fields of partial ROMInfos distinct
so that they can still be used as identifiers of ROMImages
2021-02-07 11:51:33 +02:00
sergm
cfa8ab9eb8 In classes ROMInfo and ROMImage, added support for partial ROM images #44
- Added metadata describing raw bitwise ROM dumps from supported hardware
  models
- New overloaded methods enable finding a ROMInfo and creating a ROMImage
  for a given File and a subset of known ROMInfos, e.g. filtered by type
  and/or pairType
- New methods facilitate creation of a full ROM image from a couple
  of the respective partial ones
2021-02-07 10:03:30 +02:00
sergm
fdc24a2acd Symbol versioning for libmt32emu #46
Added support for documenting easily the exact library version
when a particular exported symbol was introduced. This will help
an application developer to quickly find the version requirements
yet adds a possibility to generate version map files automatically
for platforms that support symbol versioning.
2021-02-06 17:10:27 +02:00
sergm
eb3947b025 Slightly improved pkgconfig support for libmt32emu
- Introduced configuration option libmt32emu_PKGCONFIG_INSTALL_PREFIX.
  Because pkgconfig files reside outside the library directory on some
  systems, we have to allow the packager to specify pkgconfig prefix
  separately.
- The pkgconfig file is no longer included in Runtime packages with shared
  library, as is commonly adopted by popular Linux distros.
2021-01-30 23:14:26 +02:00
Dominik Reichardt
030495a8d9 Generate and install a pkg-config file (#43)
* Generate and install a pkg-config file

* revised the pkg-config template some more
2021-01-30 21:29:34 +02:00
sergm
f7a5ac8706 Further improved packaging of libmt32emu on Linux
When creating a Devel package for shared library in DEB and RPM formats,
the package name and resulting package file name are now adjusted
automatically (still, not splitting stuff into several cmake components).
2021-01-30 14:35:47 +02:00
sergm
fd667b1c89 Unified the naming scheme for generated package files 2021-01-30 10:55:55 +02:00
sergm
29e9ff37ec Fixed software license information in generated RPM packages 2021-01-30 10:14:10 +02:00
sergm
2caba8b87c Improved cmake script of libmt32emu wrt. packaging
The advanced option libmt32emu_PACKAGE_TYPE is now possible to select
regardless whether a static or shared library is built. For static builds,
values Complete and Devel are identical but for Runtime, documentation
files are only added to the package.

This permits somewhat better build experience when using the top-level
CMakeLists.txt script. Specifically, it is now easy to omit development
files and build both components mt32emu_qt and mt32emu_smf2wav statically
linked with the library with just a single cmake command like

  cmake -Dlibmt32emu_PACKAGE_TYPE=Runtime .
2021-01-26 21:15:18 +02:00
sergm
7a941bdc32 Added a comment wrt. a workaround in cmake build script for OS/2 2021-01-26 21:03:23 +02:00
sergm
2ec9dbb2bb Bumped versions:
- mt32emu 2.4.2
- mt32emu_qt 1.8.0
- mt32emu_smf2wav 1.6.0
- mt32emu_win32drv 1.6.0
2021-01-17 15:16:00 +02:00
sergm
cbbf84a396 Bumped copyright year 2021-01-17 12:20:07 +02:00
sergm
b83ae8edfb Updated references to README.txt -> README.md 2021-01-10 13:44:50 +02:00
sergm
785fb8cc37 Refreshed READMEs which are now provided in the markdown format 2021-01-09 21:59:59 +02:00
sergm
2f0215d9bf Fixed the preprocessor directive in FileStream 2020-10-31 20:39:53 +02:00
sergm
ff1d7742bc Minor code cleanup after commit da082cb8e0 2020-10-31 14:13:59 +02:00
Serg M
88baf4767a Merge pull request #42 from lotharsm/fix-warnings
Silence GCC compiler warnings
2020-10-26 17:49:12 +02:00
Lothar Serra Mari
b94e4f9de1 Silence GCC compiler warnings 2020-10-25 17:16:25 +01:00
sergm
da082cb8e0 Reworked the support for accessing ROM files with localised pathnames
introduced in libmt32emu version 2.3.0

Since it is not really necessary in majority of cases but may nevertheless
update global C and C++ locale settings, it must now be explicitly enabled
with the new Cmake option libmt32emu_INSTALL_DEFAULT_LOCALE. Also, it no
longer touches the global C++ locale even if enabled, since that appears
to have no positive effect. So far, it has been found useful for building
shared library with some old versions of MS VC when linking C runtime
statically.

Also, mt32emu-qt now only initialises C locale upon startup.
2020-10-25 17:53:53 +02:00
sergm
bf996c9844 Added a temporary workaround for the code that sets default C++ locale
that fails to work with the cygwin and the OS/2 gcc ports
2020-10-14 09:05:52 +03:00
sergm
bcf9bd6374 Now using native gcc's dllexport / dllimport attributes for OS/2 builds 2020-10-13 22:11:07 +03:00
KO Myung-Hun
8a9834cfc6 Define MT32EMU_EXPORT_ATTRIBUTE on OS/2 2020-10-08 19:57:32 +09:00
KO Myung-Hun
455d94e47b Do not set CMAKE_CXX_VISIBILITY_PRESET to hidden on OS/2
Without this, a bunch of warnings is generated like:

-----
[  3%] Building CXX object mt32emu/CMakeFiles/mt32emu.dir/src/Analog.cpp.o
In file included from F:/lang/work/OpenDUNE/munt.git/mt32emu/src/Analog.cpp:22:
F:/lang/work/OpenDUNE/munt.git/mt32emu/src/Analog.h: In destructor 'MT32Emu::Analog::~Analog()':
F:/lang/work/OpenDUNE/munt.git/mt32emu/src/Analog.h:41:21: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
   41 |  virtual ~Analog() {}
      |                     ^
-----
2020-10-08 19:57:25 +09:00
sergm
8aa0a7b956 Released mt32emu version 2.4.1
- Updated NEWS.txt
2020-10-07 22:35:28 +03:00
sergm
00c7db7491 Fixed a bug in libmt32emu that caused loss of the least significant bit
of PCM samples loaded from ROMs. Spotted by clearcase and reported at
https://www.vogons.org/viewtopic.php?f=40&t=76940
2020-10-07 22:32:13 +03:00
sergm
f2bf654695 Released mt32emu version 2.4.0
- Updated NEWS.txt
- Bumped copyright year
2020-03-29 14:59:36 +03:00
sergm
8e42f47425 Added a comment in BufferedSysexDataStorage::allocate
as to why we assume a non-atomic update of the buffer
startPosition and endPosition to be safe
2020-03-29 14:31:28 +03:00
sergm
f97fa40dbe Fixed compilation of the library headers in C mode 2020-02-27 22:50:28 +02:00
sergm
81a0ea35ad Bumped version 2.4.0 of mt32emu library 2020-02-22 15:11:25 +02:00
sergm
04e6234a65 Fixed yet another memory leak in MidiEventQueue dtor 2020-02-22 14:55:13 +02:00
sergm
07dc13230a Finialised API for MIDI event queue configuration
- Synth class now exposes method
  configureMIDIEventQueueSysexStorage(Bit32u) to select between
  the available storage models and for setting the buffer size.
- Both setMIDIEventQueueSize and configureMIDIEventQueueSysexStorage
  can now apply their respective settings while the Synth object
  is closed. This way extra reallocations of the MidiEventQueue
  can be avoided. Note, the effect of setMIDIEventQueueSize now
  persists Synth reopenings.
- Minor cleanup to related method and functions.
2020-02-22 12:31:39 +02:00
sergm
51a5588987 Fixed a memory leak in ~MidiEventQueue introduced in 1ea0469877 2020-02-09 22:21:32 +02:00
sergm
1ea0469877 Refactored MidiEventQueue
Introduced helper interface SysexDataStorage that facilitates
various ways the SysEx data is stored. Specifically,
along with the dynamic memory allocation, a storage buffer
can now be preallocated and used to keep the SysEx data
of the MIDI event stored on the queue. This makes it possible
to push MIDI events to the queue even from a realtime thread.
2019-08-25 16:31:57 +03:00
sergm
adf0331bef More code cleanup wrt. reverb models handling 2019-08-21 21:57:20 +03:00
sergm
8740f58b3e Converted compiler definition MT32EMU_REDUCE_REVERB_MEMORY to a runtime
configuration option. This allows the client to ensure that reverb mode
changes are safe for rendering in a realtime thread.
2019-08-20 21:46:36 +03:00
sergm
538a3b6b0e - Bumped copyright year
- Updated docs
2019-04-21 09:57:52 +03:00