#include "const-c.inc"
+typedef OggOpusFile* Audio__Opusfile;
+typedef const OpusHead* Audio__Opusfile__Head;
+typedef const OpusTags* Audio__Opusfile__Tags;
+typedef const OpusPictureTag* Audio__Opusfile__PictureTag;
+
MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile PREFIX = op_
PROTOTYPES: ENABLE
INCLUDE: const-xs.inc
-OggOpusFile*
+Audio::Opusfile
op_open_file(path)
const char *path;
PREINIT:
if(err)
croak("op_open_file returned error %d\n", err);
-OggOpusFile*
+Audio::Opusfile
op_open_memory(const char *data, size_t length(data))
PREINIT:
int err;
void
DESTROY(of)
- OggOpusFile *of;
+ Audio::Opusfile of;
CODE:
op_free(of);
bool
op_seekable(of)
- OggOpusFile* of;
+ Audio::Opusfile of;
int
op_link_count(of)
- OggOpusFile* of;
+ Audio::Opusfile of;
int
op_serialno(of, li = -1)
- OggOpusFile* of;
+ Audio::Opusfile of;
int li;
-const OpusHead*
+Audio::Opusfile::Head
op_head(of, li = -1)
- OggOpusFile *of;
+ Audio::Opusfile of;
int li;
-const OpusTags*
+Audio::Opusfile::Tags
op_tags(of, li = -1)
- OggOpusFile *of;
+ Audio::Opusfile of;
int li;
MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::Tags PREFIX = opus_tags_
int
opus_tags_query_count(tags, tag)
- const OpusTags* tags;
+ Audio::Opusfile::Tags tags;
const char* tag;
const char*
opus_tags_query(tags, tag, count = 0)
- const OpusTags* tags;
+ Audio::Opusfile::Tags tags;
const char* tag;
int count;
MODULE = Audio::Opusfile PACKAGE = Audio::Opusfile::PictureTag PREFIX = opus_picture_tag_
-const OpusPictureTag*
+Audio::Opusfile::PictureTag
opus_picture_tag_parse(tag)
const char *tag;
PREINIT:
void
DESTROY(pic)
- const OpusPictureTag* pic
+ Audio::Opusfile::PictureTag pic
CODE:
Safefree(pic);
int
type(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->type;
OUTPUT:
const char*
mime_type(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->mime_type;
OUTPUT:
const char*
description(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->description;
OUTPUT:
int
width(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->width;
OUTPUT:
int
height(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->height;
OUTPUT:
int
depth(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->depth;
OUTPUT:
int
colors(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->colors;
OUTPUT:
int
data_length(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->data_length;
OUTPUT:
SV*
data(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = newSVpvn(pic->data, pic->data_length);
OUTPUT:
int
format(pic)
- const OpusPictureTag *pic;
+ Audio::Opusfile::PictureTag pic;
CODE:
RETVAL = pic->format;
OUTPUT:
int
version(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->version;
OUTPUT:
int
channel_count(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->channel_count;
OUTPUT:
unsigned
pre_skip(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->pre_skip;
OUTPUT:
unsigned
input_sample_rate(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->input_sample_rate;
OUTPUT:
int
mapping_family(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->mapping_family;
OUTPUT:
int
stream_count(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->stream_count;
OUTPUT:
int
coupled_count(head)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
CODE:
RETVAL = head->coupled_count;
OUTPUT:
int
mapping(head, k)
- const OpusHead* head;
+ Audio::Opusfile::Head head;
int k;
CODE:
RETVAL = (int) head->mapping[k];
-const OggOpusFile* T_OGG_OPUS_FILE
- OggOpusFile* T_OGG_OPUS_FILE
-const OpusHead* T_OPUS_HEAD
- OpusHead* T_OPUS_HEAD
-const OpusTags* T_OPUS_TAGS
- OpusTags* T_OPUS_TAGS
-const OpusPictureTag* T_OPUS_PICTURE_TAG
- OpusPictureTag* T_OPUS_PICTURE_TAG
-
-INPUT
-# All three types are copies of T_PTROBJ, only difference being the class name
-
-T_OGG_OPUS_FILE
- if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile\")) {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type,tmp);
- }
- else
- Perl_croak_nocontext(\"%s: %s is not of type %s\",
- ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
- \"$var\", \"Audio::Opusfile\")
-
-T_OPUS_HEAD
- if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::Head\")) {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type,tmp);
- }
- else
- Perl_croak_nocontext(\"%s: %s is not of type %s\",
- ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
- \"$var\", \"Audio::Opusfile::Head\")
-
-T_OPUS_TAGS
- if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::Tags\")) {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type,tmp);
- }
- else
- Perl_croak_nocontext(\"%s: %s is not of type %s\",
- ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
- \"$var\", \"Audio::Opusfile::Tags\")
-
-T_OPUS_PICTURE_TAG
- if (SvROK($arg) && sv_derived_from($arg, \"Audio::Opusfile::PictureTag\")) {
- IV tmp = SvIV((SV*)SvRV($arg));
- $var = INT2PTR($type,tmp);
- }
- else
- Perl_croak_nocontext(\"%s: %s is not of type %s\",
- ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
- \"$var\", \"Audio::Opusfile::Tags\")
-
-OUTPUT
-
-T_OGG_OPUS_FILE
- sv_setref_pv($arg, \"Audio::Opusfile\", (void*)$var);
-
-T_OPUS_HEAD
- sv_setref_pv($arg, \"Audio::Opusfile::Head\", (void*)$var);
-
-T_OPUS_TAGS
- sv_setref_pv($arg, \"Audio::Opusfile::Tags\", (void*)$var);
-
-T_OPUS_PICTURE_TAG
- sv_setref_pv($arg, \"Audio::Opusfile::PictureTag\", (void*)$var);
+Audio::Opusfile T_PTROBJ
+Audio::Opusfile::Head T_PTROBJ
+Audio::Opusfile::Tags T_PTROBJ
+Audio::Opusfile::PictureTag T_PTROBJ