Commit 760c4caf authored by golgoj4's avatar golgoj4

refs #1108 #1170 #1988 - Updates the screensaver to use opengl textures for...

refs #1108 #1170 #1988 - Updates the screensaver to use opengl textures for qt5. updates various .pro files with fixes for building. AndroidManifest.xml among them. qml screens for all skins i think.
parent cb27f4b6
<?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.linuxmce.qorbiterqt5" android:versionCode="1" android:versionName="1.0">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/icon" android:label="@string/app_name">
<manifest android:versionCode="1" package="org.linuxmce.qorbiterqt5" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/icon" android:label="LinuxMCE QOrbiter-Qt5">
<activity android:configChanges="orientation|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:screenOrientation="unspecified" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
......@@ -10,7 +10,7 @@
<meta-data android:name="android.app.repository" android:value="@string/repository"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<meta-data android:name="android.app.lib_name" android:value="@string/app_lib_name"/>
<meta-data android:name="android.app.lib_name" android:value="qorbiter"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="1"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
......@@ -32,15 +32,15 @@
</activity>
</application>
<!-- %%INSERT_USES_SDK%% -->
<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"/>
<uses-sdk android:targetSdkVersion="13" android:minSdkVersion="10"/>
<supports-screens android:anyDensity="true" android:normalScreens="true" android:smallScreens="true" android:largeScreens="true"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="13"/>
<uses-feature android:glEsVersion="0x00020000"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.PERSISTENT_ACTIVITY"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.PERSISTENT_ACTIVITY"/>
<uses-permission android:name="android.permission.SIGNAL_PERSISTENT_PROCESSES"/>
<uses-permission android:name="android.permission.STATUS_BAR"/>
<uses-permission android:name="android.permission.USE_SIP"/>
......
......@@ -214,7 +214,7 @@ int main(int argc, char* argv[])
QCoreApplication::setApplicationName("LinuxMCE QOrbiter");
QCoreApplication::setOrganizationDomain("org.linuxmce.QOrbiter");
QCoreApplication::setOrganizationName("www.linuxMCE.org");
#ifdef __ANDROID__
#ifdef __ANDROID__ && ! defined(QT5)
AndroidSystem androidHelper;
#endif
......
......@@ -191,10 +191,10 @@ orbiterWindow::orbiterWindow(int deviceid, std::string routerip, bool fullScreen
#ifndef QT5
buildType = "/qml/desktop";
#else
buildType = "/qml/rpi";
buildType = "/qml/qt5-desktop";
#endif
qrcPath = buildType+"/Splash.qml";
localPath = "desktop/";
localPath = "qt5-desktop/";
#elif defined (for_freemantle)
buildType = "/qml/freemantle";
qrcPath = "qrc:freemantle/Splash.qml";
......@@ -240,17 +240,16 @@ orbiterWindow::orbiterWindow(int deviceid, std::string routerip, bool fullScreen
qDebug() << "Plugin path list"; mainView.engine()->pluginPathList().join("\n");
mainView.rootContext()->setBaseUrl(QUrl::fromLocalFile("/"));
#endif
#ifdef QT5
mainView.setSource(QString("assets:/qml/Welcome.qml"));
#else
mainView.setSource(QString("assets:/qml/Base.qml"));
#endif
#elif !for_harmattan
mainView.setSource(QApplication::applicationDirPath().remove("/bin")+buildType+"/Splash.qml");
#elif for_harmattan
mainView.setSource(QApplication::applicationDirPath()+"qml/Splash.qml");
#endif
}
......
......@@ -2,7 +2,6 @@
#define ANDROIDSYSTEM_H
#include <QObject>
#include <jni.h>
#ifndef QT5
......@@ -127,8 +126,8 @@ public slots:
void setApiLevel(int lvl){ apiLevel = lvl; emit apiLevelChanged();}
int getApiLevel(){ return apiLevel;}
Q_INVOKABLE bool updateExternalStorageLocation();
Q_INVOKABLE bool updateBuildInformation();
/* Q_INVOKABLE*/ bool updateExternalStorageLocation();
/* Q_INVOKABLE*/ bool updateBuildInformation();
bool playMedia(QString url);
bool stopMedia();
......
......@@ -232,7 +232,7 @@ public slots:
void setVolume(qreal vol){
#ifdef LINUX
#ifdef QT4
qreal c = audioSink->volume();
qWarning() << "Current volume" << c;
qreal d = c+0.01;
......
......@@ -63,11 +63,11 @@ android-g++{
}
linux-g++{
QMLDIR_TARGET=$DESTDIR
QMLDIR_TARGET=$$DESTDIR
}
linux-rasp-pi-g++{
QMLDIR_TARGET=$DESTDIR
QMLDIR_TARGET=$$DESTDIR
}
copy_qmldir.target=$$QMLDIR_TARGET
......
......@@ -2,8 +2,11 @@
#ifdef QT5
#include <qqml.h>
#include <QSGSimpleRectNode>
#include <QSGSimpleTextureNode>
#include <qquickwindow.h>
#else
#include <qdeclarative.h>
#include <QPainter>
#endif
......@@ -11,16 +14,15 @@
#include <QDebug>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QPainter>
#include <QTimerEvent>
const int animationInterval = 30; // should be 60fps
#ifdef QT5
DceScreenSaver::DceScreenSaver(QQuickPaintedItem *parent):
QQuickPaintedItem(parent)
#else
DceScreenSaver::DceScreenSaver(QQuickItem *parent):
QQuickItem(parent)
#else
DceScreenSaver::DceScreenSaver(QDeclarativeItem *parent):
QDeclarativeItem(parent)
#endif
......@@ -32,7 +34,7 @@ DceScreenSaver::DceScreenSaver(QDeclarativeItem *parent):
// QDeclarativeItem to create a visual item, you will need to uncomment the
// following line:
setFlag(ItemHasNoContents, false);
#endif
#endif
m_animationTimer = startTimer(animationInterval);
fadeOpacity = 1;
......@@ -67,8 +69,8 @@ DceScreenSaver::DceScreenSaver(QDeclarativeItem *parent):
surface.fill(Qt::black);
QObject::connect(this, SIGNAL(heightChanged()), this, SLOT(forceUpdate()));
QObject::connect(this, SIGNAL(widthChanged()), this, SLOT(forceUpdate()));
// QObject::connect(zoomAnimation, SIGNAL(finished()), this, SLOT(resetPicture()));
qDebug() << "Screensaver ctor";
// QObject::connect(zoomAnimation, SIGNAL(finished()), this, SLOT(resetPicture()));
qDebug() << "Screensaver ctor";
}
DceScreenSaver::~DceScreenSaver()
......@@ -97,23 +99,20 @@ void DceScreenSaver::setImageList(QStringList l)
}
void DceScreenSaver::requestImage(QString img)
{
void DceScreenSaver::requestImage(QString img){
QNetworkRequest req;
req.setUrl("http://"+requestUrl+"/lmce-admin/imdbImage.php?type=screensaver&val="+img);
QObject::connect(requestManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(processImageData(QNetworkReply*)));
requestManager->get(req);
}
void DceScreenSaver::processImageData(QNetworkReply *r)
{
void DceScreenSaver::processImageData(QNetworkReply *r){
QByteArray p;
if(r->bytesAvailable()){
p = r->readAll();
} else{
} else{
return;
}
......@@ -127,13 +126,13 @@ void DceScreenSaver::processImageData(QNetworkReply *r)
currentImage= t.scaled(width(),height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
}
#ifndef RPI
#ifndef QT5
startFadeTimer(2500);
#else
update();
#endif
// beginZoom();
// beginZoom();
}
......@@ -156,8 +155,8 @@ void DceScreenSaver::getNextImage()
void DceScreenSaver::paint(QPainter *p ,const QStyleOptionGraphicsItem *option, QWidget *widget )
{
Q_UNUSED(option);
Q_UNUSED(widget);
Q_UNUSED(option);
Q_UNUSED(widget);
p->setBrush(Qt::NoBrush);
......@@ -185,24 +184,23 @@ void DceScreenSaver::paint(QPainter *p ,const QStyleOptionGraphicsItem *option,
#ifdef QT5
void DceScreenSaver::paint(QPainter *painter )
{
painter->setBrush(Qt::NoBrush);
painter->setPen(Qt::NoPen);
QSGNode * DceScreenSaver::updatePaintNode(QSGNode *node, QQuickItem::UpdatePaintNodeData *d){
painter->setRenderHint(QPainter::HighQualityAntialiasing, 1);
QImage t = currentImage.toImage();
QSGTexture *tex;
tex = this->window()->createTextureFromImage(t);
if(!node){
node = new QSGSimpleTextureNode;
static_cast<QSGSimpleTextureNode*>(node)->setFiltering(QSGTexture::Nearest);
}
//draw old frame first
QRectF tgtRect(0,0,width(), height());
QSize scaledSize;
scaledSize.setHeight(height()*currentScale);
scaledSize.setWidth(width()*currentScale);
static_cast<QSGSimpleTextureNode*>(node)->setRect(boundingRect());
Q_ASSERT(tex);
painter->drawPixmap(tgtRect, surface, tgtRect);
painter->drawPixmap(tgtRect, currentImage, tgtRect);
static_cast<QSGSimpleTextureNode*>(node)->setTexture(tex);
qDebug()<<"updatePaintNode() returning node";
return node;
}
#endif
......@@ -223,13 +221,13 @@ void DceScreenSaver::timerEvent(QTimerEvent *event)
void DceScreenSaver::beginZoom()
{
// zoomAnimation->setDuration(interval);
// zoomAnimation->start();
// zoomAnimation->setDuration(interval);
// zoomAnimation->start();
}
void DceScreenSaver::startFadeTimer(int time)
{
#ifndef RPI
#ifndef QT5
fadeAnimation->setDuration(time);
fadeAnimation->start();
#endif
......
......@@ -15,7 +15,7 @@
class DceScreenSaver :
#ifdef QT5
public QQuickPaintedItem
public QQuickItem
#else
public QDeclarativeItem
#endif
......@@ -34,7 +34,7 @@ class DceScreenSaver :
public:
#ifdef QT5
DceScreenSaver(QQuickPaintedItem *parent=0);
DceScreenSaver(QQuickItem *parent=0);
#else
DceScreenSaver(QDeclarativeItem *parent = 0);
#endif
......@@ -151,12 +151,9 @@ protected:
#ifdef QT4
void paint(QPainter *p ,const QStyleOptionGraphicsItem *option, QWidget *widget );
#elif QT5
void paint(QPainter *painter);
QSGNode* updatePaintNode(QSGNode *node, UpdatePaintNodeData*d) ;
#endif
void timerEvent(QTimerEvent *event);
};
QML_DECLARE_TYPE(DceScreenSaver)
......
......@@ -59,7 +59,6 @@ contains(QT_VERSION,5.*.*){
DEFINES+=GLENABLED
QT+= opengl script widgets
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
}
......@@ -102,7 +101,8 @@ TRANSLATIONS += app_de.ts
#linux deploy configuration
common-folder.source = qml/skins-common
common-folder.target = qml
common-folder.target = $$DESTDIR/qml
DEPLOYMENTFOLDERS+=common-folder
linux-g++{
......@@ -120,11 +120,11 @@ linux-g++{
}
contains(QT_VERSION,5.*.*){
folder_01.source = qml/rpi
folder_01.target = $$DESTDIR/qml
folder_01.source = qml/qt5-desktop
folder_01.target = $$DESTDIR/qml/
plugins_folder.source = imports/
plugins_folder.target = $$DESTDIR
glmsg=yes
glmsg=scenegraph
}
folder_03.source = config.xml
......
import QtQuick 2.0
import QtMultimedia 5.0
import AudioVisual 1.0
import QtMultimedia 5.0
Item {
width: 100
height: 62
anchors.fill: parent
// property alias videoPlayer:vplayer
property string currentMediaUrl:dceMediaController.fileUrl
// Keys.onPressed:{
// if(!activeFocus)
// return
// switch(event.key){
// case Qt.Key_Back:
// manager.changedPlaylistPosition((mediaplaylist.currentIndex-++1));
// break;
// case Qt.Key_Forward:
// manager.changedPlaylistPosition((mediaplaylist.currentIndex+1))
// break;
// case 16777347: /* Keycode Track forward */
// manager.changedPlaylistPosition((mediaplaylist.currentIndex+1));
// break;
// case 16777346: /* Keycode Track Backwards */
// manager.changedPlaylistPosition((mediaplaylist.currentIndex-1))
// break;
// case Qt.Key_Plus: /*Plus sign */
// manager.adjustVolume(+1)
// break;
// case Qt.Key_VolumeMute:
// manager.mute()
// break;
// case Qt.Key_M:
// manager.mute()
// break;
// case Qt.Key_Minus: /* Minus Sign */
// manager.adjustVolume(-1)
// break;
// case Qt.Key_T:
// if(playlist.state==="showing")
// playlist.state="hidden"
// else
// playlist.state = "showing"
// break;
// case Qt.Key_S:
// manager.stopMedia()
// break;
// case Qt.Key_Pause:
// manager.pauseMedia()
// break;
// case Qt.Key_P:
// manager.pauseMedia()
// break;
// case Qt.Key_PageUp:
// manager.changedPlaylistPosition(mediaplaylist.currentIndex-1)
// break;
// case Qt.Key_PageDown:
// manager.changedPlaylistPosition(mediaplaylist.currentIndex+1)
// break;
// default:
// console.log(event.key)
// break
// }
// }
MediaManager{
id:dceMediaController
incomingTime:player.position
onCurrentStatusChanged:logger.logMediaMessage("Media Player Status::"+dceMediaController.currentStatus)
onMediaBufferChanged: console.log("media buffer change:"+mediaBuffer)
onMediaPlayingChanged: console.log("Media Playback status changed locally "+mediaBuffer)
onCurrentStatusChanged:logger.logMediaMessage("Media Player Status::"+dceMediaController.currentStatus)
onMediaBufferChanged: console.log("media buffer change:"+mediaBuffer)
onMediaPlayingChanged: console.log("Media Playback status changed locally "+mediaBuffer)
Component.onCompleted: {
console.log("initializing media player "+manager.mediaPlayerID)
dceMediaController.setConnectionDetails(manager.mediaPlayerID, manager.m_ipAddress)
}
console.log("initializing media player "+manager.mediaPlayerID)
dceMediaController.setConnectionDetails(manager.mediaPlayerID, manager.m_ipAddress)
}
}
Connections{
target:manager
// onOrientationChanged:dceplayer.setWindowSize(manager.appHeight, manager.appWidth)
......@@ -35,16 +99,16 @@ Item {
MediaPlayer{
id:player
source: dceMediaController.fileUrl
onSourceChanged: if(source !==""){play()}
onSourceChanged:{ if(source !==""){play()}; console.log(source)}
}
VideoOutput{
id:videoPlane
}
// VideoOutput{
// id:videoPlane
// }
Audio{
id:audioPlayer
}
// Audio{
// id:audioPlayer
// }
}
import QtQuick 2.0
import QtGraphicalEffects 1.0
import "../../../skins-common/lib/components"
Item{
id:hdr
......
......@@ -8,7 +8,6 @@
*/
import QtQuick 2.0
import QtGraphicalEffects 1.0
import DceScreenSaver 1.0
import "components"
......@@ -52,9 +51,6 @@ Item {
}
}
FontLoader{
id:myFont
name:"Sawasdee"
......@@ -323,9 +319,12 @@ Item {
DceMedia{
id:dceplayer
anchors.top: parent.top
anchors.left:parent.left
anchors{
top:parent.top
bottom:parent.bottom
left:parent.left
right:parent.right
}
onFocusChanged: console.log("DCEPlayer Internal focus::"+focus)
onActiveFocusChanged: {
if(activeFocus){
......@@ -334,72 +333,10 @@ Item {
}
}
// onVolumeChanged:console.log(volume)
Keys.onVolumeDownPressed: manager.adjustVolume("-1")
Keys.onVolumeUpPressed: manager.adjustVolume("+1")
Keys.onTabPressed: ftr.forceActiveFocus()
Keys.onPressed: {
// Keys.onVolumeDownPressed: manager.adjustVolume("-1")
// Keys.onVolumeUpPressed: manager.adjustVolume("+1")
// Keys.onTabPressed: ftr.forceActiveFocus()
switch(event.key){
case Qt.Key_Back:
manager.changedPlaylistPosition((mediaplaylist.currentIndex-++1));
break;
case Qt.Key_Forward:
manager.changedPlaylistPosition((mediaplaylist.currentIndex+1))
break;
case 16777347: /* Keycode Track forward */
manager.changedPlaylistPosition((mediaplaylist.currentIndex+1));
break;
case 16777346: /* Keycode Track Backwards */
manager.changedPlaylistPosition((mediaplaylist.currentIndex-1))
break;
case Qt.Key_Plus: /*Plus sign */
manager.adjustVolume(+1)
break;
case Qt.Key_VolumeMute:
manager.mute()
break;
case Qt.Key_M:
manager.mute()
break;
case Qt.Key_Minus: /* Minus Sign */
manager.adjustVolume(-1)
break;
case Qt.Key_T:
if(playlist.state==="showing")
playlist.state="hidden"
else
playlist.state = "showing"
break;
case Qt.Key_S:
manager.stopMedia()
break;
case Qt.Key_Pause:
manager.pauseMedia()
break;
case Qt.Key_P:
manager.pauseMedia()
break;
case Qt.Key_PageUp:
manager.changedPlaylistPosition(mediaplaylist.currentIndex-1)
break;
case Qt.Key_PageDown:
manager.changedPlaylistPosition(mediaplaylist.currentIndex+1)
break;
default:
console.log(event.key)
break
}
}
}
Item{
......
......@@ -157,15 +157,16 @@ qorbiterManager::qorbiterManager(QDeclarativeView *view, QObject *parent) :
*/
#ifdef for_desktop
#ifdef QT4_8
buildType = "/qml/desktop";
#elif QT5 && !defined ANDROID
buildType = "/qml/rpi";
#endif
qrcPath = buildType+"/Splash.qml";
//mainView.setSource(QApplication::applicationDirPath()+qrcPath);
#endif
#ifdef WIN32
#ifdef QT4_8
buildType = "/qml/desktop";
#elif QT5 && defined RPI
buildType = "/qml/rpi";
#elif QT5 && !defined RPI
buildType="/qml/qt5-desktop";
#endif
qrcPath = buildType+"/Splash.qml";
#elif WIN32
buildType="/qml/desktop";
qrcPath = "qrc:desktop/Splash.qml";
#elif defined (for_freemantle)
......@@ -225,7 +226,7 @@ qorbiterManager::qorbiterManager(QDeclarativeView *view, QObject *parent) :
qmlPath = adjustPath(QApplication::applicationDirPath().remove("/bin"));
setApplicationPath(QApplication::applicationDirPath());
localDir = qmlPath.append(buildType);
qDebug() << "build type set to:: "<< buildType;
initializeGridModel(); //begins setup of media grid listmodel and its properties
initializeSortString(); //associated logic for navigating media grids
......@@ -294,6 +295,7 @@ void qorbiterManager::gotoQScreen(QString s)
emit clearModel();
emit cancelRequests();
emit resetFilter();
}
//send the qmlview a request to go to a screen, needs error handling
......@@ -440,6 +442,7 @@ bool qorbiterManager::initializeManager(string sRouterIP, int device_id)
#elif for_desktop
if(b_localLoading == true)
{
if( !loadSkins(QUrl(localDir)))
{
emit skinIndexReady(false);
......@@ -1433,10 +1436,7 @@ bool qorbiterManager::loadSkins(QUrl base)
setDceResponse("Skin Search Path:"+ desktopQmlPath.dirName());
localSkins = desktopQmlPath.entryList(QDir::Dirs |QDir::NoDotAndDotDot);
#ifdef QT_DEBUG
qDebug()<<"inside of skins we find" << localSkins.join(",");
#endif
tskinModel->addSkin(localSkins.join(","));
#endif
return true;
......
......@@ -326,5 +326,5 @@ RESOURCES += \
../../skinData.qrc
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../../../platforms/Android/qt5-pkg-src
message ($$ANDROID_PACKAGE_SOURCE_DIR)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment