The decoder_plugin_ops structure

The decoder_plugin_ops structure that is returned by the Instantiate_Plugin function and defines an instance of a decoder plugin, is defined as:
  typedef status_t	op_decoder_open(void*,const char *name, const char *header, uint32 size);
  typedef void		op_decoder_close(void*);
  typedef status_t	op_decoder_info(void*,file_info*);
  typedef int32		op_decoder_read(void *,char *buf, ulong framecount);
  typedef status_t	op_decoder_play(void*);
  typedef status_t	op_decoder_stop(void*);
  typedef status_t	op_decoder_setvolume(void*,float);
  typedef status_t	op_decoder_setspeed(void *,float speed);
  typedef status_t	op_decoder_seek(void*, uint32 pos);
  typedef uint32	op_decoder_position(void*);
  typedef float		op_decoder_bufferamount(void*);

  typedef struct decoder_plugin_ops
  {
	uint32			ops_magic;	// magic number
	uint32			ops_version;	// version of this plugin structure

	op_decoder_open		(*Open);	// leave NULL if not implemented
	op_decoder_close	(*Close);	// leave NULL if not implemented
	op_decoder_info		(*Info);	// MUST be implemented
	op_decoder_read		(*Read);	// leave NULL for decoders that don't produce data
	op_decoder_play		(*Play);	// leave NULL if you do provide data
	op_decoder_stop		(*Stop);	// leave NULL if you do provide data
	op_decoder_setvolume	(*SetVolume);	// leave NULL if you do provide data
	op_decoder_setspeed	(*SetSpeed);	// leave NULL if you do provide data
	op_decoder_seek		(*Seek);	// leave NULL if seeking is not possible (streams)
	op_decoder_position	(*Position);	// leave NULL if you can't provide position-info
	op_decoder_bufferamount	(*BufferAmount);// leave NULL if you don't want to display a buffer-indicator
  } decoder_plugin_ops;
The void* that all of the functions receive as their first argument is the pointer that was filled in by the Instantiate_Plugin function.
Copyright © 1999 Marco Nelissen