diff options
author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-07-25 21:33:35 +0000 |
---|---|---|
committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-07-25 21:33:35 +0000 |
commit | 6d085c1c2c9fd7270f96d22b1781d28005ff3674 (patch) | |
tree | 4277a65883efc53d6fb4d6252a3ccfb6f937ade2 | |
parent | c5ced15ac3cb7365914b75378ac8d746480e65df (diff) | |
download | vdr-plugin-muggle-6d085c1c2c9fd7270f96d22b1781d28005ff3674.tar.gz vdr-plugin-muggle-6d085c1c2c9fd7270f96d22b1781d28005ff3674.tar.bz2 |
Removed bugs in finding track files and playlist indexing.
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@105 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | gd_content_interface.c | 46 | ||||
-rwxr-xr-x | mg_content_interface.c | 38 | ||||
-rw-r--r-- | mg_playlist.c | 21 | ||||
-rw-r--r-- | mg_playlist.h | 10 | ||||
-rw-r--r-- | mg_tools.c | 28 | ||||
-rw-r--r-- | muggle.c | 34 | ||||
-rw-r--r-- | vdr_menu.c | 83 | ||||
-rw-r--r-- | vdr_menu.h | 21 | ||||
-rw-r--r-- | vdr_player.c | 16 | ||||
-rw-r--r-- | vdr_setup.c | 7 |
10 files changed, 175 insertions, 129 deletions
diff --git a/gd_content_interface.c b/gd_content_interface.c index 874159e..759c32c 100644 --- a/gd_content_interface.c +++ b/gd_content_interface.c @@ -1,10 +1,10 @@ /*! \file content_interface.cpp * \brief Data Objects for content (e.g. mp3 files, movies) for the vdr muggle plugindatabase * - * \version $Revision: 1.23 $ - * \date $Date: 2004/07/06 00:20:51 $ + * \version $Revision: 1.24 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: MountainMan $ + * \author Responsible author: $Author: lvw $ * * Implements main classes of for content items and interfaces to SQL databases * @@ -330,8 +330,7 @@ mgGdTrack::~mgGdTrack() bool mgGdTrack::readData() { MYSQL_RES *result; - int nrows; - int nfields; + int nrows, nfields; // note: this does not work with empty album or genre fields result = mgSqlReadQuery(&m_db, @@ -346,6 +345,7 @@ bool mgGdTrack::readData() nrows = mysql_num_rows(result); nfields = mysql_num_fields(result); + if(nrows == 0) { mgWarning("No entries found \n"); @@ -353,30 +353,33 @@ bool mgGdTrack::readData() } else { - if (nrows >1 ) + if( nrows > 1 ) { - mgWarning("More than one entry found"); + mgWarning("mgGdTrack::readData: More than one entry found. Using first entry."); } - MYSQL_ROW row; - - row = mysql_fetch_row(result); - m_artist = row[0]; - m_album = row[1]; - m_title = row [2]; - m_mp3file = row [3]; - m_genre = row [4]; - if(sscanf(row [5], "%d", &m_year) !=1) + MYSQL_ROW row = mysql_fetch_row(result); + + m_artist = row[0]; + m_album = row[1]; + m_title = row[2]; + m_mp3file = row[3]; + m_genre = row[4]; + + if( sscanf( row[5], "%d", &m_year) != 1 ) { mgError("Invalid year '%s' in database", row [5]); } - if(sscanf(row [6], "%d", &m_rating) !=1) + + if( row[6] && sscanf( row[6], "%d", &m_rating ) != 1 ) { - mgError("Invalid rating '%s' in database", row [6]); + mgError( "Invalid rating '%s' in database", row [6] ); } - if(sscanf(row [7], "%d", &m_length) !=1) + + if( row[7] && sscanf( row[7], "%d", &m_length) != 1 ) { - mgError("Invalid duration '%s' in database", row [7]); + mgError( "Invalid duration '%s' in database", row [7]); } + } m_retrieved = true; return true; @@ -1392,6 +1395,9 @@ mgContentItem* GdTreeNode::getSingleTrack() /* -------------------- begin CVS log --------------------------------- * $Log: gd_content_interface.c,v $ + * Revision 1.24 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.23 2004/07/06 00:20:51 MountainMan * loading and saving playlists * diff --git a/mg_content_interface.c b/mg_content_interface.c index 437d8b5..c62bd2d 100755 --- a/mg_content_interface.c +++ b/mg_content_interface.c @@ -1,8 +1,8 @@ /*! \file mg_content_interface.c * \brief Data Objects for content (e.g. mp3 files, movies) for the vdr muggle plugin * - * \version $Revision: 1.5 $ - * \date $Date: 2004/05/28 15:29:18 $ + * \version $Revision: 1.6 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author Responsible author: $Author: lvw $ * @@ -104,7 +104,6 @@ void mgTracklist::sortBy(int col, bool direction) ****************************************************************************/ void mgTracklist::setDisplayColumns(vector<int> cols) { - m_columns = cols; } @@ -124,36 +123,38 @@ unsigned int mgTracklist::getNumColumns() * \brief creates the label string for an item * * The list can create a label with different fields (columns). - * The fields used in the list and their order is set by the function - using the function setDisplayColumns - * function getLabel(). + * The fields used in the list and their order is set using the function setDisplayColumns + * * This function creates a string from these columns, separated by the string * 'separator' * in the label and their order ****************************************************************************/ string mgTracklist::getLabel(unsigned int position, const string separator) { - string label =""; + string label = ""; mgContentItem* item; - if(position >= m_list.size()) + if( position >= m_list.size() ) + { return ""; - + } else - { - item = *(m_list.begin()+position); - } - + { + item = *( m_list.begin() + position ); + } + + mgDebug( 1, "mgTracklist::getLabel: Starting to iterate columns." ); for( vector<int>::iterator iter = m_columns.begin(); iter != m_columns.end(); iter++ ) - { + { if( iter != m_columns.begin() ) - { + { label += separator; - } + } + mgDebug( 1, "mgTracklist::getLabel: obtaining label from item %d", *iter ); label += item->getLabel(*iter); - } + } return label; } @@ -302,6 +303,9 @@ string mgSelectionTreeNode::getRestrictions() /* -------------------- begin CVS log --------------------------------- * $Log: mg_content_interface.c,v $ + * Revision 1.6 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.5 2004/05/28 15:29:18 lvw * Merged player branch back on HEAD branch. * diff --git a/mg_playlist.c b/mg_playlist.c index 19e24d5..8f9303d 100644 --- a/mg_playlist.c +++ b/mg_playlist.c @@ -2,10 +2,10 @@ * \file mg_playlist.c * \brief defines functions to be executed on playlists for the vdr muggle plugindatabase * - * \version $Revision: 1.3 $ - * \date $Date: 2004/07/09 12:22:00 $ + * \version $Revision: 1.4 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * * This file implements the class mgPlaylist which maintains a playlist * and supports editing (e.g. adding or moving tracks), navigating it @@ -16,7 +16,6 @@ #include "mg_playlist.h" #include "mg_tools.h" -#include <string> #include <vector> using namespace std; @@ -35,7 +34,7 @@ mgPlaylist::mgPlaylist() mgPlaylist::mgPlaylist(string listname) { - m_current_idx = 0; + m_current_idx = -1; m_listname = listname; } @@ -55,7 +54,7 @@ void mgPlaylist::toggleLoop() void mgPlaylist::initialize() { - m_current = m_list.begin(); + m_current_idx = -1; } /* ==== add/remove tracks ==== */ @@ -140,6 +139,7 @@ int mgPlaylist::count() mgContentItem* mgPlaylist::getFirst() { m_current = m_list.begin(); + m_current_idx = 0; return *m_current; } @@ -162,6 +162,11 @@ mgContentItem* mgPlaylist::skipFwd() { mgContentItem* next; + if( m_current_idx < 0 ) + { + return getFirst(); + } + if( m_current + 1 == m_list.end() ) // unless loop mode { // TODO: why not return a NULL pointer? LVW @@ -207,13 +212,13 @@ mgContentItem* mgPlaylist::sneakNext() } } -bool mgPlaylist::exportM3U( const char *m3u_file ) +bool mgPlaylist::exportM3U( string m3u_file ) { vector<mgContentItem*>::iterator iter; bool result = true; // open a file for writing - FILE *listfile = fopen( m3u_file, "w" ); + FILE *listfile = fopen( m3u_file.c_str(), "w" ); if( !listfile ) { diff --git a/mg_playlist.h b/mg_playlist.h index aaac699..4a0da71 100644 --- a/mg_playlist.h +++ b/mg_playlist.h @@ -2,10 +2,10 @@ * \file mg_playlist.c * \brief defines functions to be executed on playlists for the vdr muggle plugindatabase * - * \version $Revision: 1.4 $ - * \date $Date: 2004/07/09 12:22:00 $ + * \version $Revision: 1.5 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * * This file implements the class mgPlaylist which maintains a playlist * and supports editing (e.g. adding or moving tracks), navigating it @@ -15,6 +15,8 @@ #ifndef __MG_PLAYLIST #define __MG_PLAYLIST +#include <string> + #include "mg_content_interface.h" /*! @@ -141,7 +143,7 @@ public: virtual bool storePlaylist()=0; //! \brief export the playlist in m3u format - virtual void exportM3U( const char *m3u_file ); + virtual bool exportM3U( std::string m3u_file ); }; #endif @@ -3,10 +3,10 @@ * \brief A few util functions for standalone and plugin messaging * for the vdr muggle plugindatabase ******************************************************************** - * \version $Revision: 1.2 $ - * \date $Date: 2004/02/02 22:48:04 $ + * \version $Revision: 1.3 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author file owner: $Author: MountainMan $ + * \author file owner: $Author: lvw $ * */ /*******************************************************************/ @@ -21,8 +21,8 @@ extern "C" #include <stdlib.h> -#define MAX_BUFLEN 1024 -#define MAX_QUERY_BUFLEN 1024 +#define MAX_BUFLEN 2048 +#define MAX_QUERY_BUFLEN 2048 static char buffer[MAX_BUFLEN]; static char querybuf[MAX_QUERY_BUFLEN]; @@ -113,16 +113,19 @@ void mgError(const char *fmt, ...) MYSQL_RES* mgSqlReadQuery(MYSQL *db, const char *fmt, ...) { va_list ap; + va_start( ap, fmt ); + vsnprintf( querybuf, MAX_QUERY_BUFLEN-1, fmt, ap ); - va_start(ap, fmt); - - vsnprintf(querybuf, MAX_QUERY_BUFLEN-1, fmt, ap); - mgDebug(9, "SQL-Query: '%s'",querybuf); - if(mysql_query(db,querybuf)) + mgDebug(9, "mgSqlReadQuery: SQL query: '%s'", querybuf); + + if( mysql_query(db, querybuf) ) { mgError("SQL error in MUGGLE\n%s\n", querybuf); } - return mysql_store_result(db); + + MYSQL_RES *result = mysql_store_result(db); + + return result; } void mgSqlWriteQuery(MYSQL *db, const char *fmt, ...) @@ -140,6 +143,9 @@ void mgSqlWriteQuery(MYSQL *db, const char *fmt, ...) /* -------------------- begin CVS log --------------------------------- * $Log: mg_tools.c,v $ + * Revision 1.3 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.2 2004/02/02 22:48:04 MountainMan * added CVS $Log * @@ -2,12 +2,12 @@ * \file muggle.c * \brief Implements a plugin for browsing media libraries within VDR * - * \version $Revision: 1.8 $ - * \date $Date: 2004/07/09 12:22:00 $ + * \version $Revision: 1.9 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * - * $Id: muggle.c,v 1.8 2004/07/09 12:22:00 LarsAC Exp $ + * $Id: muggle.c,v 1.9 2004/07/25 21:33:35 lvw Exp $ */ #include <getopt.h> @@ -50,11 +50,11 @@ mgMuggle::mgMuggle(void) // defaults for database arguments the_setup.DbHost = "localhost"; the_setup.DbPort = 0; - the_setup.DbName = "GiantDisc2"; + the_setup.DbName = "GiantDisc"; the_setup.DbUser = ""; the_setup.DbPass = "" ; the_setup.GdCompatibility = false; - the_setup.ToplevelDir = ""; + the_setup.ToplevelDir = "/mnt/music/"; } mgMuggle::~mgMuggle() @@ -71,13 +71,13 @@ const char *mgMuggle::CommandLineHelp(void) " -p PPPP, --port=PPPP specify port of database server (default is )\n" " -u UUUU, --user=UUUU specify database user (default is )\n" " -w WWWW, --password=WWWW specify database password (default is empty)\n" - " -t TTTT, --toplevel=TTTT specify toplevel directory for music\n" + " -t TTTT, --toplevel=TTTT specify toplevel directory for music (default is /mnt/music)\n" " -g, --giantdisc enable full Giantdisc compatibility mode\n"; } bool mgMuggle::ProcessArgs(int argc, char *argv[]) { - cout << "mgMuggle::ProcessArgs" << endl << flush; + mgDebug( 1, "mgMuggle::ProcessArgs" ); // Implement command line argument processing here if applicable. static struct option long_options[] = @@ -119,10 +119,12 @@ bool mgMuggle::ProcessArgs(int argc, char *argv[]) } break; case 't': { - the_setup.ToplevelDir = optarg; + string res = string(optarg) + "/"; + the_setup.ToplevelDir = strdup( res.c_str() ); } break; case 'g': { + the_setup.DbName = "GiantDisc"; the_setup.GdCompatibility = true; } break; default: return false; @@ -151,16 +153,16 @@ bool mgMuggle::Start(void) m_media->initFilterSet(); // Read commands for playlists in etc. /video/muggle/playlist_commands.conf - m_playlist_cmds = new cCommands(); + m_playlist_commands = new cCommands(); - char *cmd_file = AddDirectory( cPlugin::ConfigDirectory("muggle"), "playlist_commands.conf" ); - bool have_cmd_file = m_playlist_cmds->Load( cmd_file ); - free( cmd_file ); + char *cmd_file = (char *) AddDirectory( cPlugin::ConfigDirectory("muggle"), "playlist_commands.conf" ); + mgDebug( 1, "mgMuggle::Start: Looking for file %s", cmd_file ); + bool have_cmd_file = m_playlist_commands->Load( (const char*) cmd_file ); if( !have_cmd_file ) { - delete m_playlist_cmds; - m_playlist_cmds = NULL; + delete m_playlist_commands; + m_playlist_commands = NULL; } return true; @@ -187,6 +189,8 @@ cMenuSetupPage *mgMuggle::SetupMenu(void) bool mgMuggle::SetupParse(const char *Name, const char *Value) { + mgDebug( 1, "mgMuggle::SetupParse" ); + if (!strcasecmp(Name, "InitLoopMode")) the_setup.InitLoopMode = atoi(Value); else if (!strcasecmp(Name, "InitShuffleMode")) the_setup.InitShuffleMode = atoi(Value); else if (!strcasecmp(Name, "AudioMode")) the_setup.AudioMode = atoi(Value); @@ -2,12 +2,12 @@ * \file vdr_menu.c * \brief Implements menu handling for browsing media libraries within VDR * - * \version $Revision: 1.23 $ - * \date $Date: 2004/07/09 12:22:00 $ + * \version $Revision: 1.24 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * - * $Id: vdr_menu.c,v 1.23 2004/07/09 12:22:00 LarsAC Exp $ + * $Id: vdr_menu.c,v 1.24 2004/07/25 21:33:35 lvw Exp $ */ #include <string> @@ -17,6 +17,8 @@ #include <menuitems.h> #include <tools.h> +#include <config.h> +#include <plugin.h> #include "vdr_menu.h" #include "vdr_player.h" @@ -56,7 +58,7 @@ void mgMenuTreeItem::Set() // ----------------------- mgMainMenu ---------------------- mgMainMenu::mgMainMenu(mgMedia *media, mgSelectionTreeNode *root, - mgPlaylist *playlist, cCommands playlist_commands) + mgPlaylist *playlist, cCommands *playlist_commands) : cOsdMenu( "" ), m_media(media), m_root(root), m_current_playlist(playlist), m_playlist_commands(playlist_commands) { @@ -135,11 +137,7 @@ eOSState mgMainMenu::ProcessKey(eKeys key) { case kOk: { - mgDebug( 1, "mgMainMenu: expand and descend" ); - m_history.push_back( Current() ); - mgDebug( 1, "Remember current node #%i", Current() ); - mgSelectionTreeNode *child = CurrentNode(); DisplayTree( child ); @@ -340,7 +338,7 @@ eOSState mgMainMenu::ProcessKey(eKeys key) state = osContinue; }; } - } + } } else if( m_state == PLAYLIST_SUBMENU ) { @@ -375,25 +373,35 @@ eOSState mgMainMenu::ProcessKey(eKeys key) state = osContinue; } break; } - else if( m_state == PLAYLIST_COMMANDS ) - { - if( state == osUnknown ) - { - switch( key ) - { - kOk: - { - state = Execute(); - } - } - } - } } else if( state == osBack ) { m_state = PLAYLIST; DisplayPlaylist( m_last_osd_index ); - + + state = osContinue; + } + } + else if( m_state == PLAYLIST_COMMANDS ) + { + if( state == osUnknown ) + { + switch( key ) + { + case kOk: + { + state = ExecutePlaylistCommand( Current() ); + } break; + default: + { + } + } + } + else if( state == osBack ) + { + m_state = PLAYLIST_SUBMENU; + DisplayPlaylistSubmenu(); + state = osContinue; } } @@ -480,11 +488,8 @@ void mgMainMenu::DisplayTree( mgSelectionTreeNode* node, int select ) SetButtons(); m_node = node; - mgDebug( 1, "mgBrowseMenu::DisplaySelection: node %s received", node->getLabel().c_str() ); vector<mgSelectionTreeNode*> children = node->getChildren(); - mgDebug( 1, "mgBrowseMenu::DisplaySelection: %d elements received", children.size() ); - for( vector<mgSelectionTreeNode*>::iterator iter = children.begin(); iter != children.end(); iter ++ ) @@ -513,10 +518,7 @@ void mgMainMenu::DisplayTreeSubmenu() m_state = TREE_SUBMENU; Clear(); - - mgDebug( 1, "Creating Muggle tree view submenu" ); SetButtons(); - SetTitle( strcat("Muggle - ",tr("Tree View Commands") ) ); // Add items @@ -573,6 +575,7 @@ eOSState mgMainMenu::TreeSubmenuAction( int n ) void mgMainMenu::DisplayPlaylist( int index_current ) { + mgDebug( 1, "mgMainMenu::DisplayPlaylist: entering." ); m_state = PLAYLIST; // make sure we have a current playlist @@ -585,7 +588,7 @@ void mgMainMenu::DisplayPlaylist( int index_current ) list->size() , tr("items") ); SetTitle( titlestr ); - + for( unsigned int i = 0; i < m_current_playlist->getNumItems(); i++) { string label = m_current_playlist->getLabel( i, " " ); @@ -687,7 +690,7 @@ void mgMainMenu::DisplayPlaylistCommands() Display(); } -eOSState cMenuCommands::ExecutePlaylistCommand( int current, char *parameters ) +eOSState mgMainMenu::ExecutePlaylistCommand( int current ) { cCommand *command = m_playlist_commands->Get( current ); if( command ) @@ -700,18 +703,17 @@ eOSState cMenuCommands::ExecutePlaylistCommand( int current, char *parameters ) confirmed = Interface->Confirm( buffer ); free( buffer ); } - if( confirmed ) + if( confirmed ) { asprintf( &buffer, "%s...", command->Title() ); Interface->Status( buffer ); Interface->Flush(); free( buffer ); - char *tmp_m3u_file = AddDirectory( cPlugin::ConfigDirectory("muggle"), "current.m3u" ); + string tmp_m3u_file = (char *) AddDirectory( cPlugin::ConfigDirectory("muggle"), "current.m3u" ); m_current_playlist->exportM3U( tmp_m3u_file ); - free( tmp_m3u_file ); - const char *result = command->Execute( tmp_m3u_file ); + char *result = (char *)command->Execute( tmp_m3u_file.c_str() ); /* What to do? Recode cMenuText (not much)? if( result ) @@ -719,6 +721,9 @@ eOSState cMenuCommands::ExecutePlaylistCommand( int current, char *parameters ) return AddSubMenu( new cMenuText( command->Title(), result ) ); } */ + + free( result ); + return osEnd; } } @@ -780,9 +785,8 @@ eOSState mgMainMenu::PlaylistSubmenuAction( int n ) } case 5: { - char *m3u_file = AddDirectory( cPlugin::ConfigDirectory("muggle"), m_current_playlist->getListname() ); + string m3u_file = AddDirectory( cPlugin::ConfigDirectory("muggle"), m_current_playlist->getListname().c_str() ); m_current_playlist->exportM3U( m3u_file ); - free( m3u_file ); } case 6: { @@ -906,6 +910,9 @@ void mgMainMenu::Play(mgPlaylist *plist) /************************************************************ * * $Log: vdr_menu.c,v $ + * Revision 1.24 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.23 2004/07/09 12:22:00 LarsAC * Untested extensions for exporting plalists * @@ -2,12 +2,12 @@ * \file vdr_menu.h * \brief Implements menu handling for broswing media libraries within VDR * - * \version $Revision: 1.12 $ - * \date $Date: 2004/07/09 12:22:00 $ + * \version $Revision: 1.13 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * - * $Id: vdr_menu.h,v 1.12 2004/07/09 12:22:00 LarsAC Exp $ + * $Id: vdr_menu.h,v 1.13 2004/07/25 21:33:35 lvw Exp $ */ #ifndef _VDR_MENU_H @@ -17,10 +17,11 @@ #include <vector> #include <osd.h> -#include <config.h> #include "i18n.h" +class cCommands; + class mgMedia; class mgSelectionTreeNode; class mgPlaylist; @@ -53,7 +54,7 @@ class mgMainMenu : public cOsdMenu public: mgMainMenu(mgMedia *media, mgSelectionTreeNode *root, - mgPlaylist *playlist, cCommands playlist_commands ); + mgPlaylist *playlist, cCommands *playlist_commands ); mgSelectionTreeNode *CurrentNode(); mgMenuTreeItem *CurrentItem(); @@ -90,11 +91,14 @@ class mgMainMenu : public cOsdMenu void RenamePlaylist(); void DisplayPlaylistSubmenu(); eOSState PlaylistSubmenuAction( int n ); + void DisplayPlaylistCommands(); + eOSState ExecutePlaylistCommand( int current ); // Filter view handling void DisplayFilter(); void DisplayFilterSelector(); + private: void Play(mgPlaylist *plist); @@ -108,7 +112,7 @@ class mgMainMenu : public cOsdMenu MuggleStatus m_state; std::list<int> m_history; - cCommands m_playlist_commands; + cCommands *m_playlist_commands; int m_last_osd_index; }; @@ -118,6 +122,9 @@ class mgMainMenu : public cOsdMenu /************************************************************ * * $Log: vdr_menu.h,v $ + * Revision 1.13 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.12 2004/07/09 12:22:00 LarsAC * Untested extensions for exporting plalists * diff --git a/vdr_player.c b/vdr_player.c index e02414e..48f7be3 100644 --- a/vdr_player.c +++ b/vdr_player.c @@ -2,12 +2,12 @@ * \file vdr_player.c * \brief A generic PCM player for a VDR media plugin (muggle) * - * \version $Revision: 1.3 $ - * \date $Date: 2004/07/12 11:06:23 $ + * \version $Revision: 1.4 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: LarsAC $ + * \author Responsible author: $Author: lvw $ * - * $Id: vdr_player.c,v 1.3 2004/07/12 11:06:23 LarsAC Exp $ + * $Id: vdr_player.c,v 1.4 2004/07/25 21:33:35 lvw Exp $ * * Adapted from * MP3/MPlayer plugin to VDR (C++) @@ -337,7 +337,6 @@ void mgPCMPlayer::Action(void) dvbSampleRate = 48000; m_state = msStop; SetPlayMode( pmStopped ); - cout << "Playmode set." << endl << flush; while( m_active ) { @@ -362,6 +361,7 @@ void mgPCMPlayer::Action(void) m_playing = m_current; string filename = getSourceFile(); + mgDebug( 1, "mgPCMPlayer::Action: music file is %s", filename.c_str() ); if( ( m_decoder = mgDecoders::findDecoder( filename ) ) && m_decoder->start() ) { @@ -696,7 +696,8 @@ string mgPCMPlayer::getSourceFile() } cout << "mgPCMPlayer::getSourceFile: found filename " << filename << endl << flush; - return "/test.mp3"; + return filename; + // return "/test.mp3"; } bool mgPCMPlayer::NextFile() @@ -1042,6 +1043,9 @@ eOSState mgPlayerControl::ProcessKey(eKeys key) /************************************************************ * * $Log: vdr_player.c,v $ + * Revision 1.4 2004/07/25 21:33:35 lvw + * Removed bugs in finding track files and playlist indexing. + * * Revision 1.3 2004/07/12 11:06:23 LarsAC * No longer skip first file on playlist when starting replay. * diff --git a/vdr_setup.c b/vdr_setup.c index 04ba06b..13f44ac 100644 --- a/vdr_setup.c +++ b/vdr_setup.c @@ -2,12 +2,12 @@ * \file vdr_setup.c * \brief A setup class for a VDR media plugin (muggle) * - * \version $Revision: 1.2 $ - * \date $Date: 2004/05/28 15:29:19 $ + * \version $Revision: 1.3 $ + * \date $Date: 2004/07/25 21:33:35 $ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner * \author Responsible author: $Author: lvw $ * - * $Id: vdr_setup.c,v 1.2 2004/05/28 15:29:19 lvw Exp $ + * $Id: vdr_setup.c,v 1.3 2004/07/25 21:33:35 lvw Exp $ * * Partially adapted from * MP3/MPlayer plugin to VDR (C++) @@ -67,4 +67,5 @@ mgSetup::mgSetup() TargetLevel = DEFAULT_TARGET_LEVEL; LimiterLevel = DEFAULT_LIMITER_LEVEL; Only48kHz = 0; + ToplevelDir = "/mnt/music/"; } |