! \brief Load the settings from a file * * We load the track's type and muted state and solo state, then clear out our * current TrackContentObject. * * Then we step through the QDomElement's children and load the * track-specific settings and trackContentObjects states from it * one at a time. * * \param element the QDomElement to load track settings from * \todo Load the track h
| 2120 | * \todo Load the track height. |
| 2121 | */ |
| 2122 | void Track::loadSettings( const QDomElement & element ) |
| 2123 | { |
| 2124 | if( element.attribute( "type" ).toInt() != type() ) |
| 2125 | { |
| 2126 | qWarning( "Current track-type does not match track-type of " |
| 2127 | "settings-node!\n" ); |
| 2128 | } |
| 2129 | |
| 2130 | setName( element.hasAttribute( "name" ) ? element.attribute( "name" ) : |
| 2131 | element.firstChild().toElement().attribute( "name" ) ); |
| 2132 | |
| 2133 | m_mutedModel.loadSettings( element, "muted" ); |
| 2134 | m_soloModel.loadSettings( element, "solo" ); |
| 2135 | |
| 2136 | if( m_simpleSerializingMode ) |
| 2137 | { |
| 2138 | QDomNode node = element.firstChild(); |
| 2139 | while( !node.isNull() ) |
| 2140 | { |
| 2141 | if( node.isElement() && node.nodeName() == nodeName() ) |
| 2142 | { |
| 2143 | loadTrackSpecificSettings( node.toElement() ); |
| 2144 | break; |
| 2145 | } |
| 2146 | node = node.nextSibling(); |
| 2147 | } |
| 2148 | m_simpleSerializingMode = false; |
| 2149 | return; |
| 2150 | } |
| 2151 | |
| 2152 | while( !m_trackContentObjects.empty() ) |
| 2153 | { |
| 2154 | delete m_trackContentObjects.front(); |
| 2155 | // m_trackContentObjects.erase( m_trackContentObjects.begin() ); |
| 2156 | } |
| 2157 | |
| 2158 | QDomNode node = element.firstChild(); |
| 2159 | while( !node.isNull() ) |
| 2160 | { |
| 2161 | if( node.isElement() ) |
| 2162 | { |
| 2163 | if( node.nodeName() == nodeName() ) |
| 2164 | { |
| 2165 | loadTrackSpecificSettings( node.toElement() ); |
| 2166 | } |
| 2167 | else if( node.nodeName() != "muted" |
| 2168 | && node.nodeName() != "solo" |
| 2169 | && !node.toElement().attribute( "metadata" ).toInt() ) |
| 2170 | { |
| 2171 | TrackContentObject * tco = createTCO( |
| 2172 | MidiTime( 0 ) ); |
| 2173 | tco->restoreState( node.toElement() ); |
| 2174 | saveJournallingState( false ); |
| 2175 | restoreJournallingState(); |
| 2176 | } |
| 2177 | } |
| 2178 | node = node.nextSibling(); |
| 2179 | } |
nothing calls this directly
no test coverage detected