00001
00002
00003
00004
00005
00006
00007
00008
00010
00011 #include "upnpcds.h"
00012 #include <qurl.h>
00013
00014 #include <qtextstream.h>
00015
00016 inline QString GetBool( bool bVal ) { return( (bVal) ? "1" : "0" ); }
00017
00020
00021
00022
00025
00026 CDSObject::CDSObject( const QString sId,
00027 const QString sTitle,
00028 const QString sParentId )
00029 {
00030 m_sId = sId;
00031 m_sParentId = sParentId;
00032 m_eType = OT_Container;
00033 m_sTitle = sTitle;
00034 m_bRestricted = true;
00035 m_sWriteStatus = "PROTECTED";
00036 m_nChildCount = 0;
00037 m_nUpdateId = 1;
00038
00039 HTTPRequest::Encode( m_sId );
00040 HTTPRequest::Encode( m_sParentId );
00041 HTTPRequest::Encode( m_sTitle );
00042
00043 m_properties.setAutoDelete( true );
00044 m_children .setAutoDelete( true );
00045 m_resources .setAutoDelete( true );
00046
00047 }
00048
00050
00052
00053 CDSObject::~CDSObject()
00054 {
00055
00056 }
00057
00059
00061
00062 Property *CDSObject::AddProperty( Property *pProp )
00063 {
00064 if (pProp)
00065 m_properties.insert( pProp->m_sName, pProp );
00066
00067 return( pProp );
00068 }
00069
00071
00073
00074 void CDSObject::SetPropValue( QString sName, QString sValue )
00075 {
00076 Property *pProp = m_properties[ sName ];
00077
00078 if (pProp != NULL)
00079 {
00080 pProp->m_sValue = sValue;
00081 HTTPRequest::Encode( pProp->m_sValue );
00082 }
00083 }
00084
00086
00088
00089 QString CDSObject::GetPropValue( QString sName )
00090 {
00091 Property *pProp = m_properties[ sName ];
00092
00093 if (pProp != NULL)
00094 {
00095 QString sValue = pProp->m_sValue;
00096 QUrl::decode( sValue );
00097 return( sValue );
00098 }
00099
00100 return( "" );
00101 }
00102
00104
00106
00107 CDSObject *CDSObject::AddChild( CDSObject *pChild )
00108 {
00109 if (pChild)
00110 {
00111 pChild->m_sParentId = m_sId;
00112 m_children.append( pChild );
00113 }
00114
00115 return( pChild );
00116 }
00117
00119
00121
00122 long CDSObject::GetChildCount()
00123 {
00124 long nCount = m_children.count();
00125 if ( nCount == 0)
00126 return( m_nChildCount );
00127
00128 return( nCount );
00129 }
00130
00132
00134
00135 Resource *CDSObject::AddResource( QString sProtocol, QString sURI )
00136 {
00137 Resource *pRes = new Resource( sProtocol, sURI );
00138
00139 m_resources.append( pRes );
00140
00141 return( pRes );
00142 }
00143
00145
00147
00148 void CDSObject::SetChildCount( long nCount )
00149 {
00150 m_nChildCount = nCount;
00151 }
00152
00154
00156
00157 QString CDSObject::toXml()
00158 {
00159 QString sXML;
00160 QTextStream os( sXML, IO_WriteOnly );
00161
00162 os.setEncoding( QTextStream::UnicodeUTF8 );
00163
00164 toXml( os );
00165
00166 return( sXML );
00167 }
00168
00170
00172
00173 void CDSObject::toXml( QTextStream &os )
00174 {
00175 QString sEndTag = "";
00176 bool bFilter = false;
00177
00178
00179
00180
00181
00182
00183 switch( m_eType )
00184 {
00185 case OT_Container:
00186 {
00187 os << "<container id=\"" << m_sId << "\" parentID=\"" << m_sParentId
00188 << "\" childCount=\"" << GetChildCount() << "\" restricted=\"" << GetBool( m_bRestricted )
00189 << "\" searchable=\"" << GetBool( m_bSearchable ) << "\" >";
00190
00191 sEndTag = "</container>";
00192
00193 break;
00194 }
00195 case OT_Item:
00196 {
00197 os << "<item id=\"" << m_sId << "\" parentID=\"" << m_sParentId
00198 << "\" restricted=\"" << GetBool( m_bRestricted ) << "\" >";
00199
00200 sEndTag = "</item>";
00201
00202 break;
00203 }
00204 default: break;
00205 }
00206
00207 os << "<dc:title>" << m_sTitle << "</dc:title>";
00208 os << "<upnp:class>" << m_sClass << "</upnp:class>";
00209
00210
00211
00212
00213
00214 for( PropertiesIterator it( m_properties ); it.current(); ++it )
00215 {
00216 Property *pProp = it.current();
00217
00218 if (pProp->m_bRequired || (pProp->m_sValue.length() > 0))
00219 {
00220 QString sName;
00221
00222 if (pProp->m_sNameSpace.length() > 0)
00223 sName = pProp->m_sNameSpace + ":" + pProp->m_sName;
00224 else
00225 sName = pProp->m_sName;
00226
00227 if (pProp->m_bRequired || !bFilter )
00228 {
00229 os << "<" << sName << ">";
00230 os << pProp->m_sValue;
00231 os << "</" << sName << ">";
00232 }
00233 }
00234 }
00235
00236
00237
00238
00239
00240 for ( Resource *pRes = m_resources.first();
00241 pRes != NULL;
00242 pRes = m_resources.next() )
00243 {
00244 os << "<res protocolInfo=\"" << pRes->m_sProtocolInfo << "\" ";
00245
00246 for (NameValue *pNV = pRes->m_lstAttributes.first();
00247 pNV != NULL;
00248 pNV = pRes->m_lstAttributes.next())
00249 {
00250 os << pNV->sName << "=\"" << pNV->sValue << "\" ";
00251 }
00252
00253 os << ">" << pRes->m_sURI;
00254 os << "</res>\r\n";
00255 }
00256
00257
00258
00259
00260
00261 for ( CDSObject *pObject = m_children.first();
00262 pObject != NULL;
00263 pObject = m_children.next() )
00264 {
00265 pObject->toXml( os );
00266 }
00267
00268
00269
00270
00271
00272 os << sEndTag;
00273 }
00274
00275
00277
00279
00280 CDSObject *CDSObject::CreateItem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00281 {
00282 if (pObject == NULL)
00283 {
00284 pObject = new CDSObject( sId, sTitle, sParentId );
00285 pObject->m_sClass = "object.item";
00286 }
00287
00288 pObject->m_eType = OT_Item;
00289
00290 pObject->AddProperty( new Property( "refID" ) );
00291
00292 return( pObject );
00293 }
00294
00296
00297 CDSObject *CDSObject::CreateContainer( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00298 {
00299 if (pObject == NULL)
00300 {
00301 pObject = new CDSObject( sId, sTitle, sParentId );
00302 pObject->m_sClass = "object.container";
00303 }
00304
00305 pObject->m_eType = OT_Container;
00306
00307 pObject->AddProperty( new Property( "childCount" ));
00308 pObject->AddProperty( new Property( "createClass" ));
00309 pObject->AddProperty( new Property( "searchClass" ));
00310 pObject->AddProperty( new Property( "searchable" ));
00311
00312 return( pObject );
00313 }
00314
00316
00317 CDSObject *CDSObject::CreateAudioItem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00318 {
00319 if (pObject == NULL)
00320 {
00321 pObject = new CDSObject( sId, sTitle, sParentId );
00322 pObject->m_sClass = "object.item.audioItem";
00323 }
00324
00325 CreateItem( sId, sTitle, sParentId, pObject );
00326
00327 pObject->AddProperty( new Property( "genre" , "upnp" ));
00328 pObject->AddProperty( new Property( "description" , "dc" ));
00329 pObject->AddProperty( new Property( "longDescription" , "upnp" ));
00330 pObject->AddProperty( new Property( "publisher" , "dc" ));
00331 pObject->AddProperty( new Property( "language" , "dc" ));
00332 pObject->AddProperty( new Property( "relation" , "dc" ));
00333 pObject->AddProperty( new Property( "rights" , "dc" ));
00334
00335 return( pObject );
00336 }
00337
00339
00340 CDSObject *CDSObject::CreateMusicTrack( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00341 {
00342 if (pObject == NULL)
00343 {
00344 pObject = new CDSObject( sId, sTitle, sParentId );
00345 pObject->m_sClass = "object.item.audioItem.musicTrack";
00346 }
00347
00348 CreateAudioItem( sId, sTitle, sParentId, pObject );
00349
00350 pObject->AddProperty( new Property( "artist" , "upnp" ));
00351 pObject->AddProperty( new Property( "album" , "upnp" ));
00352 pObject->AddProperty( new Property( "originalTrackNumber" , "upnp" ));
00353 pObject->AddProperty( new Property( "playlist" , "upnp" ));
00354 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00355 pObject->AddProperty( new Property( "contributor" , "dc" ));
00356 pObject->AddProperty( new Property( "date" , "dc" ));
00357
00358 pObject->AddProperty( new Property( "albumArtURI" , "upnp" ));
00359
00360 return( pObject );
00361 }
00362
00364
00365 CDSObject *CDSObject::CreateAudioBroadcast( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00366 {
00367 if (pObject == NULL)
00368 {
00369 pObject = new CDSObject( sId, sTitle, sParentId );
00370 pObject->m_sClass = "object.item.audioItem.audioBroadcast";
00371 }
00372
00373 CreateAudioItem( sId, sTitle, sParentId, pObject );
00374
00375 pObject->AddProperty( new Property( "region" , "upnp" ));
00376 pObject->AddProperty( new Property( "radioCallSign" , "upnp" ));
00377 pObject->AddProperty( new Property( "radioStationID" , "upnp" ));
00378 pObject->AddProperty( new Property( "radioBand" , "upnp" ));
00379 pObject->AddProperty( new Property( "channelNr" , "upnp" ));
00380
00381 return( pObject );
00382 }
00383
00385
00386 CDSObject *CDSObject::CreateAudioBook( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00387 {
00388 if (pObject == NULL)
00389 {
00390 pObject = new CDSObject( sId, sTitle, sParentId );
00391 pObject->m_sClass = "object.item.audioItem.audioBook";
00392 }
00393
00394 CreateAudioItem( sId, sTitle, sParentId, pObject );
00395
00396 pObject->AddProperty( new Property( "storageMedium", "upnp" ));
00397 pObject->AddProperty( new Property( "producer" , "upnp" ));
00398 pObject->AddProperty( new Property( "contributor" , "dc" ));
00399 pObject->AddProperty( new Property( "date" , "dc" ));
00400
00401 return( pObject );
00402 }
00403
00405
00406 CDSObject *CDSObject::CreateVideoItem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00407 {
00408 if (pObject == NULL)
00409 {
00410 pObject = new CDSObject( sId, sTitle, sParentId );
00411 pObject->m_sClass = "object.item.videoItem";
00412 }
00413
00414 CreateItem( sId, sTitle, sParentId, pObject );
00415
00416 pObject->AddProperty( new Property( "genre" , "upnp" ));
00417 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00418 pObject->AddProperty( new Property( "producer" , "upnp" ));
00419 pObject->AddProperty( new Property( "rating" , "upnp" ));
00420 pObject->AddProperty( new Property( "actor" , "upnp" ));
00421 pObject->AddProperty( new Property( "director" , "upnp" ));
00422 pObject->AddProperty( new Property( "description" , "dc" ));
00423 pObject->AddProperty( new Property( "publisher" , "dc" ));
00424 pObject->AddProperty( new Property( "language" , "dc" ));
00425 pObject->AddProperty( new Property( "relation" , "dc" ));
00426
00427
00428
00429 pObject->AddProperty( new Property( "creator" , "dc" ));
00430 pObject->AddProperty( new Property( "artist" , "upnp" ));
00431 pObject->AddProperty( new Property( "album" , "upnp" ));
00432 pObject->AddProperty( new Property( "date" , "dc" ));
00433
00434 pObject->AddProperty( new Property( "albumArtURI" , "upnp" ));
00435
00436 return( pObject );
00437 }
00438
00440
00441 CDSObject *CDSObject::CreateMovie( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00442 {
00443 if (pObject == NULL)
00444 {
00445 pObject = new CDSObject( sId, sTitle, sParentId );
00446 pObject->m_sClass = "object.item.videoItem.movie";
00447 }
00448
00449 CreateVideoItem( sId, sTitle, sParentId, pObject );
00450
00451 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00452 pObject->AddProperty( new Property( "DVDRegionCode" , "upnp" ));
00453 pObject->AddProperty( new Property( "channelName" , "upnp" ));
00454 pObject->AddProperty( new Property( "scheduledStartTime", "upnp" ));
00455 pObject->AddProperty( new Property( "scheduledEndTime" , "upnp" ));
00456
00457 return( pObject );
00458 }
00459
00461
00462 CDSObject *CDSObject::CreateVideoBroadcast( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00463 {
00464 if (pObject == NULL)
00465 {
00466 pObject = new CDSObject( sId, sTitle, sParentId );
00467 pObject->m_sClass = "object.item.videoItem.videoBroadcast";
00468 }
00469
00470 CreateVideoItem( sId, sTitle, sParentId, pObject );
00471
00472 pObject->AddProperty( new Property( "icon" , "upnp" ));
00473 pObject->AddProperty( new Property( "region" , "upnp" ));
00474 pObject->AddProperty( new Property( "channelNr", "upnp" ));
00475
00476 return( pObject );
00477 }
00478
00480
00481 CDSObject *CDSObject::CreateMusicVideoClip( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00482 {
00483 if (pObject == NULL)
00484 {
00485 pObject = new CDSObject( sId, sTitle, sParentId );
00486 pObject->m_sClass = "object.item.videoItem.musicVideoClip";
00487 }
00488
00489 CreateVideoItem( sId, sTitle, sParentId, pObject );
00490
00491 pObject->AddProperty( new Property( "artist" , "upnp" ));
00492 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00493 pObject->AddProperty( new Property( "album" , "upnp" ));
00494 pObject->AddProperty( new Property( "scheduledStartTime", "upnp" ));
00495 pObject->AddProperty( new Property( "scheduledStopTime" , "upnp" ));
00496 pObject->AddProperty( new Property( "director" , "upnp" ));
00497 pObject->AddProperty( new Property( "contributor" , "dc" ));
00498 pObject->AddProperty( new Property( "date" , "dc" ));
00499
00500 return( pObject );
00501 }
00502
00504
00505 CDSObject *CDSObject::CreateImageItem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00506 {
00507 if (pObject == NULL)
00508 {
00509 pObject = new CDSObject( sId, sTitle, sParentId );
00510 pObject->m_sClass = "object.item.imageItem";
00511 }
00512
00513 CreateItem( sId, sTitle, sParentId, pObject );
00514
00515 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00516 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00517 pObject->AddProperty( new Property( "rating" , "upnp" ));
00518 pObject->AddProperty( new Property( "description" , "dc" ));
00519 pObject->AddProperty( new Property( "publisher" , "dc" ));
00520 pObject->AddProperty( new Property( "date" , "dc" ));
00521 pObject->AddProperty( new Property( "rights" , "dc" ));
00522
00523 return( pObject );
00524 }
00525
00527
00528 CDSObject *CDSObject::CreatePhoto( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00529 {
00530 if (pObject == NULL)
00531 {
00532 pObject = new CDSObject( sId, sTitle, sParentId );
00533 pObject->m_sClass = "object.item.imageItem.photo";
00534 }
00535
00536 CreateImageItem( sId, sTitle, sParentId, pObject );
00537
00538 pObject->AddProperty( new Property( "album", "upnp" ));
00539
00540 return( pObject );
00541 }
00542
00544
00545 CDSObject *CDSObject::CreatePlaylistItem ( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00546 {
00547 if (pObject == NULL)
00548 {
00549 pObject = new CDSObject( sId, sTitle, sParentId );
00550 pObject->m_sClass = "object.item.playlistItem";
00551 }
00552
00553 CreateItem( sId, sTitle, sParentId, pObject );
00554
00555 pObject->AddProperty( new Property( "artist" , "upnp" ));
00556 pObject->AddProperty( new Property( "genre" , "upnp" ));
00557 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00558 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00559 pObject->AddProperty( new Property( "description" , "dc" ));
00560 pObject->AddProperty( new Property( "date" , "dc" ));
00561 pObject->AddProperty( new Property( "language" , "dc" ));
00562
00563 return( pObject );
00564 }
00565
00567
00568 CDSObject *CDSObject::CreateTextItem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00569 {
00570 if (pObject == NULL)
00571 {
00572 pObject = new CDSObject( sId, sTitle, sParentId );
00573 pObject->m_sClass = "object.item.textItem";
00574 }
00575
00576 CreateItem( sId, sTitle, sParentId, pObject );
00577
00578 pObject->AddProperty( new Property( "author" , "upnp" ));
00579 pObject->AddProperty( new Property( "protection" , "upnp" ));
00580 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00581 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00582 pObject->AddProperty( new Property( "rating" , "upnp" ));
00583 pObject->AddProperty( new Property( "description" , "dc" ));
00584 pObject->AddProperty( new Property( "publisher" , "dc" ));
00585 pObject->AddProperty( new Property( "contributor" , "dc" ));
00586 pObject->AddProperty( new Property( "date" , "dc" ));
00587 pObject->AddProperty( new Property( "relation" , "dc" ));
00588 pObject->AddProperty( new Property( "language" , "dc" ));
00589 pObject->AddProperty( new Property( "rights" , "dc" ));
00590
00591 return( pObject );
00592 }
00593
00595
00596 CDSObject *CDSObject::CreateAlbum( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00597 {
00598 if (pObject == NULL)
00599 {
00600 pObject = new CDSObject( sId, sTitle, sParentId );
00601 pObject->m_sClass = "object.container.album";
00602 }
00603
00604 CreateContainer( sId, sTitle, sParentId, pObject );
00605
00606 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00607 pObject->AddProperty( new Property( "longDescription", "dc" ));
00608 pObject->AddProperty( new Property( "description" , "dc" ));
00609 pObject->AddProperty( new Property( "publisher" , "dc" ));
00610 pObject->AddProperty( new Property( "contributor" , "dc" ));
00611 pObject->AddProperty( new Property( "date" , "dc" ));
00612 pObject->AddProperty( new Property( "relation" , "dc" ));
00613 pObject->AddProperty( new Property( "rights" , "dc" ));
00614
00615 return( pObject );
00616 }
00617
00619
00620 CDSObject *CDSObject::CreateMusicAlbum( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00621 {
00622 if (pObject == NULL)
00623 {
00624 pObject = new CDSObject( sId, sTitle, sParentId );
00625 pObject->m_sClass = "object.container.album.musicAlbum";
00626 }
00627
00628 CreateAlbum( sId, sTitle, sParentId, pObject );
00629
00630 pObject->AddProperty( new Property( "artist" , "upnp" ));
00631 pObject->AddProperty( new Property( "genre" , "upnp" ));
00632 pObject->AddProperty( new Property( "producer" , "upnp" ));
00633 pObject->AddProperty( new Property( "albumArtURI", "upnp" ));
00634 pObject->AddProperty( new Property( "toc" , "upnp" ));
00635 return( pObject );
00636 }
00637
00639
00640 CDSObject *CDSObject::CreatePhotoAlbum( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00641 {
00642 if (pObject == NULL)
00643 {
00644 pObject = new CDSObject( sId, sTitle, sParentId );
00645 pObject->m_sClass = "object.container.album.photoAlbum";
00646 }
00647
00648 CreateAlbum( sId, sTitle, sParentId, pObject );
00649
00650 return( pObject );
00651 }
00652
00654
00655 CDSObject *CDSObject::CreateGenre( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00656 {
00657 if (pObject == NULL)
00658 {
00659 pObject = new CDSObject( sId, sTitle, sParentId );
00660 pObject->m_sClass = "object.container.genre";
00661 }
00662
00663 CreateContainer( sId, sTitle, sParentId, pObject );
00664
00665 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00666 pObject->AddProperty( new Property( "description" , "dc" ));
00667
00668 return( pObject );
00669 }
00670
00672
00673 CDSObject *CDSObject::CreateMusicGenre( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00674 {
00675 if (pObject == NULL)
00676 {
00677 pObject = new CDSObject( sId, sTitle, sParentId );
00678 pObject->m_sClass = "object.container.genre.musicGenre";
00679 }
00680
00681 CreateGenre( sId, sTitle, sParentId, pObject );
00682
00683 return( pObject );
00684 }
00685
00687
00688 CDSObject *CDSObject::CreateMovieGenre( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00689 {
00690 if (pObject == NULL)
00691 {
00692 pObject = new CDSObject( sId, sTitle, sParentId );
00693 pObject->m_sClass = "object.container.genre.movieGenre";
00694 }
00695
00696 CreateGenre( sId, sTitle, sParentId, pObject );
00697
00698 return( pObject );
00699 }
00700
00702
00703 CDSObject *CDSObject::CreatePlaylistContainer( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00704 {
00705 if (pObject == NULL)
00706 {
00707 pObject = new CDSObject( sId, sTitle, sParentId );
00708 pObject->m_sClass = "object.container.playlistContainer";
00709 }
00710
00711 CreateContainer( sId, sTitle, sParentId, pObject );
00712
00713 pObject->AddProperty( new Property( "artist" , "upnp" ));
00714 pObject->AddProperty( new Property( "genre" , "upnp" ));
00715 pObject->AddProperty( new Property( "longDescription", "upnp" ));
00716 pObject->AddProperty( new Property( "producer" , "upnp" ));
00717 pObject->AddProperty( new Property( "storageMedium" , "upnp" ));
00718 pObject->AddProperty( new Property( "description" , "dc" ));
00719 pObject->AddProperty( new Property( "contributor" , "dc" ));
00720 pObject->AddProperty( new Property( "date" , "dc" ));
00721 pObject->AddProperty( new Property( "language" , "dc" ));
00722 pObject->AddProperty( new Property( "rights" , "dc" ));
00723
00724 return( pObject );
00725 }
00726
00728
00729 CDSObject *CDSObject::CreatePerson( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00730 {
00731 if (pObject == NULL)
00732 {
00733 pObject = new CDSObject( sId, sTitle, sParentId );
00734 pObject->m_sClass = "object.container.person";
00735 }
00736
00737 CreateContainer( sId, sTitle, sParentId, pObject );
00738
00739 pObject->AddProperty( new Property( "language", "dc" ));
00740
00741 return( pObject );
00742 }
00743
00745
00746 CDSObject *CDSObject::CreateMusicArtist( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00747 {
00748 if (pObject == NULL)
00749 {
00750 pObject = new CDSObject( sId, sTitle, sParentId );
00751 pObject->m_sClass = "object.container.person.musicArtist";
00752 }
00753
00754 CreatePerson( sId, sTitle, sParentId, pObject );
00755
00756 pObject->AddProperty( new Property( "genre" , "upnp" ));
00757 pObject->AddProperty( new Property( "artistDiscographyURI", "upnp" ));
00758
00759 return( pObject );
00760 }
00761
00763
00764 CDSObject *CDSObject::CreateStorageSystem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00765 {
00766 if (pObject == NULL)
00767 {
00768 pObject = new CDSObject( sId, sTitle, sParentId );
00769 pObject->m_sClass = "object.container.storageSystem";
00770 }
00771
00772 CreateContainer( sId, sTitle, sParentId, pObject );
00773
00774 pObject->AddProperty( new Property( "storageTotal" , "upnp", true ));
00775 pObject->AddProperty( new Property( "storageUsed" , "upnp", true ));
00776 pObject->AddProperty( new Property( "storageFree" , "upnp", true ));
00777 pObject->AddProperty( new Property( "storageMaxPartition", "upnp", true ));
00778 pObject->AddProperty( new Property( "storageMedium" , "upnp", true ));
00779
00780 return( pObject );
00781 }
00782
00784
00785 CDSObject *CDSObject::CreateStorageVolume( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00786 {
00787 if (pObject == NULL)
00788 {
00789 pObject = new CDSObject( sId, sTitle, sParentId );
00790 pObject->m_sClass = "object.container.storageVolume";
00791 }
00792
00793 CreateContainer( sId, sTitle, sParentId, pObject );
00794
00795 pObject->AddProperty( new Property( "storageTotal" , "upnp", true ));
00796 pObject->AddProperty( new Property( "storageUsed" , "upnp", true ));
00797 pObject->AddProperty( new Property( "storageFree" , "upnp", true ));
00798 pObject->AddProperty( new Property( "storageMedium", "upnp", true ));
00799
00800 return( pObject );
00801 }
00802
00804
00805 CDSObject *CDSObject::CreateStorageFolder( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
00806 {
00807 if (pObject == NULL)
00808 {
00809 pObject = new CDSObject( sId, sTitle, sParentId );
00810 pObject->m_sClass = "object.container.storageFolder";
00811 }
00812
00813 CreateContainer( sId, sTitle, sParentId, pObject );
00814
00815 pObject->AddProperty( new Property( "storageUsed", "upnp", true ));
00816
00817 return( pObject );
00818 }