Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
VAPython
Commits
b4fdc7e5
Commit
b4fdc7e5
authored
Aug 23, 2017
by
Dipl.-Ing. Jonas Stienen
Browse files
Some methods for signal source management
parent
c64b1a38
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/vasingleton.cpp
View file @
b4fdc7e5
...
...
@@ -113,7 +113,6 @@ static struct PyMethodDef va_methods[] =
{
"load_scene"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"is_scene_loaded"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"get_scene_info"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"set_listener_real_world_orientation_q"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"get_portal_ids"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"get_portal_name"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
{
"set_portal_name"
,
(
PyCFunction
)
va_not_implemented
,
METH_FASTCALL
,
va_no_doc
},
...
...
src/vasingletonmethods.hpp
View file @
b4fdc7e5
...
...
@@ -1344,3 +1344,142 @@ static PyObject* va_set_listener_real_world_orientation_vu( PyObject*, PyObject*
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_audio_file_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"path"
,
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"s|s:create_audio_file_signal_source"
,
_keywords
,
0
};
char
*
pcPath
=
nullptr
;
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcPath
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateAudiofileSignalSource
(
std
::
string
(
pcPath
),
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_text_to_speech_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|s:create_text_to_speech_signal_source"
,
_keywords
,
0
};
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateTextToSpeechSignalSource
(
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_sequencer_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|s:create_sequencer_signal_source"
,
_keywords
,
0
};
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateSequencerSignalSource
(
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_network_stream_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"interface"
,
"port"
,
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"si|s:create_network_stream_signal_source"
,
_keywords
,
0
};
char
*
pcInterface
=
nullptr
;
int
iPort
=
-
1
;
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcInterface
,
&
iPort
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sInterface
=
pcInterface
?
std
::
string
(
pcInterface
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateNetworkStreamSignalSource
(
sInterface
,
iPort
,
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_engine_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|s:create_engine_signal_source"
,
_keywords
,
0
};
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateEngineSignalSource
(
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_create_machine_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"name"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"|s:create_machine_signal_source"
,
_keywords
,
0
};
char
*
pcName
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcName
)
)
return
NULL
;
std
::
string
sName
=
pcName
?
std
::
string
(
pcName
)
:
""
;
std
::
string
sSignalSource
=
g_pVANetClient
->
GetCoreInstance
()
->
CreateEngineSignalSource
(
sName
);
return
PyUnicode_FromString
(
SaveStringToUnicodeConversion
(
sSignalSource
).
c_str
()
);
VAPY_CATCH_RETURN
;
};
static
PyObject
*
va_delete_signal_source
(
PyObject
*
,
PyObject
**
ppArgs
,
Py_ssize_t
nArgs
,
PyObject
*
pKeywordNames
)
{
VAPY_REQUIRE_CONN_TRY
;
static
const
char
*
const
_keywords
[]
=
{
"signal_source"
,
NULL
};
static
_PyArg_Parser
_parser
=
{
"s:delete_signal_source"
,
_keywords
,
0
};
char
*
pcSignalSource
=
nullptr
;
if
(
!
_PyArg_ParseStack
(
ppArgs
,
nArgs
,
pKeywordNames
,
&
_parser
,
&
pcSignalSource
)
)
return
NULL
;
std
::
string
sSignalSource
=
pcSignalSource
?
std
::
string
(
pcSignalSource
)
:
""
;
bool
bRet
=
g_pVANetClient
->
GetCoreInstance
()
->
DeleteSignalSource
(
sSignalSource
);
return
PyBool_FromLong
(
bRet
);
VAPY_CATCH_RETURN
;
};
/*
{ "get_signal_source_info", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_signal_source_infos", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_machine_signal_source_state_str", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_machine_signal_source_speed", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_machine_signal_source_speed", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_machine_signal_source_start_file", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_machine_signal_idle_start_file", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_machine_signal_stop_start_file", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "add_sound_playback", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "remove_sound_playback", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "set_signal_source_parameters", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
{ "get_signal_source_parameters", ( PyCFunction ) va_not_implemented, METH_FASTCALL, va_no_doc },
*/
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment