summaryrefslogtreecommitdiffstats
path: root/gst/nsf/nsf.h
diff options
context:
space:
mode:
Diffstat (limited to 'gst/nsf/nsf.h')
-rw-r--r--gst/nsf/nsf.h69
1 files changed, 56 insertions, 13 deletions
diff --git a/gst/nsf/nsf.h b/gst/nsf/nsf.h
index 2f960367..d81bb6fc 100644
--- a/gst/nsf/nsf.h
+++ b/gst/nsf/nsf.h
@@ -60,7 +60,8 @@ enum
{
NSF_FILTER_NONE,
NSF_FILTER_LOWPASS,
- NSF_FILTER_WEIGHTED
+ NSF_FILTER_WEIGHTED,
+ NSF_FILTER_MAX, /* $$$ ben : add this one for range chacking */
};
typedef struct nsf_s
@@ -90,6 +91,14 @@ typedef struct nsf_s
uint8 current_song; /* current song */
boolean bankswitched; /* is bankswitched? */
+ /* $$$ ben : Playing time ... */
+ uint32 cur_frame;
+ uint32 cur_frame_end;
+ uint32 * song_frames;
+
+ /* $$$ ben : Last error string */
+ const char * errstr;
+
/* CPU and APU contexts */
nes6502_context *cpu;
apu_t *apu;
@@ -98,26 +107,49 @@ typedef struct nsf_s
void (*process)(void *buffer, int num_samples);
} nsf_t;
+/* $$$ ben : Generic loader struct */
+struct nsf_loader_t {
+ /* Init and open. */
+ int (*open)(struct nsf_loader_t * loader);
+
+ /* Close and shutdown. */
+ void (*close) (struct nsf_loader_t * loader);
+
+ /* This function should return <0 on error, else the number of byte NOT read.
+ * that way a simple 0 test tell us if read was complete.
+ */
+ int (*read) (struct nsf_loader_t * loader, void *data, int n);
+
+ /* Get file length. */
+ int (*length) (struct nsf_loader_t * loader);
+
+ /* Skip n bytes. */
+ int (*skip) (struct nsf_loader_t * loader,int n);
+
+ /* Get filename (for debug). */
+ const char * (*fname) (struct nsf_loader_t * loader);
+
+};
+
/* Function prototypes */
-extern void nsf_init(void);
+extern int nsf_init(void);
-extern nsf_t *nsf_load(char *filename, void *source, int length);
+extern nsf_t * nsf_load_extended(struct nsf_loader_t * loader);
+extern nsf_t *nsf_load(const char *filename, void *source, int length);
extern void nsf_free(nsf_t **nsf_info);
-extern void nsf_playtrack(nsf_t *nsf, int track, int sample_rate, int sample_bits,
- boolean stereo);
+extern int nsf_playtrack(nsf_t *nsf, int track, int sample_rate,
+ int sample_bits, boolean stereo);
extern void nsf_frame(nsf_t *nsf);
-extern void nsf_setchan(nsf_t *nsf, int chan, boolean enabled);
-extern void nsf_setfilter(nsf_t *nsf, int filter_type);
+extern int nsf_setchan(nsf_t *nsf, int chan, boolean enabled);
+extern int nsf_setfilter(nsf_t *nsf, int filter_type);
#endif /* _NSF_H_ */
/*
** $Log$
-** Revision 1.1 2006/07/13 15:07:28 wtay
-** Based on patches by: Johan Dahlin <johan at gnome dot org>
-** Ronald Bultje <rbultje at ronald dot bitfreak dot net>
-** * configure.ac:
+** Revision 1.2 2008/03/25 15:56:12 slomo
+** Patch by: Andreas Henriksson <andreas at fatal dot set>
** * gst/nsf/Makefile.am:
** * gst/nsf/dis6502.h:
** * gst/nsf/fds_snd.c:
@@ -125,7 +157,6 @@ extern void nsf_setfilter(nsf_t *nsf, int filter_type);
** * gst/nsf/fmopl.c:
** * gst/nsf/fmopl.h:
** * gst/nsf/gstnsf.c:
-** * gst/nsf/gstnsf.h:
** * gst/nsf/log.c:
** * gst/nsf/log.h:
** * gst/nsf/memguard.c:
@@ -144,7 +175,19 @@ extern void nsf_setfilter(nsf_t *nsf, int filter_type);
** * gst/nsf/vrc7_snd.h:
** * gst/nsf/vrcvisnd.c:
** * gst/nsf/vrcvisnd.h:
-** Added NSF decoder plugin. Fixes 151192.
+** Update our internal nosefart to nosefart-2.7-mls to fix segfaults
+** on some files. Fixes bug #498237.
+** Remove some // comments, fix some compiler warnings and use pow()
+** instead of a slow, selfmade implementation.
+**
+** Revision 1.3 2003/05/01 22:34:20 benjihan
+** New NSF plugin
+**
+** Revision 1.2 2003/04/09 14:50:32 ben
+** Clean NSF api.
+**
+** Revision 1.1 2003/04/08 20:53:00 ben
+** Adding more files...
**
** Revision 1.11 2000/07/04 04:59:24 matt
** removed DOS-specific stuff