/***************************************************************************
                            SynthOut.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <kdec/kde_SynthOut.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/SynthOut.h>

@implementation  SynthOut


- initWithInt: (int)d
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_SynthOut((int)d)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- init
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_SynthOut(0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			kde_del_SynthOut((kde_SynthOut *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- openDev: (int)sqfd
{
	kde_SynthOut_openDev((kde_SynthOut *)[self qt], (int)sqfd);
	return self;
}

- closeDev
{
	kde_SynthOut_closeDev((kde_SynthOut *)[self qt]);
	return self;
}

- initDev
{
	kde_SynthOut_initDev((kde_SynthOut *)[self qt]);
	return self;
}

- noteOn: (unsigned char)chn note: (unsigned char)note vel: (unsigned char)vel
{
	kde_SynthOut_noteOn((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)note, (unsigned char)vel);
	return self;
}

- noteOff: (unsigned char)chn note: (unsigned char)note vel: (unsigned char)vel
{
	kde_SynthOut_noteOff((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)note, (unsigned char)vel);
	return self;
}

- keyPressure: (unsigned char)chn note: (unsigned char)note vel: (unsigned char)vel
{
	kde_SynthOut_keyPressure((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)note, (unsigned char)vel);
	return self;
}

- chnPatchChange: (unsigned char)chn patch: (unsigned char)patch
{
	kde_SynthOut_chnPatchChange((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)patch);
	return self;
}

- chnPressure: (unsigned char)chn vel: (unsigned char)vel
{
	kde_SynthOut_chnPressure((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)vel);
	return self;
}

- chnPitchBender: (unsigned char)chn lsb: (unsigned char)lsb msb: (unsigned char)msb
{
	kde_SynthOut_chnPitchBender((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)lsb, (unsigned char)msb);
	return self;
}

- chnController: (unsigned char)chn ctl: (unsigned char)ctl v: (unsigned char)v
{
	kde_SynthOut_chnController((kde_SynthOut *)[self qt], (unsigned char)chn, (unsigned char)ctl, (unsigned char)v);
	return self;
}

- sysex: (unsigned char*)data size: (unsigned long)size
{
	kde_SynthOut_sysex((kde_SynthOut *)[self qt], (unsigned char*)data, (unsigned long)size);
	return self;
}

@end
