summaryrefslogtreecommitdiff
path: root/muggle-plugin
diff options
context:
space:
mode:
authorRaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b>2004-02-01 22:12:56 +0000
committerRaK <RaK@e10066b5-e1e2-0310-b819-94efdf66514b>2004-02-01 22:12:56 +0000
commitabfc554e5ef67d1c286eb3863a55702a7fd37f73 (patch)
tree068cdcd405957c7145d2c1c5819f4274c667bf47 /muggle-plugin
parentdf4daa209687834b0e131c8396fce5e8630f45f8 (diff)
downloadvdr-plugin-muggle-abfc554e5ef67d1c286eb3863a55702a7fd37f73.tar.gz
vdr-plugin-muggle-abfc554e5ef67d1c286eb3863a55702a7fd37f73.tar.bz2
Added new View Genre -> Year -> Track
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk@11 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'muggle-plugin')
-rw-r--r--muggle-plugin/Makefile6
-rw-r--r--muggle-plugin/README4
-rw-r--r--muggle-plugin/gd_content_interface.c61
-rw-r--r--muggle-plugin/menu.txt5
-rw-r--r--muggle-plugin/muggle.h14
-rw-r--r--muggle-plugin/sh_muggle2.c4
-rw-r--r--muggle-plugin/vdr_menu.h15
7 files changed, 88 insertions, 21 deletions
diff --git a/muggle-plugin/Makefile b/muggle-plugin/Makefile
index 8728cc3..609c3dc 100644
--- a/muggle-plugin/Makefile
+++ b/muggle-plugin/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.1 2004/02/01 18:22:53 LarsAC Exp $
+# $Id: Makefile,v 1.2 2004/02/01 22:12:56 RaK Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -48,7 +48,8 @@ DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
OBJS = $(PLUGIN).o vdr_menu.o mg_database.o mg_content_interface.o sh_dummy_content.o gd_content_interface.o mg_tools.o mg_media.o
-BINOBJS = sh_shell_osd_plugin.o sh_shell_osd.o sh_shell_osd_menuitems.o muggle.o vdr_menu.o content_interface.o dummy_content.o gd_contentinterface.o muggle_tools.o mgmedia.o
+#BINOBJS = sh_shell_osd_plugin.o sh_shell_osd.o sh_shell_osd_menuitems.o muggle.o vdr_menu.o content_interface.o dummy_content.o gd_contentinterface.o muggle_tools.o mgmedia.o
+BINOBJS = muggle.o vdr_menu.o mg_content_interface.o gd_content_interface.o mg_tools.o mg_media.o
### Implicit rules:
@@ -89,3 +90,4 @@ dist: clean
clean:
@-rm -f $(OBJS) $(BINOBJS) $(DEPFILE) *.so *.tgz core* *~
@-rm -f sh_muggle sh_muggle2
+
diff --git a/muggle-plugin/README b/muggle-plugin/README
index 692baf1..4f6cbbf 100644
--- a/muggle-plugin/README
+++ b/muggle-plugin/README
@@ -1,6 +1,8 @@
This is a "plugin" for the Video Disk Recorder (VDR).
-Written by: Ralf Klüber <r@lf-klueber.de>, Andi Kellner, Lars von Wedel <vonwedel@web.de>
+Written by: Andi Kellner,
+ Lars von Wedel <vonwedel@web.de>
+ Ralf Klüber <r@lf-klueber.de>,
Project's homepage: URL
diff --git a/muggle-plugin/gd_content_interface.c b/muggle-plugin/gd_content_interface.c
index 5707f78..becae1c 100644
--- a/muggle-plugin/gd_content_interface.c
+++ b/muggle-plugin/gd_content_interface.c
@@ -3,10 +3,10 @@
* \brief Data Objects for content (e.g. mp3 files, movies)
* for the vdr muggle plugindatabase
********************************************************************
- * \version $Revision: 1.1 $
- * \date $Date: 2004/02/01 18:22:53 $
+ * \version $Revision: 1.2 $
+ * \date $Date: 2004/02/01 22:12:56 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
- * \author file owner: $Author: LarsAC $
+ * \author file owner: $Author: RaK $
*
* DUMMY
* Implements main classes of for content items and interfaces to SQL databases
@@ -40,7 +40,7 @@ int GdInitDatabase(MYSQL *db)
}
if(mysql_real_connect(db,"localhost","root","",
- "GiantDisc2",0,NULL,0) == NULL)
+ "GiantDisc",0,NULL,0) == NULL)
{
return -2;
}
@@ -733,7 +733,7 @@ bool GdTreeNode::expand()
mgWarning("Node already expanded\n");
return true;
}
- if (m_level == 1)
+ if (m_level == 1 && m_view < 100)
{
m_view = atoi(m_id.c_str());
}
@@ -845,7 +845,43 @@ bool GdTreeNode::expand()
return false;
}
break;
- default:
+ case 4: // Genre -> Year -> Track
+ if(m_level == 1) { // Genre
+ sprintf(sqlbuff,
+ "SELECT DISTINCT genre.genre,tracks.genre1"
+ " FROM genre,tracks"
+ " WHERE (genre.id=tracks.genre1) AND"
+ " %s"
+ " ORDER BY genre.genre"
+ , m_restriction.c_str());
+ idfield = "tracks.genre1";
+ } else if (m_level == 2) { // Year
+ sprintf(sqlbuff,
+ "SELECT DISTINCT tracks.year,tracks.year"
+ " FROM genre,tracks"
+ " WHERE (genre.id=tracks.genre1) AND"
+ " %s"
+ " ORDER BY tracks.year"
+ , m_restriction.c_str());
+ idfield = "tracks.year";
+ } else if (m_level == 3) { // Track
+ sprintf(sqlbuff,
+ "SELECT DISTINCT"
+ " CONCAT(tracks.artist,' - ',tracks.title) AS title"
+ " ,tracks.id"
+ " FROM tracks,genre"
+ " WHERE (genre.id=tracks.genre1) AND"
+ " %s"
+ " ORDER BY tracks.title"
+ , m_restriction.c_str());
+ idfield = "tracks.id";
+ } else {
+ mgWarning("View #%d level %d' not yet implemented", m_view, m_level);
+ m_expanded = false;
+ return false;
+ }
+ break;
+ default:
mgError("View '%d' not yet implemented", m_view);
}
@@ -871,7 +907,7 @@ bool GdTreeNode::expand()
m_children.push_back(new_child);
numchild++;
}
- } else {
+ } else if (m_view <100) {
new_child = new GdTreeNode(this, // parent
"1" , // id
"Artist -> Album -> Title", // label,
@@ -887,6 +923,17 @@ bool GdTreeNode::expand()
"Artist -> Track" , // label,
"1");
m_children.push_back(new_child);
+ new_child = new GdTreeNode(this, // parent
+ "4" , // id
+ "Genre -> Year -> Track" , // label,
+ "1");
+ m_children.push_back(new_child);
+ } else {
+ new_child = new GdTreeNode(this, // parent
+ "100" , // id
+ "Search Result", // label,
+ m_restriction);
+ m_children.push_back(new_child);
}
m_expanded = true;
diff --git a/muggle-plugin/menu.txt b/muggle-plugin/menu.txt
index cdea3f8..08c7b2e 100644
--- a/muggle-plugin/menu.txt
+++ b/muggle-plugin/menu.txt
@@ -29,14 +29,17 @@ DOWN select next item (VDR-mechanism)
LEFT selection pg-up (VDR-mechanism)
RIGHT selection pg-down (VDR-mechanism)
-RED add all tracks under this node to playlist
+RED add all tracks under currently highlighted node to playlist
GREEN ==>DisplayFilter
YELLOW ==>DisplayPlaylist();
BLUE --
+ // Should be in the future: Collapse all and goto default View
TRACKS (Tracklist)
------------------
+ // Andi, ich kapier es nicht. Was unterscheidet Tracks from Tree?
+ // IMHO ist Tracks eine Sonderform von Tree, der nur Leaves hat, oder?
OK DisplayTrackInfo(current)
BACK ==> DisplayTree( parent ); // collapse
diff --git a/muggle-plugin/muggle.h b/muggle-plugin/muggle.h
index e6ed1c2..6fbe44d 100644
--- a/muggle-plugin/muggle.h
+++ b/muggle-plugin/muggle.h
@@ -2,17 +2,23 @@
/*! \file muggle.h
* \brief Implements a plugin for browsing media libraries within VDR
********************************************************************
- * \version $Revision: 1.1 $
- * \date $Date: 2004/02/01 18:22:53 $
+ * \version $Revision: 1.2 $
+ * \date $Date: 2004/02/01 22:12:56 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
- * \author file owner: $Author: LarsAC $
+ * \author file owner: $Author: RaK $
*/
/*******************************************************************/
#ifndef _MUGGLE_H
#define _MUGGLE_H
-#include <vdr/plugin.h>
+#undef SHELL_TEST
+
+#ifdef SHELL_TEST
+ #include "shell_plugin.h"
+#else
+ #include <vdr/plugin.h>
+#endif
class mgMuggle : public cPlugin
{
diff --git a/muggle-plugin/sh_muggle2.c b/muggle-plugin/sh_muggle2.c
index e3748a4..4c98da6 100644
--- a/muggle-plugin/sh_muggle2.c
+++ b/muggle-plugin/sh_muggle2.c
@@ -4,8 +4,8 @@
#include "myosd.h"
#include "muggle.h"
-#include "mgmedia.h"
-#include "muggle_tools.h"
+#include "mg_media.h"
+#include "mg_tools.h"
#include <unistd.h>
eKeys waitForKey()
diff --git a/muggle-plugin/vdr_menu.h b/muggle-plugin/vdr_menu.h
index 480c687..a0807a4 100644
--- a/muggle-plugin/vdr_menu.h
+++ b/muggle-plugin/vdr_menu.h
@@ -2,17 +2,24 @@
/*! \file vdr_menu.h
* \brief Implements menu handling for broswing media libraries within VDR
********************************************************************
- * \version $Revision: 1.1 $
- * \date $Date: 2004/02/01 18:22:53 $
+ * \version $Revision: 1.2 $
+ * \date $Date: 2004/02/01 22:12:56 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
- * \author file owner: $Author: LarsAC $
+ * \author file owner: $Author: RaK $
*/
/*******************************************************************/
#ifndef _VDR_MENU_H
#define _VDR_MENU_H
-#include <vdr/osd.h>
+#undef SHELL_TEST
+
+#ifdef SHELL_TEST
+ #include "myosd.h"
+ #include "mymenuitems.h"
+#else
+ #include <vdr/osd.h>
+#endif
class mgMedia;
class mgSelectionTreeNode;