Skip to content
Snippets Groups Projects
Commit c933cefc authored by jsiegle's avatar jsiegle
Browse files

Add methods for saving editor state

parent 9c947cd0
No related branches found
No related tags found
No related merge requests found
......@@ -489,6 +489,20 @@ void GenericEditor::setChannelSelectionState(int chan, bool p, bool r, bool a)
channelSelector->setAudioStatus(chan, a);
}
void GenericEditor::saveEditorParameters(XmlElement* xml)
{
xml->setAttribute("Attribute", "WHAT");
}
void GenericEditor::loadEditorParameters(XmlElement* xml)
{
//xml->setAttribute("Attribute", "WHAT");
}
/////////////////////// BUTTONS ///////////////////////////////
......
......@@ -231,6 +231,12 @@ public:
/** Sets param/audio/record selection state for a given channel */
void setChannelSelectionState(int chan, bool p, bool r, bool a);
/** Writes editor state to xml */
virtual void saveEditorParameters(XmlElement* xml);
/** Writes editor state to xml */
virtual void loadEditorParameters(XmlElement* xml);
protected:
/** A pointer to the button that opens the drawer for the ChannelSelector. */
......
......@@ -251,3 +251,16 @@ void VisualizerEditor::buttonEvent(Button* button)
}
void VisualizerEditor::saveEditorParameters(XmlElement* xml)
{
xml->setAttribute("Attribute", "VISUALIZER");
}
void VisualizerEditor::loadEditorParameters(XmlElement* xml)
{
//xml->setAttribute("Attribute", "VISUALIZER");
}
\ No newline at end of file
......@@ -80,6 +80,9 @@ public:
void updateVisualizer();
void saveEditorParameters(XmlElement* xml);
void loadEditorParameters(XmlElement* xml);
ScopedPointer<DataWindow> dataWindow;
ScopedPointer<Visualizer> canvas;
......
......@@ -534,9 +534,11 @@ void GenericProcessor::saveParametersToChannelsXml(juce::XmlElement* channelPare
void GenericProcessor::saveToXml(juce::XmlElement* parentElement)
{
std::cout <<"Creating Channels" << std::endl;
std::cout <<"Creating channel xml elements" << std::endl;
String channelName;
XmlElement* channelChildNode;
XmlElement* editorChildNode;
int numChannels = channels.size();
//I'm unsure whether or not the name or XML elements should include whether they're normal or event channels–it probably depends on loading implementation
......@@ -548,17 +550,19 @@ void GenericProcessor::saveToXml(juce::XmlElement* parentElement)
saveParametersToChannelsXml(channelChildNode, i);
}
int numEventChannels = eventChannels.size();
// int numEventChannels = eventChannels.size();
for (int i = 1; i <= numEventChannels; i++)
{
// for (int i = 1; i <= numEventChannels; i++)
// {
channelName=/**String("EventCh:")+*/String(i);
channelChildNode = parentElement->createNewChildElement("EVENTCHANNEL");
channelChildNode->setAttribute("name", channelName);
saveParametersToChannelsXml(channelChildNode, i);
}
// channelName=/**String("EventCh:")+*/String(i);
// channelChildNode = parentElement->createNewChildElement("EVENTCHANNEL");
// channelChildNode->setAttribute("name", channelName);
// saveParametersToChannelsXml(channelChildNode, i);
// }
editorChildNode = parentElement->createNewChildElement("EDITOR");
getEditor()->saveEditorParameters(editorChildNode);
}
......@@ -593,6 +597,9 @@ void GenericProcessor::loadFromXml()
subNode->getBoolAttribute("audio"));
}
}
} else if (xmlNode->hasTagName("EDITOR"))
{
getEditor()->loadEditorParameters(xmlNode);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment