示例#1
0
void cMenuSetupUserdefTimes::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  cString szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 1);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode1].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode1].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode1].description, sizeof(data->ShowModes[showUserMode1].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode1].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 2);
  Add(new cMenuEditBoolItem( szUseUserTime, &data->ShowModes[showUserMode2].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode2].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode2].description, sizeof(data->ShowModes[showUserMode2].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode2].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 3);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode3].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode3].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode3].description, sizeof(data->ShowModes[showUserMode3].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode3].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  szUseUserTime = cString::sprintf("%s %d", tr("Use user-defined time"), 4);
  Add(new cMenuEditBoolItem(szUseUserTime, &data->ShowModes[showUserMode4].useIt,       trVDR("no"),      trVDR("yes")));
  AddHelp(tr("Help$Besides 'Now' and 'Next' you can specify up to 4 other times in the EPG which can be used by repeatedly pressing the green key, e.g. 'prime time', 'late night',..."));
  if (data->ShowModes[showUserMode4].GetUsage())
  {
      Add(new cMenuEditStrItem(IndentMenuItem(tr("Description")), data->ShowModes[showUserMode4].description, sizeof(data->ShowModes[showUserMode4].description), trVDR(FileNameChars)));
      AddHelp(tr("Help$This is the description for your user-defined time as it will appear as label on the green button."));
      Add(new cMenuEditTimeItem(IndentMenuItem(tr("Time")), &data->ShowModes[showUserMode4].itime));
      AddHelp(tr("Help$Specify the user-defined time here in 'HH:MM'."));
  }

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
示例#2
0
Group::Group(Group &group)
{
    Add(group);
}
示例#3
0
文件: slib-b.c 项目: 0xb1dd1e/jamplus
void ExportB()
{
	printf("ExportB: 3 + 9 = %d\n", Add(3, 9));
}
示例#4
0
range_iterator Group::Add(ClientId clientId)
{
    return Add(Range(clientId, clientId+1));
}
示例#5
0
Group::Group(ClientId clientId)
{
    Add(Range(clientId, clientId+1));
}
示例#6
0
文件: parse.c 项目: attuska/Sasc-ng
void cProviders::AddProv(cProvider *p)
{
  if(p) Add(p);
}
int main(int argc, char *argv[]) {
	FILE * inputFile;
	if (argc < 2 || argc>3) 
		DieWithUserMessage("Parameter(s)","<Server Name> [LClient.txt]");
	if(argc==3)
	{
		inputFile = fopen (argv[2] , "r");
		if (inputFile == NULL)
			DieWithSystemMessage("File Open Error!");
	}
	if(argc==2)
	{
		inputFile =stdin;
	}
	char *servName = argv[1];
	char *servIP=getIPbyHostName(servName, addr);//Get Server IP by Server Name

	FILE *fp;
	if((fp=fopen("LClient.log","w"))==NULL)
		DieWithSystemMessage("File Open Error!");

	//===========Deal with Login Command============
	char _CMDString[MAXLEN_CMD];
	char *CMDString=_CMDString;

	beforeLogin:fputs("Please use login command to connect to the server first as [login <name>]:\n", stdout);

	if(fgets(CMDString,MAXLEN_CMD,inputFile)== NULL)
		DieWithSystemMessage("Input Error!");
	//printf("string length:\t%d\n",strlen(CMDString));
	while((Login(CMDString))!=1)
	{
		fputs("\nLogin again:\n", stdout);
		if(fgets(CMDString,MAXLEN_CMD,inputFile)== NULL)
			DieWithSystemMessage("Input Error!");
	}

	//===========End of dealing with Login Command, and Get the name=========


	//===========initiate the socket =====================	
	in_port_t servPort =atoi("5000");// Set server port (numeric) 5000	
	int sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);// Create a reliable, stream socket using TCP
	if (sock < 0)
		DieWithSystemMessage("socket() failed");	
	struct sockaddr_in servAddr;// Construct the server address structure
	memset(&servAddr, 0, sizeof(servAddr)); // Zero out structure
	servAddr.sin_family = AF_INET;			   // IPv4 address family
	// Convert address
	int rtnVal = inet_pton(AF_INET, servIP, &servAddr.sin_addr.s_addr);
	if (rtnVal == 0)
		DieWithUserMessage("inet_pton() failed", "invalid address string");
	else if (rtnVal < 0)
		DieWithSystemMessage("inet_pton() failed");
	servAddr.sin_port = htons(servPort);		// Server port
	//===========END initiate the socket =====================




	//===========Establish the connection to the echo server=============
	if (connect(sock, (struct sockaddr *) &servAddr, sizeof(servAddr)) < 0)
		DieWithSystemMessage("connect() failed");
	IsLogined=1;  //Connection Established, and this means someone logined successfully
	char buffer[BUFSIZE];

	int IsListCmd=0;

	//char IsListDone[5]="Done";
	char QUIT[2]="*";
	char _EOF[2]="$";
	int IsReLogin=0;
	for(;;)
	{		
		//puts(CMDString);
		ssize_t numBytes = send(sock, CMDString, strlen(CMDString), 0);
		if (numBytes < 0)
			DieWithSystemMessage("send() failed");
		else if (numBytes != strlen(CMDString))
				DieWithUserMessage("send()", "sent unexpected number of bytes");

		if(IsListCmd==0)
		{
			bufferClean(buffer);
			numBytes = recv(sock, buffer, BUFSIZE - 1, 0);
			if (numBytes < 0)
				DieWithSystemMessage("recv() failed");
			buffer[numBytes] = '\0';// Terminate the string!	
			if(strncmp(buffer,QUIT,1)==0)
			{
				fputs(buffer, fp);
				fputs("\r\n",fp);
				labelQUIT:close(sock);
				goto beforeLogin;
			}

			if(strncmp(buffer,_EOF,1)==0)
			{
				fputs(buffer, fp);
				fputs("\r\n",fp);
				labelEOF:close(sock); 
				if(argc==3)
					fclose(fp);
				fclose(inputFile);
				exit(0);
			}
			if(IsReLogin!=1)
			{
				fputs(buffer, stdout);
				fputs("\n",stdout);
				fputs(buffer, fp);
				fputs("\r\n",fp);
			}
		}
		else
		{	
			int i=0;
			while(IsListCmd==1)
			{
				bufferClean(buffer);
				numBytes = recv(sock, buffer, BUFSIZE - 1, 0);
				if (numBytes < 0)
					DieWithSystemMessage("recv() failed");

				for(i=0;i<strlen(buffer);i++)
				{
					int buffer_Length=strlen(buffer);
					if(buffer[i]=='#')
					{
						buffer[i]='\0';
						fputs(buffer, stdout);
						fputs(buffer, fp);
						/*if(i<buffer_Length)
						{
							i++;
							for(;i<buffer_Length;i++)
							{
								if(buffer[i]=='*')
								{
									puts("QUIT Here!");
									goto labelQUIT;
								}
								if(buffer[i]=='$')
									goto labelEOF;
								fputc(buffer[i],stdout);
								fputc(buffer[i],fp);
							}
						}*/
						IsListCmd=0;
						fputs("\n",stdout);
						//goto ListDone;
						break;
					}
				}
				if(IsListCmd==0)
					break;
				fputs(buffer, stdout);
				fputs(buffer, fp);

			}
		}
		bufferClean(buffer);
		for(;;)
		{
			int IsInputLegal=0;
			bufferClean(CMDString);

//ListDone:
			if(fgets(CMDString,MAXLEN_CMD,inputFile)== NULL)
				DieWithSystemMessage("Input Error!");
			CMDString=trimRight(CMDString);
			//gets(CMDString);    //input another Command
			switch(CommandCheckAndReturncmdCode(CMDString))
			{
				case 1: if(IsLogined==1)
							{
								fputs("You have logined already. Please quit first!\n", stdout);
								IsInputLegal=0;
							} 
							else 
							{
								if(Login(CMDString)==1) 
									IsInputLegal=1;
							}
							break;
				case 2: if(Add(CMDString)==1) IsInputLegal=1; break;
				case 3: if(Remove(CMDString)==1) IsInputLegal=1; break;
				case 4: if(List(CMDString)==1) {IsInputLegal=1;IsListCmd=1;} break;
				case 5: if(Quit(CMDString)==1) {IsInputLegal=1;IsLogined=0;}; break;
				default:IsInputLegal=0;break;
			}
			if(IsInputLegal==1)
				break;
			else
				continue;
		}

	}
	
}
示例#8
0
		Vector3& Vector3::operator+=(const Vector3& other)
		{
			return Add(other);
		}
示例#9
0
文件: MC.cpp 项目: Aieener/HRE
void MC::MCRUN()
{
	Cells s(c,r);

	stringstream st;

	double addordel; // the prob to decide either add or del;
	// double probd;//,proba; // the acceptance prob of addition; proba = min(1.0,aaccp);
	double prob; // the prob to decide either accept add/del;
	double aaccp,daccp; 
	double Q; // the fraction of hor and ver particle;
	double tho; // the density 
	double AD;// addition and deletion fraction
	double size;
		
	srand(time(NULL));
	long int i = 0;
	// Histogram his(0, r*c/length, 1); // the histogram of nv

	//================================Start my MC simulation=================================
	while (i<step)
	{
		i++;
		// generate a random probability to decide either add or del;
		addordel = rand()%2;
		size = av+ah-dv-dh;

		// *****************define the probabilities ***********************************// I HAVE TO CHANGE IT FOR LATTICE GAS CASE!!!
		prob = ((double) rand() / (RAND_MAX)); 
		tho = double(length*size)/double(r*c);

		aaccp = z*double(r*c)/(double(nh+nv+1.0)*double(length));
		daccp = (double(nh+nv)*double(length))/(z*double(r*c));

		// proba = min(1.0,aaccp);
		// probd = min(1.0,daccp);

        // ===========================Addition ===================================
		if(addordel == 0) 
		{
			//Do Addition;
			Add(s,prob,aaccp);
		}

		// ============================Deletion=============================
		else
		{
			if (size != 0) // make sure there are rods to be del;
			{
				//Do deletion;
				Del(s,prob,daccp,size);
			}			
		}

		// ======================= Record the datas =============================================		
        Q = (nv - nh)/(nh + nv);
		AD = (av+ah-dv-dh)/(av+ah+dv+dh);

		if (i%(step/10000) == 0)
		{
			// his.record(nv);
			st << i << "         " << Q <<"        "<< nv << "          "<< nh << "         "<< tho << "         "<< AD<< "         "<< endl;
			cout <<"Process: "<< ((10000*i)/step)/100.00 <<"%"<<"    "<<"SIZE: "<<av+ah-dv-dh<<"    "<<"# of Ver Rod: "<<nv<<"    "<<"# of Hor Rod: "<< nh <<"   "<<"Qis "<<Q <<"   "<<"tho is: "<<tho << endl;
		}
	}
	// Record the data into a txt file
	ofstream myfile3 ("dataplot.dat");
	string data = st.str();
	myfile3 << data;
	myfile3.close();
	// his.plot(0);
}
示例#10
0
/**
 * \brief Add a new mark of the given type. Before the new mark is added, any
 *        existing redundant mark of that type is removed. This simplifies
 *        the cleanup code.
 */
void DeleteMap::AddMark(uint64_t frame, MarkTypes type)
{
    EDIT_CHECK;
    if ((MARK_CUT_START != type) && (MARK_CUT_END != type) &&
        (MARK_PLACEHOLDER != type))
        return;

    frm_dir_map_t::Iterator find_temporary = m_deleteMap.find(frame);
    if (find_temporary != m_deleteMap.end())
    {
        if (MARK_PLACEHOLDER == find_temporary.value())
        {
            // Delete the temporary mark before putting a real mark at its
            // location
            Delete(frame, "");
        }
        else // Don't add a mark on top of a mark
            return;
    }

    int       lasttype  = MARK_UNSET;
    long long lastframe = -1;
    long long remove    = -1;
    QMutableMapIterator<uint64_t, MarkTypes> it(m_deleteMap);

    if (type == MARK_CUT_END)
    {
        // remove curent end marker if it exists
        while (it.hasNext())
        {
            it.next();
            if (it.key() > frame)
            {
                if ((lasttype == MARK_CUT_END) && (lastframe > -1))
                    remove = lastframe;
                break;
            }
            lasttype  = it.value();
            lastframe = it.key();
        }
        if ((remove < 0) && (lasttype == MARK_CUT_END) &&
            (lastframe > -1) && (lastframe < (int64_t)frame))
            remove = lastframe;
    }
    else if (type == MARK_CUT_START)
    {
        // remove curent start marker if it exists
        it.toBack();
        while (it.hasPrevious())
        {
            it.previous();
            if (it.key() <= frame)
            {
                if (lasttype == MARK_CUT_START && (lastframe > -1))
                    remove = lastframe;
                break;
            }
            lasttype  = it.value();
            lastframe = it.key();
        }
        if ((remove < 0) && (lasttype == MARK_CUT_START) &&
            (lastframe > -1) && (lastframe > (int64_t)frame))
            remove = lastframe;
    }

    if (remove > -1)
        Delete((uint64_t)remove);
    Add(frame, type);
    CleanMap();
}
示例#11
0
/// Add a new cut marker (to start or end a cut region)
void DeleteMap::NewCut(uint64_t frame)
{
    EDIT_CHECK;

    // Defer pushing the undo entry until the end, when we're sure a
    // change has been made.
    frm_dir_map_t initialDeleteMap = m_deleteMap;

    // find any existing temporary marker to determine cut range
    int64_t existing = -1;
    for (auto it = m_deleteMap.begin() ; it != m_deleteMap.end(); ++it)
    {
        if (MARK_PLACEHOLDER == it.value())
        {
            existing = it.key();
            break;
        }
    }

    if (existing > -1)
    {
        uint64_t total = m_ctx->player->GetTotalFrameCount();
        uint64_t otherframe = static_cast<uint64_t>(existing);
        if (otherframe == frame)
            Delete(otherframe);
        else
        {
            uint64_t startframe;
            uint64_t endframe;
            int64_t cut_start = -1;
            int64_t cut_end = -1;
            if (IsInDelete(frame))
            {
                MarkTypes type = MARK_UNSET;
                cut_start = GetNearestMark(frame, false);
                cut_end = GetNearestMark(frame, true);
                frm_dir_map_t::Iterator it2 = m_deleteMap.find(frame);
                if (it2 != m_deleteMap.end())
                    type = it2.value();
                if (MARK_CUT_START == type)
                {
                    cut_start = frame;
                }
                else if (MARK_CUT_END == type)
                {
                    cut_end = frame;
                }
            }

            if (otherframe < frame)
            {
                startframe = otherframe;
                endframe = cut_end != -1 ? static_cast<uint64_t>(cut_end)
                                         : frame;
            }
            else
            {
                startframe = cut_start != -1 ? static_cast<uint64_t>(cut_start)
                                             : frame;
                endframe = otherframe;
            }

            // Don't place a cut marker on first or last frame; instead cut
            // to beginning or end
            if (startframe == 1)
                startframe = 0;
            if (endframe >= total - 1)
                endframe = total;

            // Don't cut the entire recording
            if ((startframe == 0) && (endframe == total))
            {
                LOG(VB_GENERAL, LOG_CRIT, LOC +
                    "Refusing to cut entire recording.");
                return;
            }

            Delete(otherframe);
            Add(startframe, MARK_CUT_START);
            Add(endframe, MARK_CUT_END);
            // Clear out any markers between the start and end frames
            otherframe = 0;
            frm_dir_map_t::Iterator it = m_deleteMap.find(startframe);
            for ( ; it != m_deleteMap.end() && otherframe < endframe; ++it)
            {
                otherframe = it.key();
                if ((startframe < otherframe) && (endframe > otherframe))
                {
                    LOG(VB_PLAYBACK, LOG_INFO, LOC +
                        QString("Deleting bounded marker: %1").arg(otherframe));
                    it = m_deleteMap.erase(it);
                    m_changed = true;
                }
            }
        }
    }
    else
        Add(frame, MARK_PLACEHOLDER);

    CleanMap();
    PushDeferred(initialDeleteMap, tr("New Cut"));
}
示例#12
0
void cMenuSetupMailNotification::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Search timer notification"), &data->sendMailOnSearchtimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the search timers that where programmed automatically in the background."));

  if (data->sendMailOnSearchtimers)
  {
    Add(new cMenuEditIntItem(IndentMenuItem(tr("Time between mails [h]")), &data->sendMailOnSearchtimerHours,  0, 999999, ""));
    AddHelp(tr("Help$Specifiy how much time in [h] you would\nlike to have atleast between two mails.\nWith '0' you get a new mail after each\nsearch timer update with new results."));
  }
  Add(new cMenuEditBoolItem(tr("Timer conflict notification"), &data->sendMailOnConflicts, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if you want to get an email notification about the timer conflicts."));

  Add(new cMenuEditStrItem(tr("Send to"), data->MailAddressTo, sizeof(data->MailAddressTo), MailBoxChars));
  AddHelp(tr("Help$Specify the email address where notifications should be sent to."));

  Add(new cMenuEditStraItem(tr("Mail method"), &data->mailViaScript, 2, MailMethod));
  AddHelp(tr("Help$Specify here the method to use when sending mails.\nYou can choose between\n - 'sendmail': requires a properly configured email system\n - 'SendEmail.pl': simple script for mail delivery"));

  if (data->mailViaScript)
  {
     cOsdItem* sep = new cOsdItem(tr("--- Email account ---"));
     sep->SetSelectable(false);
     Add(sep);
     AddHelp(" dummy");

     Add(new cMenuEditStrItem(tr("Email address"), data->MailAddress, sizeof(data->MailAddress), MailBoxChars));
     AddHelp(tr("Help$Specify the email address where notifications should be sent from."));

     Add(new cMenuEditStrItem(tr("SMTP server"), data->MailServer, sizeof(data->MailServer), HostNameChars));
     AddHelp(tr("Help$Specify the SMTP server that should deliver the notifications. If it's using a port different from the default(25) append the port with \":port\"."));
     Add(new cMenuEditBoolItem(tr("Use SMTP authentication"), &data->MailUseAuth, trVDR("no"), trVDR("yes")));
     AddHelp(tr("Help$Set this to 'yes' if your account needs authentication to send mails."));

     if (data->MailUseAuth)
     {
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth user")), data->MailAuthUser, sizeof(data->MailAuthUser), UserNameChars));
        AddHelp(tr("Help$Specify the auth user, if this account needs authentication for SMTP."));
        Add(new cMenuEditStrItem(IndentMenuItem(tr("Auth password")), tmpMailAuthPass, sizeof(tmpMailAuthPass), PasswordChars));
        AddHelp(tr("Help$Specify the auth password, if this account needs authentication for SMTP."));
     }
  }

  SetCurrent(Get(current));
  Display();

  SetHelpKeys();
}
示例#13
0
void cMenuSetupTimerConflicts::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditIntItem(tr("Ignore below priority"), &data->checkMinPriority, 0, MAXPRIORITY));
  AddHelp(tr("Help$If a timer with priority below the given value will fail it will not be classified as important. Only important conflicts will produce an OSD message about the conflict after an automatic conflict check."));
  Add(new cMenuEditIntItem(tr("Ignore conflict duration less ... min."), &data->checkMinDuration, 0, 999));
  AddHelp(tr("Help$If a conflicts duration is less then the given number of minutes it will not be classified as important. Only important conflicts will produce an OSD message about the conflict after an automatic conflict check."));
  Add(new cMenuEditIntItem(tr("Only check within next ... days"), &data->checkMaxDays, 1, 14));
  AddHelp(tr("Help$This value reduces the conflict check to the given range of days. All other conflicts are classified as 'not yet important'."));

  cOsdItem* sep = new cOsdItem(tr("--- Automatic checking ---"));
  sep->SetSelectable(false);
  Add(sep);
  AddHelp("dummy");

  Add(new cMenuEditBoolItem(tr("After each timer programming"), &data->checkTimerConflAfterTimerProg, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed after each manual timer programming. In the case of a conflict you get immediately a message that informs you about it. The message is only displayed if this timer is involved in any conflict."));
  Add(new cMenuEditBoolItem(tr("When a recording starts"), &data->checkTimerConflOnRecording, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed when a recording starts. In the case of a conflict you get immediately a message that informs you about it. The message is only displayed if the conflict is within the next 2 hours."));

  Add(new cMenuEditBoolItem(tr("After each search timer update"), &data->checkTimerConflictsAfterUpdate, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the conflict check should be performed after each search timer update."));
  if (!data->checkTimerConflictsAfterUpdate)
  {
      Add(new cMenuEditIntItem(IndentMenuItem(tr("every ... minutes")), &data->conflictCheckIntervall, 0, 999));
      AddHelp(tr("Help$Specify here the time intervall to be used for an automatic conflict check in the background.\n('0' disables an automatic check)"));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("if conflicts within next ... minutes")), &data->conflictCheckWithinLimit, 0, 9999));
      AddHelp(tr("Help$If the next conflict will appear in the given number of minutes you can specify here a shorter check intervall to get more OSD notifications about it."));
      if (data->conflictCheckWithinLimit)
      {
	  Add(new cMenuEditIntItem(IndentMenuItem(IndentMenuItem(tr("every ... minutes"))), &data->conflictCheckIntervall2, 1, 999));
      AddHelp(tr("Help$If the next conflict will appear in the given number of minutes you can specify here a shorter check intervall to get more OSD notifications about it."));
      }
  }
  Add(new cMenuEditBoolItem(tr("Avoid notification when replaying"), &data->noConflMsgWhileReplay, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if the don't want to get OSD messages about conflicts if you currently replay something. Nevertheless messages will be displayed if the first upcoming conflict is within the next 2 hours."));

  SetCurrent(Get(current));
  Display();
  SetHelp(NULL, NULL, tr("Button$Help"), NULL);
}
示例#14
0
void cMenuSetupSearchtimers::Set()
{
  int current = Current();
  Clear();
  helpTexts.clear();

  Add(new cMenuEditBoolItem(tr("Use search timers"), &data->useSearchTimers, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$'Search timers' can be used to automatically create timers for events that match your search criterions."));
  if (data->useSearchTimers)
  {
      Add(new cMenuEditIntItem(tr("  Update interval [min]"), &data->UpdateIntervall, 1, 9999));
      AddHelp(tr("Help$Specify here the time intervall to be used when searching for events in the background."));
      Add(new cMenuEditIntItem(tr("  SVDRP port"), &data->SVDRPPort, 1, 99999));
      AddHelp(tr("Help$Programming of new timers or timer changes is done with SVDRP. The default value should be correct, so change it only if you know what you are doing."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default priority")), &data->DefPriority, 0, MAXPRIORITY));
      AddHelp(tr("Help$Specify here the default priority of timers created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Default lifetime (d)")), &data->DefLifetime, 0, MAXLIFETIME));
      AddHelp(tr("Help$Specify here the default lifetime of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at start (min)")), &data->DefMarginStart));
      AddHelp(tr("Help$Specify here the default start recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditIntItem(IndentMenuItem(trVDR("Setup.Recording$Margin at stop (min)")), &data->DefMarginStop));
      AddHelp(tr("Help$Specify here the default stop recording margin of timers/recordings created with this plugin. This value can also be adjusted for each search itself."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("No announcements when replaying")), &data->noAnnounceWhileReplay, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you don't like to get any announcements of broadcasts if you currently replay anything."));
      Add(new cMenuEditBoolItem(IndentMenuItem(tr("Recreate timers after deletion")), &data->TimerProgRepeat, trVDR("no"), trVDR("yes")));
      AddHelp(tr("Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."));
      Add(new cMenuEditIntItem(IndentMenuItem(tr("Check if EPG exists for ... [h]")), &data->checkEPGHours, 0, 999));
      AddHelp(tr("Help$Specify how many hours of future EPG there should be and get warned else after a search timer update."));
      if (data->checkEPGHours > 0)
      {
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by OSD"),2), &data->checkEPGWarnByOSD, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check via OSD."));
	Add(new cMenuEditBoolItem(IndentMenuItem(tr("Warn by mail"),2), &data->checkEPGWarnByMail, trVDR("no"), trVDR("yes")));
	AddHelp(tr("Help$Set this to 'yes' if you want get warnings from the EPG check by mail."));

	// create the char array for the menu display
	if (menuitemsChGr) delete [] menuitemsChGr;
	menuitemsChGr = ChannelGroups.CreateMenuitemsList();
	Add(new cMenuEditStraItem(IndentMenuItem(tr("Channel group to check"),2), &data->checkEPGchannelGroupNr, ChannelGroups.Count()+1, menuitemsChGr));
	AddHelp(tr("Help$Specify the channel group to check."));
      }
  }

  Add(new cMenuEditBoolItem(  tr("Ignore PayTV channels"), &data->ignorePayTV, trVDR("no"), trVDR("yes")));
  AddHelp(tr("Help$Set this to 'yes' if don't want to see events on PayTV channels when searching for repeats."));
  Add(new cOsdItem(tr("Search templates")));
  AddHelp(tr("Help$Here you can setup templates for your searches."));
  Add(new cOsdItem(tr("Blacklists")));
  AddHelp(tr("Help$Here you can setup blacklists which can be used within a search to exclude events you don't like."));
  Add(new cOsdItem(tr("Channel groups")));
  AddHelp(tr("Help$Here you can setup channel groups which can be used within a search. These are different to VDR channel groups and represent a set of arbitrary channels, e.g. 'FreeTV'."));

  SetCurrent(Get(current));
  Display();
  SetHelpKeys();
}
示例#15
0
/**
 * Change value by key.
 * @param osName  Key name.
 * @param bValue   Boolean value.
 *
 * @since GDAL 2.3
 */
void CPLJSONObject::Set(const std::string &osName, bool bValue)
{
    Delete( osName );
    Add( osName, bValue );
}
示例#16
0
// Add a function to the current scope
Symbol *
	GlobalScope::
	AddFunction(const char * const name)
{
	return Add(name, &m_functions);
}
示例#17
0
//==========================================================================*
// Add a value P(x,y)
//--------------------------------------------------------------------------*
void TLinearRegression::Add(const TVec2d& Point)
{
  Add(Point.x, Point.y);
}
示例#18
0
// Add a symbol to the current scope
Symbol *
	GlobalScope::
	AddSymbol(const char * const name)
{
	return Add(name, &m_symbols);
}
示例#19
0
文件: parse.c 项目: attuska/Sasc-ng
void cAssembleData::SetAssembled(const unsigned char *Data)
{
  Add(new cAssSct(Data));
  curr=First();
}
示例#20
0
// Add a label to the current scope
Symbol *
	GlobalScope::
	AddLabel(const char * const name)
{
	return Add(name, &m_labels);
}
示例#21
0
HWStubManager::HWStubManager()
{
    Add("Default", QString::fromStdString(hwstub::uri::default_uri().full_uri()));
}
CModuleActionsSet::CModuleActionsSet(string language) : CImpactActionsSet(language) {
	Add(new CRenameAction());
	Add(new CDeleteEntityAction());
	if(m_szLanguage=="JAVA")		
		Add(new CMoveToPackageAction());
}
示例#23
0
range_iterator Group::Add(Range r)
{
    return Add(r, rangeList.begin());
}
示例#24
0
void C4ObjectList::Copy(const C4ObjectList &rList)
{
	Clear(); Default();
	C4ObjectLink *cLnk;
	for (cLnk=rList.First; cLnk; cLnk=cLnk->Next) Add(cLnk->Obj, C4ObjectList::stNone);
}
示例#25
0
Group::Group(Range r)
{
    Add(r);
}
示例#26
0
/**
 * Change value by key.
 * @param osName  Key name.
 * @param dfValue  Double value.
 *
 * @since GDAL 2.3
 */
void CPLJSONObject::Set(const std::string &osName, double dfValue)
{
    Delete( osName );
    Add( osName, dfValue );
}
示例#27
0
//-----------------------------------------------------------------------------
// Invokes methods on all installed game systems
//-----------------------------------------------------------------------------
bool IGameSystem::InitAllSystems()
{
	int i;

	{
		// first add any auto systems to the end
		CAutoGameSystem *pSystem = s_pSystemList;
		while ( pSystem )
		{
			if ( s_GameSystems.Find( pSystem ) == s_GameSystems.InvalidIndex() )
			{
				Add( pSystem );
			}
			else
			{
				DevWarning( 1, "AutoGameSystem already added to game system list!!!\n" );
			}
			pSystem = pSystem->m_pNext;
		}
		s_pSystemList = NULL;
	}

	{
		CAutoGameSystemPerFrame *pSystem = s_pPerFrameSystemList;
		while ( pSystem )
		{
			if ( s_GameSystems.Find( pSystem ) == s_GameSystems.InvalidIndex() )
			{
				Add( pSystem );
			}
			else
			{
				DevWarning( 1, "AutoGameSystem already added to game system list!!!\n" );
			}

			pSystem = pSystem->m_pNext;
		}
		s_pSystemList = NULL;
	}
	// Now remember that we are initted so new CAutoGameSystems will add themselves automatically.
	s_bSystemsInitted = true;

	for ( i = 0; i < s_GameSystems.Count(); ++i )
	{
		MDLCACHE_CRITICAL_SECTION();

		IGameSystem *sys = s_GameSystems[i];

#if defined( _X360 )
		char sz[128];
		Q_snprintf( sz, sizeof( sz ), "%s->Init():Start", sys->Name() );
		XBX_rTimeStampLog( Plat_FloatTime(), sz );
#endif
		bool valid = sys->Init();

#if defined( _X360 )
		Q_snprintf( sz, sizeof( sz ), "%s->Init():Finish", sys->Name() );
		XBX_rTimeStampLog( Plat_FloatTime(), sz );
#endif
		if ( !valid )
			return false;
	}

	return true;
}
示例#28
0
/**
 * Change value by key.
 * @param osName  Key name.
 * @param nValue   Long value.
 *
 * @since GDAL 2.3
 */
void CPLJSONObject::Set(const std::string &osName, GInt64 nValue)
{
    Delete( osName );
    Add( osName, nValue );
}
示例#29
0
// add files to list
gbool GFileSorter::AddFiles(const char *directory,time_t &maxFileTime,BOOL &stop)
{

    CFileFind finder;

    CString dir = directory;

    // add separator
    int l = dir.GetLength();
    if (l == 0) return FALSE;
    if ( !((dir[l-1] == '\\') || (dir[l-1] == '/'))) dir += '\\';

    dir += "*.*";

    CString path;

    CTime creationTime((time_t)0);
    CTime accessTime((time_t)0);
    CTime writeTime((time_t)0);

    // setup the find structure
    BOOL bWorking = finder.FindFile(dir);


    while (bWorking)  { // for all entrys
        if (stop) break;

        bWorking = finder.FindNextFile();

        path = finder.GetFilePath();

        creationTime = (time_t)0;
        accessTime = (time_t)0;
        writeTime = (time_t)0;

        BOOL ret=finder.GetCreationTime(creationTime);
        finder.GetLastAccessTime(accessTime);
        finder.GetLastWriteTime(writeTime);

        time_t t = creationTime.GetTime();

        if (writeTime.GetTime()>0) t = max(t,writeTime.GetTime()); // HG wg Kristof

        if (accessTime.GetTime()>0) t = max(t,accessTime.GetTime());

        if (finder.IsDots( )) {	// ignore . ..

        } else 	if (finder.IsDirectory( )) { // recursively step down

            t=0; // we want to delete empty directories new 20.10.98
            AddFiles(path,t,stop);

            DWORD length = 0;

            // to do get date of latest
            TRACE("D %s c %ld a %ld w %ld size %ld \n",(const char *) path, creationTime.GetTime(),accessTime.GetTime(),writeTime.GetTime(),length);

            // time is the max of the child time +1
            GFSortEntry *e = new GFSortEntry(path,t+1,length,gtrue);

            if (!e) break;
            if (!Add(e)) break;

            if (t>maxFileTime) maxFileTime = t;


        }
        else {

            DWORD length = finder.GetLength(); // get length 64
            fileSum += length;

            TRACE("F %s c %ld a %ld w %ld size %ld \n",(const char *) path, creationTime.GetTime(),accessTime.GetTime(),writeTime.GetTime(),length);
            GFSortEntry *e = new GFSortEntry(path,t,length);

            if (t>maxFileTime) maxFileTime = t;

            if (!e) break;
            if (!Add(e)) break;
        }


    }
    finder.Close();

    //TRACE("%ld bytes \n",(long)fileSum);

    return TRUE;
}
示例#30
0
void cMenuSetupEPGMenus::Set()
{
    int current = Current();
    Clear();
    helpTexts.clear();

    Add(new cMenuEditStraItem(  tr("Ok key"), &data->useOkForSwitch, 2, OkKeyMode));
    AddHelp(tr("Help$Choose here the behaviour of key 'Ok'. You can use it to display the summary or to switch to the corresponding channel.\nNote: the functionality of key 'blue' (Switch/Info/Search) depends on this setting."));

    Add(new cMenuEditStraItem(tr("Red key"), &data->redkeymode, 2, RedKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Record' or 'Commands') you like to have on the red key.\n(Can be toggled with key '0')"));
    Add(new cMenuEditStraItem(tr("Blue key"), &data->bluekeymode, 2, BlueKeyMode));
    AddHelp(tr("Help$Choose which standard function ('Switch'/'Info' or 'Search') you like to have on the blue key.\n(Can be toggled with key '0')"));

    Add(new cMenuEditBoolItem(tr("Show progress in 'Now'"), &data->showProgress, trVDR("no"), trVDR("yes")));
    AddHelp(tr("Help$Shows a progressbar in 'Overview - Now' that informs about the remaining time of the current event."));
    Add(new cMenuEditBoolItem(  tr("Show channel numbers"), &data->showChannelNr,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display channel numbers in 'Overview - Now'.\n\n(To completely define your own menu look please inspect the MANUAL)"));
    Add(new cMenuEditBoolItem(  tr("Show channel separators"), &data->showChannelGroups,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display VDR channel groups as separators between your channels in 'Overview - Now'."));
    Add(new cMenuEditBoolItem(  tr("Show day separators"), &data->showDaySeparators,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Display a separator line at day break in 'Schedule'."));
    Add(new cMenuEditBoolItem(  tr("Show radio channels"), &data->showRadioChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Show also radio channels."));
    Add(new cMenuEditIntItem(tr("Limit channels from 1 to"), &data->maxChannelMenuNow, 0, 9999));
    AddHelp(tr("Help$If you have a large channel set you can speed up things when you limit the displayed channels with this setting. Use '0' to disable the limit."));
    Add(new cMenuEditBoolItem(  tr("'One press' timer creation"), &data->onePressTimerCreation,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$When a timer is created with 'Record' you can choose between an immediate creation of the timer or the display of the timer edit menu."));
    Add(new cMenuEditBoolItem(  tr("Show channels without EPG"), &data->showEmptyChannels,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Choose 'yes' here if you want to display channels without EPG in 'Overview - Now'. 'Ok' on these entries switches the channel."));
    Add(new cMenuEditIntItem(tr("Time interval for FRew/FFwd [min]"), &data->timeShiftValue, 1, 9999));
    AddHelp(tr("Help$Choose here the time interval which should be used for jumping through the EPG by pressing FRew/FFwd.\n\n(If you don't have those keys, you can toggle to this functionality pressing '0' and get '<<' and '>>' on the keys green and yellow)"));
    Add(new cMenuEditBoolItem(  tr("Toggle Green/Yellow"), &data->toggleGreenYellow,       trVDR("no"),      trVDR("yes")));
    AddHelp(tr("Help$Specify if green and yellow shall also be switched when pressing '0'."));

    Add(new cMenuEditStraItem(  tr("Show favorites menu"), &data->showFavoritesMenu, 4, FavoritesMenuMode));
    AddHelp(tr("Help$A favorites menu can display a list of your favorite broadcasts. Enable this if you want an additional menu besides 'Now' and 'Next'\nAny search can be used as a favorite. You only have to set the option 'Use in favorites menu' when editing a search."));
    if (data->showFavoritesMenu)
    {
	Add(new cMenuEditIntItem( IndentMenuItem(tr("for the next ... hours")), &data->FavoritesMenuTimespan, 1, 9999));
	AddHelp(tr("Help$This value controls the timespan used to display your favorites."));
    }

    SetCurrent(Get(current));
    Display();
    SetHelpKeys();
}