/*
* 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.
*/
//static int DEBUG=0;
static char *VERSION="0.0.6";
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "xchat-plugin.h"
static xchat_plugin *ph;
#include "functions.c"
#include "mp3Info.c"
#include "oggInfo.c"
#include "theme.c"
static int print_themes (char *word[], char *word_eol[], void *userdata){
printThemes();
return XCHAT_EAT_ALL;
}
static int mpc_themeReload(char *word[], char *word_eol[], void *userdata){
themeInit();
loadThemes();
return XCHAT_EAT_ALL;
}
static int mpc_tell(char *word[], char *word_eol[], void *userdata){
char *tTitle, *zero, *oggLine, *line;
struct tagInfo info;
HWND hwnd = FindWindow("MediaPlayerClassicW",NULL);
if (hwnd==0) {xchat_command(ph, randomLine(notRunTheme));return XCHAT_EAT_ALL;}
tTitle=(char*)malloc(sizeof(char)*1024);
GetWindowText(hwnd, tTitle, 1024);
zero=strstr(tTitle," - Media Player Classic");
if (zero!=NULL) zero[0]=0;
else xchat_print(ph,"pattern not found");
if ((tTitle[1]==':')&&(tTitle[2]=='\\')){
//xchat_print(ph,"seams to be full path");
if (endsWith(tTitle,".mp3")==1){
//xchat_print(ph,"seams to be a mp3 file");
info = readHeader(tTitle);
if ((