2023年2月21日15:20:23
parent
af9fde79d7
commit
b3a6276236
|
|
@ -290,6 +290,7 @@ public class PlayerController {
|
|||
common_method();
|
||||
}
|
||||
|
||||
|
||||
private void common_method() {
|
||||
splitPane.getItems().remove(1);
|
||||
splitPane.getItems().add(1, root);
|
||||
|
|
@ -314,8 +315,9 @@ public class PlayerController {
|
|||
});
|
||||
|
||||
this.height.addListener((observable, oldValue, newValue) -> {
|
||||
PlayerController.this.root.setPrefHeight(newValue.doubleValue() - listView.getHeight());
|
||||
PlayerController.this.root.setPrefHeight(newValue.doubleValue());
|
||||
log.info("newValue.doubleValue():{}", newValue.doubleValue());
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,6 +118,42 @@ public class SmallToolsController {
|
|||
color_choose(flag);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void base_62_menu_item(){
|
||||
load_codec_tools(0);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void base_64_menu_item(){
|
||||
load_codec_tools(1);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void base_32_menu_item(){
|
||||
load_codec_tools(2);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void morse_coder_menu_item(){
|
||||
load_codec_tools(3);
|
||||
}
|
||||
|
||||
public void load_codec_tools(int index) {
|
||||
AnchorPane fx = null;
|
||||
try {
|
||||
fx = FXMLLoader.load(ResourcesUtils.getResource("codec-tools"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Scene scene = new Scene(fx);
|
||||
Stage stage = (Stage) splitPane.getScene().getWindow();
|
||||
stage.setScene(scene);
|
||||
|
||||
ListView<ResourcesUtils.Player> listView = (ListView) fx.lookup("#listView");
|
||||
listView.getSelectionModel().select(index);
|
||||
}
|
||||
|
||||
public void load_player(int index) {
|
||||
AnchorPane fx = null;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -163,6 +163,9 @@ public class VideoController {
|
|||
@FXML
|
||||
private AnchorPane video_root;
|
||||
|
||||
@FXML
|
||||
private HBox mv_hbox;
|
||||
|
||||
public void full_screen() {
|
||||
|
||||
AnchorPane root = null;
|
||||
|
|
@ -199,20 +202,18 @@ public class VideoController {
|
|||
initListView();
|
||||
medias = getMusicMedias();
|
||||
|
||||
medias.addListener(new ListChangeListener<Media>() {
|
||||
public void onChanged(Change<? extends Media> c) {
|
||||
while (c.next()) {
|
||||
if (c.wasAdded()) {
|
||||
if ((medias.size() - 1) >= VideoController.this.playindex.get()) {
|
||||
VideoController.this.mp = new MediaPlayer(medias.get(VideoController.this.playindex.get()));
|
||||
}
|
||||
}
|
||||
if (medias.size() == 0) {
|
||||
VideoController.this.isplaying.set(false);
|
||||
VideoController.this.mp.pause();
|
||||
VideoController.this.mp = null;
|
||||
medias.addListener((ListChangeListener<Media>) c -> {
|
||||
while (c.next()) {
|
||||
if (c.wasAdded()) {
|
||||
if ((medias.size() - 1) >= VideoController.this.playindex.get()) {
|
||||
VideoController.this.mp = new MediaPlayer(medias.get(VideoController.this.playindex.get()));
|
||||
}
|
||||
}
|
||||
if (medias.size() == 0) {
|
||||
VideoController.this.isplaying.set(false);
|
||||
VideoController.this.mp.pause();
|
||||
VideoController.this.mp = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -231,6 +232,7 @@ public class VideoController {
|
|||
this.playindex.addListener((observable, oldValue, newValue) -> VideoController.this.myPlay());
|
||||
this.mv.setPreserveRatio(false);
|
||||
this.mv.fitWidthProperty().bind(video_root.prefWidthProperty().subtract(300));
|
||||
this.mv.fitHeightProperty().bind(video_root.prefHeightProperty().subtract(130));
|
||||
|
||||
//设置按钮
|
||||
set_button();
|
||||
|
|
|
|||
|
|
@ -35,6 +35,15 @@
|
|||
<MenuItem mnemonicParsing="false" text="颜色选择工具" onAction="#color_choose_menu_item"/>
|
||||
</items>
|
||||
</Menu>
|
||||
|
||||
<Menu mnemonicParsing="false" text="编解码工具">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Base62编码解码" onAction="#base_62_menu_item"/>
|
||||
<MenuItem mnemonicParsing="false" text="Base64编码解码" onAction="#base_64_menu_item"/>
|
||||
<MenuItem mnemonicParsing="false" text="Base32编码解码" onAction="#base_32_menu_item"/>
|
||||
<MenuItem mnemonicParsing="false" text="摩尔斯电码" onAction="#morse_coder_menu_item"/>
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
</MenuBar>
|
||||
<SplitPane fx:id="splitPane" dividerPositions="0.5" layoutY="25.0" prefHeight="575.0" prefWidth="1200.0"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
<?import com.leewyatt.rxcontrols.controls.RXMediaProgressBar?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ListView?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.Slider?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
|
|
@ -11,9 +10,27 @@
|
|||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.media.MediaView?>
|
||||
|
||||
<AnchorPane fx:id="video_root" prefHeight="649.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zhangmeng.tools.controller.VideoController">
|
||||
<AnchorPane fx:id="video_root" prefHeight="649.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zhangmeng.tools.controller.VideoController">
|
||||
|
||||
<HBox fx:id="icon_hbox" alignment="CENTER" layoutY="479.0" prefHeight="49.0" prefWidth="1200.0" spacing="20.0" style="-fx-background-color: #6666" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||
|
||||
<HBox fx:id="mv_hbox" layoutX="2.0" layoutY="31.0" prefHeight="521.0" prefWidth="1198.0" style="-fx-border-color: #85c486" AnchorPane.bottomAnchor="98.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<ListView fx:id="listView" prefHeight="551.0" prefWidth="300.0" />
|
||||
<MediaView fx:id="mv" style="-fx-border-color: red;-fx-background-color: #e9df47" HBox.hgrow="ALWAYS">
|
||||
</MediaView>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox layoutX="22.0" layoutY="562.0301513671875" AnchorPane.bottomAnchor="69.9698486328125" AnchorPane.leftAnchor="22.0" AnchorPane.rightAnchor="33.0">
|
||||
<children>
|
||||
|
||||
<Label fx:id="label_name" text="芊芊墨客-音乐相随" />
|
||||
<RXMediaProgressBar fx:id="progressBar" prefHeight="11.0" prefWidth="961.0" HBox.hgrow="ALWAYS" />
|
||||
<Label fx:id="label_time" text="00:00" />
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<HBox fx:id="icon_hbox" alignment="CENTER" layoutX="2.0" layoutY="479.0" prefHeight="36.0" prefWidth="1198.0" spacing="20.0" style="-fx-background-color: #6666" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
|
||||
<children>
|
||||
<ImageView fx:id="iv_set" fitHeight="33.0" fitWidth="77.0" pickOnBounds="true" preserveRatio="true">
|
||||
<image>
|
||||
|
|
@ -53,12 +70,5 @@
|
|||
<Slider fx:id="sl_vol" prefHeight="14.0" prefWidth="148.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<RXMediaProgressBar fx:id="progressBar" layoutX="92.0" layoutY="542.0" prefHeight="11.0" prefWidth="961.0" AnchorPane.bottomAnchor="71.0" AnchorPane.leftAnchor="185.0" AnchorPane.rightAnchor="101.0" />
|
||||
|
||||
<ListView prefHeight="551.0" prefWidth="300.0" AnchorPane.bottomAnchor="98.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" fx:id="listView" />
|
||||
|
||||
<Label fx:id="label_name" layoutX="21.0" layoutY="564.0" text="芊芊墨客-音乐相随" AnchorPane.bottomAnchor="68.0" AnchorPane.leftAnchor="21.0" />
|
||||
<Label fx:id="label_time" layoutX="1121.0" layoutY="564.0" text="00:00" AnchorPane.bottomAnchor="68.0" AnchorPane.rightAnchor="44.0" />
|
||||
<MediaView fx:id="mv" style="-fx-border-color: red" layoutX="306.0" layoutY="48.0" fitHeight="680.0" fitWidth="1024.0" AnchorPane.bottomAnchor="99.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
</MediaView>
|
||||
</AnchorPane>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
|
||||
<AnchorPane fx:controller="com.zhangmeng.tools.controller.VipParserController" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="649.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<AnchorPane fx:controller="com.zhangmeng.tools.controller.VipParserController" minWidth="-Infinity" prefHeight="649.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Label layoutX="165.0" layoutY="273.0" text="将要解析的视频地址" AnchorPane.leftAnchor="165.0" />
|
||||
<TextField layoutX="315.0" layoutY="269.0" prefHeight="25.0" prefWidth="457.0" fx:id="input_text" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue