15#pragma message( "--- CrossFade.cpp: This is abandoned code, not included in Audacity builds")
63 <<
" to " << ( len + start ).as_long_long()
81 int numclips =
mClips.size();
84 std::vector<sampleCount> clipStart(numclips);
85 std::vector<sampleCount> clipLength(numclips);
86 std::vector<Sequence*> tmpSequence(numclips);
91 for(
const auto &tmpclip:
mClips)
93 tmpSequence[i] = tmpclip->GetSequence();
98 clipStart[i]= start - tmpclip->GetStartSample();
105 clipLength[i] = tmpclip->GetNumSamples()-clipStart[i];
107 std::cout <<
"X:" <<
" "
110 << tmpclip->GetStartSample().as_long_long()
113 if(clipStart[i] + len < clipLength[i])
115 clipLength[i] = len + clipStart[i];
118 << clipStart[i].as_long_long()
120 << clipLength[i].as_long_long()
122 << ( clipLength[i] - clipStart[i] ).as_long_long()
125 std::cout <<
"-------------\n";
131 std::cout <<
"int\n";
132 short *dest = (
short *)buffer;
133 vector<short*> shortSeq;
136 for(
int i = 0; i < numclips; i++)
138 shortSeq.push_back((
short*)tmpSequence[i]);
144 for (
int j = 0; j < (int)len; j++)
148 for(
int i = 0; i < numclips; i++)
152 if(j + clipStart[i] >= 0 &&
153 clipStart[i]+len < clipLength[i])
157 f += shortSeq[ i ][ j+ clipStart[i].as_long_long() ];
180 std::cout <<
"int24\n";
181 int *dest = (
int *)buffer;
182 vector<int *> intSeq;
186 for(
int i = 0; i < numclips; i++)
189 intSeq.push_back((
int*)tmpSequence[i]);
194 for (
int j = 0; j < (int)len; j++) {
197 for(
int i= 0; i < numclips; i++)
203 if(j + clipStart[i] >= 0 && clipStart[i] + len < clipLength[i])
207 f+= intSeq[ i ][ j + clipStart[ i ].as_long_long() ];
227 std::cout <<
"float\n";
228 float *dest = (
float *)buffer;
229 vector<float*> floatSeq;
235 for (
int j = 0; j < (int)len; j++) {
241 for(
int i = 0; i < numclips; i++)
244 cout << numclips <<
" " ;
248 if(j + clipStart[i] >= 0 &&
249 clipStart[i] + j < clipLength[i])
256 f += floatSeq[ i ][ ( j + clipStart[ i ] ).as_long_long() ];
259 cout << f <<
" "<< i <<
" "
260 << floatSeq[ i ][ j + clipStart[ i ].as_long_long() ] <<
"|";
278 cout << *dest << endl;
bool GetSamples(samplePtr buffer, sampleFormat format, sampleCount start, size_t len)
bool CrossFadeMix(samplePtr buffer, sampleFormat format, sampleCount start, size_t len)
Positions or offsets within audio files need a wide type.
long long as_long_long() const