Commit 8b759eb4 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

mikmod: remove ancient unported plugin

This hasn't been touched in 11 years, and
clearly no one's been missing it.
parent 0dcd7644
......@@ -52,12 +52,6 @@ else
LIBPNG_DIR =
endif
# if USE_MIKMOD
# MIKMOD_DIR = mikmod
# else
MIKMOD_DIR =
# endif
if USE_DV1394
DV1394_DIR = raw1394
else
......@@ -119,7 +113,6 @@ SUBDIRS = \
$(LIBDV_DIR) \
$(LIBMNG_DIR) \
$(LIBPNG_DIR) \
$(MIKMOD_DIR) \
$(PULSE_DIR) \
$(SHOUT2_DIR) \
$(SOUP_DIR) \
......
plugin_LTLIBRARIES = libgstmikmod.la
libgstmikmod_la_SOURCES = gstmikmod.c drv_gst.c mikmod_reader.c
libgstmikmod_la_CFLAGS = $(GST_CFLAGS) $(MIKMOD_CFLAGS)
libgstmikmod_la_LIBADD = $(GST_LIBS) $(MIKMOD_LIBS)
libgstmikmod_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstmikmod_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = gstmikmod.h
EXTRA_DIST = README
Hi,
This is the gstreamer MikMod plugin. It is able to play the IT, XM, S3M,
MTM, 669, STM, ULT, FAR, MED, AMF, DSM, IMF, GDM, STX, OKT and of course MOD
module formats.
Take a look to : http://mikmod.raphnet.net/
Usage : gstreamer-launch filesrc location=foo.mod ! mikmod ! osssink
or gst-player foo.mod
Properties :
musicvolume :
Volume of the module. Allowed values range from 0 to 128. The default value is 128.
pansep :
Stereo channels separation. Allowed values range from 0 (no separation, thus mono sound)
to 128 (full channel separation). The default value is 128.
reverb :
Amount of sound reverberation. Allowed values range from 0 (no reverberation) to 15
(a rough estimate for chaos...). The default value is 6.
sndfxvolume :
Volume of the sound effects. Allowed values range from 0 to 128. The default value is 128.
volume :
Overall sound volume. Allowed values range from 0 to 128. The default value is 96
interp :
This flag, if set, enables the interpolated mixers. Interpolated mixing gives better
sound but takes a bit more time than standard mixing. If the library is built with the
high quality mixer, interpolated mixing is always enabled, regardless of this flag. The
default value is false.
reverse :
This flag, if set, exchanges the left and right stereo channels. The default value is false.
surround :
This flag, if set, enables the surround mixers. Since surround mixing works only for stereo
sound, this flag has no effect if the sound playback is in mono. The default value is true.
16bit :
This flag, if set, selects 16 bit sound mode. This mode yields better sound quality, but needs
twice more mixing time. The default value is true.
hqmixer :
This flag, if set, selects the high-quality software mixer. This mode yields better sound quality,
but needs more mixing time. Of course, this flag has no effect if no DMODE_SOFT_xx flag is set.
The default value is false.
soft_music :
This flag, if set, selects software mixing of the module. The default value is true.
soft_sndfx :
This flag, if set, selects software mixing of the sound effects. The default value is true.
stereo :
This flag, if set, selects stereo sound. The default value is true.
--
Apoc
/* MikMod sound library
(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS
for complete list.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include "gstmikmod.h"
static int buffer_size;
static SBYTE *audiobuffer = NULL;
extern int need_sync;
static BOOL
mikmod_IsThere (void)
{
return 1;
}
static BOOL
mikmod_Init (void)
{
buffer_size = 32768;
if (!(audiobuffer = (SBYTE *) g_malloc (buffer_size)))
return 1;
return VC_Init ();
}
static void
mikmod_Exit (void)
{
VC_Exit ();
if (audiobuffer) {
g_free (audiobuffer);
audiobuffer = NULL;
}
}
static void
mikmod_Update (void)
{
gint length;
GstBuffer *outdata;
length = VC_WriteBytes ((SBYTE *) audiobuffer, buffer_size);
outdata = gst_buffer_new ();
GST_BUFFER_DATA (outdata) = g_memdup (audiobuffer, length);
GST_BUFFER_SIZE (outdata) = length;
GST_BUFFER_TIMESTAMP (outdata) = timestamp;
if (need_sync == 1) {
/* FIXME, send a flush event or something */
need_sync = 0;
}
gst_pad_push (srcpad, GST_DATA (outdata));
}
static BOOL
mikmod_Reset (void)
{
VC_Exit ();
return VC_Init ();
}
MDRIVER drv_gst = {
NULL,
"mikmod",
"mikmod output driver v1.0",
0, 255,
#if (LIBMIKMOD_VERSION > 0x030106)
"mikmod",
NULL,
#endif
mikmod_IsThere,
VC_SampleLoad,
VC_SampleUnload,
VC_SampleSpace,
VC_SampleLength,
mikmod_Init,
mikmod_Exit,
mikmod_Reset,
VC_SetNumVoices,
VC_PlayStart,
VC_PlayStop,
mikmod_Update,
NULL,
VC_VoiceSetVolume,
VC_VoiceGetVolume,
VC_VoiceSetFrequency,
VC_VoiceGetFrequency,
VC_VoiceSetPanning,
VC_VoiceGetPanning,
VC_VoicePlay,
VC_VoiceStop,
VC_VoiceStopped,
VC_VoiceGetPosition,
VC_VoiceRealVolume
};
This diff is collapsed.
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_MIKMOD_H__
#define __GST_MIKMOD_H__
#include <mikmod.h>
#include <gst/gst.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_MIKMOD \
(gst_mikmod_get_type())
#define GST_MIKMOD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MIKMOD,GstMikMod))
#define GST_MIKMOD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MIKMOD,GstMikModClass))
#define GST_MIKMOD_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_MIKMOD,GstMikModClass))
#define GST_IS_MIKMOD(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MIKMOD))
#define GST_IS_MIKMOD_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MIKMOD))
struct _GstMikMod {
GstElement element;
GstPad *sinkpad, *srcpad;
GstBuffer *Buffer;
gchar *songname;
gchar *modtype;
gint musicvolume;
gint pansep;
gint reverb;
gint sndfxvolume;
gint volume;
gint mixfreq;
gint mode;
gboolean interp;
gboolean reverse;
gboolean surround;
gboolean _16bit;
gboolean hqmixer;
gboolean soft_music;
gboolean soft_sndfx;
gboolean stereo;
gboolean initialized;
};
struct _GstMikModClass {
GstElementClass parent_class;
};
typedef struct _GstMikMod GstMikMod;
typedef struct _GstMikModClass GstMikModClass;
extern MODULE *module;
extern MREADER *reader;
extern GstPad *srcpad;
extern GstClockTime timestamp;
extern int need_sync;
GType gst_mikmod_get_type(void);
/* symbols for mikmod_reader.h */
struct _GST_READER
{
MREADER core;
GstMikMod *mik;
guint64 offset;
gshort eof;
};
typedef struct _GST_READER GST_READER;
MREADER *GST_READER_new( GstMikMod *mik );
/* symbols for drv_gst.c */
extern MDRIVER drv_gst;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_MIKMOD_H__ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h>
#include <string.h>
#include "gstmikmod.h"
extern int need_sync;
static BOOL GST_READER_Eof (MREADER * reader);
static BOOL GST_READER_Read (MREADER * reader, void *ptr, size_t size);
static int GST_READER_Get (MREADER * reader);
static BOOL GST_READER_Seek (MREADER * reader, long offset, int whence);
static long GST_READER_Tell (MREADER * reader);
static BOOL
GST_READER_Eof (MREADER * reader)
{
GST_READER *gst_reader;
gst_reader = (GST_READER *) reader;
return gst_reader->eof;
}
static BOOL
GST_READER_Read (MREADER * reader, void *ptr, size_t size)
{
GST_READER *gst_reader;
gst_reader = (GST_READER *) reader;
memcpy (ptr, GST_BUFFER_DATA (gst_reader->mik->Buffer) + gst_reader->offset,
size);
gst_reader->offset = gst_reader->offset + size;
return 1;
}
static int
GST_READER_Get (MREADER * reader)
{
GST_READER *gst_reader;
int res;
gst_reader = (GST_READER *) reader;
res = *(GST_BUFFER_DATA (gst_reader->mik->Buffer) + gst_reader->offset);
gst_reader->offset += 1;
return res;
}
static BOOL
GST_READER_Seek (MREADER * reader, long offset, int whence)
{
GST_READER *gst_reader;
gst_reader = (GST_READER *) reader;
if (whence == SEEK_SET)
gst_reader->offset = offset;
else
gst_reader->offset += offset;
return 1;
}
static long
GST_READER_Tell (MREADER * reader)
{
GST_READER *gst_reader;
gst_reader = (GST_READER *) reader;
return gst_reader->offset;
}
MREADER *
GST_READER_new (GstMikMod * mik)
{
GST_READER *gst_reader;
gst_reader = (GST_READER *) g_malloc (sizeof (GST_READER));
if (gst_reader) {
gst_reader->offset = 0;
gst_reader->eof = 0;
gst_reader->mik = mik;
gst_reader->core.Eof = &GST_READER_Eof;
gst_reader->core.Read = &GST_READER_Read;
gst_reader->core.Get = &GST_READER_Get;
gst_reader->core.Seek = &GST_READER_Seek;
gst_reader->core.Tell = &GST_READER_Tell;
}
return (MREADER *) gst_reader;
}
void
GST_READER_free (MREADER * reader)
{
if (reader)
g_free (reader);
}
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include "mikmod_types.h"
#include <string.h> /* memcmp */
#include <ctype.h> /* isdigit */
#define MODULEHEADERSIZE 0x438
gboolean
MOD_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf) + MODULEHEADERSIZE;
/* Protracker and variants */
if ((!memcmp (data, "M.K.", 4)) || (!memcmp (data, "M!K!", 4)))
return TRUE;
/* Star Tracker */
if (((!memcmp (data, "FLT", 3)) || (!memcmp (data, "EXO", 3)))
&& (isdigit (data[3])))
return TRUE;
/* Oktalyzer (Amiga) */
if (!memcmp (data, "OKTA", 4))
return TRUE;
/* Oktalyser (Atari) */
if (!memcmp (data, "CD81", 4))
return TRUE;
/* Fasttracker */
if ((!memcmp (data + 1, "CHN", 3)) && (isdigit (data[0])))
return TRUE;
/* Fasttracker or Taketracker */
if (((!memcmp (data + 2, "CH", 2)) || (!memcmp (data + 2, "CN", 2)))
&& (isdigit (data[0])) && (isdigit (data[1])))
return TRUE;
return FALSE;
}
gboolean
Mod_669_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "if", 2) || !memcmp (data, "JN", 2))
return TRUE;
return FALSE;
}
gboolean
Amf_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (memcmp (data, "AMF", 3))
return FALSE;
data = GST_BUFFER_DATA (buf) + 3;
if (((gint) * data >= 10) && ((gint) * data <= 14))
return TRUE;
return FALSE;
}
gboolean
Dsm_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "RIFF", 4) && !memcmp (data + 8, "DSMF", 4))
return TRUE;
return FALSE;
}
gboolean
Fam_CheckType (GstBuffer * buf)
{
gchar *data;
static const unsigned char FARSIG[4 + 3] =
{ 'F', 'A', 'R', 0xfe, 13, 10, 26 };
data = GST_BUFFER_DATA (buf);
if ((memcmp (data, FARSIG, 4)) || (memcmp (data + 44, FARSIG + 4, 3)))
return FALSE;
return 1;
}
gboolean
Gdm_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "GDM\xfe", 4) && !memcmp (data + 71, "GMFS", 4))
return TRUE;
return FALSE;
}
gboolean
Imf_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf) + 0x3c;
if (!memcmp (data, "IM10", 4))
return TRUE;
return FALSE;
}
gboolean
It_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "IMPM", 4))
return TRUE;
return FALSE;
}
gboolean
M15_CheckType (GstBuffer * buf)
{
/* FIXME: M15 CheckType to do */
return FALSE;
}
gboolean
Med_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if ((!memcmp (data, "MMD0", 4)) || (memcmp (data, "MMD1", 4)))
return TRUE;
return FALSE;
}
gboolean
Mtm_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "MTM", 3))
return TRUE;
return FALSE;
}
gboolean
Okt_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (!memcmp (data, "OKTSONG", 8))
return TRUE;
return FALSE;
}
gboolean
S3m_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf) + 0x2c;
if (!memcmp (data, "SCRM", 4))
return TRUE;
return FALSE;
}
gboolean
Xm_CheckType (GstBuffer * buf)
{
gchar *data;
data = GST_BUFFER_DATA (buf);
if (memcmp (data, "Extended Module: ", 17))
return FALSE;
if (data[37] == 0x1a)
return TRUE;
return FALSE;
}
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __MIKMOD_TYPES_H__
#define __MIKMOD_TYPES_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
gboolean MOD_CheckType (GstBuffer *buf);
gboolean Mod_669_CheckType (GstBuffer *buf);
gboolean Amf_CheckType (GstBuffer *buf);
gboolean Dsm_CheckType (GstBuffer *buf);
gboolean Fam_CheckType (GstBuffer *buf);
gboolean Gdm_CheckType (GstBuffer *buf);
gboolean Imf_CheckType (GstBuffer *buf);
gboolean It_CheckType (GstBuffer *buf);
gboolean M15_CheckType (GstBuffer *buf);
gboolean Mtm_CheckType (GstBuffer *buf);
gboolean Okt_CheckType (GstBuffer *buf);
gboolean S3m_CheckType (GstBuffer *buf);
gboolean Xm_CheckType (GstBuffer *buf);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __MIKMOD_TYPES_H__ */
......@@ -27,7 +27,6 @@ EXTRA_DIST = \
libfame.m4 \
lib-ld.m4 \
lib-link.m4 \
libmikmod.m4 \
lib-prefix.m4 \
ogg.m4 \
progtest.m4 \
......
# Configure paths for libmikmod
#
# Derived from glib.m4 (Owen Taylor 97-11-3)
# Improved by Chris Butler
#
dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
dnl LIBMIKMOD_LDADD
dnl
AC_DEFUN([AM_PATH_LIBMIKMOD],
[dnl
dnl Get the cflags and libraries from the libmikmod-config script