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


C++ CAlbum::GetFilename方法代码示例

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


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

示例1: RunEx

void CGetCovers::RunEx()
{
	std::vector<CAlbum*> albumList;

	CMediaDatabase::GetAlbumsFromDatabaseNotLoaded(m_pWindow, &albumList);

	// set processbar max
	m_pProcessbar->SetMaxPosition((int) albumList.size());

	std::vector<CAlbum*>::iterator iter = albumList.begin();

	while ((iter != albumList.end()) && (!m_bPleaseStop))
	{
		CAlbum* album = *iter;
		
		std::string outfile = SallyAPI::String::PathHelper::GetDirectoryFromPath(album->GetFilename());
		outfile.append(album->GetCoverName());

		bool exists = SallyAPI::File::FileHelper::FileExists(outfile);
		
		if (exists)
		{
			// Datei exists already
			CMediaDatabase::SetAlbumInDatabase(m_pWindow, album->GetAlbum(), album->GetArtist(), true);
		}
		else
		{
			// Get it from Amazon
			bool result = false;

			result = m_AmazonCover.GetMusicCover(album->GetArtist(), album->GetAlbum(), outfile);

			if (result)
			{
				CMediaDatabase::SetAlbumInDatabase(m_pWindow, album->GetAlbum(), album->GetArtist(), true);
			}
			else
			{
				CMediaDatabase::SetAlbumInDatabase(m_pWindow, album->GetAlbum(), album->GetArtist(), false);
			}
		}
		++iter;

		// update processbar
		m_pProcessbar->SetPosition(m_pProcessbar->GetPosition() + 1);
	}

	// Delete vector
	iter = albumList.begin();
	while (iter != albumList.end())
	{
		SafeDelete(*iter);
		++iter;
	}

	if (!m_bPleaseStop)
		m_pWindow->SendMessageToParent(0, 0, m_iMessageId);
}
开发者ID:grimtraveller,项目名称:sally-project,代码行数:58,代码来源:GetCovers.cpp

示例2: UpdateImages

void CAddMusicAlbum::UpdateImages()
{
	EnterRenderLock();

	SallyAPI::Config::CConfig* config = SallyAPI::Config::CConfig::GetInstance(); 
	SallyAPI::Config::CTheme* theme = config->GetTheme();

	std::vector<CAlbum*>::iterator iter = m_vAlbumList.begin();

	int k = 0;
	int i = 0;

	if (m_iStartPicture == 0)
	{
		std::vector<SallyAPI::GUI::CImageBox*> imageBoxVector = m_mImage[0];
		std::vector<SallyAPI::GUI::CLabelBox*> imageNameVector = m_mImageName[0];
		std::vector<SallyAPI::GUI::CButton*> imageAddAllVector = m_mImageAddAlbum[0];

		for (int l = 0; l < m_iRows; ++l)
		{
			imageBoxVector[l]->Visible(false);
			imageNameVector[l]->Visible(false);
			imageAddAllVector[l]->Visible(false);
		}
		k = 1;
	}

	for (int l = 0; (l < (m_iStartPicture - 1) * m_iRows) && (iter != m_vAlbumList.end()); ++l)
	{
		++iter;
	}

	SallyAPI::GUI::CPicture* picture;

	while ((k < m_iCols + 2) && (iter != m_vAlbumList.end()))
	{
		std::vector<SallyAPI::GUI::CImageBox*> imageBoxVector = m_mImage[k];
		std::vector<SallyAPI::GUI::CLabelBox*> imageNameVector = m_mImageName[k];
		std::vector<SallyAPI::GUI::CButton*> imageAddAllVector = m_mImageAddAlbum[k];

		for (; (i < m_iRows) && (iter != m_vAlbumList.end()); i++)
		{
			CAlbum* album = *iter;

			std::string covername = album->GetCoverName();
			
			std::string filename = SallyAPI::String::PathHelper::GetDirectoryFromPath(album->GetFilename());
			filename = SallyAPI::String::PathHelper::CorrectPath(filename);

			filename.append(covername);

			std::string description = album->GetArtist();
			description.append("\n");
			description.append(album->GetAlbum());

			imageNameVector[i]->SetText(description);
			imageBoxVector[i]->SetText(filename);

			picture = m_mPictureMap[filename];

			// Not yet loaded... use default pic
			if (picture == NULL)
				picture = theme->GetPicture(GUI_APP_DEFAULT_CD + m_iGraphicId);

			// Now paint
			if (picture != NULL)
			{
				imageBoxVector[i]->SetPicture(picture);
				imageBoxVector[i]->Visible(true);

				/*
				int xImageBox = 0;
				int yImageBox = 0;
				imageBoxVector[i]->GetAbsolutPosition(&xImageBox, &yImageBox);

				float rotationAngleY = xImageBox - ((WINDOW_WIDTH) / 2) + MENU_WIDTH;
				rotationAngleY = rotationAngleY / 1500;

				imageBoxVector[i]->SetRotationAngleY(rotationAngleY);
				*/

				imageNameVector[i]->Visible(true);

				imageAddAllVector[i]->Visible(true);
			}
			else
			{
				imageBoxVector[i]->SetPicture(NULL);
				imageNameVector[i]->SetText("");
				imageNameVector[i]->Visible(false);
				imageAddAllVector[i]->Visible(false);
			}
			++iter;
		}
		if (iter != m_vAlbumList.end())
		{
			i = 0;
			k++;
		}
	}
//.........这里部分代码省略.........
开发者ID:grimtraveller,项目名称:sally-project,代码行数:101,代码来源:AddMusicAlbum.cpp


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