| 7176 | } |
| 7177 | |
| 7178 | bool |
| 7179 | Node::refreshChannelSelectors() |
| 7180 | { |
| 7181 | if ( !isNodeCreated() ) { |
| 7182 | return false; |
| 7183 | } |
| 7184 | |
| 7185 | double time = getApp()->getTimeLine()->currentFrame(); |
| 7186 | // Refresh each layer selector (input and output) |
| 7187 | bool hasChanged = false; |
| 7188 | for (std::map<int, ChannelSelector>::iterator it = _imp->channelsSelectors.begin(); it != _imp->channelsSelectors.end(); ++it) { |
| 7189 | |
| 7190 | int inputNb = it->first; |
| 7191 | |
| 7192 | |
| 7193 | // The Output Layer menu has a All choice, input layers menus have a None choice. |
| 7194 | std::vector<ChoiceOption> choices; |
| 7195 | if (inputNb >= 0) { |
| 7196 | choices.push_back(ChoiceOption("None", "", "")); |
| 7197 | } |
| 7198 | |
| 7199 | |
| 7200 | std::list<ImagePlaneDesc> availableComponents; |
| 7201 | _imp->effect->getAvailableLayers(time, ViewIdx(0), inputNb, &availableComponents); |
| 7202 | |
| 7203 | for (std::list<ImagePlaneDesc>::const_iterator it2 = availableComponents.begin(); it2 != availableComponents.end(); ++it2) { |
| 7204 | ChoiceOption layerOption = it2->getPlaneOption(); |
| 7205 | choices.push_back(layerOption); |
| 7206 | } |
| 7207 | |
| 7208 | { |
| 7209 | KnobChoicePtr layerKnob = it->second.layer.lock(); |
| 7210 | |
| 7211 | bool menuChanged = layerKnob->populateChoices(choices); |
| 7212 | if (menuChanged) { |
| 7213 | hasChanged = true; |
| 7214 | if (inputNb == -1) { |
| 7215 | s_outputLayerChanged(); |
| 7216 | } |
| 7217 | } |
| 7218 | } |
| 7219 | } // for each layer selector |
| 7220 | |
| 7221 | // Refresh each mask channel selector |
| 7222 | |
| 7223 | for (std::map<int, MaskSelector>::iterator it = _imp->maskSelectors.begin(); it != _imp->maskSelectors.end(); ++it) { |
| 7224 | |
| 7225 | int inputNb = it->first; |
| 7226 | std::vector<ChoiceOption> choices; |
| 7227 | choices.push_back(ChoiceOption("None", "","")); |
| 7228 | |
| 7229 | // Get the mask input components |
| 7230 | std::list<ImagePlaneDesc> availableComponents; |
| 7231 | |
| 7232 | _imp->effect->getAvailableLayers(time, ViewIdx(0), inputNb, &availableComponents); |
| 7233 | |
| 7234 | |
| 7235 | for (std::list<ImagePlaneDesc>::const_iterator it2 = availableComponents.begin(); it2 != availableComponents.end(); ++it2) { |
no test coverage detected