import QtQuick 2.0 import Label 2.0 import "../../com/neusoft/auto/widgets" import "../../windowsList.js" as WindowsList import "../../layoutList.js" as Layout HMICenterWindow { id:main_play_window property string usb_ptime: "00:00:00" property string usb_totaltime:"00:00:00" property double usb_playbarscale: 0 property string songtitle: dashUSBCtrl.filename property string coverpath: dashUSBCtrl.coverPath property string artistname: dashUSBCtrl.artistName property string albumname: dashUSBCtrl.albumName onVisibleChanged: { console.log("[Audio_QML_MAIN]### onVisibleChanged main_play_window.visible ===###"+main_play_window.visible) console.log("[Audio]### NOFILE!!!!!!!!!!!1"); } Item { x:comX y:comY Image{ id:bgAll width: 800 height: 350 source: "../../images/Common/Background/Media_BG.png" anchors.top:main_play_window.top anchors.left: main_play_window.left } Image{ id:imgUsbDevice x:36 y:7 source:"../../images/Type_E_Audio/Media_Playing/Media_icon_USB.png" } HMILabel{ id: usbName color: "#FFFFFF" text: " " font.pixelSize:20 horizontalAlignment: Label.AlignLeft anchors.left:imgUsbDevice.right anchors.leftMargin: 8 elide: Label.ElideRight width:440 height: 30 anchors.verticalCenter: imgUsbDevice.verticalCenter } Image { id: imgAlbumWhiteBg anchors.top: imgUsbDevice.bottom anchors.topMargin: 31 x:imgUsbDevice.x + 15 width:221;height: 230 source:"../../images/Type_E_Audio/Media_Playing/Media_Album_cover_Transparent.png" } Image { id: imgAlbum anchors.top: imgUsbDevice.bottom anchors.topMargin: 31 x:imgUsbDevice.x + 15 width:221;height: 230 fillMode: Image.PreserveAspectFit source: { if(coverpath === "") { imgAlbum.source = "../../images/Type_E_Audio/Media_Playing/Media_Album_cover_default.png" } else { imgAlbum.source = coverpath } } } Image { id: imgAlbumBg anchors.top: imgUsbDevice.bottom anchors.topMargin: 25 // anchors.left: bgAll.left // anchors.leftMargin: 33 x:imgUsbDevice.x width:344;height: 244 source: { source="../../images/Type_E_Audio/Media_Playing/Media_Album cover.png" } } HMILabel { id: current_play_song anchors.top: imgAlbum.top anchors.topMargin: 5 x:405 wrapMode: Label.NoWrap horizontalAlignment: Label.AlignHCenter text: (songtitle==""?"Unknow":songtitle.substring(0,songtitle.length - 4))//(usb_scanstatus == StatusList.USB_SCAN_START)?usb_songfilename:"Song Name" color: "#FFFFFF" width:300 height: 40 font.pixelSize: 30 elide: Label.ElideRight onTextChanged: { if(current_play_song.width <= contentWidth) { current_play_song.horizontalAlignment = Label.AlignLeft } else { current_play_song.horizontalAlignment = Label.AlignHCenter } } } HMILabel { id: albumName text: (albumname==""?" ":albumname)//qsTr("Album Name") anchors.top: current_play_song.bottom anchors.topMargin: 10 x:405 font.pixelSize: 22 width:300 height: 30 horizontalAlignment: Label.AlignHCenter elide: Label.ElideRight onTextChanged: { if(albumName.width <= contentWidth) { albumName.horizontalAlignment = Label.AlignLeft } else { albumName.horizontalAlignment = Label.AlignHCenter } } } HMILabel{ id: artistName text: (artistname==""?" ":artistname)//qsTr("Artist Name") anchors.top: albumName.bottom anchors.topMargin: 10 x:405 horizontalAlignment: Label.AlignHCenter elide: Label.ElideRight font.pixelSize: 22 width:300 height: 30 onTextChanged: { if(artistName.width <= contentWidth) { artistName.horizontalAlignment = Label.AlignLeft } else { artistName.horizontalAlignment = Label.AlignHCenter } } } HMILabel{ id: play_time color: "#FFFFFF" text:(usb_ptime==""?"00:00:00":usb_ptime)//usb_ptime//qsTr("01:40") anchors.top: imgAlbum.bottom anchors.topMargin: 27 anchors.left: bgAll.left anchors.leftMargin: 80 // anchors.verticalCenter: btnPlayRepeat.verticalCenter font.pixelSize: 18 width:75//47 height: 20 horizontalAlignment: Label.AlignLeft visible: true } HMIProcessBarDrag { id:main_processbar anchors.verticalCenter:play_time.verticalCenter anchors.left: play_time.right anchors.leftMargin: 15 barBackgroundMiddlewidth:460//464-10 enterValue: usb_playbarscale * totalValue } HMILabel{ id: total_time color: "#FFFFFF" text: (usb_totaltime==""?"00:00:00":usb_totaltime)//"04:30"//usb_totaltime anchors.verticalCenter: play_time.verticalCenter anchors.left: main_processbar.right anchors.leftMargin: 15 horizontalAlignment: Label.AlignLeft font.pixelSize: 18 width:75//47 height: 20 } } Connections { target:dashUSBCtrl onPtimechange: { console.debug("onPtimechange = "+usbPtime) usb_ptime = usbPtime; usb_totaltime = usbTotaltime; usb_playbarscale = usbPlaybarscale } onArtistNameChange: { console.debug("onArtistNameChange = "+dashUSBCtrl.artistName) artistname = dashUSBCtrl.artistName; } onAlbumNameChange: { console.debug("onAlbumNameChange = "+dashUSBCtrl.albumName) albumname = dashUSBCtrl.albumName; } onFileNameChange: { console.debug("onFileNameChange = "+dashUSBCtrl.filename) songtitle = dashUSBCtrl.filename; } onCoverPathChange: { console.debug("onCoverPathChange = "+dashUSBCtrl.coverPath) coverpath = dashUSBCtrl.coverPath; if(coverpath === "") { imgAlbum.source = "../../images/Type_E_Audio/Media_Playing/Media_Album_cover_default.png" } else { imgAlbum.source = coverpath } } onSongInfoClr: { artistname = dashUSBCtrl.artistName; albumname = dashUSBCtrl.albumName; songtitle = dashUSBCtrl.filename; coverpath = dashUSBCtrl.coverPath; imgAlbum.source = "../../images/Type_E_Audio/Media_Playing/Media_Album_cover_default.png" } // onUsbDisconnect: // { // imgAlbum.source = "../images/Type_E_Audio/Media_Playing/Media_Album_cover_default.png" // ScreenManager.changeLayout(Layout.LT_CALL, Layout.USB, WindowsList.USB_NOCONNECTED) // } } }