Пример #1
0
int rtsp_fillStreamMenu(interfaceMenu_t *pMenu, void* pArg)
{
	int which;
	//int position = 0;
	char *str;

	which = GET_NUMBER(pArg);

	interface_clearMenuEntries((interfaceMenu_t*)&rtspStreamMenu);

	str = _T("SEARCHING_MOVIES");
	interface_addMenuEntryDisabled((interfaceMenu_t*)&rtspStreamMenu, str, thumbnail_search);

	collectFlag++;

	if( collectThread == 0)
	{
		pthread_create(&collectThread, NULL, rtsp_list_updater, SET_NUMBER(which));
		pthread_detach(collectThread);
	}

	interface_setSelectedItem((interfaceMenu_t*)&rtspStreamMenu, MENU_ITEM_MAIN);

	interface_menuActionShowMenu(pMenu, (void*)&rtspStreamMenu);

	return 0;
}
Пример #2
0
static int voip_fillAnsweredCallsMenu(interfaceMenu_t *pMenu, void *pArg)
{
	FILE *file;
	char *str;
	int i = 0;

	interface_clearMenuEntries((interfaceMenu_t*)&AnsweredCallsMenu);

	str = _T("CLEARLIST");
	interface_addMenuEntry((interfaceMenu_t*)&AnsweredCallsMenu, str, voip_clearList, (void*)ENTRY_INFO_SET(LIST_ANSWERED,LAST_DIALED), thumbnail_dial);

	file = m3u_initFile(ANSWERED_FILENAME, "r");
	if(file != NULL)
	{
		while ( m3u_readEntry(file) == 0 )
		{
			interface_addMenuEntry((interfaceMenu_t*)&AnsweredCallsMenu, m3u_description, voip_dialNumber, (void*)ENTRY_INFO_SET(LIST_ANSWERED,i), thumbnail_voip );
			i++;
		}
	}
	if( i == 0)
	{
		str = _T("NO_ANSWERED_CALLS");
		interface_addMenuEntryDisabled((interfaceMenu_t*)&AnsweredCallsMenu, str, -1 );
	}
	interface_menuActionShowMenu(pMenu, (void*)&AnsweredCallsMenu);
	interface_displayMenu(1);
	return 0;
}
Пример #3
0
static int voip_fillAddressBookMenu(interfaceMenu_t *pMenu, void *pArg)
{
	int i = 0;
	char *str;
	FILE *file;
	
	interface_clearMenuEntries((interfaceMenu_t*)&AddressBookMenu);

	str = _T("ADD");
	interface_addMenuEntry((interfaceMenu_t*)&AddressBookMenu, str, voip_newAddressBookURI, (void*)ENTRY_INFO_SET(LIST_ADDRESS, LAST_DIALED), thumbnail_dial);

	file = m3u_initFile(ADDRESSBOOK_FILENAME, "r");
	if(file != NULL)
	{
		while ( m3u_readEntry(file) == 0 )
		{
			interface_addMenuEntry((interfaceMenu_t*)&AddressBookMenu, m3u_description, voip_dialNumber, (void*)ENTRY_INFO_SET(LIST_ADDRESS, i), thumbnail_account_buddy );
			i++;
		}
	}
	if(i == 0)
	{
		str = _T("ADDRESS_BOOK_EMPTY");
		interface_addMenuEntryDisabled((interfaceMenu_t*)&AddressBookMenu, str, -1 );
	}
	if( interface_getSelectedItem( (interfaceMenu_t*)&AddressBookMenu ) >= i )
	{
		interface_setSelectedItem( (interfaceMenu_t*)&AddressBookMenu, i );
	}

	interface_menuActionShowMenu(pMenu, (void*)&AddressBookMenu);
	interface_displayMenu(1);
	return 0;
}
Пример #4
0
static int youtube_fillMenu( interfaceMenu_t* pMenu, void *pArg )
{
	int i;
	char *str;
	int page = (int) pArg;
	char url[64+MAX_FIELD_PATTERN_LENGTH];
	
	if(page == 1)
	{
		interface_clearMenuEntries( (interfaceMenu_t*)&YoutubeMenu );

		str = _T("VIDEO_SEARCH");
		interface_addMenuEntry( (interfaceMenu_t*)&YoutubeMenu, str, youtube_videoSearch, NULL, thumbnail_search );

		youtubeInfo.count = 0;
		youtubeInfo.index = 0;
	}

	if( youtubeInfo.search[0] == 0 )
		//snprintf(url, sizeof(url), "http://gdata.youtube.com/feeds/api/standardfeeds/recently_featured?format=5&max-results=%d&start-index=%d", YOUTUBE_LINKS_PER_PAGE, (page-1)*YOUTUBE_LINKS_PER_PAGE+1);
		snprintf(url, sizeof(url), "http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?time=today&format=5&max-results=%d&start-index=%d", YOUTUBE_LINKS_PER_PAGE, (page-1)*YOUTUBE_LINKS_PER_PAGE+1);
	else
		//snprintf(url, sizeof(url), "http://gdata.youtube.com/feeds/api/videos?format=5&max-results=%d&start-index=%d&vq=%s", YOUTUBE_LINKS_PER_PAGE, (page-1)*YOUTUBE_LINKS_PER_PAGE+1, youtubeInfo.search);
		snprintf(url, sizeof(url), "http://gdata.youtube.com/feeds/api/videos?format=5&max-results=%d&start-index=%d&q=%s", YOUTUBE_LINKS_PER_PAGE, (page-1)*YOUTUBE_LINKS_PER_PAGE+1, youtubeInfo.search);

	youtube_getVideoList(url, youtube_addMenuEntry, page);

	if(( youtubeInfo.count == 0 ) && ( page == 1 ))
	{
		str = _T("NO_MOVIES");
		interface_addMenuEntryDisabled( (interfaceMenu_t*)&YoutubeMenu, str, thumbnail_info );
	}

	if(( youtubeInfo.search[0] == 0 ) && ( page == 1 ))
	{
		pthread_create(&youtubeInfo.search_thread, NULL, youtube_MenuVideoSearchThread, NULL);
		pthread_detach(youtubeInfo.search_thread);
	}

	return 0;
}
Пример #5
0
static int rtsp_displayStreamMenu(void* pArg)
{
	char channelEntry[MENU_ENTRY_INFO_LENGTH];
	streams_struct* stream_ptr=NULL;
	int which = GET_NUMBER(pArg);
	interfaceMenu_t *rtspMenu = (interfaceMenu_t*)&rtspStreamMenu;

	interface_clearMenuEntries(rtspMenu);
	interface_showLoadingAnimation();

	int streamNumber = 0;
	for (stream_ptr = pstream_head; stream_ptr != NULL; stream_ptr = stream_ptr->next)
	{
		sprintf(channelEntry, "%d: %s", streamNumber+1, stream_ptr->name ? stream_ptr->name : stream_ptr->stream);

		int entryIndex = interface_addMenuEntry(rtspMenu, channelEntry, rtsp_stream_change, CHANNEL_INFO_SET(which, streamNumber), thumbnail_vod) - 1;
		interface_setMenuEntryImage(rtspMenu, entryIndex, stream_ptr->thumb);
		//dprintf("%s: Compare current %s\n", __FUNCTION__, channelEntry);
		if ( strcmp(stream_info.ip, appControlInfo.rtspInfo.streamIP) == 0 && 
		     strcmp(stream_info.streamname, stream_ptr->stream) == 0 )
		{
			interface_setSelectedItem(rtspMenu, streamNumber);
		}
		streamNumber++;
	}

	if (streamNumber == 0)
	{
		char *str;
		str = _T("NO_MOVIES");
		interface_addMenuEntryDisabled(rtspMenu, str, thumbnail_info);
	}

	interface_hideLoadingAnimation();
	interface_displayMenu(1);

	return 0;
}
Пример #6
0
int voip_fillMenu(interfaceMenu_t *pMenu, void *pArg)
{
	char *str;
	char buffer[MENU_ENTRY_INFO_LENGTH];
	int redial_available = 0;
	menuActionFunction pAction;
	int show = (int)pArg;

	interface_clearMenuEntries((interfaceMenu_t*)&VoIPMenu);

	if(appControlInfo.voipInfo.active)
	{
		switch(appControlInfo.voipInfo.status)
		{
			case voipStatus_incoming: str = _T("ANSWER_CALL"); pAction = voip_answerCall; break;
			case voipStatus_dialing:
			case voipStatus_talking:  str = _T("HANGUP");      pAction = voip_hangup; break;
			default: str = _T("DIAL"); pAction = voip_enterURI;
		}
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, pAction, NULL, thumbnail_dial);
#ifdef ENABLE_VOIP_CONFERENCE
		if (appControlInfo.voipInfo.status == voipStatus_talking)
		{
			str = _T("DIAL_CONFERENCE");
			interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str,voip_enterURI, NULL, thumbnail_dial);
		}
#endif
		if( appControlInfo.voipInfo.lastSip[4] != 0 )
		{
			sprintf(buffer,"%s (%s)",_T("REDIAL"), appControlInfo.voipInfo.lastSip);
			str = buffer;
			redial_available = appControlInfo.voipInfo.status == voipStatus_idle;
		} else
		{
			str = _T("REDIAL");
		}
		interface_addMenuEntryCustom((interfaceMenu_t*)&VoIPMenu, interfaceMenuEntryText, str, strlen(str)+1, redial_available, voip_dialNumber, NULL, NULL, NULL, (void*)ENTRY_INFO_SET(-1,LAST_DIALED), thumbnail_redial);
	
		str = _T("ADDRESS_BOOK");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, voip_fillAddressBookMenu, NULL, thumbnail_address_book);
		str = _T("MISSED_CALLS");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, voip_fillMissedCallsMenu, NULL, thumbnail_missed_calls);
		str = _T("ANSWERED_CALLS");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, voip_fillAnsweredCallsMenu, NULL, thumbnail_answered_calls);
		str = _T("DIALED_NUMBERS");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, voip_fillDialedNumbersMenu, NULL, thumbnail_dialed_numbers);
		str = _T("ACCOUNT");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, str, voip_fillAccountMenu, (void*)-1, appControlInfo.voipInfo.connected ? thumbnail_account_active : thumbnail_account_inactive);
	} else
	{
		voip_init();

		if(appControlInfo.voipInfo.active)
			return voip_fillMenu(pMenu, pArg);

		/*str = _T("RECONNECT");
		interface_addMenuEntry((interfaceMenu_t*)&VoIPMenu, interfaceMenuEntryText, str, strlen(str), 1, voip_enterURI, NULL, NULL, NULL, thumbnail_dial);*/
		str = _T("VOIP_UNAVAILABLE");
		interface_addMenuEntryDisabled((interfaceMenu_t*)&VoIPMenu, str, -1);
	}
	if( show || interfaceInfo.currentMenu == (interfaceMenu_t*)&VoIPMenu )
	{
		interface_menuActionShowMenu(pMenu, (void*)&VoIPMenu);
	}	
	return 0;
}