Skip to content

Commit d178ffc

Browse files
committed
[BTRemoteControl] Update after interface changes
1 parent da9c880 commit d178ffc

File tree

8 files changed

+447
-252
lines changed

8 files changed

+447
-252
lines changed

BluetoothRemoteControl/4ModDecoders.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class ADPCM : public Decoders::IDecoder {
3333
};
3434

3535
public:
36-
static constexpr Exchange::IVoiceProducer::IProfile::codec DecoderType = Exchange::IVoiceProducer::IProfile::codec::ADPCM;
37-
static const TCHAR* Name;
36+
static constexpr Exchange::IBluetoothRemoteControl::codectype DecoderType = Exchange::IBluetoothRemoteControl::codectype::IMA_ADPCM;
37+
static const TCHAR* Name;
3838

3939
public:
4040
ADPCM() = delete;
@@ -118,7 +118,7 @@ class ADPCM : public Decoders::IDecoder {
118118

119119
::memcpy(_package, &(dataIn[3]), _offset);
120120
}
121-
else if ((lengthIn + _offset) < sizeof(_package)) {
121+
else if ((lengthIn + _offset) < sizeof(_package)) {
122122
::memcpy(&(_package[_offset]), dataIn, lengthIn);
123123
_offset += lengthIn;
124124
}
@@ -146,7 +146,7 @@ class ADPCM : public Decoders::IDecoder {
146146
_frame = 0;
147147
_offset = 0;
148148
}
149-
149+
150150
return ( sendFrame );
151151
}
152152

@@ -166,7 +166,7 @@ static Decoders::DecoderFactory<ADPCM> _adpcmFactory;
166166

167167
class PCM : public ADPCM {
168168
public:
169-
static constexpr Exchange::IVoiceProducer::IProfile::codec DecoderType = Exchange::IVoiceProducer::IProfile::codec::PCM;
169+
static constexpr Exchange::IBluetoothRemoteControl::codectype DecoderType = Exchange::IBluetoothRemoteControl::codectype::PCM;
170170

171171
public:
172172
PCM() = delete;
@@ -290,4 +290,4 @@ class PCM : public ADPCM {
290290

291291
static Decoders::DecoderFactory<PCM> _pcmFactory;
292292

293-
} // namespace
293+
} // namespace

BluetoothRemoteControl/Administrator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Key {
2929
Key(const Key&) = delete;
3030
Key& operator= (const Key&) = delete;
3131

32-
Key(const TCHAR name[], const Exchange::IVoiceProducer::IProfile::codec codec)
32+
Key(const TCHAR name[], const Exchange::IBluetoothRemoteControl::codectype codec)
3333
: _name(name)
3434
, _codec(codec) {
3535
}
@@ -45,15 +45,15 @@ class Key {
4545
bool operator!= (const Key& RHS) const {
4646
return (!operator==(RHS));
4747
}
48-
48+
4949
private:
5050
const string _name;
51-
Exchange::IVoiceProducer::IProfile::codec _codec;
51+
Exchange::IBluetoothRemoteControl::codectype _codec;
5252
};
5353

5454
static std::map<Key, IDecoder::IFactory*> _factories;
5555

56-
/* static */ IDecoder* IDecoder::Instance(const TCHAR name[], Exchange::IVoiceProducer::IProfile::codec codec, const string& configuration)
56+
/* static */ IDecoder* IDecoder::Instance(const TCHAR name[], Exchange::IBluetoothRemoteControl::codectype codec, const string& configuration)
5757
{
5858
IDecoder* result = nullptr;
5959
std::map<Key, IDecoder::IFactory*>::iterator index = _factories.find(Key(name, codec));
@@ -63,7 +63,7 @@ static std::map<Key, IDecoder::IFactory*> _factories;
6363
return (result);
6464
}
6565

66-
/* static */ void IDecoder::Announce(const TCHAR name[], Exchange::IVoiceProducer::IProfile::codec codec, IDecoder::IFactory* factory)
66+
/* static */ void IDecoder::Announce(const TCHAR name[], Exchange::IBluetoothRemoteControl::codectype codec, IDecoder::IFactory* factory)
6767
{
6868
// uses pair's piecewise constructor
6969
_factories.emplace(std::piecewise_construct,

BluetoothRemoteControl/Administrator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "Module.h"
2323

24-
#include <interfaces/IVoiceHandler.h>
24+
#include <interfaces/IBluetoothRemoteControl.h>
2525

2626
namespace Thunder {
2727

@@ -35,8 +35,8 @@ namespace Decoders {
3535
virtual IDecoder* Factory(const string& configuration) = 0;
3636
};
3737

38-
static void Announce(const TCHAR name[], Exchange::IVoiceProducer::IProfile::codec codec, IFactory* factory);
39-
static IDecoder* Instance(const TCHAR name[], Exchange::IVoiceProducer::IProfile::codec codec, const string& configuration);
38+
static void Announce(const TCHAR name[], Exchange::IBluetoothRemoteControl::codectype, IFactory* factory);
39+
static IDecoder* Instance(const TCHAR name[], Exchange::IBluetoothRemoteControl::codectype codec, const string& configuration);
4040

4141
virtual uint32_t Frames() const = 0;
4242
virtual uint32_t Dropped() const = 0;

BluetoothRemoteControl/BluetoothRemoteControl.conf.in

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ configuration.add("controller", "BluetoothControl")
66
configuration.add("keyingest", "true")
77
configuration.add("recorder", "off")
88
configuration.add("keymap", "bluetooth")
9-
configuration.add("codec", "pcm")
10-
configuration.add("samplerate", "16000")
11-
configuration.add("channels", "1")
12-
configuration.add("resolution", "16")
13-
configuration.add("configuration", None)
149
configuration.add("serviceuuid", "f0e0d000-a000-b000-c000-987654321000")
1510
configuration.add("commanduuid", "f0e0d001-a000-b000-c000-987654321000")
1611
configuration.add("datauuid", "f0e0d002-a000-b000-c000-987654321000")
1712
configuration.add("audiobuffersize", 0)
1813
configuration.add("firstaudiochunksize", 40)
1914
configuration.add("audiochunksize", 40)
15+
16+
audioprofile = JSON()
17+
audioprofile.add("codec", "pcm")
18+
audioprofile.add("samplerate", "16000")
19+
audioprofile.add("channels", "1")
20+
audioprofile.add("resolution", "16")
21+
audioprofile.add("configuration", "")
22+
23+
configuration.add("audioprofile", audioprofile)

0 commit comments

Comments
 (0)