/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtMultimedia.h"

#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtMultimedia/qaudiobuffer.sip"
#include <qaudiobuffer.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtMultimedia/sipQtMultimediaQAudioBuffer.cpp"

#line 30 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtMultimedia/sipQtMultimediaQAudioBuffer.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtMultimedia/qaudioformat.sip"
#include <qaudioformat.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.11/build/QtMultimedia/sipQtMultimediaQAudioBuffer.cpp"


PyDoc_STRVAR(doc_QAudioBuffer_isValid, "isValid(self) -> bool");

extern "C" {static PyObject *meth_QAudioBuffer_isValid(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_isValid(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_isValid, doc_QAudioBuffer_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_format, "format(self) -> QAudioFormat");

extern "C" {static PyObject *meth_QAudioBuffer_format(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_format(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            ::QAudioFormat*sipRes;

            sipRes = new ::QAudioFormat(sipCpp->format());

            return sipConvertFromNewType(sipRes, sipType_QAudioFormat, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_format, doc_QAudioBuffer_format);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_frameCount, "frameCount(self) -> int");

extern "C" {static PyObject *meth_QAudioBuffer_frameCount(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_frameCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->frameCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_frameCount, doc_QAudioBuffer_frameCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_sampleCount, "sampleCount(self) -> int");

extern "C" {static PyObject *meth_QAudioBuffer_sampleCount(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_sampleCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->sampleCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_sampleCount, doc_QAudioBuffer_sampleCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_byteCount, "byteCount(self) -> int");

extern "C" {static PyObject *meth_QAudioBuffer_byteCount(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_byteCount(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->byteCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_byteCount, doc_QAudioBuffer_byteCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_duration, "duration(self) -> int");

extern "C" {static PyObject *meth_QAudioBuffer_duration(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_duration(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            ::qint64 sipRes;

            sipRes = sipCpp->duration();

            return PyLong_FromLongLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_duration, doc_QAudioBuffer_duration);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_startTime, "startTime(self) -> int");

extern "C" {static PyObject *meth_QAudioBuffer_startTime(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_startTime(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            ::qint64 sipRes;

            sipRes = sipCpp->startTime();

            return PyLong_FromLongLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_startTime, doc_QAudioBuffer_startTime);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_constData, "constData(self) -> Optional[PyQt5.sip.voidptr]");

extern "C" {static PyObject *meth_QAudioBuffer_constData(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_constData(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            const void*sipRes;

            sipRes = sipCpp->constData();

            return sipConvertFromConstVoidPtr(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_constData, doc_QAudioBuffer_constData);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QAudioBuffer_data, "data(self) -> Optional[PyQt5.sip.voidptr]");

extern "C" {static PyObject *meth_QAudioBuffer_data(PyObject *, PyObject *);}
static PyObject *meth_QAudioBuffer_data(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QAudioBuffer *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QAudioBuffer, &sipCpp))
        {
            void*sipRes;

            sipRes = sipCpp->data();

            return sipConvertFromVoidPtr(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QAudioBuffer, sipName_data, doc_QAudioBuffer_data);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QAudioBuffer(void *, int);}
static void release_QAudioBuffer(void *sipCppV, int)
{
    delete reinterpret_cast< ::QAudioBuffer *>(sipCppV);
}


extern "C" {static void *array_QAudioBuffer(Py_ssize_t);}
static void *array_QAudioBuffer(Py_ssize_t sipNrElem)
{
    return new ::QAudioBuffer[sipNrElem];
}


extern "C" {static void array_delete_QAudioBuffer(void *);}
static void array_delete_QAudioBuffer(void *sipCpp)
{
    delete[] reinterpret_cast< ::QAudioBuffer *>(sipCpp);
}


extern "C" {static void assign_QAudioBuffer(void *, Py_ssize_t, void *);}
static void assign_QAudioBuffer(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QAudioBuffer *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QAudioBuffer *>(sipSrc);
}


extern "C" {static void *copy_QAudioBuffer(const void *, Py_ssize_t);}
static void *copy_QAudioBuffer(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::QAudioBuffer(reinterpret_cast<const ::QAudioBuffer *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_QAudioBuffer(sipSimpleWrapper *);}
static void dealloc_QAudioBuffer(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QAudioBuffer(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QAudioBuffer(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QAudioBuffer(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    ::QAudioBuffer *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new ::QAudioBuffer();

            return sipCpp;
        }
    }

    {
        const ::QByteArray* a0;
        int a0State = 0;
        const ::QAudioFormat* a1;
        ::qint64 a2 = -1;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            SIP_NULLPTR,
            sipName_startTime,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1J9|n", sipType_QByteArray, &a0, &a0State, sipType_QAudioFormat, &a1, &a2))
        {
            sipCpp = new ::QAudioBuffer(*a0, *a1, a2);
            sipReleaseType(const_cast< ::QByteArray *>(a0), sipType_QByteArray, a0State);

            return sipCpp;
        }
    }

    {
        int a0;
        const ::QAudioFormat* a1;
        ::qint64 a2 = -1;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            SIP_NULLPTR,
            sipName_startTime,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ9|n", &a0, sipType_QAudioFormat, &a1, &a2))
        {
            sipCpp = new ::QAudioBuffer(a0, *a1, a2);

            return sipCpp;
        }
    }

    {
        const ::QAudioBuffer* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QAudioBuffer, &a0))
        {
            sipCpp = new ::QAudioBuffer(*a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QAudioBuffer[] = {
    {sipName_byteCount, meth_QAudioBuffer_byteCount, METH_VARARGS, doc_QAudioBuffer_byteCount},
    {sipName_constData, meth_QAudioBuffer_constData, METH_VARARGS, doc_QAudioBuffer_constData},
    {sipName_data, meth_QAudioBuffer_data, METH_VARARGS, doc_QAudioBuffer_data},
    {sipName_duration, meth_QAudioBuffer_duration, METH_VARARGS, doc_QAudioBuffer_duration},
    {sipName_format, meth_QAudioBuffer_format, METH_VARARGS, doc_QAudioBuffer_format},
    {sipName_frameCount, meth_QAudioBuffer_frameCount, METH_VARARGS, doc_QAudioBuffer_frameCount},
    {sipName_isValid, meth_QAudioBuffer_isValid, METH_VARARGS, doc_QAudioBuffer_isValid},
    {sipName_sampleCount, meth_QAudioBuffer_sampleCount, METH_VARARGS, doc_QAudioBuffer_sampleCount},
    {sipName_startTime, meth_QAudioBuffer_startTime, METH_VARARGS, doc_QAudioBuffer_startTime}
};

PyDoc_STRVAR(doc_QAudioBuffer, "\1QAudioBuffer()\n"
"QAudioBuffer(data: Union[QByteArray, bytes, bytearray], format: QAudioFormat, startTime: int = -1)\n"
"QAudioBuffer(numFrames: int, format: QAudioFormat, startTime: int = -1)\n"
"QAudioBuffer(other: QAudioBuffer)");


static pyqt5ClassPluginDef plugin_QAudioBuffer = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtMultimedia_QAudioBuffer = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QAudioBuffer,
        SIP_NULLPTR,
        &plugin_QAudioBuffer,
    },
    {
        sipNameNr_QAudioBuffer,
        {0, 0, 1},
        9, methods_QAudioBuffer,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QAudioBuffer,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QAudioBuffer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QAudioBuffer,
    assign_QAudioBuffer,
    array_QAudioBuffer,
    copy_QAudioBuffer,
    release_QAudioBuffer,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QAudioBuffer,
    sizeof (::QAudioBuffer),
};
