|
31 | 31 |
|
32 | 32 | import java.util.*; |
33 | 33 |
|
34 | | -import javax.swing.tree.DefaultMutableTreeNode; |
35 | | - |
36 | 34 | import nl.digitalekabeltelevisie.controller.*; |
37 | 35 | import nl.digitalekabeltelevisie.data.mpeg.psi.TableSection; |
38 | 36 | import nl.digitalekabeltelevisie.util.*; |
@@ -152,14 +150,14 @@ public KVP getJTreeNode(int modus) { |
152 | 150 | private int sub_segments_expected; |
153 | 151 |
|
154 | 152 |
|
155 | | - public SegmentationDescriptor(byte[] b, int offset, TableSection parent) { |
156 | | - super(b, offset, parent); |
157 | | - segmentation_event_id = getBytes(b,offset+6,4); |
158 | | - segmentation_event_cancel_indicator = getInt(b,offset+10,1,0b1000_0000)>>7; |
159 | | - reserved = getInt(b,offset+10,1,0b0111_1111); |
| 153 | + public SegmentationDescriptor(byte[] b, TableSection parent) { |
| 154 | + super(b, parent); |
| 155 | + segmentation_event_id = getBytes(b,6,4); |
| 156 | + segmentation_event_cancel_indicator = getInt(b,10,1,0b1000_0000)>>7; |
| 157 | + reserved = getInt(b,10,1,0b0111_1111); |
160 | 158 | if(segmentation_event_cancel_indicator == 0) { |
161 | 159 |
|
162 | | - int localOffset = offset+11; |
| 160 | + int localOffset = 11; |
163 | 161 | program_segmentation_flag = getInt(b,localOffset,1,0b1000_0000)>>7; |
164 | 162 | segmentation_duration_flag = getInt(b,localOffset,1,0b0100_0000)>>6; |
165 | 163 | delivery_not_restricted_flag = getInt(b,localOffset,1,0b0010_0000)>>5; |
@@ -218,51 +216,47 @@ public SegmentationDescriptor(byte[] b, int offset, TableSection parent) { |
218 | 216 |
|
219 | 217 |
|
220 | 218 | @Override |
221 | | - public DefaultMutableTreeNode getJTreeNode(final int modus) { |
222 | | - final DefaultMutableTreeNode t = super.getJTreeNode(modus); |
223 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_event_id", segmentation_event_id, null))); |
224 | | - t.add(new DefaultMutableTreeNode( |
225 | | - new KVP("segmentation_event_cancel_indicator", segmentation_event_cancel_indicator, |
226 | | - segmentation_event_cancel_indicator == 1 |
227 | | - ? "a previously sent segmentation event has been cancelled" |
228 | | - : "no previously sent segmentation event has been cancelled"))); |
229 | | - t.add(new DefaultMutableTreeNode(new KVP("reserved", reserved, null))); |
| 219 | + public KVP getJTreeNode(final int modus) { |
| 220 | + final KVP t = super.getJTreeNode(modus); |
| 221 | + t.add(new KVP("segmentation_event_id", segmentation_event_id)); |
| 222 | + t.add(new KVP("segmentation_event_cancel_indicator", segmentation_event_cancel_indicator, |
| 223 | + segmentation_event_cancel_indicator == 1 ? "a previously sent segmentation event has been cancelled" |
| 224 | + : "no previously sent segmentation event has been cancelled")); |
| 225 | + t.add(new KVP("reserved", reserved)); |
230 | 226 | if (segmentation_event_cancel_indicator == 0) { |
231 | | - t.add(new DefaultMutableTreeNode(new KVP("program_segmentation_flag", program_segmentation_flag, null))); |
232 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_duration_flag", segmentation_duration_flag, null))); |
233 | | - t.add(new DefaultMutableTreeNode(new KVP("delivery_not_restricted_flag", delivery_not_restricted_flag, null))); |
| 227 | + t.add(new KVP("program_segmentation_flag", program_segmentation_flag)); |
| 228 | + t.add(new KVP("segmentation_duration_flag", segmentation_duration_flag)); |
| 229 | + t.add(new KVP("delivery_not_restricted_flag", delivery_not_restricted_flag)); |
234 | 230 |
|
235 | 231 | if (delivery_not_restricted_flag == 0) { |
236 | | - t.add(new DefaultMutableTreeNode( |
237 | | - new KVP("web_delivery_allowed_flag", web_delivery_allowed_flag, null))); |
238 | | - t.add(new DefaultMutableTreeNode( |
239 | | - new KVP("no_regional_blackout_flag", no_regional_blackout_flag, null))); |
240 | | - t.add(new DefaultMutableTreeNode(new KVP("archive_allowed_flag", archive_allowed_flag, null))); |
241 | | - t.add(new DefaultMutableTreeNode(new KVP("device_restrictions", device_restrictions, null))); |
| 232 | + t.add(new KVP("web_delivery_allowed_flag", web_delivery_allowed_flag)); |
| 233 | + t.add(new KVP("no_regional_blackout_flag", no_regional_blackout_flag)); |
| 234 | + t.add(new KVP("archive_allowed_flag", archive_allowed_flag)); |
| 235 | + t.add(new KVP("device_restrictions", device_restrictions)); |
242 | 236 |
|
243 | 237 | } else { |
244 | | - t.add(new DefaultMutableTreeNode(new KVP("reserved", reserved2, null))); |
| 238 | + t.add(new KVP("reserved", reserved2)); |
245 | 239 |
|
246 | 240 | } |
247 | 241 | if (program_segmentation_flag == 0) { |
248 | | - t.add(new DefaultMutableTreeNode(new KVP("component_count", component_count, null))); |
249 | | - Utils.addListJTree(t, componentOffsetList, modus, "Component Offsets"); |
| 242 | + t.add(new KVP("component_count", component_count)); |
| 243 | + addListJTree(t, componentOffsetList, modus, "Component Offsets"); |
250 | 244 | } |
251 | 245 | if (segmentation_duration_flag == 1) { |
252 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_duration", segmentation_duration, Utils.printTimebase90kHz(segmentation_duration)))); |
| 246 | + t.add(new KVP("segmentation_duration", segmentation_duration, Utils.printTimebase90kHz(segmentation_duration))); |
253 | 247 | } |
254 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_upid_type", segmentation_upid_type, getSegmentationUpidTypeString(segmentation_upid_type)))); |
255 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_upid_length", segmentation_upid_length, null))); |
| 248 | + t.add(new KVP("segmentation_upid_type", segmentation_upid_type, getSegmentationUpidTypeString(segmentation_upid_type))); |
| 249 | + t.add(new KVP("segmentation_upid_length", segmentation_upid_length)); |
256 | 250 |
|
257 | 251 | if (segmentation_upid_length > 0) { |
258 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_upid", segmentation_upid, null))); |
| 252 | + t.add(new KVP("segmentation_upid", segmentation_upid)); |
259 | 253 | } |
260 | | - t.add(new DefaultMutableTreeNode(new KVP("segmentation_type_id", segmentation_type_id, getSegmentationTypeIdString(segmentation_type_id)))); |
261 | | - t.add(new DefaultMutableTreeNode(new KVP("segment_num", segment_num, null))); |
262 | | - t.add(new DefaultMutableTreeNode(new KVP("segments_expected", segments_expected, null))); |
| 254 | + t.add(new KVP("segmentation_type_id", segmentation_type_id, getSegmentationTypeIdString(segmentation_type_id))); |
| 255 | + t.add(new KVP("segment_num", segment_num)); |
| 256 | + t.add(new KVP("segments_expected", segments_expected)); |
263 | 257 | if (segmentation_type_id == 0x34 || segmentation_type_id == 0x36) { |
264 | | - t.add(new DefaultMutableTreeNode(new KVP("sub_segment_num", sub_segment_num, null))); |
265 | | - t.add(new DefaultMutableTreeNode(new KVP("sub_segments_expected", sub_segments_expected, null))); |
| 258 | + t.add(new KVP("sub_segment_num", sub_segment_num)); |
| 259 | + t.add(new KVP("sub_segments_expected", sub_segments_expected)); |
266 | 260 | } |
267 | 261 |
|
268 | 262 | } |
|
0 commit comments