Package devplugin

Examples of devplugin.Channel


          Calendar.DAY_OF_WEEK));
    } else if (mMode == MODE_EDIT_EXCLUSION) {
      String title = mExclusion.getTitle();
      String topic = mExclusion.getTopic();
      ProgramFilter filter = mExclusion.getFilter();
      Channel channel = mExclusion.getChannel();
      int timeFrom = mExclusion.getTimeLowerBound();
      int timeTo = mExclusion.getTimeUpperBound();
      int dayOfWeek = mExclusion.getDayOfWeek();
      if (title != null) {
        mTitleCb.setSelected(true);
View Full Code Here


  public Object createDataObject(Object obj) {
    String title = null;
    String topic = null;
    String filterName = null;
    Channel channel = null;
    int timeFrom = -1;
    int timeTo = -1;
    int weekOfDay = Exclusion.DAYLIMIT_DAILY;

    if (mTitleCb.isSelected()) {
View Full Code Here

      }
    });
  }

  private void showChannel() {
    Channel selectedChannel = (Channel) mList.getSelectedValue();
    if (selectedChannel != null) {
      mParent.showChannel(selectedChannel);
    }
  }
View Full Code Here

   * @return The program or <code>null</code> if there is no such program.
   */
  public Program getProgram(Date date, String progID) {
    TvDataBase db = TvDataBase.getInstance();
   
    Channel ch = getChannelFromProgId(progID);
    if (ch != null && ChannelList.isSubscribedChannel(ch)) {
      int index = progID.lastIndexOf('_');
      String timeString = progID.substring(index + 1);
      int hourIndex = timeString.indexOf(':');
      int offsetIndex = timeString.lastIndexOf(':');

      if(hourIndex != offsetIndex) {
        int timeZoneOffset = Integer.parseInt(timeString.substring(offsetIndex + 1));
        int currentTimeZoneOffset = TimeZone.getDefault().getRawOffset()/60000;
       
        if(timeZoneOffset != currentTimeZoneOffset) {
          String[] hourMinute = timeString.split(":");
          int timeZoneDiff = currentTimeZoneOffset - timeZoneOffset;
         
          int hour = Integer.parseInt(hourMinute[0]) + (timeZoneDiff/60);
          int minute = Integer.parseInt(hourMinute[1]) + (timeZoneDiff%60);
         
          if(hour >= 24) {
            hour -= 24;
            date = date.addDays(1);
          }
          else if(hour < 0) {
            hour += 24;
            date = date.addDays(-1);
          }
         
          hourMinute[0] = String.valueOf(hour);
          hourMinute[1] = String.valueOf(minute);
          hourMinute[2] = String.valueOf(currentTimeZoneOffset);
         
          StringBuilder newId = new StringBuilder(progID.substring(0, index + 1));
          newId.append(hourMinute[0]).append(":").append(hourMinute[1]).append(":").append(hourMinute[2]);
         
          progID = newId.toString();
        }
      }
      else {
        String[] hourMinute = timeString.split(":");
        StringBuilder newId = new StringBuilder(progID.substring(0, index + 1));
        newId.append(hourMinute[0]).append(":").append(hourMinute[1]).append(":").append(TimeZone.getDefault().getRawOffset()/60000);
       
        progID = newId.toString();
      }
     
      if(ch.getTimeZone().getRawOffset() != TimeZone.getDefault().getRawOffset()) {
        String[] hourMinute = timeString.split(":");
        int milliSeconds = Integer.parseInt(hourMinute[0]) * 60 * 60 * 1000 + Integer.parseInt(hourMinute[1]) * 60 * 1000;

        int diff = Math.abs(ch.getTimeZone().getRawOffset() - TimeZone.getDefault().getRawOffset());
       
        if(ch.getTimeZone().getRawOffset() < TimeZone.getDefault().getRawOffset()) {
          if(milliSeconds < diff) {
            date = date.addDays(-1);
          }
        }
        else if(milliSeconds + diff >= 86400 * 1000) {
View Full Code Here

        count++;
        lastSeparator = i;
      }
    }
    if (count == 4) {
      Channel channel = ChannelList.getChannel(progId.substring(0, lastSeparator));
      if (channel != null) {
        return channel;
      }
    }
View Full Code Here

   */
  public Program getExampleProgram() {
    if (mExampleProgram == null) {
      // TODO: internationalize
     
      Channel exampleChannel = new Channel(null, "Channel 1",
          TimeZone.getDefault(), "de", "");

      MutableProgram prog = new MutableProgram(exampleChannel,
                                               Date.getCurrentDate(), 14, 45, true);
      prog.setTitle("Die Waltons");
View Full Code Here

        mSubscribedChannels);
    boolean missingIcon = false;

    for (Object object : objects) {
      if (object instanceof Channel) {
        Channel channel = (Channel) object;
        mChannelListModel.subscribeChannel(channel);
        if (channel.getIcon() == null) {
          missingIcon = true;
        }
      }
    }
View Full Code Here

       mChannelList.add(ch);
       fireTableDataChanged();
     }

     public Object getValueAt(int rowIndex, int columnIndex) {
       Channel ch = mChannelList.get(rowIndex);
       ChannelGroup group = ch.getGroup();
       switch (columnIndex) {
         case 0 : return ch;
         case 1 : if (group != null) {
                    try {
                      return group.getProviderName();
                    }catch(NoSuchMethodError e) {
                      return "-";
                    }
                  }
                  else {
                    return "-";
                  }



         case 2 : String country = ch.getCountry();
                  Locale locale = new Locale(Locale.getDefault().getLanguage(), country);
                  return locale.getDisplayCountry();
         case 3 : return ch.getTimeZone().getDisplayName();
         default: return ch;
       }
     }
View Full Code Here

   
    // Get item
    Object item = getModel().getElementAt(index);

    if (item instanceof Channel) {
      Channel channel = (Channel) item;

      StringBuilder buf = new StringBuilder();

      Locale loc = new Locale(Locale.getDefault().getLanguage(), channel.getCountry());
      buf.append("<html>");
      buf.append("<b>").append(Localizer.getLocalization(Localizer.I18N_CHANNEL)).append(" :</b> ").append(channel.getName()).append("<br>");
      if (!TVBrowser.isStable()) {
        buf.append("<b>ID (dev. only) :</b> ").append(channel.getUniqueId())
            .append("<br>");
      }
      buf.append("<b>").append(mLocalizer.msg("country", "Country")).append(" :</b> ").append(loc.getDisplayCountry()).append("<br>");
      buf.append("<b>").append(mLocalizer.msg("timezone", "Timezone")).append(" :</b> ").append(channel.getTimeZone().getDisplayName()).append("<br>");
      buf.append("<b>").append(mLocalizer.msg("category", "Category")).append(" :</b> ").append(ChannelUtil.getNameForCategories(channel.getCategories())).append("<br><br>");
      buf.append(mLocalizer.msg("provided", "provided by")).append("<br><center>").append(ChannelUtil.getProviderName(channel)).append("</center>");
      buf.append("</html>");
      return buf.toString();
    }
View Full Code Here

                  "ChannelId-" + i, ""), properties.getProperty("ChannelTitle-" + i,
                  ""), properties.getProperty("ChannelBaseUrl-" + i, ""), properties
                  .getProperty("ChannelIconUrl-" + i, ""), properties.getProperty(
                  "ChannelLastUpdate-" + i, ""));

          Channel ch = createTVBrowserChannel(dataHydraChannelGroup, container);
          mInternalChannels.put(ch, container);
          channels.add(ch);
        }
      }
      closeIconLoader(dataHydraChannelGroup);
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.