@@ -38,6 +38,7 @@ class SnapClient {
38
38
p_decoder = &decoder;
39
39
p_output = &output_adapter;
40
40
p_client = &client;
41
+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
41
42
}
42
43
43
44
SnapClient (Client &client, AudioStream &stream, StreamingDecoder &decoder,
@@ -48,13 +49,15 @@ class SnapClient {
48
49
output_adapter.setStream (stream);
49
50
p_output = &output_adapter;
50
51
p_client = &client;
52
+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
51
53
}
52
54
53
55
SnapClient (Client &client, AudioOutput &output, AudioDecoder &decoder) {
54
56
p_decoder = &decoder;
55
57
p_output = &output;
56
58
p_client = &client;
57
- }
59
+ server_ip.fromString (CONFIG_SNAPCAST_SERVER_HOST);
60
+ }
58
61
59
62
SnapClient (Client &client, AudioOutput &output, StreamingDecoder &decoder,
60
63
int bufferSize = CONFIG_STREAMIN_DECODER_BUFFER) {
@@ -73,7 +76,7 @@ class SnapClient {
73
76
74
77
// / @brief Defines the Snapcast Server IP address
75
78
// / @param address
76
- void setServerIP (IPAddress ipAddress) { this ->address = ipAddress; }
79
+ void setServerIP (IPAddress ipAddress) { this ->server_ip = ipAddress; }
77
80
78
81
// / Defines the time synchronization logic
79
82
void setSnapTimeSync (SnapTimeSync &timeSync){
@@ -111,7 +114,8 @@ class SnapClient {
111
114
SnapTime::instance ().setupSNTPTime ();
112
115
#endif
113
116
114
- p_snapprocessor->setServerIP (address);
117
+ p_snapprocessor->setServerIP (server_ip);
118
+ p_snapprocessor->setServerPort (server_port);
115
119
p_snapprocessor->setOutput (*p_output);
116
120
p_snapprocessor->snapOutput ().setSnapTimeSync (*p_time_sync);
117
121
p_snapprocessor->setDecoder (*p_decoder);
@@ -158,7 +162,8 @@ class SnapClient {
158
162
AudioDecoder *p_decoder = nullptr ;
159
163
Client *p_client = nullptr ;
160
164
SnapTimeSync *p_time_sync = nullptr ;
161
- IPAddress address;
165
+ IPAddress server_ip;
166
+ int server_port = CONFIG_SNAPCAST_SERVER_PORT;
162
167
163
168
void setupMDNS () {
164
169
#if CONFIG_SNAPCLIENT_USE_MDNS && defined(ESP32)
0 commit comments