int PlaylistEntryPixelOverlay::StartPlaying(void)
{
	LogDebug(VB_PLAYLIST, "PlaylistEntryPixelOverlay::StartPlaying()\n");

	if (!CanPlay())
	{
		FinishPlay();
		return 0;
	}

    PixelOverlayModel *model = PixelOverlayManager::INSTANCE.getModel(m_modelName);
    if (model == nullptr) {
        return 0;
    }

	if ((m_action == "Disabled") ||
		(m_action == "Enabled") ||
		(m_action == "Transparent") ||
        (m_action == "TransparentRGB")) {
        model->setState(m_action);
        return 1;
    } else if (m_action == "Value") {
        model->setValue(m_value, m_startChannel, m_endChannel);
        return 1;
    }
	return 0;
}
Exemplo n.º 2
0
int PlaylistEntryBrightness::StartPlaying(void)
{
	LogDebug(VB_PLAYLIST, "PlaylistEntryBrightness::StartPlaying()\n");

	if (!CanPlay())
	{
		FinishPlay();
		return 0;
	}

	player->SetBrightness(m_brightness);

	PlaylistEntryBase::StartPlaying();

	FinishPlay();

	return 1;
}
int PlaylistEntryPixelOverlay::Process(void)
{
	FinishPlay();

	return PlaylistEntryBase::Process();
}
Exemplo n.º 4
0
int PlaylistEntryBranch::StartPlaying(void)
{
	LogDebug(VB_PLAYLIST, "PlaylistEntryBranch::StartPlaying()\n");

	if (!CanPlay())
	{
		FinishPlay();
		return 0;
	}

	if (m_branchType == PE_BRANCH_TYPE_CLOCK_TIME)
	{
		time_t currTime = time(NULL);
		struct tm now;

		localtime_r(&currTime, &now);

		// FIXME PLAYLIST, how do we handle passing midnight???
		if ((m_hour <= now.tm_hour) &&
			(m_minute <= now.tm_min) &&
			(m_second <= now.tm_sec))
		{
			m_conditionTrue = 1;
		}
		else
		{
			m_conditionTrue = 0;
		}
LogDebug(VB_PLAYLIST, "Now: %02d:%02d:%02d, Test: %02d:%02d:%02d, Res: %d\n", now.tm_hour, now.tm_min, now.tm_sec, m_hour, m_minute, m_second, m_conditionTrue);
	}
	else if (m_branchType == PE_BRANCH_TYPE_PLAYLIST_TIME)
	{
		m_conditionTrue = 0;
	}
	else if (m_branchType == PE_BRANCH_TYPE_LOOP_COUNT)
	{
		m_conditionTrue = 0;
	}

	if ((m_conditionTrue) && (m_truePlaylist))
	{
		if (!m_truePlaylistName.empty())
		{
			if (!m_truePlaylist->Load(m_truePlaylistName.c_str()))
				return 0;
		}

		if (!m_truePlaylist->Start())
			return 0;
	}
	else if (m_falsePlaylist)
	{
		if (!m_falsePlaylistName.empty())
		{
			if (!m_falsePlaylist->Load(m_falsePlaylistName.c_str()))
				return 0;
		}

		if (!m_falsePlaylist->Start())
			return 0;
	}

	return PlaylistEntryBase::StartPlaying();
}