Switch to unified view

a/src/upmpd.cxx b/src/upmpd.cxx
...
...
159
// them.
159
// them.
160
static string ohDesc(
160
static string ohDesc(
161
    "<service>"
161
    "<service>"
162
    "  <serviceType>urn:av-openhome-org:service:Product:1</serviceType>"
162
    "  <serviceType>urn:av-openhome-org:service:Product:1</serviceType>"
163
    "  <serviceId>urn:av-openhome-org:serviceId:Product</serviceId>"
163
    "  <serviceId>urn:av-openhome-org:serviceId:Product</serviceId>"
164
    "  <SCPDURL>/OHProduct.xml</SCPDURL>"
164
    "  <SCPDURL>/upmpd/OHProduct.xml</SCPDURL>"
165
    "  <controlURL>/ctl/OHProduct</controlURL>"
165
    "  <controlURL>/ctl/OHProduct</controlURL>"
166
    "  <eventSubURL>/evt/OHProduct</eventSubURL>"
166
    "  <eventSubURL>/evt/OHProduct</eventSubURL>"
167
    "</service>"
167
    "</service>"
168
    "<service>"
168
    "<service>"
169
    "  <serviceType>urn:av-openhome-org:service:Info:1</serviceType>"
169
    "  <serviceType>urn:av-openhome-org:service:Info:1</serviceType>"
170
    "  <serviceId>urn:av-openhome-org:serviceId:Info</serviceId>"
170
    "  <serviceId>urn:av-openhome-org:serviceId:Info</serviceId>"
171
    "  <SCPDURL>/OHInfo.xml</SCPDURL>"
171
    "  <SCPDURL>/upmpd/OHInfo.xml</SCPDURL>"
172
    "  <controlURL>/ctl/OHInfo</controlURL>"
172
    "  <controlURL>/ctl/OHInfo</controlURL>"
173
    "  <eventSubURL>/evt/OHInfo</eventSubURL>"
173
    "  <eventSubURL>/evt/OHInfo</eventSubURL>"
174
    "</service>"
174
    "</service>"
175
    "<service>"
175
    "<service>"
176
    "  <serviceType>urn:av-openhome-org:service:Time:1</serviceType>"
176
    "  <serviceType>urn:av-openhome-org:service:Time:1</serviceType>"
177
    "  <serviceId>urn:av-openhome-org:serviceId:Time</serviceId>"
177
    "  <serviceId>urn:av-openhome-org:serviceId:Time</serviceId>"
178
    "  <SCPDURL>/OHTime.xml</SCPDURL>"
178
    "  <SCPDURL>/upmpd/OHTime.xml</SCPDURL>"
179
    "  <controlURL>/ctl/OHTime</controlURL>"
179
    "  <controlURL>/ctl/OHTime</controlURL>"
180
    "  <eventSubURL>/evt/OHTime</eventSubURL>"
180
    "  <eventSubURL>/evt/OHTime</eventSubURL>"
181
    "</service>"
181
    "</service>"
182
    "<service>"
182
    "<service>"
183
    "  <serviceType>urn:av-openhome-org:service:Volume:1</serviceType>"
183
    "  <serviceType>urn:av-openhome-org:service:Volume:1</serviceType>"
184
    "  <serviceId>urn:av-openhome-org:serviceId:Volume</serviceId>"
184
    "  <serviceId>urn:av-openhome-org:serviceId:Volume</serviceId>"
185
    "  <SCPDURL>/OHVolume.xml</SCPDURL>"
185
    "  <SCPDURL>/upmpd/OHVolume.xml</SCPDURL>"
186
    "  <controlURL>/ctl/OHVolume</controlURL>"
186
    "  <controlURL>/ctl/OHVolume</controlURL>"
187
    "  <eventSubURL>/evt/OHVolume</eventSubURL>"
187
    "  <eventSubURL>/evt/OHVolume</eventSubURL>"
188
    "</service>"
188
    "</service>"
189
    "<service>"
189
    "<service>"
190
    "  <serviceType>urn:av-openhome-org:service:Playlist:1</serviceType>"
190
    "  <serviceType>urn:av-openhome-org:service:Playlist:1</serviceType>"
191
    "  <serviceId>urn:av-openhome-org:serviceId:Playlist</serviceId>"
191
    "  <serviceId>urn:av-openhome-org:serviceId:Playlist</serviceId>"
192
    "  <SCPDURL>/OHPlaylist.xml</SCPDURL>"
192
    "  <SCPDURL>/upmpd/OHPlaylist.xml</SCPDURL>"
193
    "  <controlURL>/ctl/OHPlaylist</controlURL>"
193
    "  <controlURL>/ctl/OHPlaylist</controlURL>"
194
    "  <eventSubURL>/evt/OHPlaylist</eventSubURL>"
194
    "  <eventSubURL>/evt/OHPlaylist</eventSubURL>"
195
    "</service>"
195
    "</service>"
196
    );
196
    );
197
197
...
...
199
// songcast-to-mpd gateway command is available
199
// songcast-to-mpd gateway command is available
200
static string ohDescReceive(
200
static string ohDescReceive(
201
    "<service>"
201
    "<service>"
202
    "  <serviceType>urn:av-openhome-org:service:Receiver:1</serviceType>"
202
    "  <serviceType>urn:av-openhome-org:service:Receiver:1</serviceType>"
203
    "  <serviceId>urn:av-openhome-org:serviceId:Receiver</serviceId>"
203
    "  <serviceId>urn:av-openhome-org:serviceId:Receiver</serviceId>"
204
    "  <SCPDURL>/OHReceiver.xml</SCPDURL>"
204
    "  <SCPDURL>/upmpd/OHReceiver.xml</SCPDURL>"
205
    "  <controlURL>/ctl/OHReceiver</controlURL>"
205
    "  <controlURL>/ctl/OHReceiver</controlURL>"
206
    "  <eventSubURL>/evt/OHReceiver</eventSubURL>"
206
    "  <eventSubURL>/evt/OHReceiver</eventSubURL>"
207
    "</service>"
207
    "</service>"
208
    );
208
    );
209
209
...
...
212
    "  <icon>"
212
    "  <icon>"
213
    "    <mimetype>image/png</mimetype>"
213
    "    <mimetype>image/png</mimetype>"
214
    "    <width>64</width>"
214
    "    <width>64</width>"
215
    "    <height>64</height>"
215
    "    <height>64</height>"
216
    "    <depth>32</depth>"
216
    "    <depth>32</depth>"
217
    "    <url>/icon.png</url>"
217
    "    <url>/upmpd/icon.png</url>"
218
    "  </icon>"
218
    "  </icon>"
219
    "</iconList>"
219
    "</iconList>"
220
    );
220
    );
221
221
222
// Our XML description data. !Keep description.xml first!
222
// Our XML description data. !Keep description.xml first!
...
...
565
            LOGERR("Failed reading " << iconpath << " : " << reason << endl);
565
            LOGERR("Failed reading " << iconpath << " : " << reason << endl);
566
        }
566
        }
567
    }
567
    }
568
568
569
    unordered_map<string, VDirContent> files;
569
    unordered_map<string, VDirContent> files;
570
    string dir("/upmpd/");
570
    for (unsigned int i = 0; i < xmlfilenames.size(); i++) {
571
    for (unsigned int i = 0; i < xmlfilenames.size(); i++) {
571
        string filename = path_cat(datadir, xmlfilenames[i]);
572
        string filename = path_cat(datadir, xmlfilenames[i]);
572
        string data;
573
        string data;
573
        if (!file_to_string(filename, data, &reason)) {
574
        if (!file_to_string(filename, data, &reason)) {
574
            LOGFAT("Failed reading " << filename << " : " << reason << endl);
575
            LOGFAT("Failed reading " << filename << " : " << reason << endl);
...
...
590
                data = regsub1("@ICONLIST@", data, iconDesc);
591
                data = regsub1("@ICONLIST@", data, iconDesc);
591
            else
592
            else
592
                data = regsub1("@ICONLIST@", data, "");
593
                data = regsub1("@ICONLIST@", data, "");
593
        }
594
        }
594
        files.insert(pair<string, VDirContent>
595
        files.insert(pair<string, VDirContent>
596
                     (dir + xmlfilenames[i], 
595
                     (xmlfilenames[i], VDirContent(data, "application/xml")));
597
                      VDirContent(data, "application/xml")));
596
    }
598
    }
597
599
598
    if (!icondata.empty()) {
600
    if (!icondata.empty()) {
599
        files.insert(pair<string, VDirContent>
601
        files.insert(pair<string, VDirContent>
600
                     ("icon.png", VDirContent(icondata, "image/png")));
602
                     (dir + "icon.png", VDirContent(icondata, "image/png")));
601
    }
603
    }
602
604
603
    if (ownqueue)
605
    if (ownqueue)
604
        opts.options |= UpMpd::upmpdOwnQueue;
606
        opts.options |= UpMpd::upmpdOwnQueue;
605
    if (openhome)
607
    if (openhome)