6
6
#include " soundcardmanager.h"
7
7
#include " portaudio.h"
8
8
#include < map>
9
-
9
+ # include " log.h "
10
10
// (*InternalHeaders(pnlSettingsOutput)
11
11
#include < wx/font.h>
12
12
#include < wx/intl.h>
@@ -42,6 +42,10 @@ const long pnlSettingsOutput::ID_M_PLBL9 = wxNewId();
42
42
const long pnlSettingsOutput::ID_M_PBTN8 = wxNewId();
43
43
const long pnlSettingsOutput::ID_M_PBTN9 = wxNewId();
44
44
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();
45
49
const long pnlSettingsOutput::ID_PANEL11 = wxNewId();
46
50
const long pnlSettingsOutput::ID_M_PSWP2 = wxNewId();
47
51
// *)
@@ -103,75 +107,91 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
103
107
m_plblOutputGain->SetFont (m_plblOutputGainFont);
104
108
pnlAoip = new wxPanel (m_pswpDestination, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T (" ID_PANEL11" ));
105
109
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" ));
107
111
m_pLbl1->SetBorderState (uiRect::BORDER_NONE);
108
112
m_pLbl1->GetUiRect ().SetGradient (0 );
109
113
m_pLbl1->SetForegroundColour (wxColour (255 ,255 ,255 ));
110
114
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" ));
112
116
m_ppnlAddress->SetForegroundColour (wxColour (0 ,0 ,0 ));
113
117
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" ));
115
119
m_pLbl2->SetBorderState (uiRect::BORDER_NONE);
116
120
m_pLbl2->GetUiRect ().SetGradient (0 );
117
121
m_pLbl2->SetForegroundColour (wxColour (255 ,255 ,255 ));
118
122
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" ));
120
124
m_pLbl9->SetBorderState (uiRect::BORDER_NONE);
121
125
m_pLbl9->GetUiRect ().SetGradient (0 );
122
126
m_pLbl9->SetForegroundColour (wxColour (255 ,255 ,255 ));
123
127
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" ));
125
129
m_pbtnRTSP->SetForegroundColour (wxColour (0 ,0 ,0 ));
126
130
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" ));
128
132
m_pLbl6->SetBorderState (uiRect::BORDER_NONE);
129
133
m_pLbl6->GetUiRect ().SetGradient (0 );
130
134
m_pLbl6->SetForegroundColour (wxColour (255 ,255 ,255 ));
131
135
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" ));
133
137
m_pedtRTSPPort->SetValidation (4 );
134
138
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" ));
136
140
m_pLbl7->SetBorderState (uiRect::BORDER_NONE);
137
141
m_pLbl7->GetUiRect ().SetGradient (0 );
138
142
m_pLbl7->SetForegroundColour (wxColour (255 ,255 ,255 ));
139
143
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 ));
141
145
m_plstPacket->SetBackgroundColour (wxColour (0 ,0 ,0 ));
142
146
m_plstPacket->SetButtonColour (wxColour (wxT (" #004040" )));
143
147
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" ));
145
149
m_pedtRTPPort->SetValidation (4 );
146
150
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" ));
148
152
m_pbtnRestartStream->SetBackgroundColour (wxColour (255 ,0 ,0 ));
149
153
wxFont m_pbtnRestartStreamFont (12 ,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false ,_T (" Tahoma" ),wxFONTENCODING_DEFAULT);
150
154
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" ));
152
156
m_pbtnStats->SetBackgroundColour (wxColour (64 ,128 ,128 ));
153
157
wxFont m_pbtnStatsFont (12 ,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false ,_T (" Tahoma" ),wxFONTENCODING_DEFAULT);
154
158
m_pbtnStats->SetFont (m_pbtnStatsFont);
155
159
m_pkbd = new wmKeyboard (pnlAoip, ID_M_PKBD2, wxPoint (10 ,160 ), wxSize (240 ,200 ), 5 , 0 );
156
160
m_pkbd->SetForegroundColour (wxColour (255 ,255 ,255 ));
157
161
wxFont m_pkbdFont (10 ,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false ,_T (" Arial" ),wxFONTENCODING_DEFAULT);
158
162
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" ));
160
164
m_pLbl10->SetBorderState (uiRect::BORDER_NONE);
161
165
m_pLbl10->GetUiRect ().SetGradient (0 );
162
166
m_pLbl10->SetForegroundColour (wxColour (255 ,255 ,255 ));
163
167
m_pLbl10->SetBackgroundColour (wxColour (61 ,120 ,218 ));
164
168
wxFont m_pLbl10Font (10 ,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false ,wxEmptyString,wxFONTENCODING_DEFAULT);
165
169
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" ));
167
171
m_pbtnDNS->SetBackgroundColour (wxColour (61 ,120 ,218 ));
168
172
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" ));
170
174
m_pbtnSAP->SetBackgroundColour (wxColour (61 ,120 ,218 ));
171
175
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" ));
173
177
m_pbtnStream->SetBackgroundColour (wxColour (0 ,128 ,0 ));
174
178
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 ));
175
195
m_pswpDestination->AddPage (pnlDisabled, _ (" Disabled" ), false );
176
196
m_pswpDestination->AddPage (pnlSoundcard, _ (" Soundcard" ), false );
177
197
m_pswpDestination->AddPage (pnlAoip, _ (" AoIP" ), false );
@@ -189,6 +209,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
189
209
Connect (ID_M_PBTN8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnDNSClick);
190
210
Connect (ID_M_PBTN9,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnSAPClick);
191
211
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);
192
214
// *)
193
215
194
216
SetSize (size);
@@ -225,6 +247,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
225
247
Settings::Get ().AddHandler (wxT (" Server" ), wxT (" Stream" ), this );
226
248
Settings::Get ().AddHandler (wxT (" Server" ), wxT (" SAP" ), this );
227
249
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 );
228
252
229
253
Connect (wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&pnlSettingsOutput::OnSettingChanged);
230
254
}
@@ -254,6 +278,9 @@ void pnlSettingsOutput::UpdateDisplayedSettings()
254
278
bool bMulticast (Settings::Get ().Read (wxT (" Server" ), wxT (" Stream" ), " Unicast" ) == " Multicast" );
255
279
m_pbtnStream->ToggleSelection (bMulticast);
256
280
281
+ m_pbtnRtpMap->SetLabel (Settings::Get ().Read (" Server" , " RTPMap" , " 96" ));
282
+ m_pbtnChannels->SetLabel (Settings::Get ().Read (" Server" , " Channels" , " 2" ));
283
+
257
284
m_pbtnSAP->Show (bMulticast);
258
285
259
286
m_pLbl1->Show (bMulticast);
@@ -306,6 +333,14 @@ void pnlSettingsOutput::OnSettingChanged(SettingEvent& event)
306
333
{
307
334
m_pbtnSAP->ToggleSelection (Settings::Get ().Read (" Server" , " SAP" , 0 ));
308
335
}
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
+ }
309
344
}
310
345
}
311
346
@@ -458,3 +493,36 @@ void pnlSettingsOutput::OnbtnStatsClick(wxCommandEvent& event)
458
493
{
459
494
Settings::Get ().Write (" Splash" , " Screen" , " RTCP" );
460
495
}
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
+ }
0 commit comments