summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rw-r--r--doc/mu-sdl.161
-rw-r--r--doc/mu123.153
-rw-r--r--src/common/common.c4
4 files changed, 125 insertions, 2 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b52d774
--- /dev/null
+++ b/README.md
@@ -0,0 +1,9 @@
+# mu123 and mu-sdl
+
+<!-- the binaries are called mu-portaudio and mu-SDL2 but shush -->
+
+play a song on loop
+
+## rationale
+
+i despise audio players that do not loop tracks correctly, since i always listen to a single song on loop
diff --git a/doc/mu-sdl.1 b/doc/mu-sdl.1
new file mode 100644
index 0000000..4e8e6a9
--- /dev/null
+++ b/doc/mu-sdl.1
@@ -0,0 +1,61 @@
+.Dd September 2, 2024
+.Dt mu-sdl 1
+.Os
+.Sh NAME
+.Nm mu-sdl
+.Nd audio player that never stops meowing
+.Sh SYNOPSIS
+.Nm mu-sdl
+.Op audio file
+.Sh DESCRIPTION
+.Nm
+will play audio files you drag and drop onto its window
+
+currently supported formats:
+.Bl -bullet
+.It
+s3xmodit
+.It
+midi
+.El
+.Sh ENVIRONMENT
+SOUNDFONT
+
+soundfont to use for midi
+.Sh FILES
+/usr/share/sounds/sf2/default-GM.sf2
+
+default soundfont
+.Sh EXAMPLES
+SOUNDFONT=gm.sf2
+.Nm
+e1m1.mid
+
+will play
+.Em e1m1.mid
+on loop with the soundfont
+.Em gm.sf2
+
+you can then hit
+.Em space
+or
+.Em escape
+to pause and quit the program, respectively
+.Sh SEE ALSO
+.Xr mu123 1
+.Xr openmpt123 1
+.Xr out123 1
+.\" .Sh STANDARDS
+.\" .Sh HISTORY
+.Sh AUTHORS
+.An sylvie
+.\" .Sh CAVEATS
+.Sh BUGS
+loading midi files leaks ~15KB of memory each time
+
+i have no idea how to fix that
+
+.\" there is also a crash i couldnt reproduce .\" i think i fixed it
+
+.\" .Sh SECURITY CONSIDERATIONS
+.\" Not used in OpenBSD.
diff --git a/doc/mu123.1 b/doc/mu123.1
new file mode 100644
index 0000000..939467a
--- /dev/null
+++ b/doc/mu123.1
@@ -0,0 +1,53 @@
+.Dd September 2, 2024
+.Dt mu123 1
+.Os
+.Sh NAME
+.Nm mu123
+.Nd audio player that never stops meowing
+.Sh SYNOPSIS
+.Nm mu123
+.Ar audio file
+.Sh DESCRIPTION
+.Nm
+will play the audio file you pass to it
+
+currently supported formats:
+.Bl -bullet
+.It
+s3xmodit
+.It
+midi
+.El
+.Sh ENVIRONMENT
+SOUNDFONT
+
+soundfont to use for midi
+.Sh FILES
+/usr/share/sounds/sf2/default-GM.sf2
+
+default soundfont
+.Sh EXAMPLES
+SOUNDFONT=gm.sf2
+.Nm
+e1m1.mid
+
+will play
+.Em e1m1.mid
+on loop with the soundfont
+.Em gm.sf2
+.Sh SEE ALSO
+.Xr mu-sdl 1
+.Xr openmpt123 1
+.Xr out123 1
+.\" .Sh STANDARDS
+.\" .Sh HISTORY
+.Sh AUTHORS
+.An sylvie
+.\" .Sh CAVEATS
+.Sh BUGS
+loading midi files leaks ~15KB of memory each time
+
+i have no idea how to fix that
+
+.\" .Sh SECURITY CONSIDERATIONS
+.\" Not used in OpenBSD.
diff --git a/src/common/common.c b/src/common/common.c
index 508140d..3fb1c6a 100644
--- a/src/common/common.c
+++ b/src/common/common.c
@@ -8,9 +8,9 @@
 int (*file_ext(char *file))(struct blob *, struct userdata *) {
 	size_t len = strlen(file);
 	#define ext(extension) memcmp(file + len - sizeof (extension) + 1, extension, sizeof (extension))
-	if ((ext(".mptm") && ext(".mod") && ext(".xm") && ext(".s3m") && ext(".it")) == 0) {
+	if ((ext(".mptm") && ext(".mod") && ext(".MOD") && ext(".xm") && ext(".s3m") && ext(".it")) == 0) {
 		return module_openmpt;
-	} else if ((ext(".mid") && ext(".midi")) == 0) {
+	} else if ((ext(".mid") && ext(".MID") && ext(".midi")) == 0) {
 		return module_fluidsynth;
 	}
 	#undef ext