mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-03-29 08:29:05 +08:00
wip : refactoring
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
EMSCRIPTEN_BINDINGS(ggwave) {
|
||||
emscripten::enum_<ggwave_SampleFormat>("SampleFormat")
|
||||
.value("GGWAVE_SAMPLE_FORMAT_UNDEFINED", GGWAVE_SAMPLE_FORMAT_UNDEFINED)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_U8", GGWAVE_SAMPLE_FORMAT_U8)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_I8", GGWAVE_SAMPLE_FORMAT_I8)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_U16", GGWAVE_SAMPLE_FORMAT_U16)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_I16", GGWAVE_SAMPLE_FORMAT_I16)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_F32", GGWAVE_SAMPLE_FORMAT_F32)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_U8", GGWAVE_SAMPLE_FORMAT_U8)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_I8", GGWAVE_SAMPLE_FORMAT_I8)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_U16", GGWAVE_SAMPLE_FORMAT_U16)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_I16", GGWAVE_SAMPLE_FORMAT_I16)
|
||||
.value("GGWAVE_SAMPLE_FORMAT_F32", GGWAVE_SAMPLE_FORMAT_F32)
|
||||
;
|
||||
|
||||
emscripten::enum_<ggwave_TxProtocolId>("TxProtocolId")
|
||||
@@ -36,15 +36,23 @@ EMSCRIPTEN_BINDINGS(ggwave) {
|
||||
.value("GGWAVE_TX_PROTOCOL_CUSTOM_9", GGWAVE_TX_PROTOCOL_CUSTOM_9)
|
||||
;
|
||||
|
||||
emscripten::enum_<ggwave_OperatingMode>("OperatingMode")
|
||||
.value("GGWAVE_OPERATING_MODE_BOTH_RX_AND_TX", GGWAVE_OPERATING_MODE_BOTH_RX_AND_TX)
|
||||
.value("GGWAVE_OPERATING_MODE_ONLY_RX", GGWAVE_OPERATING_MODE_ONLY_RX)
|
||||
.value("GGWAVE_OPERATING_MODE_ONLY_TX", GGWAVE_OPERATING_MODE_ONLY_TX)
|
||||
;
|
||||
|
||||
emscripten::class_<ggwave_Parameters>("Parameters")
|
||||
.constructor<>()
|
||||
.property("payloadLength", &ggwave_Parameters::payloadLength)
|
||||
.property("sampleRateInp", &ggwave_Parameters::sampleRateInp)
|
||||
.property("sampleRateOut", &ggwave_Parameters::sampleRateOut)
|
||||
.property("samplesPerFrame", &ggwave_Parameters::samplesPerFrame)
|
||||
.property("soundMarkerThreshold", &ggwave_Parameters::soundMarkerThreshold)
|
||||
.property("sampleFormatInp", &ggwave_Parameters::sampleFormatInp)
|
||||
.property("sampleFormatOut", &ggwave_Parameters::sampleFormatOut)
|
||||
.property("payloadLength", & ggwave_Parameters::payloadLength)
|
||||
.property("sampleRateInp", & ggwave_Parameters::sampleRateInp)
|
||||
.property("sampleRateOut", & ggwave_Parameters::sampleRateOut)
|
||||
.property("sampleRate", & ggwave_Parameters::sampleRate)
|
||||
.property("samplesPerFrame", & ggwave_Parameters::samplesPerFrame)
|
||||
.property("soundMarkerThreshold", & ggwave_Parameters::soundMarkerThreshold)
|
||||
.property("sampleFormatInp", & ggwave_Parameters::sampleFormatInp)
|
||||
.property("sampleFormatOut", & ggwave_Parameters::sampleFormatOut)
|
||||
.property("operatingMode", & ggwave_Parameters::operatingMode)
|
||||
;
|
||||
|
||||
emscripten::function("getDefaultParameters", &ggwave_getDefaultParameters);
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
bindings/python/.gitignore
vendored
2
bindings/python/.gitignore
vendored
@@ -1,7 +1,7 @@
|
||||
ggwave.so
|
||||
README.rst
|
||||
ggwave.bycython.cpp
|
||||
ggwave.cpython-36m-x86_64-linux-gnu.so
|
||||
ggwave.cpython-*-x86_64-linux-gnu.so
|
||||
ggwave/
|
||||
ggwave.egg-info/
|
||||
dist/
|
||||
|
||||
@@ -30,14 +30,21 @@ cdef extern from "ggwave.h" nogil:
|
||||
GGWAVE_TX_PROTOCOL_CUSTOM_8,
|
||||
GGWAVE_TX_PROTOCOL_CUSTOM_9
|
||||
|
||||
ctypedef enum ggwave_OperatingMode:
|
||||
GGWAVE_OPERATING_MODE_BOTH_RX_AND_TX,
|
||||
GGWAVE_OPERATING_MODE_ONLY_RX,
|
||||
GGWAVE_OPERATING_MODE_ONLY_TX,
|
||||
|
||||
ctypedef struct ggwave_Parameters:
|
||||
int payloadLength
|
||||
float sampleRateInp
|
||||
float sampleRateOut
|
||||
float sampleRate
|
||||
int samplesPerFrame
|
||||
float soundMarkerThreshold
|
||||
ggwave_SampleFormat sampleFormatInp
|
||||
ggwave_SampleFormat sampleFormatOut
|
||||
ggwave_OperatingMode operatingMode
|
||||
|
||||
ctypedef int ggwave_Instance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user