summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-07-29 06:18:07 +0000
committerlvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b>2004-07-29 06:18:07 +0000
commit37ce84e62b46619cc0bfc5733159c07b88556754 (patch)
treee74fcff6729d699e64b8a00ccee8db6329b258aa
parent584267906a160cdb699b88da0f5e5e495052ab44 (diff)
downloadvdr-plugin-muggle-37ce84e62b46619cc0bfc5733159c07b88556754.tar.gz
vdr-plugin-muggle-37ce84e62b46619cc0bfc5733159c07b88556754.tar.bz2
Added todo entries
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@113 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--TODO4
-rw-r--r--gd_content_interface.h22
-rw-r--r--mg_media.c124
-rw-r--r--muggle.c8
4 files changed, 90 insertions, 68 deletions
diff --git a/TODO b/TODO
index 06a91e3..509d3cb 100644
--- a/TODO
+++ b/TODO
@@ -13,6 +13,7 @@ Testing/bugs
Code polishing
==============
- Check for memory leaks
+ - Why do filters use pointers?
- Check for (reasonably) consistent usage of char*/string
- mgDatabase is not used?
- mgPlayer used what for?
@@ -105,6 +106,9 @@ Already Done
************************************************************
*
* $Log: TODO,v $
+* Revision 1.11 2004/07/29 06:18:07 lvw
+* Added todo entries
+*
* Revision 1.10 2004/07/29 05:58:14 lvw
* TODO list changed
*
diff --git a/gd_content_interface.h b/gd_content_interface.h
index 491e4b9..d564f7d 100644
--- a/gd_content_interface.h
+++ b/gd_content_interface.h
@@ -3,10 +3,10 @@
* \brief Data objects for content (e.g. mp3 files, movies)
* for the vdr muggle plugin database
*
- * \version $Revision: 1.8 $
- * \date $Date: 2004/07/06 00:20:51 $
+ * \version $Revision: 1.9 $
+ * \date $Date: 2004/07/29 06:17:50 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
- * \author Responsible author: $Author: MountainMan $
+ * \author Responsible author: $Author: lvw $
*
* Declares main classes for content items and interfaces to SQL databases
*
@@ -65,8 +65,9 @@ class gdFilterSets : public mgFilterSets
* the active filter sets.
*
* \param viewPort - after call, contains the index of the appropriate default view in
+ * \todo should viewPort be a reference?
*/
- virtual std::string computeRestriction(int *viewPrt);
+ virtual std::string computeRestriction(int *viewPrt);
};
@@ -77,15 +78,19 @@ class gdFilterSets : public mgFilterSets
* The object is initially created with a database identifier.
* The actual data is only read when a content field is accessed for
* the first time. For subsequent access, cached values are used.
+ *
+ * \todo does each track node need a reference to the database?
+ * maybe we can use a static db handle in mgDatabase?
+ * \
*/
class mgGdTrack : public mgContentItem
{
private:
- /*!
- * \brief the database in which the track resides
- * */
+ /*!
+ * \brief the database in which the track resides
+ * */
MYSQL m_db;
/*!
@@ -306,6 +311,9 @@ public:
/* -------------------- begin CVS log ---------------------------------
* $Log: gd_content_interface.h,v $
+ * Revision 1.9 2004/07/29 06:17:50 lvw
+ * Added todo entries
+ *
* Revision 1.8 2004/07/06 00:20:51 MountainMan
* loading and saving playlists
*
diff --git a/mg_media.c b/mg_media.c
index 18e44f3..96dc3f7 100644
--- a/mg_media.c
+++ b/mg_media.c
@@ -1,8 +1,8 @@
/*! \file mg_media.c
* \brief Top level access to media in vdr plugin muggle
*
- * \version $Revision: 1.13 $
- * \date $Date: 2004/05/28 15:29:18 $
+ * \version $Revision: 1.14 $
+ * \date $Date: 2004/07/29 06:17:40 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
* \author Responsible author: $Author: lvw $
*/
@@ -245,55 +245,61 @@ mgSelectionTreeNode* mgMedia::getSelectionRoot()
mgPlaylist* mgMedia::createTemporaryPlaylist()
{
string tmpname = "current";
- return loadPlaylist(tmpname);
+ return loadPlaylist( tmpname );
}
/*!
- *******************************************************************
- * \brief
- ********************************************************************/
+ * \brief Load a playlist from the database
+ *
+ */
mgPlaylist* mgMedia::loadPlaylist(string name)
{
mgPlaylist *list;
- switch(m_mediatype)
- {
- case GD_MP3:
- list = new GdPlaylist(name, m_db);
- list->setDisplayColumns(getDefaultCols());
- return list;
+ switch( m_mediatype )
+ {
+ case GD_MP3:
+ {
+ list = new GdPlaylist(name, m_db);
+ list->setDisplayColumns(getDefaultCols());
+
+ return list;
+ } break;
}
- mgError("implementation Error"); // we should never get here
+ mgError("Implementation error: Unknown media type"); // we should never get here
return NULL;
}
/*!
- *******************************************************************
- * \brief
- ********************************************************************/
+ * \brief Obtain a list of stored playlists
+ */
vector<string> *mgMedia::getStoredPlaylists()
{
switch(m_mediatype)
{
case GD_MP3:
- return GdGetStoredPlaylists(m_db);
+ {
+ return GdGetStoredPlaylists( m_db );
+ } break;
}
mgError("implementation Error"); // we should never get here
return new vector<string>();
}
/*!
- *******************************************************************
- * \brief
- ********************************************************************/
+ * \brief obtain the indices of columns which are presented by default
+ */
vector<int> mgMedia::getDefaultCols()
{
vector<int> cols;
switch(m_mediatype)
{
case GD_MP3:
+ {
cols.push_back(1); // artist
cols.push_back(0); // track
+
return cols;
+ } break;
}
mgError("implementation Error"); // we should never get here
@@ -301,9 +307,8 @@ vector<int> mgMedia::getDefaultCols()
}
/*!
- *******************************************************************
- * \brief
- ********************************************************************/
+ * \brief
+ */
mgTracklist* mgMedia::getTracks()
{
mgTracklist *tracks;
@@ -320,18 +325,18 @@ mgTracklist* mgMedia::getTracks()
}
/*!
- *******************************************************************
* \brief creates FiliterSetObject for the selected media type
* and activates set n (if available)
- ********************************************************************/
+ */
void mgMedia::initFilterSet(int num)
{
- switch(m_mediatype)
+ switch(m_mediatype)
{
- case GD_MP3:
- m_filters = new gdFilterSets();
- m_filters->select(num);
- break;
+ case GD_MP3:
+ {
+ m_filters = new gdFilterSets();
+ m_filters->select(num);
+ } break;
}
}
@@ -351,56 +356,54 @@ vector<mgFilter*> *mgMedia::getActiveFilters()
}
/*!
- *******************************************************************
* \brief returns title of the active filter set
- ********************************************************************/
+ */
string mgMedia::getActiveFilterTitle()
{
switch(m_mediatype)
{
case GD_MP3:
- if(!m_filters)
{
- mgError("ImplementationError:getActiveFilterTitle m_filters == NULL");
- }
- return m_filters->getTitle();
+ if( !m_filters )
+ {
+ mgError("ImplementationError:getActiveFilterTitle m_filters == NULL");
+ }
+ return m_filters->getTitle();
+ } break;
}
return "";
}
/*!
- *******************************************************************
* \brief proceeds to the next filter set in a cirlucar fashion
- ********************************************************************/
+ */
void mgMedia::nextFilterSet()
{
if(!m_filters)
- {
- mgError("ImplementationError: nextFilterSet m_filters == NULL");
- }
+ {
+ mgError("ImplementationError: nextFilterSet m_filters == NULL");
+ }
m_filters->nextSet();
}
/*!
- *******************************************************************
* \brief clears the current filter values and restores defaults
- ********************************************************************/
+ */
void mgMedia::clearActiveFilter()
{
- if(!m_filters)
- {
- mgError("ImplementationError: clearActiveFilter m_filters == NULL");
- }
+ if( !m_filters )
+ {
+ mgError("ImplementationError: clearActiveFilter m_filters == NULL");
+ }
m_filters->clear();
}
/*!
- *******************************************************************
* \brief Applies the active filter set and returns a root node for the
* selection in the default view for this filter set
- ********************************************************************/
-mgSelectionTreeNode *mgMedia::applyActiveFilter()
+ */
+mgSelectionTreeNode* mgMedia::applyActiveFilter()
{
int view;
GdTreeNode* node;
@@ -408,15 +411,17 @@ mgSelectionTreeNode *mgMedia::applyActiveFilter()
switch(m_mediatype)
{
case GD_MP3:
- if(!m_filters)
{
- mgError("ImplementationError: applyActiveFilter() m_filters == NULL");
- }
- m_filters->accept();
- m_sql_filter = m_filters->computeRestriction(&view);
- node = new GdTreeNode(m_db, view, m_sql_filter);
- node->expand();
- return node->getChildren()[0];
+ if(!m_filters)
+ {
+ mgError("ImplementationError: applyActiveFilter() m_filters == NULL");
+ }
+ m_filters->accept();
+ m_sql_filter = m_filters->computeRestriction(&view);
+ node = new GdTreeNode(m_db, view, m_sql_filter);
+ node->expand();
+ return node->getChildren()[0];
+ } break;
}
return NULL;
}
@@ -424,6 +429,9 @@ mgSelectionTreeNode *mgMedia::applyActiveFilter()
/* -------------------- begin CVS log ---------------------------------
* $Log: mg_media.c,v $
+ * Revision 1.14 2004/07/29 06:17:40 lvw
+ * Added todo entries
+ *
* Revision 1.13 2004/05/28 15:29:18 lvw
* Merged player branch back on HEAD branch.
*
diff --git a/muggle.c b/muggle.c
index 6e75705..5a5df21 100644
--- a/muggle.c
+++ b/muggle.c
@@ -2,12 +2,12 @@
* \file muggle.c
* \brief Implements a plugin for browsing media libraries within VDR
*
- * \version $Revision: 1.9 $
- * \date $Date: 2004/07/25 21:33:35 $
+ * \version $Revision: 1.10 $
+ * \date $Date: 2004/07/29 06:18:07 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
* \author Responsible author: $Author: lvw $
*
- * $Id: muggle.c,v 1.9 2004/07/25 21:33:35 lvw Exp $
+ * $Id: muggle.c,v 1.10 2004/07/29 06:18:07 lvw Exp $
*/
#include <getopt.h>
@@ -131,6 +131,8 @@ bool mgMuggle::ProcessArgs(int argc, char *argv[])
}
}
+ // check for GD compatibility and override
+
return true;
}