Compare commits

...

8 commits

Author SHA1 Message Date
James Le Cuirot
6928b8609d Fix building with no sndfile support at all
The stub functions still reference SNDFILE, so we still need to include
the bundled header in this case.
2025-03-09 18:25:42 +01:00
Andrew Rabert
f6facdaa68 Fix libxmp playback
Fixes crashing when the int16_buffer is smaller than the desired len.
Particularly, I was seeing the int16_buffer with a size of 0.
2025-01-11 17:09:53 +01:00
alexey.lysiuk
7e369774d5 always install glib for linux jobs of github action workflow
this fixes the following error when configuring linux dynamic dependencies jobs
CMake Error at /usr/local/share/cmake-3.31/Modules/FindPkgConfig.cmake:938 (message):
  None of the required 'glib-2.0' found
Call Stack (most recent call first):
  thirdparty/fluidsynth/src/CMakeLists.txt:158 (pkg_search_module)
2025-01-11 11:53:42 +02:00
Christoph Oelckers
4cc05f7584 bring both version of the DUMB license in sync. 2025-01-10 17:13:50 +01:00
Rachael Alexanderson
628cd49221
Merge pull request #63 from Cacodemon345/patch-3
libxmp backend: Set starting subsong correctly
2024-11-23 06:15:07 -05:00
Cacodemon345
7062053c04
libxmp backend: Set starting subsong correctly 2024-11-23 15:01:25 +06:00
Christoph Oelckers
3944bbc756 allow both libsndfile-1.dll and sndfile.dll when dynamically loading the library.
sndfile.dll is the official name so this should be checked as well.
2024-10-13 07:51:31 +02:00
alexey.lysiuk
519b76b6e7 - updated github actions workflow
* fix warnings
* add upload artifacts step (disabled by default because of warnings it reported on every symlink inside installation directory)
2024-10-10 13:01:13 +03:00
5 changed files with 67 additions and 17 deletions

View file

@ -21,17 +21,17 @@ jobs:
- name: macOS Clang - Dynamic Deps
os: macos-latest
build_type: Release
deps_cmd: brew install glib pkg-config
- name: macOS Clang - Static Deps
os: macos-latest
build_type: Release
cmake_options: -DDYN_FLUIDSYNTH=OFF -DDYN_MPG123=OFF -DDYN_SNDFILE=OFF
deps_cmd: brew install glib libsndfile mpg123 pkg-config
deps_cmd: brew install libsndfile mpg123
- name: Linux GCC - Dynamic Deps
os: ubuntu-latest
build_type: Release
deps_cmd: sudo apt update && sudo apt install libglib2.0-dev
- name: Linux GCC - Static Deps
os: ubuntu-latest
@ -43,6 +43,7 @@ jobs:
os: ubuntu-latest
build_type: Release
cmake_options: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
deps_cmd: sudo apt update && sudo apt install libglib2.0-dev
- name: Linux Clang - Static Deps
os: ubuntu-latest
@ -51,7 +52,7 @@ jobs:
deps_cmd: sudo apt update && sudo apt install libasound2-dev libglib2.0-dev libmpg123-dev libsndfile1-dev
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Dependencies
shell: bash
@ -87,3 +88,10 @@ jobs:
else
./list_midi_devices
fi
- name: Upload Install Directory
if: false # Remove this line to upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.name }}
path: build_install

View file

@ -18,9 +18,9 @@
*/
Dynamic Universal Music Bibliotheque
Dynamic Universal Music Bibliotheque, Version 0.9.3
Copyright (C) 2001-2003 Ben Davis, Robert J Ohannessian and Julien Cugniere
Copyright (C) 2001-2005 Ben Davis, Robert J Ohannessian and Julien Cugniere
This software is provided 'as-is', without any express or implied warranty.
In no event shall the authors be held liable for any damages arising from the
@ -39,16 +39,49 @@ freely, subject to the following restrictions:
[Note that the above point asks for a link to DUMB, not just a mention.
Googling for DUMB doesn't help much! The URL is "http://dumb.sf.net/".]
[The only reason why the link is not strictly required is that such a
requirement prevents DUMB from being used in projects with certain other
licences, notably the GPL. See http://www.gnu.org/philosophy/bsd.html .]
[The link was originally strictly required. This was changed for two
reasons. Firstly, if many projects request an acknowledgement, the list of
acknowledgements can become quite unmanageable. Secondly, DUMB was placing
a restriction on the code using it, preventing people from using the GNU
General Public Licence which disallows any such restrictions. See
http://www.gnu.org/philosophy/bsd.html for more information on this
subject. However, if DUMB plays a significant part in your project, we do
urge you to acknowledge its use.]
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed from or altered in any source distribution.
4. If you are using the Program in someone else's bedroom at any Monday
3:05 PM, you are not allowed to modify the Program for ten minutes. [This
4. If you are using the Program in someone else's bedroom on any Monday at
3:05 pm, you are not allowed to modify the Program for ten minutes. [This
clause provided by Inphernic; every licence should contain at least one
clause, the reasoning behind which is far from obvious.]
5. Users who wish to use DUMB for the specific purpose of playing music are
required to feed their dog on every full moon (if deemed appropriate).
[This clause provided by Allefant, who couldn't remember what Inphernic's
clause was.]
6. No clause in this licence shall prevent this software from being depended
upon by a product licensed under the GNU General Public Licence. If such a
clause is deemed to exist, Debian, then it shall be respected in spirit as
far as possible and all other clauses shall continue to apply in full
force.
8. Take the number stated as introducing this clause. Multiply it by two,
then subtract four. Now insert a '+' between the two digits and evaluate
the resulting sum. Call the result 'x'. If you have not yet concluded that
every numbered clause in this licence whose ordinal number is strictly
greater than 'x' (with the exception of the present clause) is null and
void, Debian, then you are hereby informed that laughter is good for one's
health and you are warmly suggested to do it. By the way, Clauses 4, 5 and
6 are null and void. Incidentally, I like Kubuntu. The work you guys do is
awesome. (Lawyers, on the other hand ...)
We regret that we cannot provide any warranty, not even the implied warranty
of merchantability or fitness for a particular purpose.
Some files generated or copied by automake, autoconf and friends are
available in an extra download. These fall under separate licences but are
all free to distribute. Please check their licences as necessary.

View file

@ -43,11 +43,11 @@ FModule SndFileModule{"SndFile"};
#ifdef _WIN32
#define SNDFILELIB "libsndfile-1.dll"
static const char* libnames[] = { "sndfile.dll", "libsndfile-1.dll" };
#elif defined(__APPLE__)
#define SNDFILELIB "libsndfile.1.dylib"
static const char* libnames[] = { "libsndfile.1.dylib" };
#else
#define SNDFILELIB "libsndfile.so.1"
static const char* libnames[] = { "libsndfile.so.1" };
#endif
extern "C" int IsSndFilePresent()
@ -61,8 +61,12 @@ extern "C" int IsSndFilePresent()
if (!done)
{
done = true;
auto abspath = FModule_GetProgDir() + "/" SNDFILELIB;
cached_result = SndFileModule.Load({abspath.c_str(), SNDFILELIB});
for (auto libname : libnames)
{
auto abspath = FModule_GetProgDir() + "/" + libname;
cached_result = SndFileModule.Load({ abspath.c_str(), libname });
if (cached_result) break;
}
}
return cached_result;
#endif

View file

@ -43,6 +43,8 @@ private:
static sf_count_t file_tell(void *user_data);
};
#else
#include "../thirdparty/sndfile.h"
#endif
#endif /* SNDFILE_DECODER_H */

View file

@ -126,7 +126,7 @@ bool XMPSong::SetSubsong(int subsong)
bool XMPSong::GetData(void *buffer, size_t len)
{
if ((len / 4) < int16_buffer.size())
if ((len / 4) > int16_buffer.size())
int16_buffer.resize(len / 4);
int ret = xmp_play_buffer(context, (void*)int16_buffer.data(), len / 2, m_Looping? INT_MAX : 0);
@ -153,7 +153,10 @@ bool XMPSong::GetData(void *buffer, size_t len)
bool XMPSong::Start()
{
return xmp_start_player(context, samplerate, 0) >= 0;
int ret = xmp_start_player(context, samplerate, 0);
if (ret >= 0)
xmp_set_position(context, subsong);
return ret >= 0;
}
StreamSource* XMP_OpenSong(MusicIO::FileInterface* reader, int samplerate)