@Override protected void addToList(final ProgramFieldType fieldType, String value, final String separator) { String currentValue = mProgram.getTextField(fieldType); if (currentValue != null && !currentValue.isEmpty()) { value = currentValue + separator + value; } mProgram.setTextField(fieldType, value); }
@Override protected void setInfoBit(final int bit) { int infoBits = mProgram.getIntField(ProgramFieldType.INFO_TYPE); if (infoBits == -1) { infoBits = 0; } infoBits |= bit; mProgram.setIntField(ProgramFieldType.INFO_TYPE, infoBits); }
@Override protected void addField(final ProgramFieldType fieldType, String value) { if (fieldType.equals(ProgramFieldType.DESCRIPTION_TYPE)) { if (((DataHydraChannelGroup) mChannel.getGroup()).isShowRegister() && mDataService.getShowRegisterText()) { value += "\n\n" + mLocalizer.msg("register", "Please Register at {0}", mChannel.getWebpage()); } } mProgram.setTextField(fieldType, value); if (fieldType.equals(ProgramFieldType.TITLE_TYPE)) { mProgram.setTitle(value); } }
@Override protected void addField(final ProgramFieldType fieldType, final int value) { if (fieldType.getFormat() == ProgramFieldType.TIME_FORMAT) { mProgram.setTimeField(fieldType, value); } else { mProgram.setIntField(fieldType, value); } if (fieldType.equals(ProgramFieldType.END_TIME_TYPE)) { int endTime = value; int startTime = mProgram.getTimeField(ProgramFieldType.START_TIME_TYPE); int progLength = endTime - startTime; // Assumption: If the program length is less than 0, the program spans // midnight if (progLength < 0) { progLength += 24 * 60; // adding 24 hours to the length } // Only allow program length for 12 hours.... This will take care of // possible DST problems if ((progLength > 0) && (progLength < 12 * 60)) { mProgram.setLength(progLength); } } }
@Override protected String getChannelCountry() { return mProgram.getChannel().getCountry(); }
@Override protected void endProgram() { // finish the program itself mProgram.setProgramLoadingIsComplete(); mMcdp.addProgram(mProgram); }
@Override protected void addField(final ProgramFieldType fieldType, final byte[] value) { mProgram.setBinaryField(fieldType, value); }