Skip to content

Commit ea1d2e1

Browse files
committed
Remove legacy code relater to runtime reconfiguration of audio pipeline
1 parent 6ac8666 commit ea1d2e1

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

inc/MicroBitAudio.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ namespace codal
9797
*/
9898
static void requestActivation();
9999

100-
/**
101-
* Catch events from the splitter
102-
* @param MicroBitEvent
103-
*/
104-
void onSplitterEvent(MicroBitEvent);
105-
106100
/**
107101
* Activate Mic
108102
*/

source/MicroBitAudio.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,26 +81,8 @@ MicroBitAudio::MicroBitAudio(NRF52Pin &pin, NRF52Pin &speaker, NRF52ADC &adc, NR
8181
//levelSPL = new LevelDetectorSPL(*rawSplitter->createChannel(), 85.0, 65.0, 16.0, 0, DEVICE_ID_MICROPHONE, false);
8282
levelSPL = new LevelDetectorSPL(*rawSplitter->createChannel(), 85.0, 65.0, 16.0, 52.0, DEVICE_ID_SYSTEM_LEVEL_DETECTOR, false);
8383

84-
// Connect to the rawSplitter. This must come AFTER the processor, to prevent the processor's channel activation starting the microphone
85-
if(EventModel::defaultEventBus)
86-
EventModel::defaultEventBus->listen(rawSplitter->id, DEVICE_EVT_ANY, this, &MicroBitAudio::onSplitterEvent, MESSAGE_BUS_LISTENER_IMMEDIATE);
87-
8884
//Initilise stream splitter
8985
splitter = new StreamSplitter(processor->output, DEVICE_ID_SPLITTER);
90-
91-
// Connect to the splitter - this COULD come after we create it, before we add any stages, as these are dynamic and will only connect on-demand, but just in case
92-
// we're going to follow the schema set out above, to be 100% sure.
93-
if(EventModel::defaultEventBus) {
94-
EventModel::defaultEventBus->listen(DEVICE_ID_SPLITTER, DEVICE_EVT_ANY, this, &MicroBitAudio::onSplitterEvent, MESSAGE_BUS_LISTENER_IMMEDIATE);
95-
EventModel::defaultEventBus->listen(DEVICE_ID_NOTIFY, mic->output.emitFlowEvents(), this, &MicroBitAudio::onSplitterEvent, MESSAGE_BUS_LISTENER_IMMEDIATE);
96-
}
97-
}
98-
99-
void MicroBitAudio::onSplitterEvent(MicroBitEvent e){
100-
if( mic->output.isFlowing() || (e.value == SPLITTER_ACTIVATE || e.value == SPLITTER_CHANNEL_CONNECT) )
101-
activateMic();
102-
else
103-
deactivateMic();
10486
}
10587

10688
void MicroBitAudio::activateMic(){

0 commit comments

Comments
 (0)