Skip to content

Commit

Permalink
Merge pull request #79 from martim01/rtpmap
Browse files Browse the repository at this point in the history
Rtpmap
  • Loading branch information
martim01 authored Jan 19, 2022
2 parents af54b94 + aace5fb commit e063d0f
Show file tree
Hide file tree
Showing 24 changed files with 316 additions and 82 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(pamworkspace VERSION 1.2.0.0)
project(pamworkspace VERSION 1.3.0.0)

SET(CMAKE_CXX_STANDARD 14)

Expand Down
2 changes: 1 addition & 1 deletion pam2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(pam2 LANGUAGES CXX VERSION 1.2.0.0)
project(pam2 LANGUAGES CXX VERSION 1.3.0.0)

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)

Expand Down
8 changes: 6 additions & 2 deletions pam2/dlgmask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <wx/intl.h>
#include <wx/string.h>
//*)

#include "log.h"
//(*IdInit(dlgMask)
const long dlgMask::ID_M_PLST1 = wxNewId();
//*)
Expand Down Expand Up @@ -66,6 +66,7 @@ void dlgMask::OnActivate(wxActivateEvent& event)
void dlgMask::OnlstSubnetSelected(wxCommandEvent& event)
{
m_sSelected = event.GetString();
pmlLog(pml::LOG_INFO) << "Selected a value " << m_sSelected;
if(HasCapture())
{
ReleaseMouse();
Expand All @@ -81,6 +82,7 @@ void dlgMask::OnLeftDown(wxMouseEvent& event)
{
ReleaseMouse();
}
pmlLog(pml::LOG_INFO) << "Clicked outside";
EndModal(wxID_CANCEL);
}
else
Expand All @@ -93,6 +95,8 @@ void dlgMask::OnLeftDown(wxMouseEvent& event)

void dlgMask::OnCaptureLost(wxMouseCaptureLostEvent& event)
{
pmlLog(pml::LOG_INFO) << "Capture lost";
wxPostEvent(m_plstSubnet, event);
EndModal(wxID_CANCEL);
// EndModal(wxID_CANCEL);
// CaptureMouse();
}
30 changes: 28 additions & 2 deletions pam2/pnlAoipManual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const long pnlAoipManual::ID_M_PLBL4 = wxNewId();
const long pnlAoipManual::ID_M_PLST5 = wxNewId();
const long pnlAoipManual::ID_M_PKBD2 = wxNewId();
const long pnlAoipManual::ID_M_PBTN3 = wxNewId();
const long pnlAoipManual::ID_M_PLBL11 = wxNewId();
const long pnlAoipManual::ID_M_PBTN4 = wxNewId();
//*)

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

Connect(ID_M_PBTN6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnSampleRateClick);
Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnStreamClick);
Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnRtpMapClick);
//*)
SetSize(size);
SetPosition(pos);
Expand Down Expand Up @@ -139,9 +150,9 @@ void pnlAoipManual::OnbtnStreamClick(wxCommandEvent& event)
<< "s=Manual SDP created by PAM\r\n"
<< "t=0 0\r\n"
<< "a=recvonly\r\n"
<< "m=audio " << m_pedtPort->GetValue() << " RTP/AVP 96\r\n"
<< "m=audio " << m_pedtPort->GetValue() << " RTP/AVP " << m_pbtnRtpMap->GetLabel() << "\r\n"
<< "c=IN IP4 " << m_pipServer->GetValue() << "/255\r\n"
<< "a=rtpmap:96 L" << (m_pbtnBits->IsChecked() ? "24" : "16") << "/" << m_pbtnSampleRate->GetLabel() << "/" << m_sChannels << "\r\n"
<< "a=rtpmap:" << m_pbtnRtpMap->GetLabel() <<" L" << (m_pbtnBits->IsChecked() ? "24" : "16") << "/" << m_pbtnSampleRate->GetLabel() << "/" << m_sChannels << "\r\n"
<< "a=mediaclk:direct=0\r\n";
//@todo grandmaster if we have one

Expand All @@ -158,3 +169,18 @@ void pnlAoipManual::OnbtnStreamClick(wxCommandEvent& event)
Settings::Get().Write("Input", "AoIP", 0); //write the new source number in
}
}

void pnlAoipManual::OnbtnRtpMapClick(wxCommandEvent& event)
{
wxArrayString asButtons;
for(int i = 96; i < 128; i++)
{
asButtons.Add(wxString::Format("%d", i));
}

dlgMask aDlg(this, asButtons, m_pbtnRtpMap->GetLabel(), wxNewId(), ClientToScreen(m_pbtnRtpMap->GetPosition()), m_pbtnRtpMap->GetSize());
if(aDlg.ShowModal()== wxID_OK)
{
m_pbtnRtpMap->SetLabel(aDlg.m_sSelected);
}
}
5 changes: 5 additions & 0 deletions pam2/pnlAoipManual.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class pnlAoipManual: public wxPanel

//(*Declarations(pnlAoipManual)
wmButton* m_pbtnBits;
wmButton* m_pbtnRtpMap;
wmButton* m_pbtnSampleRate;
wmButton* m_pbtnStream;
wmEdit* m_pedtPort;
Expand All @@ -28,6 +29,7 @@ class pnlAoipManual: public wxPanel
wmLabel* m_pLbl1;
wmLabel* m_pLbl2;
wmLabel* m_pLbl4;
wmLabel* m_pLbl8;
wmLabel* m_pLbl9;
wmList* m_plstChannels;
//*)
Expand All @@ -46,13 +48,16 @@ class pnlAoipManual: public wxPanel
static const long ID_M_PLST5;
static const long ID_M_PKBD2;
static const long ID_M_PBTN3;
static const long ID_M_PLBL11;
static const long ID_M_PBTN4;
//*)

private:

//(*Handlers(pnlAoipManual)
void OnbtnSampleRateClick(wxCommandEvent& event);
void OnbtnStreamClick(wxCommandEvent& event);
void OnbtnRtpMapClick(wxCommandEvent& event);
//*)
void OnlstChannelSelected(wxCommandEvent& event);

Expand Down
102 changes: 85 additions & 17 deletions pam2/pnlSettingsOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "soundcardmanager.h"
#include "portaudio.h"
#include <map>

#include "log.h"
//(*InternalHeaders(pnlSettingsOutput)
#include <wx/font.h>
#include <wx/intl.h>
Expand Down Expand Up @@ -42,6 +42,10 @@ const long pnlSettingsOutput::ID_M_PLBL9 = wxNewId();
const long pnlSettingsOutput::ID_M_PBTN8 = wxNewId();
const long pnlSettingsOutput::ID_M_PBTN9 = wxNewId();
const long pnlSettingsOutput::ID_M_PBTN3 = wxNewId();
const long pnlSettingsOutput::ID_M_PLBL12 = wxNewId();
const long pnlSettingsOutput::ID_M_PBTN5 = wxNewId();
const long pnlSettingsOutput::ID_M_PLBL11 = wxNewId();
const long pnlSettingsOutput::ID_M_PBTN4 = wxNewId();
const long pnlSettingsOutput::ID_PANEL11 = wxNewId();
const long pnlSettingsOutput::ID_M_PSWP2 = wxNewId();
//*)
Expand Down Expand Up @@ -103,75 +107,91 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
m_plblOutputGain->SetFont(m_plblOutputGainFont);
pnlAoip = new wxPanel(m_pswpDestination, ID_PANEL11, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL11"));
pnlAoip->SetBackgroundColour(wxColour(0,0,0));
m_pLbl1 = new wmLabel(pnlAoip, ID_M_PLBL1, _("Multicast"), wxPoint(0,65), wxSize(100,40), 0, _T("ID_M_PLBL1"));
m_pLbl1 = new wmLabel(pnlAoip, ID_M_PLBL1, _("Multicast"), wxPoint(0,55), wxSize(100,40), 0, _T("ID_M_PLBL1"));
m_pLbl1->SetBorderState(uiRect::BORDER_NONE);
m_pLbl1->GetUiRect().SetGradient(0);
m_pLbl1->SetForegroundColour(wxColour(255,255,255));
m_pLbl1->SetBackgroundColour(wxColour(64,0,128));
m_ppnlAddress = new wmipeditpnl(pnlAoip, ID_PANEL12, wxPoint(100,65), wxSize(200,40), wxTAB_TRAVERSAL, _T("ID_PANEL12"));
m_ppnlAddress = new wmipeditpnl(pnlAoip, ID_PANEL12, wxPoint(100,55), wxSize(200,40), wxTAB_TRAVERSAL, _T("ID_PANEL12"));
m_ppnlAddress->SetForegroundColour(wxColour(0,0,0));
m_ppnlAddress->SetBackgroundColour(wxColour(255,255,255));
m_pLbl2 = new wmLabel(pnlAoip, ID_M_PLBL2, _("RTP Port"), wxPoint(300,65), wxSize(50,40), 0, _T("ID_M_PLBL2"));
m_pLbl2 = new wmLabel(pnlAoip, ID_M_PLBL2, _("RTP Port"), wxPoint(300,55), wxSize(50,40), 0, _T("ID_M_PLBL2"));
m_pLbl2->SetBorderState(uiRect::BORDER_NONE);
m_pLbl2->GetUiRect().SetGradient(0);
m_pLbl2->SetForegroundColour(wxColour(255,255,255));
m_pLbl2->SetBackgroundColour(wxColour(64,0,128));
m_pLbl9 = new wmLabel(pnlAoip, ID_M_PLBL8, _("RTSP"), wxPoint(0,15), wxSize(100,40), 0, _T("ID_M_PLBL8"));
m_pLbl9 = new wmLabel(pnlAoip, ID_M_PLBL8, _("RTSP"), wxPoint(0,10), wxSize(100,40), 0, _T("ID_M_PLBL8"));
m_pLbl9->SetBorderState(uiRect::BORDER_NONE);
m_pLbl9->GetUiRect().SetGradient(0);
m_pLbl9->SetForegroundColour(wxColour(255,255,255));
m_pLbl9->SetBackgroundColour(wxColour(64,0,128));
m_pbtnRTSP = new wmButton(pnlAoip, ID_M_PBTN6, _("Stream"), wxPoint(100,15), wxSize(200,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6"));
m_pbtnRTSP = new wmButton(pnlAoip, ID_M_PBTN6, _("Stream"), wxPoint(100,10), wxSize(200,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6"));
m_pbtnRTSP->SetForegroundColour(wxColour(0,0,0));
m_pbtnRTSP->SetBackgroundColour(wxColour(255,255,255));
m_pLbl6 = new wmLabel(pnlAoip, ID_M_PLBL6, _("Port"), wxPoint(300,15), wxSize(50,40), 0, _T("ID_M_PLBL6"));
m_pLbl6 = new wmLabel(pnlAoip, ID_M_PLBL6, _("Port"), wxPoint(300,10), wxSize(50,40), 0, _T("ID_M_PLBL6"));
m_pLbl6->SetBorderState(uiRect::BORDER_NONE);
m_pLbl6->GetUiRect().SetGradient(0);
m_pLbl6->SetForegroundColour(wxColour(255,255,255));
m_pLbl6->SetBackgroundColour(wxColour(64,0,128));
m_pedtRTSPPort = new wmEdit(pnlAoip, ID_M_PEDT3, wxEmptyString, wxPoint(350,15), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3"));
m_pedtRTSPPort = new wmEdit(pnlAoip, ID_M_PEDT3, wxEmptyString, wxPoint(350,10), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3"));
m_pedtRTSPPort->SetValidation(4);
m_pedtRTSPPort->SetBorderStyle(1,1);
m_pLbl7 = new wmLabel(pnlAoip, ID_M_PLBL7, _("Packet Time"), wxPoint(0,110), wxSize(100,40), 0, _T("ID_M_PLBL7"));
m_pLbl7 = new wmLabel(pnlAoip, ID_M_PLBL7, _("Packet Time"), wxPoint(0,100), wxSize(100,40), 0, _T("ID_M_PLBL7"));
m_pLbl7->SetBorderState(uiRect::BORDER_NONE);
m_pLbl7->GetUiRect().SetGradient(0);
m_pLbl7->SetForegroundColour(wxColour(255,255,255));
m_pLbl7->SetBackgroundColour(wxColour(64,0,128));
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));
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));
m_plstPacket->SetBackgroundColour(wxColour(0,0,0));
m_plstPacket->SetButtonColour(wxColour(wxT("#004040")));
m_plstPacket->SetSelectedButtonColour(wxColour(wxT("#FF8000")));
m_pedtRTPPort = new wmEdit(pnlAoip, ID_M_PEDT2, wxEmptyString, wxPoint(350,65), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT2"));
m_pedtRTPPort = new wmEdit(pnlAoip, ID_M_PEDT2, wxEmptyString, wxPoint(350,55), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT2"));
m_pedtRTPPort->SetValidation(4);
m_pedtRTPPort->SetBorderStyle(1,1);
m_pbtnRestartStream = new wmButton(pnlAoip, ID_M_PBTN1, _("Restart Stream"), wxPoint(470,15), wxSize(120,40), wmButton::STYLE_HOLD, wxDefaultValidator, _T("ID_M_PBTN1"));
m_pbtnRestartStream = new wmButton(pnlAoip, ID_M_PBTN1, _("Restart Stream"), wxPoint(470,10), wxSize(120,40), wmButton::STYLE_HOLD, wxDefaultValidator, _T("ID_M_PBTN1"));
m_pbtnRestartStream->SetBackgroundColour(wxColour(255,0,0));
wxFont m_pbtnRestartStreamFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT);
m_pbtnRestartStream->SetFont(m_pbtnRestartStreamFont);
m_pbtnStats = new wmButton(pnlAoip, ID_M_PBTN2, _("RTCP Stats"), wxPoint(470,65), wxSize(120,40), 0, wxDefaultValidator, _T("ID_M_PBTN2"));
m_pbtnStats = new wmButton(pnlAoip, ID_M_PBTN2, _("RTCP Stats"), wxPoint(470,55), wxSize(120,40), 0, wxDefaultValidator, _T("ID_M_PBTN2"));
m_pbtnStats->SetBackgroundColour(wxColour(64,128,128));
wxFont m_pbtnStatsFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT);
m_pbtnStats->SetFont(m_pbtnStatsFont);
m_pkbd = new wmKeyboard(pnlAoip, ID_M_PKBD2, wxPoint(10,160), wxSize(240,200), 5, 0);
m_pkbd->SetForegroundColour(wxColour(255,255,255));
wxFont m_pkbdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
m_pkbd->SetFont(m_pkbdFont);
m_pLbl10 = new wmLabel(pnlAoip, ID_M_PLBL9, _("Advertise"), wxPoint(260,215), wxSize(330,30), 0, _T("ID_M_PLBL9"));
m_pLbl10 = new wmLabel(pnlAoip, ID_M_PLBL9, _("Advertise"), wxPoint(260,250), wxSize(330,30), 0, _T("ID_M_PLBL9"));
m_pLbl10->SetBorderState(uiRect::BORDER_NONE);
m_pLbl10->GetUiRect().SetGradient(0);
m_pLbl10->SetForegroundColour(wxColour(255,255,255));
m_pLbl10->SetBackgroundColour(wxColour(61,120,218));
wxFont m_pLbl10Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
m_pLbl10->SetFont(m_pLbl10Font);
m_pbtnDNS = new wmButton(pnlAoip, ID_M_PBTN8, _("mDNS-SD"), wxPoint(300,250), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN8"));
m_pbtnDNS = new wmButton(pnlAoip, ID_M_PBTN8, _("mDNS-SD"), wxPoint(300,285), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN8"));
m_pbtnDNS->SetBackgroundColour(wxColour(61,120,218));
m_pbtnDNS->SetToggle(true, wxT("Off"), wxT("On"), 40);
m_pbtnSAP = new wmButton(pnlAoip, ID_M_PBTN9, _("SAP"), wxPoint(300,300), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN9"));
m_pbtnSAP = new wmButton(pnlAoip, ID_M_PBTN9, _("SAP"), wxPoint(300,330), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN9"));
m_pbtnSAP->SetBackgroundColour(wxColour(61,120,218));
m_pbtnSAP->SetToggle(true, wxT("Off"), wxT("On"), 40);
m_pbtnStream = new wmButton(pnlAoip, ID_M_PBTN3, _("Stream"), wxPoint(300,160), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3"));
m_pbtnStream = new wmButton(pnlAoip, ID_M_PBTN3, _("Stream"), wxPoint(300,200), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3"));
m_pbtnStream->SetBackgroundColour(wxColour(0,128,0));
m_pbtnStream->SetToggle(true, wxT("Unicast"), wxT("Multicast"), 40);
m_pLbl11 = new wmLabel(pnlAoip, ID_M_PLBL12, _("Channels"), wxPoint(300,145), wxSize(70,40), 0, _T("ID_M_PLBL12"));
m_pLbl11->SetBorderState(uiRect::BORDER_NONE);
m_pLbl11->GetUiRect().SetGradient(0);
m_pLbl11->SetForegroundColour(wxColour(255,255,255));
m_pLbl11->SetBackgroundColour(wxColour(64,0,128));
m_pbtnChannels = new wmButton(pnlAoip, ID_M_PBTN5, _("2"), wxPoint(370,145), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN5"));
m_pbtnChannels->SetForegroundColour(wxColour(0,0,0));
m_pbtnChannels->SetBackgroundColour(wxColour(255,255,255));
m_pLbl8 = new wmLabel(pnlAoip, ID_M_PLBL11, _("RTPMap"), wxPoint(438,145), wxSize(70,40), 0, _T("ID_M_PLBL11"));
m_pLbl8->SetBorderState(uiRect::BORDER_NONE);
m_pLbl8->GetUiRect().SetGradient(0);
m_pLbl8->SetForegroundColour(wxColour(255,255,255));
m_pLbl8->SetBackgroundColour(wxColour(64,0,128));
m_pbtnRtpMap = new wmButton(pnlAoip, ID_M_PBTN4, _("96"), wxPoint(508,145), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN4"));
m_pbtnRtpMap->SetForegroundColour(wxColour(0,0,0));
m_pbtnRtpMap->SetBackgroundColour(wxColour(255,255,255));
m_pswpDestination->AddPage(pnlDisabled, _("Disabled"), false);
m_pswpDestination->AddPage(pnlSoundcard, _("Soundcard"), false);
m_pswpDestination->AddPage(pnlAoip, _("AoIP"), false);
Expand All @@ -189,6 +209,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
Connect(ID_M_PBTN8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnDNSClick);
Connect(ID_M_PBTN9,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnSAPClick);
Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnStreamClick);
Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnChannelsClick);
Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsOutput::OnbtnRtpMapClick);
//*)

SetSize(size);
Expand Down Expand Up @@ -225,6 +247,8 @@ pnlSettingsOutput::pnlSettingsOutput(wxWindow* parent,wxWindowID id,const wxPoin
Settings::Get().AddHandler(wxT("Server"), wxT("Stream"), this);
Settings::Get().AddHandler(wxT("Server"), wxT("SAP"), this);
Settings::Get().AddHandler(wxT("Server"), wxT("DNS-SD"), this);
Settings::Get().AddHandler(wxT("Server"), wxT("RTPMap"), this);
Settings::Get().AddHandler(wxT("Server"), wxT("Channels"), this);

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

m_pbtnRtpMap->SetLabel(Settings::Get().Read("Server", "RTPMap", "96"));
m_pbtnChannels->SetLabel(Settings::Get().Read("Server", "Channels", "2"));

m_pbtnSAP->Show(bMulticast);

m_pLbl1->Show(bMulticast);
Expand Down Expand Up @@ -306,6 +333,14 @@ void pnlSettingsOutput::OnSettingChanged(SettingEvent& event)
{
m_pbtnSAP->ToggleSelection(Settings::Get().Read("Server", "SAP", 0));
}
else if(event.GetKey() == "RTPMap")
{
m_pbtnRtpMap->SetLabel(event.GetValue());
}
else if(event.GetKey() == "Channels")
{
m_pbtnChannels->SetLabel(event.GetValue());
}
}
}

Expand Down Expand Up @@ -458,3 +493,36 @@ void pnlSettingsOutput::OnbtnStatsClick(wxCommandEvent& event)
{
Settings::Get().Write("Splash", "Screen", "RTCP");
}

void pnlSettingsOutput::OnbtnRtpMapClick(wxCommandEvent& event)
{
wxArrayString asButtons;
for(int i = 96; i < 128; i++)
{
asButtons.Add(wxString::Format("%d", i));
}

dlgMask aDlg(this, asButtons, m_pbtnRtpMap->GetLabel(), wxNewId(), ClientToScreen(m_pbtnRtpMap->GetPosition()), m_pbtnRtpMap->GetSize());
if(aDlg.ShowModal()== wxID_OK)
{
m_pbtnRtpMap->SetLabel(aDlg.m_sSelected);
pmlLog(pml::LOG_TRACE) << "RTPMAP: " << aDlg.m_sSelected.ToStdString();
Settings::Get().Write("Server", "RTPMap", aDlg.m_sSelected);
}
}

void pnlSettingsOutput::OnbtnChannelsClick(wxCommandEvent& event)
{
wxArrayString asButtons;
for(int i = 1; i < 9; i++)
{
asButtons.Add(wxString::Format("%d", i));
}

dlgMask aDlg(this, asButtons, m_pbtnChannels->GetLabel(), wxNewId(), ClientToScreen(m_pbtnChannels->GetPosition()), m_pbtnChannels->GetSize());
if(aDlg.ShowModal()== wxID_OK)
{
m_pbtnChannels->SetLabel(aDlg.m_sSelected);
Settings::Get().Write("Server", "Channels", aDlg.m_sSelected);
}
}
10 changes: 10 additions & 0 deletions pam2/pnlSettingsOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,27 @@ class pnlSettingsOutput: public wxPanel
void ShowSoundcardOutputs();

//(*Declarations(pnlSettingsOutput)
wmButton* m_pbtnChannels;
wmButton* m_pbtnDNS;
wmButton* m_pbtnRTSP;
wmButton* m_pbtnRestartStream;
wmButton* m_pbtnRtpMap;
wmButton* m_pbtnSAP;
wmButton* m_pbtnStats;
wmButton* m_pbtnStream;
wmEdit* m_pedtRTPPort;
wmEdit* m_pedtRTSPPort;
wmKeyboard* m_pkbd;
wmLabel* m_pLbl10;
wmLabel* m_pLbl11;
wmLabel* m_pLbl1;
wmLabel* m_pLbl2;
wmLabel* m_pLbl3;
wmLabel* m_pLbl4;
wmLabel* m_pLbl5;
wmLabel* m_pLbl6;
wmLabel* m_pLbl7;
wmLabel* m_pLbl8;
wmLabel* m_pLbl9;
wmLabel* m_plblOutputGain;
wmList* m_plstDestination;
Expand Down Expand Up @@ -88,6 +92,10 @@ class pnlSettingsOutput: public wxPanel
static const long ID_M_PBTN8;
static const long ID_M_PBTN9;
static const long ID_M_PBTN3;
static const long ID_M_PLBL12;
static const long ID_M_PBTN5;
static const long ID_M_PLBL11;
static const long ID_M_PBTN4;
static const long ID_PANEL11;
static const long ID_M_PSWP2;
//*)
Expand All @@ -108,6 +116,8 @@ class pnlSettingsOutput: public wxPanel
void OnlsliderOutputGainMove(wxCommandEvent& event);
void OnbtnRestartStreamHeld(wxCommandEvent& event);
void OnbtnStatsClick(wxCommandEvent& event);
void OnbtnRtpMapClick(wxCommandEvent& event);
void OnbtnChannelsClick(wxCommandEvent& event);
//*)
void OnSettingChanged(SettingEvent& event);

Expand Down
Loading

0 comments on commit e063d0f

Please sign in to comment.