/***************************************************************************
                            KMidSimpleAPI.cpp -  description
                             -------------------
    begin                : Sun Jan 27 16:22:17 2002
    copyright            : (C) 2000-2001 Lost Highway Ltd.
    email                : Richard_Dale@tipitina.demon.co.uk
    generated by         : duke@tipitina on Sun Jan 27 16:22:17 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
***************************************************************************/

#define _BOOL_H_
#include <libkmid/libkmid.h>
#include <qstring.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <kdejava/KDESupport.h>
#include <kdejava/KMidSimpleAPI.h>

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidInit(JNIEnv *env, jclass obj)
{
	return (jint) KMidSimpleAPI::kMidInit();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidLoad(JNIEnv *env, jclass obj, jstring filename)
{
static QCString * _qstring_filename = 0;
	return (jint) KMidSimpleAPI::kMidLoad((char*) QtSupport::toCharString(env, filename, &_qstring_filename));
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidPlay__I(JNIEnv *env, jclass obj, jint loop)
{
	return (jint) KMidSimpleAPI::kMidPlay((int) loop);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidPlay__(JNIEnv *env, jclass obj)
{
	return (jint) KMidSimpleAPI::kMidPlay(0);
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidStop(JNIEnv *env, jclass obj)
{
	return (jint) KMidSimpleAPI::kMidStop();
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidDestruct(JNIEnv *env, jclass obj)
{
	KMidSimpleAPI::kMidDestruct();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidIsPlaying(JNIEnv *env, jclass obj)
{
	return (jint) KMidSimpleAPI::kMidIsPlaying();
}

JNIEXPORT jint JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidDevices(JNIEnv *env, jclass obj)
{
	return (jint) KMidSimpleAPI::kMidDevices();
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidName(JNIEnv *env, jclass obj, jint i)
{
	 const char * _qcstring;
	_qcstring = (const char *)KMidSimpleAPI::kMidName((int) i);
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidType(JNIEnv *env, jclass obj, jint i)
{
	 const char * _qcstring;
	_qcstring = (const char *)KMidSimpleAPI::kMidType((int) i);
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidSetDevice(JNIEnv *env, jclass obj, jint i)
{
	KMidSimpleAPI::kMidSetDevice((int) i);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidSetMidiMapper(JNIEnv *env, jclass obj, jstring mapfilename)
{
static QCString * _qstring_mapfilename = 0;
	KMidSimpleAPI::kMidSetMidiMapper((char*) QtSupport::toCharString(env, mapfilename, &_qstring_mapfilename));
	return;
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidVersion(JNIEnv *env, jclass obj)
{
	 const char * _qcstring;
	_qcstring = (const char *)KMidSimpleAPI::kMidVersion();
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

JNIEXPORT jstring JNICALL
Java_org_kde_koala_KMidSimpleAPI_kMidCopyright(JNIEnv *env, jclass obj)
{
	 const char * _qcstring;
	_qcstring = (const char *)KMidSimpleAPI::kMidCopyright();
	return QtSupport::fromCharString(env, (char *) _qcstring);
}

