mirror of
https://github.com/ZDoom/ZMusic.git
synced 2025-04-07 01:42:11 +00:00
Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
|
6928b8609d | ||
|
f6facdaa68 | ||
|
7e369774d5 | ||
|
4cc05f7584 | ||
|
628cd49221 | ||
|
7062053c04 | ||
|
3944bbc756 | ||
|
519b76b6e7 |
5 changed files with 67 additions and 17 deletions
14
.github/workflows/continuous_integration.yml
vendored
14
.github/workflows/continuous_integration.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -43,6 +43,8 @@ private:
|
|||
static sf_count_t file_tell(void *user_data);
|
||||
};
|
||||
|
||||
#else
|
||||
#include "../thirdparty/sndfile.h"
|
||||
#endif
|
||||
|
||||
#endif /* SNDFILE_DECODER_H */
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue