📄 0.lua
字号:
end
CheckDisplayIndicator = function()
local l_22_0 = gPlayer:Database().Count
if gOrder == "7" or l_22_0 == 0 or l_22_0 ~= gPlayer:Database().NowPlayingCount then
return false
end
local l_22_1 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ARTIST)
local l_22_2 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ALBUM)
local l_22_3 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_GENRE)
local l_22_4 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_COMPOSER)
local l_22_5 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
local l_22_6 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_ARTIST)
local l_22_7 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_ALBUM)
local l_22_8 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_GENRE)
local l_22_9 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_COMPOSER)
local l_22_10 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_PLAYLIST)
local l_22_11 = MusicConfig_Instance():GetSetting(CONFIG_NOWPLAYING_ORDER)
if l_22_11 ~= gOrder and gOrder ~= "0" then
return false
end
if gOrder == "4" or gOrder == "0" then
return true
elseif gOrder == "11" then
if l_22_1 == l_22_6 then
return true
end
elseif gOrder == "100" then
if l_22_1 == l_22_6 and l_22_2 == l_22_7 then
return true
end
elseif gOrder == "20" then
if l_22_2 == l_22_7 then
return true
end
elseif gOrder == "30" then
if l_22_5 == l_22_10 then
return true
end
elseif gOrder == "52" then
if l_22_3 == l_22_8 then
return true
end
elseif gOrder == "62" then
if l_22_4 == l_22_9 then
return true
end
elseif gOrder == "500" then
if l_22_1 == l_22_6 and l_22_3 == l_22_8 then
return true
end
elseif gOrder == "510" then
if l_22_2 == l_22_7 and l_22_3 == l_22_8 then
return true
end
elseif gOrder == "600" then
if l_22_1 == l_22_6 and l_22_4 == l_22_9 then
return true
end
elseif gOrder == "610" then
if l_22_2 == l_22_7 and l_22_4 == l_22_9 then
return true
end
end
return false
end
CalculatePlaylist_TitleStringLength = function()
if gOrder == "30" then
local pln = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST_NAME)
local strw = MusicHelper_GetStringWidth(TitleText, pln)
trace("[MG-Song, CalculatePlaylist_StrLength] playlist name:[" .. pln .. "], width: " .. tostring(strw))
trace("[MG-Song] font_name: " .. TitleText.FontName .. ", font_path: " .. TitleText.FontPath .. ", font_size: " .. tostring(TitleText.FontSize))
if gIsWMPPlaylist == false and gMaxTitleStringLength <= strw then
_application.Navigation.Title = ""
TitleText.String = pln
TitleText._visible = true
else
TitleText._visible = false
_application.Navigation.Title = pln
end
end
end
SelectData = function()
if gOrder == "0" then
gPlayer:Database():SelectPlayingList()
_application.Navigation.Title = Locale:GetString("IDS_MUSIC_NOWPLAYING")
elseif gOrder == "4" then
local mwc = MusicWhereConditions()
gPlayer:Database():Select(TID_SONG, mwc)
_application.Navigation.Title = Locale:GetString("IDS_MUSIC_ALLSONGS")
elseif gOrder == "7" then
local mwc = MusicWhereConditions()
gPlayer:Database():Select(VID_SONGS_OF_TYPE, mwc)
_application.Navigation.Title = Locale:GetString("IDS_MUSIC_PURCHASED")
elseif gOrder == "11" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ARTIST)
local mwc = MusicWhereConditions()
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_ARTIST, mwc)
_application.Navigation.Title = ca .. ": " .. Locale:GetString("IDS_MUSIC_ALLSONGS")
if gEnterFrom_TreeList == true then
listview.Viewport.y = 634
end
elseif gOrder == "100" then
local cal = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ALBUM)
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ARTIST)
local mwc = MusicWhereConditions()
mwc:AddCondition(ca)
mwc:AddCondition(cal)
gPlayer:Database():Select(VID_SONGS_OF_ARTIST_ALBUM, mwc)
_application.Navigation.Title = cal
listview.Viewport.y = 634
elseif gOrder == "20" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ALBUM)
local mwc = MusicWhereConditions()
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_ALBUM, mwc)
_application.Navigation.Title = ca
listview.Viewport.y = 634
elseif gOrder == "30" then
local cp = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
local mwc = MusicWhereConditions()
trace("[MG] Playlist Uid " .. cp .. "\n")
mwc:AddCondition(cp)
gPlayer:Database():Select(VID_SONGS_INFO_OF_PLAYLIST, mwc)
_application.Navigation.Title = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST_NAME)
listview.Viewport.y = 634
elseif gOrder == "52" then
local cg = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_GENRE)
local mwc = MusicWhereConditions()
mwc:AddCondition(cg)
gPlayer:Database():Select(VID_SONGS_OF_GENRE, mwc)
_application.Navigation.Title = cg .. ": " .. Locale:GetString("IDS_MUSIC_ALLSONGS")
if gEnterFrom_TreeList == true then
listview.Viewport.y = 634
end
elseif gOrder == "62" then
local cc = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_COMPOSER)
local mwc = MusicWhereConditions()
mwc:AddCondition(cc)
gPlayer:Database():Select(VID_SONGS_OF_COMPOSER, mwc)
_application.Navigation.Title = cc .. ": " .. Locale:GetString("IDS_MUSIC_ALLSONGS")
if gEnterFrom_TreeList == true then
listview.Viewport.y = 634
end
elseif gOrder == "500" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ARTIST)
local cg = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_GENRE)
local mwc = MusicWhereConditions()
mwc:AddCondition(cg)
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_GENRE_ARTIST, mwc)
_application.Navigation.Title = ca
listview.Viewport.y = 634
elseif gOrder == "510" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ALBUM)
local cg = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_GENRE)
local mwc = MusicWhereConditions()
mwc:AddCondition(cg)
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_GENRE_ALBUM, mwc)
_application.Navigation.Title = ca
listview.Viewport.y = 634
elseif gOrder == "600" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ARTIST)
local cc = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_COMPOSER)
local mwc = MusicWhereConditions()
mwc:AddCondition(cc)
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_COMPOSER_ARTIST, mwc)
_application.Navigation.Title = ca
listview.Viewport.y = 634
elseif gOrder == "610" then
local ca = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_ALBUM)
local cc = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_COMPOSER)
local mwc = MusicWhereConditions()
mwc:AddCondition(cc)
mwc:AddCondition(ca)
gPlayer:Database():Select(VID_SONGS_OF_COMPOSER_ALBUM, mwc)
_application.Navigation.Title = ca
listview.Viewport.y = 634
end
end
OnListChange = function()
SelectData()
SongCollection = gPlayer:Database().CurMusicList
ItemListGenerator.Collection = SongCollection
if gOrder == "30" and gIsWMPPlaylist == false then
if ItemListGenerator:GetCount() > 0 then
subtitlegroup._visible = false
gizmo._visible = true
else
gizmo._visible = false
subtitlegroup._visible = true
end
else
subtitlegroup._visible = false
gizmo._visible = true
end
listview:Focus()
if gNotifyFromRename == true and gOrder == "30" then
gNotifyFromRename = false
local l_25_0 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
local l_25_1 = PlaylistInfo()
if l_25_1 ~= nil and gPlayer:Database():GetPlaylistInfo(l_25_0, l_25_1) == true then
MusicConfig_Instance():SetSetting(CONFIG_CURRENT_PLAYLIST_NAME, l_25_1.Name)
trace("[MG] After rename playlist, name: " .. l_25_1.Name .. "\n")
CalculatePlaylist_TitleStringLength()
end
end
end
OnAddSongsPress = function(l_26_0)
if gOrder ~= "30" then
return
end
addsongs_icon:SetTextureRef("Addsongs_down")
end
OnAddSongsRelease = function(l_27_0)
if gOrder ~= "30" then
return
end
addsongs_icon:SetTextureRef("Addsongs")
if _config_os == "windowsmobile" and Playlist_titlegroup._visible == true and addsongs_icon._visible == true then
local l_27_1 = MusicConfig_Instance():GetSetting(CONFIG_CURRENT_PLAYLIST)
if gIsWMPPlaylist == false and l_27_1 ~= nil then
GotoAddSongsPage()
end
end
end
OnAddSongsReleaseOutside = function(l_28_0)
if gOrder ~= "30" then
return
end
addsongs_icon:SetTextureRef("Addsongs")
end
ItemListLayout = TileLayout()
ItemListLayout:SetItemSize(480, gListView_Height, 0)
ItemListLayout.SelectionNode = Selector
listview:SetLayout(ItemListLayout)
if _config_os == "windowsmobile" then
_application.OnVisibilityChanged:connect(OnActivate)
_request.NavigateOutTo:connect(OnNavigateOutTo)
_request.NavigateInFrom:connect(OnNavigateInFrom)
gPlayer.onPlayingIndexChange:connect(OnPlayingIndexChange)
gPlayer.onListChange:connect(OnListChange)
gOrder = _request.URL.Parameters:GetParameter("order")
trace("[MG] MusicSongList - order " .. gOrder .. "\n")
gIsWMPPlaylist = false
if gOrder == "30" then
do
local l = _request.URL.Parameters:GetParameter("IsWMPPlaylist")
if l ~= nil and l == "1" then
gIsWMPPlaylist = true
end
end
end
gEnterFrom_TreeList = false
local l = _request.URL.Parameters:GetParameter("EnterFrom_TreeList")
if l ~= nil and l == "1" then
gEnterFrom_TreeList = true
end
SelectData()
SongCollection = gPlayer:Database().CurMusicList
ItemListGenerator = LibraryGeneratorMusicInfo(SongCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
_application:SetLeftSoftkey(Softkey(Locale:GetString("IDS_MUSIC_UP"), LSKFunction))
if gOrder == "30" and gIsWMPPlaylist == false then
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MUSIC_MENU"), RSKFunction))
Playlist_titlegroup._visible = true
CalculatePlaylist_TitleStringLength()
local l = ItemListGenerator:GetCount()
if l > 0 then
subtitlegroup._visible = false
gizmo._visible = true
else
gizmo._visible = false
subtitlegroup._visible = true
end
else
_application:SetRightSoftkey(Softkey(Locale:GetString("IDS_MUSIC_NOWPLAYING_RSK"), RSKFunctionPlayer))
Playlist_titlegroup._visible = false
subtitlegroup._visible = false
gizmo._visible = true
end
else
FakeCollection = VectorNotifyint()
for i = 0, 10 do
FakeCollection:push_back(i)
end
ItemListGenerator = LibraryGeneratorint(FakeCollection, listview:GetMovie(), listview.ComponentLibraryName, listview.ComponentLibraryID)
end
ItemListGenerator.RecycleItems = true
gShowIndicator = CheckDisplayIndicator()
ListPhysics = ScrollPhysics(listview, listview, HandleItemSelection)
ListPhysics:ConnectMouseEvents()
ItemListGenerator.ItemCreated:connect(HandleItemCreated)
ItemListGenerator.ItemDestroyed:connect(HandleItemDestroyed)
listview:SetGenerator(ItemListGenerator)
listview:ForceLayout()
listview:Focus()
addsongs_icon.onPress:connect(OnAddSongsPress)
addsongs_icon.onRelease:connect(OnAddSongsRelease)
addsongs_icon.onReleaseOutside:connect(OnAddSongsOutside)
if _application.Store:GetStringValue(Lifetime_Permanent, "EnableLandscape") == "true" then
trace("[MG] : EnableLandscape")
require("Audio\\MusicSong_Landscape")
_MusicSong_ScreenRotation = MusicSong_ScreenRotation()
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -