~ubuntu-branches/ubuntu/hardy/lmms/hardy

« back to all changes in this revision

Viewing changes to src/midi/midi_mapper.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ragwitz
  • Date: 2005-12-22 16:22:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051222162250-key3p7x0212jy6dn
Tags: 0.1.2-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * midi_mapper.cpp - MIDI-mapper for any midiDevice
3
3
 *
4
 
 * Linux MultiMedia Studio
5
 
 * Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
 
4
 * Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
 
5
 * 
 
6
 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
6
7
 *
7
8
 * This program is free software; you can redistribute it and/or
8
9
 * modify it under the terms of the GNU General Public
73
74
                        continue;
74
75
                }
75
76
                QString line( buf );
 
77
#if QT_VERSION >= 0x030100
76
78
                line.replace( '\n', "" );
 
79
#else
 
80
                if( line.contains( '\n' ) )
 
81
                {
 
82
                        line = line.left( line.length() - 1 );
 
83
                }
 
84
#endif
77
85
                if( line.left( 6 ) == "DEFINE" )
78
86
                {
79
87
                        if( line.section( ' ', 1, 1 ) == "PATCHMAP" )
117
125
                        continue;
118
126
                }
119
127
                QString line( buf );
 
128
#if QT_VERSION >= 0x030100
120
129
                line.replace( '\n', "" );
 
130
#else
 
131
                if( line.contains( '\n' ) )
 
132
                {
 
133
                        line = line.left( line.length() - 1 );
 
134
                }
 
135
#endif
121
136
                if( line.left( 3 ) == "END" )
122
137
                {
123
138
                        return;
124
139
                }
125
 
                if( QString( line ).replace( ' ', "" )[0] == '#' )
 
140
                if( line[0] == '#' )
126
141
                {
127
142
                        continue;
128
143
                }
129
144
                m_patchMap[prog_idx].first = line.section( '=', 1, 1 ).toInt();
130
 
                m_patchMap[prog_idx].second = line.section( '=', 0, 0 ).
131
 
                                                        replace( ' ', "" );
 
145
                m_patchMap[prog_idx].second = line.section( '=', 0, 0 )
 
146
#if QT_VERSION >= 0x030100
 
147
                                                        .replace( ' ', "" )
 
148
#endif
 
149
                                                ;
132
150
                ++prog_idx;
133
151
        }
134
152
}
148
166
                        continue;
149
167
                }
150
168
                QString line( buf );
 
169
#if QT_VERSION >= 0x030100
151
170
                line.replace( '\n', "" );
 
171
#else
 
172
                if( line.contains( '\n' ) )
 
173
                {
 
174
                        line = line.left( line.length() - 1 );
 
175
                }
 
176
#endif
152
177
                if( line.left( 3 ) == "END" )
153
178
                {
154
179
                        return;
155
180
                }
156
 
                if( QString( line ).replace( ' ', "" )[0] == '#' )
 
181
                if( line[0] == '#' )
157
182
                {
158
183
                        continue;
159
184
                }
164
189
 
165
190
                        m_drumsetKeyMap[key].second = line.mid( 4 ).
166
191
                                                        section( '=', 0, 0 ).
167
 
                                                        section( ' ', 1, 1 ).
168
 
                                                        replace( ' ', "" );
 
192
                                                        section( ' ', 1, 1 )
 
193
#if QT_VERSION >= 0x030100
 
194
                                                        .replace( ' ', "" )
 
195
#endif
 
196
                                                        ;
169
197
                }
170
198
                ++key;
171
199
        }
185
213
                        continue;
186
214
                }
187
215
                QString line( buf );
 
216
#if QT_VERSION >= 0x030100
188
217
                line.replace( '\n', "" );
 
218
#else
 
219
                if( line.contains( '\n' ) )
 
220
                {
 
221
                        line = line.left( line.length() - 1 );
 
222
                }
 
223
#endif
189
224
                if( line.left( 3 ) == "END" )
190
225
                {
191
226
                        return;
192
227
                }
193
 
                if( QString( line ).replace( ' ', "" )[0] == '#' )
 
228
                if( line[0] == '#' )
194
229
                {
195
230
                        continue;
196
231
                }