Skip to content

Commit

Permalink
[stdstring] get rid of CStdString in video/
Browse files Browse the repository at this point in the history
  • Loading branch information
notspiff authored and Montellese committed Jan 7, 2015
1 parent fa4617e commit a6345db
Show file tree
Hide file tree
Showing 23 changed files with 767 additions and 764 deletions.
32 changes: 16 additions & 16 deletions xbmc/network/upnp/UPnPInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,29 +264,29 @@ PopulateObjectFromTag(CVideoInfoTag& tag,
EClientQuirks quirks)
{
if (!tag.m_strFileNameAndPath.empty() && file_path)
*file_path = tag.m_strFileNameAndPath;
*file_path = tag.m_strFileNameAndPath.c_str();

if (tag.m_iDbId != -1 ) {
if (tag.m_type == MediaTypeMusicVideo) {
object.m_ObjectClass.type = "object.item.videoItem.musicVideoClip";
object.m_Creator = StringUtils::Join(tag.m_artist, g_advancedSettings.m_videoItemSeparator).c_str();
for (std::vector<std::string>::const_iterator itArtist = tag.m_artist.begin(); itArtist != tag.m_artist.end(); ++itArtist)
object.m_People.artists.Add(itArtist->c_str());
object.m_Affiliation.album = tag.m_strAlbum;
object.m_Title = tag.m_strTitle;
object.m_Affiliation.album = tag.m_strAlbum.c_str();
object.m_Title = tag.m_strTitle.c_str();
object.m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDate().c_str();
object.m_ReferenceID = NPT_String::Format("videodb://musicvideos/titles/%i", tag.m_iDbId);
} else if (tag.m_type == MediaTypeMovie) {
object.m_ObjectClass.type = "object.item.videoItem.movie";
object.m_Title = tag.m_strTitle;
object.m_Title = tag.m_strTitle.c_str();
object.m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDate().c_str();
object.m_ReferenceID = NPT_String::Format("videodb://movies/titles/%i", tag.m_iDbId);
} else {
object.m_ObjectClass.type = "object.item.videoItem.videoBroadcast";
object.m_Recorded.program_title = "S" + ("0" + NPT_String::FromInteger(tag.m_iSeason)).Right(2);
object.m_Recorded.program_title += "E" + ("0" + NPT_String::FromInteger(tag.m_iEpisode)).Right(2);
object.m_Recorded.program_title += " : " + tag.m_strTitle;
object.m_Recorded.series_title = tag.m_strShowTitle;
object.m_Recorded.program_title += (" : " + tag.m_strTitle).c_str();
object.m_Recorded.series_title = tag.m_strShowTitle.c_str();
int season = tag.m_iSeason > 1 ? tag.m_iSeason : 1;
object.m_Recorded.episode_number = season * 100 + tag.m_iEpisode;
object.m_Title = object.m_Recorded.series_title + " - " + object.m_Recorded.program_title;
Expand All @@ -307,8 +307,8 @@ PopulateObjectFromTag(CVideoInfoTag& tag,

object.m_XbmcInfo.date_added = tag.m_dateAdded.GetAsW3CDate().c_str();
object.m_XbmcInfo.rating = tag.m_fRating;
object.m_XbmcInfo.votes = tag.m_strVotes;
object.m_XbmcInfo.unique_identifier = tag.m_strIMDBNumber;
object.m_XbmcInfo.votes = tag.m_strVotes.c_str();
object.m_XbmcInfo.unique_identifier = tag.m_strIMDBNumber.c_str();

for (unsigned int index = 0; index < tag.m_genre.size(); index++)
object.m_Affiliation.genres.Add(tag.m_genre.at(index).c_str());
Expand All @@ -323,9 +323,9 @@ PopulateObjectFromTag(CVideoInfoTag& tag,
for (unsigned int index = 0; index < tag.m_writingCredits.size(); index++)
object.m_People.authors.Add(tag.m_writingCredits[index].c_str());

object.m_Description.description = tag.m_strTagLine;
object.m_Description.long_description = tag.m_strPlot;
object.m_Description.rating = tag.m_strMPAARating;
object.m_Description.description = tag.m_strTagLine.c_str();
object.m_Description.long_description = tag.m_strPlot.c_str();
object.m_Description.rating = tag.m_strMPAARating.c_str();
object.m_MiscInfo.last_position = (NPT_UInt32)tag.m_resumePoint.timeInSeconds;
object.m_MiscInfo.last_time = tag.m_lastPlayed.GetAsW3CDateTime().c_str();
object.m_MiscInfo.play_count = tag.m_playCount;
Expand Down Expand Up @@ -509,15 +509,15 @@ BuildObject(CFileItem& item,
case VIDEODATABASEDIRECTORY::NODE_TYPE_ACTOR:
container->m_ObjectClass.type += ".person.videoArtist";
container->m_Creator = StringUtils::Join(tag.m_artist, g_advancedSettings.m_videoItemSeparator).c_str();
container->m_Title = tag.m_strTitle;
container->m_Title = tag.m_strTitle.c_str();
break;
case VIDEODATABASEDIRECTORY::NODE_TYPE_SEASONS:
case VIDEODATABASEDIRECTORY::NODE_TYPE_TITLE_TVSHOWS:
container->m_ObjectClass.type += ".album.videoAlbum";
container->m_Recorded.series_title = tag.m_strShowTitle;
container->m_Recorded.series_title = tag.m_strShowTitle.c_str();
container->m_Recorded.episode_number = tag.m_iEpisode;
container->m_MiscInfo.play_count = tag.m_playCount;
container->m_Title = tag.m_strTitle;
container->m_Title = tag.m_strTitle.c_str();
if (!tag.m_premiered.IsValid() && tag.m_iYear)
container->m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDateTime().c_str();
else
Expand All @@ -535,8 +535,8 @@ BuildObject(CFileItem& item,
for (unsigned int index = 0; index < tag.m_writingCredits.size(); index++)
container->m_People.authors.Add(tag.m_writingCredits[index].c_str());

container->m_Description.description = tag.m_strTagLine;
container->m_Description.long_description = tag.m_strPlot;
container->m_Description.description = tag.m_strTagLine.c_str();
container->m_Description.long_description = tag.m_strPlot.c_str();

break;
default:
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/LabelFormatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ std::string CLabelFormatter::GetMaskContent(const CMaskString &mask, const CFile
}
break;
case 'O':
if (movie && movie->m_strMPAARating)
if (movie)
{// MPAA Rating
value = movie->m_strMPAARating;
}
Expand Down
9 changes: 4 additions & 5 deletions xbmc/video/Bookmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
*
*/

#include <string>
#include <vector>

#include "utils/StdString.h"

class CBookmark
{
public:
Expand All @@ -42,9 +41,9 @@ class CBookmark
double timeInSeconds;
double totalTimeInSeconds;
long partNumber;
CStdString thumbNailImage;
CStdString playerState;
CStdString player;
std::string thumbNailImage;
std::string playerState;
std::string player;
long seasonNumber;
long episodeNumber;

Expand Down
4 changes: 2 additions & 2 deletions xbmc/video/FFmpegVideoDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const AVCodec * FFmpegVideoDecoder::getAVCodec() const
return m_pCodec;
}

CStdString FFmpegVideoDecoder::getErrorMsg() const
std::string FFmpegVideoDecoder::getErrorMsg() const
{
return m_errorMsg;
}
Expand All @@ -136,7 +136,7 @@ double FFmpegVideoDecoder::getLastFrameTime() const
}


bool FFmpegVideoDecoder::open( const CStdString& filename )
bool FFmpegVideoDecoder::open( const std::string& filename )
{
// See http://dranger.com/ffmpeg/tutorial01.html
close();
Expand Down
8 changes: 4 additions & 4 deletions xbmc/video/FFmpegVideoDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

#include "utils/StdString.h"
#include <string>

class CBaseTexture;

Expand Down Expand Up @@ -58,7 +58,7 @@ class FFmpegVideoDecoder
*
* @param filename The video file name, which must be translated through CSpecialProtocol::TranslatePath()
*/
bool open( const CStdString& filename );
bool open( const std::string& filename );

/**
* Returns true if the decoder has the video file opened.
Expand Down Expand Up @@ -110,7 +110,7 @@ class FFmpegVideoDecoder
/**
* Returns the error message text if opening the video failed
*/
CStdString getErrorMsg() const;
std::string getErrorMsg() const;

/**
* Decodes and renders the next video frame into the provided texture which
Expand Down Expand Up @@ -152,7 +152,7 @@ class FFmpegVideoDecoder
unsigned int m_frameRGBwidth;
unsigned int m_frameRGBheight;

CStdString m_errorMsg;
std::string m_errorMsg;
};

#endif
11 changes: 5 additions & 6 deletions xbmc/video/PlayerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "PlayerController.h"
#include "dialogs/GUIDialogSlider.h"
#include "utils/StdString.h"
#include "settings/AdvancedSettings.h"
#include "settings/DisplaySettings.h"
#include "settings/MediaSettings.h"
Expand Down Expand Up @@ -65,7 +64,7 @@ bool CPlayerController::OnAction(const CAction &action)

bool subsOn = !g_application.m_pPlayer->GetSubtitleVisible();
g_application.m_pPlayer->SetSubtitleVisible(subsOn);
CStdString sub, lang;
std::string sub, lang;
if (subsOn)
{
SPlayerSubtitleStreamInfo info;
Expand Down Expand Up @@ -112,7 +111,7 @@ bool CPlayerController::OnAction(const CAction &action)
g_application.m_pPlayer->SetSubtitleVisible(true);
}

CStdString sub, lang;
std::string sub, lang;
if (currentSubVisible)
{
SPlayerSubtitleStreamInfo info;
Expand Down Expand Up @@ -209,8 +208,8 @@ bool CPlayerController::OnAction(const CAction &action)
if (++currentAudio >= g_application.m_pPlayer->GetAudioStreamCount())
currentAudio = 0;
g_application.m_pPlayer->SetAudioStream(currentAudio); // Set the audio stream to the one selected
CStdString aud;
CStdString lan;
std::string aud;
std::string lan;
SPlayerAudioStreamInfo info;
g_application.m_pPlayer->GetAudioStreamInfo(currentAudio, info);
if (!g_LangCodeExpander.Lookup(lan, info.language))
Expand Down Expand Up @@ -419,7 +418,7 @@ void CPlayerController::OnSliderChange(void *data, CGUISliderControl *slider)
m_sliderAction == ACTION_VSHIFT_UP || m_sliderAction == ACTION_VSHIFT_DOWN ||
m_sliderAction == ACTION_SUBTITLE_VSHIFT_UP || m_sliderAction == ACTION_SUBTITLE_VSHIFT_DOWN)
{
CStdString strValue = StringUtils::Format("%1.2f",slider->GetFloatValue());
std::string strValue = StringUtils::Format("%1.2f",slider->GetFloatValue());
slider->SetTextValue(strValue);
}
else if (m_sliderAction == ACTION_VOLAMP_UP || m_sliderAction == ACTION_VOLAMP_DOWN)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/video/Teletext.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class CTeletextDecoder

static FT_Error MyFaceRequester(FTC_FaceID face_id, FT_Library library, FT_Pointer request_data, FT_Face *aface);

CStdString m_teletextFont; /* Path to teletext font */
std::string m_teletextFont; /* Path to teletext font */
int m_YOffset; /* Swap position for Front buffer and Back buffer */
color_t *m_TextureBuffer; /* Texture buffer to hold generated data */
bool m_updateTexture; /* Update the texture if set */
Expand Down
4 changes: 2 additions & 2 deletions xbmc/video/TeletextDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

#include "utils/StdString.h"
#include <string>

#define FLOFSIZE 4
#define SUBTITLE_CACHESIZE 50
Expand Down Expand Up @@ -431,7 +431,7 @@ typedef struct TextCacheStruct_t
short pop, gpop, drcs, gdrcs;
unsigned short *ColorTable;

CStdString line30;
std::string line30;
} TextCacheStruct_t;

/* struct for all Information needed for Page Rendering */
Expand Down
Loading

0 comments on commit a6345db

Please sign in to comment.