Permalink
Browse files

import a copy of qdaapd, for now at least

  • Loading branch information...
1 parent c733733 commit 943277424d336d8aaec4a706c8bc811bc1068d59 @RJ committed Feb 9, 2010
View
@@ -2,4 +2,4 @@ TEMPLATE = subdirs
OBJECTS_DIR = build
MOC_DIR = build
-SUBDIRS = qxmpp miniupnp src
+SUBDIRS = qxmpp miniupnp qdaapd src
View
@@ -0,0 +1,77 @@
+#include "collection.h"
+using namespace QDaap;
+
+Collection::Collection(QString name, QObject *parent) :
+ QObject(parent), m_tracksloaded(false), m_name(name)
+{
+}
+
+int Collection::numTracks()
+{
+ return tracks().size();
+}
+
+QMap<quint32,Track> & Collection::tracks()
+{
+ return m_tracks;
+}
+
+void Collection::loadTracks()
+{
+ qDebug() << "LoadTracks()";
+
+ QDaap::Track t;
+ t.id = t.perid = 1;
+ t.artist = "Test artist name 1";
+ t.album = "Test album name 1";
+ t.track = "Test track title 1";
+ t.duration = 300000;
+ t.filesize = 1024*1024*5;
+ t.albumposition = 1;
+ t.genre = "Rock";
+ t.comment = "no comment";
+ t.year = 1982;
+ t.albumdiscnumber = 1;
+ t.bitrate = 128;
+
+
+ m_tracks[t.id] = t;
+
+ QDaap::Track t2;
+ t2.id = t2.perid = 2;
+ t2.artist = "Test artist name 2";
+ t2.album = "Test album name 2";
+ t2.track = "Test track title 2";
+ t2.duration = 200000;
+ t2.filesize = 1024*1024*3;
+ t2.albumposition = 7;
+ t2.genre = "Rock";
+ t2.comment = "no comment";
+ t2.year = 1982;
+ t2.albumdiscnumber = 1;
+ t2.bitrate = 128;
+
+ m_tracks[t2.id] = t2;
+
+ m_tracksloaded = true;
+ emit finishedLoading();
+}
+
+QIODevice * Collection::getTrack(quint32 id)
+{
+ if(!m_tracks.contains(id))
+ {
+ qDebug() << "no track id in collection : " << id;
+ return 0;
+ //Q_ASSERT(false);
+ }
+ QDaap::Track t = m_tracks[id];
+ QFile * f = new QFile("/tmp/angels.mp3");
+ f->open(QIODevice::ReadOnly);
+ return f;
+}
+
+int Collection::numPlaylists() const
+{
+ return 0;
+}
View
@@ -0,0 +1,96 @@
+#ifndef COLLECTION_H
+#define COLLECTION_H
+
+#include <QObject>
+#include <QList>
+#include <QMap>
+#include <QFile>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QDebug>
+
+namespace QDaap
+{
+
+
+class Track
+{
+public:
+ Track() : extension("mp3"), disabled(false), trackcount(1), albumdiscnumber(1)
+ {};
+
+ quint32 id;
+ quint64 perid;
+ QString genre;
+ QString artist;
+ QString album;
+ QString track;
+ QString comment;
+ QString extension;
+ bool disabled;
+ quint16 bitrate;
+ quint32 duration; // ms
+ quint32 filesize;
+ quint16 trackcount;
+ quint16 albumposition;
+ quint16 year;
+ quint16 albumdiscnumber;
+};
+
+
+
+/*
+class Playlist
+{
+public:
+ quint32 id;
+ quint64 perid;
+ QString title;
+ quint32 length; // num tracks in playlist
+
+ virtual QList<Track> getTracks()
+ {
+ return QList<Track>();
+ };
+};
+*/
+
+class Collection : public QObject
+{
+Q_OBJECT
+public:
+ explicit Collection(QString name, QObject *parent = 0);
+
+ QString name() const { return m_name; };
+
+ int numTracks();
+ QMap<quint32,Track> & tracks();
+
+ int numPlaylists() const;
+
+ // this should hit DB/peer get full current list of all tracks:
+ virtual void loadTracks();
+
+ virtual QIODevice * getTrack(quint32 id);
+
+ //QList<Playlist> playlists() const = 0;
+
+ bool isLoaded() const { return m_tracksloaded; };
+
+
+signals:
+ void finishedLoading();
+
+public slots:
+
+protected:
+
+ QString m_name;
+
+ QMap<quint32,Track> m_tracks;
+ bool m_tracksloaded;
+};
+
+} // ns
+
+#endif // COLLECTION_H
@@ -0,0 +1,120 @@
+# Microsoft Developer Studio Project File - Name="daaplib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=daaplib - Win32 Debug
+!MESSAGE Dies ist kein g�ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f�hren Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "daaplib.mak".
+!MESSAGE
+!MESSAGE Sie k�nnen beim Ausf�hren von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "daaplib.mak" CFG="daaplib - Win32 Debug"
+!MESSAGE
+!MESSAGE F�r die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "daaplib - Win32 Release" (basierend auf "Win32 (x86) Static Library")
+!MESSAGE "daaplib - Win32 Debug" (basierend auf "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=xicl6.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "daaplib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD CPP /nologo /W4 /GX /O2 /I "./include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
+# ADD BASE RSC /l 0x407 /d "NDEBUG"
+# ADD RSC /l 0x407 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "daaplib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "./include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x407 /d "_DEBUG"
+# ADD RSC /l 0x407 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=xilink6.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "daaplib - Win32 Release"
+# Name "daaplib - Win32 Debug"
+# Begin Group "Quellcodedateien"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\src\registry.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\taginput.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\tagoutput.cpp
+# End Source File
+# End Group
+# Begin Group "Header-Dateien"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\include\daap\basic.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\daap\registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\daap\taginput.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\include\daap\tagoutput.h
+# End Source File
+# End Group
+# End Target
+# End Project
Oops, something went wrong.

0 comments on commit 9432774

Please sign in to comment.