#if defined(TARGET_ANDROID)
#include "android/activity/XBMCApp.h"
#include "android/activity/AndroidFeatures.h"
+#include "android/jni/Build.h"
#endif
#ifdef TARGET_WINDOWS
XInitThreads();
#endif
- // we start in frontend
- m_bInBackground = false;
/* for now always keep this around */
#ifdef HAS_KARAOKE
return g_application.OnAppCommand(newEvent.appcommand.action);
case XBMC_TOUCH:
{
- int windowId = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;
-
if (newEvent.touch.action == ACTION_TOUCH_TAP)
{ // Send a mouse motion event with no dx,dy for getting the current guiitem selected
g_application.OnAction(CAction(ACTION_MOUSE_MOVE, 0, newEvent.touch.x, newEvent.touch.y, 0, 0));
}
int actionId = 0;
if (newEvent.touch.action == ACTION_GESTURE_BEGIN || newEvent.touch.action == ACTION_GESTURE_END)
- {
actionId = newEvent.touch.action;
- windowId = WINDOW_INVALID;
+ else
+ {
+ int iWin = g_windowManager.GetActiveWindow() & WINDOW_ID_MASK;
+ // change this if we have a dialog up
+ if (g_windowManager.HasModalDialog())
+ {
+ iWin = g_windowManager.GetTopMostModalDialogID() & WINDOW_ID_MASK;
+ }
+ if (iWin == WINDOW_DIALOG_FULLSCREEN_INFO)
+ { // fullscreen info dialog - special case
+ CButtonTranslator::GetInstance().TranslateTouchAction(iWin, newEvent.touch.action, newEvent.touch.pointers, actionId);
+ if (actionId <= 0)
+ iWin = WINDOW_FULLSCREEN_VIDEO; // fallthrough to the main window
+ }
+ if (actionId <= 0)
+ {
+ if (iWin == WINDOW_FULLSCREEN_VIDEO)
+ {
+ // current active window is full screen video.
+ if (g_application.m_pPlayer->IsInMenu())
+ {
+ // if player is in some sort of menu, (ie DVDMENU) map buttons differently
+ CButtonTranslator::GetInstance().TranslateTouchAction(WINDOW_VIDEO_MENU, newEvent.touch.action, newEvent.touch.pointers, actionId);
+ }
+ else if (g_PVRManager.IsStarted() && g_application.CurrentFileItem().HasPVRChannelInfoTag())
+ {
+ // check for PVR specific keymaps in FULLSCREEN_VIDEO window
+ CButtonTranslator::GetInstance().TranslateTouchAction(WINDOW_FULLSCREEN_LIVETV, newEvent.touch.action, newEvent.touch.pointers, actionId);
+
+ // if no PVR specific action/mapping is found, fall back to default
+ if (actionId <= 0)
+ CButtonTranslator::GetInstance().TranslateTouchAction(iWin, newEvent.touch.action, newEvent.touch.pointers, actionId);
+ }
+ else
+ {
+ // in any other case use the fullscreen window section of keymap.xml to map key->action
+ CButtonTranslator::GetInstance().TranslateTouchAction(iWin, newEvent.touch.action, newEvent.touch.pointers, actionId);
+ }
+ }
+ else // iWin != WINDOW_FULLSCREEN_VIDEO
+ CButtonTranslator::GetInstance().TranslateTouchAction(iWin, newEvent.touch.action, newEvent.touch.pointers, actionId);
+ }
}
- else if (!CButtonTranslator::GetInstance().TranslateTouchAction(newEvent.touch.action, newEvent.touch.pointers, windowId, actionId) ||
- actionId <= 0)
+
+ if (actionId <= 0)
return false;
- CApplicationMessenger::Get().SendAction(CAction(actionId, 0, newEvent.touch.x, newEvent.touch.y, newEvent.touch.x2, newEvent.touch.y2), windowId, false);
+ if ((actionId >= ACTION_TOUCH_TAP && actionId <= ACTION_GESTURE_END)
+ || (actionId >= ACTION_MOUSE_START && actionId <= ACTION_MOUSE_END) )
+ CApplicationMessenger::Get().SendAction(CAction(actionId, 0, newEvent.touch.x, newEvent.touch.y, newEvent.touch.x2, newEvent.touch.y2), WINDOW_INVALID, false);
+ else
+ CApplicationMessenger::Get().SendAction(CAction(actionId), WINDOW_INVALID, false);
+
// Post an unfocus message for touch device after the action.
if (newEvent.touch.action == ACTION_GESTURE_END || newEvent.touch.action == ACTION_TOUCH_TAP)
{
}
break;
}
+ case XBMC_SETFOCUS:
+ // Reset the screensaver
+ g_application.ResetScreenSaver();
+ g_application.WakeUpScreenSaverAndDPMS();
+ // Send a mouse motion event with no dx,dy for getting the current guiitem selected
+ g_application.OnAction(CAction(ACTION_MOUSE_MOVE, 0, newEvent.focus.x, newEvent.focus.y, 0, 0));
+ break;
}
return true;
}
CLog::Log(LOGNOTICE, "Running on Darwin iOS %d-bit %s%s", g_sysinfo.GetKernelBitness(), g_sysinfo.IsAppleTV2() ? "(AppleTV2) " : "", g_sysinfo.GetUnameVersion().c_str());
#elif defined(TARGET_FREEBSD)
CLog::Log(LOGNOTICE, "Running on FreeBSD %d-bit %s", g_sysinfo.GetKernelBitness(), g_sysinfo.GetUnameVersion().c_str());
+#elif defined(TARGET_ANDROID)
+ CLog::Log(LOGNOTICE, "Running on Android %d-bit API level %d (%s, %s)", g_sysinfo.GetKernelBitness(), CJNIBuild::SDK_INT, g_sysinfo.GetLinuxDistro().c_str(), g_sysinfo.GetUnameVersion().c_str());
#elif defined(TARGET_POSIX)
CLog::Log(LOGNOTICE, "Running on Linux %d-bit (%s, %s)", g_sysinfo.GetKernelBitness(), g_sysinfo.GetLinuxDistro().c_str(), g_sysinfo.GetUnameVersion().c_str());
#elif defined(TARGET_WINDOWS)
CLog::Log(LOGNOTICE, "Running with %s rights", (CWIN32Util::IsCurrentUserLocalAdministrator() == TRUE) ? "administrator" : "restricted");
CLog::Log(LOGNOTICE, "Aero is %s", (g_sysinfo.IsAeroDisabled() == true) ? "disabled" : "enabled");
#endif
+#if defined(TARGET_ANDROID)
+ CLog::Log(LOGNOTICE,
+ "Product: %s, Device: %s, Board: %s - Manufacturer: %s, Brand: %s, Model: %s, Hardware: %s",
+ CJNIBuild::PRODUCT.c_str(), CJNIBuild::DEVICE.c_str(), CJNIBuild::BOARD.c_str(),
+ CJNIBuild::MANUFACTURER.c_str(), CJNIBuild::BRAND.c_str(), CJNIBuild::MODEL.c_str(), CJNIBuild::HARDWARE.c_str());
+#endif
+
#if defined(__arm__)
if (g_cpuInfo.GetCPUFeatures() & CPU_FEATURE_NEON)
CLog::Log(LOGNOTICE, "ARM Features: Neon enabled");
{
// if the skin changes and the current theme is not the default one, reset
// the theme to the default value (which will also change lookandfeel.skincolors
- // which in turn will reload the skin
+ // which in turn will reload the skin. Similarly, if the current skin font is not
+ // the default, reset it as well.
if (settingId == "lookandfeel.skin" && CSettings::Get().GetString("lookandfeel.skintheme") != "SKINDEFAULT")
CSettings::Get().SetString("lookandfeel.skintheme", "SKINDEFAULT");
+ else if (settingId == "lookandfeel.skin" && CSettings::Get().GetString("lookandfeel.font") != "Default")
+ CSettings::Get().SetString("lookandfeel.font", "Default");
else
{
std::string builtin("ReloadSkin");
CApplicationMessenger::Get().ExecBuiltIn("ReloadSkin");
}
else if (settingId == "lookandfeel.skinzoom")
- g_windowManager.SendMessage(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESIZE);
+ {
+ CGUIMessage msg(GUI_MSG_NOTIFY_ALL, 0, 0, GUI_MSG_WINDOW_RESIZE);
+ g_windowManager.SendThreadMessage(msg);
+ }
else if (StringUtils::StartsWithNoCase(settingId, "audiooutput."))
{
// AE is master of audio settings and needs to be informed first
void CApplication::Render()
{
// do not render if we are stopped or in background
- if (m_bStop || m_bInBackground)
+ if (m_bStop)
return;
MEASURE_FUNCTION;
}
}
+ // record current file
+ if (action.GetID() == ACTION_RECORD)
+ {
+ if (m_pPlayer->CanRecord())
+ m_pPlayer->Record(!m_pPlayer->IsRecording());
+ }
+
if (m_playerController->OnAction(action))
return true;
}
CLog::Log(LOGNOTICE, "stop player");
m_pPlayer->ClosePlayer();
+ CAnnouncementManager::Deinitialize();
+
StopPVRManager();
StopServices();
//Sleep(5000);
if (dbs.Open())
{
CBookmark bookmark;
- if (dbs.GetResumeBookMark(item.GetPath(), bookmark))
+ CStdString path = item.GetPath();
+ if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString()))
+ path = item.GetProperty("original_listitem_url").asString();
+ if( dbs.GetResumeBookMark(path, bookmark) )
{
startoffset = (int)(bookmark.timeInSeconds*75);
selectedFile = bookmark.partNumber;
{
// can only resume seek here, not dvdstate
CBookmark bookmark;
- if( dbs.GetResumeBookMark(item.GetPath(), bookmark) )
+ CStdString path = item.GetPath();
+ if (item.HasProperty("original_listitem_url") && URIUtils::IsPlugin(item.GetProperty("original_listitem_url").asString()))
+ path = item.GetProperty("original_listitem_url").asString();
+ if( dbs.GetResumeBookMark(path, bookmark) )
seconds = bookmark.timeInSeconds;
else
seconds = 0.0f;
should the playerState be required, it is fetched from the database.
See the note in CGUIWindowVideoBase::ShowResumeMenu.
*/
- if (item.HasVideoInfoTag() && item.GetVideoInfoTag()->m_resumePoint.IsSet())
- options.starttime = item.GetVideoInfoTag()->m_resumePoint.timeInSeconds;
+ if (item.IsResumePointSet())
+ options.starttime = item.GetCurrentResumeTime();
}
else if (item.HasVideoInfoTag())
{
// this really aught to be inside !bRestart, but since PlayStack
// uses that to init playback, we have to keep it outside
int playlist = g_playlistPlayer.GetCurrentPlaylist();
- if (item.IsVideo() && g_playlistPlayer.GetPlaylist(playlist).size() > 1)
+ if (item.IsVideo() && playlist == PLAYLIST_VIDEO && g_playlistPlayer.GetPlaylist(playlist).size() > 1)
{ // playing from a playlist by the looks
// don't switch to fullscreen if we are not playing the first item...
options.fullscreen = !g_playlistPlayer.HasPlayedFirstFile() && g_advancedSettings.m_fullScreenOnMovieStart && !CMediaSettings::Get().DoesVideoStartWindowed();
void CApplication::CheckScreenSaverAndDPMS()
{
- if (m_bInBackground)
- return;
if (!m_dpmsIsActive)
g_Windowing.ResetOSScreensaver();
g_windowManager.ActivateWindow(WINDOW_SCREENSAVER);
}
-void CApplication::SetInBackground(bool background)
-{
- if (!background)
- {
- ResetScreenSaverTimer();
- }
- m_bInBackground = background;
-}
-
void CApplication::CheckShutdown()
{
// first check if we should reset the timer
- bool resetTimer = m_bInhibitIdleShutdown;
-
- if (m_pPlayer->IsPlaying() || m_pPlayer->IsPausedPlayback()) // is something playing?
- resetTimer = true;
-
- if (m_musicInfoScanner->IsScanning())
- resetTimer = true;
-
- if (m_videoInfoScanner->IsScanning())
- resetTimer = true;
-
- if (g_windowManager.IsWindowActive(WINDOW_DIALOG_PROGRESS)) // progress dialog is onscreen
- resetTimer = true;
-
- if (CSettings::Get().GetBool("pvrmanager.enabled") && !g_PVRManager.IsIdle())
- resetTimer = true;
-
- if (resetTimer)
+ if (m_bInhibitIdleShutdown
+ || m_pPlayer->IsPlaying() || m_pPlayer->IsPausedPlayback() // is something playing?
+ || m_musicInfoScanner->IsScanning()
+ || m_videoInfoScanner->IsScanning()
+ || g_windowManager.IsWindowActive(WINDOW_DIALOG_PROGRESS) // progress dialog is onscreen
+ || (CSettings::Get().GetBool("pvrmanager.enabled") && !g_PVRManager.IsIdle()))
{
m_shutdownTimer.StartZero();
return;
//We don't know if there is unsecure information in this yet, so we
//postpone any logging
const std::string in_actionStr(actionStr);
- CLog::Log(LOGDEBUG,"%s : Translating action string", __FUNCTION__);
CGUIInfoLabel info(actionStr, "");
actionStr = info.GetLabel(0);
CAEFactory::GarbageCollect();
+ // if we don't render the gui there's no reason to start the screensaver.
+ // that way the screensaver won't kick in if we maximize the XBMC window
+ // after the screensaver start time.
+ if(!m_renderGUI)
+ ResetScreenSaverTimer();
}
// Global Idle Time in Seconds
return *m_itemCurrentFile;
}
+CFileItem& CApplication::CurrentUnstackedItem()
+{
+ if (m_itemCurrentFile->IsStack() && m_currentStack->Size() > 0)
+ return *(*m_currentStack)[m_currentStackPosition];
+ else
+ return *m_itemCurrentFile;
+}
+
void CApplication::ShowVolumeBar(const CAction *action)
{
CGUIDialog *volumeBar = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VOLUME_BAR);
hardwareVolume = std::max(VOLUME_MINIMUM, std::min(VOLUME_MAXIMUM, hardwareVolume));
m_volumeLevel = hardwareVolume;
- float value = 0.0f;
- if (hardwareVolume > VOLUME_MINIMUM)
- {
- float dB = CAEUtil::PercentToGain(hardwareVolume);
- value = CAEUtil::GainToScale(dB);
- }
- if (value >= 0.99f)
- value = 1.0f;
-
- CAEFactory::SetVolume(value);
+ CAEFactory::SetVolume(hardwareVolume);
}
float CApplication::GetVolume(bool percentage /* = true */) const