| 653 | // private |
| 654 | |
| 655 | void afxEffectron::process_server() |
| 656 | { |
| 657 | if (effect_state != INACTIVE_STATE) |
| 658 | effect_elapsed += TickSec; |
| 659 | |
| 660 | U8 pending_state = effect_state; |
| 661 | |
| 662 | // check for state changes |
| 663 | switch (effect_state) |
| 664 | { |
| 665 | case INACTIVE_STATE: |
| 666 | if (marks_mask & MARK_ACTIVATE) |
| 667 | pending_state = ACTIVE_STATE; |
| 668 | break; |
| 669 | case ACTIVE_STATE: |
| 670 | if (marks_mask & MARK_INTERRUPT) |
| 671 | pending_state = CLEANUP_STATE; |
| 672 | else if (marks_mask & MARK_SHUTDOWN) |
| 673 | pending_state = CLEANUP_STATE; |
| 674 | else if (state_expired()) |
| 675 | pending_state = CLEANUP_STATE; |
| 676 | break; |
| 677 | case CLEANUP_STATE: |
| 678 | if (cleanup_over()) |
| 679 | pending_state = DONE_STATE; |
| 680 | break; |
| 681 | } |
| 682 | |
| 683 | if (effect_state != pending_state) |
| 684 | change_state_s(pending_state); |
| 685 | |
| 686 | if (effect_state == INACTIVE_STATE) |
| 687 | return; |
| 688 | |
| 689 | //--------------------------// |
| 690 | |
| 691 | // sample the constraints |
| 692 | constraint_mgr->sample(TickSec, Platform::getVirtualMilliseconds()); |
| 693 | |
| 694 | if (active_phrase) |
| 695 | active_phrase->update(TickSec, effect_elapsed); |
| 696 | } |
| 697 | |
| 698 | void afxEffectron::change_state_s(U8 pending_state) |
| 699 | { |