mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-11 12:48:12 +08:00
experiment ui
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "alpha 0.7.3"
|
const VERSION = "alpha 0.7.5"
|
||||||
|
|
||||||
const CONFIG_PATH = "./config.ini"
|
const CONFIG_PATH = "./config.ini"
|
||||||
const Assests_PATH = "./assets"
|
const Assests_PATH = "./assets"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ func Initialize() {
|
|||||||
|
|
||||||
tabs := container.NewAppTabs(
|
tabs := container.NewAppTabs(
|
||||||
container.NewTabItem(i18n.T("gui.tab.player"),
|
container.NewTabItem(i18n.T("gui.tab.player"),
|
||||||
newPaddedBoarder(nil, createPlayController(), nil, nil, createPlaylist()),
|
newPaddedBoarder(nil, createPlayControllerV2(), nil, nil, createPlaylist()),
|
||||||
),
|
),
|
||||||
container.NewTabItem(i18n.T("gui.tab.search"),
|
container.NewTabItem(i18n.T("gui.tab.search"),
|
||||||
newPaddedBoarder(createSearchBar(), nil, nil, nil, createSearchList()),
|
newPaddedBoarder(createSearchBar(), nil, nil, nil, createSearchList()),
|
||||||
|
|||||||
@@ -186,10 +186,14 @@ func registerPlayControllerHandler() {
|
|||||||
controller.MainPlayer.EventHandler.RegisterA(player.EventPlay, "gui.player.updateinfo", func(event *event.Event) {
|
controller.MainPlayer.EventHandler.RegisterA(player.EventPlay, "gui.player.updateinfo", func(event *event.Event) {
|
||||||
l().Debug("receive EventPlay update player info")
|
l().Debug("receive EventPlay update player info")
|
||||||
media := event.Data.(player.PlayEvent).Media
|
media := event.Data.(player.PlayEvent).Media
|
||||||
|
//PlayController.Title.SetText(
|
||||||
|
// util.StringNormalize(media.Title, 16, 16))
|
||||||
|
//PlayController.Artist.SetText(
|
||||||
|
// util.StringNormalize(media.Artist, 16, 16))
|
||||||
PlayController.Title.SetText(
|
PlayController.Title.SetText(
|
||||||
util.StringNormalize(media.Title, 16, 16))
|
media.Title)
|
||||||
PlayController.Artist.SetText(
|
PlayController.Artist.SetText(
|
||||||
util.StringNormalize(media.Artist, 16, 16))
|
media.Artist)
|
||||||
PlayController.Username.SetText(media.ToUser().Name)
|
PlayController.Username.SetText(media.ToUser().Name)
|
||||||
if media.Cover == "" {
|
if media.Cover == "" {
|
||||||
PlayController.SetDefaultCover()
|
PlayController.SetDefaultCover()
|
||||||
@@ -223,32 +227,37 @@ func createPlayControllerV2() fyne.CanvasObject {
|
|||||||
PlayController.ButtonSwitch = widget.NewButtonWithIcon("", theme.MediaPlayIcon(), func() {})
|
PlayController.ButtonSwitch = widget.NewButtonWithIcon("", theme.MediaPlayIcon(), func() {})
|
||||||
PlayController.ButtonNext = widget.NewButtonWithIcon("", theme.MediaSkipNextIcon(), func() {})
|
PlayController.ButtonNext = widget.NewButtonWithIcon("", theme.MediaSkipNextIcon(), func() {})
|
||||||
|
|
||||||
buttonsBox := container.NewCenter(
|
buttonsBox := container.NewHBox(PlayController.ButtonPrev, PlayController.ButtonSwitch, PlayController.ButtonNext)
|
||||||
container.NewHBox(PlayController.ButtonPrev, PlayController.ButtonSwitch, PlayController.ButtonNext))
|
|
||||||
|
PlayController.Volume = widget.NewSlider(0, 100)
|
||||||
|
PlayController.ButtonLrc = widget.NewButton(i18n.T("gui.player.button.lrc"), func() {})
|
||||||
|
|
||||||
|
controls := container.NewPadded(container.NewBorder(nil, nil,
|
||||||
|
buttonsBox, nil,
|
||||||
|
container.NewGridWithColumns(
|
||||||
|
2,
|
||||||
|
container.NewMax(),
|
||||||
|
container.NewBorder(nil, nil, widget.NewIcon(theme.VolumeMuteIcon()), PlayController.ButtonLrc,
|
||||||
|
PlayController.Volume)),
|
||||||
|
))
|
||||||
|
|
||||||
PlayController.Progress = widget.NewSlider(0, 1000)
|
PlayController.Progress = widget.NewSlider(0, 1000)
|
||||||
PlayController.CurrentTime = widget.NewLabel("0:00")
|
PlayController.CurrentTime = widget.NewLabel("0:00")
|
||||||
PlayController.TotalTime = widget.NewLabel("0:00")
|
PlayController.TotalTime = widget.NewLabel("0:00")
|
||||||
progressItem := container.NewBorder(nil, nil, PlayController.CurrentTime, PlayController.TotalTime, PlayController.Progress)
|
progressItem := container.NewBorder(nil, nil,
|
||||||
|
PlayController.CurrentTime,
|
||||||
|
PlayController.TotalTime,
|
||||||
|
PlayController.Progress)
|
||||||
|
|
||||||
PlayController.Title = widget.NewLabel("Title")
|
PlayController.Title = widget.NewLabel("Title")
|
||||||
PlayController.Title.TextStyle.Bold = true
|
|
||||||
//a := canvas.NewText("asdf", color.Black)
|
|
||||||
//a.TextSize = 12
|
|
||||||
PlayController.Artist = widget.NewLabel("Artist")
|
PlayController.Artist = widget.NewLabel("Artist")
|
||||||
PlayController.Username = widget.NewLabel("Username")
|
PlayController.Username = widget.NewLabel("Username")
|
||||||
|
|
||||||
playInfo := container.NewBorder(PlayController.Username, nil, nil, PlayController.Artist, PlayController.Title)
|
playInfo := container.NewBorder(nil, nil, nil, PlayController.Username,
|
||||||
|
container.NewHBox(PlayController.Title, PlayController.Artist))
|
||||||
PlayController.Volume = widget.NewSlider(0, 100)
|
|
||||||
volumeIcon := widget.NewIcon(theme.VolumeMuteIcon())
|
|
||||||
PlayController.ButtonLrc = widget.NewButton(i18n.T("gui.player.button.lrc"), func() {})
|
|
||||||
|
|
||||||
volumeControl := container.NewBorder(nil, nil, container.NewHBox(widget.NewLabel(" "), volumeIcon), nil,
|
|
||||||
container.NewGridWithColumns(3, container.NewMax(PlayController.Volume), PlayController.ButtonLrc))
|
|
||||||
|
|
||||||
registerPlayControllerHandler()
|
registerPlayControllerHandler()
|
||||||
|
|
||||||
return container.NewBorder(nil, nil, container.NewHBox(PlayController.Cover, widget.NewSeparator()), nil,
|
return container.NewBorder(nil, nil, container.NewHBox(PlayController.Cover, widget.NewSeparator()), nil,
|
||||||
container.NewVBox(playInfo, buttonsBox, progressItem, volumeControl))
|
container.NewVBox(playInfo, progressItem, controls))
|
||||||
}
|
}
|
||||||
|
|||||||
7
todo.txt
7
todo.txt
@@ -6,16 +6,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
- 多来源点歌
|
|
||||||
- web输出
|
- web输出
|
||||||
- 黑名单
|
- 黑名单
|
||||||
- 进入beta版本
|
- 进入beta版本
|
||||||
|
|
||||||
- bilibili 歌词来源
|
- bilibili 歌词来源
|
||||||
|
|
||||||
|
alpha
|
||||||
|
|
||||||
|
- local provider
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
Finished
|
Finished
|
||||||
|
- 2022.7.03: 多来源点歌
|
||||||
- 2022.7.01: 文本输出
|
- 2022.7.01: 文本输出
|
||||||
- 2022.7.01: 历史记录
|
- 2022.7.01: 历史记录
|
||||||
- 2022.6.29: 跳过闲置歌单
|
- 2022.6.29: 跳过闲置歌单
|
||||||
|
|||||||
Reference in New Issue
Block a user