Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit ee3816f

Browse files
committed
Merge branch 'master' into support_for_philips_hue
2 parents 925b063 + d1dc28d commit ee3816f

File tree

18 files changed

+186
-49
lines changed

18 files changed

+186
-49
lines changed

bin/install_hyperion.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ fi
3434
echo 'Downloading hyperion'
3535
if [ $IS_OPENELEC -eq 1 ]; then
3636
# OpenELEC has a readonly file system. Use alternative location
37-
curl --get https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz | tar -C /storage -xz
38-
curl --get https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.deps.openelec-rpi.tar.gz | tar -C /storage/hyperion/bin -xz
37+
curl -L --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz | tar -C /storage -xz
38+
curl -L --get https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.deps.openelec-rpi.tar.gz | tar -C /storage/hyperion/bin -xz
3939

4040
# modify the default config to have a correct effect path
4141
sed -i 's:/opt:/storage:g' /storage/hyperion/config/hyperion.config.json
4242
else
43-
wget https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz -O - | tar -C /opt -xz
43+
wget https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.tar.gz -O - | tar -C /opt -xz
4444
fi
4545

4646
# create links to the binaries
@@ -68,9 +68,9 @@ fi
6868
if [ $USE_INITCTL -eq 1 ]; then
6969
echo 'Installing initctl script'
7070
if [ $IS_RASPBMC -eq 1 ]; then
71-
wget -N https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.conf -P /etc/init/
71+
wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.conf -P /etc/init/
7272
else
73-
wget -N https://raw.github.com/tvdzwan/hyperion/master/deploy/hyperion.xbian.conf -O /etc/init/hyperion.conf
73+
wget -N https://raw.githubusercontent.com/tvdzwan/hyperion/master/deploy/hyperion.xbian.conf -O /etc/init/hyperion.conf
7474
fi
7575
elif [ $USE_SERVICE -eq 1 ]; then
7676
echo 'Installing startup script in init.d'

deploy/hyperion.tar.gz

7.67 KB
Binary file not shown.

include/hyperion/ImageProcessor.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class ImageProcessor
3737
///
3838
void setSize(const unsigned width, const unsigned height);
3939

40+
/// Enable or disable the black border detector
41+
void enableBalckBorderDetector(bool enable);
42+
4043
///
4144
/// Processes the image to a list of led colors. This will update the size of the buffer-image
4245
/// if required and call the image-to-leds mapping to determine the mean color per led.
@@ -142,7 +145,7 @@ class ImageProcessor
142145
const LedString _ledString;
143146

144147
/// Flag the enables(true)/disabled(false) blackborder detector
145-
const bool _enableBlackBorderRemoval;
148+
bool _enableBlackBorderRemoval;
146149

147150
/// The processor for black border detection
148151
hyperion::BlackBorderProcessor * _borderProcessor;

include/utils/Sleep.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#pragma once
2+
3+
#include <QThread>
4+
5+
class Sleep : protected QThread {
6+
public:
7+
static inline void msleep(unsigned long msecs) {
8+
QThread::msleep(msecs);
9+
}
10+
};

include/xbmcvideochecker/XBMCVideoChecker.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Q_OBJECT
3838
/// @param grabPhoto Whether or not to grab when the XBMC photo player is playing
3939
/// @param grabAudio Whether or not to grab when the XBMC audio player is playing
4040
/// @param grabMenu Whether or not to grab when nothing is playing (in XBMC menu)
41-
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
41+
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
4242
/// @param enable3DDetection Wheter or not to enable the detection of 3D movies playing
4343
///
4444
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabScreensaver, bool enable3DDetection);
@@ -96,6 +96,12 @@ private slots:
9696
/// The JSON-RPC message to check the screensaver
9797
const QString _checkScreensaverRequest;
9898

99+
/// The JSON-RPC message to check the active stereoscopicmode
100+
const QString _getStereoscopicMode;
101+
102+
/// The JSON-RPC message to check the xbmc version
103+
const QString _getXbmcVersion;
104+
99105
/// The QT TCP Socket with connection to XBMC
100106
QTcpSocket _socket;
101107

@@ -111,7 +117,7 @@ private slots:
111117
/// Flag indicating whether or not to grab when XBMC is playing nothing (in menu)
112118
const bool _grabMenu;
113119

114-
/// Flag inidcating whether or not to grab when the XBMC screensaver is activated
120+
/// Flag indicating whether or not to grab when the XBMC screensaver is activated
115121
const bool _grabScreensaver;
116122

117123
/// Flag indicating wheter or not to enable the detection of 3D movies playing
@@ -125,4 +131,7 @@ private slots:
125131

126132
/// Previous emitted video mode
127133
VideoMode _previousVideoMode;
134+
135+
/// XBMC version number
136+
int _xbmcVersion;
128137
};

libsrc/effectengine/Effect.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ Effect::Effect(PyThreadState * mainThreadState, int priority, int timeout, const
6464
{
6565
_colors.resize(_imageProcessor->getLedCount(), ColorRgb::BLACK);
6666

67+
// disable the black border detector for effects
68+
_imageProcessor->enableBalckBorderDetector(false);
69+
6770
// connect the finished signal
6871
connect(this, SIGNAL(finished()), this, SLOT(effectFinished()));
6972
}

libsrc/hyperion/ImageProcessor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ void ImageProcessor::setSize(const unsigned width, const unsigned height)
4343
_imageToLeds = new ImageToLedsMap(width, height, 0, 0, _ledString.leds());
4444
}
4545

46+
void ImageProcessor::enableBalckBorderDetector(bool enable)
47+
{
48+
_enableBlackBorderRemoval = enable;
49+
}
50+
4651
bool ImageProcessor::getScanParameters(size_t led, double &hscanBegin, double &hscanEnd, double &vscanBegin, double &vscanEnd) const
4752
{
4853
if (led < _ledString.leds().size())

libsrc/hyperion/ImageToLedsMap.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ ImageToLedsMap::ImageToLedsMap(
3535
// skip leds without area
3636
if ((led.maxX_frac-led.minX_frac) < 1e-6 || (led.maxY_frac-led.minY_frac) < 1e-6)
3737
{
38+
mColorsMap.emplace_back();
3839
continue;
3940
}
40-
41+
4142
// Compute the index boundaries for this led
4243
unsigned minX_idx = xOffset + unsigned(std::round(actualWidth * led.minX_frac));
4344
unsigned maxX_idx = xOffset + unsigned(std::round(actualWidth * led.maxX_frac));
4445
unsigned minY_idx = yOffset + unsigned(std::round(actualHeight * led.minY_frac));
4546
unsigned maxY_idx = yOffset + unsigned(std::round(actualHeight * led.maxY_frac));
46-
47+
4748
// make sure that the area is at least a single led large
4849
minX_idx = std::min(minX_idx, xOffset + actualWidth - 1);
4950
if (minX_idx == maxX_idx)

libsrc/leddevice/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ include_directories(
1313

1414
# Group the headers that go through the MOC compiler
1515
SET(Leddevice_QT_HEADERS
16+
${CURRENT_SOURCE_DIR}/LedRs232Device.h
1617
${CURRENT_SOURCE_DIR}/LedDeviceAdalight.h
1718
${CURRENT_SOURCE_DIR}/LedDevicePhilipsHue.h
1819
)
@@ -21,8 +22,6 @@ SET(Leddevice_HEADERS
2122
${CURRENT_HEADER_DIR}/LedDevice.h
2223
${CURRENT_HEADER_DIR}/LedDeviceFactory.h
2324

24-
${CURRENT_SOURCE_DIR}/LedRs232Device.h
25-
2625
${CURRENT_SOURCE_DIR}/LedDeviceLightpack.h
2726
${CURRENT_SOURCE_DIR}/LedDeviceMultiLightpack.h
2827
${CURRENT_SOURCE_DIR}/LedDevicePaintpack.h

libsrc/leddevice/LedDeviceAdalight.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
// hyperion local includes
1212
#include "LedDeviceAdalight.h"
1313

14-
LedDeviceAdalight::LedDeviceAdalight(const std::string& outputDevice, const unsigned baudrate) :
15-
LedRs232Device(outputDevice, baudrate),
14+
LedDeviceAdalight::LedDeviceAdalight(const std::string& outputDevice, const unsigned baudrate, int delayAfterConnect_ms) :
15+
LedRs232Device(outputDevice, baudrate, delayAfterConnect_ms),
1616
_ledBuffer(0),
1717
_timer()
1818
{

0 commit comments

Comments
 (0)