updated .gitignore, cleared unwanted files and folders, added close stream functionality
This commit is contained in:
parent
d32989cc81
commit
f2f1f091bf
92 changed files with 95 additions and 14610 deletions
BIN
src/.DS_Store
vendored
BIN
src/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -110,6 +110,28 @@ PaError Na_OpenOutputStream(int deviceIndex)
|
|||
return err;
|
||||
}
|
||||
|
||||
PaError Na_CloseInputStream()
|
||||
{
|
||||
PaError err = paNoError;
|
||||
PaStreamInfo* info;
|
||||
if ((info = Pa_GetStreamInfo(inputStream) != NULL))
|
||||
{
|
||||
err = Pa_CloseStream(inputStream);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
PaError Na_CloseOutputStream()
|
||||
{
|
||||
PaError err = paNoError;
|
||||
PaStreamInfo* info;
|
||||
if ((info = Pa_GetStreamInfo(outputStream) != NULL))
|
||||
{
|
||||
err = Pa_CloseStream(outputStream);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void WriteLargeDataToOutputBuffer(void* arg)
|
||||
{
|
||||
playback_data* pd = (playback_data*) arg;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ PaError Na_OpenInputStream(int deviceIndex);
|
|||
|
||||
PaError Na_OpenOutputStream(int deviceIndex);
|
||||
|
||||
PaError Na_CloseInputStream();
|
||||
|
||||
PaError Na_CloseOutputStream();
|
||||
|
||||
void Na_WriteToOutputBuffer(void* data, size_t size);
|
||||
|
||||
PaError Na_Terminate();
|
||||
|
|
|
|||
|
|
@ -116,6 +116,34 @@ napi_value OpenOutputStream(napi_env env, napi_callback_info info)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
napi_value CloseInputStream(napi_env env, napi_callback_info info)
|
||||
{
|
||||
printf("NAPI::CloseInputStream\n");
|
||||
|
||||
PaError err = paNoError;
|
||||
err = Na_CloseInputStream();
|
||||
if (err != paNoError)
|
||||
{
|
||||
napi_throw_error(env, NULL, Pa_GetErrorText(err));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
napi_value CloseOutputStream(napi_env env, napi_callback_info info)
|
||||
{
|
||||
printf("NAPI::CloseOutputStream\n");
|
||||
|
||||
PaError err = paNoError;
|
||||
err = Na_CloseOutputStream();
|
||||
if (err != paNoError)
|
||||
{
|
||||
napi_throw_error(env, NULL, Pa_GetErrorText(err));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
napi_value WriteToOutputStream(napi_env env, napi_callback_info info)
|
||||
{
|
||||
printf("NAPI::WriteToOutputStream\n");
|
||||
|
|
@ -159,10 +187,12 @@ napi_value Init(napi_env env, napi_value exports)
|
|||
DECLARE_NAPI_METHOD("GetDefaultOutputDevice", GetDefaultOutputDevice),
|
||||
DECLARE_NAPI_METHOD("OpenInputStream", OpenInputStream),
|
||||
DECLARE_NAPI_METHOD("OpenOutputStream", OpenOutputStream),
|
||||
DECLARE_NAPI_METHOD("CloseInputStream", CloseInputStream),
|
||||
DECLARE_NAPI_METHOD("CloseOutputStream", CloseOutputStream),
|
||||
DECLARE_NAPI_METHOD("WriteToOutputStream", WriteToOutputStream),
|
||||
};
|
||||
|
||||
status = napi_define_properties(env, exports, 7, desc);
|
||||
status = napi_define_properties(env, exports, 9, desc);
|
||||
|
||||
return exports;
|
||||
|
||||
|
|
|
|||
BIN
src/test.o
BIN
src/test.o
Binary file not shown.
Loading…
Reference in a new issue