bool CAddonInstaller::IsDownloading() const
{
CSingleLock lock(m_critSection);
- return m_downloadJobs.size() > 0;
+ return !m_downloadJobs.empty();
}
void CAddonInstaller::GetInstallList(VECADDONS &addons) const
CAESinkDirectSound::CAESinkDirectSound() :
m_pBuffer (NULL ),
m_pDSound (NULL ),
+ m_encodedFormat (AE_FMT_INVALID),
m_AvgBytesPerSec(0 ),
m_dwChunkSize (0 ),
m_dwFrameSize (0 ),
AEChannelsFromSpeakerMask(wfxex.dwChannelMask);
format.m_channelLayout = m_channelLayout;
+ m_encodedFormat = format.m_dataFormat;
format.m_frames = uiFrameCount;
format.m_frameSamples = format.m_frames * format.m_channelLayout.Count();
format.m_frameSize = (AE_IS_RAW(format.m_dataFormat) ? wfxex.Format.wBitsPerSample >> 3 : sizeof(float)) * format.m_channelLayout.Count();
m_uiBufferLen(0),
m_avgTimeWaiting(50),
m_sinkLatency(0.0),
+ m_lastWriteToBuffer(0),
m_pBuffer(NULL),
m_bufferPtr(0)
{
return 0;
}
- unsigned int GetStereoModeFlags(const std::string mode)
+ unsigned int GetStereoModeFlags(const std::string& mode)
{
static std::map<std::string, unsigned int> convert;
if(convert.empty())
unsigned int GetFlagsChromaPosition(unsigned int chroma_position);
unsigned int GetFlagsColorPrimaries(unsigned int color_primaries);
unsigned int GetFlagsColorTransfer(unsigned int color_transfer);
- unsigned int GetStereoModeFlags(const std::string mode);
+ unsigned int GetStereoModeFlags(const std::string& mode);
std::string GetStereoModeInvert(const std::string& mode);
}
CSingleLock lock(m_critSection);
return (m_iEpgID > 0 && /* valid EPG ID */
- m_tags.size() > 0 && /* contains at least 1 tag */
+ !m_tags.empty() && /* contains at least 1 tag */
m_tags.rbegin()->second->EndAsUTC() >= CDateTime::GetCurrentDateTime().GetAsUTCDateTime()); /* the last end time hasn't passed yet */
}
CDateTime first;
CSingleLock lock(m_critSection);
- if (m_tags.size() > 0)
+ if (!m_tags.empty())
first = m_tags.begin()->second->StartAsUTC();
return first;
CDateTime last;
CSingleLock lock(m_critSection);
- if (m_tags.size() > 0)
+ if (!m_tags.empty())
last = m_tags.rbegin()->second->StartAsUTC();
return last;
SSession()
{
session = NULL;
+ port = 0;
refs = 0;
+ last = 0;
}
std::string hostname;
}
// add our map to our table
- if (map.size() > 0)
+ if (!map.empty())
m_translatorMap.insert(pair<int, buttonMap>( windowID, map));
}
}
}
// add the modified touch map with the window ID
- if (map.size() > 0)
+ if (!map.empty())
m_touchMap.insert(std::pair<int, buttonMap>(windowID, map));
}
}
}
-JSONRPC_STATUS CPlayerOperations::StartSlideshow(const std::string path, bool recursive, bool random)
+JSONRPC_STATUS CPlayerOperations::StartSlideshow(const std::string& path, bool recursive, bool random)
{
int flags = 0;
if (recursive)
static int GetActivePlayers();
static PlayerType GetPlayer(const CVariant &player);
static int GetPlaylist(PlayerType player);
- static JSONRPC_STATUS StartSlideshow(const std::string path, bool recursive, bool random);
+ static JSONRPC_STATUS StartSlideshow(const std::string& path, bool recursive, bool random);
static void SendSlideshowAction(int actionID);
static void OnPlaylistChanged();
static JSONRPC_STATUS GetPropertyValue(PlayerType player, const CStdString &property, CVariant &result);
return true;
}
-void CPythonInvoker::addPath(const std::string path)
+void CPythonInvoker::addPath(const std::string& path)
{
if (path.empty())
return;
private:
void initializeModules(const std::map<std::string, PythonModuleInitialization> &modules);
bool initializeModule(PythonModuleInitialization module);
- void addPath(const std::string path);
+ void addPath(const std::string& path);
std::string m_pythonPath;
void *m_threadState;
bool CPeripheral::HasSettings(void) const
{
- return m_settings.size() > 0;
+ return !m_settings.empty();
}
bool CPeripheral::HasConfigurableSettings(void) const
groupedItems.Add(item);
}
- if ((groupBy & GroupBySet) && setMap.size() > 0)
+ if ((groupBy & GroupBySet) && !setMap.empty())
{
CVideoDbUrl itemsUrl;
if (!itemsUrl.FromString(baseDir))
cstr = new_cstr;
}
+ free(cstr);
return "";
}
Parses the XML for multiple tags of the given name.
Does not clear the array to support chaining.
*/
-bool XMLUtils::GetStringArray(const TiXmlNode* pRootNode, const char* strTag, std::vector<std::string>& arrayValue, bool clear /* = false */, const std::string separator /* = "" */)
+bool XMLUtils::GetStringArray(const TiXmlNode* pRootNode, const char* strTag, std::vector<std::string>& arrayValue, bool clear /* = false */, const std::string& separator /* = "" */)
{
std::string strTemp;
const TiXmlElement* node = pRootNode->FirstChildElement(strTag);
\param clear if true, clears the string prior to adding tags, if tags are available. Defaults to false.
*/
static bool GetAdditiveString(const TiXmlNode* rootNode, const char* tag, const CStdString& separator, CStdString& value, bool clear = false);
- static bool GetStringArray(const TiXmlNode* rootNode, const char* tag, std::vector<std::string>& arrayValue, bool clear = false, const std::string separator = "");
+ static bool GetStringArray(const TiXmlNode* rootNode, const char* tag, std::vector<std::string>& arrayValue, bool clear = false, const std::string& separator = "");
static bool GetEncoding(const CXBMCTinyXML* pDoc, CStdString& strEncoding);
static bool GetPath(const TiXmlNode* pRootNode, const char* strTag, CStdString& strStringValue);
static bool GetFloat(const TiXmlNode* pRootNode, const char* strTag, float& value, const float min, const float max);