예제 #1
0
int CSelectChannelWidget::exec(CMenuTarget* parent, const std::string& actionKey)
{
	int   res = menu_return::RETURN_REPAINT;

	if (parent)
		parent->hide();

	if(actionKey == "tv")
	{
		return InitZapitChannelHelper(CZapitClient::MODE_TV);
	}
	else if(actionKey == "radio")
	{
		return InitZapitChannelHelper(CZapitClient::MODE_RADIO);
	}
	else if (strncmp(actionKey.c_str(), "ZCT:", 4) == 0 || strncmp(actionKey.c_str(), "ZCR:", 4) == 0)
	{
		unsigned int cnr = 0;
		t_channel_id channel_id = 0;
		sscanf(&(actionKey[4]),"%u|%" SCNx64 "", &cnr, &channel_id);

		if (strncmp(actionKey.c_str(), "ZCT:", 4) == 0)//...tv
		{
			g_settings.StartChannelTV = actionKey.substr(actionKey.find_first_of("#")+1);
			g_settings.startchanneltv_id = channel_id;
		}
		else if (strncmp(actionKey.c_str(), "ZCR:", 4) == 0)//...radio
		{
			g_settings.StartChannelRadio = actionKey.substr(actionKey.find_first_of("#")+1);
			g_settings.startchannelradio_id= channel_id;
		}

		// ...leave bouquet/channel menu and show a refreshed zapit menu with current start channel(s)
		g_RCInput->postMsg(CRCInput::RC_timeout, 0);
		return menu_return::RETURN_EXIT;
	}

	return res;
}
예제 #2
0
int CSelectChannelWidget::exec(CMenuTarget *parent, const std::string &actionKey)
{
	int   res = menu_return::RETURN_REPAINT;
	
	dprintf(DEBUG_NORMAL, "CSelectChannelWidget::exec: actionKey:%s\n", actionKey.c_str());

	if (parent)
		parent->hide();

	if(actionKey == "tv")
	{
		InitZapitChannelHelper(CZapitClient::MODE_TV);
		return res;
	}
	else if(actionKey == "radio")
	{
		InitZapitChannelHelper(CZapitClient::MODE_RADIO);
		return res;
	}

	return res;
}