! \brief Save this track's settings to file * * We save the track type and its muted state and solo state, then append the track- * specific settings. Then we iterate through the trackContentObjects * and save all their states in turn. * * \param doc The QDomDocument to use to save * \param element The The QDomElement to save into * \todo Does this accurately describe the parameters
| 2069 | * \todo Save the track height |
| 2070 | */ |
| 2071 | void Track::saveSettings( QDomDocument & doc, QDomElement & element ) |
| 2072 | { |
| 2073 | if( !m_simpleSerializingMode ) |
| 2074 | { |
| 2075 | element.setTagName( "track" ); |
| 2076 | } |
| 2077 | element.setAttribute( "type", type() ); |
| 2078 | element.setAttribute( "name", name() ); |
| 2079 | m_mutedModel.saveSettings( doc, element, "muted" ); |
| 2080 | m_soloModel.saveSettings( doc, element, "solo" ); |
| 2081 | |
| 2082 | if( m_height >= MINIMAL_TRACK_HEIGHT ) |
| 2083 | { |
| 2084 | element.setAttribute( "height", m_height ); |
| 2085 | } |
| 2086 | |
| 2087 | QDomElement tsDe = doc.createElement( nodeName() ); |
| 2088 | // let actual track (InstrumentTrack, bbTrack, sampleTrack etc.) save |
| 2089 | // its settings |
| 2090 | element.appendChild( tsDe ); |
| 2091 | saveTrackSpecificSettings( doc, tsDe ); |
| 2092 | |
| 2093 | if( m_simpleSerializingMode ) |
| 2094 | { |
| 2095 | m_simpleSerializingMode = false; |
| 2096 | return; |
| 2097 | } |
| 2098 | |
| 2099 | // now save settings of all TCO's |
| 2100 | for( tcoVector::const_iterator it = m_trackContentObjects.begin(); |
| 2101 | it != m_trackContentObjects.end(); ++it ) |
| 2102 | { |
| 2103 | ( *it )->saveState( doc, element ); |
| 2104 | } |
| 2105 | } |
| 2106 | |
| 2107 | |
| 2108 |