MCPcopy Create free account
hub / github.com/LMMS/lmms / saveSettings

Method saveSettings

src/core/AutomatableModel.cpp:95–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94
95void AutomatableModel::saveSettings( QDomDocument& doc, QDomElement& element, const QString& name )
96{
97 if( isAutomated() || m_scaleType != Linear )
98 {
99 // automation needs tuple of data (name, id, value)
100 // scale type also needs an extra value
101 // => it must be appended as a node
102 QDomElement me = doc.createElement( name );
103 me.setAttribute( "id", ProjectJournal::idToSave( id() ) );
104 me.setAttribute( "value", m_value );
105 me.setAttribute( "scale_type", m_scaleType == Logarithmic ? "log" : "linear" );
106 element.appendChild( me );
107 }
108 else
109 {
110 // non automation, linear scale (default), can be saved as attribute
111 element.setAttribute( name, m_value );
112 }
113
114 if( m_controllerConnection && m_controllerConnection->getController()->type()
115 != Controller::DummyController )
116 {
117 QDomElement controllerElement;
118
119 // get "connection" element (and create it if needed)
120 QDomNode node = element.namedItem( "connection" );
121 if( node.isElement() )
122 {
123 controllerElement = node.toElement();
124 }
125 else
126 {
127 controllerElement = doc.createElement( "connection" );
128 element.appendChild( controllerElement );
129 }
130
131 QDomElement element = doc.createElement( name );
132 m_controllerConnection->saveSettings( doc, element );
133
134 controllerElement.appendChild( element );
135 }
136}
137
138
139

Callers

nothing calls this directly

Calls 3

idFunction · 0.85
getControllerMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected