Changeset 19 for lib/mpdconnection.cpp
- Timestamp:
- 12/31/07 11:58:35 (4 years ago)
- File:
-
- 1 edited
-
lib/mpdconnection.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lib/mpdconnection.cpp
r17 r19 185 185 */ 186 186 187 void MPDConnection::add(const QStringList &files) 188 { 189 QByteArray send = "command_list_begin\n"; 190 191 for(qint32 i = 0; i < files.size(); i++) { 192 send += "add \""; 193 send += files.at(i); 194 send += "\"\n"; 195 } 196 197 send += "command_list_end"; 198 199 sendCommand(send); 200 201 if(!commandOk()) 202 qDebug("Couldn't add song(s) to playlist"); 203 } 204 187 205 void MPDConnection::removeSongs(const QList<qint32> &items) 188 206 { … … 199 217 sendCommand(send); 200 218 201 if(!commandOk()) {219 if(!commandOk()) 202 220 qDebug("Couldn't remove songs from playlist"); 203 }204 221 } 205 222 … … 243 260 sendCommand("next"); 244 261 245 if(!commandOk()) {262 if(!commandOk()) 246 263 qDebug("Couldn't go to next track"); 247 }248 264 } 249 265 … … 258 274 sendCommand(data); 259 275 260 if(!commandOk()) {276 if(!commandOk()) 261 277 qDebug("Couldn't set pause"); 262 }263 278 } 264 279 … … 269 284 sendCommand(data); 270 285 271 if(!commandOk()) {286 if(!commandOk()) 272 287 qDebug("Couldn't start playing song"); 273 }274 288 } 275 289 … … 280 294 sendCommand(data); 281 295 282 if(!commandOk()) {296 if(!commandOk()) 283 297 qDebug("Couldn't start playing song id"); 284 }285 298 } 286 299 … … 289 302 sendCommand("previous"); 290 303 291 if(!commandOk()) {304 if(!commandOk()) 292 305 qDebug("Couldn't go to previous track"); 293 }294 306 } 295 307 … … 304 316 sendCommand(data); 305 317 306 if(!commandOk()) {318 if(!commandOk()) 307 319 qDebug("Couldn't toggle random"); 308 }309 320 } 310 321 … … 319 330 sendCommand(data); 320 331 321 if(!commandOk()) {332 if(!commandOk()) 322 333 qDebug("Couldn't toggle repeat"); 323 }324 334 } 325 335 … … 348 358 sendCommand(data); 349 359 350 if(!commandOk()) {360 if(!commandOk()) 351 361 qDebug("Couldn't set volume"); 352 }353 362 } 354 363 … … 357 366 sendCommand("stop"); 358 367 359 if(!commandOk()) {368 if(!commandOk()) 360 369 qDebug("Couldn't stop playing"); 361 }362 370 } 363 371
Note: See TracChangeset
for help on using the changeset viewer.
