Ejemplo n.º 1
0
/* -------------------------------- */
void install_prg(void)
{
register int i;

ap_id = appl_init();
open_vwork();

kb_rec = (int *)Iorec(1);
for (i = 0; i < 5; i++)
	old_kb[i] = kb_rec[i + 2];

kb_rec[2] = 10;
kb_rec[3] = 0;
kb_rec[4] = 0;
kb_rec[5] = 2;
kb_rec[6] = 8;

rsrc_load("M_TEXT.RSC");
rsrc_gaddr(ROOT, TXT_MENU, &menu_adr);

graf_mouse(ARROW, 0L);

init_mtext();
init_rsc();

menu_bar(menu_adr, TRUE);
}
Ejemplo n.º 2
0
int
SetMBuf ()
{
  unsigned short size;

  size = 16384;			/* 16K MIDI buffer */

  m_buff = (struct iorec *) Iorec (MIDI);	/* pointer to buffer descriptor */

  oldbuf = m_buff->ibuf;
  oldbsz = m_buff->ibufsz;
  oldbhi = m_buff->ibufhi;
  oldblo = m_buff->ibuflo;

  if ((char *) NULL == (newbuf = (char *) malloc (size)))
    {

      printf ("ERROR -- unable to allocate MIDI buffer.\n");
      return (FAILURE);
    }

  /* clear out the buffer */

  m_buff->ibufhd = 0;		/* reset the head index */
  m_buff->ibuftl = 0;		/* reset the tail index */

  /* we do this twice because we aren't disabling interrupts ... */

  m_buff->ibufhd = 0;		/* reset the head index */
  m_buff->ibuftl = 0;		/* reset the tail index */

  m_buff->ibuf = newbuf;	/* change address of buffer */
  m_buff->ibufsz = size;	/* change size of buffer */

  index = 0;			/* reset the byte index */

  return (SUCCESS);
}