@@ -16,7 +16,8 @@ PwarController::PwarController(QObject *parent)
1616
1717 // Initialize default config
1818 strcpy (m_config.stream_ip , " 192.168.66.3" );
19- m_config.stream_port = 8321 ;
19+ m_config.connect_port = 8321 ;
20+ m_config.listen_port = 8321 ;
2021 m_config.passthrough_test = 0 ;
2122 m_config.oneshot_mode = 0 ;
2223 m_config.buffer_size = 64 ;
@@ -71,14 +72,28 @@ void PwarController::setStreamIp(const QString &ip) {
7172 }
7273}
7374
74- int PwarController::streamPort () const {
75- return m_config.stream_port ;
75+ int PwarController::connectPort () const {
76+ return m_config.connect_port ;
7677}
7778
78- void PwarController::setStreamPort (int port) {
79- if (m_config.stream_port != port) {
80- m_config.stream_port = port;
81- emit streamPortChanged ();
79+ void PwarController::setConnectPort (int port) {
80+ if (m_config.connect_port != port) {
81+ m_config.connect_port = port;
82+ emit connectPortChanged ();
83+ if (pwar_is_running ()) {
84+ setStatus (" Port changed - stop and start to apply" );
85+ }
86+ }
87+ }
88+
89+ int PwarController::listenPort () const {
90+ return m_config.listen_port ;
91+ }
92+
93+ void PwarController::setListenPort (int port) {
94+ if (m_config.listen_port != port) {
95+ m_config.listen_port = port;
96+ emit listenPortChanged ();
8297 if (pwar_is_running ()) {
8398 setStatus (" Port changed - stop and start to apply" );
8499 }
@@ -249,8 +264,8 @@ void PwarController::loadSettings() {
249264 QString savedIp = m_settings->value (" network/streamIp" , QString (m_config.stream_ip )).toString ();
250265 setStreamIp (savedIp);
251266
252- int savedPort = m_settings->value (" network/streamPort " , m_config.stream_port ).toInt ();
253- setStreamPort (savedPort);
267+ int savedPort = m_settings->value (" network/connectPort " , m_config.connect_port ).toInt ();
268+ setConnectPort (savedPort);
254269
255270 // Load audio settings
256271 bool savedPassthrough = m_settings->value (" audio/passthroughTest" , m_config.passthrough_test ).toBool ();
@@ -278,7 +293,7 @@ void PwarController::saveSettings() {
278293
279294 // Save network settings
280295 m_settings->setValue (" network/streamIp" , streamIp ());
281- m_settings->setValue (" network/streamPort " , streamPort ());
296+ m_settings->setValue (" network/connectPort " , connectPort ());
282297
283298 // Save audio settings
284299 m_settings->setValue (" audio/passthroughTest" , passthroughTest ());
0 commit comments