Example #1
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;
}
Example #2
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;
}
Example #3
0
static int rtsp_stream_change(interfaceMenu_t *pMenu, void* pArg)
{
	int which = CHANNEL_INFO_GET_SCREEN(pArg);
	unsigned int streamNumber = CHANNEL_INFO_GET_CHANNEL(pArg);

	dprintf("%s(%d): in %d\n", __FUNCTION__, which, streamNumber);

	interface_removeEvent(rtsp_stream_start, pArg);

	if ( appControlInfo.rtspInfo.active != 0 )
	{
		eprintf("RTSP: stop video at %d\n", which);
		// force showState to NOT be triggered
		interfacePlayControl.activeButton = interfacePlayControlStop;
		rtsp_stopVideo(which);
	}

	if (streamNumber != CHANNEL_CUSTOM)
	{
		interface_setSelectedItem(_M &rtspStreamMenu, streamNumber);

		if ( pstream_head == NULL ) {
			int ret = get_rtsp_streams(ppstream_head);
			dprintf("%s: Found streams %i\n", __FUNCTION__,ret);
			if (ret != 0 || pstream_head == NULL) {
				interface_showMessageBox(_T("ERR_DEFAULT_STREAM"), thumbnail_warning, 0);
				eprintf("RTSP: Failed to find default stream\n");
				return -1;
			}
		}
		streams_struct* stream_ptr = get_stream(streamNumber);
		if ( !stream_ptr ) {
			interface_showMessageBox(_T("ERR_STREAM_IN_LIST"), thumbnail_error, 0);
			eprintf("RTSP: Stream number %d not found in linked list\n", streamNumber);
			return -1;
		}
		//dprintf("%s: stream_ptr->stream %s\n", __FUNCTION__, stream_ptr->stream);

		stream_info.port = appControlInfo.rtspInfo.RTSPPort;
		strcpy(stream_info.ip, appControlInfo.rtspInfo.streamIP);
		strcpy(stream_info.streamname, stream_ptr->stream);
		appControlInfo.playbackInfo.playlistMode = playlistModeNone;
		stream_info.custom_url = 0;
	}

	if ( rtsp_stream_start(pArg) == 0 )
	{
		interface_showMenu(0, 1);

		return 0;
	}

	return -1;
}
Example #4
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;
}
Example #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;
}