From 761d03eb0416a4ce1b43fb9c3d84342458c1c54f Mon Sep 17 00:00:00 2001 From: Elias Woods Date: Thu, 1 Jul 2010 01:39:08 -0400 Subject: [PATCH] Multiple download fix, Added pause button, Added next button Credit to w00t for catching memory bugs --- Groove.pro | 10 ++- Groove.pro.user | 39 +++++---- Makefile | 212 ++++++++++++++++++++++++------------------------- groove.cpp | 25 ++++-- groove.h | 4 + grooveprogressbar.cpp | 2 + grooveprogressbar.h | 5 +- playlist.cpp | 37 +++++---- playlist.h | 3 +- qmaemo5rotator.cpp | 11 +-- qmaemo5rotator.h | 2 - splayer.cpp | 15 ++++ splayer.h | 4 +- 13 files changed, 202 insertions(+), 167 deletions(-) diff --git a/Groove.pro b/Groove.pro index fa7f8d2..1444540 100644 --- a/Groove.pro +++ b/Groove.pro @@ -28,8 +28,7 @@ SOURCES += main.cpp \ streamio.cpp \ playlist.cpp \ downloadmanager.cpp \ - grooveprogressbar.cpp \ - qmaemo5rotator.cpp + grooveprogressbar.cpp HEADERS += \ groove.h \ @@ -38,9 +37,12 @@ HEADERS += \ streamio.h \ playlist.h \ downloadmanager.h \ - grooveprogressbar.h \ - qmaemo5rotator.h + grooveprogressbar.h +maemo5 { +SOURCES += qmaemo5rotator.cpp +HEADERS += qmaemo5rotator.h +} OTHER_FILES += \ icon.svg \ groove.png diff --git a/Groove.pro.user b/Groove.pro.user index ae4a94e..ecdfbb8 100644 --- a/Groove.pro.user +++ b/Groove.pro.user @@ -21,9 +21,7 @@ qmake QtProjectManager.QMakeBuildStep - - LIBS+=-L/usr/lib -lqjson - + Make @@ -44,7 +42,9 @@ 1 false - + + LD_LIBRARY_PATH=/usr/lib + Debug Qt4ProjectManager.Qt4BuildConfiguration 2 @@ -190,11 +190,11 @@ Qt4ProjectManager.MaemoRunConfiguration - 2010-05-16T00:55:48 + 2010-06-30T23:36:47 1 - 2010-06-25T21:36:22 + 2010-07-01T01:31:56 @@ -237,7 +237,7 @@ Debug Qt4ProjectManager.Qt4BuildConfiguration 2 - /scratchbox/users/eli/home/eli/qt4/Groove-build + /scratchbox/users/eli/home/eli/qt4/Groove-build-simulator 4 0 true @@ -271,25 +271,24 @@ Release Qt4ProjectManager.Qt4BuildConfiguration 0 - /scratchbox/users/eli/home/eli/qt4/Groove-build + /scratchbox/users/eli/home/eli/qt4/Groove-build-simulator 4 0 true 2 - - 2 - /home/eli/Projects/qt4/Groove-build/Groove - false - - LD_LIBRARY_PATH=/home/eli/NokiaQtSDK/QtCreator/lib/qtcreator:../qjson/lib/ - - - false - $BUILDDIR - Run /home/eli/Projects/qt4/Groove-build/Groove - ProjectExplorer.CustomExecutableRunConfiguration + Groove + Qt4ProjectManager.Qt4RunConfiguration + 2 + + Groove.pro + false + false + + false + false + 1 diff --git a/Makefile b/Makefile index 334586f..e226c11 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: groove -# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Jun 25 06:09:19 2010 +# Generated by qmake (2.01a) (Qt 4.6.2) on: Thu Jul 1 01:20:30 2010 # Project: Groove.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile Groove.pro @@ -10,13 +10,13 @@ CC = gcc CXX = g++ -DEFINES = -DQT_GL_NO_SCISSOR_TEST -DQT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024 -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -CFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES) -CXXFLAGS = -pipe -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wall -W -D_REENTRANT $(DEFINES) -INCPATH = -I/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5 -I. -I/targets/FREMANTLE_ARMEL/usr/include/QtCore -I/targets/FREMANTLE_ARMEL/usr/include/QtNetwork -I/targets/FREMANTLE_ARMEL/usr/include/QtGui -I/targets/FREMANTLE_ARMEL/usr/include/phonon -I/targets/FREMANTLE_ARMEL/usr/include -I. -I../qjson/src -I/usr/include/phonon_compat -I. +DEFINES = -DDATADIR="/usr/share" -DPKGDATADIR="" -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +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/qt4/phonon -I/usr/include/qt4 -I. -I/usr/include/qjson -I/usr/include/qt4/phonon_compat -I. LINK = g++ -LFLAGS = -Wl,-rpath-link,/usr/lib -Wl,-O1 -Wl,--hash-style=gnu -Wl,-rpath,/usr/lib -LIBS = $(SUBLIBS) -L/usr/lib -L~/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1014-slim/usr/lib -lqjson -lphonon -L/usr/lib -L/usr/X11R6/lib -lQtGui -lQtNetwork -lQtDBus -lQtXml -lQtCore -lpthread +LFLAGS = -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/lib -L/usr/local/lib -lqjson -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread AR = ar cqs RANLIB = QMAKE = /usr/bin/qmake @@ -50,16 +50,13 @@ SOURCES = main.cpp \ streamio.cpp \ playlist.cpp \ downloadmanager.cpp \ - grooveprogressbar.cpp \ - qmaemo5rotator.cpp moc_groove.cpp \ + grooveprogressbar.cpp moc_groove.cpp \ moc_gscom.cpp \ moc_splayer.cpp \ moc_streamio.cpp \ moc_playlist.cpp \ moc_downloadmanager.cpp \ - moc_grooveprogressbar.cpp \ - moc_qmaemo5rotator.cpp \ - qrc_reasource.cpp + moc_grooveprogressbar.cpp OBJECTS = main.o \ groove.o \ gscom.o \ @@ -68,34 +65,32 @@ OBJECTS = main.o \ playlist.o \ downloadmanager.o \ grooveprogressbar.o \ - qmaemo5rotator.o \ moc_groove.o \ moc_gscom.o \ moc_splayer.o \ moc_streamio.o \ moc_playlist.o \ moc_downloadmanager.o \ - moc_grooveprogressbar.o \ - moc_qmaemo5rotator.o \ - qrc_reasource.o -DIST = /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ + moc_grooveprogressbar.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ Groove.pro QMAKE_TARGET = groove DESTDIR = @@ -128,61 +123,59 @@ all: Makefile $(TARGET) $(TARGET): $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) -Makefile: Groove.pro /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/linux-g++-maemo5/qmake.conf /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf \ - /targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf \ +Makefile: Groove.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ /usr/lib/libphonon.prl \ - /usr/lib/libQtDBus.prl \ - /usr/lib/libQtXml.prl \ - /usr/lib/libQtCore.prl \ /usr/lib/libQtGui.prl \ - /usr/lib/libQtNetwork.prl + /usr/lib/libQtNetwork.prl \ + /usr/lib/libQtCore.prl $(QMAKE) -unix -o Makefile Groove.pro -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/unix.conf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/common/linux.conf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/qconfig.pri: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_functions.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt_config.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/exclusive_builds.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_pre.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/release.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/default_post.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/warn_on.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/qt.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/unix/thread.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/moc.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/resources.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/uic.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/yacc.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/lex.prf: -/targets/FREMANTLE_ARMEL/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/share/qt4/mkspecs/common/g++.conf: +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/release.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/share/qt4/mkspecs/features/include_source_dir.prf: /usr/lib/libphonon.prl: -/usr/lib/libQtDBus.prl: -/usr/lib/libQtXml.prl: -/usr/lib/libQtCore.prl: /usr/lib/libQtGui.prl: /usr/lib/libQtNetwork.prl: +/usr/lib/libQtCore.prl: qmake: FORCE @$(QMAKE) -unix -o Makefile Groove.pro dist: @$(CHK_DIR_EXISTS) .tmp/groove1.0.0 || $(MKDIR) .tmp/groove1.0.0 - $(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 qmaemo5rotator.h .tmp/groove1.0.0/ && $(COPY_FILE) --parents reasource.qrc .tmp/groove1.0.0/ && $(COPY_FILE) --parents main.cpp groove.cpp gscom.cpp splayer.cpp streamio.cpp playlist.cpp downloadmanager.cpp grooveprogressbar.cpp qmaemo5rotator.cpp .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 + $(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 .tmp/groove1.0.0/ && $(COPY_FILE) --parents main.cpp groove.cpp gscom.cpp splayer.cpp streamio.cpp playlist.cpp downloadmanager.cpp grooveprogressbar.cpp .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 clean:compiler_clean @@ -201,9 +194,9 @@ mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all -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_qmaemo5rotator.cpp +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 compiler_moc_header_clean: - -$(DEL_FILE) moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_qmaemo5rotator.cpp + -$(DEL_FILE) moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp moc_playlist.cpp moc_downloadmanager.cpp moc_grooveprogressbar.cpp moc_groove.cpp: gscom.h \ splayer.h \ streamio.h \ @@ -211,10 +204,10 @@ moc_groove.cpp: gscom.h \ qmaemo5rotator.h \ playlist.h \ groove.h - /usr/bin/moc $(DEFINES) $(INCPATH) groove.h -o moc_groove.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) groove.h -o moc_groove.cpp moc_gscom.cpp: gscom.h - /usr/bin/moc $(DEFINES) $(INCPATH) gscom.h -o moc_gscom.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gscom.h -o moc_gscom.cpp moc_splayer.cpp: streamio.h \ splayer.h \ @@ -223,7 +216,7 @@ moc_splayer.cpp: streamio.h \ playlist.h \ gscom.h \ splayer.h - /usr/bin/moc $(DEFINES) $(INCPATH) splayer.h -o moc_splayer.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splayer.h -o moc_splayer.cpp moc_streamio.cpp: splayer.h \ streamio.h \ @@ -232,29 +225,21 @@ moc_streamio.cpp: splayer.h \ playlist.h \ gscom.h \ streamio.h - /usr/bin/moc $(DEFINES) $(INCPATH) streamio.h -o moc_streamio.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) streamio.h -o moc_streamio.cpp moc_playlist.cpp: gscom.h \ playlist.h - /usr/bin/moc $(DEFINES) $(INCPATH) playlist.h -o moc_playlist.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) playlist.h -o moc_playlist.cpp moc_downloadmanager.cpp: downloadmanager.h - /usr/bin/moc $(DEFINES) $(INCPATH) downloadmanager.h -o moc_downloadmanager.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) downloadmanager.h -o moc_downloadmanager.cpp moc_grooveprogressbar.cpp: qmaemo5rotator.h \ grooveprogressbar.h - /usr/bin/moc $(DEFINES) $(INCPATH) grooveprogressbar.h -o moc_grooveprogressbar.cpp + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) grooveprogressbar.h -o moc_grooveprogressbar.cpp -moc_qmaemo5rotator.cpp: qmaemo5rotator.h - /usr/bin/moc $(DEFINES) $(INCPATH) qmaemo5rotator.h -o moc_qmaemo5rotator.cpp - -compiler_rcc_make_all: qrc_reasource.cpp +compiler_rcc_make_all: compiler_rcc_clean: - -$(DEL_FILE) qrc_reasource.cpp -qrc_reasource.cpp: reasource.qrc \ - icon.svg - /usr/bin/rcc -name reasource reasource.qrc -o qrc_reasource.cpp - compiler_image_collection_make_all: qmake_image_collection.cpp compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp @@ -268,7 +253,7 @@ compiler_yacc_impl_make_all: compiler_yacc_impl_clean: compiler_lex_make_all: compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_rcc_clean +compiler_clean: compiler_moc_header_clean ####### Compile @@ -320,9 +305,6 @@ grooveprogressbar.o: grooveprogressbar.cpp grooveprogressbar.h \ qmaemo5rotator.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o grooveprogressbar.o grooveprogressbar.cpp -qmaemo5rotator.o: qmaemo5rotator.cpp qmaemo5rotator.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qmaemo5rotator.o qmaemo5rotator.cpp - moc_groove.o: moc_groove.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_groove.o moc_groove.cpp @@ -344,12 +326,6 @@ moc_downloadmanager.o: moc_downloadmanager.cpp moc_grooveprogressbar.o: moc_grooveprogressbar.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_grooveprogressbar.o moc_grooveprogressbar.cpp -moc_qmaemo5rotator.o: moc_qmaemo5rotator.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qmaemo5rotator.o moc_qmaemo5rotator.cpp - -qrc_reasource.o: qrc_reasource.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_reasource.o qrc_reasource.cpp - ####### Install install_target: first FORCE @@ -362,9 +338,29 @@ uninstall_target: FORCE -$(DEL_DIR) $(INSTALL_ROOT)/usr/bin/ -install: install_target FORCE +install_desktop: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/hildon/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + -$(INSTALL_FILE) /scratchbox/users/eli/home/eli/qt4/Groove/groove.desktop $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +uninstall_desktop: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/hildon/groove.desktop + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +install_icon64: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + -$(INSTALL_FILE) /scratchbox/users/eli/home/eli/qt4/Groove/groove.png $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +uninstall_icon64: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/groove.png + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +install: install_target install_desktop install_icon64 FORCE -uninstall: uninstall_target FORCE +uninstall: uninstall_target uninstall_desktop uninstall_icon64 FORCE FORCE: diff --git a/groove.cpp b/groove.cpp index e857651..f8c30c0 100644 --- a/groove.cpp +++ b/groove.cpp @@ -1,5 +1,7 @@ #include "groove.h" +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" +#endif groove::groove(QWidget *parent) : @@ -14,9 +16,10 @@ groove::groove(QWidget *parent) : QVBoxLayout *vlayout = new QVBoxLayout(); QHBoxLayout *bottomLayout = new QHBoxLayout(); button = new QPushButton("Search"); - QPushButton *dButton = new QPushButton("Play"); - QPushButton *stopButton = new QPushButton("Stop"); + QPushButton *dButton = new QPushButton("Queue"); + QPushButton *stopButton = new QPushButton("Pause"); QPushButton *moreButton = new QPushButton("..."); + QPushButton *nextB = new QPushButton("->"); resultView = new QTableView(); QMenu *pushMenu = new QMenu(); //showFullScreen(); @@ -28,8 +31,8 @@ groove::groove(QWidget *parent) : pd = new grooveProgressBar(this); pd->hide(); QMenu *moreAction = new QMenu(); - moreAction->addAction("Playlist"); - connect(moreAction->addAction("Add current song to playlist"),SIGNAL(triggered()),this,SLOT(addSongPlaylist())); + //moreAction->addAction("Playlist"); + connect(moreAction->addAction("Play Now"),SIGNAL(triggered()),this,SLOT(play())); connect(moreAction->addAction("Show download Progress"),SIGNAL(triggered()),pd,SLOT(show())); moreButton->setMenu(moreAction); @@ -54,7 +57,10 @@ groove::groove(QWidget *parent) : resultView->setPalette(pal);*/ portrait = false; layout->addWidget(sMethod); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) rot = new QMaemo5Rotator(QMaemo5Rotator::AutomaticBehavior,this); +#endif + //this->setAttribute(Qt::WA_Maemo5AutoOrientation); layout->addWidget(lineEdit); layout->addWidget(button); vlayout->addLayout(layout); @@ -62,6 +68,7 @@ groove::groove(QWidget *parent) : vlayout->addLayout(bottomLayout); bottomLayout->addWidget(dButton); bottomLayout->addWidget(stopButton); + bottomLayout->addWidget(nextB); bottomLayout->addWidget(moreButton); vlayout->setMenuBar(mBar); setLayout(vlayout); @@ -73,7 +80,7 @@ groove::groove(QWidget *parent) : connect(gs, SIGNAL(finishedSearch()), this, SLOT(finishedS())); connect(lineEdit,SIGNAL(returnPressed()),this, SLOT(search())); connect(pushMenu,SIGNAL(triggered(QAction*)),this,SLOT(changeS(QAction*))); - connect(dButton,SIGNAL(clicked()),this, SLOT(play())); + connect(dButton,SIGNAL(clicked()),this, SLOT(addSongPlaylist())); connect(stopButton,SIGNAL(clicked()),this,SLOT(stop())); connect(moreButton,SIGNAL(clicked()),this,SLOT(moreB())); //connect(rotator,SIGNAL(orientationChanged(Orientation)),this,SLOT(orientationChanged())); @@ -82,6 +89,10 @@ groove::groove(QWidget *parent) : player->setPlaylist(pl); connect(pl,SIGNAL(downloadProgress(int,qint64,qint64)),this,SLOT(progressUpdate(int,qint64,qint64))); connect(pl,SIGNAL(bufferReady(int)),pd,SLOT(close())); + connect(pl,SIGNAL(freeze(bool)),resultView,SLOT(setDisabled(bool))); + connect(pl,SIGNAL(freeze(bool)),pushMenu,SLOT(setDisabled(bool))); + connect(pl,SIGNAL(freeze(bool)),dButton,SLOT(setDisabled(bool))); + connect(nextB,SIGNAL(clicked()),player,SLOT(playNext())); } void groove::search() { @@ -169,7 +180,7 @@ void groove::addSongPlaylist() void groove::stop() { - player->stop(); + player->pause(); } void groove::moreB() { @@ -179,6 +190,8 @@ void groove::progressUpdate(int p, qint64 d, qint64 t) { //if(!pd->isHidden()) //{ + + pd->setMaximum(t); pd->setValue(d); //} diff --git a/groove.h b/groove.h index 3bb0000..4abda41 100644 --- a/groove.h +++ b/groove.h @@ -3,7 +3,9 @@ #include #include "gscom.h" #include "splayer.h" +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" +#endif #include #include "playlist.h" #include "grooveprogressbar.h" @@ -37,7 +39,9 @@ private: QPushButton *button; bool portrait; gscom *gs; +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) QMaemo5Rotator *rot; +#endif playlist *pl; grooveProgressBar *pd; diff --git a/grooveprogressbar.cpp b/grooveprogressbar.cpp index 2817e83..e63a4d8 100644 --- a/grooveprogressbar.cpp +++ b/grooveprogressbar.cpp @@ -1,5 +1,7 @@ #include "grooveprogressbar.h" +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" +#endif grooveProgressBar::grooveProgressBar(QWidget *parent) : QDialog(parent) { diff --git a/grooveprogressbar.h b/grooveprogressbar.h index d0067fd..6887b52 100644 --- a/grooveprogressbar.h +++ b/grooveprogressbar.h @@ -3,8 +3,9 @@ #include #include +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) #include "qmaemo5rotator.h" - +#endif class grooveProgressBar : public QDialog { Q_OBJECT @@ -13,7 +14,9 @@ public: void setMaximum(int maximum); void setValue(int position); int maximum(); +#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) QMaemo5Rotator *rot; +#endif signals: diff --git a/playlist.cpp b/playlist.cpp index 10f7d49..3004f86 100644 --- a/playlist.cpp +++ b/playlist.cpp @@ -8,6 +8,7 @@ playlist::playlist(QObject *parent) : pList = new QList; this->currentplayingitem = -1; this->currentSkeyItem = -1; + this->reply = NULL; } void playlist::markPlayed(int position) { @@ -16,7 +17,7 @@ void playlist::markPlayed(int position) } void playlist::freeMemory(int position) { - pList->at(position)->buffer->~QBuffer(); + delete pList->at(position)->buffer; pList->at(position)->buffer = new QBuffer(); } bool playlist::existAt(int position) @@ -70,7 +71,11 @@ void playlist::beginDownload(int position) req.setUrl(*pList->at(currentdownloaditem)->server); qDebug() << pList->at(currentdownloaditem)->server; req.setHeader(req.ContentTypeHeader,QVariant("application/x-www-form-urlencoded")); - delete reply; + if(reply) + { + reply->abort(); + delete reply; + } reply = manager->post(req,QString("streamKey=" + pList->at(this->currentdownloaditem)->streamkey->toAscii()).toAscii()); pList->at(this->currentdownloaditem)->buffer->open(QBuffer::ReadWrite | QBuffer::Truncate); connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(downloadSlot(qint64,qint64))); @@ -86,7 +91,7 @@ void playlist::setGscom(gscom *comm) } void playlist::skeyFound() { - emit this->unfreeze(); + emit this->freeze(false); pList->at(this->currentSkeyItem)->streamkey = new QString(gs->streamID); pList->at(this->currentSkeyItem)->server = new QUrl(gs->sku); if(this->currentdownloaditem == -1) @@ -110,8 +115,9 @@ int playlist::addSong(QStandardItem *item) newelement->type = playlist::EStream; pList->append(newelement); gs->getSong(item->text()); - emit this->freeze(); + this->currentSkeyItem = pList->size()-1; + emit this->freeze(true); return pList->size()-1; } @@ -145,20 +151,23 @@ void playlist::downloadSlot(qint64 b, qint64 t) if(t != 0) { emit this->downloadProgress(this->currentdownloaditem,b,t); - pList->at(this->currentdownloaditem)->buffer->buffer().append(reply->readAll()); - //qDebug() << !pList->at(this->currentdownloaditem)->bufferready << this->currentdownloaditem; - if ( b >= t*0.05 && !pList->at(this->currentdownloaditem)->bufferready) - //if(!pList->at(currentdownloaditem)->bufferready && b/(startStreamT.msecsTo(QTime::currentTime()) + 1)*100/1024 >= 10) + if(existAt(this->currentdownloaditem)) { - this->setBufferRdy(this->currentdownloaditem); - emit this->bufferReady(this->currentdownloaditem); + pList->at(this->currentdownloaditem)->buffer->buffer().append(reply->readAll()); + //qDebug() << !pList->at(this->currentdownloaditem)->bufferready << this->currentdownloaditem; + if ( b >= t*0.05 && !pList->at(this->currentdownloaditem)->bufferready) + //if(!pList->at(currentdownloaditem)->bufferready && b/(startStreamT.msecsTo(QTime::currentTime()) + 1)*100/1024 >= 10) + { + this->setBufferRdy(this->currentdownloaditem); + emit this->bufferReady(this->currentdownloaditem); - qDebug() << "Buffer Ready"; - } - if (b==t) - { + qDebug() << "Buffer Ready"; + } + if (b==t) + { emit this->downloadComplete(this->currentdownloaditem); //emit this->bufferReady(this->currentdownloaditem); + } } } } diff --git a/playlist.h b/playlist.h index 4365d8d..2fe1acb 100644 --- a/playlist.h +++ b/playlist.h @@ -41,8 +41,7 @@ signals: void bufferReady(int position); void sFailure(int position,failType); void downloadComplete(int position); - void freeze(); - void unfreeze(); + void freeze(bool); public slots: private slots: diff --git a/qmaemo5rotator.cpp b/qmaemo5rotator.cpp index 78cbe6a..7515550 100644 --- a/qmaemo5rotator.cpp +++ b/qmaemo5rotator.cpp @@ -5,7 +5,7 @@ #include #include #include -#endif + QMaemo5Rotator::QMaemo5Rotator(RotationBehavior behavior, QWidget *parent) : QObject(parent), @@ -16,9 +16,7 @@ QMaemo5Rotator::QMaemo5Rotator(RotationBehavior behavior, QWidget *parent) QMaemo5Rotator::~QMaemo5Rotator() { -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) QDBusConnection::systemBus().call(QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, MCE_ACCELEROMETER_DISABLE_REQ)); -#endif } const QMaemo5Rotator::RotationBehavior QMaemo5Rotator::currentBehavior() @@ -33,7 +31,6 @@ const QMaemo5Rotator::Orientation QMaemo5Rotator::currentOrientation() void QMaemo5Rotator::setCurrentBehavior(QMaemo5Rotator::RotationBehavior value) { -#if defined(Q_WS_MAEMO_5) || defined(Q_WS_HILDON) if (value == _currentBehavior && isSetUp) return; @@ -58,7 +55,6 @@ void QMaemo5Rotator::setCurrentBehavior(QMaemo5Rotator::RotationBehavior value) setCurrentOrientation(QMaemo5Rotator::LandscapeOrientation); } } -#endif } void QMaemo5Rotator::setCurrentOrientation(QMaemo5Rotator::Orientation value) @@ -71,20 +67,16 @@ void QMaemo5Rotator::setCurrentOrientation(QMaemo5Rotator::Orientation value) case QMaemo5Rotator::PortraitOrientation: if (par != NULL) { -#if defined(Q_WS_MAEMO_5) par->setAttribute(Qt::WA_Maemo5LandscapeOrientation, false); par->setAttribute(Qt::WA_Maemo5PortraitOrientation, true); -#endif } orientationChanged(QMaemo5Rotator::PortraitOrientation); break; case QMaemo5Rotator::LandscapeOrientation: if (par != NULL) { -#if defined(Q_WS_MAEMO_5) par->setAttribute(Qt::WA_Maemo5PortraitOrientation, false); par->setAttribute(Qt::WA_Maemo5LandscapeOrientation, true); -#endif } orientationChanged(QMaemo5Rotator::LandscapeOrientation); @@ -104,3 +96,4 @@ void QMaemo5Rotator::on_orientation_changed(const QString& newOrientation) } QApplication::desktop()->updateGeometry(); } +#endif diff --git a/qmaemo5rotator.h b/qmaemo5rotator.h index 0e63bf7..82b2afa 100644 --- a/qmaemo5rotator.h +++ b/qmaemo5rotator.h @@ -1,6 +1,5 @@ #ifndef QMAEMO5ROTATOR_H #define QMAEMO5ROTATOR_H - //---------- // Provides a means of WORKING automatic rotation for Maemo 5 apps. (The default Qt solution is buggy.) //---------- @@ -54,5 +53,4 @@ signals: void orientationChanged(Orientation orientation); }; - #endif // QMAEMO5ROTATOR_H diff --git a/splayer.cpp b/splayer.cpp index 16c8ec3..a59899d 100644 --- a/splayer.cpp +++ b/splayer.cpp @@ -34,6 +34,21 @@ void sPlayer::markComplete() else pl->setCurrentPlaying(-1); } +void sPlayer::pause() +{ + if(media->state() == Phonon::PausedState) + media->play(); + if(media->state() == Phonon::PlayingState) + media->pause(); +} +void sPlayer::playNext() +{ + if(pl->existAt(pl->currentplaying()+1)) + { + media->stop(); + this->markComplete(); + } +} sPlayer::~sPlayer() { diff --git a/splayer.h b/splayer.h index 5c3e18a..6d41fd6 100644 --- a/splayer.h +++ b/splayer.h @@ -15,9 +15,10 @@ class sPlayer : public QObject public: explicit sPlayer(QObject *parent = 0); void play(int p); - void playNext(); + void play(); void stop(); + void pause(); void setPlaylist(playlist *playList); ~sPlayer(); @@ -26,6 +27,7 @@ signals: void downloadComplete(); public slots: void start(int p); + void playNext(); void putb(int p,qint64,qint64); void abortDownload(); private slots: -- 1.7.9.5