Subversion Repositories tpanel

Rev

Rev 107 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 107 Rev 118
Line 264... Line 264...
264
    size_t oldIndex = 0;
264
    size_t oldIndex = 0;
265
 
265
 
266
    if (elements.size() == 0)
266
    if (elements.size() == 0)
267
        return false;
267
        return false;
268
 
268
 
269
    for (mapIter = elements.begin(); mapIter != elements.end(); mapIter++)
269
    for (mapIter = elements.begin(); mapIter != elements.end(); ++mapIter)
270
    {
270
    {
271
        if ((index = xml.getElementIndex(*mapIter, &depth)) == TExpat::npos)
271
        if ((index = xml.getElementIndex(*mapIter, &depth)) == TExpat::npos)
272
        {
272
        {
273
            MSG_WARNING("Element \"" << *mapIter << "\" was not found!");
273
            MSG_WARNING("Element \"" << *mapIter << "\" was not found!");
274
            continue;
274
            continue;
Line 417... Line 417...
417
    {
417
    {
418
        MSG_DEBUG("Found fields:");
418
        MSG_DEBUG("Found fields:");
419
        vector<string>::iterator iter;
419
        vector<string>::iterator iter;
420
        int i = 1;
420
        int i = 1;
421
 
421
 
422
        for (iter = flds.begin(); iter != flds.end(); iter++)
422
        for (iter = flds.begin(); iter != flds.end(); ++iter)
423
        {
423
        {
424
            MSG_DEBUG("    " << i << ": " << *iter);
424
            MSG_DEBUG("    " << i << ": " << *iter);
425
            i++;
425
            i++;
426
        }
426
        }
427
    }
427
    }
Line 455... Line 455...
455
    {
455
    {
456
        MSG_WARNING("The internal list of elements is empty!")
456
        MSG_WARNING("The internal list of elements is empty!")
457
        return map;
457
        return map;
458
    }
458
    }
459
 
459
 
460
    for (iter = channels.begin(); iter != channels.end(); iter++)
460
    for (iter = channels.begin(); iter != channels.end(); ++iter)
461
    {
461
    {
462
        vector<MAP_T>::iterator mapIter;
462
        vector<MAP_T>::iterator mapIter;
463
 
463
 
464
        for (mapIter = localMap.begin(); mapIter != localMap.end(); mapIter++)
464
        for (mapIter = localMap.begin(); mapIter != localMap.end(); ++mapIter)
465
        {
465
        {
466
            if (mapIter->p == port && mapIter->c == *iter)
466
            if (mapIter->p == port && mapIter->c == *iter)
467
                map.push_back(*mapIter);
467
                map.push_back(*mapIter);
468
        }
468
        }
469
    }
469
    }
Line 484... Line 484...
484
        return map;
484
        return map;
485
    }
485
    }
486
 
486
 
487
    vector<MAP_T>::iterator mapIter;
487
    vector<MAP_T>::iterator mapIter;
488
 
488
 
489
    for (mapIter = mMap.map_cm.begin(); mapIter != mMap.map_cm.end(); mapIter++)
489
    for (mapIter = mMap.map_cm.begin(); mapIter != mMap.map_cm.end(); ++mapIter)
490
    {
490
    {
491
        if (mapIter->bn == name)
491
        if (mapIter->bn == name)
492
            map.push_back(*mapIter);
492
            map.push_back(*mapIter);
493
    }
493
    }
494
 
494
 
Line 504... Line 504...
504
    vector<int>::iterator iter;
504
    vector<int>::iterator iter;
505
 
505
 
506
    if (channels.size() == 0)
506
    if (channels.size() == 0)
507
        return map;
507
        return map;
508
 
508
 
509
    for (iter = channels.begin(); iter != channels.end(); iter++)
509
    for (iter = channels.begin(); iter != channels.end(); ++iter)
510
    {
510
    {
511
        vector<MAP_T>::iterator mapIter;
511
        vector<MAP_T>::iterator mapIter;
512
 
512
 
513
        if (mMap.map_lm.size() > 0)
513
        if (mMap.map_lm.size() > 0)
514
        {
514
        {
515
            for (mapIter = mMap.map_lm.begin(); mapIter != mMap.map_lm.end(); mapIter++)
515
            for (mapIter = mMap.map_lm.begin(); mapIter != mMap.map_lm.end(); ++mapIter)
516
            {
516
            {
517
                if (mapIter->p == port && mapIter->c == *iter)
517
                if (mapIter->p == port && mapIter->c == *iter)
518
                    map.push_back(*mapIter);
518
                    map.push_back(*mapIter);
519
            }
519
            }
520
        }
520
        }
Line 529... Line 529...
529
    DECL_TRACER("TAmxCommands::findSounds()");
529
    DECL_TRACER("TAmxCommands::findSounds()");
530
 
530
 
531
    return mMap.map_sm;
531
    return mMap.map_sm;
532
}
532
}
533
 
533
 
534
bool TAmxCommands::soundExist(const string sname)
534
bool TAmxCommands::soundExist(const string& sname)
535
{
535
{
536
    DECL_TRACER("TAmxCommands::soundExist(const string sname)");
536
    DECL_TRACER("TAmxCommands::soundExist(const string sname)");
537
 
537
 
538
    if (mMap.map_sm.size() == 0)
538
    if (mMap.map_sm.size() == 0)
539
        return false;
539
        return false;
Line 566... Line 566...
566
    if (pos != string::npos)    // Command with parameters
566
    if (pos != string::npos)    // Command with parameters
567
    {
567
    {
568
        string bef = cmd.substr(0, pos);
568
        string bef = cmd.substr(0, pos);
569
        string rest = cmd.substr(pos + 1);
569
        string rest = cmd.substr(pos + 1);
570
 
570
 
571
        for (iter = mCmdTable.begin(); iter != mCmdTable.end(); iter++)
571
        for (iter = mCmdTable.begin(); iter != mCmdTable.end(); ++iter)
572
        {
572
        {
573
            iter->channels.clear();
573
            iter->channels.clear();
574
            iter->pars.clear();
574
            iter->pars.clear();
575
 
575
 
576
            if (iter->cmd.compare(bef) == 0 && iter->command)
576
            if (iter->cmd.compare(bef) == 0 && iter->command)
Line 597... Line 597...
597
                        if (parts.size() > 0)
597
                        if (parts.size() > 0)
598
                        {
598
                        {
599
                            vector<string>::iterator piter;
599
                            vector<string>::iterator piter;
600
                            int cnt = 0;
600
                            int cnt = 0;
601
 
601
 
602
                            for (piter = parts.begin(); piter != parts.end(); piter++)
602
                            for (piter = parts.begin(); piter != parts.end(); ++piter)
603
                            {
603
                            {
604
                                if (cdef.hasChannels && !cnt)
604
                                if (cdef.hasChannels && !cnt)
605
                                {
605
                                {
606
                                    cnt++;
606
                                    cnt++;
607
                                    continue;
607
                                    continue;
Line 621... Line 621...
621
            }
621
            }
622
        }
622
        }
623
    }
623
    }
624
    else        // Command without parameter
624
    else        // Command without parameter
625
    {
625
    {
626
        for (iter = mCmdTable.begin(); iter != mCmdTable.end(); iter++)
626
        for (iter = mCmdTable.begin(); iter != mCmdTable.end(); ++iter)
627
        {
627
        {
628
            if (iter->cmd.compare(cmd) == 0 && iter->command)
628
            if (iter->cmd.compare(cmd) == 0 && iter->command)
629
            {
629
            {
630
                iter->command(port, iter->channels, iter->pars);
630
                iter->command(port, iter->channels, iter->pars);
631
                return true;
631
                return true;
Line 656... Line 656...
656
        vector<string> parts = StrSplit(schan, "&");
656
        vector<string> parts = StrSplit(schan, "&");
657
        vector<string>::iterator iter;
657
        vector<string>::iterator iter;
658
 
658
 
659
        if (parts.size() > 0)
659
        if (parts.size() > 0)
660
        {
660
        {
661
            for (iter = parts.begin(); iter != parts.end(); iter++)
661
            for (iter = parts.begin(); iter != parts.end(); ++iter)
662
            {
662
            {
663
                if (iter->find(".") != string::npos)
663
                if (iter->find(".") != string::npos)
664
                {
664
                {
665
                    vector<string> p2 = StrSplit(*iter, ".");
665
                    vector<string> p2 = StrSplit(*iter, ".");
666
 
666
 
Line 697... Line 697...
697
{
697
{
698
    DECL_TRACER("TAmxCommands::registerCommand(std::function<void (vector<int>& channels, vector<string>& pars)> command, const string& name)");
698
    DECL_TRACER("TAmxCommands::registerCommand(std::function<void (vector<int>& channels, vector<string>& pars)> command, const string& name)");
699
 
699
 
700
    vector<CMD_TABLE>::iterator iter;
700
    vector<CMD_TABLE>::iterator iter;
701
 
701
 
702
    for (iter = mCmdTable.begin(); iter != mCmdTable.end(); iter++)
702
    for (iter = mCmdTable.begin(); iter != mCmdTable.end(); ++iter)
703
    {
703
    {
704
        if (iter->cmd.compare(name) == 0)
704
        if (iter->cmd.compare(name) == 0)
705
        {
705
        {
706
            iter->command = command;
706
            iter->command = command;
707
            iter->channels.clear();
707
            iter->channels.clear();