本文整理汇总了C++中Array::GetNth方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::GetNth方法的具体用法?C++ Array::GetNth怎么用?C++ Array::GetNth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Array
的用法示例。
在下文中一共展示了Array::GetNth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
BonkEnc::InputFilter *BonkEnc::Utilities::CreateInputFilter(const String &iFile, Track *trackInfo)
{
Array<String> extensions;
Array<Int> indexes;
String file = iFile.ToLower();
for (Int i = 0; i < DLLInterfaces::winamp_in_plugins.Length(); i++)
{
Int n = 1;
Int k = 0;
String extension;
for (Int j = 0; true; j++)
{
if (!(n & 1))
{
if (DLLInterfaces::winamp_in_modules.GetNth(i)->FileExtensions[j] == 0) n++;
}
else
{
extension[k++] = DLLInterfaces::winamp_in_modules.GetNth(i)->FileExtensions[j];
if (DLLInterfaces::winamp_in_modules.GetNth(i)->FileExtensions[j] == 0)
{
String extension2 = extension;
Int o = 0;
for (Int m = 0; m <= extension2.Length(); m++)
{
if (extension2[m] == ';' || extension2[m] == 0)
{
extension[m - o] = 0;
extensions.Add(extension);
indexes.Add(i);
o = m + 1;
}
else
{
extension[m - o] = tolower(extension2[m]);
}
}
k = 0;
n++;
extension = "";
}
}
if (DLLInterfaces::winamp_in_modules.GetNth(i)->FileExtensions[j] == 0 && DLLInterfaces::winamp_in_modules.GetNth(i)->FileExtensions[j + 1] == 0) break;
}
}
Int found = -1;
for (Int j = 0; j < extensions.Length(); j++)
{
if (file.EndsWith(extensions.GetNth(j)))
{
found = j;
break;
}
}
InputFilter *filter_in = NIL;
if ((file.StartsWith("/cda") || file.EndsWith(".cda")) && BonkEnc::currentConfig->enable_cdrip && BonkEnc::currentConfig->cdrip_numdrives >= 1)
{
filter_in = new FilterInCDRip(BonkEnc::currentConfig, trackInfo);
}
else if ((file.EndsWith(".mp1") || file.EndsWith(".mp2") || file.EndsWith(".mp3")) && BonkEnc::currentConfig->enable_mad)
{
filter_in = new FilterInMAD(BonkEnc::currentConfig, trackInfo);
}
else if ((file.EndsWith(".mp4") || file.EndsWith(".m4a") || file.EndsWith(".m4b")) && BonkEnc::currentConfig->enable_mp4 && BonkEnc::currentConfig->enable_faad2)
{
filter_in = new FilterInMP4(BonkEnc::currentConfig, trackInfo);
}
else if (file.EndsWith(".ogg") && BonkEnc::currentConfig->enable_vorbis)
{
filter_in = new FilterInVORBIS(BonkEnc::currentConfig, trackInfo);
}
else if (file.EndsWith(".aac") && BonkEnc::currentConfig->enable_faad2)
{
filter_in = new FilterInFAAD2(BonkEnc::currentConfig, trackInfo);
}
else if (file.EndsWith(".bonk") && BonkEnc::currentConfig->enable_bonk)
{
filter_in = new FilterInBONK(BonkEnc::currentConfig, trackInfo);
}
else if (file.EndsWith(".flac") && BonkEnc::currentConfig->enable_flac)
{
filter_in = new FilterInFLAC(BonkEnc::currentConfig, trackInfo);
}
else if (file.EndsWith(".wma") && BonkEnc::currentConfig->enable_wma)
{
filter_in = new FilterInWMA(BonkEnc::currentConfig, trackInfo);
//.........这里部分代码省略.........
示例2: if
//.........这里部分代码省略.........
{
ex_ID3Field_SetINT(ex_ID3Frame_GetField(comment, ID3FN_TEXTENC), encoding);
ex_ID3Field_SetEncoding(ex_ID3Frame_GetField(comment, ID3FN_TEXT), encoding);
if (encoding == ID3TE_UTF16) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(comment, ID3FN_TEXT), (unicode_t *) String(leBOM).Append(format->comment).ConvertTo("UTF-16LE"));
else if (encoding == ID3TE_UTF16BE) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(comment, ID3FN_TEXT), (unicode_t *) format->comment.ConvertTo("UTF-16BE"));
else ex_ID3Field_SetASCII(ex_ID3Frame_GetField(comment, ID3FN_TEXT), format->comment);
ex_ID3Tag_AddFrame(tag, comment);
}
else if (currentConfig->default_comment != NIL)
{
ex_ID3Field_SetINT(ex_ID3Frame_GetField(comment, ID3FN_TEXTENC), encoding);
ex_ID3Field_SetEncoding(ex_ID3Frame_GetField(comment, ID3FN_TEXT), encoding);
if (encoding == ID3TE_UTF16) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(comment, ID3FN_TEXT), (unicode_t *) String(leBOM).Append(currentConfig->default_comment).ConvertTo("UTF-16LE"));
else if (encoding == ID3TE_UTF16BE) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(comment, ID3FN_TEXT), (unicode_t *) currentConfig->default_comment.ConvertTo("UTF-16BE"));
else ex_ID3Field_SetASCII(ex_ID3Frame_GetField(comment, ID3FN_TEXT), currentConfig->default_comment);
ex_ID3Tag_AddFrame(tag, comment);
}
ID3Frame *label = ex_ID3Frame_NewID(ID3FID_PUBLISHER);
if (format->label != NIL)
{
ex_ID3Field_SetINT(ex_ID3Frame_GetField(label, ID3FN_TEXTENC), encoding);
ex_ID3Field_SetEncoding(ex_ID3Frame_GetField(label, ID3FN_TEXT), encoding);
if (encoding == ID3TE_UTF16) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(label, ID3FN_TEXT), (unicode_t *) String(leBOM).Append(format->label).ConvertTo("UTF-16LE"));
else if (encoding == ID3TE_UTF16BE) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(label, ID3FN_TEXT), (unicode_t *) format->label.ConvertTo("UTF-16BE"));
else ex_ID3Field_SetASCII(ex_ID3Frame_GetField(label, ID3FN_TEXT), format->label);
ex_ID3Tag_AddFrame(tag, label);
}
ID3Frame *isrc = ex_ID3Frame_NewID(ID3FID_ISRC);
if (format->isrc != NIL)
{
ex_ID3Field_SetINT(ex_ID3Frame_GetField(isrc, ID3FN_TEXTENC), encoding);
ex_ID3Field_SetEncoding(ex_ID3Frame_GetField(isrc, ID3FN_TEXT), encoding);
if (encoding == ID3TE_UTF16) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(isrc, ID3FN_TEXT), (unicode_t *) String(leBOM).Append(format->isrc).ConvertTo("UTF-16LE"));
else if (encoding == ID3TE_UTF16BE) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(isrc, ID3FN_TEXT), (unicode_t *) format->isrc.ConvertTo("UTF-16BE"));
else ex_ID3Field_SetASCII(ex_ID3Frame_GetField(isrc, ID3FN_TEXT), format->isrc);
ex_ID3Tag_AddFrame(tag, isrc);
}
Array<ID3Frame *> pictures;
if (currentConfig->copy_picture_tags)
{
for (Int i = 0; i < format->pictures.Length(); i++)
{
ID3Frame *picture = ex_ID3Frame_NewID(ID3FID_PICTURE);
Picture *picInfo = format->pictures.GetNth(i);
ex_ID3Field_SetINT(ex_ID3Frame_GetField(picture, ID3FN_TEXTENC), encoding);
ex_ID3Field_SetEncoding(ex_ID3Frame_GetField(picture, ID3FN_DESCRIPTION), encoding);
if (encoding == ID3TE_UTF16) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(picture, ID3FN_DESCRIPTION), (unicode_t *) String(leBOM).Append(picInfo->description).ConvertTo("UTF-16LE"));
else if (encoding == ID3TE_UTF16BE) ex_ID3Field_SetUNICODE(ex_ID3Frame_GetField(picture, ID3FN_DESCRIPTION), (unicode_t *) picInfo->description.ConvertTo("UTF-16BE"));
else ex_ID3Field_SetASCII(ex_ID3Frame_GetField(picture, ID3FN_DESCRIPTION), picInfo->description);
ex_ID3Field_SetASCII(ex_ID3Frame_GetField(picture, ID3FN_MIMETYPE), picInfo->mime.ConvertTo("ISO-8859-1"));
ex_ID3Field_SetINT(ex_ID3Frame_GetField(picture, ID3FN_PICTURETYPE), picInfo->type);
ex_ID3Field_SetBINARY(ex_ID3Frame_GetField(picture, ID3FN_DATA), picInfo->data, picInfo->data.Size());
ex_ID3Tag_AddFrame(tag, picture);
pictures.Add(picture);
}
}
String::SetOutputFormat(prevOutFormat.ConvertTo("ISO-8859-1"));
buffer.Resize(ex_ID3Tag_Size(tag));
Int size = ex_ID3Tag_Render(tag, buffer, version == 1 ? ID3TT_ID3V1 : ID3TT_ID3V2);
ex_ID3Tag_Delete(tag);
ex_ID3Frame_Delete(artist);
ex_ID3Frame_Delete(title);
ex_ID3Frame_Delete(album);
ex_ID3Frame_Delete(track);
ex_ID3Frame_Delete(year);
ex_ID3Frame_Delete(genre);
ex_ID3Frame_Delete(label);
ex_ID3Frame_Delete(isrc);
ex_ID3Frame_Delete(comment);
for (Int j = 0; j < format->pictures.Length(); j++)
{
ex_ID3Frame_Delete(pictures.GetNth(j));
}
return size;
}