/***************************************************************************
 *   Copyright (C) 2005 by Reel Multimedia                                 *
 *                                                                         *
 *                                                                         *
 *   This program is free software; you can 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 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program 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     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "mediaplayer.h"
#include "playermenu.h"

#include "i18n.h"
#include "def.h"

#include "vdr/remote.h"

static const char *VERSION  = "0.0.1";


cPluginMediaPlayer::cPluginMediaPlayer()
{ 
}

cPluginMediaPlayer::~cPluginMediaPlayer()
{
}

const char *cPluginMediaPlayer::Version()
{
    return VERSION;
}

const char *cPluginMediaPlayer::Description()
{
    return DESCRIPTION;
}

bool cPluginMediaPlayer::Initialize()
{
    RegisterI18n(Phrases);
    return true;
}

cMenuSetupPage *cPluginMediaPlayer::SetupMenu()
{
    return NULL; 
}

bool cPluginMediaPlayer::SetupParse(const char *Name, const char *Value)
{
    return true;
}

cOsdObject *cPluginMediaPlayer::MainMenuAction(void)
{
    //printf("------------cPluginMediaPlayer::MainMenuAction------------\n");
    std::string titlestring = tr(DESCRIPTION); 
    return new cMenuMediaPlayer(titlestring);
}

bool cPluginMediaPlayer::Service(char const *id, void *data)
{

    return false;
}

const char **cPluginMediaPlayer::SVDRPHelpPages(void)
{
    static const char *HelpPages[] = 
    {
        "OPEN\n"
        "    Open mediaplayer plugin.",
        NULL
    };
    return HelpPages;
}

cString cPluginMediaPlayer::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode)
{ 
    if (strcasecmp(Command, "OPEN") == 0) 
    {
       cRemote::CallPlugin("mediaplayer"); 

       std::string msg = "Opening mediaplayer plugin, startdir = " + std::string(Option);
       return cString(msg.c_str());
    }
    return NULL;
}

VDRPLUGINCREATOR(cPluginMediaPlayer); // Don't touch this!

