From 2023a504eae2a6023e99f4782a501b71455cdc7d Mon Sep 17 00:00:00 2001 From: Elias Woods Date: Fri, 4 Jun 2010 17:07:59 -0400 Subject: [PATCH] new file: Groove.pro new file: Groove.pro.user new file: Makefile new file: control new file: debian/README.Debian new file: debian/README.source new file: debian/changelog new file: debian/compat new file: debian/control new file: debian/copyright new file: debian/cron.d.ex new file: debian/docs new file: debian/emacsen-install.ex new file: debian/emacsen-remove.ex new file: debian/emacsen-startup.ex new file: debian/groove.default.ex new file: debian/groove.doc-base.EX new file: debian/init.d.ex new file: debian/init.d.lsb.ex new file: debian/manpage.1.ex new file: debian/manpage.sgml.ex new file: debian/manpage.xml.ex new file: debian/menu.ex new file: debian/postinst.ex new file: debian/postrm.ex new file: debian/preinst.ex new file: debian/prerm.ex new file: debian/rules new file: debian/watch.ex new file: groove.cpp new file: groove.h new file: gscom.cpp new file: gscom.h new file: main.cpp new file: splayer.cpp new file: splayer.h new file: streamio.cpp new file: streamio.h --- Groove.pro | 34 +++++ Groove.pro.user | 305 ++++++++++++++++++++++++++++++++++++++ Makefile | 278 ++++++++++++++++++++++++++++++++++ control | 13 ++ debian/README.Debian | 6 + debian/README.source | 9 ++ debian/changelog | 5 + debian/compat | 1 + debian/control | 14 ++ debian/copyright | 35 +++++ debian/cron.d.ex | 4 + debian/emacsen-install.ex | 45 ++++++ debian/emacsen-remove.ex | 15 ++ debian/emacsen-startup.ex | 25 ++++ debian/groove.default.ex | 10 ++ debian/groove.doc-base.EX | 20 +++ debian/init.d.ex | 157 ++++++++++++++++++++ debian/init.d.lsb.ex | 296 +++++++++++++++++++++++++++++++++++++ debian/manpage.1.ex | 59 ++++++++ debian/manpage.sgml.ex | 154 +++++++++++++++++++ debian/manpage.xml.ex | 291 ++++++++++++++++++++++++++++++++++++ debian/menu.ex | 2 + debian/postinst.ex | 39 +++++ debian/postrm.ex | 37 +++++ debian/preinst.ex | 35 +++++ debian/prerm.ex | 38 +++++ debian/rules | 13 ++ debian/watch.ex | 23 +++ groove.cpp | 128 ++++++++++++++++ groove.h | 35 +++++ gscom.cpp | 360 +++++++++++++++++++++++++++++++++++++++++++++ gscom.h | 56 +++++++ main.cpp | 15 ++ splayer.cpp | 127 ++++++++++++++++ splayer.h | 36 +++++ streamio.cpp | 32 ++++ streamio.h | 29 ++++ 37 files changed, 2781 insertions(+) create mode 100644 Groove.pro create mode 100644 Groove.pro.user create mode 100644 Makefile create mode 100644 control create mode 100644 debian/README.Debian create mode 100644 debian/README.source create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/cron.d.ex create mode 100644 debian/docs create mode 100644 debian/emacsen-install.ex create mode 100644 debian/emacsen-remove.ex create mode 100644 debian/emacsen-startup.ex create mode 100644 debian/groove.default.ex create mode 100644 debian/groove.doc-base.EX create mode 100644 debian/init.d.ex create mode 100644 debian/init.d.lsb.ex create mode 100644 debian/manpage.1.ex create mode 100644 debian/manpage.sgml.ex create mode 100644 debian/manpage.xml.ex create mode 100644 debian/menu.ex create mode 100644 debian/postinst.ex create mode 100644 debian/postrm.ex create mode 100644 debian/preinst.ex create mode 100644 debian/prerm.ex create mode 100755 debian/rules create mode 100644 debian/watch.ex create mode 100644 groove.cpp create mode 100644 groove.h create mode 100644 gscom.cpp create mode 100644 gscom.h create mode 100755 main.cpp create mode 100644 splayer.cpp create mode 100644 splayer.h create mode 100644 streamio.cpp create mode 100644 streamio.h diff --git a/Groove.pro b/Groove.pro new file mode 100644 index 0000000..2762e5f --- /dev/null +++ b/Groove.pro @@ -0,0 +1,34 @@ +###################################################################### +# Automatically generated by qmake (2.01a) Tue May 11 00:18:10 2010 +###################################################################### + +TEMPLATE = app +TARGET = groove +#target = groove +target.path = /usr/bin +#//target.path = /usr/local/ +INSTALLS += target +#CONFIG += build_all +DEPENDPATH += . +INCLUDEPATH += . +INCLUDEPATH += /usr/include/qjson +#INCLUDEPATH += ../qjson/src/ +#INCLUDEPATH += ./src/ +LIBS += -L/usr/lib -lqjson ##Desktop Target +#LIBS += -L/usr/local/lib -lqjson ##Armel Target +#LIBS += -L~/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1014-slim/usr/lib -lqjson ##Armel Target SDK +#LIBS += -L../qjson/lib -lqjson ##X86 maemo +QT += network +QT += phonon +# Input +SOURCES += main.cpp \ + groove.cpp \ + gscom.cpp \ + splayer.cpp \ + streamio.cpp + +HEADERS += \ + groove.h \ + gscom.h \ + splayer.h \ + streamio.h diff --git a/Groove.pro.user b/Groove.pro.user new file mode 100644 index 0000000..381d0a1 --- /dev/null +++ b/Groove.pro.user @@ -0,0 +1,305 @@ + + + + ProjectExplorer.Project.ActiveTarget + 1 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + LIBS+=-L/usr/lib -lqjson + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/eli/Projects/qt-build + 2 + 0 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /scratchbox/users/eli/home/eli/qt4/Groove-build + 2 + 0 + true + + 2 + + Groove + Qt4ProjectManager.Qt4RunConfiguration + 2 + + Groove.pro + false + false + + LD_LIBRARY_PATH=/home/eli/NokiaQtSDK/QtCreator/lib/qtcreator:../qjson-build/lib/ + + false + false + + + 1 + + + + ProjectExplorer.Project.Target.1 + + Maemo + Qt4ProjectManager.Target.MaemoDeviceTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + LIBS+=-L~/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1014-slim/usr/lib -lqjson + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /scratchbox/users/eli/home/eli/qt4/Groove-build + 5 + 9 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /scratchbox/users/eli/home/eli/qt4/Groove-build + 5 + 9 + true + + 2 + + Groove.pro + Groove on Maemo device + Qt4ProjectManager.MaemoRunConfiguration + + + 2010-05-16T00:55:48 + + 1 + + 2010-05-27T11:12:48 + + + + 1 + + + + ProjectExplorer.Project.Target.2 + + Qt Simulator + Qt4ProjectManager.Target.QtSimulatorTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /scratchbox/users/eli/home/eli/qt4/Groove-build + 4 + 0 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /scratchbox/users/eli/home/eli/qt4/Groove-build + 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 + + 1 + + + + ProjectExplorer.Project.TargetCount + 3 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..eec5371 --- /dev/null +++ b/Makefile @@ -0,0 +1,278 @@ +############################################################################# +# Makefile for building: groove +# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Jun 4 15:49:00 2010 +# Project: Groove.pro +# Template: app +# Command: /usr/bin/qmake -unix -o Makefile Groove.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -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,-O1 +LIBS = $(SUBLIBS) -L/usr/lib -L/usr/lib -lqjson -lphonon -lQtGui -lQtNetwork -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = main.cpp \ + groove.cpp \ + gscom.cpp \ + splayer.cpp \ + streamio.cpp moc_groove.cpp \ + moc_gscom.cpp \ + moc_splayer.cpp \ + moc_streamio.cpp +OBJECTS = main.o \ + groove.o \ + gscom.o \ + splayer.o \ + streamio.o \ + moc_groove.o \ + moc_gscom.o \ + moc_splayer.o \ + moc_streamio.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 = +TARGET = groove + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +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/libQtGui.prl \ + /usr/lib/libQtNetwork.prl \ + /usr/lib/libQtCore.prl + $(QMAKE) -unix -o Makefile Groove.pro +/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/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 .tmp/groove1.0.0/ && $(COPY_FILE) --parents main.cpp groove.cpp gscom.cpp splayer.cpp streamio.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 + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +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 +compiler_moc_header_clean: + -$(DEL_FILE) moc_groove.cpp moc_gscom.cpp moc_splayer.cpp moc_streamio.cpp +moc_groove.cpp: gscom.h \ + splayer.h \ + streamio.h \ + groove.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) groove.h -o moc_groove.cpp + +moc_gscom.cpp: gscom.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gscom.h -o moc_gscom.cpp + +moc_splayer.cpp: streamio.h \ + splayer.h \ + splayer.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) splayer.h -o moc_splayer.cpp + +moc_streamio.cpp: splayer.h \ + streamio.h \ + streamio.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) streamio.h -o moc_streamio.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean + +####### Compile + +main.o: main.cpp groove.h \ + gscom.h \ + splayer.h \ + streamio.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp + +groove.o: groove.cpp groove.h \ + gscom.h \ + splayer.h \ + streamio.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o groove.o groove.cpp + +gscom.o: gscom.cpp gscom.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gscom.o gscom.cpp + +splayer.o: splayer.cpp splayer.h \ + streamio.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o splayer.o splayer.cpp + +streamio.o: streamio.cpp streamio.h \ + splayer.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o streamio.o streamio.cpp + +moc_groove.o: moc_groove.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_groove.o moc_groove.cpp + +moc_gscom.o: moc_gscom.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gscom.o moc_gscom.cpp + +moc_splayer.o: moc_splayer.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_splayer.o moc_splayer.cpp + +moc_streamio.o: moc_streamio.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_streamio.o moc_streamio.cpp + +####### Install + +install_target: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/bin/ + -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(STRIP) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + +uninstall_target: FORCE + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) $(INSTALL_ROOT)/usr/bin/ + + +install: install_target FORCE + +uninstall: uninstall_target FORCE + +FORCE: + diff --git a/control b/control new file mode 100644 index 0000000..4ff60c0 --- /dev/null +++ b/control @@ -0,0 +1,13 @@ +Source: groove +Section: unknown +Priority: extra +Maintainer: Elias Woods +Build-Depends: debhelper (>= 7) +Standards-Version: 3.8.3 +Homepage: None Yet + +Package: groove +Architecture: amd64 +Depends: libqjson0, libqt4-gui, libqt4-core, libqt4-network, libqt4-phonon, phonon, phonon-backend-gstreamer, ${shlibs:Depends}, ${misc:Depends} +Description: Groove - A grooveshark client for linux + A grooveshark client written qt4 diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..482ab4a --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +groove for Debian +----------------- + + + + -- Elias Woods Thu, 03 Jun 2010 20:06:24 -0400 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000..e7af138 --- /dev/null +++ b/debian/README.source @@ -0,0 +1,9 @@ +groove for Debian +----------------- + + + + + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..b4693bd --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +groove (0.0.1-2) lucid; urgency=low + + * Initial release (Closes: #nnnn) + + -- Elias Woods Thu, 03 Jun 2010 20:06:24 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..ff0c6ec --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: groove +Section: universe/misc +Priority: extra +Maintainer: Elias Woods +Build-Depends: debhelper (>= 7), libqjson-dev, libqt4-dev, libqt4-phonon-dev +Standards-Version: 3.8.3 +Homepage: None Yet + +Package: groove +Architecture: any +Depends: libqjson0, libqt4-gui, libqt4-core, libqt4-network, libqt4-phonon, phonon, phonon-backend-gstreamer, ${shlibs:Depends}, ${misc:Depends} +Build-Depends: libqjson-dev, libqt4-dev, libqt4-phonon-dev +Description: Groove - A grooveshark client for linux + A grooveshark client written qt4 diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..38727f2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,35 @@ +This work was packaged for Debian by: + + Elias Woods on Thu, 03 Jun 2010 20:06:24 -0400 + +It was downloaded from + +Upstream Author(s): + + + + +Copyright: + + + + +License: + + + +The Debian packaging is: + + Copyright (C) 2010 Elias Woods + +# Please chose a license for your packaging work. If the program you package +# uses a mainstream license, using the same license is the safest choice. +# Please avoid to pick license terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. +# If you just want it to be GPL version 3, leave the following lines in. + +and is licensed under the GPL version 3, +see `/usr/share/common-licenses/GPL-3'. + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/debian/cron.d.ex b/debian/cron.d.ex new file mode 100644 index 0000000..9075a8f --- /dev/null +++ b/debian/cron.d.ex @@ -0,0 +1,4 @@ +# +# Regular cron jobs for the groove package +# +0 4 * * * root [ -x /usr/bin/groove_maintenance ] && /usr/bin/groove_maintenance diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/emacsen-install.ex b/debian/emacsen-install.ex new file mode 100644 index 0000000..68dae2f --- /dev/null +++ b/debian/emacsen-install.ex @@ -0,0 +1,45 @@ +#! /bin/sh -e +# /usr/lib/emacsen-common/packages/install/groove + +# Written by Jim Van Zandt , borrowing heavily +# from the install scripts for gettext by Santiago Vila +# and octave by Dirk Eddelbuettel . + +FLAVOR=$1 +PACKAGE=groove + +if [ ${FLAVOR} = emacs ]; then exit 0; fi + +echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} + +#FLAVORTEST=`echo $FLAVOR | cut -c-6` +#if [ ${FLAVORTEST} = xemacs ] ; then +# SITEFLAG="-no-site-file" +#else +# SITEFLAG="--no-site-file" +#fi +FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" + +ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} + +# Install-info-altdir does not actually exist. +# Maybe somebody will write it. +if test -x /usr/sbin/install-info-altdir; then + echo install/${PACKAGE}: install Info links for ${FLAVOR} + install-info-altdir --quiet --section "" "" --dirname=${FLAVOR} /usr/share/info/${PACKAGE}.info.gz +fi + +install -m 755 -d ${ELCDIR} +cd ${ELDIR} +FILES=`echo *.el` +cp ${FILES} ${ELCDIR} +cd ${ELCDIR} + +cat << EOF > path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF +${FLAVOR} ${FLAGS} ${FILES} +rm -f *.el path.el + +exit 0 diff --git a/debian/emacsen-remove.ex b/debian/emacsen-remove.ex new file mode 100644 index 0000000..4162715 --- /dev/null +++ b/debian/emacsen-remove.ex @@ -0,0 +1,15 @@ +#!/bin/sh -e +# /usr/lib/emacsen-common/packages/remove/groove + +FLAVOR=$1 +PACKAGE=groove + +if [ ${FLAVOR} != emacs ]; then + if test -x /usr/sbin/install-info-altdir; then + echo remove/${PACKAGE}: removing Info links for ${FLAVOR} + install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/share/info/groove.info.gz + fi + + echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} + rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} +fi diff --git a/debian/emacsen-startup.ex b/debian/emacsen-startup.ex new file mode 100644 index 0000000..f778c78 --- /dev/null +++ b/debian/emacsen-startup.ex @@ -0,0 +1,25 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file, e.g. /etc/emacs/site-start.d/50groove.el +;; for the Debian groove package +;; +;; Originally contributed by Nils Naumann +;; Modified by Dirk Eddelbuettel +;; Adapted for dh-make by Jim Van Zandt + +;; The groove package follows the Debian/GNU Linux 'emacsen' policy and +;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, +;; xemacs19, emacs20, xemacs20...). The compiled code is then +;; installed in a subdirectory of the respective site-lisp directory. +;; We have to add this to the load-path: +(let ((package-dir (concat "/usr/share/" + (symbol-name flavor) + "/site-lisp/groove"))) +;; If package-dir does not exist, the groove package must have +;; removed but not purged, and we should skip the setup. + (when (file-directory-p package-dir) + (setq load-path (cons package-dir load-path)) + (autoload 'groove-mode "groove-mode" + "Major mode for editing groove files." t) + (add-to-list 'auto-mode-alist '("\\.groove$" . groove-mode)))) + diff --git a/debian/groove.default.ex b/debian/groove.default.ex new file mode 100644 index 0000000..fdf6589 --- /dev/null +++ b/debian/groove.default.ex @@ -0,0 +1,10 @@ +# Defaults for groove initscript +# sourced by /etc/init.d/groove +# installed at /etc/default/groove by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +# Additional options that are passed to the Daemon. +DAEMON_OPTS="" diff --git a/debian/groove.doc-base.EX b/debian/groove.doc-base.EX new file mode 100644 index 0000000..0128b27 --- /dev/null +++ b/debian/groove.doc-base.EX @@ -0,0 +1,20 @@ +Document: groove +Title: Debian groove Manual +Author: +Abstract: This manual describes what groove is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/groove/groove.sgml.gz + +Format: postscript +Files: /usr/share/doc/groove/groove.ps.gz + +Format: text +Files: /usr/share/doc/groove/groove.text.gz + +Format: HTML +Index: /usr/share/doc/groove/html/index.html +Files: /usr/share/doc/groove/html/*.html diff --git a/debian/init.d.ex b/debian/init.d.ex new file mode 100644 index 0000000..069030a --- /dev/null +++ b/debian/init.d.ex @@ -0,0 +1,157 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian +# by Ian Murdock . +# Further changes by Javier Fernandez-Sanguino +# +# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/groove +NAME=groove +DESC=groove + +test -x $DAEMON || exit 0 + +LOGDIR=/var/log/groove +PIDFILE=/var/run/$NAME.pid +DODTIME=1 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +# Include groove defaults if available +if [ -f /etc/default/groove ] ; then + . /etc/default/groove +fi + +set -e + +running_pid() +{ + # Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected child? + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() +{ +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + # Obtain the pid and check it against the binary name + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +force_stop() { +# Forcefully kill the process + [ ! -f "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + [ -n "$DODTIME" ] && sleep "$DODTIME"s + if running ; then + kill -9 $pid + [ -n "$DODTIME" ] && sleep "$DODTIME"s + if running ; then + echo "Cannot kill $LABEL (pid=$pid)!" + exit 1 + fi + fi + fi + rm -f $PIDFILE + return 0 +} + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --exec $DAEMON -- $DAEMON_OPTS + if running ; then + echo "$NAME." + else + echo " ERROR." + fi + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --exec $DAEMON + echo "$NAME." + ;; + force-stop) + echo -n "Forcefully stopping $DESC: " + force_stop + if ! running ; then + echo "$NAME." + else + echo " ERROR." + fi + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/$NAME.pid --exec $DAEMON + #;; + force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart" except that it does nothing if the + # daemon isn't already running. + # check wether $DAEMON is running. If so, restart + start-stop-daemon --stop --test --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON \ + && $0 restart \ + || exit 0 + ;; + restart) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON + [ -n "$DODTIME" ] && sleep $DODTIME + start-stop-daemon --start --quiet --pidfile \ + /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + status) + echo -n "$LABEL is " + if running ; then + echo "running" + else + echo " not running." + exit 1 + fi + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload|status|force-stop}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/init.d.lsb.ex b/debian/init.d.lsb.ex new file mode 100644 index 0000000..8d99468 --- /dev/null +++ b/debian/init.d.lsb.ex @@ -0,0 +1,296 @@ +#!/bin/sh +# +# Example init.d script with LSB support. +# +# Please read this init.d carefully and modify the sections to +# adjust it to the program you want to run. +# +# Copyright (c) 2007 Javier Fernandez-Sanguino +# +# This is free software; you may redistribute it and/or modify +# it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, +# or (at your option) any later version. +# +# This is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License with +# the Debian operating system, in /usr/share/common-licenses/GPL; if +# not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# +### BEGIN INIT INFO +# Provides: groove +# Required-Start: $network $local_fs +# Required-Stop: +# Should-Start: $named +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: +# Description: +# <...> +# <...> +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/sbin/groove # Introduce the server's location here +NAME=groove # Introduce the short server's name here +DESC=groove # Introduce a short description here +LOGDIR=/var/log/groove # Log directory to use + +PIDFILE=/var/run/$NAME.pid + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +# Default options, these can be overriden by the information +# at /etc/default/$NAME +DAEMON_OPTS="" # Additional options given to the server + +DIETIME=10 # Time to wait for the server to die, in seconds + # If this value is set too low you might not + # let some servers to die gracefully and + # 'restart' will not work + +#STARTTIME=2 # Time to wait for the server to start, in seconds + # If this value is set each time the server is + # started (on start or restart) the script will + # stall to try to determine if it is running + # If it is not set and the server takes time + # to setup a pid file the log message might + # be a false positive (says it did not start + # when it actually did) + +LOGFILE=$LOGDIR/$NAME.log # Server logfile +#DAEMONUSER=groove # Users to run the daemons as. If this value + # is set start-stop-daemon will chuid the server + +# Include defaults if available +if [ -f /etc/default/$NAME ] ; then + . /etc/default/$NAME +fi + +# Use this if you want the user to explicitly set 'RUN' in +# /etc/default/ +#if [ "x$RUN" != "xyes" ] ; then +# log_failure_msg "$NAME disabled, please adjust the configuration to your needs " +# log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it." +# exit 0 +#fi + +# Check that the user exists (if we set a user) +# Does the user exist? +if [ -n "$DAEMONUSER" ] ; then + if getent passwd | grep -q "^$DAEMONUSER:"; then + # Obtain the uid and gid + DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` + DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` + else + log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." + exit 0 + fi +fi + + +set -e + +running_pid() { +# Check if a given process pid's cmdline matches a given name + pid=$1 + name=$2 + [ -z "$pid" ] && return 1 + [ ! -d /proc/$pid ] && return 1 + cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1 |cut -d : -f 1` + # Is this the expected server + [ "$cmd" != "$name" ] && return 1 + return 0 +} + +running() { +# Check if the process is running looking at /proc +# (works for all users) + + # No pidfile, probably no daemon present + [ ! -f "$PIDFILE" ] && return 1 + pid=`cat $PIDFILE` + running_pid $pid $DAEMON || return 1 + return 0 +} + +start_server() { +# Start the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS + errcode=$? + else +# if we are using a daemonuser then change the user id + start-stop-daemon --start --quiet --pidfile $PIDFILE \ + --chuid $DAEMONUSER \ + --exec $DAEMON -- $DAEMON_OPTS + errcode=$? + fi + return $errcode +} + +stop_server() { +# Stop the process using the wrapper + if [ -z "$DAEMONUSER" ] ; then + killproc -p $PIDFILE $DAEMON + errcode=$? + else +# if we are using a daemonuser then look for process that match + start-stop-daemon --stop --quiet --pidfile $PIDFILE \ + --user $DAEMONUSER \ + --exec $DAEMON + errcode=$? + fi + + return $errcode +} + +reload_server() { + [ ! -f "$PIDFILE" ] && return 1 + pid=pidofproc $PIDFILE # This is the daemon's pid + # Send a SIGHUP + kill -1 $pid + return $? +} + +force_stop() { +# Force the process to die killing it manually + [ ! -e "$PIDFILE" ] && return + if running ; then + kill -15 $pid + # Is it really dead? + sleep "$DIETIME"s + if running ; then + kill -9 $pid + sleep "$DIETIME"s + if running ; then + echo "Cannot kill $NAME (pid=$pid)!" + exit 0 + fi + fi + fi + rm -f $PIDFILE +} + + +case "$1" in + start) + log_daemon_msg "Starting $DESC " "$NAME" + # Check if it's running first + if running ; then + log_progress_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + if start_server ; then + # NOTE: Some servers might die some time after they start, + # this code will detect this issue if STARTTIME is set + # to a reasonable value + [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time + if running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # It is not running after we did start + log_end_msg 1 + fi + else + # Either we could not start it + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if running ; then + # Only stop the server if we see it running + errcode=0 + stop_server || errcode=$? + log_end_msg $errcode + else + # If it's not running don't do anything + log_progress_msg "apparently not running" + log_end_msg 0 + exit 0 + fi + ;; + force-stop) + # First try to stop gracefully the program + $0 stop + if running; then + # If it's still running try to kill it more forcefully + log_daemon_msg "Stopping (force) $DESC" "$NAME" + errcode=0 + force_stop || errcode=$? + log_end_msg $errcode + fi + ;; + restart|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + errcode=0 + stop_server || errcode=$? + # Wait some sensible amount, some server need this + [ -n "$DIETIME" ] && sleep $DIETIME + start_server || errcode=$? + [ -n "$STARTTIME" ] && sleep $STARTTIME + running || errcode=$? + log_end_msg $errcode + ;; + status) + + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + log_end_msg 0 + else + log_progress_msg "apparently not running" + log_end_msg 1 + exit 0 + fi + ;; + # Use this if the daemon cannot reload + reload) + log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" + log_warning_msg "cannot re-read the config file (use restart)." + ;; + # And this if it cann + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # log_daemon_msg "Reloading $DESC configuration files" "$NAME" + # if running ; then + # reload_server + # if ! running ; then + # Process died after we tried to reload + # log_progress_msg "died on reload" + # log_end_msg 1 + # exit 0 + # fi + # else + # log_progress_msg "server is not running" + # log_end_msg 1 + # exit 0 + # fi + #;; + + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|force-stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/debian/manpage.1.ex b/debian/manpage.1.ex new file mode 100644 index 0000000..4833c1a --- /dev/null +++ b/debian/manpage.1.ex @@ -0,0 +1,59 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH GROOVE SECTION "June 3, 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +groove \- program to do something +.SH SYNOPSIS +.B groove +.RI [ options ] " files" ... +.br +.B bar +.RI [ options ] " files" ... +.SH DESCRIPTION +This manual page documents briefly the +.B groove +and +.B bar +commands. +.PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +\fBgroove\fP is a program that... +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +For a complete description, see the Info files. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-v, \-\-version +Show version of program. +.SH SEE ALSO +.BR bar (1), +.BR baz (1). +.br +The programs are documented fully by +.IR "The Rise and Fall of a Fooish Bar" , +available via the Info system. +.SH AUTHOR +groove was written by . +.PP +This manual page was written by Elias Woods , +for the Debian project (and may be used by others). diff --git a/debian/manpage.sgml.ex b/debian/manpage.sgml.ex new file mode 100644 index 0000000..535dc53 --- /dev/null +++ b/debian/manpage.sgml.ex @@ -0,0 +1,154 @@ + manpage.1'. You may view + the manual page with: `docbook-to-man manpage.sgml | nroff -man | + less'. A typical entry in a Makefile or Makefile.am is: + +manpage.1: manpage.sgml + docbook-to-man $< > $@ + + + The docbook-to-man binary is found in the docbook-to-man package. + Please remember that if you create the nroff version in one of the + debian/rules file targets (such as build), you will need to include + docbook-to-man in your Build-Depends control field. + + --> + + + FIRSTNAME"> + SURNAME"> + + June 3, 2010"> + + SECTION"> + EliasWoods@gmail.com"> + + GROOVE"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2003 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + program to do something + + + + &dhpackage; + + + + + + + + DESCRIPTION + + This manual page documents briefly the + &dhpackage; and bar + commands. + + This manual page was written for the &debian; distribution + because the original program does not have a manual page. + Instead, it has documentation in the &gnu; + Info format; see below. + + &dhpackage; is a program that... + + + + OPTIONS + + These programs follow the usual &gnu; command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + Info files. + + + + + + + + Show summary of options. + + + + + + + + Show version of program. + + + + + + SEE ALSO + + bar (1), baz (1). + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + Info system. + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (and may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
+ + diff --git a/debian/manpage.xml.ex b/debian/manpage.xml.ex new file mode 100644 index 0000000..3910c55 --- /dev/null +++ b/debian/manpage.xml.ex @@ -0,0 +1,291 @@ + +.
will be generated. You may view the +manual page with: nroff -man .
| less'. A typical entry +in a Makefile or Makefile.am is: + +DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl +XP = xsltproc -''-nonet -''-param man.charmap.use.subset "0" + +manpage.1: manpage.xml + $(XP) $(DB2MAN) $< + +The xsltproc binary is found in the xsltproc package. The XSL files are in +docbook-xsl. A description of the parameters you can use can be found in the +docbook-xsl-doc-* packages. Please remember that if you create the nroff +version in one of the debian/rules file targets (such as build), you will need +to include xsltproc and docbook-xsl in your Build-Depends control field. +Alternatively use the xmlto command/package. That will also automatically +pull in xsltproc and docbook-xsl. + +Notes for using docbook2x: docbook2x-man does not automatically create the +AUTHOR(S) and COPYRIGHT sections. In this case, please add them manually as + ... . + +To disable the automatic creation of the AUTHOR(S) and COPYRIGHT sections +read /usr/share/doc/docbook-xsl/doc/manpages/authors.html. This file can be +found in the docbook-xsl-doc-html package. + +Validation can be done using: `xmllint -''-noout -''-valid manpage.xml` + +General documentation about man-pages and man-page-formatting: +man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/ + +--> + + + + + + + + + + + + + +]> + + + + &dhtitle; + &dhpackage; + + + &dhfirstname; + &dhsurname; + Wrote this manpage for the Debian system. +
+ &dhemail; +
+
+
+ + 2007 + &dhusername; + + + This manual page was written for the Debian system + (and may be used by others). + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU General Public License, + Version 2 or (at your option) any later version published by + the Free Software Foundation. + On Debian systems, the complete text of the GNU General Public + License can be found in + /usr/share/common-licenses/GPL. + +
+ + &dhucpackage; + &dhsection; + + + &dhpackage; + program to do something + + + + &dhpackage; + + + + + + + + + this + + + + + + + + this + that + + + + + &dhpackage; + + + + + + + + + + + + + + + + + + + DESCRIPTION + This manual page documents briefly the + &dhpackage; and bar + commands. + This manual page was written for the Debian distribution + because the original program does not have a manual page. + Instead, it has documentation in the GNU + info + 1 + format; see below. + &dhpackage; is a program that... + + + OPTIONS + The program follows the usual GNU command line syntax, + with long options starting with two dashes (`-'). A summary of + options is included below. For a complete description, see the + + info + 1 + files. + + + + + + + Does this and that. + + + + + + + Show summary of options. + + + + + + + Show version of program. + + + + + + FILES + + + /etc/foo.conf + + The system-wide configuration file to control the + behaviour of &dhpackage;. See + + foo.conf + 5 + for further details. + + + + ${HOME}/.foo.conf + + The per-user configuration file to control the + behaviour of &dhpackage;. See + + foo.conf + 5 + for further details. + + + + + + ENVIONMENT + + + FOO_CONF + + If used, the defined file is used as configuration + file (see also ). + + + + + + DIAGNOSTICS + The following diagnostics may be issued + on stderr: + + + Bad configuration file. Exiting. + + The configuration file seems to contain a broken configuration + line. Use the option, to get more info. + + + + + &dhpackage; provides some return codes, that can + be used in scripts: + + Code + Diagnostic + + 0 + Program exited successfully. + + + 1 + The configuration file seems to be broken. + + + + + + BUGS + The program is currently limited to only work + with the foobar library. + The upstreams BTS can be found + at . + + + SEE ALSO + + + bar + 1 + , + baz + 1 + , + foo.conf + 5 + + The programs are documented fully by The Rise and + Fall of a Fooish Bar available via the + info + 1 + system. + +
+ diff --git a/debian/menu.ex b/debian/menu.ex new file mode 100644 index 0000000..11027d1 --- /dev/null +++ b/debian/menu.ex @@ -0,0 +1,2 @@ +?package(groove):needs="X11|text|vc|wm" section="Applications/see-menu-manual"\ + title="groove" command="/usr/bin/groove" diff --git a/debian/postinst.ex b/debian/postinst.ex new file mode 100644 index 0000000..fd7adaa --- /dev/null +++ b/debian/postinst.ex @@ -0,0 +1,39 @@ +#!/bin/sh +# postinst script for groove +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm.ex b/debian/postrm.ex new file mode 100644 index 0000000..ffd9f49 --- /dev/null +++ b/debian/postrm.ex @@ -0,0 +1,37 @@ +#!/bin/sh +# postrm script for groove +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/preinst.ex b/debian/preinst.ex new file mode 100644 index 0000000..e30e1e1 --- /dev/null +++ b/debian/preinst.ex @@ -0,0 +1,35 @@ +#!/bin/sh +# preinst script for groove +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/prerm.ex b/debian/prerm.ex new file mode 100644 index 0000000..1ce4b4d --- /dev/null +++ b/debian/prerm.ex @@ -0,0 +1,38 @@ +#!/bin/sh +# prerm script for groove +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..917d9bf --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ diff --git a/debian/watch.ex b/debian/watch.ex new file mode 100644 index 0000000..9ca1b7b --- /dev/null +++ b/debian/watch.ex @@ -0,0 +1,23 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# See uscan(1) for format + +# Compulsory line, this is a version 3 file +version=3 + +# Uncomment to examine a Webpage +# +#http://www.example.com/downloads.php groove-(.*)\.tar\.gz + +# Uncomment to examine a Webserver directory +#http://www.example.com/pub/groove-(.*)\.tar\.gz + +# Uncommment to examine a FTP server +#ftp://ftp.example.com/pub/groove-(.*)\.tar\.gz debian uupdate + +# Uncomment to find new files on sourceforge, for devscripts >= 2.9 +# http://sf.net/groove/groove-(.*)\.tar\.gz + +# Uncomment to find new files on GooglePages +# http://example.googlepages.com/foo.html groove-(.*)\.tar\.gz diff --git a/groove.cpp b/groove.cpp new file mode 100644 index 0000000..46da9d3 --- /dev/null +++ b/groove.cpp @@ -0,0 +1,128 @@ +#include "groove.h" + + + +groove::groove(QWidget *parent) : + QWidget(parent) +{ + mBar = new QMenuBar(); + //mBar->addAction("test"); + sMethod = new QPushButton("Song:"); + lineEdit = new QLineEdit(""); + player = new sPlayer(); + QHBoxLayout *layout = new QHBoxLayout(); + QVBoxLayout *vlayout = new QVBoxLayout(); + button = new QPushButton("Search"); + QPushButton *dButton = new QPushButton("Play"); + resultView = new QTableView(); + QMenu *pushMenu = new QMenu(); + //showFullScreen(); + lineEdit->insert(""); + lineEdit->setDisabled(true); + pushMenu->addAction("Song:"); + pushMenu->addAction("Artist:"); + pushMenu->addAction("Album:"); + + //sMethod->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Maximum); + sMethod->setMaximumWidth(sMethod->sizeHint().rwidth()); + sMethod->setMenu(pushMenu); + model = new QStandardItemModel(); + model->setHorizontalHeaderLabels( + QStringList() << "Please wait for initialization" + /*<< "Artist"*/); + resultView->setModel(model); + resultView->verticalHeader()->hide(); + resultView->horizontalHeader()->setStretchLastSection(true); + resultView->setSelectionBehavior(QAbstractItemView::SelectRows); + resultView->setSelectionMode(QAbstractItemView::SingleSelection); + resultView->setEditTriggers(QAbstractItemView::NoEditTriggers); + resultView->setColumnHidden(2,true); + resultView->setAutoScroll(false); + + layout->addWidget(sMethod); + layout->addWidget(lineEdit); + layout->addWidget(button); + vlayout->addLayout(layout); + vlayout->addWidget(resultView); + vlayout->addWidget(dButton); + vlayout->setMenuBar(mBar); + setLayout(vlayout); + setWindowTitle("GrooveShark"); + //Create New Grooveshark connection + gs = new gscom(); + //Connections + connect(button, SIGNAL(clicked()), this, SLOT(search())); + 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(gs,SIGNAL(sKeyFound()),this,SLOT(startP())); +} +void groove::search() +{ + if(!lineEdit->text().isEmpty()) + { + if(lineEdit->isEnabled()) + { + + if(sMethod->text().compare("Song:")==0) + resultView->setModel(gs->getSongModel(lineEdit->text())); + else if(sMethod->text().compare("Artist:")==0) + resultView->setModel(gs->getArtistModel(lineEdit->text())); + else if(sMethod->text().compare("Album")==0) + resultView->setModel(gs->getAlbumModel(lineEdit->text())); + else + return; + + + button->setText("Stop"); + lineEdit->setDisabled(true); + } + else + { + resultView->setModel(model); + button->setText("Search"); + resultView->setColumnWidth(0,resultView->viewport()->width()/2); + resultView->setColumnWidth(1,resultView->viewport()->width()/2); + lineEdit->setDisabled(false); + } + } +} +void groove::finishedS() +{ + model = gs->getModel(); + resultView->setModel(model); + button->setText("Search"); + resultView->setColumnWidth(0,resultView->viewport()->width()/2); + resultView->setColumnWidth(1,resultView->viewport()->width()/2); + lineEdit->setDisabled(false); + resultView->setColumnHidden(2,true); +} +void groove::changeS( QAction * action) +{ + sMethod->setText(action->text()); + sMethod->setMaximumWidth(sMethod->sizeHint().rwidth()); +} +void groove::play() +{ + QModelIndexList selected = resultView->selectionModel()->selectedRows(0); + if(!selected.isEmpty()) + { + QStandardItem *item = model->item(selected.first().row(),2); + if(item == 0) + return; + //gs->getSong(); + gs->getSong(item->text()); + } + //selected. + //if +} +void groove::startP() +{ + if(!gs->sku.isValid()) + return; + player->~sPlayer(); + player = new sPlayer(); + player->play(gs->streamID,gs->sku); + +} diff --git a/groove.h b/groove.h new file mode 100644 index 0000000..2761070 --- /dev/null +++ b/groove.h @@ -0,0 +1,35 @@ +#ifndef GROOVE_H +#define GROOVE_H +#include +#include "gscom.h" +#include "splayer.h" +#include + +class groove : public QWidget +{ + Q_OBJECT; +public: + explicit groove(QWidget *parent = 0); + +signals: + +public slots: + void search(); + void finishedS(); + void changeS( QAction * action); + void play(); + void startP(); + +private: + sPlayer *player; + QMenuBar *mBar; + QPushButton *sMethod; + QStandardItemModel *model; + QLineEdit *lineEdit; + QTableView *resultView; + QPushButton *button; + gscom *gs; + +}; + +#endif // GROOVE_H diff --git a/gscom.cpp b/gscom.cpp new file mode 100644 index 0000000..69f7497 --- /dev/null +++ b/gscom.cpp @@ -0,0 +1,360 @@ +#include "gscom.h" +#include +#include +#include +//#include + +gscom::gscom() +{ + manager = new QNetworkAccessManager(this); + connect(manager, SIGNAL(finished(QNetworkReply*)), + this, SLOT(replyFinished(QNetworkReply*))); + cookies = manager->cookieJar(); + currentaction = getPHP; + manager->get(QNetworkRequest(QUrl(QString("http://") + GS_LISTEN))); + phpSession = new QString("none"); + sessionKey = new QString("none"); + firstR = true; + model = new QStandardItemModel(); + model->setHorizontalHeaderLabels( + QStringList() << "Online"); + addDebugMsg("You may now search for a song"); + //getSessionKey(); +} + +QStandardItemModel* gscom::getSongModel(QString song) +{ + model = new QStandardItemModel(); + model->setHorizontalHeaderLabels( + QStringList() << "Searching.."); + addDebugMsg("Fetching Song List..."); + + if(currentaction != none) + { + addDebugMsg("Error: communication is busy Try again later"); + return model; + } + else + { + QString *token = getToken(getSearchResults); + qDebug() << token->toAscii(); + QNetworkRequest request; + request.setUrl(QUrl("http://cowbell.grooveshark.com/more.php?getSearchResults")); + request.setHeader(request.ContentTypeHeader,QVariant("application/json")); + QVariantMap jlist; + QVariantMap header; + //header.insert("uuid","DEA8E133-2080-F666-4B38-9465187B20A9"); + header.insert("session",phpSession->toUtf8()); + header.insert("client","gslite"); + header.insert("clientRevision","20100412.09"); + header.insert("token",token->toAscii()); + jlist.insert("method","getSearchResults"); + jlist.insertMulti("header",header); + QVariantMap param; + param.insert("type","Songs"); + param.insert("query",song.toAscii()); + jlist.insertMulti("parameters",param); + QJson::Serializer *serializer = new QJson::Serializer(); + //qDebug() << serializer->serialize(jlist); + manager->post(request,serializer->serialize(jlist)); + currentaction = getSearchResults; + } + + return model; +} +QStandardItemModel* gscom::getArtistModel(QString song) +{ + model = new QStandardItemModel(); + model->setHorizontalHeaderLabels( + QStringList() << "Searching.."); + addDebugMsg("Fetching Song List..."); + + if(currentaction != none) + { + addDebugMsg("Error: communication is busy Try again later"); + return model; + } + else + { + QString *token = getToken(getSearchResults); + qDebug() << token->toAscii(); + QNetworkRequest request; + request.setUrl(QUrl("http://cowbell.grooveshark.com/more.php?getSearchResults")); + request.setHeader(request.ContentTypeHeader,QVariant("application/json")); + QVariantMap jlist; + QVariantMap header; + //header.insert("uuid","DEA8E133-2080-F666-4B38-9465187B20A9"); + header.insert("session",phpSession->toUtf8()); + header.insert("client","gslite"); + header.insert("clientRevision","20100412.09"); + header.insert("token",token->toAscii()); + jlist.insert("method","getSearchResults"); + jlist.insertMulti("header",header); + QVariantMap param; + param.insert("type","Artists"); + param.insert("query",song.toAscii()); + jlist.insertMulti("parameters",param); + QJson::Serializer *serializer = new QJson::Serializer(); + //qDebug() << serializer->serialize(jlist); + manager->post(request,serializer->serialize(jlist)); + currentaction = getSearchResults; + } + + return model; +} +QStandardItemModel* gscom::getAlbumModel(QString song) +{ + model = new QStandardItemModel(); + model->setHorizontalHeaderLabels( + QStringList() << "Searching.."); + addDebugMsg("Fetching Song List..."); + + if(currentaction != none) + { + addDebugMsg("Error: communication is busy Try again later"); + return model; + } + else + { + QString *token = getToken(getSearchResults); + qDebug() << token->toAscii(); + QNetworkRequest request; + request.setUrl(QUrl("http://cowbell.grooveshark.com/more.php?getSearchResults")); + request.setHeader(request.ContentTypeHeader,QVariant("application/json")); + QVariantMap jlist; + QVariantMap header; + //header.insert("uuid","DEA8E133-2080-F666-4B38-9465187B20A9"); + header.insert("session",phpSession->toUtf8()); + header.insert("client","gslite"); + header.insert("clientRevision","20100412.09"); + header.insert("token",token->toAscii()); + jlist.insert("method","getSearchResults"); + jlist.insertMulti("header",header); + QVariantMap param; + param.insert("type","Albums"); + param.insert("query",song.toAscii()); + jlist.insertMulti("parameters",param); + QJson::Serializer *serializer = new QJson::Serializer(); + //qDebug() << serializer->serialize(jlist); + manager->post(request,serializer->serialize(jlist)); + currentaction = getSearchResults; + } + + return model; +} +void gscom::replyFinished(QNetworkReply *reply) +{ + switch (currentaction) + { + case getStreamKeyFromSongIDEx: + { + qDebug() << "tester"; + QJson::Parser parser; + bool ok; + QVariantMap result = parser.parse (reply->readAll(), &ok).toMap(); + if (!ok) { + qFatal("An error occurred during parsing"); + return; + } + QVariantMap results = result["result"].toMap(); + this->streamID = results["streamKey"].toString(); + this->sku = QUrl(QString("http://") + results["ip"].toString() + "/stream.php"); + qDebug() << sku; + currentaction = none; + reply->close(); + emit sKeyFound(); + } + break; + case getPHP: + { + QList cookieList = cookies->cookiesForUrl(QUrl(QString("http://") + GS_LISTEN)); + foreach(QNetworkCookie cookie, cookieList) + { + if(cookie.name() == "PHPSESSID") + { + phpSession = new QString(cookie.value()); + } + } + reply->readAll(); + reply->close(); + qDebug() << phpSession->toAscii(); + firstR = false; + currentaction = getCommunicationToken; + getSessionKey(); + + } + break; + case getCommunicationToken: + { + bool ok; + QJson::Parser parser; + QVariantMap result = parser.parse(reply->readAll(),&ok).toMap(); + if(!ok) + qDebug("Error parsing request"); + else + { + sessionKey = new QString(result["result"].toString()); + qDebug() << sessionKey->toAscii(); + } + currentaction = none; + reply->close(); + emit finishedSearch(); + } + break; + case(getSearchResults): + { + QJson::Parser parser; + bool ok; + QVariantMap result = parser.parse (reply->readAll(), &ok).toMap(); + if (!ok) { + qFatal("An error occurred during parsing"); + return; + } + if(result.contains("fault")) + { + currentaction = getPHP; + manager->get(QNetworkRequest(QUrl(QString("http://") + GS_LISTEN))); + qDebug() << reply->readAll(); + reply->close(); + return; + } + model->clear(); + model->setHorizontalHeaderLabels( + QStringList() << "Song" + << "Artist" + << "Song Id"); + + + foreach (QVariant plugin, result["result"].toList()) { + QList items; + QVariantMap nestedMap = plugin.toMap(); + items.append(new QStandardItem(nestedMap["Name"].toString())); + items.append(new QStandardItem(nestedMap["ArtistName"].toString())); + items.append(new QStandardItem(nestedMap["SongID"].toString())); + model->appendRow(items); + } + currentaction = none; + reply->close(); + emit finishedSearch(); + } + break; + default: + qDebug() << reply->readAll(); + reply->close(); + currentaction=none; + } + +} +QStandardItemModel* gscom::getModel() +{ + return model; +} +void gscom::addDebugMsg(QString debug) +{ + QList rows = QList() + << (QStringList() << debug); + foreach (QStringList row, rows) { + QList items; + foreach (QString text, row) + items.append(new QStandardItem(text)); + model->appendRow(items); + } + return; +} +QString* gscom::getToken(gMETHOD meth) +{ + QCryptographicHash *hasher = new QCryptographicHash(QCryptographicHash::Sha1); + //generate six random numbers + QString rnum = QString(qrand() %9 + 48) + + QString(qrand() %9 + 48) + + QString(qrand() %9 + 48) + + QString(qrand() %9 + 48) + + QString(qrand() %9 + 48) + + QString(qrand() %9 + 48); + QString *data = new QString(); + QString *string = new QString(); + switch(meth) + { + case(getSearchResults): + data->append("getSearchResults"); + break; + case(getStreamKeyFromSongIDEx): + data->append("getStreamKeyFromSongIDEx"); + break; + default: + data->append("getSearchResults"); + } + string->append(data); + string->append(":"); + string->append(sessionKey->toAscii()); + string->append(":quitStealinMahShit:"); + string->append(rnum); + hasher->addData(string->toAscii()); + QString *rs = new QString(); + rs->append(rnum); + rs->append(hasher->result().toHex()); + return rs; +} +void gscom::getSong(QString songid) +{ + if(currentaction != none) + { + return; + } + else + { + QString *token = getToken(getStreamKeyFromSongIDEx); + qDebug() << token->toAscii(); + QNetworkRequest request; + request.setUrl(QUrl("http://cowbell.grooveshark.com/more.php?getStreamKeyFromSongIdEx")); + request.setHeader(request.ContentTypeHeader,QVariant("application/json")); + QVariantMap jlist; + QVariantMap header; + //header.insert("uuid","DEA8E133-2080-F666-4B38-9465187B20A9"); + header.insert("session",phpSession->toUtf8()); + header.insert("client","gslite"); + header.insert("clientRevision","20100412.09"); + header.insert("token",token->toAscii()); + jlist.insert("method","getStreamKeyFromSongIDEx"); + jlist.insertMulti("header",header); + QVariantMap param; + QVariantMap country; + country.insert("CC1","0"); + country.insert("CC3","0"); + country.insert("ID","223"); + country.insert("CC2","0"); + country.insert("CC4","1073741824"); + param.insertMulti("country",country); + param.insert("mobile",false); + param.insert("songID",songid.toAscii()); + param.insert("prefetch",false); + jlist.insertMulti("parameters",param); + QJson::Serializer *serializer = new QJson::Serializer(); + //qDebug() << serializer->serialize(jlist); + manager->post(request,serializer->serialize(jlist)); + currentaction = getStreamKeyFromSongIDEx; + } + return; +} + +void gscom::getSessionKey() +{ + QNetworkRequest request; // = new QNetworkRequest(QUrl("https://cowbell.grooveshark.com/service.php")); + request.setUrl(QUrl("https://cowbell.grooveshark.com/service.php")); + request.setHeader(request.ContentTypeHeader,QVariant("application/json")); + QVariantMap jlist; + QVariantMap header; + //header.insert("uuid","DEA8E133-2080-F666-4B38-9465187B20A9"); + //header.insert("session",phpSession->toUtf8()); + header.insert("client","gslite"); + header.insert("clientRevision","20100412.09"); + jlist.insert("method","getCommunicationToken"); + jlist.insertMulti("header",header); + QVariantMap param; + QCryptographicHash *hasher = new QCryptographicHash(QCryptographicHash::Md5); + hasher->addData(phpSession->toUtf8()); + param.insert("secretKey",hasher->result().toHex()); + jlist.insertMulti("parameters",param); + QJson::Serializer *serializer = new QJson::Serializer(); + manager->post(request,serializer->serialize(jlist)); +} diff --git a/gscom.h b/gscom.h new file mode 100644 index 0000000..f39e9a0 --- /dev/null +++ b/gscom.h @@ -0,0 +1,56 @@ +#ifndef GSCOM_H +#define GSCOM_H +#include +#include +#include +//#include +#define GSPASS "**********" +#define GSIP "grooveshark.com" +#define GS_LISTEN "listen.grooveshark.com" +#define GS_GUTS "guts.grroveshark.com" +class gscom : public QObject +{ + Q_OBJECT; +public: + QUrl sku; + QString streamID; + gscom(); + QStandardItemModel* getSongModel(QString song); + QStandardItemModel* getArtistModel(QString artist); + QStandardItemModel* getAlbumModel(QString Album); + QStandardItemModel* getModel(); + void getSong(QString songid); + + +signals: + void finishedSearch(); + void sKeyFound(); + +public slots: + void replyFinished(QNetworkReply*); + + + +private: + enum gMETHOD { + getCommunicationToken, + getSearchResults, + getStreamKeyFromSongIDEx, + getPHP, + none + }; + gMETHOD currentaction; + QString *sessionKey; + void getSessionKey(); + QString* getStreamKey(); + QString* getToken(gMETHOD m); + QStandardItemModel *model; + QString *phpSession; + QNetworkAccessManager *manager; + QNetworkCookieJar *cookies; + void addDebugMsg(QString debug); + bool firstR; + QByteArray *postdata; +}; + +#endif // GSCOM_H diff --git a/main.cpp b/main.cpp new file mode 100755 index 0000000..84ca261 --- /dev/null +++ b/main.cpp @@ -0,0 +1,15 @@ +#include "groove.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + a.setApplicationName("Groove"); + groove gs; +#if defined(Q_WS_S60) + gs.showMaximized(); +#else + gs.show(); +#endif + return a.exec(); +} diff --git a/splayer.cpp b/splayer.cpp new file mode 100644 index 0000000..1c6e8ce --- /dev/null +++ b/splayer.cpp @@ -0,0 +1,127 @@ +#include "splayer.h" +#include +sPlayer::sPlayer(QObject *parent) : + QObject(parent) +{ + manager = new QNetworkAccessManager(); + buffer = new QBuffer(); + audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory,this); + media = new Phonon::MediaObject(this); + Phonon::createPath(media, audioOutput); + playing = false; + //reply = new QNetworkReply(); + internal = parent; + //buffer->open(QIODevice::ReadWrite); +} +sPlayer::~sPlayer() +{ + manager->~QNetworkAccessManager(); + //reply->~QIODevice(); + buffer->~QBuffer(); + media->~MediaNode(); +} + +void sPlayer::play(QString StreamKey,QUrl server) +{ + if(playing) + { + //reply->abort(); + } + + QNetworkRequest req; + req.setUrl(server); + qDebug() << server; + req.setHeader(req.ContentTypeHeader,QVariant("application/x-www-form-urlencoded")); + reply = manager->post(req,QString("streamKey=" + StreamKey.toAscii()).toAscii()); + buffer->open(buffer->ReadWrite | buffer->Truncate); + connect(reply,SIGNAL(finished()),this,SLOT(start())); + connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64))); + media->stop(); + playing = false; + startStreamT = QTime::currentTime(); +} +void sPlayer::start() +{ + QVariant url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); + if(url.toUrl().isValid()) + { + QNetworkRequest req; + req.setUrl(url.toUrl()); + qDebug() << url; + reply = manager->get(req); + connect(reply,SIGNAL(finished()),this,SLOT(start())); + connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64))); + } + else + { + if(!playing) + { + playing = true; + media->setCurrentSource(Phonon::MediaSource(buffer)); + media->play(); + qDebug() << "Playing"; + } + } + /*else + { + media->stop(); + buffer->close(); + buffer->open(QIODevice::ReadWrite | QIODevice::Truncate); + buffer->write(reply->readAll()); + reply->close(); + media->setCurrentSource(Phonon::MediaSource(buffer)); + media->play(); + }*/ +} +void sPlayer::putb(qint64 b, qint64 t) +{ + //qDebug() << "Download: " << b << "Total: " << t; + if(b == 0 && t == 0) + { + QVariant url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); + if(url.toUrl().isValid()) + { + QNetworkRequest req; + req.setUrl(url.toUrl()); + qDebug() << url; + reply = manager->get(req); + connect(reply,SIGNAL(finished()),this,SLOT(start())); + connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64))); + } + else + { + //buffer->close(); + reply->close(); + } + } + else + { + + buffer->buffer().append(reply->readAll()); + //qDebug() << buffer->bytesAvailable(); + if(playing) + { + StreamIO* stream = (StreamIO*) media->currentSource().stream(); + stream->setStreamSize(buffer->size()); + } + + /* + //buffer->seek(b); + qint64 last = buffer->pos(); + buffer->seek(buffer->bytesAvailable()+buffer->pos()); + qDebug() << buffer->write(reply->readAll()); + qDebug() << buffer->pos(); + //buffer->putChar() + buffer->seek(last); + //buffer->data().append(reply->readAll());*/ + //qDebug() << "Download speed (KB/S): " << b/(startStreamT.msecsTo(QTime::currentTime()) + 1)*100/1024; + if ( b >= t*0.05 && !playing && b/(startStreamT.msecsTo(QTime::currentTime()) + 1)*100/1024 >= 35) + { + playing = true; + //Start playback at 25% download + media->setCurrentSource(Phonon::MediaSource(buffer)); + media->play(); + qDebug() << "Playing"; + } + } +} diff --git a/splayer.h b/splayer.h new file mode 100644 index 0000000..07224ad --- /dev/null +++ b/splayer.h @@ -0,0 +1,36 @@ +#ifndef SPLAYER_H +#define SPLAYER_H +#include +//#include +#include +#include +#include "streamio.h" + +class sPlayer : public QObject +{ + Q_OBJECT +public: + explicit sPlayer(QObject *parent = 0); + void play(QString StreamKey, QUrl server); + void stop(); + ~sPlayer(); + +signals: + void finishedPlaying(); + void downloadComplete(); +public slots: + void start(); + void putb(qint64,qint64); +private: + QNetworkAccessManager *manager; + Phonon::AudioOutput *audioOutput; + Phonon::MediaObject *media; + QNetworkReply *reply; + QBuffer *buffer; + Phonon::Path *path; + bool playing; + QObject *internal; + QTime startStreamT; +}; + +#endif // SPLAYER_H diff --git a/streamio.cpp b/streamio.cpp new file mode 100644 index 0000000..ce3cc30 --- /dev/null +++ b/streamio.cpp @@ -0,0 +1,32 @@ +#include "streamio.h" +/* +StreamIO::StreamIO(Phonon::MediaSource *parent) : + Phonon::MediaSource(parent) +{ + internal = parent; +} +void StreamIO::setSizeOfStream(qint64 s) +{ + internal->stream()->setStreamSize(s); +} +/*qint64 StreamIO::size() +{ + return sized; +} +qint64 StreamIO::bytesAvailable() +{ + return this->size(); +} +bool StreamIO::isSequential() +{ + return true; +}/* +qint64 StreamIO::readData(char* data, qint64 maxsize) +{ + internal->data().at(rpos); + data = this->data().at(rpos); + rpos += 1; + return 1; +} + +*/ diff --git a/streamio.h b/streamio.h new file mode 100644 index 0000000..3173a72 --- /dev/null +++ b/streamio.h @@ -0,0 +1,29 @@ +#ifndef STREAMIO_H +#define STREAMIO_H +#include +#include +#include +#include "splayer.h" + +class StreamIO : public Phonon::AbstractMediaStream +{ + Q_OBJECT + + /* +public: + explicit StreamIO(Phonon::MediaSource *parent = 0); + void setSizeOfStream(qint64); + //qint64 bytesAvailable(); + //qint64 size(); + //bool isSequential(); +signals: + +public slots: +private: + Phonon::MediaSource *internal; + //qint64 readData(char * data, qint64 maxsize);*/ + friend class sPlayer; + +}; + +#endif // STREAMIO_H -- 1.7.9.5