@ -120,7 +120,7 @@ bool ConfigurationXmlSubHandler::startElement(const TQString&, const TQString&,
// handle alternative encoding for properties with arbitrary names
// handle alternative encoding for properties with arbitrary names
m_propertyName = atts . value ( " name " ) ;
m_propertyName = atts . value ( " name " ) ;
TQString value = atts . value ( " value " ) ;
TQString value = atts . value ( " value " ) ;
if ( value ) {
if ( ! value . isNull ( ) ) {
m_propertyType = " String " ;
m_propertyType = " String " ;
m_configuration - > set < String > ( qstrtostr ( m_propertyName ) ,
m_configuration - > set < String > ( qstrtostr ( m_propertyName ) ,
qstrtostr ( value ) ) ;
qstrtostr ( value ) ) ;
@ -433,7 +433,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
// std::cerr << "\n\n\nRosegarden file version = \"" << version << "\"\n\n\n" << std::endl;
// std::cerr << "\n\n\nRosegarden file version = \"" << version << "\"\n\n\n" << std::endl;
if ( smajor ) {
if ( ! smajor . isNull ( ) ) {
int major = smajor . toInt ( ) ;
int major = smajor . toInt ( ) ;
int minor = sminor . toInt ( ) ;
int minor = sminor . toInt ( ) ;
@ -477,17 +477,17 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
//
//
TQString thruStr = atts . value ( " thrufilter " ) ;
TQString thruStr = atts . value ( " thrufilter " ) ;
if ( thruStr )
if ( ! thruStr . isNull ( ) )
getStudio ( ) . setMIDIThruFilter ( thruStr . toInt ( ) ) ;
getStudio ( ) . setMIDIThruFilter ( thruStr . toInt ( ) ) ;
TQString recordStr = atts . value ( " recordfilter " ) ;
TQString recordStr = atts . value ( " recordfilter " ) ;
if ( recordStr )
if ( ! recordStr . isNull ( ) )
getStudio ( ) . setMIDIRecordFilter ( recordStr . toInt ( ) ) ;
getStudio ( ) . setMIDIRecordFilter ( recordStr . toInt ( ) ) ;
TQString inputStr = atts . value ( " audioinputpairs " ) ;
TQString inputStr = atts . value ( " audioinputpairs " ) ;
if ( inputStr ) {
if ( ! inputStr . isNull ( ) ) {
int inputs = inputStr . toInt ( ) ;
int inputs = inputStr . toInt ( ) ;
if ( inputs < 1 )
if ( inputs < 1 )
inputs = 1 ; // we simply don't permit no inputs
inputs = 1 ; // we simply don't permit no inputs
@ -498,14 +498,14 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString mixerStr = atts . value ( " mixerdisplayoptions " ) ;
TQString mixerStr = atts . value ( " mixerdisplayoptions " ) ;
if ( mixerStr ) {
if ( ! mixerStr . isNull ( ) ) {
unsigned int mixer = mixerStr . toUInt ( ) ;
unsigned int mixer = mixerStr . toUInt ( ) ;
getStudio ( ) . setMixerDisplayOptions ( mixer ) ;
getStudio ( ) . setMixerDisplayOptions ( mixer ) ;
}
}
TQString metronomeStr = atts . value ( " metronomedevice " ) ;
TQString metronomeStr = atts . value ( " metronomedevice " ) ;
if ( metronomeStr ) {
if ( ! metronomeStr . isNull ( ) ) {
DeviceId metronome = metronomeStr . toUInt ( ) ;
DeviceId metronome = metronomeStr . toUInt ( ) ;
getStudio ( ) . setMetronomeDevice ( metronome ) ;
getStudio ( ) . setMetronomeDevice ( metronome ) ;
}
}
@ -519,32 +519,32 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
timeT t = 0 ;
timeT t = 0 ;
TQString timeStr = atts . value ( " time " ) ;
TQString timeStr = atts . value ( " time " ) ;
if ( timeStr )
if ( ! timeStr . isNull ( ) )
t = timeStr . toInt ( ) ;
t = timeStr . toInt ( ) ;
int num = 4 ;
int num = 4 ;
TQString numStr = atts . value ( " numerator " ) ;
TQString numStr = atts . value ( " numerator " ) ;
if ( numStr )
if ( ! numStr . isNull ( ) )
num = numStr . toInt ( ) ;
num = numStr . toInt ( ) ;
int denom = 4 ;
int denom = 4 ;
TQString denomStr = atts . value ( " denominator " ) ;
TQString denomStr = atts . value ( " denominator " ) ;
if ( denomStr )
if ( ! denomStr . isNull ( ) )
denom = denomStr . toInt ( ) ;
denom = denomStr . toInt ( ) ;
bool common = false ;
bool common = false ;
TQString commonStr = atts . value ( " common " ) ;
TQString commonStr = atts . value ( " common " ) ;
if ( commonStr )
if ( ! commonStr . isNull ( ) )
common = ( commonStr = = " true " ) ;
common = ( commonStr = = " true " ) ;
bool hidden = false ;
bool hidden = false ;
TQString hiddenStr = atts . value ( " hidden " ) ;
TQString hiddenStr = atts . value ( " hidden " ) ;
if ( hiddenStr )
if ( ! hiddenStr . isNull ( ) )
hidden = ( hiddenStr = = " true " ) ;
hidden = ( hiddenStr = = " true " ) ;
bool hiddenBars = false ;
bool hiddenBars = false ;
TQString hiddenBarsStr = atts . value ( " hiddenbars " ) ;
TQString hiddenBarsStr = atts . value ( " hiddenbars " ) ;
if ( hiddenBarsStr )
if ( ! hiddenBarsStr . isNull ( ) )
hiddenBars = ( hiddenBarsStr = = " true " ) ;
hiddenBars = ( hiddenBarsStr = = " true " ) ;
getComposition ( ) . addTimeSignature
getComposition ( ) . addTimeSignature
@ -554,21 +554,21 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
timeT t = 0 ;
timeT t = 0 ;
TQString timeStr = atts . value ( " time " ) ;
TQString timeStr = atts . value ( " time " ) ;
if ( timeStr )
if ( ! timeStr . isNull ( ) )
t = timeStr . toInt ( ) ;
t = timeStr . toInt ( ) ;
tempoT tempo = Composition : : getTempoForQpm ( 120.0 ) ;
tempoT tempo = Composition : : getTempoForQpm ( 120.0 ) ;
TQString tempoStr = atts . value ( " tempo " ) ;
TQString tempoStr = atts . value ( " tempo " ) ;
TQString targetStr = atts . value ( " target " ) ;
TQString targetStr = atts . value ( " target " ) ;
TQString bphStr = atts . value ( " bph " ) ;
TQString bphStr = atts . value ( " bph " ) ;
if ( tempoStr ) {
if ( ! tempoStr . isNull ( ) ) {
tempo = tempoStr . toInt ( ) ;
tempo = tempoStr . toInt ( ) ;
} else if ( bphStr ) {
} else if ( ! bphStr . isNull ( ) ) {
tempo = Composition : : getTempoForQpm
tempo = Composition : : getTempoForQpm
( double ( bphStr . toInt ( ) ) / 60.0 ) ;
( double ( bphStr . toInt ( ) ) / 60.0 ) ;
}
}
if ( targetStr ) {
if ( ! targetStr . isNull ( ) ) {
getComposition ( ) . addTempoAtTime ( t , tempo , targetStr . toInt ( ) ) ;
getComposition ( ) . addTempoAtTime ( t , tempo , targetStr . toInt ( ) ) ;
} else {
} else {
getComposition ( ) . addTempoAtTime ( t , tempo ) ;
getComposition ( ) . addTempoAtTime ( t , tempo ) ;
@ -587,12 +587,12 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
// Get and set the record track
// Get and set the record track
//
//
TQString recordStr = atts . value ( " recordtrack " ) ;
TQString recordStr = atts . value ( " recordtrack " ) ;
if ( recordStr ) {
if ( ! recordStr . isNull ( ) ) {
getComposition ( ) . setTrackRecording ( recordStr . toInt ( ) , true ) ;
getComposition ( ) . setTrackRecording ( recordStr . toInt ( ) , true ) ;
}
}
TQString recordPlStr = atts . value ( " recordtracks " ) ;
TQString recordPlStr = atts . value ( " recordtracks " ) ;
if ( recordPlStr ) {
if ( ! recordPlStr . isNull ( ) ) {
RG_DEBUG < < " Record tracks: " < < recordPlStr < < endl ;
RG_DEBUG < < " Record tracks: " < < recordPlStr < < endl ;
TQStringList recordList = TQStringList : : split ( ' , ' , recordPlStr ) ;
TQStringList recordList = TQStringList : : split ( ' , ' , recordPlStr ) ;
for ( TQStringList : : iterator i = recordList . begin ( ) ;
for ( TQStringList : : iterator i = recordList . begin ( ) ;
@ -606,7 +606,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
//
//
int position = 0 ;
int position = 0 ;
TQString positionStr = atts . value ( " pointer " ) ;
TQString positionStr = atts . value ( " pointer " ) ;
if ( positionStr ) {
if ( ! positionStr . isNull ( ) ) {
position = positionStr . toInt ( ) ;
position = positionStr . toInt ( ) ;
}
}
@ -618,12 +618,12 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
// older defaultTempo.
// older defaultTempo.
//
//
TQString tempoStr = atts . value ( " compositionDefaultTempo " ) ;
TQString tempoStr = atts . value ( " compositionDefaultTempo " ) ;
if ( tempoStr ) {
if ( ! tempoStr . isNull ( ) ) {
tempoT tempo = tempoT ( tempoStr . toInt ( ) ) ;
tempoT tempo = tempoT ( tempoStr . toInt ( ) ) ;
getComposition ( ) . setCompositionDefaultTempo ( tempo ) ;
getComposition ( ) . setCompositionDefaultTempo ( tempo ) ;
} else {
} else {
tempoStr = atts . value ( " defaultTempo " ) ;
tempoStr = atts . value ( " defaultTempo " ) ;
if ( tempoStr ) {
if ( ! tempoStr . isNull ( ) ) {
double tempo = qstrtodouble ( tempoStr ) ;
double tempo = qstrtodouble ( tempoStr ) ;
getComposition ( ) . setCompositionDefaultTempo
getComposition ( ) . setCompositionDefaultTempo
( Composition : : getTempoForQpm ( tempo ) ) ;
( Composition : : getTempoForQpm ( tempo ) ) ;
@ -639,7 +639,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString loopStartStr = atts . value ( " loopstart " ) ;
TQString loopStartStr = atts . value ( " loopstart " ) ;
TQString loopEndStr = atts . value ( " loopend " ) ;
TQString loopEndStr = atts . value ( " loopend " ) ;
if ( loopStartStr & & loopEndStr ) {
if ( ! loopStartStr . isNull ( ) & & ! loopEndStr . isNull ( ) ) {
int loopStart = loopStartStr . toInt ( ) ;
int loopStart = loopStartStr . toInt ( ) ;
int loopEnd = loopEndStr . toInt ( ) ;
int loopEnd = loopEndStr . toInt ( ) ;
@ -649,7 +649,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString selectedTrackStr = atts . value ( " selected " ) ;
TQString selectedTrackStr = atts . value ( " selected " ) ;
if ( selectedTrackStr ) {
if ( ! selectedTrackStr . isNull ( ) ) {
TrackId selectedTrack =
TrackId selectedTrack =
( TrackId ) selectedTrackStr . toInt ( ) ;
( TrackId ) selectedTrackStr . toInt ( ) ;
@ -657,7 +657,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString soloTrackStr = atts . value ( " solo " ) ;
TQString soloTrackStr = atts . value ( " solo " ) ;
if ( soloTrackStr ) {
if ( ! soloTrackStr . isNull ( ) ) {
if ( soloTrackStr . toInt ( ) = = 1 )
if ( soloTrackStr . toInt ( ) = = 1 )
getComposition ( ) . setSolo ( true ) ;
getComposition ( ) . setSolo ( true ) ;
else
else
@ -666,7 +666,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString playMetStr = atts . value ( " playmetronome " ) ;
TQString playMetStr = atts . value ( " playmetronome " ) ;
if ( playMetStr ) {
if ( ! playMetStr . isNull ( ) ) {
if ( playMetStr . toInt ( ) )
if ( playMetStr . toInt ( ) )
getComposition ( ) . setPlayMetronome ( true ) ;
getComposition ( ) . setPlayMetronome ( true ) ;
else
else
@ -674,7 +674,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString recMetStr = atts . value ( " recordmetronome " ) ;
TQString recMetStr = atts . value ( " recordmetronome " ) ;
if ( recMetStr ) {
if ( ! recMetStr . isNull ( ) ) {
if ( recMetStr . toInt ( ) )
if ( recMetStr . toInt ( ) )
getComposition ( ) . setRecordMetronome ( true ) ;
getComposition ( ) . setRecordMetronome ( true ) ;
else
else
@ -682,23 +682,23 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString nextTriggerIdStr = atts . value ( " nexttriggerid " ) ;
TQString nextTriggerIdStr = atts . value ( " nexttriggerid " ) ;
if ( nextTriggerIdStr ) {
if ( ! nextTriggerIdStr . isNull ( ) ) {
getComposition ( ) . setNextTriggerSegmentId ( nextTriggerIdStr . toInt ( ) ) ;
getComposition ( ) . setNextTriggerSegmentId ( nextTriggerIdStr . toInt ( ) ) ;
}
}
TQString copyrightStr = atts . value ( " copyright " ) ;
TQString copyrightStr = atts . value ( " copyright " ) ;
if ( copyrightStr ) {
if ( ! copyrightStr . isNull ( ) ) {
getComposition ( ) . setCopyrightNote ( qstrtostr ( copyrightStr ) ) ;
getComposition ( ) . setCopyrightNote ( qstrtostr ( copyrightStr ) ) ;
}
}
TQString startMarkerStr = atts . value ( " startMarker " ) ;
TQString startMarkerStr = atts . value ( " startMarker " ) ;
TQString endMarkerStr = atts . value ( " endMarker " ) ;
TQString endMarkerStr = atts . value ( " endMarker " ) ;
if ( startMarkerStr ) {
if ( ! startMarkerStr . isNull ( ) ) {
getComposition ( ) . setStartMarker ( startMarkerStr . toInt ( ) ) ;
getComposition ( ) . setStartMarker ( startMarkerStr . toInt ( ) ) ;
}
}
if ( endMarkerStr ) {
if ( ! endMarkerStr . isNull ( ) ) {
getComposition ( ) . setEndMarker ( endMarkerStr . toInt ( ) ) ;
getComposition ( ) . setEndMarker ( endMarkerStr . toInt ( ) ) ;
}
}
@ -716,17 +716,17 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
bool muted = false ;
bool muted = false ;
TQString trackNbStr = atts . value ( " id " ) ;
TQString trackNbStr = atts . value ( " id " ) ;
if ( trackNbStr ) {
if ( ! trackNbStr . isNull ( ) ) {
id = trackNbStr . toInt ( ) ;
id = trackNbStr . toInt ( ) ;
}
}
TQString labelStr = atts . value ( " label " ) ;
TQString labelStr = atts . value ( " label " ) ;
if ( labelStr ) {
if ( ! labelStr . isNull ( ) ) {
label = qstrtostr ( labelStr ) ;
label = qstrtostr ( labelStr ) ;
}
}
TQString mutedStr = atts . value ( " muted " ) ;
TQString mutedStr = atts . value ( " muted " ) ;
if ( mutedStr ) {
if ( ! mutedStr . isNull ( ) ) {
if ( mutedStr = = " true " )
if ( mutedStr = = " true " )
muted = true ;
muted = true ;
else
else
@ -734,12 +734,12 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString positionStr = atts . value ( " position " ) ;
TQString positionStr = atts . value ( " position " ) ;
if ( positionStr ) {
if ( ! positionStr . isNull ( ) ) {
position = positionStr . toInt ( ) ;
position = positionStr . toInt ( ) ;
}
}
TQString instrumentStr = atts . value ( " instrument " ) ;
TQString instrumentStr = atts . value ( " instrument " ) ;
if ( instrumentStr ) {
if ( ! instrumentStr . isNull ( ) ) {
instrument = instrumentStr . toInt ( ) ;
instrument = instrumentStr . toInt ( ) ;
}
}
@ -754,42 +754,42 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
// here
// here
TQString presetLabelStr = atts . value ( " defaultLabel " ) ;
TQString presetLabelStr = atts . value ( " defaultLabel " ) ;
if ( labelStr ) {
if ( ! labelStr . isNull ( ) ) {
track - > setPresetLabel ( presetLabelStr . ascii ( ) ) ;
track - > setPresetLabel ( presetLabelStr . ascii ( ) ) ;
}
}
TQString clefStr = atts . value ( " defaultClef " ) ;
TQString clefStr = atts . value ( " defaultClef " ) ;
if ( clefStr ) {
if ( ! clefStr . isNull ( ) ) {
track - > setClef ( clefStr . toInt ( ) ) ;
track - > setClef ( clefStr . toInt ( ) ) ;
}
}
TQString transposeStr = atts . value ( " defaultTranspose " ) ;
TQString transposeStr = atts . value ( " defaultTranspose " ) ;
if ( transposeStr ) {
if ( ! transposeStr . isNull ( ) ) {
track - > setTranspose ( transposeStr . toInt ( ) ) ;
track - > setTranspose ( transposeStr . toInt ( ) ) ;
}
}
TQString colorStr = atts . value ( " defaultColour " ) ;
TQString colorStr = atts . value ( " defaultColour " ) ;
if ( colorStr ) {
if ( ! colorStr . isNull ( ) ) {
track - > setColor ( colorStr . toInt ( ) ) ;
track - > setColor ( colorStr . toInt ( ) ) ;
}
}
TQString highplayStr = atts . value ( " defaultHighestPlayable " ) ;
TQString highplayStr = atts . value ( " defaultHighestPlayable " ) ;
if ( highplayStr ) {
if ( ! highplayStr . isNull ( ) ) {
track - > setHighestPlayable ( highplayStr . toInt ( ) ) ;
track - > setHighestPlayable ( highplayStr . toInt ( ) ) ;
}
}
TQString lowplayStr = atts . value ( " defaultLowestPlayable " ) ;
TQString lowplayStr = atts . value ( " defaultLowestPlayable " ) ;
if ( lowplayStr ) {
if ( ! lowplayStr . isNull ( ) ) {
track - > setLowestPlayable ( lowplayStr . toInt ( ) ) ;
track - > setLowestPlayable ( lowplayStr . toInt ( ) ) ;
}
}
TQString staffSizeStr = atts . value ( " staffSize " ) ;
TQString staffSizeStr = atts . value ( " staffSize " ) ;
if ( staffSizeStr ) {
if ( ! staffSizeStr . isNull ( ) ) {
track - > setStaffSize ( staffSizeStr . toInt ( ) ) ;
track - > setStaffSize ( staffSizeStr . toInt ( ) ) ;
}
}
TQString staffBracketStr = atts . value ( " staffBracket " ) ;
TQString staffBracketStr = atts . value ( " staffBracket " ) ;
if ( staffBracketStr ) {
if ( ! staffBracketStr . isNull ( ) ) {
track - > setStaffBracket ( staffBracketStr . toInt ( ) ) ;
track - > setStaffBracket ( staffBracketStr . toInt ( ) ) ;
}
}
@ -809,17 +809,17 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
int track = - 1 , startTime = 0 ;
int track = - 1 , startTime = 0 ;
unsigned int colourindex = 0 ;
unsigned int colourindex = 0 ;
TQString trackNbStr = atts . value ( " track " ) ;
TQString trackNbStr = atts . value ( " track " ) ;
if ( trackNbStr ) {
if ( ! trackNbStr . isNull ( ) ) {
track = trackNbStr . toInt ( ) ;
track = trackNbStr . toInt ( ) ;
}
}
TQString startIdxStr = atts . value ( " start " ) ;
TQString startIdxStr = atts . value ( " start " ) ;
if ( startIdxStr ) {
if ( ! startIdxStr . isNull ( ) ) {
startTime = startIdxStr . toInt ( ) ;
startTime = startIdxStr . toInt ( ) ;
}
}
TQString segmentType = ( atts . value ( " type " ) ) . lower ( ) ;
TQString segmentType = ( atts . value ( " type " ) ) . lower ( ) ;
if ( segmentType ) {
if ( ! segmentType . isNull ( ) ) {
if ( segmentType = = " audio " ) {
if ( segmentType = = " audio " ) {
int audioFileId = atts . value ( " file " ) . toInt ( ) ;
int audioFileId = atts . value ( " file " ) . toInt ( ) ;
@ -854,7 +854,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString delayStr = atts . value ( " delay " ) ;
TQString delayStr = atts . value ( " delay " ) ;
if ( delayStr ) {
if ( ! delayStr . isNull ( ) ) {
RG_DEBUG < < " Delay string is \" " < < delayStr < < " \" " < < endl ;
RG_DEBUG < < " Delay string is \" " < < delayStr < < " \" " < < endl ;
long delay = delayStr . toLong ( ) ;
long delay = delayStr . toLong ( ) ;
RG_DEBUG < < " Delay is " < < delay < < endl ;
RG_DEBUG < < " Delay is " < < delay < < endl ;
@ -864,8 +864,8 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString rtDelaynSec = atts . value ( " rtdelaynsec " ) ;
TQString rtDelaynSec = atts . value ( " rtdelaynsec " ) ;
TQString rtDelayuSec = atts . value ( " rtdelayusec " ) ;
TQString rtDelayuSec = atts . value ( " rtdelayusec " ) ;
TQString rtDelaySec = atts . value ( " rtdelaysec " ) ;
TQString rtDelaySec = atts . value ( " rtdelaysec " ) ;
if ( rtDelaySec & & ( rtDelaynSec | | rtDelayuSec ) ) {
if ( ! rtDelaySec . isNull ( ) & & ( ! rtDelaynSec . isNull ( ) | | ! rtDelayuSec . isNull ( ) ) ) {
if ( rtDelaynSec ) {
if ( ! rtDelaynSec . isNull ( ) ) {
m_currentSegment - > setRealTimeDelay
m_currentSegment - > setRealTimeDelay
( RealTime ( rtDelaySec . toInt ( ) ,
( RealTime ( rtDelaySec . toInt ( ) ,
rtDelaynSec . toInt ( ) ) ) ;
rtDelaynSec . toInt ( ) ) ) ;
@ -877,31 +877,31 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString transposeStr = atts . value ( " transpose " ) ;
TQString transposeStr = atts . value ( " transpose " ) ;
if ( transposeStr )
if ( ! transposeStr . isNull ( ) )
m_currentSegment - > setTranspose ( transposeStr . toInt ( ) ) ;
m_currentSegment - > setTranspose ( transposeStr . toInt ( ) ) ;
// fill in the label
// fill in the label
TQString labelStr = atts . value ( " label " ) ;
TQString labelStr = atts . value ( " label " ) ;
if ( labelStr )
if ( ! labelStr . isNull ( ) )
m_currentSegment - > setLabel ( qstrtostr ( labelStr ) ) ;
m_currentSegment - > setLabel ( qstrtostr ( labelStr ) ) ;
m_currentSegment - > setTrack ( track ) ;
m_currentSegment - > setTrack ( track ) ;
//m_currentSegment->setStartTime(startTime);
//m_currentSegment->setStartTime(startTime);
TQString colourIndStr = atts . value ( " colourindex " ) ;
TQString colourIndStr = atts . value ( " colourindex " ) ;
if ( colourIndStr ) {
if ( ! colourIndStr . isNull ( ) ) {
colourindex = colourIndStr . toInt ( ) ;
colourindex = colourIndStr . toInt ( ) ;
}
}
m_currentSegment - > setColourIndex ( colourindex ) ;
m_currentSegment - > setColourIndex ( colourindex ) ;
TQString snapGridSizeStr = atts . value ( " snapgridsize " ) ;
TQString snapGridSizeStr = atts . value ( " snapgridsize " ) ;
if ( snapGridSizeStr ) {
if ( ! snapGridSizeStr . isNull ( ) ) {
m_currentSegment - > setSnapGridSize ( snapGridSizeStr . toInt ( ) ) ;
m_currentSegment - > setSnapGridSize ( snapGridSizeStr . toInt ( ) ) ;
}
}
TQString viewFeaturesStr = atts . value ( " viewfeatures " ) ;
TQString viewFeaturesStr = atts . value ( " viewfeatures " ) ;
if ( viewFeaturesStr ) {
if ( ! viewFeaturesStr . isNull ( ) ) {
m_currentSegment - > setViewFeatures ( viewFeaturesStr . toInt ( ) ) ;
m_currentSegment - > setViewFeatures ( viewFeaturesStr . toInt ( ) ) ;
}
}
@ -913,21 +913,21 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
TQString triggerRetuneStr = atts . value ( " triggerretune " ) ;
TQString triggerRetuneStr = atts . value ( " triggerretune " ) ;
TQString triggerAdjustTimeStr = atts . value ( " triggeradjusttimes " ) ;
TQString triggerAdjustTimeStr = atts . value ( " triggeradjusttimes " ) ;
if ( triggerIdStr ) {
if ( ! triggerIdStr . isNull ( ) ) {
int pitch = - 1 ;
int pitch = - 1 ;
if ( triggerPitchStr )
if ( ! triggerPitchStr . isNull ( ) )
pitch = triggerPitchStr . toInt ( ) ;
pitch = triggerPitchStr . toInt ( ) ;
int velocity = - 1 ;
int velocity = - 1 ;
if ( triggerVelocityStr )
if ( ! triggerVelocityStr . isNull ( ) )
velocity = triggerVelocityStr . toInt ( ) ;
velocity = triggerVelocityStr . toInt ( ) ;
TriggerSegmentRec * rec =
TriggerSegmentRec * rec =
getComposition ( ) . addTriggerSegment ( m_currentSegment ,
getComposition ( ) . addTriggerSegment ( m_currentSegment ,
triggerIdStr . toInt ( ) ,
triggerIdStr . toInt ( ) ,
pitch , velocity ) ;
pitch , velocity ) ;
if ( rec ) {
if ( rec ) {
if ( triggerRetuneStr )
if ( ! triggerRetuneStr . isNull ( ) )
rec - > setDefaultRetune ( triggerRetuneStr . lower ( ) = = " true " ) ;
rec - > setDefaultRetune ( triggerRetuneStr . lower ( ) = = " true " ) ;
if ( triggerAdjustTimeStr )
if ( ! triggerAdjustTimeStr . isNull ( ) )
rec - > setDefaultTimeAdjust ( qstrtostr ( triggerAdjustTimeStr ) ) ;
rec - > setDefaultTimeAdjust ( qstrtostr ( triggerAdjustTimeStr ) ) ;
}
}
m_currentSegment - > setStartTimeDataMember ( startTime ) ;
m_currentSegment - > setStartTimeDataMember ( startTime ) ;
@ -937,7 +937,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
}
}
TQString endMarkerStr = atts . value ( " endmarker " ) ;
TQString endMarkerStr = atts . value ( " endmarker " ) ;
if ( endMarkerStr ) {
if ( ! endMarkerStr . isNull ( ) ) {
delete m_segmentEndMarkerTime ;
delete m_segmentEndMarkerTime ;
m_segmentEndMarkerTime = new timeT ( endMarkerStr . toInt ( ) ) ;
m_segmentEndMarkerTime = new timeT ( endMarkerStr . toInt ( ) ) ;
}
}
@ -1246,10 +1246,10 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
skipToNextPlayDevice ( ) ;
skipToNextPlayDevice ( ) ;
if ( m_device ) {
if ( m_device ) {
if ( nameStr & & nameStr ! = " " ) {
if ( ! nameStr . isNull ( ) & & nameStr ! = " " ) {
m_device - > setName ( qstrtostr ( nameStr ) ) ;
m_device - > setName ( qstrtostr ( nameStr ) ) ;
}
}
} else if ( nameStr & & nameStr ! = " " ) {
} else if ( ! nameStr . isNull ( ) & & nameStr ! = " " ) {
addMIDIDevice ( nameStr , m_createDevices ) ; // also sets m_device
addMIDIDevice ( nameStr , m_createDevices ) ; // also sets m_device
}
}
}
}
@ -1366,7 +1366,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
m_lsb ) ,
m_lsb ) ,
pc ,
pc ,
qstrtostr ( nameStr ) ,
qstrtostr ( nameStr ) ,
keyMappingStr ? qstrtostr ( keyMappingStr ) : " " ) ;
( ! keyMappingStr . isNull ( ) ) ? qstrtostr ( keyMappingStr ) : " " ) ;
if ( m_device - > getType ( ) = = Device : : Midi ) {
if ( m_device - > getType ( ) = = Device : : Midi ) {
// Insert the program
// Insert the program
@ -1412,7 +1412,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
if ( m_keyMapping ) {
if ( m_keyMapping ) {
TQString numStr = atts . value ( " number " ) ;
TQString numStr = atts . value ( " number " ) ;
TQString namStr = atts . value ( " name " ) ;
TQString namStr = atts . value ( " name " ) ;
if ( numStr & & namStr ) {
if ( ! numStr . isNull ( ) & & ! namStr . isNull ( ) ) {
m_keyNameMap [ numStr . toInt ( ) ] = qstrtostr ( namStr ) ;
m_keyNameMap [ numStr . toInt ( ) ] = qstrtostr ( namStr ) ;
}
}
}
}
@ -1702,7 +1702,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
std : : string program = " " ;
std : : string program = " " ;
TQString progStr = atts . value ( " program " ) ;
TQString progStr = atts . value ( " program " ) ;
if ( progStr ) {
if ( ! progStr . isNull ( ) ) {
program = qstrtostr ( progStr ) ;
program = qstrtostr ( progStr ) ;
}
}
@ -1715,8 +1715,8 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
AudioPlugin * plugin = 0 ;
AudioPlugin * plugin = 0 ;
AudioPluginManager * apm = getAudioPluginManager ( ) ;
AudioPluginManager * apm = getAudioPluginManager ( ) ;
if ( ! identifier ) {
if ( identifier . isNull ( ) ) {
if ( atts . value ( " id " ) ) {
if ( ! ( atts . value ( " id " ) ) . isNull ( ) ) {
unsigned long id = atts . value ( " id " ) . toULong ( ) ;
unsigned long id = atts . value ( " id " ) . toULong ( ) ;
if ( apm )
if ( apm )
plugin = apm - > getPluginByUniqueId ( id ) ;
plugin = apm - > getPluginByUniqueId ( id ) ;
@ -1750,10 +1750,10 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
// we shouldn't be halting import of the RG file just because
// we shouldn't be halting import of the RG file just because
// we can't match a plugin
// we can't match a plugin
//
//
if ( identifier ) {
if ( ! identifier . isNull ( ) ) {
RG_DEBUG < < " WARNING: RoseXmlHandler: plugin " < < identifier < < " not found " < < endl ;
RG_DEBUG < < " WARNING: RoseXmlHandler: plugin " < < identifier < < " not found " < < endl ;
m_pluginsNotFound . insert ( identifier ) ;
m_pluginsNotFound . insert ( identifier ) ;
} else if ( atts . value ( " id " ) ) {
} else if ( ! ( atts . value ( " id " ) ) . isNull ( ) ) {
RG_DEBUG < < " WARNING: RoseXmlHandler: plugin uid " < < atts . value ( " id " ) < < " not found " < < endl ;
RG_DEBUG < < " WARNING: RoseXmlHandler: plugin uid " < < atts . value ( " id " ) < < " not found " < < endl ;
} else {
} else {
m_errorString = " No plugin identifier or uid specified " ;
m_errorString = " No plugin identifier or uid specified " ;
@ -1764,7 +1764,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
if ( lcName = = " synth " ) {
if ( lcName = = " synth " ) {
TQString identifier = atts . value ( " identifier " ) ;
TQString identifier = atts . value ( " identifier " ) ;
if ( identifier ) {
if ( ! identifier . isNull ( ) ) {
RG_DEBUG < < " WARNING: RoseXmlHandler: no instrument for plugin " < < identifier < < endl ;
RG_DEBUG < < " WARNING: RoseXmlHandler: no instrument for plugin " < < identifier < < endl ;
m_pluginsNotFound . insert ( identifier ) ;
m_pluginsNotFound . insert ( identifier ) ;
}
}
@ -1823,19 +1823,19 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
MidiMetronome metronome ( instrument ) ;
MidiMetronome metronome ( instrument ) ;
if ( atts . value ( " barpitch " ) )
if ( ! ( atts . value ( " barpitch " ) ) . isNull ( ) )
metronome . setBarPitch ( atts . value ( " barpitch " ) . toInt ( ) ) ;
metronome . setBarPitch ( atts . value ( " barpitch " ) . toInt ( ) ) ;
if ( atts . value ( " beatpitch " ) )
if ( ! ( atts . value ( " beatpitch " ) ) . isNull ( ) )
metronome . setBeatPitch ( atts . value ( " beatpitch " ) . toInt ( ) ) ;
metronome . setBeatPitch ( atts . value ( " beatpitch " ) . toInt ( ) ) ;
if ( atts . value ( " subbeatpitch " ) )
if ( ! ( atts . value ( " subbeatpitch " ) ) . isNull ( ) )
metronome . setSubBeatPitch ( atts . value ( " subbeatpitch " ) . toInt ( ) ) ;
metronome . setSubBeatPitch ( atts . value ( " subbeatpitch " ) . toInt ( ) ) ;
if ( atts . value ( " depth " ) )
if ( ! ( atts . value ( " depth " ) ) . isNull ( ) )
metronome . setDepth ( atts . value ( " depth " ) . toInt ( ) ) ;
metronome . setDepth ( atts . value ( " depth " ) . toInt ( ) ) ;
if ( atts . value ( " barvelocity " ) )
if ( ! ( atts . value ( " barvelocity " ) ) . isNull ( ) )
metronome . setBarVelocity ( atts . value ( " barvelocity " ) . toInt ( ) ) ;
metronome . setBarVelocity ( atts . value ( " barvelocity " ) . toInt ( ) ) ;
if ( atts . value ( " beatvelocity " ) )
if ( ! ( atts . value ( " beatvelocity " ) ) . isNull ( ) )
metronome . setBeatVelocity ( atts . value ( " beatvelocity " ) . toInt ( ) ) ;
metronome . setBeatVelocity ( atts . value ( " beatvelocity " ) . toInt ( ) ) ;
if ( atts . value ( " subbeatvelocity " ) )
if ( ! ( atts . value ( " subbeatvelocity " ) ) . isNull ( ) )
metronome . setSubBeatVelocity ( atts . value ( " subbeatvelocity " ) . toInt ( ) ) ;
metronome . setSubBeatVelocity ( atts . value ( " subbeatvelocity " ) . toInt ( ) ) ;
dynamic_cast < MidiDevice * > ( m_device ) - >
dynamic_cast < MidiDevice * > ( m_device ) - >
@ -1964,7 +1964,7 @@ RoseXmlHandler::startElement(const TQString& namespaceURI,
int channel = atts . value ( " channel " ) . toInt ( ) ;
int channel = atts . value ( " channel " ) . toInt ( ) ;
TQString type = atts . value ( " type " ) ;
TQString type = atts . value ( " type " ) ;
if ( type ) {
if ( ! type . isNull ( ) ) {
if ( type . lower ( ) = = " buss " ) {
if ( type . lower ( ) = = " buss " ) {
if ( m_instrument )
if ( m_instrument )
m_instrument - > setAudioInputToBuss ( value , channel ) ;
m_instrument - > setAudioInputToBuss ( value , channel ) ;
@ -2359,7 +2359,7 @@ RoseXmlHandler::setMIDIDeviceName(TQString name)
arg < < ( unsigned int ) md - > getId ( ) ;
arg < < ( unsigned int ) md - > getId ( ) ;
arg < < name ;
arg < < name ;
std : : cerr < < " Renaming device " < < md - > getId ( ) < < " to " < < name < < std : : endl ;
std : : cerr < < " Renaming device " < < md - > getId ( ) < < " to " < < name . ascii ( ) < < std : : endl ;
rgapp - > sequencerSend ( " renameDevice(unsigned int, TQString) " ,
rgapp - > sequencerSend ( " renameDevice(unsigned int, TQString) " ,
data ) ;
data ) ;