/*
    RECWSERV.C

Wserv subclass for Sound record/playback application
*/

#include <hwim.g>
#include <record.g>
#include <gate.g>
#include <hwim.h>
#include <record.rsg>

GLREF_D PR_HWIMMAN * const w_am;
GLREF_D UBYTE *DatCommandPtr;
GLREF_D UBYTE *DatUsedPathNamePtr;
GLREF_D WSERV_SPEC *wserv_channel;
GLREF_D PR_GATE *DatGate;

GLDEF_D PR_RECENG *receng;

#pragma METHOD_CALL

GLDEF_C VOID main(VOID)
    {
    IN_HWIMMAN app;
    IN_WSERV ws;

    p_linklib(0);
    app.flags=FLG_APPMAN_FULLSCREEN|FLG_APPMAN_RSCFILE|FLG_APPMAN_CLEAN|
        FLG_APPMAN_SRSCFILE;
    app.wserv_cat=ws.com_cat=p_getlibh(CAT_RECORD_RECORD);
    app.wserv_class=C_RECWSERV;
    ws.com_class=C_RECCOM;
    p_send4(p_new(CAT_RECORD_RECORD,C_RECMAN),O_AM_INIT,&app,&ws);
    }

METHOD VOID recwserv_ws_dyn_init(PR_RECWSERV *self)
    {
    W_WINDATA wd;

    p_setpth("\\WVE\\");
    wd.extent.tl.x=0;
    wd.extent.tl.y=0;
    wd.extent.height=wserv_channel->conn.info.pixels.y;
    wd.extent.width=wserv_channel->conn.info.pixels.x-DatGate->gate.x.bsww;
    self->wserv.cli=f_newsend(CAT_RECORD_RECORD,C_RECCLI,
                                O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
    wsSetList(W_STATUS_WINDOW_ICON,NULL,W_STATUS_WIN_NO_DIAMOND);
    wStatusWindow(W_STATUS_WINDOW_BIG);
    self->wserv.help_index_id=RECORD_HELP;
    receng=f_newsend(CAT_RECORD_RECORD,C_RECENG,O_ENG_INIT,self->wserv.cli,O_CL_UPDATE,O_CL_BEGIN_SOUND);
    p_send4(self->wserv.com,O_COM_FILE_CHANGE,w_am->hwimman.command,
                                DatUsedPathNamePtr);
    }

