mirror of
https://github.com/H-uru/korman.git
synced 2025-07-14 02:27:36 -04:00
C Korlib code de-duplication
Moves all PyHSPlasma struct definitions into a private header file. Also adds move constructor and assignment support to PyObjectRef.
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "sound.h"
|
||||
#include "PyHSPlasma_private.h"
|
||||
|
||||
#include <PRP/Audio/plSoundBuffer.h>
|
||||
#include <Stream/hsStream.h>
|
||||
@ -22,20 +23,6 @@
|
||||
|
||||
static const int BITS_PER_SAMPLE = 16;
|
||||
|
||||
extern "C" {
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
hsStream* fThis;
|
||||
bool fPyOwned;
|
||||
} pyStream;
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
plWAVHeader* fThis;
|
||||
bool fPyOwned;
|
||||
} pyWAVHeader;
|
||||
|
||||
static size_t _read_stream(void* ptr, size_t size, size_t nmemb, void* datasource) {
|
||||
hsStream* s = static_cast<hsStream*>(datasource);
|
||||
// hsStream is a bit overzealous protecting us against overreads, so we need to
|
||||
@ -115,5 +102,3 @@ PyObject* inspect_vorbisfile(PyObject*, PyObject* args) {
|
||||
// Therefore, we only need to return the size.
|
||||
return PyLong_FromSsize_t(size);
|
||||
}
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user