Skip to content

Commit 3ea95b1

Browse files
oepavelmedengineer
authored andcommitted
Fix channel selection
1 parent 23f37ec commit 3ea95b1

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [ubuntu-18.04]
13+
os: [ubuntu-20.04]
1414

1515
steps:
1616
- uses: actions/checkout@v1

Source/MatlabInterface.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,16 @@ AudioProcessorEditor* MatlabInterface::createEditor()
6060
void MatlabInterface::parameterValueChanged(Parameter* param)
6161
{
6262
if (param->getName().equalsIgnoreCase("Channel"))
63-
{
64-
int localIndex = (int)param->getValue();
65-
int globalIndex = getDataStream(param->getStreamId())->getContinuousChannels()[localIndex]->getGlobalIndex();
66-
setSelectedChannel(globalIndex);
67-
}
68-
63+
{
64+
Array<var>* array = param->getValue().getArray();
65+
66+
if (array->size() > 0)
67+
{
68+
int localIndex = int(array->getFirst());
69+
int globalIndex = getDataStream(param->getStreamId())->getContinuousChannels()[localIndex]->getGlobalIndex();
70+
setSelectedChannel(globalIndex);
71+
}
72+
}
6973
}
7074

7175
void MatlabInterface::process(AudioSampleBuffer& buffer)

Source/OpenEphysLib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
3838
{
3939
info->apiVersion = PLUGIN_API_VER;
4040
info->name = "Matlab Interface";
41-
info->libVersion = "0.2.0";
41+
info->libVersion = "0.2.1";
4242
info->numPlugins = NUM_PLUGINS;
4343
}
4444

0 commit comments

Comments
 (0)