/****************************************************************************
**
** DCOP Skeleton generated by dcopidl2cpp from kscd.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "/tmp/buildd/tde-packaging/arch/tde-extra/tde-tdemultimedia/src/tdemultimedia-trinity-14.1.6/kscd/kscd.h"

#include <kdatastream.h>
#include <tqasciidict.h>


static const int KSCD_fhash = 29;
static const char* const KSCD_ftable[28][3] = {
    { "bool", "playing()", "playing()" },
    { "void", "play()", "play()" },
    { "void", "stop()", "stop()" },
    { "void", "previous()", "previous()" },
    { "void", "next()", "next()" },
    { "void", "jumpTo(int)", "jumpTo(int seconds)" },
    { "void", "eject()", "eject()" },
    { "void", "quit()", "quit()" },
    { "void", "toggleLoop()", "toggleLoop()" },
    { "void", "toggleShuffle()", "toggleShuffle()" },
    { "void", "toggleTimeDisplay()", "toggleTimeDisplay()" },
    { "void", "cddbDialog()", "cddbDialog()" },
    { "void", "optionDialog()", "optionDialog()" },
    { "void", "setTrack(int)", "setTrack(int t)" },
    { "void", "volumeDown()", "volumeDown()" },
    { "void", "volumeUp()", "volumeUp()" },
    { "void", "setVolume(int)", "setVolume(int v)" },
    { "void", "setDevice(TQString)", "setDevice(TQString dev)" },
    { "int", "getVolume()", "getVolume()" },
    { "int", "currentTrack()", "currentTrack()" },
    { "int", "currentTrackLength()", "currentTrackLength()" },
    { "int", "currentPosition()", "currentPosition()" },
    { "int", "getStatus()", "getStatus()" },
    { "TQString", "currentTrackTitle()", "currentTrackTitle()" },
    { "TQString", "currentAlbum()", "currentAlbum()" },
    { "TQString", "currentArtist()", "currentArtist()" },
    { "TQStringList", "trackList()", "trackList()" },
    { 0, 0, 0 }
};
static const int KSCD_ftable_hiddens[27] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KSCD::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( KSCD_fhash, true, false );
	for ( int i = 0; KSCD_ftable[i][1]; i++ )
	    fdict->insert( KSCD_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // bool playing()
	replyType = KSCD_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << playing( );
    } break;
    case 1: { // void play()
	replyType = KSCD_ftable[1][0]; 
	play( );
    } break;
    case 2: { // void stop()
	replyType = KSCD_ftable[2][0]; 
	stop( );
    } break;
    case 3: { // void previous()
	replyType = KSCD_ftable[3][0]; 
	previous( );
    } break;
    case 4: { // void next()
	replyType = KSCD_ftable[4][0]; 
	next( );
    } break;
    case 5: { // void jumpTo(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSCD_ftable[5][0]; 
	jumpTo(arg0 );
    } break;
    case 6: { // void eject()
	replyType = KSCD_ftable[6][0]; 
	eject( );
    } break;
    case 7: { // void quit()
	replyType = KSCD_ftable[7][0]; 
	quit( );
    } break;
    case 8: { // void toggleLoop()
	replyType = KSCD_ftable[8][0]; 
	toggleLoop( );
    } break;
    case 9: { // void toggleShuffle()
	replyType = KSCD_ftable[9][0]; 
	toggleShuffle( );
    } break;
    case 10: { // void toggleTimeDisplay()
	replyType = KSCD_ftable[10][0]; 
	toggleTimeDisplay( );
    } break;
    case 11: { // void cddbDialog()
	replyType = KSCD_ftable[11][0]; 
	cddbDialog( );
    } break;
    case 12: { // void optionDialog()
	replyType = KSCD_ftable[12][0]; 
	optionDialog( );
    } break;
    case 13: { // void setTrack(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSCD_ftable[13][0]; 
	setTrack(arg0 );
    } break;
    case 14: { // void volumeDown()
	replyType = KSCD_ftable[14][0]; 
	volumeDown( );
    } break;
    case 15: { // void volumeUp()
	replyType = KSCD_ftable[15][0]; 
	volumeUp( );
    } break;
    case 16: { // void setVolume(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSCD_ftable[16][0]; 
	setVolume(arg0 );
    } break;
    case 17: { // void setDevice(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSCD_ftable[17][0]; 
	setDevice(arg0 );
    } break;
    case 18: { // int getVolume()
	replyType = KSCD_ftable[18][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getVolume( );
    } break;
    case 19: { // int currentTrack()
	replyType = KSCD_ftable[19][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentTrack( );
    } break;
    case 20: { // int currentTrackLength()
	replyType = KSCD_ftable[20][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentTrackLength( );
    } break;
    case 21: { // int currentPosition()
	replyType = KSCD_ftable[21][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentPosition( );
    } break;
    case 22: { // int getStatus()
	replyType = KSCD_ftable[22][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getStatus( );
    } break;
    case 23: { // TQString currentTrackTitle()
	replyType = KSCD_ftable[23][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentTrackTitle( );
    } break;
    case 24: { // TQString currentAlbum()
	replyType = KSCD_ftable[24][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentAlbum( );
    } break;
    case 25: { // TQString currentArtist()
	replyType = KSCD_ftable[25][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentArtist( );
    } break;
    case 26: { // TQStringList trackList()
	replyType = KSCD_ftable[26][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << trackList( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList KSCD::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "KSCD";
    return ifaces;
}

QCStringList KSCD::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; KSCD_ftable[i][2]; i++ ) {
	if (KSCD_ftable_hiddens[i])
	    continue;
	TQCString func = KSCD_ftable[i][0];
	func += ' ';
	func += KSCD_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


