Package devplugin

Examples of devplugin.Channel


            if (min >= 60) {
              hour = hour + min / 60;
              min = min - (60 * (min / 60));
            }

            Channel chan = conf.getChannelForExternalId(channel);

            if (chan != null) {
              for (Iterator<Program> it = CapturePlugin.getPluginManager().getChannelDayProgram(date, chan); it.hasNext();) {
                Program prog = it.next();

View Full Code Here


    private void writeChannelMappings(ObjectOutputStream stream) throws IOException {
      stream.writeInt(mChannels.keySet().size());
      Iterator<Channel> it = mChannels.keySet().iterator();

      while (it.hasNext()) {
        Channel channel = it.next();
        channel.writeData(stream);
        stream.writeObject(mChannels.get(channel));
      }
    }
View Full Code Here

            groupId = (String)stream.readObject();
          }

          String channelId = (String)stream.readObject();
          String value = (String)stream.readObject();
          Channel ch = Channel.getChannel(dataServiceClassName, groupId, null, channelId);

          if (ch!=null) {
            mChannels.put(ch, value);
          }
        }
        else {
          Channel ch = Channel.readData(stream, true);
          String value = (String)stream.readObject();

          if (ch!=null) {
            mChannels.put(ch, value);
          }
View Full Code Here

    progPn.add(removeBtn, BorderLayout.WEST);

    JPanel pn1 = new JPanel(new BorderLayout());
    progPn.add(pn1, BorderLayout.CENTER);
    Channel ch = program.getChannel();
    JLabel channelLb;
    channelLb = new JLabel(ch.getName()+": ");
    channelLb.setFont(new Font("Dialog", Font.BOLD, 12));
    channelLb.setHorizontalAlignment(SwingConstants.RIGHT);
    channelLb.setPreferredSize(new Dimension(60,10));
    pn1.add(channelLb, BorderLayout.WEST);
View Full Code Here

    for (int day = 0; day <= nrDays; day++) {
      for (int channelIdx = 0; channelIdx < channels.length; channelIdx++) {
        if (progress != null) {
          progress.setValue(day * channels.length + channelIdx);
        }
        Channel channel = channels[channelIdx];
        if (channel != null) {
            ChannelDayProgram dayProg = TvDataBase.getInstance().getDayProgram(startDate, channel);
            if (dayProg != null) {
              // This day has data -> remember it
              lastDayWithData = day;
View Full Code Here

      }

      mDayProgram.setLastProgramHadEndOnUpdate(dataFile.readBoolean());

      Date date = Date.readData(dataFile);
      Channel channel = Channel.readData(dataFile, false);

      boolean timeLimited = channel.isTimeLimited();
      int startTimeLimit = channel.getStartTimeLimit();
      int endTimeLimit = channel.getEndTimeLimit();

      int size = dataFile.readInt();
      mDayProgram.removeAllPrograms();
      for (int i = 0; i < size; i++) {
        Program prog = loadProgram(dataFile, date, channel);
View Full Code Here

      ObjectInputStream objIn = new ObjectInputStream(stream);

      objIn.readInt();

      Date date = Date.readData(objIn);
      Channel channel = Channel.readData(objIn, false);

      int size = objIn.readInt();
      mDayProgram.removeAllPrograms();
      for (int i = 0; i < size; i++) {
        Program prog = loadProgram(objIn, date, channel);
View Full Code Here

  private void saveDayProgram(final boolean update) throws IOException {
    checkValid();

    Date date = mDayProgram.getDate();
    Channel channel = mDayProgram.getChannel();

    RandomAccessFile dataFile = null;
    try {
      if (update)
      {
        dataFile = new RandomAccessFile(mFile + "_to_ver_2_update", "rw");
      }
      else
      {
        dataFile = new RandomAccessFile(mFile, "rw");
      }

      dataFile.writeInt(2); // version

      dataFile.writeBoolean(mDayProgram.getLastProgramHadEndOnUpdate());

      date.writeData(dataFile);
      channel.writeToDataFile(dataFile);

      int programCount = mDayProgram.getProgramCount();
      dataFile.writeInt(programCount);
      for (int i = 0; i < programCount; i++) {
        Program program = mDayProgram.getProgramAt(i);
View Full Code Here

        programs.add(mDayProgram.getProgramAt(i));
      }

      mDayProgram.removeAllPrograms();

      Channel channel = mDayProgram.getChannel();

      for(Program prog : programs) {
        int time = prog.getHours() * 60 + prog.getMinutes();

        int startTimeLimit = channel.getStartTimeLimit();
        int endTimeLimit = channel.getEndTimeLimit();

        if((startTimeLimit < endTimeLimit && time >= startTimeLimit && time < endTimeLimit) ||
            (endTimeLimit < startTimeLimit && (time < endTimeLimit || time >= startTimeLimit))) {
          mDayProgram.addProgram(prog);
        }
View Full Code Here

      if (!tvDataFiles.containsKey(key)
          || (date != null && date.compareTo(expireDate) < 0)) {
        // This day program was deleted -> Inform the listeners

        // Get the channel and date
        Channel channel = getChannelFromFileName(key, channelArr, channelIdArr);
        if ((channel != null) && (date != null)) {
          mLog.info("Day program was deleted by third party: " + date + " on "
              + channel.getName());
          ChannelDayProgram dummyProg = new MutableChannelDayProgram(date,
              channel);
          fireDayProgramTouched(dummyProg, null);
          fireDayProgramDeleted(dummyProg);

          mTvDataInventory.setUnknown(date, channel);
        }
        else {
          // we do not know the channel of this file -> remove from list of
          // remembered files
          mTvDataInventory.setUnknown(key);
        }
      }
    }

    // Check whether day programs were added or replaced
    for (File tvDataFile : tvDataArr) {
      String fileName = tvDataFile.getName();

      // Get the channel and date
      Channel channel = getChannelFromFileName(fileName, channelArr,
          channelIdArr);
      Date date = getDateFromFileName(fileName);
      if ((channel != null) && (date != null)) {
        // Get the version
        int version = (int) tvDataFile.length();

        // Check whether this day program is known
        int knownStatus = mTvDataInventory.getKnownStatus(date, channel,
            version);

        if ((knownStatus == TvDataInventory.UNKNOWN)
            || (knownStatus == TvDataInventory.OTHER_VERSION)) {
          // do not try to read very old unknown files
          if (isValidDate(date)) {
            if (!somethingChanged) {
              // This is the first changed day program -> fire update start
              TvDataUpdater.getInstance().fireTvDataUpdateStarted();
            }

            // Inform the listeners
            mLog.info("Day program was changed by third party: " + date + " on "
                + channel.getName());
            ChannelDayProgram newDayProg = getDayProgram(date, channel, false);
            if (newDayProg != null) {
              handleKnownStatus(knownStatus, newDayProg, version);
            }
View Full Code Here

TOP

Related Classes of devplugin.Channel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.