タイニー番組ナビゲータ本体
Révision | 533fc32f972cfc7fcfcc916be62e0e029a32902f (tree) |
---|---|
l'heure | 2019-06-30 22:23:46 |
Auteur | Masahiko Kimura <mkimura@u01....> |
Commiter | Masahiko Kimura |
Ver.1.12.1 (2019/06/30):
@@ -391,7 +391,7 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
391 | 391 | private JTree jTree_tree = null; |
392 | 392 | private JScrollPane jScrollPane_listed = null; |
393 | 393 | private JTableRowHeader jTable_rowheader = null; |
394 | - private ListedTable jTable_listed = null; | |
394 | + protected ListedTable jTable_listed = null; | |
395 | 395 | private VWColorCharCellRenderer2 titleCellRenderer = null; |
396 | 396 | |
397 | 397 | private VWListedTreeNode listRootNode = null; // リスト形式のツリー |
@@ -1204,6 +1204,58 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
1204 | 1204 | } |
1205 | 1205 | } |
1206 | 1206 | |
1207 | + /** | |
1208 | + * 通知すべきピックアップ情報を取得する | |
1209 | + */ | |
1210 | + public boolean getPickupsToNotify(ArrayList<String>list) { | |
1211 | + list.clear(); | |
1212 | + | |
1213 | + TVProgram tvp = tvprograms.getPickup(); | |
1214 | + if ( tvp == null ) | |
1215 | + return false; | |
1216 | + | |
1217 | + String os = System.getProperty("os.name"); | |
1218 | + boolean isWin10 = os != null && os.contains("Windows 10"); | |
1219 | + | |
1220 | + // 現在日時 | |
1221 | + int min = env.getMinsBeforeProgStart(); | |
1222 | + String dtmin = CommonUtils.getDateTime(min*60); | |
1223 | + String dtmax = CommonUtils.getDateTime((min+1)*60); | |
1224 | + | |
1225 | + String bodyAll = ""; | |
1226 | + String head = "" + min + "分後にピックアップの番組が始まります\n"; | |
1227 | + | |
1228 | + for ( ProgList tPl : tvp.getCenters() ) { | |
1229 | + for ( ProgDateList tPcl : tPl.pdate ) { | |
1230 | + for ( ProgDetailList tvd : tPcl.pdetail ) { | |
1231 | + // 予約開始まで規定時間以内の場合 | |
1232 | + String nextstart = tvd.startDateTime; | |
1233 | + | |
1234 | + if ( nextstart.compareTo(dtmin) >= 0 && nextstart.compareTo(dtmax) < 0 ) { | |
1235 | + String title = tvd.title; | |
1236 | + String stime = tvd.start; | |
1237 | + String etime = tvd.end; | |
1238 | + String body = | |
1239 | + "「" + title + "」\n" + | |
1240 | + "(" + stime + "~" + etime + ")\n"; | |
1241 | + | |
1242 | + if (isWin10){ | |
1243 | + list.add(head + body); | |
1244 | + } | |
1245 | + else{ | |
1246 | + bodyAll += body; | |
1247 | + } | |
1248 | + } | |
1249 | + } | |
1250 | + } | |
1251 | + } | |
1252 | + | |
1253 | + if (!isWin10 && !bodyAll.isEmpty()) | |
1254 | + list.add(head + bodyAll); | |
1255 | + | |
1256 | + return list.size() > 0; | |
1257 | + } | |
1258 | + | |
1207 | 1259 | /* |
1208 | 1260 | * 絞り込み検索 |
1209 | 1261 | */ |
@@ -1867,7 +1919,7 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
1867 | 1919 | showPopupForSortSearchKey(e.getX(), e.getY()); |
1868 | 1920 | break; |
1869 | 1921 | case KEYWORDGROUP: |
1870 | - showPopupForRemoveKeywordGrp(e.getX(), e.getY()); | |
1922 | + showPopupForKeywordGroup(e.getX(), e.getY()); | |
1871 | 1923 | break; |
1872 | 1924 | case EXTENTION: |
1873 | 1925 | showPopupForSortExtension(e.getX(), e.getY()); |
@@ -3207,6 +3259,44 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
3207 | 3259 | } |
3208 | 3260 | |
3209 | 3261 | /** |
3262 | + * キーワードグループを並べ替える | |
3263 | + */ | |
3264 | + private void sortSearchKeyGroup() { | |
3265 | + // | |
3266 | + ArrayList<String> oList = new ArrayList<String>(); | |
3267 | + for ( SearchGroup gr : srGrps ) { | |
3268 | + final String name = gr.getName(); | |
3269 | + oList.add(name); | |
3270 | + } | |
3271 | + // | |
3272 | + JListSortDialog lsD = new JListSortDialog("キーワードグループの並べ替え", oList); | |
3273 | + CommonSwingUtils.setLocationCenter(parent,lsD); | |
3274 | + | |
3275 | + lsD.setVisible(true); | |
3276 | + | |
3277 | + if (lsD.isRegistered()) { | |
3278 | + SearchGroupList newSrGrps = new SearchGroupList(); | |
3279 | + for ( String label : oList ) { | |
3280 | + for ( SearchGroup gr : srGrps ) { | |
3281 | + if ( gr.getName().equals(label) ) { | |
3282 | + newSrGrps.add(gr); | |
3283 | + break; | |
3284 | + } | |
3285 | + } | |
3286 | + } | |
3287 | + | |
3288 | + srGrps.clear(); | |
3289 | + for (SearchGroup gr : newSrGrps){ | |
3290 | + srGrps.add(gr); | |
3291 | + } | |
3292 | + srGrps.save(); | |
3293 | + | |
3294 | + // ツリーを更新 | |
3295 | + redrawTreeByKeywordGroup(); | |
3296 | + } | |
3297 | + } | |
3298 | + | |
3299 | + /** | |
3210 | 3300 | * キーワードグループを編集したい |
3211 | 3301 | */ |
3212 | 3302 | private void editSeachkeyGroup(String name) { |
@@ -3613,7 +3703,7 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
3613 | 3703 | } |
3614 | 3704 | |
3615 | 3705 | // キーワードグループの処理 |
3616 | - private void showPopupForRemoveKeywordGrp(int x, int y) | |
3706 | + private void showPopupForKeywordGroup(int x, int y) | |
3617 | 3707 | { |
3618 | 3708 | JPopupMenu pop = new JPopupMenu(); |
3619 | 3709 |
@@ -3626,6 +3716,15 @@ public abstract class AbsListedView extends JPanel implements TickTimerListener | ||
3626 | 3716 | } |
3627 | 3717 | }); |
3628 | 3718 | pop.add(menuItem); |
3719 | + | |
3720 | + menuItem = new JMenuItemWithShortcut("キーワードグループの並べ替え"); | |
3721 | + menuItem.setMnemonic(KeyEvent.VK_S); | |
3722 | + menuItem.addActionListener(new ActionListener() { | |
3723 | + public void actionPerformed(ActionEvent e) { | |
3724 | + sortSearchKeyGroup(); | |
3725 | + } | |
3726 | + }); | |
3727 | + pop.add(menuItem); | |
3629 | 3728 | } |
3630 | 3729 | pop.show(jTree_tree, x, y); |
3631 | 3730 | } |
@@ -444,8 +444,8 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
444 | 444 | public void jumpToNow() { |
445 | 445 | if ( nowNode != null ) { |
446 | 446 | TreePath tp = new TreePath(nowNode.getPath()); |
447 | - jTree_tree.setSelectionPath(null); | |
448 | - jTree_tree.setSelectionPath(tp); | |
447 | + setSelectionPath(null); | |
448 | + setSelectionPath(tp); | |
449 | 449 | } |
450 | 450 | } |
451 | 451 |
@@ -871,7 +871,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
871 | 871 | return; |
872 | 872 | |
873 | 873 | // 前後のノードに移動する |
874 | - jTree_tree.setSelectionPath(path); | |
874 | + setSelectionPath(path); | |
875 | 875 | jLayeredPane_space_main_view.scrollRectToVisible(new Rectangle(vp, vs)); |
876 | 876 | } |
877 | 877 | /* |
@@ -893,7 +893,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
893 | 893 | return; |
894 | 894 | |
895 | 895 | // 前日のノードに移動して一番下にスクロールする |
896 | - jTree_tree.setSelectionPath(path); | |
896 | + setSelectionPath(path); | |
897 | 897 | vp.y = ps.height - vs.height; |
898 | 898 | } |
899 | 899 | // 一番下でかつプラス方向にスクロールしたら |
@@ -907,7 +907,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
907 | 907 | return; |
908 | 908 | |
909 | 909 | // 翌日のノードに移動して一番上にスクロールする |
910 | - jTree_tree.setSelectionPath(path); | |
910 | + setSelectionPath(path); | |
911 | 911 | vp.y = 0; |
912 | 912 | } |
913 | 913 | // それ以外の場合はホイール量に応じてスクロールする |
@@ -1014,7 +1014,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1014 | 1014 | * サイドツリーの「現在日時」を選択する |
1015 | 1015 | */ |
1016 | 1016 | public void selectTreeDefault() { |
1017 | - if ( defaultNode != null ) jTree_tree.setSelectionPath(new TreePath(defaultNode.getPath())); | |
1017 | + if ( defaultNode != null ) setSelectionPath(new TreePath(defaultNode.getPath())); | |
1018 | 1018 | } |
1019 | 1019 | |
1020 | 1020 | /** |
@@ -1029,8 +1029,8 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1029 | 1029 | // 表示位置を記憶 |
1030 | 1030 | Point vp = vport.getViewPosition(); //= SwingUtilities.convertPoint(vport,0,0,label); |
1031 | 1031 | // ツリー再選択 |
1032 | - jTree_tree.setSelectionPath(null); | |
1033 | - jTree_tree.setSelectionPath(tp); | |
1032 | + setSelectionPath(null); | |
1033 | + setSelectionPath(tp); | |
1034 | 1034 | // 表示位置を復帰 |
1035 | 1035 | if (vp.x != 0 && vp.y != 0) { |
1036 | 1036 | jLayeredPane_space_main_view.scrollRectToVisible(new Rectangle(vp, vport.getSize())); |
@@ -1184,7 +1184,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1184 | 1184 | _redrawTreeByDate(bsNode); |
1185 | 1185 | _redrawTreeByDate(csNode); |
1186 | 1186 | |
1187 | - jTree_tree.setSelectionPath(tp); | |
1187 | + setSelectionPath(tp); | |
1188 | 1188 | jTree_tree.updateUI(); |
1189 | 1189 | startTreeListener(); |
1190 | 1190 | } |
@@ -1221,7 +1221,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1221 | 1221 | centerNode.add(new DefaultMutableTreeNode(pl.Center)); |
1222 | 1222 | } |
1223 | 1223 | |
1224 | - jTree_tree.setSelectionPath(tp); | |
1224 | + setSelectionPath(tp); | |
1225 | 1225 | jTree_tree.updateUI(); |
1226 | 1226 | startTreeListener(); |
1227 | 1227 | } |
@@ -1242,7 +1242,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1242 | 1242 | } |
1243 | 1243 | } |
1244 | 1244 | |
1245 | - jTree_tree.setSelectionPath(tp); | |
1245 | + setSelectionPath(tp); | |
1246 | 1246 | jTree_tree.updateUI(); |
1247 | 1247 | startTreeListener(); |
1248 | 1248 | } |
@@ -1484,6 +1484,9 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1484 | 1484 | System.err.println(ERRID+"過去ログの取得に失敗しました: "+date); |
1485 | 1485 | return null; |
1486 | 1486 | } |
1487 | + | |
1488 | + // 指定した日付のノードがツリーになければ作成する | |
1489 | + addPassedNodeIfNotExist(date); | |
1487 | 1490 | } |
1488 | 1491 | |
1489 | 1492 | // 番組枠描画 |
@@ -1495,6 +1498,35 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
1495 | 1498 | return pli; |
1496 | 1499 | } |
1497 | 1500 | |
1501 | + /* | |
1502 | + * 表示対象の過去日のノードがなければ追加する | |
1503 | + */ | |
1504 | + private boolean addPassedNodeIfNotExist(String date){ | |
1505 | + if (date == null) | |
1506 | + return false; | |
1507 | + | |
1508 | + // 過去日ノードを順にチェックする | |
1509 | + int num = passedNode.getChildCount(); | |
1510 | + for (int n=0; n<num; n++){ | |
1511 | + DefaultMutableTreeNode cnode = (DefaultMutableTreeNode) passedNode.getChildAt(n); | |
1512 | + | |
1513 | + // ラベルが一致したら | |
1514 | + if (cnode.toString().equals(date)) | |
1515 | + return true; | |
1516 | + // 追加する日より過去の日付だったらその前にインサートする | |
1517 | + else if (cnode.toString().compareTo(date) < 0){ | |
1518 | + passedNode.insert(new DefaultMutableTreeNode(date), n); | |
1519 | + jTree_tree.updateUI(); | |
1520 | + return true; | |
1521 | + } | |
1522 | + } | |
1523 | + | |
1524 | + // 過去日ノードになかったら追加する | |
1525 | + passedNode.add(new DefaultMutableTreeNode(date)); | |
1526 | + jTree_tree.updateUI(); | |
1527 | + return true; | |
1528 | + } | |
1529 | + | |
1498 | 1530 | /** |
1499 | 1531 | * 日付別に表を作成する、の本体 |
1500 | 1532 | * @see #redrawByDate(String, IterationType) |
@@ -2563,6 +2595,16 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2563 | 2595 | }; |
2564 | 2596 | |
2565 | 2597 | /* |
2598 | + * ツリービューでパスを選択する | |
2599 | + */ | |
2600 | + private void setSelectionPath(TreePath path){ | |
2601 | + if (jTree_tree != null){ | |
2602 | + jTree_tree.setSelectionPath(path); | |
2603 | + if (path != null) | |
2604 | + jTree_tree.scrollPathToVisible(path); | |
2605 | + } | |
2606 | + } | |
2607 | + /* | |
2566 | 2608 | * 表示中の日付の前後の日付のパスを取得する |
2567 | 2609 | */ |
2568 | 2610 | private final TreePath getNextDatePath(boolean next){ |
@@ -2599,6 +2641,9 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2599 | 2641 | return null; |
2600 | 2642 | } |
2601 | 2643 | |
2644 | + if (path.getPathCount() < 3) | |
2645 | + return null; | |
2646 | + | |
2602 | 2647 | String date = path.getPathComponent(2).toString(); |
2603 | 2648 | String today = JTreeLabel.Nodes.NOW.getLabel(); |
2604 | 2649 |
@@ -2672,7 +2717,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2672 | 2717 | return; |
2673 | 2718 | |
2674 | 2719 | // 前後のノードに移動する |
2675 | - jTree_tree.setSelectionPath(path); | |
2720 | + setSelectionPath(path); | |
2676 | 2721 | } |
2677 | 2722 | // データの高さがビューポートより小さい場合は何もしない |
2678 | 2723 | else if (ps.height <= vs.height) |
@@ -2685,7 +2730,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2685 | 2730 | return; |
2686 | 2731 | |
2687 | 2732 | // 前日のノードに移動して一番下にスクロールする |
2688 | - jTree_tree.setSelectionPath(path); | |
2733 | + setSelectionPath(path); | |
2689 | 2734 | vp.y = ps.height - vs.height; |
2690 | 2735 | } |
2691 | 2736 | // 一番下でかつプラス方向にホイールを回したら |
@@ -2696,7 +2741,7 @@ public abstract class AbsPaperView extends JPanel implements TickTimerListener,H | ||
2696 | 2741 | return; |
2697 | 2742 | |
2698 | 2743 | // 翌日のノードに移動して一番上にスクロールする |
2699 | - jTree_tree.setSelectionPath(path); | |
2744 | + setSelectionPath(path); | |
2700 | 2745 | vp.y = 0; |
2701 | 2746 | } |
2702 | 2747 | // それ以外の場合はホイール量に応じてスクロールする |
@@ -769,7 +769,7 @@ public abstract class AbsReserveListView extends JScrollPane implements TickTime | ||
769 | 769 | HDDRecorderList recs = recorders.findInstance(getSelectedRecorderOnToolbar()); |
770 | 770 | |
771 | 771 | String bodyAll = ""; |
772 | - String head = "予約済の番組が" + min + "分後に始まります\n"; | |
772 | + String head = "" + min + "分後に予約した番組が始まります\n"; | |
773 | 773 | |
774 | 774 | for ( HDDRecorder recorder : recs ) { |
775 | 775 | if ( recorder.isBackgroundOnly() ) { |
@@ -308,6 +308,7 @@ public abstract class AbsSettingView extends JScrollPane { | ||
308 | 308 | private JCCLabel jCCL_rsv_recedcolor = null; |
309 | 309 | private JCheckBoxPanel jCBP_useAutocomplete = null; |
310 | 310 | private JCheckBoxPanel jCBP_notifyBeforeProgStart = null; |
311 | + private JCheckBoxPanel jCBP_notifyBeforePickProgStart = null; | |
311 | 312 | private JSliderPanel jSP_minsBeforeProgStart = null; |
312 | 313 | |
313 | 314 | // タイトル一覧 |
@@ -1076,15 +1077,21 @@ public abstract class AbsSettingView extends JScrollPane { | ||
1076 | 1077 | // RELOADリスナー不要 |
1077 | 1078 | y+=(PARTS_HEIGHT+SEP_HEIGHT); |
1078 | 1079 | |
1079 | - CommonSwingUtils.putComponentOn(jPanel_setting, jCBP_notifyBeforeProgStart = new JCheckBoxPanel("予約番組が開始する前に通知する(Windows 10のみ)",LABEL_WIDTH), PARTS_WIDTH, PARTS_HEIGHT, SEP_WIDTH, y); | |
1080 | + CommonSwingUtils.putComponentOn(jPanel_setting, jCBP_notifyBeforeProgStart = new JCheckBoxPanel("予約した番組が開始する前に通知する",LABEL_WIDTH), PARTS_WIDTH, PARTS_HEIGHT, SEP_WIDTH, y); | |
1080 | 1081 | jCBP_notifyBeforeProgStart.setSelected(env.getNotifyBeforeProgStart()); |
1081 | 1082 | jCBP_notifyBeforeProgStart.addItemListener(il_notifyBeforeProgStart); |
1082 | 1083 | // RELOADリスナー不要 |
1083 | 1084 | y+=(PARTS_HEIGHT+SEP_HEIGHT); |
1084 | 1085 | |
1085 | - CommonSwingUtils.putComponentOn(jPanel_setting, jSP_minsBeforeProgStart = new JSliderPanel("┗ 開始何分前に通知するか",LABEL_WIDTH,0,72,200), PARTS_WIDTH, PARTS_HEIGHT, SEP_WIDTH, y); | |
1086 | + CommonSwingUtils.putComponentOn(jPanel_setting, jCBP_notifyBeforePickProgStart = new JCheckBoxPanel("ピックアップした番組が開始する前に通知する",LABEL_WIDTH), PARTS_WIDTH, PARTS_HEIGHT, SEP_WIDTH, y); | |
1087 | + jCBP_notifyBeforePickProgStart.setSelected(env.getNotifyBeforePickProgStart()); | |
1088 | + jCBP_notifyBeforePickProgStart.addItemListener(il_notifyBeforeProgStart); | |
1089 | + // RELOADリスナー不要 | |
1090 | + y+=(PARTS_HEIGHT+SEP_HEIGHT); | |
1091 | + | |
1092 | + CommonSwingUtils.putComponentOn(jPanel_setting, jSP_minsBeforeProgStart = new JSliderPanel("┗ 番組開始の何分前に通知するか",LABEL_WIDTH,0,60,200), PARTS_WIDTH, PARTS_HEIGHT, SEP_WIDTH, y); | |
1086 | 1093 | jSP_minsBeforeProgStart.setValue(env.getMinsBeforeProgStart()); |
1087 | - jSP_minsBeforeProgStart.setEnabled(jCBP_notifyBeforeProgStart.isSelected()); | |
1094 | + jSP_minsBeforeProgStart.setEnabled(jCBP_notifyBeforeProgStart.isSelected() || jCBP_notifyBeforePickProgStart.isSelected()); | |
1088 | 1095 | // RELOADリスナー不要 |
1089 | 1096 | y+=(PARTS_HEIGHT+SEP_HEIGHT); |
1090 | 1097 |
@@ -1436,6 +1443,7 @@ public abstract class AbsSettingView extends JScrollPane { | ||
1436 | 1443 | env.setRecordedColor(jCCL_rsv_recedcolor.getChoosed()); |
1437 | 1444 | env.setUseAutocomplete(jCBP_useAutocomplete.isSelected()); |
1438 | 1445 | env.setNotifyBeforeProgStart(jCBP_notifyBeforeProgStart.isSelected()); |
1446 | + env.setNotifyBeforePickProgStart(jCBP_notifyBeforePickProgStart.isSelected()); | |
1439 | 1447 | env.setMinsBeforeProgStart(jSP_minsBeforeProgStart.getValue()); |
1440 | 1448 | |
1441 | 1449 | // タイトル一覧関係 |
@@ -1817,7 +1825,7 @@ public abstract class AbsSettingView extends JScrollPane { | ||
1817 | 1825 | private final ItemListener il_notifyBeforeProgStart = new ItemListener() { |
1818 | 1826 | @Override |
1819 | 1827 | public void itemStateChanged(ItemEvent e) { |
1820 | - jSP_minsBeforeProgStart.setEnabled(jCBP_notifyBeforeProgStart.isSelected()); | |
1828 | + jSP_minsBeforeProgStart.setEnabled(jCBP_notifyBeforeProgStart.isSelected() || jCBP_notifyBeforePickProgStart.isSelected()); | |
1821 | 1829 | } |
1822 | 1830 | }; |
1823 | 1831 |
@@ -163,8 +163,6 @@ public abstract class AbsTitleListView extends JPanel { | ||
163 | 163 | |
164 | 164 | private static final String ICONFILE_PULLDOWNMENU = "icon/down-arrow.png"; |
165 | 165 | |
166 | - public static final String MOVEONLY = "移動のみ"; | |
167 | - | |
168 | 166 | /******************************************************************************* |
169 | 167 | * 部品 |
170 | 168 | ******************************************************************************/ |
@@ -269,7 +267,7 @@ public abstract class AbsTitleListView extends JPanel { | ||
269 | 267 | c.addData(folder); |
270 | 268 | c.addData(genre); |
271 | 269 | c.addData(recname); |
272 | - c.addData(copycount.equals("1") ? MOVEONLY : copycount + "回"); | |
270 | + c.addData(copycount); | |
273 | 271 | c.addData(dlna_oid); |
274 | 272 | c.addData(recorder); |
275 | 273 |
@@ -506,11 +504,15 @@ public abstract class AbsTitleListView extends JPanel { | ||
506 | 504 | String devId = getSelectedDeviceId(); |
507 | 505 | if (titles && devId != null){ |
508 | 506 | StWin.appendMessage(MSGID+"レコーダからタイトル一覧を取得します(force=" + String.valueOf(force) + ",details=" + String.valueOf(details) + "):"+devId); |
507 | + TatCount tc = new TatCount(); | |
509 | 508 | if (rec.GetRdTitles(devId, force, details, devId.equals(HDDRecorder.DEVICE_ALL))){ |
510 | - MWin.appendMessage(MSGID+"レコーダからタイトル一覧が正常に取得できました:"+devId); | |
509 | + String time = String.format(" [%.2f秒]", tc.end()); | |
510 | + MWin.appendMessage(MSGID+"レコーダからタイトル一覧が正常に取得できました:"+devId + time); | |
511 | + } | |
512 | + else{ | |
513 | + String time = String.format("[%.2f秒]", tc.end()); | |
514 | + MWin.appendError(ERRID+"レコーダからのタイトル一覧の取得に失敗しました:"+devId + time); | |
511 | 515 | } |
512 | - else | |
513 | - MWin.appendError(ERRID+"レコーダからのタイトル一覧の取得に失敗しました:"+devId); | |
514 | 516 | |
515 | 517 | if ( ! rec.getErrmsg().equals("")) { |
516 | 518 | MWin.appendMessage(MSGID+"[追加情報] "+rec.getErrmsg()); |
@@ -890,11 +892,11 @@ public abstract class AbsTitleListView extends JPanel { | ||
890 | 892 | sa.genre = ro.getGenreNameList(); |
891 | 893 | sa.recname = rec.getDispName(); |
892 | 894 | sa.recorder = rec.Myself(); |
893 | - sa.copycount = ro.getHidden_params().get("copycount"); | |
895 | + sa.copycount = ro.formatCopyCount(); | |
894 | 896 | sa.dlna_oid = ro.getHidden_params().get("dlnaObjectID"); |
895 | 897 | |
896 | 898 | sa.hide_ttlid = ro.getId(); |
897 | - sa.hide_detail = ro.getDetail(); | |
899 | + sa.hide_detail = ro.formatDetail(); | |
898 | 900 | sa.hide_recording = ro.getRecording(); |
899 | 901 | |
900 | 902 | sa.fireChanged(); |
@@ -1696,10 +1698,28 @@ public abstract class AbsTitleListView extends JPanel { | ||
1696 | 1698 | |
1697 | 1699 | @Override |
1698 | 1700 | public int compare(String str1, String str2) { |
1699 | - int num1 = str1.equals(MOVEONLY) ? 1 : Integer.parseInt(str1.substring(0, str1.length()-1)); | |
1700 | - int num2 = str2.equals(MOVEONLY) ? 1 : Integer.parseInt(str2.substring(0, str2.length()-1)); | |
1701 | + int num1 = parseCopyCount(str1); | |
1702 | + int num2 = parseCopyCount(str2); | |
1701 | 1703 | return num1 - num2; |
1702 | 1704 | } |
1705 | + | |
1706 | + // 整形されたコピー回数から回数を取得する | |
1707 | + int parseCopyCount(String str){ | |
1708 | + try{ | |
1709 | + // 「移動のみ」の場合 | |
1710 | + if (str.equals(TitleInfo.MOVEONLY)) | |
1711 | + return 0; | |
1712 | + // 「録画中」の場合 | |
1713 | + else if (str.equals(TitleInfo.RECORDING)) | |
1714 | + return -1; | |
1715 | + // 「n回」の場合 | |
1716 | + else | |
1717 | + return Integer.parseInt(str.substring(0, str.length()-1)); | |
1718 | + } | |
1719 | + catch(NumberFormatException e){ | |
1720 | + return -2; | |
1721 | + } | |
1722 | + } | |
1703 | 1723 | }; |
1704 | 1724 | |
1705 | 1725 | col = getColumn(TitleColumn.COPYCOUNT); |
@@ -887,11 +887,16 @@ public class Env { | ||
887 | 887 | public void setUseAutocomplete(boolean b) { useAutocomplete = b; } |
888 | 888 | private boolean useAutocomplete = false; |
889 | 889 | |
890 | - // 予約番組の開始を通知するか(Windows10のみ) | |
890 | + // 予約番組の開始を通知するか | |
891 | 891 | public boolean getNotifyBeforeProgStart(){ return notifyBeforeProgStart; } |
892 | 892 | public void setNotifyBeforeProgStart(boolean b){ notifyBeforeProgStart = b; } |
893 | 893 | private boolean notifyBeforeProgStart = false; |
894 | 894 | |
895 | + // ピックアップ番組の開始を通知するか | |
896 | + public boolean getNotifyBeforePickProgStart(){ return notifyBeforePickProgStart; } | |
897 | + public void setNotifyBeforePickProgStart(boolean b){ notifyBeforePickProgStart = b; } | |
898 | + private boolean notifyBeforePickProgStart = false; | |
899 | + | |
895 | 900 | // 開始何分前に通知するか |
896 | 901 | public int getMinsBeforeProgStart(){ return minsBeforeProgStart; } |
897 | 902 | public void setMinsBeforeProgStart(int n){ minsBeforeProgStart = n; } |
@@ -5,20 +5,20 @@ import java.util.ArrayList; | ||
5 | 5 | import java.util.Iterator; |
6 | 6 | |
7 | 7 | public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGroup>{ |
8 | - | |
8 | + | |
9 | 9 | private final ArrayList<SearchGroup> gList = new ArrayList<SearchGroup>(); |
10 | - | |
10 | + | |
11 | 11 | private int idx; |
12 | - | |
12 | + | |
13 | 13 | private String gFile = "env"+File.separator+"keywordgroup.xml"; |
14 | - | |
15 | - | |
14 | + | |
15 | + | |
16 | 16 | // コンストラクタ |
17 | 17 | public SearchGroupList() { |
18 | 18 | // |
19 | 19 | } |
20 | - | |
21 | - | |
20 | + | |
21 | + | |
22 | 22 | // 検索系 |
23 | 23 | @Override |
24 | 24 | public Iterator<SearchGroup> iterator() { |
@@ -37,11 +37,11 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
37 | 37 | public void remove() { |
38 | 38 | gList.remove(idx); |
39 | 39 | } |
40 | - | |
40 | + | |
41 | 41 | public int size() { |
42 | 42 | return gList.size(); |
43 | 43 | } |
44 | - | |
44 | + | |
45 | 45 | // グループ・メンバー追加 |
46 | 46 | public boolean add(String name) { |
47 | 47 | for ( SearchGroup gl : gList ) { |
@@ -55,13 +55,30 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
55 | 55 | gList.add(gl); |
56 | 56 | return true; |
57 | 57 | } |
58 | + | |
59 | + public boolean add(SearchGroup gr){ | |
60 | + if (gr == null || gr.getName() == null) | |
61 | + return false; | |
62 | + | |
63 | + for ( SearchGroup gl : gList ) { | |
64 | + if ( gl.getName().equals(gr.getName()) ) { | |
65 | + // 既に存在している | |
66 | + return false; | |
67 | + } | |
68 | + } | |
69 | + | |
70 | + gList.add(gr); | |
71 | + | |
72 | + return true; | |
73 | + } | |
74 | + | |
58 | 75 | public boolean add(String name, String member) { |
59 | - | |
76 | + | |
60 | 77 | if ( name == null || member == null ) { |
61 | 78 | // グループとメンバーの指定は必須 |
62 | 79 | return false; |
63 | 80 | } |
64 | - | |
81 | + | |
65 | 82 | for ( SearchGroup gl : gList ) { |
66 | 83 | if ( gl.getName().equals(name) ) { |
67 | 84 | gList.iterator(); |
@@ -82,7 +99,7 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
82 | 99 | gl.add(member); |
83 | 100 | return true; |
84 | 101 | } |
85 | - | |
102 | + | |
86 | 103 | // 削除する |
87 | 104 | public boolean remove(String name) { |
88 | 105 | for ( SearchGroup gl : gList ) { |
@@ -95,12 +112,12 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
95 | 112 | return false; |
96 | 113 | } |
97 | 114 | public boolean remove(String name, String member) { |
98 | - | |
115 | + | |
99 | 116 | if ( member == null ) { |
100 | 117 | // グループ指定は必須 |
101 | 118 | return false; |
102 | 119 | } |
103 | - | |
120 | + | |
104 | 121 | if ( name == null ) { |
105 | 122 | // グループ横断削除 |
106 | 123 | for ( SearchGroup gl : gList ) { |
@@ -134,14 +151,19 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
134 | 151 | return false; |
135 | 152 | } |
136 | 153 | } |
137 | - | |
154 | + | |
155 | + // クリアする | |
156 | + public void clear(){ | |
157 | + gList.clear(); | |
158 | + } | |
159 | + | |
138 | 160 | // 検索する |
139 | 161 | public boolean isFind(String name, String member) { |
140 | - | |
162 | + | |
141 | 163 | if ( name == null || member == null ) { |
142 | 164 | return false; |
143 | 165 | } |
144 | - | |
166 | + | |
145 | 167 | for ( SearchGroup gl : gList ) { |
146 | 168 | if ( gl.getName().equals(name) ) { |
147 | 169 | for ( String gmember : gl ) { |
@@ -154,7 +176,7 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
154 | 176 | } |
155 | 177 | return false; |
156 | 178 | } |
157 | - | |
179 | + | |
158 | 180 | // 改名する |
159 | 181 | public boolean rename(String oldName, String newName) { |
160 | 182 | for ( SearchGroup gl : gList ) { |
@@ -186,7 +208,7 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
186 | 208 | } |
187 | 209 | return false; |
188 | 210 | } |
189 | - | |
211 | + | |
190 | 212 | // セーブ・ロード |
191 | 213 | public boolean save() { |
192 | 214 | System.out.println("検索キーワードグループ設定を保存します: "+gFile); |
@@ -196,7 +218,7 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
196 | 218 | } |
197 | 219 | return true; |
198 | 220 | } |
199 | - | |
221 | + | |
200 | 222 | public boolean load() { |
201 | 223 | System.out.println("検索キーワードグループ設定を読み込みます: "+gFile); |
202 | 224 | if ( new File(gFile).exists() ) { |
@@ -207,7 +229,7 @@ public class SearchGroupList implements Iterator<SearchGroup>, Iterable<SearchGr | ||
207 | 229 | return true; |
208 | 230 | } |
209 | 231 | } |
210 | - | |
232 | + | |
211 | 233 | System.err.println("検索キーワードグループ設定が読み込みに失敗しました: "+gFile); |
212 | 234 | return false; |
213 | 235 | } |
@@ -1569,6 +1569,8 @@ public class TVProgramUtils implements Cloneable { | ||
1569 | 1569 | * 番組情報をキャッシュファイルから読み込む |
1570 | 1570 | */ |
1571 | 1571 | public boolean loadFromProgCache(String prefix){ |
1572 | + TatCount tc = new TatCount(); | |
1573 | + | |
1572 | 1574 | if (!useProgCache){ |
1573 | 1575 | System.out.println("高速キャッシュファイルは使用しません"); |
1574 | 1576 | return false; |
@@ -1623,7 +1625,8 @@ public class TVProgramUtils implements Cloneable { | ||
1623 | 1625 | |
1624 | 1626 | pcenter = pcl; |
1625 | 1627 | |
1626 | - System.out.println("高速キャッシュファイルの読み込みに成功しました"); | |
1628 | + String tm = String.format(" [%.2f秒]", tc.end()); | |
1629 | + System.out.println("高速キャッシュファイルの読み込みに成功しました" + tm); | |
1627 | 1630 | return true; |
1628 | 1631 | } |
1629 | 1632 | } |
@@ -9,6 +9,9 @@ import java.util.regex.Pattern; | ||
9 | 9 | * <P>個々のタイトルの情報を保持します。 |
10 | 10 | */ |
11 | 11 | public class TitleInfo implements Cloneable { |
12 | + public static final String MOVEONLY = "移動のみ"; | |
13 | + public static final String RECORDING = "録画中"; | |
14 | + | |
12 | 15 | private int serial=0; |
13 | 16 | private String id=null; |
14 | 17 | private String rec_mode=""; |
@@ -22,8 +25,6 @@ public class TitleInfo implements Cloneable { | ||
22 | 25 | private String channel=""; |
23 | 26 | private String ch_name=""; |
24 | 27 | |
25 | - private String detail=""; | |
26 | - | |
27 | 28 | private String content_id=""; |
28 | 29 | |
29 | 30 | private String rec_device=null; |
@@ -83,8 +84,7 @@ public class TitleInfo implements Cloneable { | ||
83 | 84 | public String getCh_name() {return ch_name;} |
84 | 85 | public void setCh_name(String s) { ch_name=s;} |
85 | 86 | |
86 | - public String getDetail() {return detail;} | |
87 | - public void setDetail(String s) { detail=s;} | |
87 | + public void setDetail(String s) {} | |
88 | 88 | |
89 | 89 | public String getContentId() {return content_id;} |
90 | 90 | public void setContentId(String s) { content_id=s;} |
@@ -165,4 +165,49 @@ public class TitleInfo implements Cloneable { | ||
165 | 165 | public HashMap<String,String> getHidden_params() { return hidden_params; } |
166 | 166 | public void setHidden_params(HashMap<String,String> a) { hidden_params = a; } |
167 | 167 | |
168 | + // コピー回数を整形する | |
169 | + public String formatCopyCount(){ | |
170 | + String copycount = getHidden_params().get("copycount"); | |
171 | + if (copycount == null) | |
172 | + return ""; | |
173 | + else if (copycount.equals("1")) | |
174 | + return MOVEONLY; | |
175 | + else if (copycount.equals("238")) | |
176 | + return RECORDING; | |
177 | + else{ | |
178 | + try{ | |
179 | + int count = Integer.parseInt(copycount); | |
180 | + return String.format("%d回", count-1); | |
181 | + } | |
182 | + catch(NumberFormatException e){ | |
183 | + } | |
184 | + | |
185 | + return copycount + "回"; | |
186 | + } | |
187 | + } | |
188 | + | |
189 | + // 詳細情報を整形する | |
190 | + public String formatDetail(){ | |
191 | + String detail = | |
192 | + "番組タイトル:" + getTitle() + "\n" + | |
193 | + "録画モード:" + getRec_mode() + "\n" + | |
194 | + "フォルダ:" + getFolderNameList() + "\n"; | |
195 | + | |
196 | + String g = ""; | |
197 | + for (TextValueSet ts : getRec_genre()){ | |
198 | + if (!g.equals("")) | |
199 | + g += ","; | |
200 | + g += ts.getValue() + ":" + ts.getText(); | |
201 | + } | |
202 | + | |
203 | + detail += "ジャンル:" + g + "\n"; | |
204 | + detail += "コピー回数:" + formatCopyCount() + "\n"; | |
205 | +// detail += "CONTENT ID:" + getContentId() + "\n"; | |
206 | + | |
207 | + String dlnaObjectID = getHidden_params().get("dlnaObjectID"); | |
208 | + if (dlnaObjectID != null) | |
209 | + detail += "DLNA OID:" + dlnaObjectID + "\n"; | |
210 | + | |
211 | + return detail; | |
212 | + } | |
168 | 213 | } |
@@ -5,7 +5,7 @@ import java.util.regex.Pattern; | ||
5 | 5 | |
6 | 6 | |
7 | 7 | public class VersionInfo { |
8 | - private static final String Version = "タイニー番組ナビゲータ for DBR-T2007 3.22.18β+1.12"; | |
8 | + private static final String Version = "タイニー番組ナビゲータ for DBR-T2007 3.22.18β+1.12.1"; | |
9 | 9 | |
10 | 10 | private static final String OSname = System.getProperty("os.name"); |
11 | 11 | private static final String OSvers = System.getProperty("os.version"); |
@@ -2116,6 +2116,7 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H | ||
2116 | 2116 | if (env.getDebug()) System.out.println("Timer Rised: now="+CommonUtils.getDateTimeYMDx(e.getCalendar())); |
2117 | 2117 | setTitleBar(); |
2118 | 2118 | checkReservesForNotify(); |
2119 | + checkPickProgsForNotify(); | |
2119 | 2120 | checkDownloadProgramTime(e.getCalendar()); |
2120 | 2121 | } |
2121 | 2122 |
@@ -2127,12 +2128,29 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H | ||
2127 | 2128 | return; |
2128 | 2129 | if (reserved == null) |
2129 | 2130 | return; |
2130 | - | |
2131 | 2131 | ArrayList<String> list = new ArrayList<String>(); |
2132 | 2132 | reserved.getReservesToNotify(list); |
2133 | 2133 | |
2134 | 2134 | for (String s : list){ |
2135 | - trayicon.displayMessage("TinyBannavi", s, MessageType.INFO); | |
2135 | + trayicon.displayMessage("TinyBannaviからのお知らせ", s, MessageType.INFO); | |
2136 | + } | |
2137 | + } | |
2138 | + | |
2139 | + /* | |
2140 | + * 開始間もなくのピックアップ番組を通知する | |
2141 | + */ | |
2142 | + private void checkPickProgsForNotify(){ | |
2143 | + if (!env.getNotifyBeforePickProgStart()) | |
2144 | + return; | |
2145 | + | |
2146 | + if (listed == null) | |
2147 | + return; | |
2148 | + | |
2149 | + ArrayList<String> list = new ArrayList<String>(); | |
2150 | + listed.getPickupsToNotify(list); | |
2151 | + | |
2152 | + for (String s : list){ | |
2153 | + trayicon.displayMessage("TinyBannaviからのお知らせ", s, MessageType.INFO); | |
2136 | 2154 | } |
2137 | 2155 | } |
2138 | 2156 |
@@ -2461,12 +2479,12 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H | ||
2461 | 2479 | tvp.refresh(); |
2462 | 2480 | tvp.add(tvd); |
2463 | 2481 | tvp.save(); |
2464 | - /* | |
2465 | - if ( listed.isNodeSelected(ListedTreeNode.PICKUP) ) { | |
2482 | + | |
2483 | + if ( listed.isNodeSelected(JTreeLabel.Nodes.PICKUP) || listed.isNodeSelected(JTreeLabel.Nodes.STANDBY) ) { | |
2466 | 2484 | // ピックアップノードが選択されていたらリストを更新する |
2467 | 2485 | listed.reselectTree(); |
2468 | 2486 | } |
2469 | - */ | |
2487 | + | |
2470 | 2488 | listed.updateReserveMark(); |
2471 | 2489 | listed.refocus(); |
2472 | 2490 | paper.updateReserveBorder(tvd.center); |
@@ -5079,7 +5097,7 @@ public class Viewer extends JFrame implements ChangeListener,TickTimerListener,H | ||
5079 | 5097 | HDDRecorder rec = rPlugin.clone(); |
5080 | 5098 | recorders.add(rec); |
5081 | 5099 | |
5082 | - rec.getChCode().load(true); // true : ログ出力あり | |
5100 | + rec.getChCode().load(env.getDebug()); // true : ログ出力あり | |
5083 | 5101 | setSettingRecPluginBase(rec, ri); |
5084 | 5102 | setSettingRecPluginExt(rec,env); |
5085 | 5103 | rec.setProgressArea(stwin); |
@@ -14,7 +14,6 @@ import java.util.Locale; | ||
14 | 14 | import java.util.regex.Matcher; |
15 | 15 | import java.util.regex.Pattern; |
16 | 16 | |
17 | -import tainavi.AbsTitleListView; | |
18 | 17 | import tainavi.AribCharMap; |
19 | 18 | import tainavi.ChannelCode; |
20 | 19 | import tainavi.ChapterInfo; |
@@ -406,7 +405,6 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
406 | 405 | ReservesToFile(getReserves(), rsvedFile); |
407 | 406 | |
408 | 407 | reportProgress(MSGID+"正常に登録できました。"); |
409 | - System.out.printf("\n<<< Message from RD >>> \"%s\"\n\n", "正常に登録できました。"); | |
410 | 408 | |
411 | 409 | return(true); |
412 | 410 | } |
@@ -457,7 +455,6 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
457 | 455 | ReservesToFile(getReserves(), rsvedFile); |
458 | 456 | |
459 | 457 | reportProgress(MSGID+"正常に更新できました。"); |
460 | - System.out.printf("\n<<< Message from RD >>> \"%s\"\n\n", "正常に更新できました。"); | |
461 | 458 | |
462 | 459 | return(true); |
463 | 460 | } |
@@ -767,8 +764,6 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
767 | 764 | return(false); |
768 | 765 | } |
769 | 766 | |
770 | - updateTitleDetail(t); | |
771 | - | |
772 | 767 | // 録画タイトルリストを更新 |
773 | 768 | ArrayList<TitleInfo> list = getTitles(); |
774 | 769 | list.remove(o); |
@@ -904,7 +899,6 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
904 | 899 | } |
905 | 900 | |
906 | 901 | reportProgress(MSGID+"正常に" + action + "できました。"); |
907 | -// System.out.printf("\n<<< Message from RD >>> \"%s\"\n\n", "正常に" + action + "できました。"); | |
908 | 902 | |
909 | 903 | return(true); |
910 | 904 | } |
@@ -1792,9 +1786,6 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
1792 | 1786 | entry.setSerial(++serial); |
1793 | 1787 | setTitleBasicInfo(entry, titlename, ch, datetime, duration, device_id, folders, genres); |
1794 | 1788 | |
1795 | - // 詳細情報のテキストを更新する | |
1796 | - updateTitleDetail(entry); | |
1797 | - | |
1798 | 1789 | // 予約情報を保存 |
1799 | 1790 | list.add(entry.clone()); |
1800 | 1791 | } |
@@ -1975,47 +1966,12 @@ public class PlugIn_RecDBR_T2007 extends HDDRecorderUtils implements HDDRecorder | ||
1975 | 1966 | |
1976 | 1967 | t.setRecording(recording); |
1977 | 1968 | |
1978 | - // 詳細情報のテキストを更新する | |
1979 | - updateTitleDetail(t); | |
1980 | - | |
1981 | 1969 | t.setDetailLoaded(true); |
1982 | 1970 | |
1983 | 1971 | return(true); |
1984 | 1972 | } |
1985 | 1973 | |
1986 | 1974 | /** |
1987 | - * タイトルの詳細情報のテキストを更新する | |
1988 | - * | |
1989 | - */ | |
1990 | - protected void updateTitleDetail(TitleInfo t) { | |
1991 | - String detail = | |
1992 | - "番組タイトル:" + t.getTitle() + "\n" + | |
1993 | - "録画モード:" + t.getRec_mode() + "\n" + | |
1994 | - "フォルダ:" + t.getFolderNameList() + "\n"; | |
1995 | - | |
1996 | - String g = ""; | |
1997 | - for (TextValueSet ts : t.getRec_genre()){ | |
1998 | - if (!g.equals("")) | |
1999 | - g += ","; | |
2000 | - g += ts.getValue() + ":" + ts.getText(); | |
2001 | - } | |
2002 | - | |
2003 | - detail += "ジャンル:" + g + "\n"; | |
2004 | - | |
2005 | - String copycount = t.getHidden_params().get("copycount"); | |
2006 | - if (copycount != null) | |
2007 | - detail += "コピー回数:" + (copycount.equals("1") ? AbsTitleListView.MOVEONLY : copycount + "回") + "\n"; | |
2008 | - | |
2009 | -// detail += "CONTENT ID:" + t.getContentId() + "\n"; | |
2010 | - | |
2011 | - String dlnaObjectID = t.getHidden_params().get("dlnaObjectID"); | |
2012 | - if (dlnaObjectID != null) | |
2013 | - detail += "DLNA OID:" + dlnaObjectID + "\n"; | |
2014 | - | |
2015 | - t.setDetail(detail); | |
2016 | - } | |
2017 | - | |
2018 | - /** | |
2019 | 1975 | * フォルダーのJSONテキストを解析する |
2020 | 1976 | */ |
2021 | 1977 | protected ArrayList<TextValueSet> parseFolders(String device_id, String s) { |
@@ -188,8 +188,14 @@ public class PlugIn_TVPTVKingdom extends TVProgramUtils implements TVProgram,Clo | ||
188 | 188 | String url = null; |
189 | 189 | String cookie = null; |
190 | 190 | if (ac.equals(bsCode)) { |
191 | + // BS4K8K | |
192 | + if (d>bscnt){ | |
193 | + int d4k = d-bscnt; | |
194 | + url = "https://tv.so-net.ne.jp/chart/bs4k8k_"+d4k+".action?head="+date+"&span=24"; | |
195 | + } | |
191 | 196 | // BS |
192 | - url = "https://tv.so-net.ne.jp/chart/bs"+d+".action?head="+date+"&span=24"; | |
197 | + else | |
198 | + url = "https://tv.so-net.ne.jp/chart/bs"+d+".action?head="+date+"&span=24"; | |
193 | 199 | cookie = null; |
194 | 200 | } |
195 | 201 | else { |
@@ -666,7 +672,8 @@ public class PlugIn_TVPTVKingdom extends TVProgramUtils implements TVProgram,Clo | ||
666 | 672 | |
667 | 673 | // 地上派・UHFは地域別に扱う |
668 | 674 | |
669 | - int cntMax = ((code.equals(allCode))?(aclist.size()-2):(1))+bscnt; | |
675 | + int bs4kcnt = 2; // BS4K8Kのページ数は現状固定 | |
676 | + int cntMax = ((code.equals(allCode))?(aclist.size()-2):(1))+bscnt+bs4kcnt; | |
670 | 677 | int cnt = 1; |
671 | 678 | for (AreaCode ac : aclist) { |
672 | 679 | if (ac.getCode().equals(bsCode)) { |
@@ -703,6 +710,15 @@ public class PlugIn_TVPTVKingdom extends TVProgramUtils implements TVProgram,Clo | ||
703 | 710 | cnt++; |
704 | 711 | } |
705 | 712 | |
713 | + // BS4K&8Kは共通にする(ページ数はとりあえず固定) | |
714 | + for ( int d=1; d<=bs4kcnt; d++ ){ | |
715 | + String url = "https://tv.so-net.ne.jp/chart/bs4k8k_"+d+".action?group=4"+d; | |
716 | + if ( _loadCenter(newcrlist, bsCode, String.valueOf(bscnt+d), url) ) { | |
717 | + reportProgress("放送局情報を取得しました: ("+cnt+"/"+cntMax+") "+url); | |
718 | + } | |
719 | + cnt++; | |
720 | + } | |
721 | + | |
706 | 722 | // BSのページ数を記録する |
707 | 723 | |
708 | 724 | if ( bscntTmp < bscnt ) { |