| 730 | |
| 731 | |
| 732 | void FxMixer::loadSettings( const QDomElement & _this ) |
| 733 | { |
| 734 | clear(); |
| 735 | QDomNode node = _this.firstChild(); |
| 736 | |
| 737 | while( ! node.isNull() ) |
| 738 | { |
| 739 | QDomElement fxch = node.toElement(); |
| 740 | |
| 741 | // index of the channel we are about to load |
| 742 | int num = fxch.attribute( "num" ).toInt(); |
| 743 | |
| 744 | // allocate enough channels |
| 745 | allocateChannelsTo( num ); |
| 746 | |
| 747 | m_fxChannels[num]->m_volumeModel.loadSettings( fxch, "volume" ); |
| 748 | m_fxChannels[num]->m_muteModel.loadSettings( fxch, "muted" ); |
| 749 | m_fxChannels[num]->m_soloModel.loadSettings( fxch, "soloed" ); |
| 750 | m_fxChannels[num]->m_name = fxch.attribute( "name" ); |
| 751 | |
| 752 | m_fxChannels[num]->m_fxChain.restoreState( fxch.firstChildElement( |
| 753 | m_fxChannels[num]->m_fxChain.nodeName() ) ); |
| 754 | |
| 755 | // mixer sends |
| 756 | QDomNodeList chData = fxch.childNodes(); |
| 757 | for( unsigned int i=0; i<chData.length(); ++i ) |
| 758 | { |
| 759 | QDomElement chDataItem = chData.at(i).toElement(); |
| 760 | if( chDataItem.nodeName() == QString( "send" ) ) |
| 761 | { |
| 762 | int sendTo = chDataItem.attribute( "channel" ).toInt(); |
| 763 | allocateChannelsTo( sendTo ) ; |
| 764 | FxRoute * fxr = createChannelSend( num, sendTo, 1.0f ); |
| 765 | if( fxr ) fxr->amount()->loadSettings( chDataItem, "amount" ); |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | |
| 770 | |
| 771 | node = node.nextSibling(); |
| 772 | } |
| 773 | |
| 774 | emit dataChanged(); |
| 775 | } |
| 776 | |
| 777 | |
| 778 | void FxMixer::validateChannelName( int index, int oldIndex ) |