Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merging with Cornelius Hald changes
  • Loading branch information
andreagrandi committed Jan 9, 2012
2 parents 8d51573 + 0a00d6c commit 70602bc
Show file tree
Hide file tree
Showing 15 changed files with 531 additions and 124 deletions.
2 changes: 1 addition & 1 deletion CuteSoma.desktop
Expand Up @@ -5,7 +5,7 @@ Type=Application
Terminal=false
Name=CuteSoma
Exec=/usr/bin/single-instance /opt/CuteSoma/bin/CuteSoma
Icon=/usr/share/icons/hicolor/scalable/apps/CuteSoma.svg
Icon=/usr/share/icons/hicolor/80x80/apps/CuteSoma.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
Binary file added CuteSoma.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 40 additions & 27 deletions CuteSoma.pro
@@ -1,11 +1,12 @@
# Add more folders to ship with the application, here
folder_01.source = qml/CuteSoma
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

QT+= declarative
QT+= network
symbian:TARGET.UID3 = 0xE6ACF247
symbian:TARGET.UID3 = 0xEEA50959

# Smart Installer package's UID
# This UID is from the protected range and therefore the package will
Expand All @@ -22,41 +23,53 @@ symbian:TARGET.CAPABILITY += NetworkServices
CONFIG += mobility
MOBILITY += multimedia

# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
CONFIG += qdeclarative-boostable

# Add dependency to Symbian components
# CONFIG += qt-components

# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp \
SOURCES += \
main.cpp \
servercomm.cpp \
playlistreader.cpp

HEADERS += \
servercomm.h \
playlistreader.h

RESOURCES += \
res.qrc

# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()

OTHER_FILES += \
qml/MainPage.qml \
qml/main.qml \
CuteSoma.desktop \
CuteSoma.svg \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
qml/ChannelsDelegate.qml \
qml/ChannelsModel.qml \
qml/ChannelPlayer.qml \
qml/About.qml

RESOURCES += \
res.qrc
qtc_packaging/debian_harmattan/changelog

# Please do not modify the following two lines. Required for deployment.
include(deployment.pri)
qtcAddDeployment()
contains(MEEGO_EDITION,harmattan) {
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications
INSTALLS += desktopfile
}

# enable booster
CONFIG += qdeclarative-boostable
QMAKE_CXXFLAGS += -fPIC -fvisibility=hidden -fvisibility-inlines-hidden
QMAKE_LFLAGS += -pie -rdynamic

HEADERS += \
servercomm.h \
playlistreader.h
contains(MEEGO_EDITION,harmattan) {
icon.files = $${TARGET}.png
icon.path = /usr/share/icons/hicolor/80x80/apps
INSTALLS += icon
}

#TODO: Create splash screen, then enable
#contains(MEEGO_EDITION,harmattan) {
# splash.files = splash.png
# splash.path = /opt/CuteSoma
# INSTALLS += splash
#}
24 changes: 9 additions & 15 deletions main.cpp
@@ -1,24 +1,18 @@
#include <QtGui/QApplication>
#include <QtDeclarative>
#include "qmlapplicationviewer.h"
#include "servercomm.h"

int main(int argc, char *argv[])
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDeclarativeView view;
view.setSource(QUrl("qrc:/qml/main.qml"));

QObject *root = (QObject*)(view.rootObject());
QScopedPointer<QApplication> app(createApplication(argc, argv));

ServerComm sc;
view.rootContext()->setContextProperty("serverComm", &sc);

QObject::connect(root, SIGNAL(play()), &sc, SLOT(play()));
QObject::connect(root, SIGNAL(pause()), &sc, SLOT(pause()));
QObject::connect(root, SIGNAL(loadChannel(QString)), &sc, SLOT(loadChannel(QString)));
QObject::connect((QObject*)view.engine(), SIGNAL(quit()), &app, SLOT(quit()));

view.showFullScreen();
QmlApplicationViewer viewer;
viewer.rootContext()->setContextProperty("serverComm", &sc);
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/CuteSoma/main.qml"));
viewer.showExpanded();

return app.exec();
return app->exec();
}
2 changes: 1 addition & 1 deletion qml/About.qml → qml/CuteSoma/About.qml
@@ -1,5 +1,5 @@
import QtQuick 1.0
import com.meego 1.0
import com.nokia.meego 1.0

Page
{
Expand Down
47 changes: 29 additions & 18 deletions qml/ChannelPlayer.qml → qml/CuteSoma/ChannelPlayer.qml
@@ -1,9 +1,12 @@
import QtQuick 1.0
import com.meego 1.0
import com.nokia.meego 1.0

Page
{
id: channelPlayer

property QtObject model: null

tools: backMenuTool

Connections
Expand All @@ -28,7 +31,7 @@ Page

onUpdateSong:
{
appWindow.updateChannelInfo(channelName);
serverComm.updateChannelInfo(model.channelName);
}
}

Expand All @@ -47,9 +50,13 @@ Page
Image
{
id: radioImageL
source: channelImage
source: model ? model.channelImageBig : ""
width: 310
height: 310
sourceSize.width: 310
sourceSize.height: 310
asynchronous: true
smooth: true
anchors.left: parent.left
anchors.leftMargin: 10
}
Expand All @@ -62,15 +69,15 @@ Page
Label
{
id: nameLabelL
text: channelName;
text: model ? model.channelName : ""
font.pixelSize: 34;
font.weight: Font.Bold;
}

Label
{
id: djLabelL
text: "Dj: " + channelDj;
text: "Dj: " + (model ? model.channelDj : "")
font.pixelSize: 25;
font.weight: Font.Light;
anchors.top: nameLabelL.bottom
Expand All @@ -80,7 +87,7 @@ Page
Label
{
id: descriptionLabelL
text: channelDescription;
text: model ? model.channelDescription : ""
font.pixelSize: 30;
font.weight: Font.Light;
width: channelPlayer.width - radioImageL.width - 20;
Expand All @@ -92,7 +99,7 @@ Page
Label
{
id: listenersLabelL
text: "Listeners: " + channelListeners;
text: "Listeners: " + (model ? model.channelListeners : "")
font.pixelSize: 25;
font.weight: Font.Light;
anchors.top: descriptionLabelL.bottom
Expand All @@ -102,7 +109,7 @@ Page
Label
{
id: songLabelL
text: song;
text: model ? model.song : ""
font.pixelSize: 25;
font.weight: Font.Bold;
anchors.top: listenersLabelL.bottom
Expand Down Expand Up @@ -147,7 +154,7 @@ Page
imgPlayL.visible = false;
imgPauseL.visible = true;

appWindow.play();
serverComm.play();
}
else
{
Expand All @@ -156,7 +163,7 @@ Page
imgPlayL.visible = true;
imgPauseL.visible = false;

appWindow.pause();
serverComm.pause();
}
}
}
Expand Down Expand Up @@ -187,9 +194,13 @@ Page
Image
{
id: radioImageP
source: channelImage
source: model ? model.channelImageBig : ""
width: 400
height: 400
sourceSize.height: 400
sourceSize.width: 400
asynchronous: true
smooth: true
anchors.top: parent.top
anchors.topMargin: 10
anchors.left: parent.left
Expand All @@ -206,15 +217,15 @@ Page
Label
{
id: nameLabelP
text: channelName;
text: model ? model.channelName : ""
font.pixelSize: 34;
font.weight: Font.Bold;
}

Label
{
id: djLabelP
text: "Dj: " + channelDj;
text: "Dj: " + (model ? model.channelDj : "")
font.pixelSize: 25;
font.weight: Font.Light;
anchors.top: nameLabelP.bottom
Expand All @@ -224,7 +235,7 @@ Page
Label
{
id: descriptionLabelP
text: channelDescription;
text: model ? model.channelDescription : ""
font.pixelSize: 25;
font.weight: Font.Light;
width: channelPlayer.width - 20
Expand All @@ -236,7 +247,7 @@ Page
Label
{
id: listenersLabelP
text: "Listeners: " + channelListeners;
text: "Listeners: " + (model ? model.channelListeners : "")
font.pixelSize: 25;
font.weight: Font.Light;
anchors.top: descriptionLabelP.bottom
Expand All @@ -246,7 +257,7 @@ Page
Label
{
id: songLabelP
text: song;
text: model ? model.song : ""
font.pixelSize: 25;
font.weight: Font.Bold;
anchors.top: listenersLabelP.bottom
Expand Down Expand Up @@ -293,7 +304,7 @@ Page
imgPlayL.visible = false;
imgPauseL.visible = true;

appWindow.play();
serverComm.play();
}
else
{
Expand All @@ -302,7 +313,7 @@ Page
imgPlayL.visible = true;
imgPauseL.visible = false;

appWindow.pause();
serverComm.pause();
}
}
}
Expand Down

0 comments on commit 70602bc

Please sign in to comment.