本文整理汇总了C++中CPVRChannel::ChannelID方法的典型用法代码示例。如果您正苦于以下问题:C++ CPVRChannel::ChannelID方法的具体用法?C++ CPVRChannel::ChannelID怎么用?C++ CPVRChannel::ChannelID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPVRChannel
的用法示例。
在下文中一共展示了CPVRChannel::ChannelID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PersistChannelSettings
bool CPVRDatabase::PersistChannelSettings(const CPVRChannel &channel, const CVideoSettings &settings)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel id: %i",
__FUNCTION__, channel.ChannelID());
return false;
}
CStdString strQuery = FormatSQL(
"REPLACE INTO channelsettings "
"(idChannel, iInterlaceMethod, iViewMode, fCustomZoomAmount, fPixelRatio, iAudioStream, iSubtitleStream, fSubtitleDelay, "
"bSubtitles, fBrightness, fContrast, fGamma, fVolumeAmplification, fAudioDelay, bOutputToAllSpeakers, bCrop, iCropLeft, "
"iCropRight, iCropTop, iCropBottom, fSharpness, fNoiseReduction, fCustomVerticalShift, bCustomNonLinStretch, bPostProcess, iScalingMethod, iDeinterlaceMode) VALUES "
"(%i, %i, %i, %f, %f, %i, %i, %f, %i, %f, %f, %f, %f, %f, %i, %i, %i, %i, %i, %i, %f, %f, %f, %i, %i, %i, %i);",
channel.ChannelID(), settings.m_InterlaceMethod, settings.m_ViewMode, settings.m_CustomZoomAmount, settings.m_CustomPixelRatio,
settings.m_AudioStream, settings.m_SubtitleStream, settings.m_SubtitleDelay, settings.m_SubtitleOn ? 1 :0,
settings.m_Brightness, settings.m_Contrast, settings.m_Gamma, settings.m_VolumeAmplification, settings.m_AudioDelay,
settings.m_OutputToAllSpeakers ? 1 : 0, settings.m_Crop ? 1 : 0, settings.m_CropLeft, settings.m_CropRight, settings.m_CropTop,
settings.m_CropBottom, settings.m_Sharpness, settings.m_NoiseReduction, settings.m_CustomVerticalShift,
settings.m_CustomNonLinStretch ? 1 : 0, settings.m_PostProcess ? 1 : 0, settings.m_ScalingMethod, settings.m_DeinterlaceMode);
return ExecuteQuery(strQuery);
}
示例2: GetChannelSettings
bool CPVRDatabase::GetChannelSettings(const CPVRChannel &channel, CVideoSettings &settings)
{
bool bReturn = false;
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel id: %i",
__FUNCTION__, channel.ChannelID());
return bReturn;
}
CStdString strQuery = FormatSQL("SELECT * FROM channelsettings WHERE idChannel = %u;", channel.ChannelID());
if (ResultQuery(strQuery))
{
try
{
if (m_pDS->num_rows() > 0)
{
settings.m_AudioDelay = m_pDS->fv("fAudioDelay").get_asFloat();
settings.m_AudioStream = m_pDS->fv("iAudioStream").get_asInt();
settings.m_Brightness = m_pDS->fv("fBrightness").get_asFloat();
settings.m_Contrast = m_pDS->fv("fContrast").get_asFloat();
settings.m_CustomPixelRatio = m_pDS->fv("fPixelRatio").get_asFloat();
settings.m_CustomNonLinStretch = m_pDS->fv("bCustomNonLinStretch").get_asBool();
settings.m_NoiseReduction = m_pDS->fv("fNoiseReduction").get_asFloat();
settings.m_PostProcess = m_pDS->fv("bPostProcess").get_asBool();
settings.m_Sharpness = m_pDS->fv("fSharpness").get_asFloat();
settings.m_CustomZoomAmount = m_pDS->fv("fCustomZoomAmount").get_asFloat();
settings.m_CustomVerticalShift = m_pDS->fv("fCustomVerticalShift").get_asFloat();
settings.m_Gamma = m_pDS->fv("fGamma").get_asFloat();
settings.m_SubtitleDelay = m_pDS->fv("fSubtitleDelay").get_asFloat();
settings.m_SubtitleOn = m_pDS->fv("bSubtitles").get_asBool();
settings.m_SubtitleStream = m_pDS->fv("iSubtitleStream").get_asInt();
settings.m_ViewMode = m_pDS->fv("iViewMode").get_asInt();
settings.m_Crop = m_pDS->fv("bCrop").get_asBool();
settings.m_CropLeft = m_pDS->fv("iCropLeft").get_asInt();
settings.m_CropRight = m_pDS->fv("iCropRight").get_asInt();
settings.m_CropTop = m_pDS->fv("iCropTop").get_asInt();
settings.m_CropBottom = m_pDS->fv("iCropBottom").get_asInt();
settings.m_InterlaceMethod = (EINTERLACEMETHOD)m_pDS->fv("iInterlaceMethod").get_asInt();
settings.m_VolumeAmplification = m_pDS->fv("fVolumeAmplification").get_asFloat();
settings.m_OutputToAllSpeakers = m_pDS->fv("bOutputToAllSpeakers").get_asBool();
settings.m_ScalingMethod = (ESCALINGMETHOD)m_pDS->fv("iScalingMethod").get_asInt();
bReturn = true;
}
m_pDS->close();
}
catch(...)
{
CLog::Log(LOGERROR, "PVRDB - %s - failed to get channel settings for channel '%s'",
__FUNCTION__, channel.ChannelName().c_str());
}
}
return bReturn;
}
示例3: Delete
bool CPVRDatabase::Delete(const CPVRChannel &channel)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
return false;
CStdString strWhereClause = FormatSQL("idChannel = %u", channel.ChannelID());
return DeleteValues("channels", strWhereClause);
}
示例4: Delete
bool CPVRDatabase::Delete(const CPVRChannel &channel)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
return false;
CLog::Log(LOGDEBUG, "PVR - %s - deleting channel '%s' from the database", __FUNCTION__, channel.ChannelName().c_str());
CStdString strWhereClause = FormatSQL("idChannel = %u", channel.ChannelID());
return DeleteValues("channels", strWhereClause);
}
示例5: Persist
int CPVRDatabase::Persist(const CPVRChannel &channel, bool bQueueWrite /* = false */)
{
int iReturn = -1;
/* invalid channel */
if (channel.UniqueID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel uid: %d",
__FUNCTION__, channel.UniqueID());
return iReturn;
}
CStdString strQuery;
if (channel.ChannelID() <= 0)
{
/* new channel */
strQuery = FormatSQL("INSERT INTO channels ("
"iUniqueId, bIsRadio, bIsHidden, "
"sIconPath, sChannelName, bIsVirtual, bEPGEnabled, sEPGScraper, iLastWatched, iClientId, "
"iClientChannelNumber, sInputFormat, sStreamURL, iEncryptionSystem, idEpg) "
"VALUES (%i, %i, %i, '%s', '%s', %i, %i, '%s', %u, %i, %i, '%s', '%s', %i, %i);",
channel.UniqueID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), (channel.IsVirtual() ? 1 : 0), (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.LastWatched(), channel.ClientID(),
channel.ClientChannelNumber(), channel.InputFormat().c_str(), channel.StreamURL().c_str(), channel.EncryptionSystem(),
channel.EpgID());
}
else
{
/* update channel */
strQuery = FormatSQL("REPLACE INTO channels ("
"iUniqueId, bIsRadio, bIsHidden, "
"sIconPath, sChannelName, bIsVirtual, bEPGEnabled, sEPGScraper, iLastWatched, iClientId, "
"iClientChannelNumber, sInputFormat, sStreamURL, iEncryptionSystem, idChannel, idEpg) "
"VALUES (%i, %i, %i, '%s', '%s', %i, %i, '%s', %u, %i, %i, '%s', '%s', %i, %i, %i);",
channel.UniqueID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), (channel.IsVirtual() ? 1 : 0), (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.LastWatched(), channel.ClientID(),
channel.ClientChannelNumber(), channel.InputFormat().c_str(), channel.StreamURL().c_str(), channel.EncryptionSystem(), channel.ChannelID(),
channel.EpgID());
}
if (bQueueWrite)
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
else if (ExecuteQuery(strQuery))
{
iReturn = (channel.ChannelID() <= 0) ? (int) m_pDS->lastinsertid() : channel.ChannelID();
}
return iReturn;
}
示例6: RemoveChannel
bool CPVRDatabase::RemoveChannel(const CPVRChannel &channel)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel id: %li",
__FUNCTION__, channel.ChannelID());
return false;
}
CStdString strWhereClause = FormatSQL("ChannelId = '%u'", channel.ChannelID());
return DeleteValues("Channels", strWhereClause);
}
示例7: Delete
bool CPVRDatabase::Delete(const CPVRChannel &channel)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
return false;
CLog::Log(LOGDEBUG, "PVR - %s - deleting channel '%s' from the database", __FUNCTION__, channel.ChannelName().c_str());
Filter filter;
filter.AppendWhere(PrepareSQL("idChannel = %u", channel.ChannelID()));
return DeleteValues("channels", filter);
}
示例8: UpdateChannel
long CPVRDatabase::UpdateChannel(const CPVRChannel &channel, bool bQueueWrite /* = false */)
{
long iReturn = -1;
/* invalid channel */
if (channel.UniqueID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel uid: %d",
__FUNCTION__, channel.UniqueID());
return iReturn;
}
CStdString strQuery;
if (channel.ChannelID() <= 0)
{
/* new channel */
strQuery = FormatSQL("INSERT INTO Channels ("
"UniqueId, ChannelNumber, GroupId, IsRadio, IsHidden, "
"IconPath, ChannelName, IsVirtual, EPGEnabled, EPGScraper, ClientId, "
"ClientChannelNumber, InputFormat, StreamURL, EncryptionSystem) "
"VALUES (%i, %i, %i, %i, %i, '%s', '%s', %i, %i, '%s', %i, %i, '%s', '%s', %i)\n",
channel.UniqueID(), channel.ChannelNumber(), channel.GroupID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), (channel.IsVirtual() ? 1 : 0), (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.ClientID(),
channel.ClientChannelNumber(), channel.InputFormat().c_str(), channel.StreamURL().c_str(), channel.EncryptionSystem());
}
else
{
/* update channel */
strQuery = FormatSQL("REPLACE INTO Channels ("
"UniqueId, ChannelNumber, GroupId, IsRadio, IsHidden, "
"IconPath, ChannelName, IsVirtual, EPGEnabled, EPGScraper, ClientId, "
"ClientChannelNumber, InputFormat, StreamURL, EncryptionSystem, ChannelId) "
"VALUES (%i, %i, %i, %i, %i, '%s', '%s', %i, %i, '%s', %i, %i, '%s', '%s', %i, %i)\n",
channel.UniqueID(), channel.ChannelNumber(), channel.GroupID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), (channel.IsVirtual() ? 1 : 0), (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.ClientID(),
channel.ClientChannelNumber(), channel.InputFormat().c_str(), channel.StreamURL().c_str(), channel.EncryptionSystem(), channel.ChannelID());
}
if (bQueueWrite)
{
QueueInsertQuery(strQuery);
iReturn = 0;
}
else if (ExecuteQuery(strQuery))
{
iReturn = (channel.ChannelID() <= 0) ? (long) m_pDS->lastinsertid() : channel.ChannelID();
}
return iReturn;
}
示例9: DeleteChannelSettings
bool CPVRDatabase::DeleteChannelSettings(const CPVRChannel &channel)
{
bool bReturn(false);
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVR - %s - invalid channel id: %i", __FUNCTION__, channel.ChannelID());
return bReturn;
}
CStdString strWhereClause = FormatSQL("idChannel = %u", channel.ChannelID());
return DeleteValues("channelsettings", strWhereClause);
}
示例10: Persist
bool CPVRDatabase::Persist(CPVRChannel &channel)
{
bool bReturn(false);
/* invalid channel */
if (channel.UniqueID() <= 0)
{
CLog::Log(LOGERROR, "PVR - %s - invalid channel uid: %d", __FUNCTION__, channel.UniqueID());
return bReturn;
}
std::string strQuery;
if (channel.ChannelID() <= 0)
{
/* new channel */
strQuery = PrepareSQL("INSERT INTO channels ("
"iUniqueId, bIsRadio, bIsHidden, bIsUserSetIcon, bIsUserSetName, bIsLocked, "
"sIconPath, sChannelName, bIsVirtual, bEPGEnabled, sEPGScraper, iLastWatched, iClientId, "
"idEpg) "
"VALUES (%i, %i, %i, %i, %i, %i, '%s', '%s', %i, %i, '%s', %u, %i, %i)",
channel.UniqueID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0), (channel.IsUserSetIcon() ? 1 : 0), (channel.IsUserSetName() ? 1 : 0), (channel.IsLocked() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), 0, (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.LastWatched(), channel.ClientID(),
channel.EpgID());
}
else
{
/* update channel */
strQuery = PrepareSQL("REPLACE INTO channels ("
"iUniqueId, bIsRadio, bIsHidden, bIsUserSetIcon, bIsUserSetName, bIsLocked, "
"sIconPath, sChannelName, bIsVirtual, bEPGEnabled, sEPGScraper, iLastWatched, iClientId, "
"idChannel, idEpg) "
"VALUES (%i, %i, %i, %i, %i, %i, '%s', '%s', %i, %i, '%s', %u, %i, %i, %i)",
channel.UniqueID(), (channel.IsRadio() ? 1 :0), (channel.IsHidden() ? 1 : 0), (channel.IsUserSetIcon() ? 1 : 0), (channel.IsUserSetName() ? 1 : 0), (channel.IsLocked() ? 1 : 0),
channel.IconPath().c_str(), channel.ChannelName().c_str(), 0, (channel.EPGEnabled() ? 1 : 0), channel.EPGScraper().c_str(), channel.LastWatched(), channel.ClientID(),
channel.ChannelID(),
channel.EpgID());
}
if (QueueInsertQuery(strQuery))
{
/* update the channel ID for new channels */
if (channel.ChannelID() <= 0)
channel.SetChannelID((int)m_pDS->lastinsertid());
bReturn = true;
}
return bReturn;
}
示例11: UpdateLastChannel
bool CPVRDatabase::UpdateLastChannel(const CPVRChannel &channel)
{
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVRDB - %s - invalid channel id: %li",
__FUNCTION__, channel.ChannelID());
return false;
}
CStdString strQuery = FormatSQL("REPLACE INTO LastChannel (ChannelId, Number, Name) VALUES (%i, %i, '%s')\n",
channel.ChannelID(), channel.ChannelNumber(), channel.ChannelName().c_str());
return ExecuteQuery(strQuery);
}
示例12: UpdateLastWatched
bool CPVRDatabase::UpdateLastWatched(const CPVRChannel &channel)
{
CSingleLock lock(m_critSection);
const std::string strQuery = PrepareSQL("UPDATE channels SET iLastWatched = %u WHERE idChannel = %d",
static_cast<unsigned int>(channel.LastWatched()), channel.ChannelID());
return ExecuteQuery(strQuery);
}
示例13: UpdateLastWatched
bool CPVRDatabase::UpdateLastWatched(const CPVRChannel &channel)
{
std::string strQuery = PrepareSQL("UPDATE channels SET iLastWatched = %d WHERE idChannel = %d",
channel.LastWatched(), channel.ChannelID());
return ExecuteQuery(strQuery);
}
示例14: RemoveFromGroup
bool CPVRChannelGroupInternal::RemoveFromGroup(const CPVRChannel &channel)
{
CSingleLock lock(m_critSection);
/* check if this channel is currently playing if we are hiding it */
CPVRChannel currentChannel;
if (g_PVRManager.GetCurrentChannel(currentChannel) && currentChannel == channel)
{
CGUIDialogOK::ShowAndGetInput(19098,19101,0,19102);
return false;
}
/* get the actual channel since this is called from a fileitemlist copy */
CPVRChannel *realChannel = (CPVRChannel *) GetByChannelID(channel.ChannelID());
if (!realChannel)
return false;
/* switch the hidden flag */
if (!realChannel->IsHidden())
{
realChannel->SetHidden(true, true);
++m_iHiddenChannels;
/* renumber this list */
Renumber();
/* and persist */
return Persist();
}
return true;
}
示例15: DeleteChannelSettings
bool CPVRDatabase::DeleteChannelSettings(const CPVRChannel &channel)
{
bool bReturn(false);
/* invalid channel */
if (channel.ChannelID() <= 0)
{
CLog::Log(LOGERROR, "PVR - %s - invalid channel id: %i", __FUNCTION__, channel.ChannelID());
return bReturn;
}
Filter filter;
filter.AppendWhere(PrepareSQL("idChannel = %u", channel.ChannelID()));
return DeleteValues("channelsettings", filter);
}