Skip to content

Commit

Permalink
Merge pull request #570 from Pulse-Eight/cec-frodo-pr
Browse files Browse the repository at this point in the history
cec: upgrade to libCEC 1.5+
  • Loading branch information
Lars Op den Kamp committed Mar 27, 2012
2 parents 8ca8fda + 6c4a3fe commit b4a6871
Show file tree
Hide file tree
Showing 17 changed files with 1,046 additions and 294 deletions.
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -1173,7 +1173,7 @@ if test "x$use_libcec" != "xno"; then

# libcec is dyloaded, so we need to check for its headers and link any depends.
if test "x$use_libcec" != "xno"; then
PKG_CHECK_MODULES([CEC],[libcec >= 1.1.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
PKG_CHECK_MODULES([CEC],[libcec >= 1.5.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])

if test "x$use_libcec" != "xno"; then
INCLUDES="$INCLUDES $CEC_CFLAGS"
Expand Down
19 changes: 13 additions & 6 deletions language/Dutch/strings.xml
Expand Up @@ -2391,16 +2391,23 @@
<string id="36004">Druk op "user" knop commando</string>
<string id="36005">Schakel commando's in bij het wisselen van kant</string>
<string id="36006">Kon de adapter niet openen</string>
<string id="36007">Schakel de TV in bij het opstarten van XBMC</string>
<string id="36007">Schakel apparatuur in bij het opstarten van XBMC</string>
<string id="36008">Schakel apparatuur uit bij het stoppen van XBMC</string>
<string id="36009">Schakel app. uit zolang de schermbeveiliging actief is</string>
<string id="36010"></string>
<string id="36011">Kon de CEC poort niet detecteren. Stel het manueel in.</string>
<string id="36012">Kon de CEC adapter niet detecteren.</string>
<string id="36013">Versie %d van de libcec interface version wordt niet ondersteund door XBMC (> %d)</string>
<string id="36011">Kon de COM poort niet detecteren. Stel het manueel in.</string>
<string id="36012">Kon de CEC adapter niet initialiseren.</string>
<string id="36013">Versie %d van de libCEC interface version wordt niet ondersteund door XBMC (> %d)</string>
<string id="36014">Zet XBMC in standby wanneer de TV uitgeschakeld wordt</string>
<string id="36015">HDMI poort nummer</string>
<string id="36016">Verbonden</string> <!-- max. 13 characters -->
<string id="36017">Adapter gevonden, maar libcec is niet beschikbaar</string>
<string id="36017">Adapter gevonden, maar libCEC is niet beschikbaar</string>
<string id="36018">Gebruik de taalinstelling van de TV</string>
</strings>
<string id="36019">Verbonden met HDMI apparaat</string>
<string id="36020">Maak XBMC de actieve bron bij het opstarten</string>
<string id="36021">Physiek adres (overschrijft HDMI poort)</string>
<string id="36022">COM poort (laat leeg, tenzij noodzakelijk)</string>
<string id="36023">Configuratie aangepast</string>
<string id="36024">Kon de nieuwe configuratie niet instellen. Controleer de instellingen.</string>
<string id="36025">Verstuur 'inactieve bron' commando bij het stoppen</string>
</strings>
18 changes: 13 additions & 5 deletions language/English/strings.xml
Expand Up @@ -2381,6 +2381,7 @@
<string id="35006">Device removed</string>
<string id="35007">Keymap to use for this device</string>
<string id="35008">Keymap enabled</string>
<string id="35009">Do not use the custom keymap for this device</string>

<string id="35500">Location</string>
<string id="35501">Class</string>
Expand All @@ -2395,16 +2396,23 @@
<string id="36004">Press "user" button command</string>
<string id="36005">Enable switch side commands</string>
<string id="36006">Could not open the adapter</string>
<string id="36007">Power on the TV when starting XBMC</string>
<string id="36008">Power off devices when stopping XBMC</string>
<string id="36007">Devices to power on the TV when starting XBMC</string>
<string id="36008">Devices to power off devices when stopping XBMC</string>
<string id="36009">Put devices in standby mode when activating screensaver</string>
<string id="36010"></string>
<string id="36011">Could not detect the CEC port. Set it up manually.</string>
<string id="36012">Could not detect the CEC adapter.</string>
<string id="36013">Unsupported libcec interface version. %d is greater than the version XBMC supports (%d)</string>
<string id="36012">Could not initialise the CEC adapter. Check your settings.</string>
<string id="36013">Unsupported libCEC interface version. %d is greater than the version XBMC supports (%d)</string>
<string id="36014">Put this PC in standby mode when the TV is switched off</string>
<string id="36015">HDMI port number</string>
<string id="36016">Connected</string> <!-- max. 13 characters -->
<string id="36017">Adapter found, but libcec is not available</string>
<string id="36017">Adapter found, but libCEC is not available</string>
<string id="36018">Use the TV's language setting</string>
<string id="36019">Connected to HDMI device</string>
<string id="36020">Make XBMC the active source when starting</string>
<string id="36021">Physical address (overrules HDMI port)</string>
<string id="36022">COM port (leave empty unless needed)</string>
<string id="36023">Configuration updated</string>
<string id="36024">Failed to set the new configuration. Please check your settings.</string>
<string id="36025">Send 'inactive source' command when stopping XBMC</string>
</strings>
30 changes: 15 additions & 15 deletions lib/libcec/Makefile
Expand Up @@ -7,48 +7,48 @@

# lib name, version
LIBNAME=libcec
VERSION=1.2.0
VERSION=latest
SOURCE=$(LIBNAME)-$(VERSION)

# download location and format
BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
ARCHIVE=$(SOURCE).tar.gz
BASE_URL=http://packages.pulse-eight.net/pulse/sources/libcec
ARCHIVE=$(SOURCE).tar.bz2
TARBALLS_LOCATION=.
RETRIEVE_TOOL=/usr/bin/curl
RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
ARCHIVE_TOOL=tar
ARCHIVE_TOOL_FLAGS=xf
ARCHIVE_TOOL_FLAGS=jxf

PREFIX ?= /usr/local
LIBCEC_CONFIGOPTS ?= --prefix=$(PREFIX)

# configuration settings
CONFIGURE=./configure CFLAGS=-D_FILE_OFFSET_BITS=64 $(LIBCEC_CONFIGOPTS)

SO_NAME=$(SOURCE)/.libs/$(LIBNAME).so
SO_NAME=$(LIBNAME)/.libs/$(LIBNAME).so

all: $(SO_NAME)

$(TARBALLS_LOCATION)/$(ARCHIVE):
$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
rm -rf $(SOURCE)
$(LIBNAME): $(TARBALLS_LOCATION)/$(ARCHIVE)
rm -rf $(LIBNAME)
$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
echo $(SOURCE) > .gitignore
cd $(SOURCE); autoreconf -vif
cd $(SOURCE); $(CONFIGURE)
echo $(LIBNAME) > .gitignore
cd $(LIBNAME); autoreconf -vif
cd $(LIBNAME); $(CONFIGURE)

$(SO_NAME): $(SOURCE)
make -j 1 -C $(SOURCE)
$(SO_NAME): $(LIBNAME)
make -j 1 -C $(LIBNAME)

install:
make -C $(SOURCE) install
make -C $(LIBNAME) install
ldconfig

clean:
rm -rf $(SOURCE)
rm -rf $(LIBNAME)

distclean::
rm -rf $(SOURCE)
rm -rf $(LIBNAME)

3 changes: 2 additions & 1 deletion project/BuildDependencies/scripts/libcec_d.bat
Expand Up @@ -7,7 +7,8 @@ CALL dlextract.bat libcec %FILES%

cd %TMP_PATH%

xcopy libcec\include\* "%CUR_PATH%\include" /E /Q /I /Y
mkdir "%CUR_PATH%\include\libcec"
xcopy libcec\include\* "%CUR_PATH%\include\libcec\." /E /Q /I /Y

copy libcec\libcec.dll "%XBMC_PATH%\system\."
copy libcec\pthreadVC2.dll "%XBMC_PATH%\system\."
Expand Down
2 changes: 1 addition & 1 deletion project/BuildDependencies/scripts/libcec_d.txt
@@ -1,3 +1,3 @@
; filename source of the file

libcec1.2.zip http://packages.pulse-eight.net/windows/
libcec-latest.zip http://packages.pulse-eight.net/windows/
37 changes: 22 additions & 15 deletions system/peripherals.xml
@@ -1,22 +1,29 @@
<peripherals>
<peripheral vendor_product="1915:003B,22B8:003B" bus="usb" name="Motorola Nyxboard Hybrid" mapTo="nyxboard">
<setting key="keymap_enabled" type="bool" value="1" label="35008" />
<setting key="do_not_use_custom_keymap" type="bool" value="0" label="35009" order="1" />
<setting key="keymap" value="nyxboard" label="35007" configurable="0" />
<setting key="enable_flip_commands" type="bool" value="1" label="36005" />
<setting key="flip_keyboard" value="XBMC.VideoLibrary.Search" label="36002" />
<setting key="flip_remote" value="Dialog.Close(virtualkeyboard)" label="36003" />
<setting key="key_user" value="" label="36004" />
<setting key="enable_flip_commands" type="bool" value="1" label="36005" order="2" />
<setting key="flip_keyboard" value="XBMC.VideoLibrary.Search" label="36002" order="3" />
<setting key="flip_remote" value="Dialog.Close(virtualkeyboard)" label="36003" order="4" />
<setting key="key_user" value="" label="36004" order="5" />
</peripheral>

<peripheral vendor_product="2548:1001" bus="usb" name="Pulse-Eight CEC Adaptor" mapTo="cec">
<setting key="enabled" type="bool" value="1" label="305" />
<setting key="port" type="string" value="" label="792" />
<setting key="cec_hdmi_port" type="int" value="1" min="1" max="16" label="36015" />
<setting key="cec_power_on_startup" type="bool" value="1" label="36007" />
<setting key="cec_power_off_shutdown" type="bool" value="1" label="36008" />
<setting key="cec_standby_screensaver" type="bool" value="1" label="36009" />
<setting key="standby_pc_on_tv_standby" type="bool" value="1" label="36014" />
<setting key="cec_debug_logging" type="bool" value="0" label="20191" />
<setting key="use_tv_menu_language" type="bool" value="1" label="36018" />
<peripheral vendor_product="2548:1001" bus="usb" name="Pulse-Eight CEC Adapter" mapTo="cec">
<setting key="enabled" type="bool" value="1" label="305" order="1" />
<setting key="activate_source" type="bool" value="1" label="36020" order="2" />
<setting key="wake_devices" type="string" value="0" label="36007" order="3" />
<setting key="standby_devices" type="string" value="0" label="36008" order="4" />
<setting key="cec_standby_screensaver" type="bool" value="1" label="36009" order="5" />
<setting key="standby_pc_on_tv_standby" type="bool" value="1" label="36014" order="6" />
<setting key="send_inactive_source" type="bool" value="1" label="36025" order="7" />
<setting key="use_tv_menu_language" type="bool" value="1" label="36018" order="8" />
<setting key="physical_address" type="string" label="36021" value="0" order="9" />
<setting key="cec_hdmi_port" type="int" value="1" min="1" max="16" label="36015" order="10" />
<setting key="connected_device" type="int" label="36019" value="0" min="0" max="15" step="1" order="11" />
<setting key="port" type="string" value="" label="36022" order="12" />

<setting key="tv_vendor" type="int" value="0" configurable="0" />
<setting key="device_name" type="string" value="XBMC" configurable="0" />
<setting key="device_type" type="int" value="1" configurable="0" />
</peripheral>
</peripherals>
26 changes: 13 additions & 13 deletions tools/darwin/depends/libcec/Makefile
Expand Up @@ -2,37 +2,37 @@ include ../Makefile.include

# lib name, version
LIBNAME=libcec
VERSION=1.2.0
VERSION=latest
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
ARCHIVE=$(SOURCE).tar.bz2

# configuration settings
CONFIGURE=./configure --prefix=$(PREFIX)

LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
LIBDYLIB=$(LIBNAME)/.libs/$(LIBNAME).dylib

all: $(LIBDYLIB) .installed

$(TARBALLS_LOCATION)/$(ARCHIVE):
$(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)

$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
rm -rf $(SOURCE)
$(LIBNAME): $(TARBALLS_LOCATION)/$(ARCHIVE)
rm -rf $(LIBNAME)
$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
echo $(SOURCE) > .gitignore
cd $(SOURCE); autoreconf -vif
cd $(SOURCE); $(CONFIGURE)
echo $(LIBNAME) > .gitignore
cd $(LIBNAME); autoreconf -vif
cd $(LIBNAME); $(CONFIGURE)

$(LIBDYLIB): $(SOURCE)
make -j 1 -C $(SOURCE)
$(LIBDYLIB): $(LIBNAME)
make -j 1 -C $(LIBNAME)

.installed:
make -C $(SOURCE) install
make -C $(LIBNAME) install
touch $@

clean:
rm -rf $(SOURCE) .installed
rm -rf $(LIBNAME) .installed

distclean::
rm -rf $(SOURCE) .installed
rm -rf $(LIBNAME) .installed

38 changes: 17 additions & 21 deletions xbmc/Application.cpp
Expand Up @@ -160,9 +160,6 @@
#endif
#include "interfaces/AnnouncementManager.h"
#include "peripherals/Peripherals.h"
#ifdef HAVE_LIBCEC
#include "peripherals/devices/PeripheralCecAdapter.h"
#endif
#include "peripherals/dialogs/GUIDialogPeripheralManager.h"
#include "peripherals/dialogs/GUIDialogPeripheralSettings.h"

Expand Down Expand Up @@ -2556,6 +2553,10 @@ bool CApplication::OnAction(const CAction &action)
}
}
}

if (g_peripherals.OnAction(action))
return true;

if (action.GetID() == ACTION_MUTE)
{
ToggleMute();
Expand Down Expand Up @@ -2831,23 +2832,9 @@ bool CApplication::ProcessRemote(float frameTime)

bool CApplication::ProcessPeripherals(float frameTime)
{
#ifdef HAVE_LIBCEC
vector<CPeripheral *> peripherals;
if (g_peripherals.GetPeripheralsWithFeature(peripherals, FEATURE_CEC))
{
for (unsigned int iPeripheralPtr = 0; iPeripheralPtr < peripherals.size(); iPeripheralPtr++)
{
CPeripheralCecAdapter *cecDevice = (CPeripheralCecAdapter *) peripherals.at(iPeripheralPtr);
if (cecDevice && cecDevice->GetButton())
{
CKey key(cecDevice->GetButton(), cecDevice->GetHoldTime());
cecDevice->ResetButton();
return OnKey(key);
}
}
}
#endif

CKey key;
if (g_peripherals.GetNextKeypress(frameTime, key))
return OnKey(key);
return false;
}

Expand Down Expand Up @@ -3288,7 +3275,8 @@ void CApplication::Stop(int exitCode)
{
try
{
CAnnouncementManager::Announce(System, "xbmc", "OnQuit");
CVariant vExitCode(exitCode);
CAnnouncementManager::Announce(System, "xbmc", "OnQuit", vExitCode);

// cancel any jobs from the jobmanager
CJobManager::GetInstance().CancelJobs();
Expand Down Expand Up @@ -5027,6 +5015,8 @@ void CApplication::ShowVolumeBar(const CAction *action)

bool CApplication::IsMuted() const
{
if (g_peripherals.IsMuted())
return true;
return g_settings.m_bMute;
}

Expand All @@ -5040,13 +5030,19 @@ void CApplication::ToggleMute(void)

void CApplication::Mute()
{
if (g_peripherals.Mute())
return;

g_settings.m_iPreMuteVolumeLevel = GetVolume();
SetVolume(0);
g_settings.m_bMute = true;
}

void CApplication::UnMute()
{
if (g_peripherals.UnMute())
return;

SetVolume(g_settings.m_iPreMuteVolumeLevel);
g_settings.m_iPreMuteVolumeLevel = 0;
g_settings.m_bMute = false;
Expand Down

0 comments on commit b4a6871

Please sign in to comment.