Bug #104 » XBMC4Xbox_AmbiLightPatch4.patch
skin/Project Mayhem III/PAL/Home.xml (working copy) | ||
---|---|---|
<onright>96</onright>
|
||
<onup>9</onup>
|
||
<ondown>5</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#FF0000)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>30</textoffsetx>
|
||
... | ... | |
<onright>96</onright>
|
||
<onup>2</onup>
|
||
<ondown>3</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#00FF00)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>30</textoffsetx>
|
||
... | ... | |
<onright>96</onright>
|
||
<onup>5</onup>
|
||
<ondown>4</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#FFFFFF,#000000,#000000,#000000,firework,500)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>30</textoffsetx>
|
||
... | ... | |
<onright>96</onright>
|
||
<onup>3</onup>
|
||
<ondown>7</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#FF00FF)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>30</textoffsetx>
|
||
... | ... | |
<onright>96</onright>
|
||
<onup>4</onup>
|
||
<ondown>9</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#FFFF00)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>30</textoffsetx>
|
||
... | ... | |
<onright>6</onright>
|
||
<onup>10</onup>
|
||
<ondown>5</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#00FFFF)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>20</textoffsetx>
|
||
... | ... | |
<onright>96</onright>
|
||
<onup>10</onup>
|
||
<ondown>5</ondown>
|
||
<onfocus>XBMC.System.PWMControl(#FFFFFF)</onfocus>
|
||
<texturefocus>home-focus.gif</texturefocus>
|
||
<texturenofocus>-</texturenofocus>
|
||
<textoffsetx>20</textoffsetx>
|
userdata/AdvancedSettings.xml (revision 0) | ||
---|---|---|
<advancedsettings>
|
||
<ambilight>
|
||
<enabled>true</enabled>
|
||
<spaceBetweenPixels>30</spaceBetweenPixels>
|
||
<FloatingAverageFrames>1</FloatingAverageFrames>
|
||
<GammaR>1.2</GammaR>
|
||
<GammaG>1.0</GammaG>
|
||
<GammaB>0.8</GammaB>
|
||
<MinRGB>2</MinRGB>
|
||
<FilterThreshold>50</FilterThreshold>
|
||
<DarknessLimit>20</DarknessLimit>
|
||
</ambilight>
|
||
</advancedsettings>
|
xbmc/AdvancedSettings.cpp (working copy) | ||
---|---|---|
m_bAutoFatxLimit = true;
|
||
m_bgInfoLoaderMaxThreads = 1;
|
||
m_ambiLight = false;
|
||
m_ambiLightSpaceBetweenPixels = 30;
|
||
m_ambiLightFloatingAverageFrames = 1;
|
||
m_ambiLightMinRGB = 2;
|
||
m_ambiLightMaxRGB = 255;
|
||
m_ambiLightMode = "linear";
|
||
m_ambiLightPosition = "all";
|
||
m_ambiLightGammaR = 1.2f;
|
||
m_ambiLightGammaG = 1.0f;
|
||
m_ambiLightGammaB = 0.8f;
|
||
m_ambiLightIntensityR = 1.0f;
|
||
m_ambiLightIntensityG = 1.0f;
|
||
m_ambiLightIntensityB = 1.0f;
|
||
m_ambiLightFilterThreshold = 50;
|
||
m_ambiLightDarknessLimit = 20;
|
||
}
|
||
bool CAdvancedSettings::Load()
|
||
... | ... | |
XMLUtils::GetBoolean(pElement, "verbose", m_bPythonVerbose);
|
||
}
|
||
pElement = pRootElement->FirstChildElement("ambilight");
|
||
if (pElement)
|
||
{
|
||
XMLUtils::GetBoolean(pElement, "enabled", m_ambiLight);
|
||
XMLUtils::GetInt(pElement, "spaceBetweenPixels", m_ambiLightSpaceBetweenPixels);
|
||
XMLUtils::GetInt(pElement, "floatingAverageFrames", m_ambiLightFloatingAverageFrames);
|
||
XMLUtils::GetInt(pElement, "minRGB", m_ambiLightMinRGB);
|
||
XMLUtils::GetInt(pElement, "maxRGB", m_ambiLightMaxRGB);
|
||
XMLUtils::GetString(pElement, "mode", m_ambiLightMode);
|
||
XMLUtils::GetString(pElement, "position", m_ambiLightPosition);
|
||
XMLUtils::GetFloat(pElement, "gammaR", m_ambiLightGammaR);
|
||
XMLUtils::GetFloat(pElement, "gammaG", m_ambiLightGammaG);
|
||
XMLUtils::GetFloat(pElement, "gammaB", m_ambiLightGammaB);
|
||
XMLUtils::GetFloat(pElement, "intensityR", m_ambiLightIntensityR);
|
||
XMLUtils::GetFloat(pElement, "intensityG", m_ambiLightIntensityG);
|
||
XMLUtils::GetFloat(pElement, "intensityB", m_ambiLightIntensityB);
|
||
XMLUtils::GetInt(pElement, "filterThreshold", m_ambiLightFilterThreshold);
|
||
XMLUtils::GetInt(pElement, "darknessLimit", m_ambiLightDarknessLimit);
|
||
}
|
||
XMLUtils::GetBoolean(pRootElement, "autofatxlimit", m_bAutoFatxLimit);
|
||
XMLUtils::GetString(pRootElement, "cddbaddress", m_cddbAddress);
|
xbmc/AdvancedSettings.h (working copy) | ||
---|---|---|
class CAdvancedSettings
|
||
{
|
||
public:
|
||
CAdvancedSettings();
|
||
public:
|
||
CAdvancedSettings();
|
||
bool Load();
|
||
void Clear();
|
||
bool Load();
|
||
void Clear();
|
||
static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
|
||
static void GetCustomRegexps(TiXmlElement *pRootElement, CStdStringArray& settings);
|
||
static void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
|
||
static void GetCustomExtensions(TiXmlElement *pRootElement, CStdString& extensions);
|
||
static void GetCustomTVRegexps(TiXmlElement *pRootElement, SETTINGS_TVSHOWLIST& settings);
|
||
static void GetCustomRegexps(TiXmlElement *pRootElement, CStdStringArray& settings);
|
||
static void GetCustomRegexpReplacers(TiXmlElement *pRootElement, CStdStringArray& settings);
|
||
static void GetCustomExtensions(TiXmlElement *pRootElement, CStdString& extensions);
|
||
// multipath testing
|
||
// multipath testing
|
||
bool m_useMultipaths;
|
||
bool m_DisableModChipDetection;
|
||
// multipath testing
|
||
// multipath testing
|
||
bool m_useMultipaths;
|
||
bool m_DisableModChipDetection;
|
||
int m_audioHeadRoom;
|
||
float m_karaokeSyncDelay;
|
||
float m_ac3Gain;
|
||
float m_audioPlayCountMinimumPercent;
|
||
int m_audioHeadRoom;
|
||
float m_karaokeSyncDelay;
|
||
float m_ac3Gain;
|
||
float m_audioPlayCountMinimumPercent;
|
||
float m_videoSubsDelayRange;
|
||
float m_videoAudioDelayRange;
|
||
int m_videoSmallStepBackSeconds;
|
||
int m_videoSmallStepBackTries;
|
||
int m_videoSmallStepBackDelay;
|
||
bool m_videoUseTimeSeeking;
|
||
int m_videoTimeSeekForward;
|
||
int m_videoTimeSeekBackward;
|
||
int m_videoTimeSeekForwardBig;
|
||
int m_videoTimeSeekBackwardBig;
|
||
int m_videoPercentSeekForward;
|
||
int m_videoPercentSeekBackward;
|
||
int m_videoPercentSeekForwardBig;
|
||
int m_videoPercentSeekBackwardBig;
|
||
CStdString m_videoPPFFmpegDeint;
|
||
CStdString m_videoPPFFmpegPostProc;
|
||
float m_videoSubsDelayRange;
|
||
float m_videoAudioDelayRange;
|
||
int m_videoSmallStepBackSeconds;
|
||
int m_videoSmallStepBackTries;
|
||
int m_videoSmallStepBackDelay;
|
||
bool m_videoUseTimeSeeking;
|
||
int m_videoTimeSeekForward;
|
||
int m_videoTimeSeekBackward;
|
||
int m_videoTimeSeekForwardBig;
|
||
int m_videoTimeSeekBackwardBig;
|
||
int m_videoPercentSeekForward;
|
||
int m_videoPercentSeekBackward;
|
||
int m_videoPercentSeekForwardBig;
|
||
int m_videoPercentSeekBackwardBig;
|
||
CStdString m_videoPPFFmpegDeint;
|
||
CStdString m_videoPPFFmpegPostProc;
|
||
bool m_musicUseTimeSeeking;
|
||
int m_musicTimeSeekForward;
|
||
int m_musicTimeSeekBackward;
|
||
int m_musicTimeSeekForwardBig;
|
||
int m_musicTimeSeekBackwardBig;
|
||
int m_musicPercentSeekForward;
|
||
int m_musicPercentSeekBackward;
|
||
int m_musicPercentSeekForwardBig;
|
||
int m_musicPercentSeekBackwardBig;
|
||
int m_musicResample;
|
||
int m_videoBlackBarColour;
|
||
int m_videoIgnoreAtStart;
|
||
int m_videoIgnoreAtEnd;
|
||
bool m_audioApplyDrc;
|
||
bool m_musicUseTimeSeeking;
|
||
int m_musicTimeSeekForward;
|
||
int m_musicTimeSeekBackward;
|
||
int m_musicTimeSeekForwardBig;
|
||
int m_musicTimeSeekBackwardBig;
|
||
int m_musicPercentSeekForward;
|
||
int m_musicPercentSeekBackward;
|
||
int m_musicPercentSeekForwardBig;
|
||
int m_musicPercentSeekBackwardBig;
|
||
int m_musicResample;
|
||
int m_videoBlackBarColour;
|
||
int m_videoIgnoreAtStart;
|
||
int m_videoIgnoreAtEnd;
|
||
bool m_audioApplyDrc;
|
||
float m_videoPlayCountMinimumPercent;
|
||
float m_videoPlayCountMinimumPercent;
|
||
int m_cacheMemBufferSize;
|
||
int m_cacheMemBufferSize;
|
||
float m_slideshowBlackBarCompensation;
|
||
float m_slideshowZoomAmount;
|
||
float m_slideshowPanAmount;
|
||
float m_slideshowBlackBarCompensation;
|
||
float m_slideshowZoomAmount;
|
||
float m_slideshowPanAmount;
|
||
int m_lcdRows;
|
||
int m_lcdColumns;
|
||
int m_lcdAddress1;
|
||
int m_lcdAddress2;
|
||
int m_lcdAddress3;
|
||
int m_lcdAddress4;
|
||
int m_lcdRows;
|
||
int m_lcdColumns;
|
||
int m_lcdAddress1;
|
||
int m_lcdAddress2;
|
||
int m_lcdAddress3;
|
||
int m_lcdAddress4;
|
||
int m_autoDetectPingTime;
|
||
int m_autoDetectPingTime;
|
||
int m_songInfoDuration;
|
||
int m_busyDialogDelay;
|
||
int m_logLevel;
|
||
CStdString m_cddbAddress;
|
||
bool m_usePCDVDROM;
|
||
bool m_fullScreenOnMovieStart;
|
||
bool m_noDVDROM;
|
||
CStdString m_cachePath;
|
||
bool m_displayRemoteCodes;
|
||
CStdString m_videoCleanDateTimeRegExp;
|
||
CStdStringArray m_videoCleanStringRegExps;
|
||
CStdStringArray m_videoExcludeFromListingRegExps;
|
||
CStdStringArray m_moviesExcludeFromScanRegExps;
|
||
CStdStringArray m_tvshowExcludeFromScanRegExps;
|
||
CStdStringArray m_audioExcludeFromListingRegExps;
|
||
CStdStringArray m_audioExcludeFromScanRegExps;
|
||
CStdStringArray m_pictureExcludeFromListingRegExps;
|
||
CStdStringArray m_videoStackRegExps;
|
||
CStdStringArray m_trailerMatchRegExps;
|
||
SETTINGS_TVSHOWLIST m_tvshowStackRegExps;
|
||
CStdString m_tvshowMultiPartStackRegExp;
|
||
CStdStringArray m_pathSubstitutions;
|
||
int m_remoteRepeat;
|
||
float m_controllerDeadzone;
|
||
bool m_FTPShowCache;
|
||
int m_songInfoDuration;
|
||
int m_busyDialogDelay;
|
||
int m_logLevel;
|
||
CStdString m_cddbAddress;
|
||
bool m_usePCDVDROM;
|
||
bool m_fullScreenOnMovieStart;
|
||
bool m_noDVDROM;
|
||
CStdString m_cachePath;
|
||
bool m_displayRemoteCodes;
|
||
CStdString m_videoCleanDateTimeRegExp;
|
||
CStdStringArray m_videoCleanStringRegExps;
|
||
CStdStringArray m_videoExcludeFromListingRegExps;
|
||
CStdStringArray m_moviesExcludeFromScanRegExps;
|
||
CStdStringArray m_tvshowExcludeFromScanRegExps;
|
||
CStdStringArray m_audioExcludeFromListingRegExps;
|
||
CStdStringArray m_audioExcludeFromScanRegExps;
|
||
CStdStringArray m_pictureExcludeFromListingRegExps;
|
||
CStdStringArray m_videoStackRegExps;
|
||
CStdStringArray m_trailerMatchRegExps;
|
||
SETTINGS_TVSHOWLIST m_tvshowStackRegExps;
|
||
CStdString m_tvshowMultiPartStackRegExp;
|
||
CStdStringArray m_pathSubstitutions;
|
||
int m_remoteRepeat;
|
||
float m_controllerDeadzone;
|
||
bool m_FTPShowCache;
|
||
bool m_playlistAsFolders;
|
||
bool m_detectAsUdf;
|
||
bool m_playlistAsFolders;
|
||
bool m_detectAsUdf;
|
||
int m_thumbSize;
|
||
int m_fanartHeight;
|
||
int m_thumbSize;
|
||
int m_fanartHeight;
|
||
int m_sambaclienttimeout;
|
||
CStdString m_sambadoscodepage;
|
||
bool m_sambastatfiles;
|
||
|
||
bool m_bHTTPDirectoryStatFilesize;
|
||
int m_sambaclienttimeout;
|
||
CStdString m_sambadoscodepage;
|
||
bool m_sambastatfiles;
|
||
bool m_bFTPThumbs;
|
||
bool m_bHTTPDirectoryStatFilesize;
|
||
CStdString m_musicThumbs;
|
||
CStdString m_dvdThumbs;
|
||
CStdString m_fanartImages;
|
||
bool m_bFTPThumbs;
|
||
bool m_bMusicLibraryHideAllItems;
|
||
int m_iMusicLibraryRecentlyAddedItems;
|
||
bool m_bMusicLibraryAllItemsOnBottom;
|
||
bool m_bMusicLibraryAlbumsSortByArtistThenYear;
|
||
CStdString m_strMusicLibraryAlbumFormat;
|
||
CStdString m_strMusicLibraryAlbumFormatRight;
|
||
bool m_prioritiseAPEv2tags;
|
||
CStdString m_musicItemSeparator;
|
||
CStdString m_videoItemSeparator;
|
||
std::vector<CStdString> m_musicTagsFromFileFilters;
|
||
CStdString m_musicThumbs;
|
||
CStdString m_dvdThumbs;
|
||
CStdString m_fanartImages;
|
||
bool m_bVideoLibraryHideAllItems;
|
||
bool m_bVideoLibraryAllItemsOnBottom;
|
||
int m_iVideoLibraryRecentlyAddedItems;
|
||
bool m_bVideoLibraryHideRecentlyAddedItems;
|
||
bool m_bVideoLibraryHideEmptySeries;
|
||
bool m_bVideoLibraryCleanOnUpdate;
|
||
bool m_bVideoLibraryExportAutoThumbs;
|
||
bool m_bVideoLibraryMyMoviesCategoriesToGenres;
|
||
bool m_bVideoLibraryImportWatchedState;
|
||
bool m_bMusicLibraryHideAllItems;
|
||
int m_iMusicLibraryRecentlyAddedItems;
|
||
bool m_bMusicLibraryAllItemsOnBottom;
|
||
bool m_bMusicLibraryAlbumsSortByArtistThenYear;
|
||
CStdString m_strMusicLibraryAlbumFormat;
|
||
CStdString m_strMusicLibraryAlbumFormatRight;
|
||
bool m_prioritiseAPEv2tags;
|
||
CStdString m_musicItemSeparator;
|
||
CStdString m_videoItemSeparator;
|
||
std::vector<CStdString> m_musicTagsFromFileFilters;
|
||
bool m_bVideoScannerIgnoreErrors;
|
||
bool m_bVideoLibraryHideAllItems;
|
||
bool m_bVideoLibraryAllItemsOnBottom;
|
||
int m_iVideoLibraryRecentlyAddedItems;
|
||
bool m_bVideoLibraryHideRecentlyAddedItems;
|
||
bool m_bVideoLibraryHideEmptySeries;
|
||
bool m_bVideoLibraryCleanOnUpdate;
|
||
bool m_bVideoLibraryExportAutoThumbs;
|
||
bool m_bVideoLibraryMyMoviesCategoriesToGenres;
|
||
bool m_bVideoLibraryImportWatchedState;
|
||
bool m_bUseEvilB;
|
||
std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
|
||
//TuxBox
|
||
int m_iTuxBoxStreamtsPort;
|
||
bool m_bTuxBoxSubMenuSelection;
|
||
int m_iTuxBoxDefaultSubMenu;
|
||
int m_iTuxBoxDefaultRootMenu;
|
||
bool m_bTuxBoxAudioChannelSelection;
|
||
bool m_bTuxBoxPictureIcon;
|
||
int m_iTuxBoxEpgRequestTime;
|
||
int m_iTuxBoxZapWaitTime;
|
||
bool m_bTuxBoxSendAllAPids;
|
||
bool m_bTuxBoxZapstream;
|
||
int m_iTuxBoxZapstreamPort;
|
||
bool m_bVideoScannerIgnoreErrors;
|
||
int m_iMythMovieLength; // minutes
|
||
bool m_bUseEvilB;
|
||
std::vector<CStdString> m_vecTokens; // cleaning strings tied to language
|
||
//TuxBox
|
||
int m_iTuxBoxStreamtsPort;
|
||
bool m_bTuxBoxSubMenuSelection;
|
||
int m_iTuxBoxDefaultSubMenu;
|
||
int m_iTuxBoxDefaultRootMenu;
|
||
bool m_bTuxBoxAudioChannelSelection;
|
||
bool m_bTuxBoxPictureIcon;
|
||
int m_iTuxBoxEpgRequestTime;
|
||
int m_iTuxBoxZapWaitTime;
|
||
bool m_bTuxBoxSendAllAPids;
|
||
bool m_bTuxBoxZapstream;
|
||
int m_iTuxBoxZapstreamPort;
|
||
// EDL Commercial Break
|
||
bool m_bEdlMergeShortCommBreaks;
|
||
int m_iEdlMaxCommBreakLength; // seconds
|
||
int m_iEdlMinCommBreakLength; // seconds
|
||
int m_iEdlMaxCommBreakGap; // seconds
|
||
int m_iEdlMaxStartGap; // seconds
|
||
int m_iEdlCommBreakAutowait; // seconds
|
||
int m_iEdlCommBreakAutowind; // seconds
|
||
int m_iMythMovieLength; // minutes
|
||
bool m_bFirstLoop;
|
||
int m_curlconnecttimeout;
|
||
int m_curllowspeedtime;
|
||
int m_curlretries;
|
||
// EDL Commercial Break
|
||
bool m_bEdlMergeShortCommBreaks;
|
||
int m_iEdlMaxCommBreakLength; // seconds
|
||
int m_iEdlMinCommBreakLength; // seconds
|
||
int m_iEdlMaxCommBreakGap; // seconds
|
||
int m_iEdlMaxStartGap; // seconds
|
||
int m_iEdlCommBreakAutowait; // seconds
|
||
int m_iEdlCommBreakAutowind; // seconds
|
||
int m_playlistRetries;
|
||
int m_playlistTimeout;
|
||
int m_iSkipLoopFilter;
|
||
bool m_bVirtualShares;
|
||
bool m_bNavVKeyboard; // if true we navigate the virtual keyboard using cursor keys
|
||
|
||
bool m_bPythonVerbose;
|
||
bool m_bAutoFatxLimit;
|
||
int m_bgInfoLoaderMaxThreads;
|
||
bool m_bFirstLoop;
|
||
int m_curlconnecttimeout;
|
||
int m_curllowspeedtime;
|
||
int m_curlretries;
|
||
int m_playlistRetries;
|
||
int m_playlistTimeout;
|
||
int m_iSkipLoopFilter;
|
||
bool m_bVirtualShares;
|
||
bool m_bNavVKeyboard; // if true we navigate the virtual keyboard using cursor keys
|
||
bool m_bPythonVerbose;
|
||
bool m_bAutoFatxLimit;
|
||
int m_bgInfoLoaderMaxThreads;
|
||
bool m_ambiLight;
|
||
int m_ambiLightSpaceBetweenPixels;
|
||
int m_ambiLightFloatingAverageFrames;
|
||
int m_ambiLightMinRGB;
|
||
int m_ambiLightMaxRGB;
|
||
CStdString m_ambiLightMode;
|
||
CStdString m_ambiLightPosition;
|
||
float m_ambiLightGammaR;
|
||
float m_ambiLightGammaG;
|
||
float m_ambiLightGammaB;
|
||
float m_ambiLightIntensityR;
|
||
float m_ambiLightIntensityG;
|
||
float m_ambiLightIntensityB;
|
||
int m_ambiLightFilterThreshold;
|
||
int m_ambiLightDarknessLimit;
|
||
};
|
||
extern CAdvancedSettings g_advancedSettings;
|
xbmc/Application.cpp (working copy) | ||
---|---|---|
}
|
||
UpdateLCD();
|
||
g_iledSmartxxrgb.AmbiLightUpdateFrameNumber();
|
||
// read raw input from controller, remote control, mouse and keyboard
|
||
ReadInput();
|
xbmc/cores/dvdplayer/DVDPlayerVideo.cpp (working copy) | ||
---|---|---|
* http://www.gnu.org/copyleft/gpl.html
|
||
*
|
||
*/
|
||
|
||
#include "stdafx.h"
|
||
#include "AdvancedSettings.h"
|
||
#include "GUISettings.h"
|
||
... | ... | |
#include "DVDCodecs/Overlay/DVDOverlaySSA.h"
|
||
#include <sstream>
|
||
#include <iomanip>
|
||
#include "utils/LED.h"
|
||
using namespace std;
|
||
CDVDPlayerVideo::CDVDPlayerVideo( CDVDClock* pClock
|
||
, CDVDOverlayContainer* pOverlayContainer
|
||
, CDVDMessageQueue& parent)
|
||
: CThread()
|
||
, m_messageQueue("video")
|
||
, m_messageParent(parent)
|
||
, CDVDOverlayContainer* pOverlayContainer
|
||
, CDVDMessageQueue& parent)
|
||
: CThread()
|
||
, m_messageQueue("video")
|
||
, m_messageParent(parent)
|
||
{
|
||
m_pClock = pClock;
|
||
m_pOverlayContainer = pOverlayContainer;
|
||
... | ... | |
{
|
||
StopThread();
|
||
g_dvdPerformanceCounter.DisableVideoQueue();
|
||
|
||
#ifdef HAS_VIDEO_PLAYBACK
|
||
if(m_output.inited)
|
||
{
|
||
... | ... | |
double CDVDPlayerVideo::GetOutputDelay()
|
||
{
|
||
double time = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET);
|
||
if( m_fFrameRate )
|
||
time = (time * DVD_TIME_BASE) / m_fFrameRate;
|
||
else
|
||
time = 0.0;
|
||
double time = m_messageQueue.GetPacketCount(CDVDMsg::DEMUXER_PACKET);
|
||
if( m_fFrameRate )
|
||
time = (time * DVD_TIME_BASE) / m_fFrameRate;
|
||
else
|
||
time = 0.0;
|
||
if( m_speed != 0 )
|
||
time = time * DVD_PLAYSPEED_NORMAL / abs(m_speed);
|
||
if( m_speed != 0 )
|
||
time = time * DVD_PLAYSPEED_NORMAL / abs(m_speed);
|
||
return time;
|
||
return time;
|
||
}
|
||
bool CDVDPlayerVideo::OpenStream( CDVDStreamInfo &hint )
|
||
... | ... | |
{
|
||
CThread::SetName("CDVDPlayerVideo");
|
||
m_iDroppedFrames = 0;
|
||
|
||
m_iCurrentPts = DVD_NOPTS_VALUE;
|
||
m_FlipTimeStamp = m_pClock->GetAbsoluteClock();
|
||
... | ... | |
bRequestDrop = false;
|
||
#else
|
||
if (m_messageQueue.GetDataSize() == 0
|
||
|| m_iNrOfPicturesNotToSkip > 0
|
||
|| m_speed < 0)
|
||
|| m_iNrOfPicturesNotToSkip > 0
|
||
|| m_speed < 0)
|
||
{
|
||
bRequestDrop = false;
|
||
m_iDroppedRequest = 0;
|
||
... | ... | |
memset(&picture, 0, sizeof(DVDVideoPicture));
|
||
if (m_pVideoCodec->GetPicture(&picture))
|
||
{
|
||
// AMBI-LIGHT STUFF
|
||
if(g_advancedSettings.m_ambiLight)
|
||
{
|
||
g_iledSmartxxrgb.AmbiLightUpdate();
|
||
g_iledSmartxxrgb.AmbiLightParamsUpdate(0,picture.iWidth,2);
|
||
for(unsigned int i=0;i<picture.iHeight;i++)
|
||
{
|
||
BYTE *s0=&picture.data[0][i*picture.iWidth];
|
||
BYTE *s1=&picture.data[1][i/2*picture.iWidth/2];
|
||
BYTE *s2=&picture.data[2][i/2*picture.iWidth/2];
|
||
g_iledSmartxxrgb.AmbiLightRGBCalculate(s0,s1,s2);
|
||
}
|
||
}
|
||
// END AMBI-LIGHT STUFF
|
||
sPostProcessType.clear();
|
||
picture.iGroupId = pPacket->iGroupId;
|
||
... | ... | |
m_pOverlayCodecCC = NULL;
|
||
}
|
||
//g_iledSmartxxrgb.AmbiLightStop();
|
||
CLog::Log(LOGNOTICE, "thread end: video_thread");
|
||
}
|
||
... | ... | |
bool bHasSpecialOverlay = m_pOverlayContainer->ContainsOverlayType(DVDOVERLAY_TYPE_SPU)
|
||
|| m_pOverlayContainer->ContainsOverlayType(DVDOVERLAY_TYPE_IMAGE)
|
||
|| m_pOverlayContainer->ContainsOverlayType(DVDOVERLAY_TYPE_SSA);
|
||
|
||
if (bHasSpecialOverlay)
|
||
{
|
||
if (m_pTempOverlayPicture && (m_pTempOverlayPicture->iWidth != pSource->iWidth || m_pTempOverlayPicture->iHeight != pSource->iHeight))
|
||
... | ... | |
CDVDCodecUtils::FreePicture(m_pTempOverlayPicture);
|
||
m_pTempOverlayPicture = NULL;
|
||
}
|
||
|
||
if (!m_pTempOverlayPicture) m_pTempOverlayPicture = CDVDCodecUtils::AllocatePicture(pSource->iWidth, pSource->iHeight);
|
||
}
|
||
... | ... | |
CDVDCodecUtils::CopyPicture(m_pTempOverlayPicture, pSource);
|
||
else
|
||
CDVDCodecUtils::CopyPicture(pDest, pSource);
|
||
|
||
m_pOverlayContainer->Lock();
|
||
VecOverlays* pVecOverlays = m_pOverlayContainer->GetOverlays();
|
||
... | ... | |
}
|
||
m_pOverlayContainer->Unlock();
|
||
|
||
if (bHasSpecialOverlay && m_pTempOverlayPicture)
|
||
CDVDCodecUtils::CopyPicture(pDest, m_pTempOverlayPicture);
|
||
}
|
||
... | ... | |
#ifdef HAS_VIDEO_PLAYBACK
|
||
/* check so that our format or aspect has changed. if it has, reconfigure renderer */
|
||
if (!g_renderManager.IsConfigured()
|
||
|| m_output.width != pPicture->iWidth
|
||
|| m_output.height != pPicture->iHeight
|
||
|| m_output.dwidth != pPicture->iDisplayWidth
|
||
|| m_output.dheight != pPicture->iDisplayHeight
|
||
|| m_output.framerate != m_fFrameRate
|
||
|| ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified
|
||
|| m_output.color_range != pPicture->color_range)
|
||
|| m_output.width != pPicture->iWidth
|
||
|| m_output.height != pPicture->iHeight
|
||
|| m_output.dwidth != pPicture->iDisplayWidth
|
||
|| m_output.dheight != pPicture->iDisplayHeight
|
||
|| m_output.framerate != m_fFrameRate
|
||
|| ( m_output.color_matrix != pPicture->color_matrix && pPicture->color_matrix != 0 ) // don't reconfigure on unspecified
|
||
|| m_output.color_range != pPicture->color_range)
|
||
{
|
||
CLog::Log(LOGNOTICE, " fps: %f, pwidth: %i, pheight: %i, dwidth: %i, dheight: %i",
|
||
m_fFrameRate, pPicture->iWidth, pPicture->iHeight, pPicture->iDisplayWidth, pPicture->iDisplayHeight);
|
||
... | ... | |
switch(pPicture->color_matrix)
|
||
{
|
||
case 7: // SMPTE 240M (1987)
|
||
flags |= CONF_FLAGS_YUVCOEF_240M;
|
||
break;
|
||
case 6: // SMPTE 170M
|
||
case 5: // ITU-R BT.470-2
|
||
case 4: // FCC
|
||
flags |= CONF_FLAGS_YUVCOEF_BT601;
|
||
break;
|
||
case 3: // RESERVED
|
||
case 2: // UNSPECIFIED
|
||
case 1: // ITU-R Rec.709 (1990) -- BT.709
|
||
default:
|
||
flags |= CONF_FLAGS_YUVCOEF_BT709;
|
||
case 7: // SMPTE 240M (1987)
|
||
flags |= CONF_FLAGS_YUVCOEF_240M;
|
||
break;
|
||
case 6: // SMPTE 170M
|
||
case 5: // ITU-R BT.470-2
|
||
case 4: // FCC
|
||
flags |= CONF_FLAGS_YUVCOEF_BT601;
|
||
break;
|
||
case 3: // RESERVED
|
||
case 2: // UNSPECIFIED
|
||
case 1: // ITU-R Rec.709 (1990) -- BT.709
|
||
default:
|
||
flags |= CONF_FLAGS_YUVCOEF_BT709;
|
||
}
|
||
if(m_bAllowFullscreen)
|
||
... | ... | |
// calculate the time we need to delay this picture before displaying
|
||
double iSleepTime, iClockSleep, iFrameSleep, iCurrentClock, iFrameDuration;
|
||
|
||
iCurrentClock = m_pClock->GetAbsoluteClock(); // snapshot current clock
|
||
iClockSleep = pts - m_pClock->GetClock(); //sleep calculated by pts to clock comparison
|
||
iFrameSleep = m_FlipTimeStamp - iCurrentClock; // sleep calculated by duration of frame
|
||
... | ... | |
if( m_speed < 0 )
|
||
{
|
||
if( iClockSleep < -DVD_MSEC_TO_TIME(200)
|
||
&& !(pPicture->iFlags & DVP_FLAG_NOSKIP) )
|
||
&& !(pPicture->iFlags & DVP_FLAG_NOSKIP) )
|
||
return result | EOS_DROPPED;
|
||
}
|
||
... | ... | |
// video device might not be done yet
|
||
while (index < 0 && !CThread::m_bStop &&
|
||
CDVDClock::GetAbsoluteClock() < iCurrentClock + iSleepTime )
|
||
CDVDClock::GetAbsoluteClock() < iCurrentClock + iSleepTime )
|
||
{
|
||
Sleep(1);
|
||
index = g_renderManager.GetImage(&image);
|
xbmc/cores/VideoRenderers/XBoxRenderer.cpp (working copy) | ||
---|---|---|
#include "Application.h"
|
||
#include "XBVideoConfig.h"
|
||
#include "Settings.h"
|
||
#include "utils/LED.h"
|
||
// http://www.martinreddy.net/gfx/faqs/colorconv.faq
|
||
... | ... | |
xscale = 1.0f;
|
||
yscale = 1.0f;
|
||
}
|
||
|
||
// horizontal centering, and align to bottom of subtitles line
|
||
osdRect.left = (float)rv.left + (float)(rv.right - rv.left - (float)w * xscale) / 2.0f;
|
||
osdRect.right = osdRect.left + (float)w * xscale;
|
||
... | ... | |
if (
|
||
D3D_OK != m_pD3DDevice->CreateTexture(m_iOSDTextureWidth, m_iOSDTextureHeight[iOSDBuffer], 1, 0, D3DFMT_LIN_L8, 0, &m_pOSDYTexture[iOSDBuffer]) ||
|
||
D3D_OK != m_pD3DDevice->CreateTexture(m_iOSDTextureWidth, m_iOSDTextureHeight[iOSDBuffer], 1, 0, D3DFMT_LIN_A8, 0, &m_pOSDATexture[iOSDBuffer])
|
||
)
|
||
)
|
||
{
|
||
CLog::Log(LOGERROR, "Could not create OSD/Sub textures");
|
||
DeleteOSDTextures(iOSDBuffer);
|
||
... | ... | |
if (
|
||
(D3D_OK == m_pOSDYTexture[iOSDBuffer]->LockRect(0, &lr, &rc, 0)) &&
|
||
(D3D_OK == m_pOSDATexture[iOSDBuffer]->LockRect(0, &lra, &rc, 0))
|
||
)
|
||
)
|
||
{
|
||
//clear the textures
|
||
memset(lr.pBits, 0, lr.Pitch*m_iOSDTextureHeight[iOSDBuffer]);
|
||
... | ... | |
//m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA );
|
||
//m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA );
|
||
// Note the mplayer code actually does this
|
||
// Note the mplayer code actually does this
|
||
//m_pD3DDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
|
||
//m_pD3DDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA );
|
||
}
|
||
... | ... | |
DeleteYV12Texture(i);
|
||
}
|
||
if(m_iYV12RenderBuffer > i)
|
||
m_iYV12RenderBuffer = i;
|
||
m_iYV12RenderBuffer = i;
|
||
m_NumYV12Buffers = i+1;
|
||
}
|
||
}
|
||
... | ... | |
// If the TV has no HD support widescreen mode is chossen according to video AR
|
||
if (g_videoConfig.Has1080i()) // Widescreen TV with 1080i res
|
||
m_iResolution = HDTV_1080i;
|
||
m_iResolution = HDTV_1080i;
|
||
else if (g_videoConfig.Has720p()) // Widescreen TV with 720p res
|
||
m_iResolution = HDTV_720p;
|
||
m_iResolution = HDTV_720p;
|
||
else if (g_videoConfig.Has480p()) // Widescreen TV with 480p
|
||
{
|
||
if (bWideScreenMode) // Choose widescreen mode according to video AR
|
||
m_iResolution = HDTV_480p_16x9;
|
||
else
|
||
m_iResolution = HDTV_480p_4x3;
|
||
}
|
||
}
|
||
else if (bWideScreenMode) // Standard 16:9 TV set with no HD
|
||
m_iResolution = NTSC_16x9;
|
||
else
|
||
... | ... | |
// We choose 16:9 resolution only for 16:9 video sources
|
||
if (m_fSourceFrameRatio >= 16.0f / 9.0f)
|
||
{
|
||
{
|
||
// The video fits best into widescreen modes so they are
|
||
// the first choices
|
||
if (g_videoConfig.Has1080i())
|
||
... | ... | |
m_fps = fps;
|
||
m_iFlags = flags;
|
||
m_bConfigured = true;
|
||
|
||
// setup what colorspace we live in
|
||
if(flags & CONF_FLAGS_YUV_FULLRANGE)
|
||
m_yuvrange = yuv_range_full;
|
||
... | ... | |
switch(CONF_FLAGS_YUVCOEF_MASK(flags))
|
||
{
|
||
case CONF_FLAGS_YUVCOEF_240M:
|
||
m_yuvcoef = yuv_coef_smtp240m; break;
|
||
case CONF_FLAGS_YUVCOEF_BT709:
|
||
m_yuvcoef = yuv_coef_bt709; break;
|
||
case CONF_FLAGS_YUVCOEF_BT601:
|
||
m_yuvcoef = yuv_coef_bt601; break;
|
||
case CONF_FLAGS_YUVCOEF_EBU:
|
||
m_yuvcoef = yuv_coef_ebu; break;
|
||
default:
|
||
m_yuvcoef = yuv_coef_bt601; break;
|
||
case CONF_FLAGS_YUVCOEF_240M:
|
||
m_yuvcoef = yuv_coef_smtp240m; break;
|
||
case CONF_FLAGS_YUVCOEF_BT709:
|
||
m_yuvcoef = yuv_coef_bt709; break;
|
||
case CONF_FLAGS_YUVCOEF_BT601:
|
||
m_yuvcoef = yuv_coef_bt601; break;
|
||
case CONF_FLAGS_YUVCOEF_EBU:
|
||
m_yuvcoef = yuv_coef_ebu; break;
|
||
default:
|
||
m_yuvcoef = yuv_coef_bt601; break;
|
||
}
|
||
// init Params for AmbiLight
|
||
g_iledSmartxxrgb.AmbiLightParamsInit(width,height,m_yuvcoef,m_yuvrange);
|
||
// calculate the input frame aspect ratio
|
||
CalculateFrameAspectRatio(d_width, d_height);
|
||
ChooseBestResolution(m_fps);
|
||
... | ... | |
source = NextYV12Texture();
|
||
#ifdef MP_DIRECTRENDERING
|
||
if( source < 0 )
|
||
{ /* no free source existed, so create one */
|
||
CSingleLock lock(g_graphicsContext);
|
||
if( CreateYV12Texture(m_NumYV12Buffers) )
|
||
{
|
||
source = m_NumYV12Buffers;
|
||
m_NumYV12Buffers++;
|
||
m_image[source].flags |= IMAGE_FLAG_DYNAMIC;
|
||
}
|
||
if( source < 0 )
|
||
{ /* no free source existed, so create one */
|
||
CSingleLock lock(g_graphicsContext);
|
||
if( CreateYV12Texture(m_NumYV12Buffers) )
|
||
{
|
||
source = m_NumYV12Buffers;
|
||
m_NumYV12Buffers++;
|
||
m_image[source].flags |= IMAGE_FLAG_DYNAMIC;
|
||
}
|
||
}
|
||
#endif
|
||
if( source >= 0 && m_image[source].plane[0] )
|
||
... | ... | |
{
|
||
if( m_image[source].flags & IMAGE_FLAG_WRITING )
|
||
SetEvent(m_eventTexturesDone[source]);
|
||
|
||
m_image[source].flags &= ~IMAGE_FLAG_INUSE;
|
||
/* if image should be preserved reserve it so it's not auto seleceted */
|
||
... | ... | |
unsigned int CXBoxRenderer::DrawSlice(unsigned char *src[], int stride[], int w, int h, int x, int y)
|
||
{
|
||
BYTE *s;
|
||
BYTE *d;
|
||
int i, p;
|
||
BYTE *s0,*s1,*s2;
|
||
BYTE *d0,*d1,*d2;
|
||
int w2,h2,x2,y2;
|
||
// check if we've finished the recent Frame and push it to the SmartXX...
|
||
if(g_advancedSettings.m_ambiLight)
|
||
g_iledSmartxxrgb.AmbiLightUpdate();
|
||
int index = NextYV12Texture();
|
||
if( index < 0 )
|
||
return -1;
|
||
... | ... | |
CLog::Log(LOGWARNING, CStdString(__FUNCTION__) + " - Timeout waiting for texture %d", index);
|
||
YV12Image &im = m_image[index];
|
||
// copy Y
|
||
p = 0;
|
||
d = (BYTE*)im.plane[p] + im.stride[p] * y + x;
|
||
s = src[p];
|
||
for (i = 0;i < h;i++)
|
||
{
|
||
memcpy(d, s, w);
|
||
s += stride[p];
|
||
d += im.stride[p];
|
||
}
|
||
// Y
|
||
d0 = (BYTE*)im.plane[0] + im.stride[0] * y + x;
|
||
s0 = src[0];
|
||
w >>= im.cshift_x; h >>= im.cshift_y;
|
||
x >>= im.cshift_x; y >>= im.cshift_y;
|
||
w2 = w >> im.cshift_x; h2 = h >> im.cshift_y;
|
||
x2 = x >> im.cshift_x; y2 = y >> im.cshift_y;
|
||
// copy U
|
||
p = 1;
|
||
d = (BYTE*)im.plane[p] + im.stride[p] * y + x;
|
||
s = src[p];
|
||
for (i = 0;i < h;i++)
|
||
// U
|
||
d1 = (BYTE*)im.plane[1] + im.stride[1] * y2 + x2;
|
||
s1 = src[1];
|
||
// V
|
||
d2 = (BYTE*)im.plane[2] + im.stride[2] * y2 + x2;
|
||
s2 = src[2];
|
||
int widthRatio = (int)(w/w2);
|
||
int heightRatio = (int)(h/h2);
|
||
//Update AmbiLights params...
|
||
if(g_advancedSettings.m_ambiLight)
|
||
g_iledSmartxxrgb.AmbiLightParamsUpdate(x,w,widthRatio);
|
||
for (int i = 0;i < h;i++)
|
||
{
|
||
memcpy(d, s, w);
|
||
s += stride[p];
|
||
d += im.stride[p];
|
||
}
|
||
memcpy(d0, s0, w);
|
||
s0 += stride[0];
|
||
d0 += im.stride[0];
|
||
// copy V
|
||
p = 2;
|
||
d = (BYTE*)im.plane[p] + im.stride[p] * y + x;
|
||
s = src[p];
|
||
for (i = 0;i < h;i++)
|
||
{
|
||
memcpy(d, s, w);
|
||
s += stride[p];
|
||
d += im.stride[p];
|
||
if(i % heightRatio == 0)
|
||
{
|
||
memcpy(d1, s1, w2);
|
||
s1 += stride[1];
|
||
d1 += im.stride[1];
|
||
memcpy(d2, s2, w2);
|
||
s2 += stride[2];
|
||
d2 += im.stride[2];
|
||
}
|
||
// calculate RGB-values for the recent row of the frame...
|
||
if(g_advancedSettings.m_ambiLight)
|
||
g_iledSmartxxrgb.AmbiLightRGBCalculate(s0,s1,s2);
|
||
}
|
||
SetEvent(m_eventTexturesDone[index]);
|
||
... | ... | |
DeleteYV12Texture(i);
|
||
DeleteOSDTextures(i);
|
||
}
|
||
|
||
if (m_hLowMemShader)
|
||
{
|
||
m_pD3DDevice->DeletePixelShader(m_hLowMemShader);
|
||
m_hLowMemShader = 0;
|
||
}
|
||
g_iledSmartxxrgb.AmbiLightStop();
|
||
m_bConfigured = false;
|
||
}
|
||
... | ... | |
void CXBoxRenderer::DeleteYV12Texture(int index)
|
||
{
|
||
CSingleLock lock(g_graphicsContext);
|
||
|
||
YV12Image &im = m_image[index];
|
||
YUVFIELDS &fields = m_YUVTexture[index];
|
||
... | ... | |
im.plane[p] = NULL;
|
||
m_NumYV12Buffers = 0;
|
||
|
||
CLog::Log(LOGDEBUG, "Deleted YV12 texture %i", index);
|
||
}
|
||
... | ... | |
p = 0;
|
||
stride = im.stride[p];
|
||
im.plane[p] = (BYTE*)dwTextureSize;
|
||
XGSetTextureHeader(im.width , im.height>>1 , 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width , im.height>>1 , 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
XGSetTextureHeader(im.width , im.height>>1 , 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width , im.height>>1 , 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
dwTextureSize += XGSetTextureHeader(im.width , im.height , 1, 0, D3DFMT_LIN_L8, 0, fields[0][p], dwTextureSize, stride);
|
||
/* U */
|
||
p = 1;
|
||
stride = im.stride[p];
|
||
im.plane[p] = (BYTE*)dwTextureSize;
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
dwTextureSize += XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y, 1, 0, D3DFMT_LIN_L8, 0, fields[0][p], dwTextureSize, stride);
|
||
/* V */
|
||
p = 2;
|
||
stride = im.stride[p];
|
||
im.plane[p] = (BYTE*)dwTextureSize;
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[2][p], dwTextureSize + stride, stride<<1);
|
||
XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y>>1, 1, 0, D3DFMT_LIN_L8, 0, fields[1][p], dwTextureSize, stride<<1);
|
||
dwTextureSize += XGSetTextureHeader(im.width>>im.cshift_x, im.height>>im.cshift_y, 1, 0, D3DFMT_LIN_L8, 0, fields[0][p], dwTextureSize, stride);
|
||
BYTE* data = (BYTE*)XPhysicalAlloc(dwTextureSize, MAXULONG_PTR, D3DTEXTURE_ALIGNMENT, memflags);
|
xbmc/Util.cpp (working copy) | ||
---|---|---|
strWhiteB= arSplit[3].c_str();
|
||
strTran = arSplit[4].c_str();
|
||
iTrTime = atoi(arSplit[5].c_str());
|
||
CUtil::PWMControl(strRgbA,strRgbB,strWhiteA,strWhiteB,strTran, iTrTime);
|
||
}
|
||
else if(parameter.size() > 6)
|
||
else if(parameter.size() == 7)
|
||
{
|
||
strRgbA = strRgbB = parameter;
|
||
strWhiteA = strWhiteB = "#000000";
|
||
strTran = "none";
|
||
strTran = "fade2";
|
||
tRGBColor rgb;
|
||
sscanf(parameter,"#%2X%2X%2X",&rgb.r,&rgb.g,&rgb.b);
|
||
//CUtil::PWMControl(strRgbA,strRgbB,strWhiteA,strWhiteB,strTran, iTrTime);
|
||
g_iledSmartxxrgb.SetRGBState(rgb);
|
||
}
|
||
CUtil::PWMControl(strRgbA,strRgbB,strWhiteA,strWhiteB,strTran, iTrTime);
|
||
else
|
||
CLog::Log(LOGDEBUG,"System.PWMControl(): Invalid parameters - use: System.PWMControl(#rgb1,#rgb2,#white1,#white2,mode,time)");
|
||
}
|
||
else if (execute.Equals("backupsysteminfo"))
|
||
{
|
xbmc/utils/LED.cpp (working copy) | ||
---|---|---|
#include "xbox/XKUtils.h"
|
||
#include "LCD.h"
|
||
#include "GUISettings.h"
|
||
#include "Settings.h"
|
||
#include <conio.h>
|
||
// set accuracy of color calculation
|
||
#define h_MAX 255
|
||
#define s_MAX 255
|
||
#define v_MAX 255
|
||
#define POS_DIV(a, b) ( (a)/(b) + ( ((a)%(b) >= (b)/2 ) ? 1 : 0) )
|
||
#define WINDOW_SIZE 5
|
||
#define HUE_WINDOW 5
|
||
#define MIN_PERCENTAGE 0.01
|
||
#define FADE2_MAX_TIME 1000
|
||
#define SLOWLIMIT 12
|
||
#define SLOWTIMES 4
|
||
ILEDSmartxxRGB g_iledSmartxxrgb;
|
||
void ILED::CLEDControl(int ixLED)
|
||
... | ... | |
ILEDSmartxxRGB::ILEDSmartxxRGB()
|
||
{
|
||
strCurrentStatus = "NULL";
|
||
strLastStatus = "NULL";
|
||
|
||
strCurrentStatus = "NULL";
|
||
strLastStatus = "NULL";
|
||
s_RGBs.strTransition = "NULL";
|
||
s_CurRGB.red = 0;
|
||
s_CurRGB.green = 0;
|
||
s_CurRGB.blue = 0;
|
||
s_CurRGB.red = 0;
|
||
s_CurRGB.green = 0;
|
||
s_CurRGB.blue = 0;
|
||
s_CurRGB.white = 0;
|
||
|
||
dwLastTime = 0;
|
||
bRepeat = false;
|
||
isPaused = false;
|
||
AmbiLightParams.AmbiLightIsPlaying=false;
|
||
}
|
||
ILEDSmartxxRGB::~ILEDSmartxxRGB()
|
||
... | ... | |
{
|
||
if (g_sysinfo.SmartXXModCHIP().Equals("SmartXX V3") || g_sysinfo.SmartXXModCHIP().Equals("SmartXX OPX"))
|
||
{
|
||
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
|
||
CLog::Log(LOGDEBUG,"Starting SmartXX RGB LED thread");
|
||
//SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_LOWEST);
|
||
//SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST);
|
||
SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_HIGHEST);
|
||
CLog::Log(LOGDEBUG,"Starting SmartXX RGB LED thread");
|
||
SetRGBStatus("general");
|
||
}
|
||
}
|
||
void ILEDSmartxxRGB::Process()
|
||
{
|
||
while(!m_bStop)
|
||
{
|
||
dwFrameTime = timeGetTime() - dwLastTime;
|
||
while(!m_bStop)
|
||
{
|
||
if(!isPaused)
|
||
{
|
||
dwFrameTime = timeGetTime() - dwLastTime;
|
||
if( (s_RGBs.strTransition.IsEmpty() || s_RGBs.strTransition.Equals("none")) && !strLastTransition.Equals("none") )
|
||
{
|
||
strLastTransition = "none";
|
||
s_CurRGB.red = s_RGBs.red1;
|
||
s_CurRGB.green = s_RGBs.green1;
|
||
s_CurRGB.blue = s_RGBs.blue1;
|
||
s_CurRGB.white = s_RGBs.white1;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue, s_CurRGB.white);
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("switch") && !strLastTransition.Equals("switch"))
|
||
{
|
||
if(dwFrameTime >= s_RGBs.iTime )
|
||
{
|
||
s_CurRGB.red = s_RGBs.red2;
|
||
s_CurRGB.green = s_RGBs.green2;
|
||
s_CurRGB.blue = s_RGBs.blue2;
|
||
s_CurRGB.white = s_RGBs.white2;
|
||
strLastTransition = "switch";
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
else
|
||
if( (s_RGBs.strTransition.IsEmpty() || s_RGBs.strTransition.Equals("none")) && !strLastTransition.Equals("none") )
|
||
{
|
||
s_CurRGB.red = s_RGBs.red1;
|
||
s_CurRGB.green = s_RGBs.green1;
|
||
s_CurRGB.green = s_RGBs.green1;
|
||
s_CurRGB.blue = s_RGBs.blue1;
|
||
s_CurRGB.white = s_RGBs.white1;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue, s_CurRGB.white);
|
||
}
|
||
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("blink"))
|
||
{
|
||
strLastTransition = "blink";
|
||
if(dwFrameTime >= s_RGBs.iTime )
|
||
{
|
||
s_CurRGB.red = (s_CurRGB.red != s_RGBs.red1) ? s_RGBs.red1 : s_RGBs.red2;
|
||
s_CurRGB.green = (s_CurRGB.green != s_RGBs.green1) ? s_RGBs.green1 : s_RGBs.green2;
|
||
s_CurRGB.blue = (s_CurRGB.blue != s_RGBs.blue1) ? s_RGBs.blue1 : s_RGBs.blue2;
|
||
s_CurRGB.white= (s_CurRGB.white != s_RGBs.white1) ? s_RGBs.white1 : s_RGBs.white2;
|
||
dwLastTime = timeGetTime();
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("fade") || s_RGBs.strTransition.Equals("fadeloop") || s_RGBs.strTransition.Equals("faderepeat"))
|
||
{
|
||
else if(s_RGBs.strTransition.Equals("switch") && !strLastTransition.Equals("switch"))
|
||
{
|
||
if(dwFrameTime >= s_RGBs.iTime )
|
||
{
|
||
s_CurRGB.red = s_RGBs.red2;
|
||
s_CurRGB.green = s_RGBs.green2;
|
||
s_CurRGB.blue = s_RGBs.blue2;
|
||
s_CurRGB.white = s_RGBs.white2;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
else
|
||
{
|
||
s_CurRGB.red = s_RGBs.red1;
|
||
s_CurRGB.green = s_RGBs.green1;
|
||
s_CurRGB.blue = s_RGBs.blue1;
|
||
s_CurRGB.white = s_RGBs.white1;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("blink"))
|
||
{
|
||
strLastTransition = "blink";
|
||
if(dwFrameTime >= s_RGBs.iTime )
|
||
{
|
||
s_CurRGB.red = (s_CurRGB.red != s_RGBs.red1) ? s_RGBs.red1 : s_RGBs.red2;
|
||
s_CurRGB.green = (s_CurRGB.green != s_RGBs.green1) ? s_RGBs.green1 : s_RGBs.green2;
|
||
s_CurRGB.blue = (s_CurRGB.blue != s_RGBs.blue1) ? s_RGBs.blue1 : s_RGBs.blue2;
|
||
s_CurRGB.white= (s_CurRGB.white != s_RGBs.white1) ? s_RGBs.white1 : s_RGBs.white2;
|
||
dwLastTime = timeGetTime();
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("fade") || s_RGBs.strTransition.Equals("fadeloop") || s_RGBs.strTransition.Equals("faderepeat"))
|
||
{
|
||
static double distanceR,distanceG,distanceB,distanceW;
|
||
if(!strLastTransition.Equals("fade"))
|
||
{
|
||
distanceR = bRepeat ? s_RGBs.red1-s_RGBs.red2 : s_RGBs.red2-s_RGBs.red1;
|
||
distanceG = bRepeat ? s_RGBs.green1-s_RGBs.green2 : s_RGBs.green2-s_RGBs.green1;
|
||
distanceB = bRepeat ? s_RGBs.blue1-s_RGBs.blue2 : s_RGBs.blue2-s_RGBs.blue1;
|
||
distanceW = bRepeat ? s_RGBs.white1-s_RGBs.white2 : s_RGBs.white2-s_RGBs.white1;
|
||
strLastTransition = "fade";
|
||
if(s_RGBs.strTransition.Equals("faderepeat"))bRepeat=!bRepeat;
|
||
}
|
||
if(dwFrameTime <= s_RGBs.iTime )
|
||
{
|
||
double stepR=distanceR/s_RGBs.iTime*dwFrameTime;
|
||
double stepG=distanceG/s_RGBs.iTime*dwFrameTime;
|
||
double stepB=distanceB/s_RGBs.iTime*dwFrameTime;
|
||
double stepW=distanceW/s_RGBs.iTime*dwFrameTime;
|
||
s_CurRGB.red=(bRepeat ? s_RGBs.red1 : s_RGBs.red2) +(int)stepR;
|
||
s_CurRGB.green=(bRepeat ? s_RGBs.green1 : s_RGBs.green2)+(int)stepG;
|
||
s_CurRGB.blue=(bRepeat ? s_RGBs.blue1 : s_RGBs.blue2)+(int)stepB;
|
||
s_CurRGB.white=(bRepeat ? s_RGBs.white1 : s_RGBs.white2)+(int)stepW;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("fadeloop") || s_RGBs.strTransition.Equals("faderepeat"))
|
||
{
|
||
strLastTransition="none";
|
||
dwLastTime = timeGetTime();
|
||
}
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("fade2"))
|
||
{
|
||
static int distanceR,distanceG,distanceB,distanceW;
|
||
static int maxDiffR,maxDiffG,maxDiffB;
|
||
if(!strLastTransition.Equals("fade2"))
|
||
{
|
||
strLastTransition = "fade2";
|
||
dwFrameTime = 0;
|
||
dwLastTime = timeGetTime();
|
||
s_RGBs.red1 =s_CurRGB.red;
|
||
s_RGBs.green1 =s_CurRGB.green;
|
||
s_RGBs.blue1 =s_CurRGB.blue ;
|
||
distanceR = s_RGBs.red2-s_RGBs.red1;
|
||
distanceG = s_RGBs.green2-s_RGBs.green1;
|
||
distanceB = s_RGBs.blue2-s_RGBs.blue1;
|
||
distanceW = s_RGBs.white2-s_RGBs.white1;
|
||
/*maxDiffR=(int)((float)distanceR/FADE2_MAX_TIME*2);
|
||
maxDiffG=(int)((float)distanceG/FADE2_MAX_TIME*2);
|
||
maxDiffB=(int)((float)distanceB/FADE2_MAX_TIME*2);
|
||
if(maxDiffR==0)maxDiffR=1;
|
||
if(maxDiffG==0)maxDiffG=1;
|
||
if(maxDiffB==0)maxDiffB=1;*/
|
||
int max=abs(MAX(distanceR,distanceG,distanceB));
|
||
//max eine sekunde transition time
|
||
s_RGBs.iTime = int((max/255.0f)*FADE2_MAX_TIME);
|
||
}
|
||
if(dwFrameTime <= s_RGBs.iTime && (s_CurRGB.red!=s_RGBs.red2 || s_CurRGB.blue!=s_RGBs.blue2 || s_CurRGB.green!=s_RGBs.green2))
|
||
{
|
||
// how far do we need to be according to current time...
|
||
int stepR=(int)((double)distanceR/s_RGBs.iTime*dwFrameTime);
|
||
int stepG=(int)((double)distanceG/s_RGBs.iTime*dwFrameTime);
|
||
int stepB=(int)((double)distanceB/s_RGBs.iTime*dwFrameTime);
|
||
int stepW=(int)((double)distanceW/s_RGBs.iTime*dwFrameTime);
|
||
/*int diffR=abs(s_CurRGB.red-s_RGBs.red1+stepR);
|
||
int diffG=abs(s_CurRGB.green-s_RGBs.green1+stepG);
|
||
int diffB=abs(s_CurRGB.blue-s_RGBs.blue1+stepB);
|
||
if(diffR>maxDiffR)
|
||
stepR=s_CurRGB.red+maxDiffR-s_RGBs.red1;
|
||
if(diffG>maxDiffG)
|
||
stepG=s_CurRGB.green+maxDiffG-s_RGBs.green1;
|
||
if(diffB>maxDiffB)
|
||
stepB=s_CurRGB.blue+maxDiffB-s_RGBs.blue1;*/
|
||
s_CurRGB.red=s_RGBs.red1+stepR;
|
||
s_CurRGB.green=s_RGBs.green1+stepG;
|
||
s_CurRGB.blue=s_RGBs.blue1+stepB;
|
||
s_CurRGB.white=s_RGBs.white1+stepW;
|
||
/*if(s_CurRGB.red<=SLOWLIMIT)
|
||
{
|
||
static int counter=0;
|
||
if(counter==SLOWTIMES)
|
||
{
|
||
if(s_CurRGB.red<s_RGBs.red2) s_CurRGB.red++;
|
||
else if(s_CurRGB.red>s_RGBs.red2) s_CurRGB.red--;
|
||
counter=0;
|
||
}
|
||
counter++;
|
||
}
|
||
else
|
||
{
|
||
if(s_CurRGB.red<s_RGBs.red2) s_CurRGB.red++;
|
||
else if(s_CurRGB.red>s_RGBs.red2) s_CurRGB.red--;
|
||
}
|
||
if(s_CurRGB.blue<=SLOWLIMIT)
|
||
{
|
||
static int counter=0;
|
||
if(counter==SLOWTIMES)
|
||
{
|
||
if(s_CurRGB.blue<s_RGBs.blue2) s_CurRGB.blue++;
|
||
else if(s_CurRGB.blue>s_RGBs.blue2) s_CurRGB.blue--;
|
||
counter=0;
|
||
}
|
||
counter++;
|
||
}
|
||
else
|
||
{
|
||
if(s_CurRGB.blue<s_RGBs.blue2) s_CurRGB.blue++;
|
||
else if(s_CurRGB.blue>s_RGBs.blue2) s_CurRGB.blue--;
|
||
}
|
||
if(s_CurRGB.green<=SLOWLIMIT)
|
||
{
|
||
static int counter=0;
|
||
if(counter==SLOWTIMES)
|
||
{
|
||
if(s_CurRGB.green<s_RGBs.green2) s_CurRGB.green++;
|
||
else if(s_CurRGB.green>s_RGBs.green2) s_CurRGB.green--;
|
||
counter=0;
|
||
}
|
||
counter++;
|
||
}
|
||
else
|
||
{
|
||
if(s_CurRGB.green<s_RGBs.green2) s_CurRGB.green++;
|
||
else if(s_CurRGB.green>s_RGBs.green2) s_CurRGB.green--;
|
||
}*/
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
/*static int i=0,minR=255,minG=255,minB=255,maxR=0,maxG=0,maxB=0;
|
||
minR=s_CurRGB.red<minR?s_CurRGB.red:minR;
|
||
minG=s_CurRGB.green<minG?s_CurRGB.green:minG;
|
||
minB=s_CurRGB.blue<minB?s_CurRGB.blue:minB;
|
||
maxR=s_CurRGB.red>maxR?s_CurRGB.red:maxR;
|
||
maxG=s_CurRGB.green>maxG?s_CurRGB.green:maxG;
|
||
maxB=s_CurRGB.blue>maxB?s_CurRGB.blue:maxB;
|
||
static int dwLastTime=0;
|
||
i=(i+1) % 100;
|
||
if(i==0)
|
||
{
|
||
CLog::DebugLog("AmbiTime: %i minR%i G%i B%i maxR%i G%i B%i",timeGetTime()-dwLastTime,minR,minG,minB,maxR,maxG,maxB);
|
||
dwLastTime=timeGetTime();
|
||
minR=minG=minB=255;
|
||
maxR=maxG=maxB=0;
|
||
}*/
|
||
}
|
||
else
|
||
{
|
||
strLastTransition = "reset";
|
||
}
|
||
}
|
||
/*else if(s_RGBs.strTransition.Equals("firework"))
|
||
{
|
||
static double distanceR,distanceG,distanceB,distanceW;
|
||
static double logScaleR,logScaleG,logScaleB,logScaleW;
|
||
static int counter;
|
||
if(!strLastTransition.Equals("fade"))
|
||
{
|
||
distanceR = bRepeat ? s_RGBs.red1-s_RGBs.red2 : s_RGBs.red2-s_RGBs.red1;
|
||
distanceG = bRepeat ? s_RGBs.green1-s_RGBs.green2 : s_RGBs.green2-s_RGBs.green1;
|
||
distanceB = bRepeat ? s_RGBs.blue1-s_RGBs.blue2 : s_RGBs.blue2-s_RGBs.blue1;
|
||
distanceW = bRepeat ? s_RGBs.white1-s_RGBs.white2 : s_RGBs.white2-s_RGBs.white1;
|
||
if(!strLastTransition.Equals("firework"))
|
||
{
|
||
counter=0;
|
||
strLastTransition="reset";
|
||
}
|
||
strLastTransition = "fade";
|
||
if(strLastTransition.Equals("reset"))
|
||
{
|
||
distanceR = s_RGBs.red1-s_RGBs.red2;
|
||
distanceG = s_RGBs.green1-s_RGBs.green2;
|
||
distanceB = s_RGBs.blue1-s_RGBs.blue2;
|
||
distanceW = s_RGBs.white1-s_RGBs.white2;
|
||
if(s_RGBs.strTransition.Equals("faderepeat"))bRepeat=!bRepeat;
|
||
}
|
||
logScaleR = 127/log(distanceR);
|
||
logScaleG = 127/log(distanceG);
|
||
logScaleB = 127/log(distanceB);
|
||
logScaleW = 127/log(distanceW);
|
||
if(dwFrameTime <= s_RGBs.iTime )
|
||
{
|
||
double stepR=distanceR/s_RGBs.iTime*dwFrameTime;
|
||
double stepG=distanceG/s_RGBs.iTime*dwFrameTime;
|
||
double stepB=distanceB/s_RGBs.iTime*dwFrameTime;
|
||
double stepW=distanceW/s_RGBs.iTime*dwFrameTime;
|
||
counter++;
|
||
}
|
||
s_CurRGB.red=(bRepeat ? s_RGBs.red1 : s_RGBs.red2) +(int)stepR;
|
||
s_CurRGB.green=(bRepeat ? s_RGBs.green1 : s_RGBs.green2)+(int)stepG;
|
||
s_CurRGB.blue=(bRepeat ? s_RGBs.blue1 : s_RGBs.blue2)+(int)stepB;
|
||
s_CurRGB.white=(bRepeat ? s_RGBs.white1 : s_RGBs.white2)+(int)stepW;
|
||
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
else if(s_RGBs.strTransition.Equals("fadeloop") || s_RGBs.strTransition.Equals("faderepeat"))
|
||
if(counter<=3)
|
||
{
|
||
strLastTransition="none";
|
||
dwFrameTime = 0;
|
||
dwLastTime = timeGetTime();
|
||
if(dwFrameTime <= s_RGBs.iTime )
|
||
{
|
||
double stepR=log(distanceR/s_RGBs.iTime*dwFrameTime)*logScaleR*-1;
|
||
double stepG=log(distanceG/s_RGBs.iTime*dwFrameTime)*logScaleG*-1;
|
||
double stepB=log(distanceB/s_RGBs.iTime*dwFrameTime)*logScaleB*-1;
|
||
double stepW=log(distanceW/s_RGBs.iTime*dwFrameTime)*logScaleW*-1;
|
||
s_CurRGB.red=s_RGBs.red1+(int)stepR;
|
||
s_CurRGB.green=s_RGBs.green1+(int)stepG;
|
||
s_CurRGB.blue=s_RGBs.blue1+(int)stepB;
|
||
s_CurRGB.white=s_RGBs.white1+(int)stepW;
|
||
SetRGBLed(s_CurRGB.red,s_CurRGB.green,s_CurRGB.blue,s_CurRGB.white);
|
||
}
|
||
}
|
||
|
||
Sleep(10);
|
||
}
|