当前位置: 首页>>代码示例>>C++>>正文


C++ CMusicInfoTag::Clear方法代码示例

本文整理汇总了C++中CMusicInfoTag::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicInfoTag::Clear方法的具体用法?C++ CMusicInfoTag::Clear怎么用?C++ CMusicInfoTag::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMusicInfoTag的用法示例。


在下文中一共展示了CMusicInfoTag::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMusicInfoTag

void CShoutcastRipFile::GetMusicInfoTag(CMusicInfoTag& tag)
{
  if ( m_recState.bFilenameSet && m_recState.bStreamSet )
  {
    tag.Clear();
    //now distinguish between
    if ( m_recState.bHasMetaData )
    {
      //The filename of RM will be something like "Oasis - Champagne Supernova", thus
      //So, we will make a file i.e "f:music\Record\Limbik Frequencies\Oasis - Champagne Supernova.mp3"
      //get the artist and trackname
      char szArtist[1124];
      char szTrackName[1124];
      char szTokens[1024];
      char* cursor;
      bool tokenUsed = false;
      bool foundArtist = false;
      bool foundTrackName = false;
      strcpy( szTokens, m_szFileName );
      cursor = strtok(szTokens, "-");
      if (!cursor) cursor = strtok(szTokens, ",");
      while (cursor != NULL)
      {
        tokenUsed = false;
        //we will look for two strings,
        //sometimes there's a track number, wich we will throw away
        if ( !foundArtist )
        {
          if ( atoi( cursor ) == 0 )
          {
            //its a string
            strcpy(szArtist, cursor );
            foundArtist = true;
            tokenUsed = true;
          }
        }
        if ( !foundTrackName && !tokenUsed )
        {
          if ( atoi( cursor ) == 0 )
          {
            //its a string
            strcpy(szTrackName, cursor );
            foundTrackName = true;
            tokenUsed = true;
          }
        }
        cursor = strtok (NULL, "-");
        //if (!cursor) cursor=strtok(NULL,",");
      }
      if ( foundTrackName )         //lets hope we found a track name, else it will be unknown
        tag.SetTitle(szTrackName);
      else
        tag.SetTitle(m_szStreamName);
      if ( foundArtist )          //lets hope we found an artist, else it will be unknown
        tag.SetArtist(szArtist);
      tag.SetAlbum(m_szStreamName);  //Jazzmusique (Album is like Directory)
    }
    else
    {
      tag.Clear();
      tag.SetTitle(m_szStreamName);
    }

  }
}
开发者ID:,项目名称:,代码行数:65,代码来源:


注:本文中的CMusicInfoTag::Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。