From 65d238684960ac08174682eea93b4fb391cfe84c Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 3 Oct 2023 14:25:56 +0300
Subject: [PATCH] add gme_set_fade_msecs to avoid gme_set_fade abi change,
and revert SOVERSION bump, change version down to 0.6.4.
---
CMakeLists.txt | 2 +-
gme.txt | 2 +-
gme/CMakeLists.txt | 2 +-
gme/gme.cpp | 3 ++-
gme/gme.h | 13 +++++++++----
player/Music_Player.cpp | 4 ++--
readme.txt | 2 +-
7 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4dc8582..6e0e288 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ include (CheckCXXCompilerFlag)
include (CTest)
# When version is changed, also change the one in gme/gme.h to match
-set(GME_VERSION 0.7.0 CACHE INTERNAL "libgme Version")
+set(GME_VERSION 0.6.4 CACHE INTERNAL "libgme Version")
# Default emulators to build (all of them! ;)
if (NOT DEFINED USE_GME_AY)
diff --git a/gme.txt b/gme.txt
index cbddf7f..30615b2 100644
--- a/gme.txt
+++ b/gme.txt
@@ -1,4 +1,4 @@
-Game_Music_Emu 0.7.0
+Game_Music_Emu 0.6.4
--------------------
Author : Shay Green <gblargg@gmail.com>
Maintainer : Michael Pyne <mpyne@purinchu.net>
diff --git a/gme/CMakeLists.txt b/gme/CMakeLists.txt
index f6399c3..46a58bd 100644
--- a/gme/CMakeLists.txt
+++ b/gme/CMakeLists.txt
@@ -201,7 +201,7 @@ endif()
# Hopefully the API can stay compatible with old versions.
set_target_properties(gme
PROPERTIES VERSION ${GME_VERSION}
- SOVERSION 1)
+ SOVERSION 0)
# macOS framework build
if(BUILD_FRAMEWORK)
diff --git a/gme/gme.cpp b/gme/gme.cpp
index 72741da..57ccdf7 100644
--- a/gme/gme.cpp
+++ b/gme/gme.cpp
@@ -380,7 +380,8 @@ void gme_set_user_cleanup(Music_Emu* me, gme_user_cleanup_t func ) { me->se
gme_err_t gme_start_track ( Music_Emu* me, int index ) { return me->start_track( index ); }
gme_err_t gme_play ( Music_Emu* me, int n, short* p ) { return me->play( n, p ); }
-void gme_set_fade ( Music_Emu* me, int start_msec, int fade_msec ) { me->set_fade( start_msec, fade_msec ); }
+void gme_set_fade ( Music_Emu* me, int start_msec ) { me->set_fade( start_msec ); }
+void gme_set_fade_msecs ( Music_Emu* me, int start_msec, int fade_msec ) { me->set_fade( start_msec, fade_msec ); }
int gme_track_ended ( Music_Emu const* me ) { return me->track_ended(); }
int gme_tell ( Music_Emu const* me ) { return me->tell(); }
int gme_tell_samples ( Music_Emu const* me ) { return me->tell_samples(); }
diff --git a/gme/gme.h b/gme/gme.h
index ef1d851..6920c73 100644
--- a/gme/gme.h
+++ b/gme/gme.h
@@ -1,6 +1,6 @@
/* Game music emulator library C interface (also usable from C++) */
-/* Game_Music_Emu 0.7.0 */
+/* Game_Music_Emu 0.6.4 */
#ifndef GME_H
#define GME_H
@@ -8,7 +8,7 @@
extern "C" {
#endif
-#define GME_VERSION 0x000700 /* 1 byte major, 1 byte minor, 1 byte patch-level */
+#define GME_VERSION 0x000604 /* 1 byte major, 1 byte minor, 1 byte patch-level */
/* Error string returned by library functions, or NULL if no error (success) */
typedef const char* gme_err_t;
@@ -55,7 +55,12 @@ BLARGG_EXPORT void gme_delete( Music_Emu* );
/* Set time to start fading track out. Once fade ends track_ended() returns true.
Fade time can be changed while track is playing. */
-BLARGG_EXPORT void gme_set_fade( Music_Emu*, int start_msec, int length_msec );
+BLARGG_EXPORT void gme_set_fade( Music_Emu*, int start_msec );
+
+/** See gme_set_fade.
+ * @since 0.6.4
+ */
+BLARGG_EXPORT void gme_set_fade_msecs( Music_Emu*, int start_msec, int length_msecs );
/**
* If do_autoload_limit is nonzero, then automatically load track length
@@ -174,7 +179,7 @@ voices, 0 unmutes them all, 0x01 mutes just the first voice, etc. */
BLARGG_EXPORT void gme_mute_voices( Music_Emu*, int muting_mask );
/* Disable/Enable echo effect for SPC files */
-/* Available since 0.7.0 */
+/* Available since 0.6.4 */
BLARGG_EXPORT void gme_disable_echo( Music_Emu*, int disable );
/* Frequency equalizer parameters (see gme.txt) */
diff --git a/player/Music_Player.cpp b/player/Music_Player.cpp
index 4430c3c..5df7e61 100644
--- a/player/Music_Player.cpp
+++ b/player/Music_Player.cpp
@@ -151,7 +151,7 @@ gme_err_t Music_Player::start_track( int track )
if ( track_info_->length <= 0 )
track_info_->length = (long) (2.5 * 60 * 1000);
- gme_set_fade( emu_, track_info_->length, 8000 );
+ gme_set_fade_msecs( emu_, track_info_->length, 8000 );
paused = false;
sound_start();
@@ -223,7 +223,7 @@ void Music_Player::mute_voices( int mask )
void Music_Player::set_fadeout( bool fade )
{
- gme_set_fade( emu_, fade ? track_info_->length : -1, 8000 );
+ gme_set_fade_msecs( emu_, fade ? track_info_->length : -1, 8000 );
}
void Music_Player::fill_buffer( void* data, sample_t* out, int count )
diff --git a/readme.txt b/readme.txt
index ab599df..eb3b560 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,4 +1,4 @@
-Game_Music_Emu 0.7.0: Game Music Emulators
+Game_Music_Emu 0.6.4: Game Music Emulators
------------------------------------------
Game_Music_Emu is a collection of video game music file emulators that
support the following formats and systems: