Skip to content

Commit

Permalink
fix #488 new overloading
Browse files Browse the repository at this point in the history
allows to overload all types including basic types (as double :p)
  • Loading branch information
Nelson-numerical-software committed Sep 4, 2023
1 parent 1ad7d79 commit 19b2a0c
Show file tree
Hide file tree
Showing 800 changed files with 5,036 additions and 6,902 deletions.
26 changes: 15 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- all operators were reworked to support compatible overload.
- Boost 1.82 used on Windows.
- [#488](http://github.com/Nelson-numerical-software/nelson/issues/488) overloading functions:

- all types including basic types can be overloaded.
- overload is now fully compatible using '@' syntax and precedence.
- all operators were reworked to support compatible overload.

- Internals:
- `class`, `function_handle` types reworked.
Expand All @@ -18,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- functions finder reworked.
- file watcher reworked.
- operators reworked.
- Boost 1.82 used on Windows.

## 0.7.5 (2023-05-27)

Expand All @@ -36,7 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Qt 6.5 support.
- [802](http://github.com/Nelson-numerical-software/nelson/issues/802): `bitand`, `bitor`, `bitxor` functions.
- [#802](http://github.com/Nelson-numerical-software/nelson/issues/802): `bitand`, `bitor`, `bitxor` functions.
- `issorted` Determine if array is sorted.
- `num2cell` Convert array to cell array with consistently sized cells.
- `hggroup` Create group object.
Expand Down Expand Up @@ -68,7 +72,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- `weboptions` did not manage HeaderFields as expected.
- update `cacert.pem`.
- [895](http://github.com/Nelson-numerical-software/nelson/issues/895): Micromamba linux build fails after packages updates.
- [#895](http://github.com/Nelson-numerical-software/nelson/issues/895): Micromamba linux build fails after packages updates.

## 0.7.3 (2023-03-28)

Expand All @@ -78,7 +82,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `ancestor` Ancestor of graphics object.
- hexadecimal color code managed example: '#DDFF00'.
- `validatecolor` Validate color values.
- [851](http://github.com/Nelson-numerical-software/nelson/issues/851): Build with micromamba environment (linux and macOS)
- [#851](http://github.com/Nelson-numerical-software/nelson/issues/851): Build with micromamba environment (linux and macOS)

### Changed

Expand All @@ -89,10 +93,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- [866](http://github.com/Nelson-numerical-software/nelson/issues/866): Close menu on figure can crash on linux.
- [#866](http://github.com/Nelson-numerical-software/nelson/issues/866): Close menu on figure can crash on linux.
- graphic hierarchy was not fully destroyed after `close` or `delete`.
- labels were not displayed correctly when the logarithmic scale was enabled.
- [869](http://github.com/Nelson-numerical-software/nelson/issues/869): missing help files in linux package.
- [#869](http://github.com/Nelson-numerical-software/nelson/issues/869): missing help files in linux package.

## 0.7.2 (2023-02-27)

Expand Down Expand Up @@ -122,9 +126,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `drawnow`: Update figures and process callbacks.
- `DrawLater` property added to `figure` graphics object.
- `interp1` linear interpolation 1D.
- [736](http://github.com/Nelson-numerical-software/nelson/issues/736): `bone`, `cool`, `copper`, `hot`, `jet`, `pink`, `turbo`, `viridis`, `white` colormaps.
- [#736](http://github.com/Nelson-numerical-software/nelson/issues/736): `bone`, `cool`, `copper`, `hot`, `jet`, `pink`, `turbo`, `viridis`, `white` colormaps.
- `Visible` property to `figure` graphics object.
- [809](http://github.com/Nelson-numerical-software/nelson/issues/809): `NumberTitle` property to `figure` graphics object.
- [#809](http://github.com/Nelson-numerical-software/nelson/issues/809): `NumberTitle` property to `figure` graphics object.
- `AlphaMap` and `Colormap` properties added to `Axes` graphics object.
- `LineStyleOrder` property of 'axes' used for `plot` and `plot3`.
- `ColorOrderIndex` and `LineStyleOrderIndex` properties added to `axes` graphics object.
Expand All @@ -135,10 +139,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `imwrite` Write image to graphics file.
- `imshow` Display image.
- `surface` Primitive surface plot.
- [808](http://github.com/Nelson-numerical-software/nelson/issues/808): `pcolor` Pseudocolor plot.
- [#808](http://github.com/Nelson-numerical-software/nelson/issues/808): `pcolor` Pseudocolor plot.
- `mesh` Mesh surface plot.
- `meshz` Mesh surface plot with curtain.
- [807](http://github.com/Nelson-numerical-software/nelson/issues/807): `loglog` Log-log scale plot.
- [#807](http://github.com/Nelson-numerical-software/nelson/issues/807): `loglog` Log-log scale plot.
- `CHANGELOG` 0.7.x family.

### Changed
Expand Down
11 changes: 0 additions & 11 deletions NelSon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-cli", "modules\main\
{88FE1B78-3774-48C1-A925-A11C87ABBEDD} = {88FE1B78-3774-48C1-A925-A11C87ABBEDD}
{8BDE7AF5-8C8E-4B96-9D91-AD5B913569C7} = {8BDE7AF5-8C8E-4B96-9D91-AD5B913569C7}
{9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D} = {9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D}
{937BEE8B-E934-45F1-98EF-33AAF951E5E9} = {937BEE8B-E934-45F1-98EF-33AAF951E5E9}
{964FF907-D58A-48B6-A03B-3F6CF48CBE41} = {964FF907-D58A-48B6-A03B-3F6CF48CBE41}
{9858F707-35E8-4A44-ACE7-7CCDDFEE26AA} = {9858F707-35E8-4A44-ACE7-7CCDDFEE26AA}
{9AC8560A-9E4C-4430-9938-63D6377890EB} = {9AC8560A-9E4C-4430-9938-63D6377890EB}
Expand Down Expand Up @@ -246,8 +245,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsStream_manager_builtin",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsError_manager_builtin", "modules\error_manager\builtin\c\nlsError_manager_builtin.vcxproj", "{34B4A66D-9703-400E-9F00-B595F8C72808}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsOverload", "modules\overload\src\c\nlsOverload.vcxproj", "{937BEE8B-E934-45F1-98EF-33AAF951E5E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsInterpreter_builtin", "modules\interpreter\builtin\c\nlsInterpreter_builtin.vcxproj", "{ADF7A34A-5D81-4F48-B972-B583210352B3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{466EA3E9-98B2-41C2-AADC-C4C798F2CDCA}"
Expand Down Expand Up @@ -883,14 +880,6 @@ Global
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|Win32.Build.0 = Release|Win32
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|x64.ActiveCfg = Release|x64
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|x64.Build.0 = Release|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|Win32.ActiveCfg = Debug|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|Win32.Build.0 = Debug|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|x64.ActiveCfg = Debug|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|x64.Build.0 = Debug|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|Win32.ActiveCfg = Release|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|Win32.Build.0 = Release|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|x64.ActiveCfg = Release|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|x64.Build.0 = Release|x64
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|Win32.ActiveCfg = Debug|Win32
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|Win32.Build.0 = Debug|Win32
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
9 changes: 3 additions & 6 deletions modules/assert_functions/builtin/cpp/Gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ using namespace Nelson;
const std::wstring gatewayName = L"assert_functions";
//=============================================================================
static const nlsGateway gateway[] = {
{ "assert_istrue", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_isfalse", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isfalseBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_istrue", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1 },
{ "assert_isfalse", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isfalseBuiltin, 2, 1 },
{ "assert", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1 },
{ "assert_checkerror", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_checkerrorBuiltin, 2,
-2, CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_isequal", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isequalBuiltin, 2, 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
using namespace Nelson;
//=============================================================================
ArrayOfVector
Nelson::AssertFunctionsGateway::assert_isfalseBuiltin(
Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
Nelson::AssertFunctionsGateway::assert_isfalseBuiltin(int nLhs, const ArrayOfVector& argIn)
{
nargincheck(argIn, 1, 2);
nargoutcheck(nLhs, 0, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
using namespace Nelson;
//=============================================================================
ArrayOfVector
Nelson::AssertFunctionsGateway::assert_istrueBuiltin(
Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
Nelson::AssertFunctionsGateway::assert_istrueBuiltin(int nLhs, const ArrayOfVector& argIn)
{
nargincheck(argIn, 1, 2);
nargoutcheck(nLhs, 0, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#pragma once
//=============================================================================
#include "ArrayOf.hpp"
#include "Evaluator.hpp"
//=============================================================================
namespace Nelson::AssertFunctionsGateway {
//=============================================================================
ArrayOfVector
assert_isfalseBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn);
assert_isfalseBuiltin(int nLhs, const ArrayOfVector& argIn);
//=============================================================================
} // namespace Nelson
//=============================================================================
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#pragma once
//=============================================================================
#include "ArrayOf.hpp"
#include "Evaluator.hpp"
//=============================================================================
namespace Nelson::AssertFunctionsGateway {
//=============================================================================
ArrayOfVector
assert_istrueBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn);
assert_istrueBuiltin(int nLhs, const ArrayOfVector& argIn);
//=============================================================================
} // namespace Nelson
//=============================================================================
1 change: 0 additions & 1 deletion modules/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ target_link_libraries(
nlsI18n
nlsInterpreter
nlsNelson_manager
nlsOverload
nlsStream_manager
nlsTypes)
# ==============================================================================
Expand Down
3 changes: 0 additions & 3 deletions modules/audio/builtin/c/nlsAudio_builtin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@
<ProjectReference Include="..\..\..\nelson_manager\src\c\nlsNelson_manager.vcxproj">
<Project>{e467b14f-0d56-4237-b649-eb5572b5e731}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\overload\src\c\nlsOverload.vcxproj">
<Project>{937bee8b-e934-45f1-98ef-33aaf951e5e9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\stream_manager\src\c\nlsStream_manager.vcxproj">
<Project>{1b461db6-82ea-4436-a674-d2975f184b90}</Project>
</ProjectReference>
Expand Down
81 changes: 53 additions & 28 deletions modules/audio/builtin/cpp/Gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// LICENCE_BLOCK_END
//=============================================================================
#include "AudioHelpers.hpp"
#include "OverloadName.hpp"
#include "NelsonGateway.hpp"
#include "audiodevinfoBuiltin.hpp"
#include "audioinfoBuiltin.hpp"
Expand Down Expand Up @@ -41,36 +42,60 @@ using namespace Nelson;
const std::wstring gatewayName = L"audio";
//=============================================================================
static const nlsGateway gateway[] = {
//=============================================================================
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "display"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_displayBuiltin, 0, 2,
CPP_BUILTIN_WITH_EVALUATOR, NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "disp"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_dispBuiltin, 0, 1, CPP_BUILTIN_WITH_EVALUATOR,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "delete"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_deleteBuiltin, 0, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "isvalid"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_isvalidBuiltin, 1, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "fieldnames"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_fieldnamesBuiltin, 1, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "properties"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_propertiesBuiltin, 1, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "get"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_getBuiltin, 1, 2, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "set"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_setBuiltin, 0, 3, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "play"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_playBuiltin, 0, -1,
CPP_BUILTIN_WITH_EVALUATOR, NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "playblocking"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_playblockingBuiltin, 0, -1,
CPP_BUILTIN_WITH_EVALUATOR, NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "pause"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_pauseBuiltin, 0, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "resume"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_resumeBuiltin, 0, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "stop"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_stopBuiltin, 0, 1, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "isprop"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_ispropBuiltin, 1, 2, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
{ OVERLOAD_FUNCTION_NAME(NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR, "ismethod"),
(ptrBuiltin)Nelson::AudioGateway::audioplayer_ismethodBuiltin, 1, 2, CPP_BUILTIN,
NLS_OVERLOAD_AUTO_OFF },
//=============================================================================
{ "audioplayer_used", (ptrBuiltin)Nelson::AudioGateway::audioplayer_usedBuiltin, 1, 0 },
{ "audiodevinfo", (ptrBuiltin)Nelson::AudioGateway::audiodevinfoBuiltin, 1, -1 },
{ "audioplayer", (ptrBuiltin)Nelson::AudioGateway::audioplayerBuiltin, 1, -1 },
{ "audioplayer_display", (ptrBuiltin)Nelson::AudioGateway::audioplayer_displayBuiltin, 0, 2,
CPP_BUILTIN_WITH_EVALUATOR },
{ "audioplayer_disp", (ptrBuiltin)Nelson::AudioGateway::audioplayer_displayBuiltin, 0, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "audioplayer_delete", (ptrBuiltin)Nelson::AudioGateway::audioplayer_deleteBuiltin, 0, 1 },
{ "audioplayer_isvalid", (ptrBuiltin)Nelson::AudioGateway::audioplayer_isvalidBuiltin, 1, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "audioplayer_fieldnames", (ptrBuiltin)Nelson::AudioGateway::audioplayer_fieldnamesBuiltin, 1,
1 },
{ "audioplayer_properties", (ptrBuiltin)Nelson::AudioGateway::audioplayer_propertiesBuiltin, 1,
1 },
{ "audioplayer_get", (ptrBuiltin)Nelson::AudioGateway::audioplayer_getBuiltin, 1, 2 },
{ "audioplayer_set", (ptrBuiltin)Nelson::AudioGateway::audioplayer_setBuiltin, 0, 3 },
{ "audioplayer_play", (ptrBuiltin)Nelson::AudioGateway::audioplayer_playBuiltin, 0, -1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "audioplayer_playblocking", (ptrBuiltin)Nelson::AudioGateway::audioplayer_playblockingBuiltin,
0, -1, CPP_BUILTIN_WITH_EVALUATOR },
{ "audioplayer_pause", (ptrBuiltin)Nelson::AudioGateway::audioplayer_pauseBuiltin, 0, 1 },
{ "audioplayer_resume", (ptrBuiltin)Nelson::AudioGateway::audioplayer_resumeBuiltin, 0, 1 },
{ "audioplayer_stop", (ptrBuiltin)Nelson::AudioGateway::audioplayer_stopBuiltin, 0, 1 },
{ "audioplayer_used", (ptrBuiltin)Nelson::AudioGateway::audioplayer_usedBuiltin, 1, 0 },
{ "audioplayer_isprop", (ptrBuiltin)Nelson::AudioGateway::audioplayer_ispropBuiltin, 1, 2 },
{ "audioplayer_ismethod", (ptrBuiltin)Nelson::AudioGateway::audioplayer_ismethodBuiltin, 1, 2 },
{ "playblocking", (ptrBuiltin)Nelson::AudioGateway::playblockingBuiltin, 0, -1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "play", (ptrBuiltin)Nelson::AudioGateway::playBuiltin, 0, -1, CPP_BUILTIN_WITH_EVALUATOR },
{ "stop", (ptrBuiltin)Nelson::AudioGateway::stopBuiltin, 0, 1, CPP_BUILTIN_WITH_EVALUATOR },
{ "resume", (ptrBuiltin)Nelson::AudioGateway::resumeBuiltin, 0, 1, CPP_BUILTIN_WITH_EVALUATOR },
{ "playblocking", (ptrBuiltin)Nelson::AudioGateway::playblockingBuiltin, 0, -1 },
{ "play", (ptrBuiltin)Nelson::AudioGateway::playBuiltin, 0, -1 },
{ "stop", (ptrBuiltin)Nelson::AudioGateway::stopBuiltin, 0, 1 },
{ "resume", (ptrBuiltin)Nelson::AudioGateway::resumeBuiltin, 0, 1 },
{ "beep", (ptrBuiltin)Nelson::AudioGateway::beepBuiltin, 1, 1 },
{ "audioread", (ptrBuiltin)Nelson::AudioGateway::audioreadBuiltin, 2, 3 },
{ "audioinfo", (ptrBuiltin)Nelson::AudioGateway::audioinfoBuiltin, 1, 1 },
Expand Down
27 changes: 26 additions & 1 deletion modules/audio/builtin/cpp/audioplayer_displayBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,31 @@
using namespace Nelson;
//=============================================================================
ArrayOfVector
Nelson::AudioGateway::audioplayer_dispBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
{
ArrayOfVector retval;
nargoutcheck(nLhs, 0, 0);
nargincheck(argIn, 1, 1);
ArrayOf param1 = argIn[0];
if (param1.isHandle()) {
std::wstring name;
Interface* io = eval->getInterface();
DisplayVariableHeader(io, param1, name, false);
if (param1.isScalar()) {
if (param1.getHandleCategory() != NLS_HANDLE_AUDIOPLAYER_CATEGORY_STR) {
Error(_W("audioplayer handle expected."));
}
auto* objPlayer = (AudioplayerObject*)param1.getContentAsHandleScalar();
objPlayer->disp(io);
}
DisplayVariableFooter(io, name.empty());
} else {
Error(_W("audioplayer handle expected."));
}
return retval;
}
//=============================================================================
ArrayOfVector
Nelson::AudioGateway::audioplayer_displayBuiltin(
Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
{
Expand All @@ -27,7 +52,7 @@ Nelson::AudioGateway::audioplayer_displayBuiltin(
nargincheck(argIn, 1, 2);
ArrayOf param1 = argIn[0];
if (param1.isHandle()) {
std::wstring name;
std::wstring name = argIn[0].wname();
if (argIn.size() == 2) {
name = argIn[1].getContentAsWideString();
}
Expand Down

0 comments on commit 19b2a0c

Please sign in to comment.