using namespace MUSIC_INFO;
using namespace XFILE;
-CCDDARipJob::CCDDARipJob(const CStdString& input,
- const CStdString& output,
+CCDDARipJob::CCDDARipJob(const std::string& input,
+ const std::string& output,
const CMusicInfoTag& tag,
int encoder,
bool eject,
CGUIDialogProgressBarHandle* handle = pDlgProgress->GetHandle(g_localizeStrings.Get(605));
int iTrack = atoi(m_input.substr(13, m_input.size() - 13 - 5).c_str());
- CStdString strLine0 = StringUtils::Format("%02i. %s - %s", iTrack,
+ std::string strLine0 = StringUtils::Format("%02i. %s - %s", iTrack,
StringUtils::Join(m_tag.GetArtist(), g_advancedSettings.m_musicItemSeparator).c_str(),
m_tag.GetTitle().c_str());
handle->SetText(strLine0);
return NULL;
// we have to set the tags before we init the Encoder
- CStdString strTrack = StringUtils::Format("%i", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(),NULL,10));
+ std::string strTrack = StringUtils::Format("%i", strtol(m_input.substr(13, m_input.size() - 13 - 5).c_str(),NULL,10));
encoder->SetComment("Ripped with XBMC");
encoder->SetArtist(StringUtils::Join(m_tag.GetArtist(),
return encoder;
}
-CStdString CCDDARipJob::SetupTempFile()
+std::string CCDDARipJob::SetupTempFile()
{
char tmp[MAX_PATH];
#ifndef TARGET_POSIX
*/
#include "utils/Job.h"
-#include "utils/StdString.h"
#include "music/tags/MusicInfoTag.h"
class CEncoder;
//! \param rate The sample rate of the input
//! \param channels Number of audio channels in input
//! \param bps The bits per sample for input
- CCDDARipJob(const CStdString& input, const CStdString& output,
+ CCDDARipJob(const std::string& input, const std::string& output,
const MUSIC_INFO::CMusicInfoTag& tag, int encoder,
bool eject=false, unsigned int rate=44100,
unsigned int channels=2, unsigned int bps=16);
virtual const char* GetType() const { return "cdrip"; };
virtual bool operator==(const CJob *job) const;
virtual bool DoWork();
- CStdString GetOutput() const { return m_output; }
+ std::string GetOutput() const { return m_output; }
protected:
//! \brief Setup the audio encoder
CEncoder* SetupEncoder(XFILE::CFile& reader);
//! \brief Helper used if output is a remote url
- CStdString SetupTempFile();
+ std::string SetupTempFile();
//! \brief Rip a chunk of audio
//! \param reader The input reader
unsigned int m_channels; //< The number of channels in input file
unsigned int m_bps; //< The bits per sample of input
MUSIC_INFO::CMusicInfoTag m_tag; //< Music tag to attach to output file
- CStdString m_input; //< The input url
- CStdString m_output; //< The output url
+ std::string m_input; //< The input url
+ std::string m_output; //< The output url
bool m_eject; //< Should we eject tray when we are finished?
int m_encoder; //< The audio encoder
};
}
// construct directory where the track is stored
- CStdString strDirectory;
+ std::string strDirectory;
int legalType;
if (!CreateAlbumDir(*pItem->GetMusicInfoTag(), strDirectory, legalType))
return false;
- CStdString strFile = URIUtils::AddFileToFolder(strDirectory,
+ std::string strFile = URIUtils::AddFileToFolder(strDirectory,
CUtil::MakeLegalFileName(GetTrackName(pItem), legalType));
AddJob(new CCDDARipJob(pItem->GetPath(),strFile,
}
// construct directory where the tracks are stored
- CStdString strDirectory;
+ std::string strDirectory;
int legalType;
if (!CreateAlbumDir(*vecItems[0]->GetMusicInfoTag(), strDirectory, legalType))
return false;
CFileItemPtr item = vecItems[i];
// construct filename
- CStdString strFile = URIUtils::AddFileToFolder(strDirectory, CUtil::MakeLegalFileName(GetTrackName(item.get()), legalType));
+ std::string strFile = URIUtils::AddFileToFolder(strDirectory, CUtil::MakeLegalFileName(GetTrackName(item.get()), legalType));
// don't rip non cdda items
if (item->GetPath().find(".cdda") == std::string::npos)
return true;
}
-bool CCDDARipper::CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, CStdString& strDirectory, int& legalType)
+bool CCDDARipper::CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, std::string& strDirectory, int& legalType)
{
CSettingPath *recordingpathSetting = (CSettingPath*)CSettings::Get().GetSetting("audiocds.recordingpath");
if (recordingpathSetting != NULL)
legalType = LEGAL_WIN32_COMPAT;
#endif
- CStdString strAlbumDir = GetAlbumDirName(infoTag);
+ std::string strAlbumDir = GetAlbumDirName(infoTag);
if (!strAlbumDir.empty())
{
return true;
}
-CStdString CCDDARipper::GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTag)
+std::string CCDDARipper::GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTag)
{
- CStdString strAlbumDir;
+ std::string strAlbumDir;
// use audiocds.trackpathformat setting to format
// directory name where CD tracks will be stored,
// replace %A with album artist name
if (strAlbumDir.find("%A") != std::string::npos)
{
- CStdString strAlbumArtist = StringUtils::Join(infoTag.GetAlbumArtist(), g_advancedSettings.m_musicItemSeparator);
+ std::string strAlbumArtist = StringUtils::Join(infoTag.GetAlbumArtist(), g_advancedSettings.m_musicItemSeparator);
if (strAlbumArtist.empty())
strAlbumArtist = StringUtils::Join(infoTag.GetArtist(), g_advancedSettings.m_musicItemSeparator);
if (strAlbumArtist.empty())
// replace %B with album title
if (strAlbumDir.find("%B") != std::string::npos)
{
- CStdString strAlbum = infoTag.GetAlbum();
+ std::string strAlbum = infoTag.GetAlbum();
if (strAlbum.empty())
strAlbum = StringUtils::Format("Unknown Album %s", CDateTime::GetCurrentDateTime().GetAsLocalizedDateTime().c_str());
else
// replace %G with genre
if (strAlbumDir.find("%G") != std::string::npos)
{
- CStdString strGenre = StringUtils::Join(infoTag.GetGenre(), g_advancedSettings.m_musicItemSeparator);
+ std::string strGenre = StringUtils::Join(infoTag.GetGenre(), g_advancedSettings.m_musicItemSeparator);
if (strGenre.empty())
strGenre = "Unknown Genre";
else
// replace %Y with year
if (strAlbumDir.find("%Y") != std::string::npos)
{
- CStdString strYear = infoTag.GetYearString();
+ std::string strYear = infoTag.GetYearString();
if (strYear.empty())
strYear = "Unknown Year";
else
return strAlbumDir;
}
-CStdString CCDDARipper::GetTrackName(CFileItem *item)
+std::string CCDDARipper::GetTrackName(CFileItem *item)
{
// get track number from "cdda://local/01.cdda"
int trackNumber = atoi(item->GetPath().substr(13, item->GetPath().size() - 13 - 5).c_str());
// get track file name format from audiocds.trackpathformat setting,
// use only format part starting from the last '/'
- CStdString strFormat = CSettings::Get().GetString("audiocds.trackpathformat");
+ std::string strFormat = CSettings::Get().GetString("audiocds.trackpathformat");
size_t pos = strFormat.find_last_of("/\\");
if (pos != std::string::npos)
strFormat.erase(0, pos+1);
formatter.FormatLabel(&destItem);
// grab the label to use it as our ripped filename
- CStdString track = destItem.GetLabel();
+ std::string track = destItem.GetLabel();
if (track.empty())
track = StringUtils::Format("%s%02i", "Track-", trackNumber);
{
if(CJobQueue::QueueEmpty())
{
- CStdString dir = URIUtils::GetDirectory(((CCDDARipJob*)job)->GetOutput());
+ std::string dir = URIUtils::GetDirectory(((CCDDARipJob*)job)->GetOutput());
bool unimportant;
int source = CUtil::GetMatchingSource(dir, *CMediaSourceSettings::Get().CMediaSourceSettings::GetSources("music"), unimportant);
\param[out] legalType created directory type (see LEGAL_... constants)
\return true if success, false if failure
*/
- bool CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, CStdString& strDirectory, int& legalType);
+ bool CreateAlbumDir(const MUSIC_INFO::CMusicInfoTag& infoTag, std::string& strDirectory, int& legalType);
/*! \brief Return formatted album subfolder for rip path
\param infoTag music info tags for the CD, used to format album name
\return album subfolder path name
*/
- CStdString GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTag);
+ std::string GetAlbumDirName(const MUSIC_INFO::CMusicInfoTag& infoTag);
/*! \brief Return file name for the track
\param item CFileItem representing a track
\return track file name
*/
- CStdString GetTrackName(CFileItem *item);
+ std::string GetTrackName(CFileItem *item);
};
#endif // _CCDDARIPPERMP3_H