Exemplo n.º 1
0
///////////////////UPNP
void DLNAProxy::browse(const int nUUID, const NPT_String& serverOrDirTitle, const NPT_String& containerId)
{
	//DLNAProgressiveBrowseOp * op;
	DeviceDescList devlist = m_core->snapshotMediaServerList();
	UUID uid = devlist.itemAt(nUUID)->uuid();
	m_dmsCurrentUUID = uid;
	m_core->browseMediaServerEx(uid, containerId, 100, this, &m_BroOp);
	m_BroOp->checkFinishedIfNotSetCallback(this);
	printf("browse....\n");

	//SiteView::DLNABrowseOp *op;
	//if (NPT_SUCCEEDED(m_core->browseMediaServer(m_dmsCurrentUUID, containerId, false, &op))) 
/*	if (NPT_SUCCEEDED(m_core->browseMediaServerEx(uid, containerId, 100, this, &op)))
    {
        if (wait(op))
        {
            if (op->succeeded()) 
            {
                printf("borwse op  successed\n");
            }
            else
            {
                printf("borwse op un successed\n");
            }
        }
		else
        {
            printf("wait wrong-->click cancle btn\n");
        }
		op->release();
	}	*/
}
Exemplo n.º 2
0
void DLNADelegation::openMediaObj(const deejay::DLNAItem* mediaItem)
{
	DeviceDescList devlist = m_core->snapshotMediaServerList();
	UUID renderUuid = devlist.itemAt(0)->uuid();

	DLNAObjectList objList;
	DLNAObject * obj = objList.itemAt(0);
	DLNAItem * item = obj->asItem();

   // deejay::UUID renderUuid = getCurrentRenderUUID();
	if (!renderUuid.isNull()) 
    {
        DLNAMediaObjType type;
		getMediaObjType(mediaItem, type);
		
        NPT_String iconUrl;
        if (((deejay::DLNAObject*)mediaItem)->findThumbnailURL(200, 200, NULL, iconUrl))
        {
            //setThumbImg(iconUrl, type);
        }
        
		deejay::DLNACoreOp *op;
		if (NPT_SUCCEEDED(m_core->playMedia(renderUuid, mediaItem, &op))) 
        {
            if (wait(op))
            {
                if (op->succeeded()) 
                {
                    //[m_delegate showControlPointPageWithMediaType:type];
                }
                else
                {
                    printf("play op un successed");
                    printf("\n");
                }
            }
			else
            {
                printf("wait wrong-->click cancle btn");
                printf("\n");
            }
			op->release();
		}
        else
        {
            //NSLog(@"create Op error");
        }
	}
    else
    {
        //[m_delegate shouldSelectRenderForMedia:mediaItem];
    }
}
Exemplo n.º 3
0
void DLNAProxy::openMediaObj(const SiteView::DLNAItem* mediaItem)
{
	DeviceDescList devlist = m_core->snapshotMediaServerList();
	UUID renderUuid = devlist.itemAt(0)->uuid();

	DLNAObjectList objList;
	DLNAObject * obj = objList.itemAt(0);
	DLNAItem * item = obj->asItem();

   // SiteView::UUID renderUuid = getCurrentRenderUUID();
	if (!renderUuid.isNull()) 
    {
        DLNAMediaObjType type;
		getMediaObjType(mediaItem, type);
		
        NPT_String iconUrl;
        if (((SiteView::DLNAObject*)mediaItem)->findThumbnailURL(200, 200, NULL, iconUrl))
        {
            //setThumbImg(iconUrl, type);
        }
        
		SiteView::DLNACoreOp *op;
		if (NPT_SUCCEEDED(m_core->playMedia(renderUuid, mediaItem, &op))) 
        {
			op->release();
		}
        else
        {
            //NSLog(@"create Op error");
        }
	}
    else
    {
        //[m_delegate shouldSelectRenderForMedia:mediaItem];
    }
}
Exemplo n.º 4
0
void DeviceDescList::differ(const DeviceDescList& oldList, const DeviceDescList& newList, DeviceDescList& removedList, DeviceDescList& addedList, DeviceDescList& commonList)
{
	removedList.clear();
	addedList.clear();
	commonList.clear();
	for (NPT_Ordinal i = 0; i < newList.count(); i++) {
		deejay::DeviceDesc *commonItem = oldList.find(newList.itemAt(i)->uuid());
		if (commonItem) {
			commonList.add(commonItem);
		} else {
			addedList.add(newList.itemAt(i));
		}
	}

	for (NPT_Ordinal i = 0; i < oldList.count(); i++) {
		deejay::DeviceDesc *commonItem = newList.find(oldList.itemAt(i)->uuid());
		if (!commonItem) {
			removedList.add(oldList.itemAt(i));
		}
	}
}