本文整理汇总了C++中Notification::function方法的典型用法代码示例。如果您正苦于以下问题:C++ Notification::function方法的具体用法?C++ Notification::function怎么用?C++ Notification::function使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notification
的用法示例。
在下文中一共展示了Notification::function方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dispatchNotification
void MediaPlayerPrivateAVFoundation::dispatchNotification()
{
ASSERT(isMainThread());
Notification notification = Notification();
{
MutexLocker lock(m_queueMutex);
if (m_queuedNotifications.isEmpty())
return;
if (!m_delayCallbacks) {
// Only dispatch one notification callback per invocation because they can cause recursion.
notification = m_queuedNotifications.first();
m_queuedNotifications.remove(0);
}
if (!m_queuedNotifications.isEmpty() && !m_mainThreadCallPending)
callOnMainThread(mainThreadCallback, this);
if (!notification.isValid())
return;
}
if (notification.type() != Notification::FunctionType)
LOG(Media, "MediaPlayerPrivateAVFoundation::dispatchNotification(%p) - dispatching %s", this, notificationName(notification));
switch (notification.type()) {
case Notification::ItemDidPlayToEndTime:
didEnd();
break;
case Notification::ItemTracksChanged:
tracksChanged();
updateStates();
break;
case Notification::ItemStatusChanged:
updateStates();
break;
case Notification::ItemSeekableTimeRangesChanged:
seekableTimeRangesChanged();
updateStates();
break;
case Notification::ItemLoadedTimeRangesChanged:
loadedTimeRangesChanged();
updateStates();
break;
case Notification::ItemPresentationSizeChanged:
sizeChanged();
updateStates();
break;
case Notification::ItemIsPlaybackLikelyToKeepUpChanged:
updateStates();
break;
case Notification::ItemIsPlaybackBufferEmptyChanged:
updateStates();
break;
case Notification::ItemIsPlaybackBufferFullChanged:
updateStates();
break;
case Notification::PlayerRateChanged:
updateStates();
rateChanged();
break;
case Notification::PlayerTimeChanged:
timeChanged(notification.time());
break;
case Notification::SeekCompleted:
seekCompleted(notification.finished());
break;
case Notification::AssetMetadataLoaded:
metadataLoaded();
updateStates();
break;
case Notification::AssetPlayabilityKnown:
updateStates();
playabilityKnown();
break;
case Notification::DurationChanged:
invalidateCachedDuration();
break;
case Notification::ContentsNeedsDisplay:
contentsNeedsDisplay();
break;
case Notification::InbandTracksNeedConfiguration:
m_inbandTrackConfigurationPending = false;
configureInbandTracks();
break;
case Notification::FunctionType:
notification.function()();
break;
case Notification::TargetIsWirelessChanged:
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
playbackTargetIsWirelessChanged();
#endif
break;
case Notification::None:
ASSERT_NOT_REACHED();
break;
}
//.........这里部分代码省略.........