Skip to content

Commit 0b36347

Browse files
dotblankEli Woods
authored and
Eli Woods
committed
Fix some buid issues on maemo, Also add some simple usability fixes
1 parent 21d90a7 commit 0b36347

10 files changed

+137
-53
lines changed

Groove.pro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ INCLUDEPATH += /usr/include/qjson /usr/include
1515
#INCLUDEPATH += ../qjson/src/
1616
#INCLUDEPATH += ./src/
1717
#LIBS += -L/usr/lib -lqjson ##Desktop Target
18-
LIBS += -L/usr/local/lib -lqjson -lmpg123 -lpulse-simple##Armel Target
18+
LIBS += -L/usr/local/lib -lqjson -lpulse-simple##Armel Target
1919
#LIBS += -L~/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1014-slim/usr/lib -lqjson ##Armel Target SDK
2020
#LIBS += -L../qjson/lib -lqjson ##X86 maemo
2121
QT += network
@@ -34,7 +34,8 @@ SOURCES += main.cpp \
3434
bottombar.cpp \
3535
vkb.cpp \
3636
searchresults.cpp \
37-
mpgplayer.cpp
37+
## mpgplayer.cpp
38+
plistwin.cpp
3839

3940
HEADERS += \
4041
groove.h \
@@ -48,7 +49,8 @@ HEADERS += \
4849
bottombar.h \
4950
vkb.h \
5051
searchresults.h \
51-
mpgplayer.h
52+
## mpgplayer.h
53+
plistwin.h
5254

5355
maemo5 {
5456
SOURCES += qmaemo5rotator.cpp

Makefile

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: groove
3-
# Generated by qmake (2.01a) (Qt 4.7.0) on: Sun Dec 5 22:41:24 2010
3+
# Generated by qmake (2.01a) (Qt 4.7.0) on: Wed Jan 5 17:21:15 2011
44
# Project: Groove.pro
55
# Template: app
66
# Command: /usr/bin/qmake -o Makefile Groove.pro
@@ -16,7 +16,7 @@ CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
1616
INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/phonon -I/usr/include/qt4 -I. -I/usr/include/qjson -I/usr/include -I/usr/include/qt4/phonon_compat -I. -I.
1717
LINK = g++
1818
LFLAGS = -Wl,-O1
19-
LIBS = $(SUBLIBS) -L/usr/lib -L/usr/local/lib -lqjson -lmpg123 -lpulse-simple -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread
19+
LIBS = $(SUBLIBS) -L/usr/lib -L/usr/local/lib -lqjson -lpulse-simple -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread
2020
AR = ar cqs
2121
RANLIB =
2222
QMAKE = /usr/bin/qmake
@@ -55,7 +55,7 @@ SOURCES = main.cpp \
5555
bottombar.cpp \
5656
vkb.cpp \
5757
searchresults.cpp \
58-
mpgplayer.cpp moc_groove.cpp \
58+
plistwin.cpp moc_groove.cpp \
5959
moc_gscom.cpp \
6060
moc_splayer.cpp \
6161
moc_streamio.cpp \
@@ -66,7 +66,7 @@ SOURCES = main.cpp \
6666
moc_bottombar.cpp \
6767
moc_vkb.cpp \
6868
moc_searchresults.cpp \
69-
moc_mpgplayer.cpp \
69+
moc_plistwin.cpp \
7070
qrc_res.cpp
7171
OBJECTS = main.o \
7272
groove.o \
@@ -80,7 +80,7 @@ OBJECTS = main.o \
8080
bottombar.o \
8181
vkb.o \
8282
searchresults.o \
83-
mpgplayer.o \
83+
plistwin.o \
8484
moc_groove.o \
8585
moc_gscom.o \
8686
moc_splayer.o \
@@ -92,7 +92,7 @@ OBJECTS = main.o \
9292
moc_bottombar.o \
9393
moc_vkb.o \
9494
moc_searchresults.o \
95-
moc_mpgplayer.o \
95+
moc_plistwin.o \
9696
qrc_res.o
9797
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
9898
/usr/share/qt4/mkspecs/common/unix.conf \
@@ -198,7 +198,7 @@ qmake: FORCE
198198

199199
dist:
200200
@$(CHK_DIR_EXISTS) .tmp/groove1.0.0 || $(MKDIR) .tmp/groove1.0.0
201-
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/groove1.0.0/ && $(COPY_FILE) --parents groove.h gscom.h splayer.h streamio.h playlist.h downloadmanager.h grooveprogressbar.h topbar.h bottombar.h vkb.h searchresults.h mpgplayer.h .tmp/groove1.0.0/ && $(COPY_FILE) --parents res.qrc .tmp/groove1.0.0/ && $(COPY_FILE) --parents main.cpp groove.cpp gscom.cpp splayer.cpp streamio.cpp playlist.cpp downloadmanager.cpp grooveprogressbar.cpp topbar.cpp bottombar.cpp vkb.cpp searchresults.cpp mpgplayer.cpp .tmp/groove1.0.0/ && $(COPY_FILE) --parents topbar.ui bottombar.ui vkb.ui searchresults.ui .tmp/groove1.0.0/ && (cd `dirname .tmp/groove1.0.0` && $(TAR) groove1.0.0.tar groove1.0.0 && $(COMPRESS) groove1.0.0.tar) && $(MOVE) `dirname .tmp/groove1.0.0`/groove1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/groove1.0.0
201+
$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/groove1.0.0/ && $(COPY_FILE) --parents groove.h gscom.h splayer.h streamio.h playlist.h downloadmanager.h grooveprogressbar.h topbar.h bottombar.h vkb.h searchresults.h plistwin.h .tmp/groove1.0.0/ && $(COPY_FILE) --parents res.qrc .tmp/groove1.0.0/ && $(COPY_FILE) --parents main.cpp groove.cpp gscom.cpp splayer.cpp streamio.cpp playlist.cpp downloadmanager.cpp grooveprogressbar.cpp topbar.cpp bottombar.cpp vkb.cpp searchresults.cpp plistwin.cpp .tmp/groove1.0.0/ && $(COPY_FILE) --parents topbar.ui bottombar.ui vkb.ui searchresults.ui .tmp/groove1.0.0/ && (cd `dirname .tmp/groove1.0.0` && $(TAR) groove1.0.0.tar groove1.0.0 && $(COMPRESS) groove1.0.0.tar) && $(MOVE) `dirname .tmp/groove1.0.0`/groove1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/groove1.0.0
202202

203203

204204
clean:compiler_clean
@@ -219,9 +219,9 @@ mocclean: compiler_moc_header_clean compiler_moc_source_clean
219219

220220
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
221221

222-
compiler_moc_header_make_all: moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_topbar.cpp moc_bottombar.cpp moc_vkb.cpp moc_searchresults.cpp moc_mpgplayer.cpp
222+
compiler_moc_header_make_all: moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_topbar.cpp moc_bottombar.cpp moc_vkb.cpp moc_searchresults.cpp moc_plistwin.cpp
223223
compiler_moc_header_clean:
224-
-$(DEL_FILE) moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_topbar.cpp moc_bottombar.cpp moc_vkb.cpp moc_searchresults.cpp moc_mpgplayer.cpp
224+
-$(DEL_FILE) moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_topbar.cpp moc_bottombar.cpp moc_vkb.cpp moc_searchresults.cpp moc_plistwin.cpp
225225
moc_groove.cpp: gscom.h \
226226
splayer.h \
227227
streamio.h \
@@ -231,6 +231,7 @@ moc_groove.cpp: gscom.h \
231231
topbar.h \
232232
vkb.h \
233233
bottombar.h \
234+
plistwin.h \
234235
groove.h
235236
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) groove.h -o moc_groove.cpp
236237

@@ -279,14 +280,10 @@ moc_vkb.cpp: vkb.h
279280
moc_searchresults.cpp: searchresults.h
280281
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) searchresults.h -o moc_searchresults.cpp
281282

282-
moc_mpgplayer.cpp: streamio.h \
283-
splayer.h \
284-
grooveprogressbar.h \
285-
qmaemo5rotator.h \
286-
playlist.h \
283+
moc_plistwin.cpp: playlist.h \
287284
gscom.h \
288-
mpgplayer.h
289-
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) mpgplayer.h -o moc_mpgplayer.cpp
285+
plistwin.h
286+
/usr/bin/moc-qt4 $(DEFINES) $(INCPATH) plistwin.h -o moc_plistwin.cpp
290287

291288
compiler_rcc_make_all: qrc_res.cpp
292289
compiler_rcc_clean:
@@ -348,7 +345,8 @@ main.o: main.cpp groove.h \
348345
playlist.h \
349346
topbar.h \
350347
vkb.h \
351-
bottombar.h
348+
bottombar.h \
349+
plistwin.h
352350
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
353351

354352
groove.o: groove.cpp groove.h \
@@ -361,15 +359,14 @@ groove.o: groove.cpp groove.h \
361359
topbar.h \
362360
vkb.h \
363361
bottombar.h \
364-
mpgplayer.h
362+
plistwin.h
365363
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o groove.o groove.cpp
366364

367365
gscom.o: gscom.cpp gscom.h
368366
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o gscom.o gscom.cpp
369367

370-
splayer.o: splayer.cpp mpgplayer.h \
368+
splayer.o: splayer.cpp splayer.h \
371369
streamio.h \
372-
splayer.h \
373370
grooveprogressbar.h \
374371
qmaemo5rotator.h \
375372
playlist.h \
@@ -412,14 +409,10 @@ searchresults.o: searchresults.cpp searchresults.h \
412409
ui_searchresults.h
413410
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o searchresults.o searchresults.cpp
414411

415-
mpgplayer.o: mpgplayer.cpp mpgplayer.h \
416-
streamio.h \
417-
splayer.h \
418-
grooveprogressbar.h \
419-
qmaemo5rotator.h \
412+
plistwin.o: plistwin.cpp plistwin.h \
420413
playlist.h \
421414
gscom.h
422-
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mpgplayer.o mpgplayer.cpp
415+
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o plistwin.o plistwin.cpp
423416

424417
moc_groove.o: moc_groove.cpp
425418
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_groove.o moc_groove.cpp
@@ -454,8 +447,8 @@ moc_vkb.o: moc_vkb.cpp
454447
moc_searchresults.o: moc_searchresults.cpp
455448
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_searchresults.o moc_searchresults.cpp
456449

457-
moc_mpgplayer.o: moc_mpgplayer.cpp
458-
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mpgplayer.o moc_mpgplayer.cpp
450+
moc_plistwin.o: moc_plistwin.cpp
451+
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_plistwin.o moc_plistwin.cpp
459452

460453
qrc_res.o: qrc_res.cpp
461454
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_res.o qrc_res.cpp

groove.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ groove::groove(QWidget *parent) :
110110

111111
connect(bBar,SIGNAL(back()),player,SLOT(back()));
112112
bBar->setPlaybackProgress(100,100);
113+
//pwindow = new pListWin(0);
114+
//pwindow->show();
113115

114116
}
115117
void groove::performSearch(QString s)
@@ -205,12 +207,13 @@ void groove::addSongPlaylist()
205207
pl->addSong(item);
206208
model->item(selected.first().row(),1)->setText("Added to Playlist");;
207209
}
210+
//pwindow->updateList();
208211
}
209212

210213
void groove::stop()
211214
{
212215
player->pause();
213-
mpg->pause();
216+
//mpg->pause();
214217
}
215218
void groove::moreB()
216219
{

groove.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
#include "topbar.h"
1313
#include "vkb.h"
1414
#include "bottombar.h"
15-
#include "mpgplayer.h"
15+
//#include "mpgplayer.h"
16+
#include "plistwin.h"
1617

1718
class groove : public QWidget
1819
{
@@ -36,7 +37,7 @@ private slots:
3637
void addSongPlaylist();
3738
void showOthers();
3839
private:
39-
mpgplayer *mpg;
40+
//mpgplayer *mpg;
4041
bottomBar *bBar;
4142
sPlayer *player;
4243
QMenuBar *mBar;
@@ -47,6 +48,7 @@ private slots:
4748
QPushButton *button;
4849
bool portrait;
4950
gscom *gs;
51+
pListWin *pwindow;
5052
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON)
5153
QMaemo5Rotator *rot;
5254
#endif

playlist.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ playlist::playlist(QObject *parent) :
1010
this->currentSkeyItem = -1;
1111
this->reply = NULL;
1212
}
13+
QList<playlist::songElement *>* playlist::getList()
14+
{
15+
return pList;
16+
}
17+
1318
void playlist::markPlayed(int position)
1419
{
1520
if(0 <= position && position < pList->size())

playlist.h

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,30 @@ class playlist : public QObject
1212
{
1313
Q_OBJECT
1414
public:
15+
enum elementType
16+
{
17+
EStream = 1,
18+
EFile = 2,
19+
};
1520
enum failType
1621
{
1722
none = 0,
1823
Aborted = 1,
1924
Other =2
2025
};
26+
struct songElement
27+
{
28+
QString *songId;
29+
QString *streamkey;
30+
QUrl *server;
31+
QBuffer *buffer;
32+
QIODevice *data;
33+
elementType type;
34+
bool downloaded;
35+
bool played;
36+
bool bufferready;
37+
};
38+
QList<songElement *>* getList();
2139
explicit playlist(QObject *parent = 0);
2240
int addSong(QStandardItem *item);
2341
QList<QStandardItem *> getPlaylist();
@@ -54,24 +72,9 @@ private slots:
5472
private:
5573

5674

57-
enum elementType
58-
{
59-
EStream = 1,
60-
EFile = 2,
61-
};
6275

63-
struct songElement
64-
{
65-
QString *songId;
66-
QString *streamkey;
67-
QUrl *server;
68-
QBuffer *buffer;
69-
QIODevice *data;
70-
elementType type;
71-
bool downloaded;
72-
bool played;
73-
bool bufferready;
74-
};
76+
77+
7578
int currentplayingitem;
7679
int currentSkeyItem;
7780
QList<songElement *> *pList;

plistwin.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#include "plistwin.h"
2+
#include <QStandardItemModel>
3+
4+
pListWin::pListWin(QWidget *parent) :
5+
QWidget(parent)
6+
{
7+
pview = new QTableView();
8+
QVBoxLayout *vlay = new QVBoxLayout();
9+
this->setLayout(vlay);
10+
vlay->addWidget(pview);
11+
}
12+
bool pListWin::setPlaylist(playlist *p)
13+
{
14+
if(p==0)
15+
return false;
16+
plist = p->getList();
17+
return true;
18+
}
19+
void pListWin::updateList()
20+
{
21+
if(!plist)
22+
return;
23+
if(!model)
24+
model = new QStandardItemModel(0,1);
25+
for(int i = 0; i < plist->count(); i++)
26+
{
27+
model->appendRow(new QStandardItem("test"));
28+
}
29+
pview->setModel(model);
30+
31+
}
32+

plistwin.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#ifndef PLISTWIN_H
2+
#define PLISTWIN_H
3+
4+
#include <QWidget>
5+
#include <QtGui>
6+
#include "playlist.h"
7+
8+
class pListWin : public QWidget
9+
{
10+
Q_OBJECT
11+
public:
12+
explicit pListWin(QWidget *parent = 0);
13+
bool setPlaylist(playlist*);
14+
void updateList();
15+
16+
signals:
17+
18+
public slots:
19+
20+
private:
21+
QTableView *pview;
22+
QList<playlist::songElement *> *plist;
23+
QStandardItemModel *model;
24+
25+
};
26+
27+
#endif // PLISTWIN_H

splayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "mpgplayer.h"
1+
#include "splayer.h"
22
#include <QFile>
33
sPlayer::sPlayer(QObject *parent) :
44
QObject(parent)

topbar.ui

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,22 @@
9292
<resources>
9393
<include location="res.qrc"/>
9494
</resources>
95-
<connections/>
95+
<connections>
96+
<connection>
97+
<sender>sBox</sender>
98+
<signal>returnPressed()</signal>
99+
<receiver>sButton</receiver>
100+
<slot>click()</slot>
101+
<hints>
102+
<hint type="sourcelabel">
103+
<x>271</x>
104+
<y>22</y>
105+
</hint>
106+
<hint type="destinationlabel">
107+
<x>453</x>
108+
<y>22</y>
109+
</hint>
110+
</hints>
111+
</connection>
112+
</connections>
96113
</ui>

0 commit comments

Comments
 (0)