Skip to content

Commit e063d0f

Browse files
authored
Merge pull request #79 from martim01/rtpmap
Rtpmap
2 parents af54b94 + aace5fb commit e063d0f

24 files changed

+316
-82
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
project(pamworkspace VERSION 1.2.0.0)
2+
project(pamworkspace VERSION 1.3.0.0)
33

44
SET(CMAKE_CXX_STANDARD 14)
55

pam2/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
2-
project(pam2 LANGUAGES CXX VERSION 1.2.0.0)
2+
project(pam2 LANGUAGES CXX VERSION 1.3.0.0)
33

44
execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake)
55

pam2/dlgmask.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <wx/intl.h>
55
#include <wx/string.h>
66
//*)
7-
7+
#include "log.h"
88
//(*IdInit(dlgMask)
99
const long dlgMask::ID_M_PLST1 = wxNewId();
1010
//*)
@@ -66,6 +66,7 @@ void dlgMask::OnActivate(wxActivateEvent& event)
6666
void dlgMask::OnlstSubnetSelected(wxCommandEvent& event)
6767
{
6868
m_sSelected = event.GetString();
69+
pmlLog(pml::LOG_INFO) << "Selected a value " << m_sSelected;
6970
if(HasCapture())
7071
{
7172
ReleaseMouse();
@@ -81,6 +82,7 @@ void dlgMask::OnLeftDown(wxMouseEvent& event)
8182
{
8283
ReleaseMouse();
8384
}
85+
pmlLog(pml::LOG_INFO) << "Clicked outside";
8486
EndModal(wxID_CANCEL);
8587
}
8688
else
@@ -93,6 +95,8 @@ void dlgMask::OnLeftDown(wxMouseEvent& event)
9395

9496
void dlgMask::OnCaptureLost(wxMouseCaptureLostEvent& event)
9597
{
98+
pmlLog(pml::LOG_INFO) << "Capture lost";
9699
wxPostEvent(m_plstSubnet, event);
97-
EndModal(wxID_CANCEL);
100+
// EndModal(wxID_CANCEL);
101+
// CaptureMouse();
98102
}

pam2/pnlAoipManual.cpp

+28-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const long pnlAoipManual::ID_M_PLBL4 = wxNewId();
2121
const long pnlAoipManual::ID_M_PLST5 = wxNewId();
2222
const long pnlAoipManual::ID_M_PKBD2 = wxNewId();
2323
const long pnlAoipManual::ID_M_PBTN3 = wxNewId();
24+
const long pnlAoipManual::ID_M_PLBL11 = wxNewId();
25+
const long pnlAoipManual::ID_M_PBTN4 = wxNewId();
2426
//*)
2527

2628
BEGIN_EVENT_TABLE(pnlAoipManual,wxPanel)
@@ -75,9 +77,18 @@ pnlAoipManual::pnlAoipManual(wxWindow* parent,wxWindowID id,const wxPoint& pos,c
7577
m_pbtnStream = new wmButton(this, ID_M_PBTN3, _("Receive"), wxPoint(300,320), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3"));
7678
m_pbtnStream->SetBackgroundColour(wxColour(0,128,0));
7779
m_pbtnStream->SetToggle(true, wxT("Stop"), wxT("Start"), 40);
80+
m_pLbl8 = new wmLabel(this, ID_M_PLBL11, _("RTPMap"), wxPoint(300,210), wxSize(70,40), 0, _T("ID_M_PLBL11"));
81+
m_pLbl8->SetBorderState(uiRect::BORDER_NONE);
82+
m_pLbl8->GetUiRect().SetGradient(0);
83+
m_pLbl8->SetForegroundColour(wxColour(255,255,255));
84+
m_pLbl8->SetBackgroundColour(wxColour(64,0,128));
85+
m_pbtnRtpMap = new wmButton(this, ID_M_PBTN4, _("96"), wxPoint(370,210), wxSize(80,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN4"));
86+
m_pbtnRtpMap->SetForegroundColour(wxColour(0,0,0));
87+
m_pbtnRtpMap->SetBackgroundColour(wxColour(255,255,255));
7888

7989
Connect(ID_M_PBTN6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnSampleRateClick);
8090
Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnStreamClick);
91+
Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnRtpMapClick);
8192
//*)
8293
SetSize(size);
8394
SetPosition(pos);
@@ -139,9 +150,9 @@ void pnlAoipManual::OnbtnStreamClick(wxCommandEvent& event)
139150
<< "s=Manual SDP created by PAM\r\n"
140151
<< "t=0 0\r\n"
141152
<< "a=recvonly\r\n"
142-
<< "m=audio " << m_pedtPort->GetValue() << " RTP/AVP 96\r\n"
153+
<< "m=audio " << m_pedtPort->GetValue() << " RTP/AVP " << m_pbtnRtpMap->GetLabel() << "\r\n"
143154
<< "c=IN IP4 " << m_pipServer->GetValue() << "/255\r\n"
144-
<< "a=rtpmap:96 L" << (m_pbtnBits->IsChecked() ? "24" : "16") << "/" << m_pbtnSampleRate->GetLabel() << "/" << m_sChannels << "\r\n"
155+
<< "a=rtpmap:" << m_pbtnRtpMap->GetLabel() <<" L" << (m_pbtnBits->IsChecked() ? "24" : "16") << "/" << m_pbtnSampleRate->GetLabel() << "/" << m_sChannels << "\r\n"
145156
<< "a=mediaclk:direct=0\r\n";
146157
//@todo grandmaster if we have one
147158

@@ -158,3 +169,18 @@ void pnlAoipManual::OnbtnStreamClick(wxCommandEvent& event)
158169
Settings::Get().Write("Input", "AoIP", 0); //write the new source number in
159170
}
160171
}
172+
173+
void pnlAoipManual::OnbtnRtpMapClick(wxCommandEvent& event)
174+
{
175+
wxArrayString asButtons;
176+
for(int i = 96; i < 128; i++)
177+
{
178+
asButtons.Add(wxString::Format("%d", i));
179+
}
180+
181+
dlgMask aDlg(this, asButtons, m_pbtnRtpMap->GetLabel(), wxNewId(), ClientToScreen(m_pbtnRtpMap->GetPosition()), m_pbtnRtpMap->GetSize());
182+
if(aDlg.ShowModal()== wxID_OK)
183+
{
184+
m_pbtnRtpMap->SetLabel(aDlg.m_sSelected);
185+
}
186+
}

pam2/pnlAoipManual.h

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class pnlAoipManual: public wxPanel
2020

2121
//(*Declarations(pnlAoipManual)
2222
wmButton* m_pbtnBits;
23+
wmButton* m_pbtnRtpMap;
2324
wmButton* m_pbtnSampleRate;
2425
wmButton* m_pbtnStream;
2526
wmEdit* m_pedtPort;
@@ -28,6 +29,7 @@ class pnlAoipManual: public wxPanel
2829
wmLabel* m_pLbl1;
2930
wmLabel* m_pLbl2;
3031
wmLabel* m_pLbl4;
32+
wmLabel* m_pLbl8;
3133
wmLabel* m_pLbl9;
3234
wmList* m_plstChannels;
3335
//*)
@@ -46,13 +48,16 @@ class pnlAoipManual: public wxPanel
4648
static const long ID_M_PLST5;
4749
static const long ID_M_PKBD2;
4850
static const long ID_M_PBTN3;
51+
static const long ID_M_PLBL11;
52+
static const long ID_M_PBTN4;
4953
//*)
5054

5155
private:
5256

5357
//(*Handlers(pnlAoipManual)
5458
void OnbtnSampleRateClick(wxCommandEvent& event);
5559
void OnbtnStreamClick(wxCommandEvent& event);
60+
void OnbtnRtpMapClick(wxCommandEvent& event);
5661
//*)
5762
void OnlstChannelSelected(wxCommandEvent& event);
5863

pam2/pnlSettingsOutput.cpp

+85-17
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "soundcardmanager.h"
77
#include "portaudio.h"
88
#include <map>
9-
9+
#include "log.h"
1010
//(*InternalHeaders(pnlSettingsOutput)
1111
#include <wx/font.h>
1212
#include <wx/intl.h>
@@ -42,6 +42,10 @@ const long pnlSettingsOutput::ID_M_PLBL9 = wxNewId();
4242
const long pnlSettingsOutput::ID_M_PBTN8 = wxNewId();
4343
const long pnlSettingsOutput::ID_M_PBTN9 = wxNewId();
4444
const long pnlSettingsOutput::ID_M_PBTN3 = wxNewId();
45+
const long pnlSettingsOutput::ID_M_PLBL12 = wxNewId();
46+
const long pnlSettingsOutput::ID_M_PBTN5 = wxNewId();
47+
const long pnlSettingsOutput::ID_M_PLBL11 = wxNewId();
48+
const long pnlSettingsOutput::ID_M_PBTN4 = wxNewId();
4549
const long pnlSettingsOutput::ID_PANEL11 = wxNewId();
4650
const long pnlSettingsOutput::ID_M_PSWP2 = wxNewId();
4751
//*)
@@ -103,75 +107,91 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
103107
m_plblOutputGain->SetFont(m_plblOutputGainFont);
104108
pnlAoip = new wxPanel(m_pswpDestination, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL11"));
105109
pnlAoip->SetBackgroundColour(wxColour(0,0,0));
106-
m_pLbl1 = new wmLabel(pnlAoip, ID_M_PLBL1, _("Multicast"), wxPoint(0,65), wxSize(100,40), 0, _T("ID_M_PLBL1"));
110+
m_pLbl1 = new wmLabel(pnlAoip, ID_M_PLBL1, _("Multicast"), wxPoint(0,55), wxSize(100,40), 0, _T("ID_M_PLBL1"));
107111
m_pLbl1->SetBorderState(uiRect::BORDER_NONE);
108112
m_pLbl1->GetUiRect().SetGradient(0);
109113
m_pLbl1->SetForegroundColour(wxColour(255,255,255));
110114
m_pLbl1->SetBackgroundColour(wxColour(64,0,128));
111-
m_ppnlAddress = new wmipeditpnl(pnlAoip, ID_PANEL12, wxPoint(100,65), wxSize(200,40), wxTAB_TRAVERSAL, _T("ID_PANEL12"));
115+
m_ppnlAddress = new wmipeditpnl(pnlAoip, ID_PANEL12, wxPoint(100,55), wxSize(200,40), wxTAB_TRAVERSAL, _T("ID_PANEL12"));
112116
m_ppnlAddress->SetForegroundColour(wxColour(0,0,0));
113117
m_ppnlAddress->SetBackgroundColour(wxColour(255,255,255));
114-
m_pLbl2 = new wmLabel(pnlAoip, ID_M_PLBL2, _("RTP Port"), wxPoint(300,65), wxSize(50,40), 0, _T("ID_M_PLBL2"));
118+
m_pLbl2 = new wmLabel(pnlAoip, ID_M_PLBL2, _("RTP Port"), wxPoint(300,55), wxSize(50,40), 0, _T("ID_M_PLBL2"));
115119
m_pLbl2->SetBorderState(uiRect::BORDER_NONE);
116120
m_pLbl2->GetUiRect().SetGradient(0);
117121
m_pLbl2->SetForegroundColour(wxColour(255,255,255));
118122
m_pLbl2->SetBackgroundColour(wxColour(64,0,128));
119-
m_pLbl9 = new wmLabel(pnlAoip, ID_M_PLBL8, _("RTSP"), wxPoint(0,15), wxSize(100,40), 0, _T("ID_M_PLBL8"));
123+
m_pLbl9 = new wmLabel(pnlAoip, ID_M_PLBL8, _("RTSP"), wxPoint(0,10), wxSize(100,40), 0, _T("ID_M_PLBL8"));
120124
m_pLbl9->SetBorderState(uiRect::BORDER_NONE);
121125
m_pLbl9->GetUiRect().SetGradient(0);
122126
m_pLbl9->SetForegroundColour(wxColour(255,255,255));
123127
m_pLbl9->SetBackgroundColour(wxColour(64,0,128));
124-
m_pbtnRTSP = new wmButton(pnlAoip, ID_M_PBTN6, _("Stream"), wxPoint(100,15), wxSize(200,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6"));
128+
m_pbtnRTSP = new wmButton(pnlAoip, ID_M_PBTN6, _("Stream"), wxPoint(100,10), wxSize(200,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6"));
125129
m_pbtnRTSP->SetForegroundColour(wxColour(0,0,0));
126130
m_pbtnRTSP->SetBackgroundColour(wxColour(255,255,255));
127-
m_pLbl6 = new wmLabel(pnlAoip, ID_M_PLBL6, _("Port"), wxPoint(300,15), wxSize(50,40), 0, _T("ID_M_PLBL6"));
131+
m_pLbl6 = new wmLabel(pnlAoip, ID_M_PLBL6, _("Port"), wxPoint(300,10), wxSize(50,40), 0, _T("ID_M_PLBL6"));
128132
m_pLbl6->SetBorderState(uiRect::BORDER_NONE);
129133
m_pLbl6->GetUiRect().SetGradient(0);
130134
m_pLbl6->SetForegroundColour(wxColour(255,255,255));
131135
m_pLbl6->SetBackgroundColour(wxColour(64,0,128));
132-
m_pedtRTSPPort = new wmEdit(pnlAoip, ID_M_PEDT3, wxEmptyString, wxPoint(350,15), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3"));
136+
m_pedtRTSPPort = new wmEdit(pnlAoip, ID_M_PEDT3, wxEmptyString, wxPoint(350,10), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3"));
133137
m_pedtRTSPPort->SetValidation(4);
134138
m_pedtRTSPPort->SetBorderStyle(1,1);
135-
m_pLbl7 = new wmLabel(pnlAoip, ID_M_PLBL7, _("Packet Time"), wxPoint(0,110), wxSize(100,40), 0, _T("ID_M_PLBL7"));
139+
m_pLbl7 = new wmLabel(pnlAoip, ID_M_PLBL7, _("Packet Time"), wxPoint(0,100), wxSize(100,40), 0, _T("ID_M_PLBL7"));
136140
m_pLbl7->SetBorderState(uiRect::BORDER_NONE);
137141
m_pLbl7->GetUiRect().SetGradient(0);
138142
m_pLbl7->SetForegroundColour(wxColour(255,255,255));
139143
m_pLbl7->SetBackgroundColour(wxColour(64,0,128));
140-
m_plstPacket = new wmList(pnlAoip, ID_M_PLST5, wxPoint(105,109), wxSize(490,44), wmList::STYLE_SELECT, 0, wxSize(-1,-1), 5, wxSize(5,-1));
144+
m_plstPacket = new wmList(pnlAoip, ID_M_PLST5, wxPoint(105,99), wxSize(490,44), wmList::STYLE_SELECT, 0, wxSize(-1,-1), 5, wxSize(5,-1));
141145
m_plstPacket->SetBackgroundColour(wxColour(0,0,0));
142146
m_plstPacket->SetButtonColour(wxColour(wxT("#004040")));
143147
m_plstPacket->SetSelectedButtonColour(wxColour(wxT("#FF8000")));
144-
m_pedtRTPPort = new wmEdit(pnlAoip, ID_M_PEDT2, wxEmptyString, wxPoint(350,65), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT2"));
148+
m_pedtRTPPort = new wmEdit(pnlAoip, ID_M_PEDT2, wxEmptyString, wxPoint(350,55), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT2"));
145149
m_pedtRTPPort->SetValidation(4);
146150
m_pedtRTPPort->SetBorderStyle(1,1);
147-
m_pbtnRestartStream = new wmButton(pnlAoip, ID_M_PBTN1, _("Restart Stream"), wxPoint(470,15), wxSize(120,40), wmButton::STYLE_HOLD, wxDefaultValidator, _T("ID_M_PBTN1"));
151+
m_pbtnRestartStream = new wmButton(pnlAoip, ID_M_PBTN1, _("Restart Stream"), wxPoint(470,10), wxSize(120,40), wmButton::STYLE_HOLD, wxDefaultValidator, _T("ID_M_PBTN1"));
148152
m_pbtnRestartStream->SetBackgroundColour(wxColour(255,0,0));
149153
wxFont m_pbtnRestartStreamFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT);
150154
m_pbtnRestartStream->SetFont(m_pbtnRestartStreamFont);
151-
m_pbtnStats = new wmButton(pnlAoip, ID_M_PBTN2, _("RTCP Stats"), wxPoint(470,65), wxSize(120,40), 0, wxDefaultValidator, _T("ID_M_PBTN2"));
155+
m_pbtnStats = new wmButton(pnlAoip, ID_M_PBTN2, _("RTCP Stats"), wxPoint(470,55), wxSize(120,40), 0, wxDefaultValidator, _T("ID_M_PBTN2"));
152156
m_pbtnStats->SetBackgroundColour(wxColour(64,128,128));
153157
wxFont m_pbtnStatsFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT);
154158
m_pbtnStats->SetFont(m_pbtnStatsFont);
155159
m_pkbd = new wmKeyboard(pnlAoip, ID_M_PKBD2, wxPoint(10,160), wxSize(240,200), 5, 0);
156160
m_pkbd->SetForegroundColour(wxColour(255,255,255));
157161
wxFont m_pkbdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
158162
m_pkbd->SetFont(m_pkbdFont);
159-
m_pLbl10 = new wmLabel(pnlAoip, ID_M_PLBL9, _("Advertise"), wxPoint(260,215), wxSize(330,30), 0, _T("ID_M_PLBL9"));
163+
m_pLbl10 = new wmLabel(pnlAoip, ID_M_PLBL9, _("Advertise"), wxPoint(260,250), wxSize(330,30), 0, _T("ID_M_PLBL9"));
160164
m_pLbl10->SetBorderState(uiRect::BORDER_NONE);
161165
m_pLbl10->GetUiRect().SetGradient(0);
162166
m_pLbl10->SetForegroundColour(wxColour(255,255,255));
163167
m_pLbl10->SetBackgroundColour(wxColour(61,120,218));
164168
wxFont m_pLbl10Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
165169
m_pLbl10->SetFont(m_pLbl10Font);
166-
m_pbtnDNS = new wmButton(pnlAoip, ID_M_PBTN8, _("mDNS-SD"), wxPoint(300,250), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN8"));
170+
m_pbtnDNS = new wmButton(pnlAoip, ID_M_PBTN8, _("mDNS-SD"), wxPoint(300,285), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN8"));
167171
m_pbtnDNS->SetBackgroundColour(wxColour(61,120,218));
168172
m_pbtnDNS->SetToggle(true, wxT("Off"), wxT("On"), 40);
169-
m_pbtnSAP = new wmButton(pnlAoip, ID_M_PBTN9, _("SAP"), wxPoint(300,300), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN9"));
173+
m_pbtnSAP = new wmButton(pnlAoip, ID_M_PBTN9, _("SAP"), wxPoint(300,330), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN9"));
170174
m_pbtnSAP->SetBackgroundColour(wxColour(61,120,218));
171175
m_pbtnSAP->SetToggle(true, wxT("Off"), wxT("On"), 40);
172-
m_pbtnStream = new wmButton(pnlAoip, ID_M_PBTN3, _("Stream"), wxPoint(300,160), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3"));
176+
m_pbtnStream = new wmButton(pnlAoip, ID_M_PBTN3, _("Stream"), wxPoint(300,200), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3"));
173177
m_pbtnStream->SetBackgroundColour(wxColour(0,128,0));
174178
m_pbtnStream->SetToggle(true, wxT("Unicast"), wxT("Multicast"), 40);
179+
m_pLbl11 = new wmLabel(pnlAoip, ID_M_PLBL12, _("Channels"), wxPoint(300,145), wxSize(70,40), 0, _T("ID_M_PLBL12"));
180+
m_pLbl11->SetBorderState(uiRect::BORDER_NONE);
181+
m_pLbl11->GetUiRect().SetGradient(0);
182+
m_pLbl11->SetForegroundColour(wxColour(255,255,255));
183+
m_pLbl11->SetBackgroundColour(wxColour(64,0,128));
184+
m_pbtnChannels = new wmButton(pnlAoip, ID_M_PBTN5, _("2"), wxPoint(370,145), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN5"));
185+
m_pbtnChannels->SetForegroundColour(wxColour(0,0,0));
186+
m_pbtnChannels->SetBackgroundColour(wxColour(255,255,255));
187+
m_pLbl8 = new wmLabel(pnlAoip, ID_M_PLBL11, _("RTPMap"), wxPoint(438,145), wxSize(70,40), 0, _T("ID_M_PLBL11"));
188+
m_pLbl8->SetBorderState(uiRect::BORDER_NONE);
189+
m_pLbl8->GetUiRect().SetGradient(0);
190+
m_pLbl8->SetForegroundColour(wxColour(255,255,255));
191+
m_pLbl8->SetBackgroundColour(wxColour(64,0,128));
192+
m_pbtnRtpMap = new wmButton(pnlAoip, ID_M_PBTN4, _("96"), wxPoint(508,145), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN4"));
193+
m_pbtnRtpMap->SetForegroundColour(wxColour(0,0,0));
194+
m_pbtnRtpMap->SetBackgroundColour(wxColour(255,255,255));
175195
m_pswpDestination->AddPage(pnlDisabled, _("Disabled"), false);
176196
m_pswpDestination->AddPage(pnlSoundcard, _("Soundcard"), false);
177197
m_pswpDestination->AddPage(pnlAoip, _("AoIP"), false);
@@ -189,6 +209,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
189209
Connect(ID_M_PBTN8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnDNSClick);
190210
Connect(ID_M_PBTN9,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnSAPClick);
191211
Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnStreamClick);
212+
Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnChannelsClick);
213+
Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnRtpMapClick);
192214
//*)
193215

194216
SetSize(size);
@@ -225,6 +247,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
225247
Settings::Get().AddHandler(wxT("Server"), wxT("Stream"), this);
226248
Settings::Get().AddHandler(wxT("Server"), wxT("SAP"), this);
227249
Settings::Get().AddHandler(wxT("Server"), wxT("DNS-SD"), this);
250+
Settings::Get().AddHandler(wxT("Server"), wxT("RTPMap"), this);
251+
Settings::Get().AddHandler(wxT("Server"), wxT("Channels"), this);
228252

229253
Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&pnlSettingsOutput::OnSettingChanged);
230254
}
@@ -254,6 +278,9 @@ void pnlSettingsOutput::UpdateDisplayedSettings()
254278
bool bMulticast(Settings::Get().Read(wxT("Server"), wxT("Stream"), "Unicast") == "Multicast");
255279
m_pbtnStream->ToggleSelection(bMulticast);
256280

281+
m_pbtnRtpMap->SetLabel(Settings::Get().Read("Server", "RTPMap", "96"));
282+
m_pbtnChannels->SetLabel(Settings::Get().Read("Server", "Channels", "2"));
283+
257284
m_pbtnSAP->Show(bMulticast);
258285

259286
m_pLbl1->Show(bMulticast);
@@ -306,6 +333,14 @@ void pnlSettingsOutput::OnSettingChanged(SettingEvent& event)
306333
{
307334
m_pbtnSAP->ToggleSelection(Settings::Get().Read("Server", "SAP", 0));
308335
}
336+
else if(event.GetKey() == "RTPMap")
337+
{
338+
m_pbtnRtpMap->SetLabel(event.GetValue());
339+
}
340+
else if(event.GetKey() == "Channels")
341+
{
342+
m_pbtnChannels->SetLabel(event.GetValue());
343+
}
309344
}
310345
}
311346

@@ -458,3 +493,36 @@ void pnlSettingsOutput::OnbtnStatsClick(wxCommandEvent& event)
458493
{
459494
Settings::Get().Write("Splash", "Screen", "RTCP");
460495
}
496+
497+
void pnlSettingsOutput::OnbtnRtpMapClick(wxCommandEvent& event)
498+
{
499+
wxArrayString asButtons;
500+
for(int i = 96; i < 128; i++)
501+
{
502+
asButtons.Add(wxString::Format("%d", i));
503+
}
504+
505+
dlgMask aDlg(this, asButtons, m_pbtnRtpMap->GetLabel(), wxNewId(), ClientToScreen(m_pbtnRtpMap->GetPosition()), m_pbtnRtpMap->GetSize());
506+
if(aDlg.ShowModal()== wxID_OK)
507+
{
508+
m_pbtnRtpMap->SetLabel(aDlg.m_sSelected);
509+
pmlLog(pml::LOG_TRACE) << "RTPMAP: " << aDlg.m_sSelected.ToStdString();
510+
Settings::Get().Write("Server", "RTPMap", aDlg.m_sSelected);
511+
}
512+
}
513+
514+
void pnlSettingsOutput::OnbtnChannelsClick(wxCommandEvent& event)
515+
{
516+
wxArrayString asButtons;
517+
for(int i = 1; i < 9; i++)
518+
{
519+
asButtons.Add(wxString::Format("%d", i));
520+
}
521+
522+
dlgMask aDlg(this, asButtons, m_pbtnChannels->GetLabel(), wxNewId(), ClientToScreen(m_pbtnChannels->GetPosition()), m_pbtnChannels->GetSize());
523+
if(aDlg.ShowModal()== wxID_OK)
524+
{
525+
m_pbtnChannels->SetLabel(aDlg.m_sSelected);
526+
Settings::Get().Write("Server", "Channels", aDlg.m_sSelected);
527+
}
528+
}

pam2/pnlSettingsOutput.h

+10
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,27 @@ class pnlSettingsOutput: public wxPanel
2727
void ShowSoundcardOutputs();
2828

2929
//(*Declarations(pnlSettingsOutput)
30+
wmButton* m_pbtnChannels;
3031
wmButton* m_pbtnDNS;
3132
wmButton* m_pbtnRTSP;
3233
wmButton* m_pbtnRestartStream;
34+
wmButton* m_pbtnRtpMap;
3335
wmButton* m_pbtnSAP;
3436
wmButton* m_pbtnStats;
3537
wmButton* m_pbtnStream;
3638
wmEdit* m_pedtRTPPort;
3739
wmEdit* m_pedtRTSPPort;
3840
wmKeyboard* m_pkbd;
3941
wmLabel* m_pLbl10;
42+
wmLabel* m_pLbl11;
4043
wmLabel* m_pLbl1;
4144
wmLabel* m_pLbl2;
4245
wmLabel* m_pLbl3;
4346
wmLabel* m_pLbl4;
4447
wmLabel* m_pLbl5;
4548
wmLabel* m_pLbl6;
4649
wmLabel* m_pLbl7;
50+
wmLabel* m_pLbl8;
4751
wmLabel* m_pLbl9;
4852
wmLabel* m_plblOutputGain;
4953
wmList* m_plstDestination;
@@ -88,6 +92,10 @@ class pnlSettingsOutput: public wxPanel
8892
static const long ID_M_PBTN8;
8993
static const long ID_M_PBTN9;
9094
static const long ID_M_PBTN3;
95+
static const long ID_M_PLBL12;
96+
static const long ID_M_PBTN5;
97+
static const long ID_M_PLBL11;
98+
static const long ID_M_PBTN4;
9199
static const long ID_PANEL11;
92100
static const long ID_M_PSWP2;
93101
//*)
@@ -108,6 +116,8 @@ class pnlSettingsOutput: public wxPanel
108116
void OnlsliderOutputGainMove(wxCommandEvent& event);
109117
void OnbtnRestartStreamHeld(wxCommandEvent& event);
110118
void OnbtnStatsClick(wxCommandEvent& event);
119+
void OnbtnRtpMapClick(wxCommandEvent& event);
120+
void OnbtnChannelsClick(wxCommandEvent& event);
111121
//*)
112122
void OnSettingChanged(SettingEvent& event);
113123

0 commit comments

Comments
 (0)