public int fetchHeaders(final Info info, final Comment comment, final int[] serialno, Page page) {
   if (page == null) {
     page = new Page();
     final int retValue = this.getNextPage(page, this.m_chunkSize);
     if (retValue == -128) {
       return -128;
     }
     if (retValue < 0) {
       return -130;
     }
   }
   if (serialno != null) {
     serialno[0] = page.serialno();
   }
   this.m_oggStreamState.init(page.serialno());
   info.init();
   comment.init();
   final Packet packet = new Packet();
   int i = 0;
   while (i < 3) {
     this.m_oggStreamState.pagein(page);
     while (i < 3) {
       final int result = this.m_oggStreamState.packetout(packet);
       if (result == 0) {
         break;
       }
       if (result == -1) {
         info.clear();
         this.m_oggStreamState.clear();
         return -1;
       }
       if (info.synthesis_headerin(comment, packet) != 0) {
         info.clear();
         this.m_oggStreamState.clear();
         return -1;
       }
       ++i;
     }
     if (i < 3 && this.getNextPage(page, 1L) < 0) {
       info.clear();
       this.m_oggStreamState.clear();
       return -1;
     }
   }
   return 0;
 }
  protected void init(
      final boolean modal,
      final int WindowNo,
      final I_AD_InfoWindow infoWindow,
      final String keyColumn,
      final String value,
      final boolean multiSelection,
      final String whereClause) {
    setCtxAttribute(ATTR_SearchText, value);

    super.init(
        modal,
        WindowNo,
        adInfoWindowBL.getTableName(infoWindow),
        keyColumn,
        multiSelection,
        whereClause);

    this.infoWindow = infoWindow;
    searchText = value;

    final I_AD_InfoWindow infoWindowTrl =
        InterfaceWrapperHelper.translate(infoWindow, I_AD_InfoWindow.class);
    setTitle(infoWindowTrl.getName());
    initAttributes();
    initParametersUI();
    initParameters();
    initInfo();
    initTree();
    initTreeUI();
    // metas begin
    // loaded OK
    p_loadedOK = true;
    // window sized to fit the preferred size and layouts of its subcomponents
    getWindow().pack();
    // metas end
  }
Example #3
0
  /**
   * Uses the local ogg_stream storage in vf; this is important for non-streaming input sources.
   *
   * @param vi the info block
   * @param vc comment block
   * @param serialno serial numbers
   * @param ogPtr ogg pointer page
   * @return success codes OV_*
   */
  int fetchHeaders(Info vi, Comment vc, int[] serialno, Page ogPtr) {
    Page og = new Page();
    Packet op = new Packet();
    int ret;

    if (ogPtr == null) {
      ret = getNextPage(og, CHUNKSIZE);
      if (ret == OV_EREAD) {
        return OV_EREAD;
      }
      if (ret < 0) {
        return OV_ENOTVORBIS;
      }
      ogPtr = og;
    }

    if (serialno != null) {
      serialno[0] = ogPtr.serialno();
    }

    os.init(ogPtr.serialno());

    // extract the initial header from the first page and verify that the
    // Ogg bitstream is in fact Vorbis data

    vi.init();
    vc.init();

    int i = 0;
    while (i < 3) {
      os.pagein(ogPtr);
      while (i < 3) {
        int result = os.packetout(op);
        if (result == 0) {
          break;
        }
        if (result == -1) {
          vi.clear();
          vc.clear();
          os.clear();
          return -1;
        }
        if (vi.synthesisHeaderin(vc, op) != 0) {
          vi.clear();
          vc.clear();
          os.clear();
          return -1;
        }
        i++;
      }
      if (i < 3) {
        if (getNextPage(ogPtr, 1) < 0) {
          vi.clear();
          vc.clear();
          os.clear();
          return -1;
        }
      }
    }
    return 0;
  }