Esempio n. 1
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;
}
Esempio n. 2
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;
}
Esempio n. 3
0
static int voip_fillAccountMenu(interfaceMenu_t *pMenu, void *pArg)
{
	char buf[MENU_ENTRY_INFO_LENGTH], *str;

	interface_clearMenuEntries((interfaceMenu_t*)&AccountMenu);

	snprintf(buf,MENU_ENTRY_INFO_LENGTH, "%s: %s", _T("VOIP_ENABLE"), appControlInfo.voipInfo.enabled ? _T("ON") : _T("OFF"));
	interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, buf, voip_toggleEnabled, NULL, appControlInfo.voipInfo.enabled ? thumbnail_yes : thumbnail_no);

	if (appControlInfo.voipInfo.enabled)
	{
		//snprintf(buf,MENU_ENTRY_INFO_LENGTH, "SIP: %s", appControlInfo.voipInfo.sip);
		//interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, interfaceMenuEntryText, buf, strlen(buf), 0, voip_toggleParam, NULL, NULL, (void*)PARAM_SIP, thumbnail_account);
		str = _T( voip_loggingIn ? "SERVER_QUERY" : (appControlInfo.voipInfo.connected || appControlInfo.voipInfo.server[0] == 0 ? "DISCONNECT" : "LOGIN_TO_SERVER") );
		interface_addMenuEntryCustom((interfaceMenu_t*)&AccountMenu, interfaceMenuEntryText,
			str, strlen(str), appControlInfo.voipInfo.connected || appControlInfo.voipInfo.server[0] != 0,
			appControlInfo.voipInfo.connected || appControlInfo.voipInfo.server[0] == 0 ? voip_logoutFromServer : voip_reloginToServer,
			NULL, NULL, NULL, NULL, appControlInfo.voipInfo.connected ? thumbnail_account_active : thumbnail_account_inactive);
		snprintf(buf,MENU_ENTRY_INFO_LENGTH, "%s: %s", _T("SERVER"), appControlInfo.voipInfo.server[0] != 0 ? appControlInfo.voipInfo.server : _T("NONE") );
		interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, buf, voip_toggleParam, (void*)PARAM_SERVER, thumbnail_account);
		if( appControlInfo.voipInfo.server[0] != 0 )
		{
			snprintf(buf,MENU_ENTRY_INFO_LENGTH, "%s: %s", _T("LOGIN"), appControlInfo.voipInfo.login);
			interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, buf, voip_toggleParam, (void*)PARAM_LOGIN, thumbnail_account);
			snprintf(buf,MENU_ENTRY_INFO_LENGTH, "%s: ***", _T("PASSWORD")/*, appControlInfo.voipInfo.passwd*/);
			interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, buf, voip_toggleParam, (void*)PARAM_PASSWD, thumbnail_account);
			/*snprintf(buf,MENU_ENTRY_INFO_LENGTH, "%s: %s", _T("REALM"), appControlInfo.voipInfo.realm);
			interface_addMenuEntry((interfaceMenu_t*)&AccountMenu, buf, voip_toggleParam, (void*)PARAM_REALM, thumbnail_account);*/
		}
	}

	if( appControlInfo.voipInfo.connected == 0 && appControlInfo.voipInfo.server[0] == 0 && interface_getSelectedItem((interfaceMenu_t*)&AccountMenu) == 0 )
	{
		interface_setSelectedItem((interfaceMenu_t*)&AccountMenu, MENU_ITEM_BACK);
	}

	interface_setMenuLogo((interfaceMenu_t*)&AccountMenu, appControlInfo.voipInfo.connected ? thumbnail_account_active : thumbnail_account_inactive, -1, 0, 0, 0);

	if( pArg != NULL || (interfaceInfo.currentMenu == (interfaceMenu_t*)&AccountMenu) )
	{
		interface_menuActionShowMenu(pMenu, (void*)&AccountMenu);
		interface_displayMenu(1);
	}

	return 0;
}
Esempio n. 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;
}
Esempio n. 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;
}
Esempio n. 6
0
void youtube_addMenuEntry(const char *url, const char *name, const char *thumbnail)
{
	const char *str;
	if( youtubeInfo.count >= YOUTUBE_MAX_LINKS || youtubeInfo.count < 0)
		return;

	str = strstr(url, "/v/");
	if( str == NULL )
	{
		dprintf("%s: Can't find Youtube VIDEO_ID in '%s'\n", __FUNCTION__, url);
		return;
	}
	strncpy( youtubeInfo.videos[youtubeInfo.count].video_id, &str[3], 11 );
	youtubeInfo.videos[youtubeInfo.count].video_id[11] = 0;
	str = name != NULL ? name : url;
	if( thumbnail != NULL )
		strcpy( youtubeInfo.videos[youtubeInfo.count].thumbnail, thumbnail );
	else
		youtubeInfo.videos[youtubeInfo.count].thumbnail[0] = 0;

	interface_addMenuEntry( (interfaceMenu_t*)&YoutubeMenu, str, youtube_streamChange, (void*)youtubeInfo.count, thumbnail_internet );

	youtubeInfo.count++;
}
Esempio n. 7
0
void menu_buildMainMenu()
{
	char *str = NULL;
	int main_icons[4] = { 0, 0, 0,
#if (defined ENABLE_FAVORITES) && !(defined ENABLE_VIDIMAX) && !(defined ENABLE_FUSION)
		statusbar_f4_favorites
#else
		0
#endif
	};

	createListMenu(&interfaceMainMenu, str, thumbnail_logo, main_icons, NULL,
				   /* interfaceInfo.clientX, interfaceInfo.clientY,
				   interfaceInfo.clientWidth, interfaceInfo.clientHeight,*/ interfaceListMenuBigThumbnail,//interfaceListMenuIconThumbnail,
				   NULL, NULL, NULL);
	interface_setCustomKeysCallback(_M &interfaceMainMenu, menu_keyCallback);
/*
	interface_addMenuEntry(_M &interfaceMainMenu, str, 0, NULL, NULL, IMAGE_DIR "splash.png");
*/

#ifndef ENABLE_VIDIMAX
#ifdef ENABLE_DVB
	 
#ifdef HIDE_EXTRA_FUNCTIONS
	if ( offair_tunerPresent() )
#endif // #ifdef HIDE_EXTRA_FUNCTIONS
	{
		offair_buildDVBTMenu(_M &interfaceMainMenu);
		str = _T("DVB_CHANNELS");
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &DVBTMenu, thumbnail_dvb);
	}
#endif // #ifdef ENABLE_DVB
#ifdef ENABLE_TELETES
	teletes_buildMenu(_M &interfaceMainMenu);
	str = _T("CAMERAS");
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &teletesMediaMenu, thumbnail_tvinfo);
#endif
#ifdef ENABLE_IPTV
	rtp_buildMenu(_M &interfaceMainMenu);
	str = _T("TV_CHANNELS");

#ifdef ENABLE_FUSION
	interface_addMenuEntry(_M &interfaceMainMenu, str, fusion_askPassword_FillStreamMenu, NULL, thumbnail_multicast);
#else
	interface_addMenuEntry(_M &interfaceMainMenu, str, rtp_initStreamMenu, NULL, thumbnail_multicast);
#endif
#endif // #ifdef ENABLE_IPTV
#ifdef ENABLE_PVR
	pvr_buildPvrMenu((interfaceMenu_t *) &interfaceMainMenu);
#endif
#ifdef ENABLE_VOD
	rtsp_buildMenu(_M &interfaceMainMenu);
	str = _T("MOVIES");

#ifdef ENABLE_FUSION
	interface_addMenuEntry(_M &interfaceMainMenu, str, fusion_askPassword_FillStreamMenu, NULL, thumbnail_vod);
#else
	interface_addMenuEntry(_M &interfaceMainMenu, str, rtsp_fillStreamMenu, NULL, thumbnail_vod);
#endif

#endif // #ifdef ENABLE_VOD
#ifdef ENABLE_FAVORITES
	playlist_buildMenu(_M &interfaceMainMenu);
	str = _T("PLAYLIST");

#ifdef ENABLE_FUSION
	interface_addMenuEntry(_M &interfaceMainMenu, str, fusion_askPassword_SwitchMenu, &playlistMenu, thumbnail_favorites);
#else
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &playlistMenu, thumbnail_favorites);
#endif

#endif // #ifdef ENABLE_FAVORITES

	media_buildMediaMenu(_M &interfaceMainMenu);
#ifdef ENABLE_USB
	str = _T("RECORDED");

#ifdef ENABLE_FUSION
	interface_addMenuEntry(_M &interfaceMainMenu, str, fusion_askPassword_USBBrowserMenu, SET_NUMBER(mediaVideo), thumbnail_usb);
#else
	interface_addMenuEntry(_M &interfaceMainMenu, str, media_initUSBBrowserMenu, SET_NUMBER(mediaVideo), thumbnail_usb);
#endif
#endif // #ifdef ENABLE_USB

#ifdef ENABLE_WEB_SERVICES
#ifndef ENABLE_FUSION
	{
		str = _T("WEB_SERVICES");
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &WebServicesMenu, thumbnail_internet);
		createListMenu(&WebServicesMenu, _T("WEB_SERVICES"), thumbnail_internet, NULL, _M &interfaceMainMenu,
					/* interfaceInfo.clientX, interfaceInfo.clientY,
					interfaceInfo.clientWidth, interfaceInfo.clientHeight,*/ interfaceListMenuIconThumbnail,
					NULL, NULL, NULL);
#ifdef ENABLE_RUTUBE
		rutube_buildMenu(_M &WebServicesMenu);
		str = "RuTube";
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &RutubeCategories, thumbnail_rutube);
	
#endif // #ifdef ENABLE_RUTUBE
#ifdef ENABLE_YOUTUBE
		youtube_buildMenu(_M &WebServicesMenu);
		str = "YouTube";
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &YoutubeMenu, thumbnail_youtube);
#endif // #ifdef ENABLE_YOUTUBE
		
#ifdef ENABLE_REGPLAT
		regplat_buildMenu(_M &WebServicesMenu);
		str = "RegPlat";
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &regplatLoginMenu, thumbnail_regplat);
#endif// #ifdef ENABLE_REGPLAT

#ifdef ENABLE_SAMBA
		samba_buildMenu(_M &WebServicesMenu);
		str = _T("NETWORK_PLACES");
		interface_addMenuEntry(_M &WebServicesMenu, str, media_initSambaBrowserMenu, NULL, thumbnail_network);
		str = _T("NETWORK_BROWSING");
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &SambaMenu, thumbnail_workstation);
		
#endif // #ifdef ENABLE_SAMBA
#ifdef ENABLE_DLNA
		dlna_buildDLNAMenu(_M &WebServicesMenu);
		str = _T("MEDIA_SERVERS");
		interface_addMenuEntry(_M &WebServicesMenu, str, dlna_initServerBrowserMenu, NULL, thumbnail_movies);
		
#endif // #ifdef ENABLE_DLNA
#ifdef ENABLE_BROWSER		
		str = _T("INTERNET_BROWSING");
		interface_addMenuEntry(_M &WebServicesMenu, str, open_browser, NULL, thumbnail_internet);
#ifndef HIDE_EXTRA_FUNCTIONS
		if (helperFileExists(MW_CONFIG_FILE))
		{
			str = _T("MIDDLEWARE");
			interface_addMenuEntry(_M &interfaceMainMenu, str, open_browser_mw, NULL, thumbnail_elecardtv);
		}
#endif // #ifndef HIDE_EXTRA_FUNCTIONS
		
#endif // #ifdef ENABLE_BROWSER
#ifdef ENABLE_SMIL
		str = _T("RTMP");
		interface_addMenuEntry((interfaceMenu_t *)&WebServicesMenu, str, smil_enterURL, SET_NUMBER(-1), thumbnail_add_url);
#endif
	}
#endif // ifndef ENABLE_FUSION
#endif // #ifdef ENABLE_WEB_SERVICES

#ifdef ENABLE_VOIP
	voip_buildMenu(_M &interfaceMainMenu);
		//if(appControlInfo.voipInfo.status == 0)
		{
			str = _T("VOIP");
			interface_addMenuEntry(_M &interfaceMainMenu, str, voip_fillMenu, SET_NUMBER(1), thumbnail_voip);
		}
	
#endif
#ifdef SHOW_CARD_MENU
	{
		card_buildMenu(_M &interfaceMainMenu);
		str = _T("CARD");
		interface_addMenuEntry(_M &interfaceMainMenu, str, card_fillInfoMenu, SET_NUMBER(1), thumbnail_rd);
		str = _T("QUIZ");
		interface_addMenuEntry(_M &interfaceMainMenu, str, card_fillQuizMenu, &cardMenu, thumbnail_account);
	}
#endif // #ifdef SHOW_CARD_MENU
	{
		output_buildMenu(_M &interfaceMainMenu);
		str = _T("SETTINGS");

#ifdef ENABLE_FUSION
	interface_addMenuEntry(_M &interfaceMainMenu, str, fusion_askPassword_SwitchMenu, &OutputMenu, thumbnail_configure);
#else
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &OutputMenu, thumbnail_configure);
#endif
	}
#else // NOT ENABLE_VIDIMAX
//#ifdef ENABLE_VIDIMAX	
	vidimax_buildCascadedMenu(_M &interfaceMainMenu);
	str = _T("Vidimax");
	interface_addMenuEntry (_M &interfaceMainMenu, str, vidimax_fillMenu, NULL, thumbnail_vidimax);
	/////////////////////////////////////////////////////////////////////////////////
#ifdef ENABLE_DVB
#ifdef HIDE_EXTRA_FUNCTIONS
		if (offair_tunerPresent())
#endif // #ifdef HIDE_EXTRA_FUNCTIONS
	{
		offair_buildDVBTMenu(_M &interfaceMainMenu);
		str = _T("DVB_CHANNELS");
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &DVBTMenu, thumbnail_dvb);
	}
#endif // #ifdef ENABLE_DVB

#ifdef ENABLE_IPTV
	rtp_buildMenu(_M &interfaceMainMenu);
	str = _T("TV_CHANNELS");
	interface_addMenuEntry(_M &interfaceMainMenu, str, rtp_initStreamMenu, NULL, thumbnail_multicast);
	
#endif // #ifdef ENABLE_IPTV
#ifdef ENABLE_PVR
	pvr_buildPvrMenu((interfaceMenu_t *) &interfaceMainMenu);
#endif

#ifdef ENABLE_FAVORITES
	playlist_buildMenu(_M &interfaceMainMenu);
	str = _T("PLAYLIST");
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &playlistMenu, thumbnail_favorites);
	
#endif // #ifdef ENABLE_FAVORITES

	media_buildMediaMenu(_M &interfaceMainMenu);
#ifdef ENABLE_USB
	str = _T("RECORDED");
	interface_addMenuEntry(_M &interfaceMainMenu, str, media_initUSBBrowserMenu, SET_NUMBER(mediaVideo), thumbnail_usb);
	
#endif // #ifdef ENABLE_USB

#ifdef ENABLE_WEB_SERVICES
	{
		str = _T("WEB_SERVICES");
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &WebServicesMenu, thumbnail_internet);
		createListMenu(&WebServicesMenu, _T("WEB_SERVICES"), thumbnail_internet, NULL, _M &interfaceMainMenu,
					/* interfaceInfo.clientX, interfaceInfo.clientY,
					interfaceInfo.clientWidth, interfaceInfo.clientHeight,*/ interfaceListMenuIconThumbnail,
					NULL, NULL, NULL);
					
#ifdef ENABLE_RUTUBE
		rutube_buildMenu(_M &WebServicesMenu);
		str = "RuTube";
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &RutubeCategories, thumbnail_rutube);
	
#endif // #ifdef ENABLE_RUTUBE
#ifdef ENABLE_YOUTUBE
		youtube_buildMenu(_M &WebServicesMenu);
		str = "YouTube";
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &YoutubeMenu, thumbnail_youtube);
#endif // #ifdef ENABLE_YOUTUBE

#ifdef ENABLE_BROWSER		
		str = _T("INTERNET_BROWSING");
		interface_addMenuEntry(_M &WebServicesMenu, str, open_browser, NULL, thumbnail_internet);
#ifndef HIDE_EXTRA_FUNCTIONS
		if (helperFileExists(MW_CONFIG_FILE))
		{
			str = _T("MIDDLEWARE");
			interface_addMenuEntry(_M &interfaceMainMenu, str, open_browser_mw, NULL, thumbnail_elecardtv);
		}
#endif // #ifndef HIDE_EXTRA_FUNCTIONS
#endif // #ifdef ENABLE_BROWSER

#ifdef ENABLE_SAMBA
		samba_buildMenu(_M &WebServicesMenu);
		str = _T("NETWORK_PLACES");
		interface_addMenuEntry(_M &WebServicesMenu, str, media_initSambaBrowserMenu, NULL, thumbnail_network);
		str = _T("NETWORK_BROWSING");
		interface_addMenuEntry(_M &WebServicesMenu, str, interface_menuActionShowMenu, &SambaMenu, thumbnail_workstation);
		
#endif // #ifdef ENABLE_SAMBA
	}
#endif // #ifdef ENABLE_WEB_SERVICES

#ifdef ENABLE_VOIP
	voip_buildMenu(_M &interfaceMainMenu);
		//if(appControlInfo.voipInfo.status == 0)
		{
			str = _T("VOIP");
			interface_addMenuEntry(_M &interfaceMainMenu, str, voip_fillMenu, SET_NUMBER(1), thumbnail_voip);
		}
#endif
	{
		output_buildMenu(_M &interfaceMainMenu);
		str = _T("SETTINGS");
		interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, &OutputMenu, thumbnail_configure);
	}

#endif // ENABLE_VIDIMAX
	/*
	str = _T("MUSIC");
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, NULL, IMAGE_DIR "thumbnail_music.png");
	str = _T("PAUSED_CONTENT");
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, NULL, IMAGE_DIR "thumbnail_paused.png");
	str = _T("ACCOUNT");
	interface_addMenuEntry(_M &interfaceMainMenu, str, interface_menuActionShowMenu, NULL, IMAGE_DIR "thumbnail_account.png");
	*/
	switch( interface_getMenuEntryCount( _M &interfaceMainMenu ))
	{
		case 4:case 6:case 9: break;
		default:
			str = _T("SHUTDOWN");
			interface_addMenuEntry(_M &interfaceMainMenu, str, power_callback, NULL, thumbnail_power);
	}

}
Esempio n. 8
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;
}