Example #1
0
ID3V2::ID3V2(FXuchar *b,FXint len) : buffer(b),size(len),p(0),padstart(0),padend(0),length(-1) {
  const FXchar & flags = buffer[5];

  version = buffer[3];
  GM_DEBUG_PRINT("[id3v2] version %d\n",version);

  buffer+=10;
  size-=10;

  /// we can skip the footer
  if (version>=4 && flags&HAS_FOOTER)
    size-=10;

  /// Apply unsync, according to spec 2.3, the extended header also needs unsyncing
  if (flags&HAS_UNSYNC) {
    unsync(buffer,size);
    }

  /// skip the extended header
  if (version>=3 && flags&HAS_EXTENDED_HEADER) {
    FXint header_size;
    if (version==3)
      header_size = ID3_INT32(buffer);
    else
      header_size = ID3_SYNCSAFE_INT32(buffer);
    buffer+=header_size;
    }

  /// Parse
  p=0;
  while(p<size)
    parse_frame();
  }
Example #2
0
/*
*       Locks or unlocks the current state of the window tree while an 
*       application is responding to a window update message in his message
*       pipe or is making some other direct screen update based on his current
*       rectangle list.
*/
void wm_update(WORD beg_update)
{

        if ( beg_update < 2)
        {
          if ( beg_update )
          {
            if ( !tak_flag(&wind_spb) )
                    ev_block(MU_MUTEX, (LONG)&wind_spb);

          }
          else
            unsync(&wind_spb);
        }
        else
        {
          beg_update -= 2;
          fm_own( beg_update );
        }
}
Example #3
0
void sh_ldapp()
{
        WORD    ret, badtry, retry;
        SHELL   *psh;


        psh = &sh[rlr->p_pid];
        strcpy(sh_apdir, D.s_cdir);             /* initialize sh_apdir  */
        badtry = 0;     

        /* Set default DESKTOP if there isn't any yet: */
        if(psh->sh_desk[0] == 0)
        {
          strcpy(&psh->sh_desk[0], DEF_DESKTOP);
          strcpy(&psh->sh_cdir[0], &D.s_cdir[0]);
        }

        do
        {
          sh_chdef(psh);
                                                /* set up so that we    */
                                                /*   will exec the      */
                                                /*   default next time  */
                                                /*   unless the         */
                                                /*   application does   */
                                                /*   a set command      */
          psh->sh_dodef = TRUE;
                                                /* init graph/char mode */
          sh_chgrf(psh);
          if (gl_shgem)
          {
            wm_start();
            ratinit();
          }
                                                /* fix up/parse cmd tail*/ 
          sh_fixtail(psh->sh_fullstep == 2);
          sh_draw(D.s_cmd, 0, 0);               /* redraw the desktop   */

                                                /* clear his desk field */
          desk_tree[rlr->p_pid] = 0x0L;
                                                /* exec it              */
                                                /* handle bad try msg   */
          if (badtry)
          {
            ret = fm_show(badtry, NULLPTR, 1);
            if (badtry == ALNOFIT)
              break;
            badtry = 0;
          }


          do
          {
            retry = FALSE;

            Dprintf(("sh_ldapp: Starting %s\n", D.s_cmd));
            if(psh->sh_isdef && strcmp(D.s_cmd, DEF_DESKTOP) == 0)
            {
              /* Start the ROM desktop: */
              sh_show(D.s_cmd);
              p_nameit(rlr, sh_name(&D.s_cmd[0]));
              p_setappdir(rlr, D.s_cmd);
              aes_run_rom_program(deskstart);
            }
#if WITH_CLI != 0
            else if(strcmp(D.s_cmd, "EMUCON") == 0)
            {
              /* start the EmuCON shell: */
              aes_run_rom_program(coma_start);
            }
#endif
            else if ( sh_find(D.s_cmd) )
            {
              /* Run a normal application: */
              sh_show(D.s_cmd);
              p_nameit(rlr, sh_name(&D.s_cmd[0]));
              p_setappdir(rlr, D.s_cmd);
              if (psh->sh_fullstep == 0)
              {
                dos_exec(0, D.s_cmd, ad_stail, ad_envrn);   /* Run the APP */

                /* If the user ran an alternative desktop and quitted it,
                   return now to the default desktop: (experimental) */
                if(psh->sh_isdef && psh->sh_dodef)
                {
                  Dprintf(("sh_ldapp: Returning to ROM desktop!\n"));
                  strcpy(&psh->sh_desk[0], DEF_DESKTOP);
                  strcpy(&psh->sh_cdir[0], &D.s_cdir[0]);
                }
              }
              else if (psh->sh_fullstep == 1)
              {
                dos_exec(0, D.s_cmd, ad_stail, ad_envrn);
                DOS_ERR = psh->sh_doexec = FALSE;
              }
              if (DOS_ERR)
                badtry = (psh->sh_isdef) ? ALNOFIT : AL08ERR;
/*  02/11/86 LKW begin  */
              if (wind_spb.sy_owner == rlr)     /* if he still owns screen*/
                  unsync(&wind_spb);            /*   then take him off. */
/*  02/11/86 LKW end    */
            }
            else
            {
              if ( (gl_shgem) &&
                   (psh->sh_isdef) )
              {
                ret = fm_show(ALOKDESK, NULLPTR, 1);
                if (ret == 1)
                  retry = TRUE;
                else
                  retry = psh->sh_doexec = FALSE;
              }
              else
                badtry = AL18ERR;
            }
          } while (retry && !badtry);

          desk_tree[rlr->p_pid] = 0x0L;         /* clear his desk field */

        } while(psh->sh_doexec && !gl_changerez);

}