mirror of
https://github.com/g4klx/DMRGateway
synced 2025-12-21 21:45:39 +08:00
Prepare for having two voice subsystems.
This commit is contained in:
@@ -29,10 +29,10 @@
|
||||
#include "PassAllPC.h"
|
||||
#include "PassAllTG.h"
|
||||
#include "DMRFullLC.h"
|
||||
#include "XLXVoice.h"
|
||||
#include "Version.h"
|
||||
#include "Thread.h"
|
||||
#include "DMRLC.h"
|
||||
#include "Voice.h"
|
||||
#include "Sync.h"
|
||||
#include "Log.h"
|
||||
#include "GitVersion.h"
|
||||
@@ -409,7 +409,7 @@ int CDMRGateway::run()
|
||||
unsigned int rfTimeout = m_conf.getRFTimeout();
|
||||
unsigned int netTimeout = m_conf.getNetTimeout();
|
||||
|
||||
CVoice* voice = NULL;
|
||||
CXLXVoice* voice = NULL;
|
||||
if (m_conf.getVoiceEnabled() && m_xlxNetwork != NULL) {
|
||||
std::string language = m_conf.getVoiceLanguage();
|
||||
std::string directory = m_conf.getVoiceDirectory();
|
||||
@@ -419,7 +419,7 @@ int CDMRGateway::run()
|
||||
LogInfo(" Language: %s", language.c_str());
|
||||
LogInfo(" Directory: %s", directory.c_str());
|
||||
|
||||
voice = new CVoice(directory, language, m_repeater->getId(), m_xlxSlot, m_xlxTG);
|
||||
voice = new CXLXVoice(directory, language, m_repeater->getId(), m_xlxSlot, m_xlxTG);
|
||||
bool ret = voice->open();
|
||||
if (!ret) {
|
||||
delete voice;
|
||||
|
||||
@@ -54,7 +54,7 @@ UserControl=1
|
||||
|
||||
# BrandMeister
|
||||
[DMR Network 1]
|
||||
Enabled=0
|
||||
Enabled=1
|
||||
Name=BM
|
||||
Address=44.131.4.1
|
||||
Port=62031
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
<ClInclude Include="UDPSocket.h" />
|
||||
<ClInclude Include="Utils.h" />
|
||||
<ClInclude Include="Version.h" />
|
||||
<ClInclude Include="Voice.h" />
|
||||
<ClInclude Include="XLXVoice.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BPTC19696.cpp" />
|
||||
@@ -236,7 +236,7 @@
|
||||
<ClCompile Include="Timer.cpp" />
|
||||
<ClCompile Include="UDPSocket.cpp" />
|
||||
<ClCompile Include="Utils.cpp" />
|
||||
<ClCompile Include="Voice.cpp" />
|
||||
<ClCompile Include="XLXVoice.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -95,9 +95,6 @@
|
||||
<ClInclude Include="QR1676.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Voice.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RewriteTG.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -140,6 +137,9 @@
|
||||
<ClInclude Include="RewriteDynTGRF.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="XLXVoice.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Conf.cpp">
|
||||
@@ -217,9 +217,6 @@
|
||||
<ClCompile Include="QR1676.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Voice.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RewriteTG.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -262,5 +259,8 @@
|
||||
<ClCompile Include="RewriteDynTGRF.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="XLXVoice.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
2
Makefile
2
Makefile
@@ -7,7 +7,7 @@ LDFLAGS = -g
|
||||
OBJECTS = BPTC19696.o Conf.o CRC.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREmbeddedData.o DMREMB.o DMRFullLC.o DMRGateway.o DMRLC.o DMRNetwork.o DMRSlotType.o \
|
||||
Golay2087.o Hamming.o Log.o MMDVMNetwork.o PassAllPC.o PassAllTG.o QR1676.o Reflectors.o RepeaterProtocol.o Rewrite.o RewriteDstId.o RewriteDynTGNet.o \
|
||||
RewriteDynTGRF.o RewritePC.o RewriteSrc.o RewriteSrcId.o RewriteTG.o RewriteType.o RS129.o SHA256.o StopWatch.o Sync.o Thread.o Timer.o UDPSocket.o \
|
||||
Utils.o Voice.o
|
||||
Utils.o XLXVoice.o
|
||||
|
||||
all: DMRGateway
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2017,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#include "DMRSlotType.h"
|
||||
#include "DMRFullLC.h"
|
||||
#include "XLXVoice.h"
|
||||
#include "DMREMB.h"
|
||||
#include "Voice.h"
|
||||
#include "Sync.h"
|
||||
#include "Log.h"
|
||||
|
||||
@@ -35,7 +35,7 @@ const unsigned char COLOR_CODE = 3U;
|
||||
const unsigned int SILENCE_LENGTH = 9U;
|
||||
const unsigned int AMBE_LENGTH = 9U;
|
||||
|
||||
CVoice::CVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg) :
|
||||
CXLXVoice::CXLXVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg) :
|
||||
m_indxFile(),
|
||||
m_ambeFile(),
|
||||
m_slot(slot),
|
||||
@@ -63,7 +63,7 @@ m_it()
|
||||
#endif
|
||||
}
|
||||
|
||||
CVoice::~CVoice()
|
||||
CXLXVoice::~CXLXVoice()
|
||||
{
|
||||
for (std::vector<CDMRData*>::iterator it = m_data.begin(); it != m_data.end(); ++it)
|
||||
delete *it;
|
||||
@@ -77,7 +77,7 @@ CVoice::~CVoice()
|
||||
delete[] m_ambe;
|
||||
}
|
||||
|
||||
bool CVoice::open()
|
||||
bool CXLXVoice::open()
|
||||
{
|
||||
FILE* fpindx = ::fopen(m_indxFile.c_str(), "rt");
|
||||
if (fpindx == NULL) {
|
||||
@@ -130,7 +130,7 @@ bool CVoice::open()
|
||||
return true;
|
||||
}
|
||||
|
||||
void CVoice::linkedTo(unsigned int number, unsigned int room)
|
||||
void CXLXVoice::linkedTo(unsigned int number, unsigned int room)
|
||||
{
|
||||
char letters[10U];
|
||||
::sprintf(letters, "%03u", number);
|
||||
@@ -158,7 +158,7 @@ void CVoice::linkedTo(unsigned int number, unsigned int room)
|
||||
createVoice(words);
|
||||
}
|
||||
|
||||
void CVoice::unlinked()
|
||||
void CXLXVoice::unlinked()
|
||||
{
|
||||
std::vector<std::string> words;
|
||||
words.push_back("notlinked");
|
||||
@@ -166,7 +166,7 @@ void CVoice::unlinked()
|
||||
createVoice(words);
|
||||
}
|
||||
|
||||
void CVoice::createVoice(const std::vector<std::string>& words)
|
||||
void CXLXVoice::createVoice(const std::vector<std::string>& words)
|
||||
{
|
||||
unsigned int ambeLength = 0U;
|
||||
for (std::vector<std::string>::const_iterator it = words.begin(); it != words.end(); ++it) {
|
||||
@@ -273,7 +273,7 @@ void CVoice::createVoice(const std::vector<std::string>& words)
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
bool CVoice::read(CDMRData& data)
|
||||
bool CXLXVoice::read(CDMRData& data)
|
||||
{
|
||||
if (m_status != VS_SENDING)
|
||||
return false;
|
||||
@@ -300,7 +300,7 @@ bool CVoice::read(CDMRData& data)
|
||||
return false;
|
||||
}
|
||||
|
||||
void CVoice::clock(unsigned int ms)
|
||||
void CXLXVoice::clock(unsigned int ms)
|
||||
{
|
||||
m_timer.clock(ms);
|
||||
if (m_timer.isRunning() && m_timer.hasExpired()) {
|
||||
@@ -313,7 +313,7 @@ void CVoice::clock(unsigned int ms)
|
||||
}
|
||||
}
|
||||
|
||||
void CVoice::createHeaderTerminator(unsigned char type)
|
||||
void CXLXVoice::createHeaderTerminator(unsigned char type)
|
||||
{
|
||||
CDMRData* data = new CDMRData;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2017,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,8 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#if !defined(Voice_H)
|
||||
#define Voice_H
|
||||
#if !defined(XLXVoice_H)
|
||||
#define XLXVoice_H
|
||||
|
||||
#include "DMREmbeddedData.h"
|
||||
#include "StopWatch.h"
|
||||
@@ -40,10 +40,10 @@ struct CPositions {
|
||||
unsigned int m_length;
|
||||
};
|
||||
|
||||
class CVoice {
|
||||
class CXLXVoice {
|
||||
public:
|
||||
CVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg);
|
||||
~CVoice();
|
||||
CXLXVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg);
|
||||
~CXLXVoice();
|
||||
|
||||
bool open();
|
||||
|
||||
Reference in New Issue
Block a user