├── DuDuPlayer ├── Controls │ ├── HeaderItem.qml │ ├── Themes.qrc │ ├── controls.pro │ ├── controls.pro.user │ ├── controls_plugin.cpp │ ├── controls_plugin.h │ ├── fnamespace.h │ ├── fusswindow.cpp │ ├── fusswindow.h │ ├── qmldir │ ├── theme │ │ ├── BusyIndicatorStyle.qml │ │ ├── ButtonStyle.qml │ │ ├── CalendarStyle.qml │ │ ├── CheckBoxStyle.qml │ │ ├── ComboBoxStyle.qml │ │ ├── GroupBoxStyle.qml │ │ ├── HeaderItem.qml │ │ ├── MenuStyle.qml │ │ ├── MyWindow.qml │ │ ├── ProgressBarStyle.qml │ │ ├── RadioButtonStyle.qml │ │ ├── ScrollViewStyle.qml │ │ ├── SliderStyle.qml │ │ ├── SpinBoxStyle.qml │ │ ├── StatusBarStyle.qml │ │ ├── SwitchStyle.qml │ │ ├── TabViewStyle.qml │ │ ├── TableViewStyle.qml │ │ ├── TextAreaStyle.qml │ │ ├── TextFieldStyle.qml │ │ ├── ToolBarStyle.qml │ │ └── ToolButtonStyle.qml │ └── win.ico ├── DuDuPlayer.pro ├── DuDuPlayer.pro.user ├── MainForm.ui.qml ├── README.md ├── code │ ├── app │ │ ├── localmusic │ │ │ ├── localmusic.cpp │ │ │ ├── localmusic.h │ │ │ ├── localmusicmodel.cpp │ │ │ └── localmusicmodel.h │ │ ├── onlinemusic │ │ │ ├── CAppOnlineMusic.cpp │ │ │ ├── CAppOnlineMusic.h │ │ │ ├── CModelOnlineMusicCollect.cpp │ │ │ ├── CModelOnlineMusicCollect.h │ │ │ ├── CModelOnlineMusicEmotion.cpp │ │ │ ├── CModelOnlineMusicEmotion.h │ │ │ ├── CModelOnlineMusicHistory.cpp │ │ │ ├── CModelOnlineMusicHistory.h │ │ │ ├── CModelOnlineMusicLanguage.cpp │ │ │ ├── CModelOnlineMusicLanguage.h │ │ │ ├── CModelOnlineMusicSearched.cpp │ │ │ ├── CModelOnlineMusicSearched.h │ │ │ ├── CModelOnlineMusicSence.cpp │ │ │ ├── CModelOnlineMusicSence.h │ │ │ ├── CModelOnlineMusicStyle.cpp │ │ │ ├── CModelOnlineMusicStyle.h │ │ │ ├── CModelOnlineMusicTopName.cpp │ │ │ ├── CModelOnlineMusicTopName.h │ │ │ ├── CModelOnlineMusicType.cpp │ │ │ ├── CModelOnlineMusicType.h │ │ │ ├── CModelOnlineMusicYears.cpp │ │ │ ├── CModelOnlineMusicYears.h │ │ │ ├── JConNetRspData.h │ │ │ ├── cnetworkmanager.cpp │ │ │ ├── cnetworkmanager.h │ │ │ ├── cnetworkonlineserver.cpp │ │ │ └── cnetworkonlineserver.h │ │ └── video │ │ │ ├── dudumediaplayer.cpp │ │ │ ├── dudumediaplayer.h │ │ │ └── 新建文本文档.txt │ ├── clogic.cpp │ ├── clogic.h │ ├── framework │ │ ├── CAppDataBase.cpp │ │ ├── CAppDataBase.h │ │ ├── JsonLite.h │ │ ├── TypeDefine.h │ │ ├── commondata.h │ │ ├── dudu.h │ │ ├── jsoncpp │ │ │ ├── CJSONUtils.cpp │ │ │ ├── CJSONUtils.h │ │ │ ├── json │ │ │ │ ├── assertions.h │ │ │ │ ├── autolink.h │ │ │ │ ├── config.h │ │ │ │ ├── features.h │ │ │ │ ├── forwards.h │ │ │ │ ├── json.h │ │ │ │ ├── reader.h │ │ │ │ ├── value.h │ │ │ │ ├── version.h │ │ │ │ └── writer.h │ │ │ └── src │ │ │ │ ├── json_batchallocator.h │ │ │ │ ├── json_internalarray.inl │ │ │ │ ├── json_internalmap.inl │ │ │ │ ├── json_reader.cpp │ │ │ │ ├── json_tool.h │ │ │ │ ├── json_value.cpp │ │ │ │ ├── json_valueiterator.inl │ │ │ │ └── json_writer.cpp │ │ ├── metadata.cpp │ │ ├── metadata.h │ │ └── qtdudu.h │ ├── logic │ │ ├── clogic.cpp │ │ └── clogic.h │ └── playlist │ │ ├── TreeItem.cpp │ │ ├── TreeItem.h │ │ ├── TreeModel.cpp │ │ └── TreeModel.h ├── images │ ├── 128cloud.png │ ├── 128download.png │ ├── 128gadget.png │ ├── 128music.png │ ├── 128radiotower.png │ ├── 128smartphone.png │ ├── 64last.png │ ├── 64next.png │ ├── 64pause.png │ ├── 64play.png │ ├── anchor-left.png │ ├── anchor-right.png │ ├── btn-delete.png │ ├── cancel.png │ ├── close.png │ ├── collect24.png │ ├── comment.png │ ├── default.png │ ├── download16.png │ ├── dudu-default.jpg │ ├── dudu.jpg │ ├── film16.png │ ├── game.png │ ├── icon-col-click.png │ ├── icon-col.png │ ├── icon-delete.png │ ├── icon-history-click.png │ ├── icon-history.png │ ├── icon-music.png │ ├── icon-net.png │ ├── icon-person-center-click.png │ ├── icon-person-center.png │ ├── icon-search.png │ ├── icon-singer22.png │ ├── icon-titlebar-person-default.png │ ├── icon-up.png │ ├── iconSearch.png │ ├── last-click.png │ ├── last.png │ ├── loop24.png │ ├── maximize.png │ ├── more16.png │ ├── music.png │ ├── music24.png │ ├── next--click.png │ ├── next.png │ ├── null.png │ ├── options.png │ ├── play-click.png │ ├── play.png │ ├── refresh.png │ ├── search-press.png │ ├── search.png │ ├── skin.png │ ├── sound-off.png │ ├── sound-on.png │ ├── stop-click.png │ └── stop.png ├── main.cpp ├── main.qml ├── qml.qrc ├── qml │ ├── Home.qml │ ├── LeftMain.qml │ ├── MusicMediaPlayerBar.qml │ ├── RightMain.qml │ ├── TitleBar.qml │ ├── common │ │ ├── ColorButton.qml │ │ ├── DuDuTabViewStyle.qml │ │ ├── FlatButton.qml │ │ ├── Function.js │ │ ├── KeyboardQWERTY.qml │ │ ├── KeyboardSymbol.qml │ │ ├── PicButton.qml │ │ ├── PlayProgressBar.qml │ │ └── TextButton.qml │ └── sub │ │ ├── LeftMainTitleBar.qml │ │ ├── LocalMusicList.qml │ │ ├── MusicMediaPlayerBar.qml │ │ ├── PageKTV.qml │ │ ├── PageList.qml │ │ ├── PageLive.qml │ │ ├── PageLyric.qml │ │ ├── PageMV.qml │ │ ├── PageOnlineMusic.qml │ │ ├── PageRadio.qml │ │ ├── PageSongList.qml │ │ ├── PlayProgressBar.qml │ │ ├── PopupSkin.qml │ │ ├── ProgressBar.qml │ │ ├── RightMainTitlebar.qml │ │ ├── TreeViewTest.qml │ │ ├── onlinemusic │ │ ├── BottomMusicControl.qml │ │ ├── OnlineMusic.qml │ │ ├── PageItem.qml │ │ ├── PagePersonalCenter.qml │ │ ├── PagePlay.qml │ │ ├── PageSearch.qml │ │ ├── PageSearchedList.qml │ │ ├── PageSingerList.qml │ │ ├── pageEmotion.qml │ │ ├── pageHot.qml │ │ ├── pageLanguage.qml │ │ ├── pageSence.qml │ │ ├── pageStyle.qml │ │ └── pageYears.qml │ │ └── video │ │ └── DuDuVideo.qml └── 设计图 │ ├── 主页.png │ └── 规格.txt └── README.md /DuDuPlayer/Controls/HeaderItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Controls.Private 1.0 4 | import QtQuick.Layouts 1.1 5 | 6 | Rectangle{ 7 | property color backGround: "transparent" 8 | property color borderColor: "#a0a0a0" 9 | property int borderWidth: 1 10 | property string title: "" 11 | 12 | anchors.fill: parent 13 | color: backGround 14 | border.color: borderColor 15 | border.width: borderWidth 16 | ColumnLayout{ 17 | anchors.fill: parent 18 | Rectangle{ 19 | Layout.fillWidth: true 20 | Layout.preferredHeight: 24 21 | height: 24 22 | color: "transparent" 23 | Text { 24 | anchors.verticalCenter: parent.verticalCenter 25 | anchors.left: parent.left 26 | anchors.leftMargin: 4 27 | verticalAlignment: Text.AlignVCenter 28 | text: title 29 | } 30 | } 31 | Rectangle{ 32 | Layout.fillWidth: true 33 | Layout.preferredHeight: 1 34 | height: 1 35 | color: borderColor 36 | } 37 | Rectangle{ 38 | Layout.fillHeight: true 39 | Layout.fillWidth: true 40 | color: "transparent" 41 | ContentItem{} 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/Themes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | theme/MyWindow.qml 4 | theme/ButtonStyle.qml 5 | theme/MenuStyle.qml 6 | theme/TextAreaStyle.qml 7 | theme/TextFieldStyle.qml 8 | theme/ComboBoxStyle.qml 9 | theme/GroupBoxStyle.qml 10 | theme/HeaderItem.qml 11 | theme/CheckBoxStyle.qml 12 | theme/RadioButtonStyle.qml 13 | theme/BusyIndicatorStyle.qml 14 | theme/CalendarStyle.qml 15 | theme/ProgressBarStyle.qml 16 | theme/ScrollViewStyle.qml 17 | theme/SliderStyle.qml 18 | theme/SpinBoxStyle.qml 19 | theme/StatusBarStyle.qml 20 | theme/SwitchStyle.qml 21 | theme/TableViewStyle.qml 22 | theme/TabViewStyle.qml 23 | theme/ToolBarStyle.qml 24 | theme/ToolButtonStyle.qml 25 | 26 | 27 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/controls.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = lib 2 | TARGET = Controls 3 | QT += qml quick widgets 4 | CONFIG += qt plugin 5 | 6 | TARGET = $$qtLibraryTarget($$TARGET) 7 | uri = XA.Controls 8 | 9 | # Input 10 | SOURCES += \ 11 | controls_plugin.cpp \ 12 | fusswindow.cpp 13 | 14 | HEADERS += \ 15 | controls_plugin.h \ 16 | fusswindow.h \ 17 | fnamespace.h 18 | 19 | OTHER_FILES = qmldir \ 20 | 21 | !equals(_PRO_FILE_PWD_, $$OUT_PWD) { 22 | copy_qmldir.target = $$OUT_PWD/qmldir 23 | copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir 24 | copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" 25 | QMAKE_EXTRA_TARGETS += copy_qmldir 26 | PRE_TARGETDEPS += $$copy_qmldir.target 27 | } 28 | 29 | qmldir.files = qmldir 30 | unix { 31 | installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /) 32 | qmldir.path = $$installPath 33 | target.path = $$installPath 34 | INSTALLS += target qmldir 35 | } 36 | 37 | RESOURCES += \ 38 | Themes.qrc 39 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/controls_plugin.cpp: -------------------------------------------------------------------------------- 1 | #include "controls_plugin.h" 2 | #include "fusswindow.h" 3 | 4 | #include 5 | 6 | void ControlsPlugin::registerTypes(const char *uri) 7 | { 8 | // @uri XA.Controls 9 | qmlRegisterType(uri, 1, 0, "FussWindow"); 10 | } 11 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/controls_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef CONTROLS_PLUGIN_H 2 | #define CONTROLS_PLUGIN_H 3 | 4 | #include 5 | 6 | class ControlsPlugin : public QQmlExtensionPlugin 7 | { 8 | Q_OBJECT 9 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") 10 | 11 | public: 12 | void registerTypes(const char *uri); 13 | }; 14 | 15 | #endif // CONTROLS_PLUGIN_H 16 | 17 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/fnamespace.h: -------------------------------------------------------------------------------- 1 | #ifndef FNAMESPACE_H 2 | #define FNAMESPACE_H 3 | 4 | #endif // FNAMESPACE_H 5 | 6 | namespace Fuss { 7 | //窗口区域,客户区、左上、上、右上、右、右下、下、左下、左、标题栏、按钮区域 8 | enum FussWindowArea 9 | { 10 | CustomerArea = 0, 11 | LeftTopResizeArea = 1, 12 | TopResizeArea = 2, 13 | RightTopResizeArea = 3, 14 | RightResizeArea = 4, 15 | RightBottomResizeArea = 5, 16 | BottomResizeArea = 6, 17 | LeftBottomResizeArea = 7, 18 | LeftResizeArea = 8, 19 | TitleBarArea = 9, 20 | ButtonArea = 10 21 | }; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/fusswindow.h: -------------------------------------------------------------------------------- 1 | #ifndef FUSSWINDOW_H 2 | #define FUSSWINDOW_H 3 | 4 | #include "fnamespace.h" 5 | #include 6 | #include 7 | 8 | class FussWindow : public QQuickView 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(int shadowThick READ shadowThick WRITE setShadowThick NOTIFY shadowThickChanged) 12 | Q_PROPERTY(QObject* layoutComponent READ layoutComponent WRITE setLayoutComponent NOTIFY layoutComponentChanged) 13 | Q_PROPERTY(bool showTitleMenu READ showTitleMenu WRITE setShowTitleMenu NOTIFY showTitleMenuChanged) 14 | Q_PROPERTY(bool showMaxButton READ showMaxButton WRITE setShowMaxButton NOTIFY showMaxButtonChanged) 15 | Q_PROPERTY(QObject* titleMenu READ titleMenu WRITE setTitleMenu NOTIFY titleMenuChanged) 16 | 17 | public: 18 | FussWindow(QQuickView *parent = 0); 19 | ~FussWindow(); 20 | 21 | protected: 22 | void mousePressEvent(QMouseEvent * event); 23 | void mouseMoveEvent(QMouseEvent * event); 24 | void mouseReleaseEvent(QMouseEvent * event); 25 | void mouseDoubleClickEvent(QMouseEvent * event); 26 | 27 | signals: 28 | void shadowThickChanged(); 29 | void layoutComponentChanged(); 30 | void showTitleMenuChanged(); 31 | void showMaxButtonChanged(); 32 | void titleMenuChanged(); 33 | 34 | public slots: 35 | int shadowThick(); 36 | void setShadowThick(int thick); 37 | 38 | QObject* layoutComponent(); 39 | void setLayoutComponent(QObject* layoutComponent); 40 | 41 | QObject* titleMenu(); 42 | void setTitleMenu(QObject* titleMenu); 43 | 44 | bool showTitleMenu(); 45 | void setShowTitleMenu(bool showTitleMenu); 46 | 47 | bool showMaxButton(); 48 | void setShowMaxButton(bool showMaxButton); 49 | 50 | private: 51 | QQuickItem * clientContent; 52 | QQuickItem * menuButton; 53 | QQuickItem * m_layoutComponent; 54 | QQuickItem * m_titleMenu; 55 | bool m_showTitleMenu = false; 56 | bool m_showMaxButton = true; 57 | 58 | int m_shadowThick = 5; 59 | int oldCursorScreenX; 60 | int oldCursorScreenY; 61 | bool beginMove; 62 | Qt::CursorShape getCursorType(int x,int y); 63 | bool beginResize; 64 | Fuss::FussWindowArea cursorInArea; 65 | 66 | }; 67 | 68 | #endif // FUSSWINDOW_H 69 | 70 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/qmldir: -------------------------------------------------------------------------------- 1 | module XA.Controls 2 | plugin Controls 3 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/BusyIndicatorStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | import QtQuick.Controls.Styles 1.2 44 | 45 | BusyIndicatorStyle { 46 | // indicator: Image { 47 | // visible: control.running 48 | // source: "spinner.png" 49 | // RotationAnimator on rotation { 50 | // running: control.running 51 | // loops: Animation.Infinite 52 | // duration: 2000 53 | // from: 0 ; to: 360 54 | // } 55 | // } 56 | } 57 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/ButtonStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Controls.Private 1.0 4 | 5 | Style { 6 | id: buttonstyle 7 | 8 | /*! The \l {QtQuick.Controls::}{Button} attached to this style. */ 9 | readonly property Button control: __control 10 | 11 | /*! The padding between the background and the label components. */ 12 | padding { 13 | top: 4 14 | left: 8 15 | right: control.menu !== null ? Math.round(TextSingleton.implicitHeight * 0.5) : 8 16 | bottom: 4 17 | } 18 | 19 | /*! This defines the background of the button. */ 20 | property Component background: Item { 21 | property bool down: control.pressed || (control.checkable && control.checked) 22 | implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5) 23 | implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2)) 24 | Rectangle { 25 | anchors.fill: parent 26 | border.width: control.activeFocus ? 2 : 1 27 | border.color: "#888" 28 | radius: TextSingleton.implicitHeight * 0.16 29 | gradient: Gradient { 30 | GradientStop { 31 | position: 0 ; 32 | color: { 33 | if(control.pressed) 34 | return "#f0f0f0"; 35 | return control.hovered ? "#fff" : "#f0f0f0"; 36 | } 37 | } 38 | GradientStop { 39 | position: 1 ; 40 | color: { 41 | if(control.pressed) 42 | return "#c0c0c0"; 43 | return control.hovered ? "#eee" : "#e0e0e0" 44 | } 45 | } 46 | } 47 | } 48 | Text { 49 | id: imageItem 50 | visible: control.menu !== null 51 | text:"▼" 52 | anchors.verticalCenter: parent.verticalCenter 53 | anchors.right: parent.right 54 | anchors.rightMargin: padding.right 55 | opacity: control.enabled ? 0.6 : 0.5 56 | color: (control.hovered||control.pressed) ? "#AAA" : "#BBB"; 57 | } 58 | } 59 | 60 | /*! This defines the label of the button. */ 61 | property Component label: Item { 62 | implicitWidth: row.implicitWidth 63 | implicitHeight: row.implicitHeight 64 | baselineOffset: row.y + text.y + text.baselineOffset 65 | Row { 66 | id: row 67 | anchors.centerIn: parent 68 | spacing: 2 69 | Image { 70 | source: control.iconSource 71 | anchors.verticalCenter: parent.verticalCenter 72 | } 73 | Text { 74 | id: text 75 | renderType: Text.NativeRendering 76 | anchors.verticalCenter: parent.verticalCenter 77 | text: control.text 78 | color: SystemPaletteSingleton.buttonText(control.enabled) 79 | } 80 | } 81 | } 82 | 83 | /*! \internal */ 84 | property Component panel: Item { 85 | anchors.fill: parent 86 | implicitWidth: Math.max(labelLoader.implicitWidth + padding.left + padding.right, backgroundLoader.implicitWidth) 87 | implicitHeight: Math.max(labelLoader.implicitHeight + padding.top + padding.bottom, backgroundLoader.implicitHeight) 88 | baselineOffset: labelLoader.item ? padding.top + labelLoader.item.baselineOffset : 0 89 | 90 | Loader { 91 | id: backgroundLoader 92 | anchors.fill: parent 93 | sourceComponent: background 94 | } 95 | 96 | Loader { 97 | id: labelLoader 98 | sourceComponent: label 99 | anchors.fill: parent 100 | anchors.leftMargin: padding.left 101 | anchors.topMargin: padding.top 102 | anchors.rightMargin: padding.right 103 | anchors.bottomMargin: padding.bottom 104 | } 105 | } 106 | 107 | 108 | } 109 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/GroupBoxStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | import QtQuick.Layouts 1.1 44 | 45 | /*! 46 | \qmltype GroupBoxStyle 47 | \internal 48 | \inqmlmodule QtQuick.Controls.Styles 49 | \ingroup controlsstyling 50 | \since 5.1 51 | */ 52 | Style { 53 | 54 | /*! The \l GroupBox attached to this style. */ 55 | readonly property GroupBox control: __control 56 | 57 | /*! The margin from the content item to the groupbox. */ 58 | padding { 59 | top: 36 60 | left: 6 61 | right: 6 62 | bottom: 6 63 | } 64 | 65 | /*! The title text color. */ 66 | property color textColor: SystemPaletteSingleton.text(control.enabled) 67 | 68 | /*! The groupbox frame. */ 69 | property Component panel: Item { 70 | anchors.fill: parent 71 | 72 | Rectangle{ 73 | anchors.fill: parent 74 | color: "transparent" 75 | border.color: "#a0a0a0" 76 | border.width: 1 77 | ColumnLayout{ 78 | anchors.fill: parent 79 | Rectangle{ 80 | Layout.fillWidth: true 81 | Layout.preferredHeight: 24 82 | height: 24 83 | color: "transparent" 84 | Text { 85 | anchors.verticalCenter: parent.verticalCenter 86 | anchors.verticalCenterOffset: 4 87 | anchors.left: parent.left 88 | anchors.leftMargin: 10 89 | verticalAlignment: Text.AlignVCenter 90 | text: control.title 91 | color: textColor 92 | } 93 | } 94 | Rectangle{ 95 | Layout.fillWidth: true 96 | Layout.preferredHeight: 1 97 | height: 1 98 | color: "#a0a0a0" 99 | } 100 | Rectangle{ 101 | Layout.fillHeight: true 102 | Layout.fillWidth: true 103 | color: "transparent" 104 | } 105 | } 106 | 107 | } 108 | 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/HeaderItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Layouts 1.1 4 | 5 | Rectangle{ 6 | id:layout 7 | property color backGroundColor: "transparent" 8 | property color borderColor: "#a0a0a0" 9 | property int borderWidth: 1 10 | property string title: "" 11 | property Component content 12 | 13 | color: backGroundColor 14 | border.color: borderColor 15 | border.width: borderWidth 16 | 17 | implicitHeight: 25+contentLoader.height+8+borderWidth*2 18 | implicitWidth: contentLoader.width+8+borderWidth*2 19 | ColumnLayout{ 20 | anchors.fill: parent 21 | spacing: 0 22 | Rectangle{ 23 | Layout.fillWidth: true 24 | Layout.preferredHeight: 24 25 | height: 24 26 | color: "transparent" 27 | Text { 28 | anchors.verticalCenter: parent.verticalCenter 29 | anchors.left: parent.left 30 | anchors.leftMargin: 4 31 | verticalAlignment: Text.AlignVCenter 32 | text: title 33 | } 34 | } 35 | Rectangle{ 36 | Layout.fillWidth: true 37 | Layout.preferredHeight: 1 38 | height: 1 39 | color: borderColor 40 | } 41 | Rectangle{ 42 | id:contentRectangle 43 | Layout.fillHeight: true 44 | Layout.fillWidth: true 45 | color: "transparent" 46 | Loader{ 47 | id:contentLoader 48 | anchors.margins: 4 49 | anchors.centerIn: parent 50 | sourceComponent: content 51 | } 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/ProgressBarStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Controls.Private 1.0 4 | import QtQuick.Controls.Styles 1.2 5 | 6 | ProgressBarStyle { 7 | background: Rectangle { 8 | radius: 2 9 | gradient: Gradient { 10 | GradientStop {color: "#bbb" ; position: 0} 11 | GradientStop {color: "#eee" ; position: 0.1} 12 | GradientStop {color: "#eee" ; position: 1} 13 | } 14 | border.color: "gray" 15 | border.width: 1 16 | implicitWidth: 200 17 | implicitHeight: 24 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/ScrollViewStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Controls.Private 1.0 4 | import QtQuick.Controls.Styles 1.2 5 | 6 | ScrollViewStyle{ 7 | 8 | } 9 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/SpinBoxStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | import QtQuick.Controls.Styles 1.2 44 | 45 | SpinBoxStyle{ 46 | // background: Rectangle { 47 | // implicitWidth: 100 48 | // implicitHeight: 20 49 | // border.color: "gray" 50 | // radius: 2 51 | // } 52 | } 53 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/StatusBarStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | 44 | /*! 45 | \qmltype StatusBarStyle 46 | \inqmlmodule QtQuick.Controls.Styles 47 | \ingroup controlsstyling 48 | \since 5.2 49 | \brief Provides custom styling for StatusBar 50 | 51 | The status bar can be defined by overriding the background component and 52 | setting the content padding. 53 | 54 | Example: 55 | \qml 56 | StatusBar { 57 | style: StatusBarStyle { 58 | padding { 59 | left: 8 60 | right: 8 61 | top: 3 62 | bottom: 3 63 | } 64 | background: Rectangle { 65 | implicitHeight: 16 66 | implicitWidth: 200 67 | gradient: Gradient{ 68 | GradientStop{color: "#eee" ; position: 0} 69 | GradientStop{color: "#ccc" ; position: 1} 70 | } 71 | Rectangle { 72 | anchors.top: parent.top 73 | width: parent.width 74 | height: 1 75 | color: "#999" 76 | } 77 | } 78 | } 79 | } 80 | \endqml 81 | */ 82 | 83 | Style { 84 | 85 | /*! The content padding inside the status bar. */ 86 | padding { 87 | left: 3 88 | right: 3 89 | top: 3 90 | bottom: 2 91 | } 92 | 93 | /*! This defines the background of the tool bar. */ 94 | property Component background: Rectangle { 95 | implicitHeight: 16 96 | implicitWidth: 200 97 | 98 | gradient: Gradient{ 99 | GradientStop{color: "#eee" ; position: 0} 100 | GradientStop{color: "#ccc" ; position: 1} 101 | } 102 | 103 | Rectangle { 104 | anchors.top: parent.top 105 | width: parent.width 106 | height: 1 107 | color: "#999" 108 | } 109 | } 110 | 111 | property Component panel: Loader { 112 | sourceComponent: background 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/TabViewStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | import QtQuick.Controls.Styles 1.2 44 | 45 | TabViewStyle { 46 | } 47 | 48 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/TableViewStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.2 3 | import QtQuick.Controls.Private 1.0 4 | 5 | /*! 6 | \qmltype TableViewStyle 7 | \inqmlmodule QtQuick.Controls.Styles 8 | \since 5.1 9 | \ingroup viewsstyling 10 | \brief Provides custom styling for TableView 11 | 12 | \note This class derives from \l {QtQuick.Controls.Styles::}{ScrollViewStyle} 13 | and supports all of the properties defined there. 14 | */ 15 | ScrollViewStyle { 16 | id: root 17 | 18 | /*! The \l TableView attached to this style. */ 19 | readonly property TableView control: __control 20 | 21 | /*! The text color. */ 22 | property color textColor: SystemPaletteSingleton.text(control.enabled) 23 | 24 | /*! The background color. */ 25 | property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" 26 | 27 | /*! The alternate background color. */ 28 | property color alternateBackgroundColor: "#f5f5f5" 29 | 30 | /*! The text highlight color, used within selections. */ 31 | property color highlightedTextColor: "white" 32 | 33 | /*! Activates items on single click. */ 34 | property bool activateItemOnSingleClick: false 35 | 36 | padding.top: control.headerVisible ? 0 : 1 37 | 38 | /*! \qmlproperty Component TableViewStyle::headerDelegate 39 | Delegate for header. This delegate is described in \l {TableView::headerDelegate} 40 | */ 41 | property Component headerDelegate: Rectangle { 42 | height:Math.max(24, textItem.implicitHeight * 1.2) 43 | border.color: "#a0a0a0" 44 | border.width: 1 45 | gradient: Gradient { 46 | GradientStop { 47 | position: 0 ; 48 | color:"#fff" 49 | } 50 | GradientStop { 51 | position: 1 ; 52 | color:"#eee" 53 | } 54 | } 55 | Text { 56 | id: textItem 57 | anchors.fill: parent 58 | verticalAlignment: Text.AlignVCenter 59 | horizontalAlignment: styleData.textAlignment 60 | anchors.leftMargin: 12 61 | text: styleData.value 62 | elide: Text.ElideRight 63 | color: textColor 64 | renderType: Text.NativeRendering 65 | } 66 | Rectangle { 67 | anchors.right: parent.right 68 | anchors.top: parent.top 69 | anchors.bottom: parent.bottom 70 | anchors.bottomMargin: 1 71 | anchors.topMargin: 1 72 | width: 1 73 | color: "#ccc" 74 | } 75 | } 76 | 77 | /*! \qmlproperty Component TableViewStyle::rowDelegate 78 | Delegate for row. This delegate is described in \l {TableView::rowDelegate} 79 | */ 80 | property Component rowDelegate: Rectangle { 81 | height: Math.max(24,Math.round(TextSingleton.implicitHeight * 1.2)) 82 | property color selectedColor: styleData.hasActiveFocus ? "#ff00a0e9" : "#999" 83 | color: styleData.selected ? selectedColor : 84 | !styleData.alternate ? alternateBackgroundColor : backgroundColor 85 | } 86 | 87 | /*! \qmlproperty Component TableViewStyle::itemDelegate 88 | Delegate for item. This delegate is described in \l {TableView::itemDelegate} 89 | */ 90 | property Component itemDelegate: Item { 91 | height: Math.max(24, label.implicitHeight) 92 | property int implicitWidth: label.implicitWidth + 20 93 | 94 | Text { 95 | id: label 96 | objectName: "label" 97 | width: parent.width 98 | anchors.leftMargin: 12 99 | anchors.left: parent.left 100 | anchors.right: parent.right 101 | horizontalAlignment: styleData.textAlignment 102 | anchors.verticalCenter: parent.verticalCenter 103 | anchors.verticalCenterOffset: 1 104 | elide: styleData.elideMode 105 | text: styleData.value !== undefined ? styleData.value : "" 106 | color: styleData.textColor 107 | renderType: Text.NativeRendering 108 | } 109 | } 110 | } 111 | 112 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/TextAreaStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | import QtQuick.Controls.Styles 1.2 44 | 45 | /*! 46 | \qmltype TextAreaStyle 47 | \inqmlmodule QtQuick.Controls.Styles 48 | \since 5.2 49 | \ingroup controlsstyling 50 | \brief Provides custom styling for TextArea. 51 | 52 | Example: 53 | \qml 54 | TextArea { 55 | style: TextAreaStyle { 56 | textColor: "#333" 57 | selectionColor: "steelblue" 58 | selectedTextColor: "#eee" 59 | backgroundColor: "#eee" 60 | } 61 | } 62 | \endqml 63 | */ 64 | 65 | ScrollViewStyle { 66 | id: style 67 | 68 | /*! The \l TextArea attached to this style. */ 69 | readonly property TextArea control: __control 70 | 71 | /*! The current font. */ 72 | property font font 73 | 74 | /*! The text color. */ 75 | property color textColor: SystemPaletteSingleton.text(control.enabled) 76 | 77 | /*! The text highlight color, used behind selections. */ 78 | property color selectionColor: SystemPaletteSingleton.highlight(control.enabled) 79 | 80 | /*! The highlighted text color, used in selections. */ 81 | property color selectedTextColor: SystemPaletteSingleton.highlightedText(control.enabled) 82 | 83 | /*! The background color. */ 84 | property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" 85 | 86 | /*! 87 | \qmlproperty enumeration renderType 88 | 89 | Override the default rendering type for the control. 90 | 91 | Supported render types are: 92 | \list 93 | \li Text.QtRendering 94 | \li Text.NativeRendering - the default 95 | \endlist 96 | 97 | \sa Text::renderType 98 | */ 99 | property int renderType: Text.NativeRendering 100 | } 101 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/ToolBarStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | 44 | /*! 45 | \qmltype ToolBarStyle 46 | \inqmlmodule QtQuick.Controls.Styles 47 | \ingroup controlsstyling 48 | \since 5.2 49 | \brief Provides custom styling for ToolBar 50 | 51 | The tool bar can be defined by overriding the background component and 52 | setting the content padding. 53 | 54 | Example: 55 | \qml 56 | ToolBar { 57 | style: ToolBarStyle { 58 | padding { 59 | left: 8 60 | right: 8 61 | top: 3 62 | bottom: 3 63 | } 64 | background: Rectangle { 65 | implicitWidth: 100 66 | implicitHeight: 40 67 | border.color: "#999" 68 | gradient: Gradient { 69 | GradientStop { position: 0 ; color: "#fff" } 70 | GradientStop { position: 1 ; color: "#eee" } 71 | } 72 | } 73 | } 74 | } 75 | \endqml 76 | */ 77 | 78 | Style { 79 | 80 | /*! The content padding inside the tool bar. */ 81 | padding { 82 | left: 6 83 | right: 6 84 | top: 3 85 | bottom: 3 86 | } 87 | 88 | /*! This defines the background of the tool bar. */ 89 | property Component background: Item { 90 | implicitHeight: 40 91 | implicitWidth: 200 92 | Rectangle { 93 | anchors.fill: parent 94 | gradient: Gradient{ 95 | GradientStop{color: "#eee" ; position: 0} 96 | GradientStop{color: "#ccc" ; position: 1} 97 | } 98 | Rectangle { 99 | anchors.bottom: parent.bottom 100 | width: parent.width 101 | height: 1 102 | color: "#999" 103 | } 104 | } 105 | } 106 | 107 | property Component panel: Loader { 108 | sourceComponent: background 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/theme/ToolButtonStyle.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). 4 | ** Contact: http://www.qt-project.org/legal 5 | ** 6 | ** This file is part of the Qt Quick Controls module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:BSD$ 9 | ** You may use this file under the terms of the BSD license as follows: 10 | ** 11 | ** "Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are 13 | ** met: 14 | ** * Redistributions of source code must retain the above copyright 15 | ** notice, this list of conditions and the following disclaimer. 16 | ** * Redistributions in binary form must reproduce the above copyright 17 | ** notice, this list of conditions and the following disclaimer in 18 | ** the documentation and/or other materials provided with the 19 | ** distribution. 20 | ** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names 21 | ** of its contributors may be used to endorse or promote products derived 22 | ** from this software without specific prior written permission. 23 | ** 24 | ** 25 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." 36 | ** 37 | ** $QT_END_LICENSE$ 38 | ** 39 | ****************************************************************************/ 40 | import QtQuick 2.2 41 | import QtQuick.Controls 1.2 42 | import QtQuick.Controls.Private 1.0 43 | 44 | /*! 45 | \qmltype ToolButtonStyle 46 | \internal 47 | \ingroup controlsstyling 48 | \inqmlmodule QtQuick.Controls.Styles 49 | */ 50 | Style { 51 | readonly property ToolButton control: __control 52 | property Component panel: Item { 53 | id: styleitem 54 | implicitWidth: (hasIcon ? icon.width : Math.max(label.implicitWidth + frame.border.left + frame.border.right, 36)) 55 | + (arrow.visible ? 10 : 0) 56 | implicitHeight: hasIcon ? icon.height : Math.max(label.implicitHeight, 36) 57 | 58 | readonly property bool hasIcon: icon.status === Image.Ready || icon.status === Image.Loading 59 | 60 | Rectangle { 61 | anchors.fill: parent 62 | visible: control.pressed || (control.checkable && control.checked) 63 | color: "lightgray" 64 | radius:4 65 | border.color: "#aaa" 66 | } 67 | Item { 68 | anchors.left: parent.left 69 | anchors.right: arrow.left 70 | anchors.top: parent.top 71 | anchors.bottom: parent.bottom 72 | clip: true 73 | Text { 74 | id: label 75 | visible: !hasIcon 76 | anchors.centerIn: parent 77 | text: control.text 78 | } 79 | Image { 80 | id: icon 81 | anchors.centerIn: parent 82 | source: control.iconSource 83 | } 84 | } 85 | 86 | BorderImage { 87 | id: frame 88 | anchors.fill: parent 89 | anchors.margins: -1 90 | anchors.topMargin: -2 91 | anchors.rightMargin: 0 92 | source: "images/focusframe.png" 93 | visible: control.activeFocus 94 | border.left: 4 95 | border.right: 4 96 | border.top: 4 97 | border.bottom: 4 98 | } 99 | 100 | Image { 101 | id: arrow 102 | visible: control.menu !== null 103 | source: visible ? "images/arrow-down.png" : "" 104 | anchors.verticalCenter: parent.verticalCenter 105 | anchors.right: parent.right 106 | anchors.rightMargin: visible ? 3 : 0 107 | opacity: control.enabled ? 0.7 : 0.5 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /DuDuPlayer/Controls/win.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/Controls/win.ico -------------------------------------------------------------------------------- /DuDuPlayer/DuDuPlayer.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick 4 | QT += core 5 | QT += sql 6 | QT += multimedia 7 | QT += widgets 8 | QT += 3drender 9 | 10 | CONFIG += c++11 11 | 12 | 13 | SOURCES += main.cpp \ 14 | code/playlist/TreeItem.cpp \ 15 | code/playlist/TreeModel.cpp \ 16 | code/framework/metadata.cpp \ 17 | code/logic/clogic.cpp \ 18 | code/app/localmusic/localmusic.cpp \ 19 | code/app/localmusic/localmusicmodel.cpp \ 20 | code/app/onlinemusic/CAppOnlineMusic.cpp \ 21 | code/app/onlinemusic/CModelOnlineMusicCollect.cpp \ 22 | code/app/onlinemusic/CModelOnlineMusicEmotion.cpp \ 23 | code/app/onlinemusic/CModelOnlineMusicHistory.cpp \ 24 | code/app/onlinemusic/CModelOnlineMusicLanguage.cpp \ 25 | code/app/onlinemusic/CModelOnlineMusicSearched.cpp \ 26 | code/app/onlinemusic/CModelOnlineMusicSence.cpp \ 27 | code/app/onlinemusic/CModelOnlineMusicStyle.cpp \ 28 | code/app/onlinemusic/CModelOnlineMusicTopName.cpp \ 29 | code/app/onlinemusic/CModelOnlineMusicType.cpp \ 30 | code/app/onlinemusic/CModelOnlineMusicYears.cpp \ 31 | code/app/onlinemusic/cnetworkmanager.cpp \ 32 | code/app/onlinemusic/cnetworkonlineserver.cpp \ 33 | code/framework/CAppDataBase.cpp \ 34 | code/framework/jsoncpp/CJSONUtils.cpp \ 35 | code/framework/jsoncpp/src/json_reader.cpp \ 36 | code/framework/jsoncpp/src/json_value.cpp \ 37 | code/framework/jsoncpp/src/json_writer.cpp \ 38 | code/app/video/dudumediaplayer.cpp 39 | 40 | RESOURCES += qml.qrc 41 | 42 | win32 { 43 | TARGET_PLATFORM = win32 44 | DEFINES += OS_WIN 45 | } 46 | qnx { 47 | } 48 | # Additional import path used to resolve QML modules in Qt Creator's code model 49 | QML_IMPORT_PATH = 50 | 51 | # Additional import path used to resolve QML modules just for Qt Quick Designer 52 | QML_DESIGNER_IMPORT_PATH = 53 | 54 | # The following define makes your compiler emit warnings if you use 55 | # any feature of Qt which as been marked deprecated (the exact warnings 56 | # depend on your compiler). Please consult the documentation of the 57 | # deprecated API in order to know how to port your code away from it. 58 | DEFINES += QT_DEPRECATED_WARNINGS 59 | 60 | # You can also make your code fail to compile if you use deprecated APIs. 61 | # In order to do so, uncomment the following line. 62 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 63 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 64 | 65 | # Default rules for deployment. 66 | qnx: target.path = /tmp/$${TARGET}/bin 67 | else: unix:!android: target.path = /opt/$${TARGET}/bin 68 | !isEmpty(target.path): INSTALLS += target 69 | 70 | HEADERS += \ 71 | code/playlist/TreeItem.h \ 72 | code/playlist/TreeModel.h \ 73 | code/framework/metadata.h \ 74 | code/framework/dudu.h \ 75 | code/framework/qtdudu.h \ 76 | code/framework/TypeDefine.h \ 77 | code/logic/clogic.h \ 78 | code/framework/commondata.h \ 79 | code/app/localmusic/localmusic.h \ 80 | code/app/localmusic/localmusicmodel.h \ 81 | code/app/onlinemusic/CAppOnlineMusic.h \ 82 | code/app/onlinemusic/CModelOnlineMusicCollect.h \ 83 | code/app/onlinemusic/CModelOnlineMusicEmotion.h \ 84 | code/app/onlinemusic/CModelOnlineMusicHistory.h \ 85 | code/app/onlinemusic/CModelOnlineMusicLanguage.h \ 86 | code/app/onlinemusic/CModelOnlineMusicSearched.h \ 87 | code/app/onlinemusic/CModelOnlineMusicSence.h \ 88 | code/app/onlinemusic/CModelOnlineMusicStyle.h \ 89 | code/app/onlinemusic/CModelOnlineMusicTopName.h \ 90 | code/app/onlinemusic/CModelOnlineMusicType.h \ 91 | code/app/onlinemusic/CModelOnlineMusicYears.h \ 92 | code/app/onlinemusic/cnetworkmanager.h \ 93 | code/app/onlinemusic/cnetworkonlineserver.h \ 94 | code/framework/CAppDataBase.h \ 95 | code/app/onlinemusic/JConNetRspData.h \ 96 | code/framework/JsonLite.h \ 97 | code/framework/jsoncpp/CJSONUtils.h \ 98 | code/framework/jsoncpp/src/json_batchallocator.h \ 99 | code/framework/jsoncpp/src/json_tool.h \ 100 | code/framework/jsoncpp/json/assertions.h \ 101 | code/framework/jsoncpp/json/autolink.h \ 102 | code/framework/jsoncpp/json/config.h \ 103 | code/framework/jsoncpp/json/features.h \ 104 | code/framework/jsoncpp/json/forwards.h \ 105 | code/framework/jsoncpp/json/json.h \ 106 | code/framework/jsoncpp/json/reader.h \ 107 | code/framework/jsoncpp/json/value.h \ 108 | code/framework/jsoncpp/json/version.h \ 109 | code/framework/jsoncpp/json/writer.h \ 110 | code/app/video/dudumediaplayer.h 111 | -------------------------------------------------------------------------------- /DuDuPlayer/MainForm.ui.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | 3 | Rectangle { 4 | property alias mouseArea: mouseArea 5 | property alias textEdit: textEdit 6 | 7 | width: 360 8 | height: 360 9 | 10 | MouseArea { 11 | id: mouseArea 12 | anchors.fill: parent 13 | } 14 | 15 | TextEdit { 16 | id: textEdit 17 | text: qsTr("Enter some text...") 18 | verticalAlignment: Text.AlignVCenter 19 | anchors.top: parent.top 20 | anchors.horizontalCenter: parent.horizontalCenter 21 | anchors.topMargin: 20 22 | Rectangle { 23 | anchors.fill: parent 24 | anchors.margins: -10 25 | color: "transparent" 26 | border.width: 1 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DuDuPlayer/README.md: -------------------------------------------------------------------------------- 1 | # DuDuPlayer 2 | create by qml 3 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/localmusic/localmusic.h: -------------------------------------------------------------------------------- 1 | #ifndef LOCALMUSIC_H 2 | #define LOCALMUSIC_H 3 | /*** 4 | * 音乐播放控制 C++ code 5 | */ 6 | #include 7 | #include 8 | #include "../../framework/dudu.h" 9 | namespace QTDUDU { 10 | #ifdef OS_WIN 11 | #define MUSIC_PATH "d:/KuGou" 12 | #define MUSIC_LYRIC_PATH "d:/KuGou/Lyric" 13 | #elif 14 | #define MUSIC_PATH "/fs/mmc1/appdata/HMI/" 15 | #endif 16 | 17 | class LocalMusic : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | Q_PROPERTY(int nplayIndex MEMBER m_nPlayIndex NOTIFY nplayIndexChanged) 22 | Q_PROPERTY(QStringList lyrics MEMBER m_lstLyric NOTIFY lyricsChanged) 23 | Q_PROPERTY(QStringList times MEMBER m_lstTime NOTIFY timeChanged) 24 | public: 25 | Q_INVOKABLE void getMusicData(); 26 | Q_INVOKABLE void playMusic(int nIndex); 27 | Q_INVOKABLE void pauseMusic(); 28 | Q_INVOKABLE void nextMusic(); 29 | Q_INVOKABLE void lastMusic(); 30 | Q_INVOKABLE void setPlayPosition(int nPosition); 31 | Q_INVOKABLE int getIndexByTime(int mmTime); // 传入参数为时间,单位是毫秒 32 | protected: 33 | LocalMusic(QObject *parent = 0); 34 | ~LocalMusic(); 35 | private: 36 | 37 | // 读取本地音频文件--所有歌曲路径 38 | bool readMusic(QString strPath, QString strFormat); 39 | 40 | // ***歌词相关*** 41 | /* krc codec 42 | const int Keys[16] = {64, 71, 97, 119, 94, 50, 116, 71, 81, 54, 49, 45, 206, 210, 110, 105}; 43 | 44 | typedef int CONVERT_CODE; 45 | 46 | #define CONVERT_SUCCESS 0x00 47 | #define CONVERT_FILE_EMPTY 0x01 48 | #define CONVERT_PARA_ERR 0x02 49 | #define CONVERT_FORMAT_ERR 0x03 50 | #define CONVERT_UNKNOWN 0x04 51 | */ 52 | // UTF-8编码检测 53 | bool IsUTF8(const void* pBuffer, long size); 54 | // 破解krc文件 55 | //CONVERT_CODE KrcDecode(QFile &KrcFile, QFile &LrcFile); 56 | // 加载歌词文件 57 | void loadLyricFile(QString strFileName); 58 | private: 59 | int m_nPlayIndex; 60 | // ***歌词相关*** 61 | // 歌词对应的时间戳 62 | QStringList m_lstTime; 63 | // 歌词 64 | QStringList m_lstLyric; 65 | // 歌词路径 66 | QString m_strlyricPath; 67 | public: 68 | static LocalMusic *getInstance(); 69 | void deleteInstance(); 70 | void getQMLMediaPlayer(); 71 | void play(QString strSongPath); 72 | private: 73 | static LocalMusic* m_pInstance; 74 | private: 75 | QVector m_lstMusicInfo; 76 | QMediaPlayer* m_pAudioPlayer; 77 | 78 | signals: 79 | 80 | void nplayIndexChanged(); 81 | void lyricsChanged(); 82 | void timeChanged(); 83 | 84 | void sigForUpdateLocalMusicData(const QVector& data); 85 | void sigQMLPlay(QString strSongName, QString strSongPath, QString strSingerPic, int nIndex); 86 | void sigQMLPause(); 87 | void sigQMLPlayIndexChanged(int nIndex); 88 | void sigQMLPositionChanged(long position); 89 | void sigQMLDurationChanged(long duration); 90 | 91 | public slots: 92 | void positionChanged(qint64 position); 93 | void durationChanged(qint64 duration); 94 | }; 95 | 96 | } 97 | 98 | #endif // LOCALMUSIC_H 99 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/localmusic/localmusicmodel.cpp: -------------------------------------------------------------------------------- 1 | #include "localmusicmodel.h" 2 | #include "../../framework/dudu.h" 3 | namespace QTDUDU { 4 | class LocalMusicModelPrivate 5 | { 6 | public: 7 | LocalMusicModelPrivate(LocalMusicModel* model): 8 | m_model(model) 9 | { 10 | m_roleNames.insert(Role_SongName, "songname"); 11 | m_roleNames.insert(Role_HasDownload, "hasDownload"); 12 | m_roleNames.insert(Role_HasMV, "hasMV"); 13 | m_roleNames.insert(Role_HasCollected, "hasCollected"); 14 | 15 | } 16 | 17 | enum { 18 | Role_SongName = Qt::UserRole + 1, 19 | Role_HasDownload, 20 | Role_HasMV, 21 | Role_HasCollected 22 | }; 23 | 24 | LocalMusicModel* m_model; 25 | QHash m_roleNames; 26 | QVector m_datas; 27 | }; 28 | 29 | LocalMusicModel::LocalMusicModel(QObject *parent) : 30 | QAbstractListModel(parent), 31 | m_dPtr(new LocalMusicModelPrivate(this)) 32 | { 33 | qRegisterMetaType>("QVector"); 34 | 35 | connect(LocalMusic::getInstance(), SIGNAL(sigForUpdateLocalMusicData(QVector)), 36 | this, SLOT(slotForLocalMusic(QVector))); 37 | } 38 | 39 | LocalMusicModel::~LocalMusicModel() 40 | { 41 | if (NULL != m_dPtr) { 42 | delete m_dPtr; 43 | m_dPtr = NULL; 44 | } 45 | } 46 | 47 | int LocalMusicModel::rowCount(const QModelIndex &parent) const 48 | { 49 | Q_UNUSED(parent) 50 | return m_dPtr->m_datas.size(); 51 | } 52 | 53 | QVariant LocalMusicModel::data(const QModelIndex &index, int role) const 54 | { 55 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 56 | { 57 | return QVariant(); 58 | } 59 | 60 | if (role == m_dPtr->Role_SongName) { 61 | return m_dPtr->m_datas.at(index.row()).strSongName; 62 | } 63 | return QVariant(); 64 | 65 | } 66 | 67 | QHash LocalMusicModel::roleNames() const 68 | { 69 | return m_dPtr->m_roleNames; 70 | } 71 | 72 | void LocalMusicModel::slotForLocalMusic(const QVector &data) 73 | { 74 | beginResetModel(); 75 | m_dPtr->m_datas = data; 76 | endResetModel(); 77 | 78 | qDebug()<<"slotForLocalMusic data size is : "<< data.size() ; 79 | } 80 | 81 | } 82 | 83 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/localmusic/localmusicmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef LOCALMUSICMODEL_H 2 | #define LOCALMUSICMODEL_H 3 | #include 4 | #include "../../framework/dudu.h" 5 | namespace QTDUDU { 6 | 7 | class LocalMusicModelPrivate; 8 | class LocalMusicModel : public QAbstractListModel 9 | { 10 | Q_OBJECT 11 | public: 12 | LocalMusicModel(QObject *parent = 0); 13 | ~LocalMusicModel(); 14 | 15 | int rowCount(const QModelIndex& parent) const; 16 | 17 | QVariant data(const QModelIndex& index, int role) const; 18 | 19 | QHash roleNames() const; 20 | private: 21 | LocalMusicModelPrivate* m_dPtr; 22 | 23 | public slots: 24 | void slotForLocalMusic(const QVector& data); 25 | }; 26 | } 27 | #endif // LOCALMUSICMODEL_H 28 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicCollect.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicCollect.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicCollectPrivate 6 | { 7 | public: 8 | CModelOnlineMusicCollectPrivate(CModelOnlineMusicCollect* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_SongName, "songname"); 12 | m_roleNames.insert(Role_SingerName, "singername"); 13 | m_roleNames.insert(Role_SingerPicUrl, "singerpicurl"); 14 | m_roleNames.insert(Role_Score, "score"); 15 | m_roleNames.insert(Role_TopNo, "topno"); 16 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 17 | m_roleNames.insert(Role_CacheID, "cacheId"); 18 | m_roleNames.insert(Role_LyricUrl, "lyriUrl"); 19 | m_roleNames.insert(Role_PlayUrl, "playUrl"); 20 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 21 | m_roleNames.insert(Role_SongId, "songId"); 22 | m_roleNames.insert(Role_SingerId, "singerId"); 23 | 24 | 25 | } 26 | 27 | enum { 28 | Role_SongName = Qt::UserRole + 1, 29 | Role_SingerName, 30 | Role_SingerPicUrl, 31 | Role_Score, 32 | Role_TopNo, 33 | Role_ExtraUrl, 34 | Role_CacheID, 35 | Role_LyricUrl, 36 | Role_PlayUrl, 37 | Role_SongId, 38 | Role_SingerId 39 | }; 40 | 41 | CModelOnlineMusicCollect* m_model; 42 | QHash m_roleNames; 43 | QVector m_datas; 44 | }; 45 | 46 | CModelOnlineMusicCollect::CModelOnlineMusicCollect(QObject *parent) : 47 | QAbstractListModel(parent), 48 | m_dPtr(new CModelOnlineMusicCollectPrivate(this)) 49 | { 50 | qRegisterMetaType>("QVector"); 51 | 52 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicCollectData(QVector)), 53 | this, SLOT(slotForOnlineMusicCollect(QVector))); 54 | } 55 | 56 | CModelOnlineMusicCollect::~CModelOnlineMusicCollect() 57 | { 58 | if (NULL != m_dPtr) { 59 | delete m_dPtr; 60 | m_dPtr = NULL; 61 | } 62 | } 63 | 64 | int CModelOnlineMusicCollect::rowCount(const QModelIndex &parent) const 65 | { 66 | Q_UNUSED(parent) 67 | return m_dPtr->m_datas.size(); 68 | } 69 | 70 | QVariant CModelOnlineMusicCollect::data(const QModelIndex &index, int role) const 71 | { 72 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 73 | { 74 | return QVariant(); 75 | } 76 | 77 | if (role == m_dPtr->Role_SongName) { 78 | return m_dPtr->m_datas.at(index.row()).strSongName; 79 | } 80 | else if (role == m_dPtr->Role_SingerName) { 81 | return m_dPtr->m_datas.at(index.row()).strSingerName; 82 | } 83 | else if (role == m_dPtr->Role_SingerPicUrl) { 84 | return m_dPtr->m_datas.at(index.row()).strSingerPicUrl; 85 | } 86 | else if (role == m_dPtr->Role_Score) { 87 | return m_dPtr->m_datas.at(index.row()).strScore; 88 | } 89 | else if (role == m_dPtr->Role_TopNo) { 90 | return m_dPtr->m_datas.at(index.row()).strTopNo; 91 | } 92 | else if (role == m_dPtr->Role_ExtraUrl) { 93 | return m_dPtr->m_datas.at(index.row()).strExtraUrl; 94 | } 95 | else if (role == m_dPtr->Role_CacheID) { 96 | return m_dPtr->m_datas.at(index.row()).strCacheID; 97 | } 98 | else if (role == m_dPtr->Role_LyricUrl) { 99 | return m_dPtr->m_datas.at(index.row()).strLyricUrl; 100 | } 101 | else if (role == m_dPtr->Role_PlayUrl) { 102 | return m_dPtr->m_datas.at(index.row()).strPlayUrl; 103 | } 104 | else if (role == m_dPtr->Role_SongId) { 105 | return m_dPtr->m_datas.at(index.row()).strSongID; 106 | } 107 | else if (role == m_dPtr->Role_SingerId) { 108 | return m_dPtr->m_datas.at(index.row()).strSingerID; 109 | } 110 | 111 | return QVariant(); 112 | 113 | } 114 | 115 | QHash CModelOnlineMusicCollect::roleNames() const 116 | { 117 | return m_dPtr->m_roleNames; 118 | } 119 | 120 | void CModelOnlineMusicCollect::slotForOnlineMusicCollect(const QVector &data) 121 | { 122 | beginResetModel(); 123 | m_dPtr->m_datas = data; 124 | endResetModel(); 125 | 126 | //qDebug()<<"slotForOnlineMusicCollect data size is : "<< data.size() ; 127 | } 128 | } 129 | 130 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicCollect.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICCOLLECT_H 2 | #define CMODELONLINEMUSICCOLLECT_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicCollectPrivate; 10 | class CModelOnlineMusicCollect : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicCollect(QObject *parent = 0); 15 | ~CModelOnlineMusicCollect(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicCollectPrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicCollect(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICCOLLECT_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicEmotion.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicEmotion.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicEmotionPrivate 6 | { 7 | public: 8 | CModelOnlineMusicEmotionPrivate(CModelOnlineMusicEmotion* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_Type, "type"); 12 | m_roleNames.insert(Role_Url, "picUrl"); 13 | } 14 | 15 | enum { 16 | Role_Type = Qt::UserRole + 1, 17 | Role_Url, 18 | }; 19 | 20 | CModelOnlineMusicEmotion* m_model; 21 | QHash m_roleNames; 22 | QVector m_datas; 23 | }; 24 | 25 | CModelOnlineMusicEmotion::CModelOnlineMusicEmotion(QObject *parent) : 26 | QAbstractListModel(parent), 27 | m_dPtr(new CModelOnlineMusicEmotionPrivate(this)) 28 | { 29 | qRegisterMetaType>("QVector"); 30 | 31 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicEmotionData(QVector)), 32 | this, SLOT(slotForOnlineMusicEmotion(QVector))); 33 | } 34 | 35 | CModelOnlineMusicEmotion::~CModelOnlineMusicEmotion() 36 | { 37 | if (NULL != m_dPtr) { 38 | delete m_dPtr; 39 | m_dPtr = NULL; 40 | } 41 | } 42 | 43 | int CModelOnlineMusicEmotion::rowCount(const QModelIndex &parent) const 44 | { 45 | Q_UNUSED(parent) 46 | return m_dPtr->m_datas.size(); 47 | } 48 | 49 | QVariant CModelOnlineMusicEmotion::data(const QModelIndex &index, int role) const 50 | { 51 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 52 | { 53 | return QVariant(); 54 | } 55 | 56 | if (role == m_dPtr->Role_Type) { 57 | return m_dPtr->m_datas.at(index.row()).strType; 58 | } 59 | else if (role == m_dPtr->Role_Url) { 60 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 61 | } 62 | 63 | return QVariant(); 64 | 65 | } 66 | 67 | QHash CModelOnlineMusicEmotion::roleNames() const 68 | { 69 | return m_dPtr->m_roleNames; 70 | } 71 | 72 | void CModelOnlineMusicEmotion::slotForOnlineMusicEmotion(const QVector &data) 73 | { 74 | beginResetModel(); 75 | m_dPtr->m_datas = data; 76 | endResetModel(); 77 | 78 | //qDebug()<<"slot For OnlineMusic Emotion data size is : "<< data.size() ; 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicEmotion.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICEMOTION_H 2 | #define CMODELONLINEMUSICEMOTION_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicEmotionPrivate; 10 | class CModelOnlineMusicEmotion : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicEmotion(QObject *parent = 0); 15 | ~CModelOnlineMusicEmotion(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicEmotionPrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicEmotion(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICEMOTION_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicHistory.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicHistory.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicHistoryPrivate 6 | { 7 | public: 8 | CModelOnlineMusicHistoryPrivate(CModelOnlineMusicHistory* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_SongName, "songname"); 12 | m_roleNames.insert(Role_SingerName, "singername"); 13 | m_roleNames.insert(Role_SingerPicUrl, "singerpicurl"); 14 | m_roleNames.insert(Role_Score, "score"); 15 | m_roleNames.insert(Role_TopNo, "topno"); 16 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 17 | m_roleNames.insert(Role_CacheID, "cacheId"); 18 | m_roleNames.insert(Role_LyricUrl, "lyriUrl"); 19 | m_roleNames.insert(Role_PlayUrl, "playUrl"); 20 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 21 | m_roleNames.insert(Role_SongId, "songId"); 22 | m_roleNames.insert(Role_SingerId, "singerId"); 23 | 24 | 25 | } 26 | 27 | enum { 28 | Role_SongName = Qt::UserRole + 1, 29 | Role_SingerName, 30 | Role_SingerPicUrl, 31 | Role_Score, 32 | Role_TopNo, 33 | Role_ExtraUrl, 34 | Role_CacheID, 35 | Role_LyricUrl, 36 | Role_PlayUrl, 37 | Role_SongId, 38 | Role_SingerId 39 | }; 40 | 41 | CModelOnlineMusicHistory* m_model; 42 | QHash m_roleNames; 43 | QVector m_datas; 44 | }; 45 | 46 | CModelOnlineMusicHistory::CModelOnlineMusicHistory(QObject *parent) : 47 | QAbstractListModel(parent), 48 | m_dPtr(new CModelOnlineMusicHistoryPrivate(this)) 49 | { 50 | qRegisterMetaType>("QVector"); 51 | 52 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicHistoryData(QVector)), 53 | this, SLOT(slotForOnlineMusicHistory(QVector))); 54 | } 55 | 56 | CModelOnlineMusicHistory::~CModelOnlineMusicHistory() 57 | { 58 | if (NULL != m_dPtr) { 59 | delete m_dPtr; 60 | m_dPtr = NULL; 61 | } 62 | } 63 | 64 | int CModelOnlineMusicHistory::rowCount(const QModelIndex &parent) const 65 | { 66 | Q_UNUSED(parent) 67 | return m_dPtr->m_datas.size(); 68 | } 69 | 70 | QVariant CModelOnlineMusicHistory::data(const QModelIndex &index, int role) const 71 | { 72 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 73 | { 74 | return QVariant(); 75 | } 76 | 77 | if (role == m_dPtr->Role_SongName) { 78 | return m_dPtr->m_datas.at(index.row()).strSongName; 79 | } 80 | else if (role == m_dPtr->Role_SingerName) { 81 | return m_dPtr->m_datas.at(index.row()).strSingerName; 82 | } 83 | else if (role == m_dPtr->Role_SingerPicUrl) { 84 | return m_dPtr->m_datas.at(index.row()).strSingerPicUrl; 85 | } 86 | else if (role == m_dPtr->Role_Score) { 87 | return m_dPtr->m_datas.at(index.row()).strScore; 88 | } 89 | else if (role == m_dPtr->Role_TopNo) { 90 | return m_dPtr->m_datas.at(index.row()).strTopNo; 91 | } 92 | else if (role == m_dPtr->Role_ExtraUrl) { 93 | return m_dPtr->m_datas.at(index.row()).strExtraUrl; 94 | } 95 | else if (role == m_dPtr->Role_CacheID) { 96 | return m_dPtr->m_datas.at(index.row()).strCacheID; 97 | } 98 | else if (role == m_dPtr->Role_LyricUrl) { 99 | return m_dPtr->m_datas.at(index.row()).strLyricUrl; 100 | } 101 | else if (role == m_dPtr->Role_PlayUrl) { 102 | return m_dPtr->m_datas.at(index.row()).strPlayUrl; 103 | } 104 | else if (role == m_dPtr->Role_SongId) { 105 | return m_dPtr->m_datas.at(index.row()).strSongID; 106 | } 107 | else if (role == m_dPtr->Role_SingerId) { 108 | return m_dPtr->m_datas.at(index.row()).strSingerID; 109 | } 110 | 111 | return QVariant(); 112 | 113 | } 114 | 115 | QHash CModelOnlineMusicHistory::roleNames() const 116 | { 117 | return m_dPtr->m_roleNames; 118 | } 119 | 120 | void CModelOnlineMusicHistory::slotForOnlineMusicHistory(const QVector &data) 121 | { 122 | beginResetModel(); 123 | m_dPtr->m_datas = data; 124 | endResetModel(); 125 | 126 | //qDebug()<<"slot For OnlineMusic TopName data size is : "<< data.size() ; 127 | } 128 | } 129 | 130 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicHistory.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICHISTORY_H 2 | #define CMODELONLINEMUSICHISTORY_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicHistoryPrivate; 10 | class CModelOnlineMusicHistory : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicHistory(QObject *parent = 0); 15 | ~CModelOnlineMusicHistory(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicHistoryPrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicHistory(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICHISTORY_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicLanguage.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicLanguage.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicLanguagePrivate 6 | { 7 | public: 8 | CModelOnlineMusicLanguagePrivate(CModelOnlineMusicLanguage* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_Type, "type"); 12 | m_roleNames.insert(Role_Url, "picUrl"); 13 | } 14 | 15 | enum { 16 | Role_Type = Qt::UserRole + 1, 17 | Role_Url, 18 | }; 19 | 20 | CModelOnlineMusicLanguage* m_model; 21 | QHash m_roleNames; 22 | QVector m_datas; 23 | }; 24 | 25 | 26 | CModelOnlineMusicLanguage::CModelOnlineMusicLanguage(QObject *parent) : 27 | QAbstractListModel(parent), 28 | m_dPtr(new CModelOnlineMusicLanguagePrivate(this)) 29 | { 30 | qRegisterMetaType>("QVector"); 31 | 32 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicLanguageData(QVector)), 33 | this, SLOT(slotForOnlineMusicLanguage(QVector))); 34 | } 35 | 36 | CModelOnlineMusicLanguage::~CModelOnlineMusicLanguage() 37 | { 38 | if (NULL != m_dPtr) { 39 | delete m_dPtr; 40 | m_dPtr = NULL; 41 | } 42 | } 43 | 44 | int CModelOnlineMusicLanguage::rowCount(const QModelIndex &parent) const 45 | { 46 | Q_UNUSED(parent) 47 | return m_dPtr->m_datas.size(); 48 | } 49 | 50 | QVariant CModelOnlineMusicLanguage::data(const QModelIndex &index, int role) const 51 | { 52 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 53 | { 54 | return QVariant(); 55 | } 56 | 57 | if (role == m_dPtr->Role_Type) { 58 | return m_dPtr->m_datas.at(index.row()).strType; 59 | } 60 | else if (role == m_dPtr->Role_Url) { 61 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 62 | } 63 | 64 | return QVariant(); 65 | 66 | } 67 | 68 | QHash CModelOnlineMusicLanguage::roleNames() const 69 | { 70 | return m_dPtr->m_roleNames; 71 | } 72 | 73 | void CModelOnlineMusicLanguage::slotForOnlineMusicLanguage(const QVector &data) 74 | { 75 | beginResetModel(); 76 | m_dPtr->m_datas = data; 77 | endResetModel(); 78 | 79 | //qDebug()<<"slot For OnlineMusic Language data size is : "<< data.size() ; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicLanguage.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICLANGUAGE_H 2 | #define CMODELONLINEMUSICLANGUAGE_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicLanguagePrivate; 10 | class CModelOnlineMusicLanguage : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicLanguage(QObject *parent = 0); 15 | ~CModelOnlineMusicLanguage(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicLanguagePrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicLanguage(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICLANGUAGE_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicSearched.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicSearched.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicSearchedPrivate 6 | { 7 | public: 8 | CModelOnlineMusicSearchedPrivate(CModelOnlineMusicSearched* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_SongName, "songname"); 12 | m_roleNames.insert(Role_SingerName, "singername"); 13 | m_roleNames.insert(Role_SingerPicUrl, "singerpicurl"); 14 | m_roleNames.insert(Role_Score, "score"); 15 | m_roleNames.insert(Role_TopNo, "topno"); 16 | 17 | } 18 | 19 | enum { 20 | Role_SongName = Qt::UserRole + 1, 21 | Role_SingerName, 22 | Role_SingerPicUrl, 23 | Role_Score, 24 | Role_TopNo, 25 | }; 26 | 27 | CModelOnlineMusicSearched* m_model; 28 | QHash m_roleNames; 29 | QVector m_datas; 30 | }; 31 | 32 | CModelOnlineMusicSearched::CModelOnlineMusicSearched(QObject *parent) : 33 | QAbstractListModel(parent), 34 | m_dPtr(new CModelOnlineMusicSearchedPrivate(this)) 35 | { 36 | qRegisterMetaType>("QVector"); 37 | 38 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicSearchedMusicData(QVector)), 39 | this, SLOT(slotForOnlineMusicSearched(QVector))); 40 | } 41 | 42 | CModelOnlineMusicSearched::~CModelOnlineMusicSearched() 43 | { 44 | if (NULL != m_dPtr) { 45 | delete m_dPtr; 46 | m_dPtr = NULL; 47 | } 48 | } 49 | 50 | int CModelOnlineMusicSearched::rowCount(const QModelIndex &parent) const 51 | { 52 | Q_UNUSED(parent) 53 | return m_dPtr->m_datas.size(); 54 | } 55 | 56 | QVariant CModelOnlineMusicSearched::data(const QModelIndex &index, int role) const 57 | { 58 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 59 | { 60 | return QVariant(); 61 | } 62 | 63 | if (role == m_dPtr->Role_SongName) { 64 | return m_dPtr->m_datas.at(index.row()).strSongName; 65 | } 66 | else if (role == m_dPtr->Role_SingerName) { 67 | return m_dPtr->m_datas.at(index.row()).strSingerName; 68 | } 69 | else if (role == m_dPtr->Role_SingerPicUrl) { 70 | return m_dPtr->m_datas.at(index.row()).strSingerPicUrl; 71 | } 72 | else if (role == m_dPtr->Role_Score) { 73 | return m_dPtr->m_datas.at(index.row()).strScore; 74 | } 75 | else if (role == m_dPtr->Role_TopNo) { 76 | return m_dPtr->m_datas.at(index.row()).strTopNo; 77 | } 78 | 79 | return QVariant(); 80 | 81 | } 82 | 83 | QHash CModelOnlineMusicSearched::roleNames() const 84 | { 85 | return m_dPtr->m_roleNames; 86 | } 87 | 88 | void CModelOnlineMusicSearched::slotForOnlineMusicSearched(const QVector &data) 89 | { 90 | beginResetModel(); 91 | m_dPtr->m_datas = data; 92 | endResetModel(); 93 | 94 | //qDebug()<<"slot For OnlineMusic Searched data size is : "<< data.size() ; 95 | } 96 | } 97 | 98 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicSearched.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICSEARCHED_H 2 | #define CMODELONLINEMUSICSEARCHED_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicSearchedPrivate; 10 | class CModelOnlineMusicSearched : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicSearched(QObject *parent = 0); 15 | ~CModelOnlineMusicSearched(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicSearchedPrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicSearched(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICSEARCHED_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicSence.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicSence.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicSencePrivate 6 | { 7 | public: 8 | CModelOnlineMusicSencePrivate(CModelOnlineMusicSence* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_Type, "type"); 12 | m_roleNames.insert(Role_Url, "picUrl"); 13 | } 14 | 15 | enum { 16 | Role_Type = Qt::UserRole + 1, 17 | Role_Url, 18 | }; 19 | 20 | CModelOnlineMusicSence* m_model; 21 | QHash m_roleNames; 22 | QVector m_datas; 23 | }; 24 | 25 | 26 | CModelOnlineMusicSence::CModelOnlineMusicSence(QObject *parent) : 27 | QAbstractListModel(parent), 28 | m_dPtr(new CModelOnlineMusicSencePrivate(this)) 29 | { 30 | qRegisterMetaType>("QVector"); 31 | 32 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicSenceData(QVector)), 33 | this, SLOT(slotForOnlineMusicSence(QVector))); 34 | } 35 | 36 | CModelOnlineMusicSence::~CModelOnlineMusicSence() 37 | { 38 | if (NULL != m_dPtr) { 39 | delete m_dPtr; 40 | m_dPtr = NULL; 41 | } 42 | } 43 | 44 | int CModelOnlineMusicSence::rowCount(const QModelIndex &parent) const 45 | { 46 | Q_UNUSED(parent) 47 | return m_dPtr->m_datas.size(); 48 | } 49 | 50 | QVariant CModelOnlineMusicSence::data(const QModelIndex &index, int role) const 51 | { 52 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 53 | { 54 | return QVariant(); 55 | } 56 | 57 | if (role == m_dPtr->Role_Type) { 58 | return m_dPtr->m_datas.at(index.row()).strType; 59 | } 60 | else if (role == m_dPtr->Role_Url) { 61 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 62 | } 63 | 64 | return QVariant(); 65 | 66 | } 67 | 68 | QHash CModelOnlineMusicSence::roleNames() const 69 | { 70 | return m_dPtr->m_roleNames; 71 | } 72 | 73 | void CModelOnlineMusicSence::slotForOnlineMusicSence(const QVector &data) 74 | { 75 | beginResetModel(); 76 | m_dPtr->m_datas = data; 77 | endResetModel(); 78 | 79 | //qDebug()<<"slot For OnlineMusic Sence data size is : "<< data.size() ; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicSence.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICSENCE_H 2 | #define CMODELONLINEMUSICSENCE_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicSencePrivate; 10 | class CModelOnlineMusicSence : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicSence(QObject *parent = 0); 15 | ~CModelOnlineMusicSence(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicSencePrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicSence(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICSENCE_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicStyle.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicStyle.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicStylePrivate 6 | { 7 | public: 8 | CModelOnlineMusicStylePrivate(CModelOnlineMusicStyle* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_Type, "type"); 12 | m_roleNames.insert(Role_Url, "picUrl"); 13 | } 14 | 15 | enum { 16 | Role_Type = Qt::UserRole + 1, 17 | Role_Url, 18 | }; 19 | 20 | CModelOnlineMusicStyle* m_model; 21 | QHash m_roleNames; 22 | QVector m_datas; 23 | }; 24 | 25 | 26 | CModelOnlineMusicStyle::CModelOnlineMusicStyle(QObject *parent) : 27 | QAbstractListModel(parent), 28 | m_dPtr(new CModelOnlineMusicStylePrivate(this)) 29 | { 30 | qRegisterMetaType>("QVector"); 31 | 32 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicStyleData(QVector)), 33 | this, SLOT(slotForOnlineMusicStyle(QVector))); 34 | } 35 | 36 | CModelOnlineMusicStyle::~CModelOnlineMusicStyle() 37 | { 38 | if (NULL != m_dPtr) { 39 | delete m_dPtr; 40 | m_dPtr = NULL; 41 | } 42 | } 43 | 44 | int CModelOnlineMusicStyle::rowCount(const QModelIndex &parent) const 45 | { 46 | Q_UNUSED(parent) 47 | return m_dPtr->m_datas.size(); 48 | } 49 | 50 | QVariant CModelOnlineMusicStyle::data(const QModelIndex &index, int role) const 51 | { 52 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 53 | { 54 | return QVariant(); 55 | } 56 | 57 | if (role == m_dPtr->Role_Type) { 58 | return m_dPtr->m_datas.at(index.row()).strType; 59 | } 60 | else if (role == m_dPtr->Role_Url) { 61 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 62 | } 63 | 64 | return QVariant(); 65 | 66 | } 67 | 68 | QHash CModelOnlineMusicStyle::roleNames() const 69 | { 70 | return m_dPtr->m_roleNames; 71 | } 72 | 73 | void CModelOnlineMusicStyle::slotForOnlineMusicStyle(const QVector &data) 74 | { 75 | beginResetModel(); 76 | m_dPtr->m_datas = data; 77 | endResetModel(); 78 | 79 | // qDebug()<<"slot For OnlineMusic Style data size is : "<< data.size() ; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicStyle.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICSTYLE_H 2 | #define CMODELONLINEMUSICSTYLE_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicStylePrivate; 10 | class CModelOnlineMusicStyle : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicStyle(QObject *parent = 0); 15 | ~CModelOnlineMusicStyle(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicStylePrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicStyle(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICSTYLE_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicTopName.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicTopName.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicTopNamePrivate 6 | { 7 | public: 8 | CModelOnlineMusicTopNamePrivate(CModelOnlineMusicTopName* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_SongName, "songname"); 12 | m_roleNames.insert(Role_SingerName, "singername"); 13 | m_roleNames.insert(Role_SingerPicUrl, "singerpicurl"); 14 | m_roleNames.insert(Role_Score, "score"); 15 | m_roleNames.insert(Role_TopNo, "topno"); 16 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 17 | m_roleNames.insert(Role_CacheID, "cacheId"); 18 | m_roleNames.insert(Role_LyricUrl, "lyriUrl"); 19 | m_roleNames.insert(Role_PlayUrl, "playUrl"); 20 | m_roleNames.insert(Role_ExtraUrl, "extralUrl"); 21 | m_roleNames.insert(Role_SongId, "songId"); 22 | m_roleNames.insert(Role_SingerId, "singerId"); 23 | 24 | 25 | } 26 | 27 | enum { 28 | Role_SongName = Qt::UserRole + 1, 29 | Role_SingerName, 30 | Role_SingerPicUrl, 31 | Role_Score, 32 | Role_TopNo, 33 | Role_ExtraUrl, 34 | Role_CacheID, 35 | Role_LyricUrl, 36 | Role_PlayUrl, 37 | Role_SongId, 38 | Role_SingerId 39 | }; 40 | 41 | CModelOnlineMusicTopName* m_model; 42 | QHash m_roleNames; 43 | QVector m_datas; 44 | }; 45 | 46 | CModelOnlineMusicTopName::CModelOnlineMusicTopName(QObject *parent) : 47 | QAbstractListModel(parent), 48 | m_dPtr(new CModelOnlineMusicTopNamePrivate(this)) 49 | { 50 | qRegisterMetaType>("QVector"); 51 | 52 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicTopnameMusicData(QVector)), 53 | this, SLOT(slotForOnlineMusicTopName(QVector))); 54 | } 55 | 56 | CModelOnlineMusicTopName::~CModelOnlineMusicTopName() 57 | { 58 | if (NULL != m_dPtr) { 59 | delete m_dPtr; 60 | m_dPtr = NULL; 61 | } 62 | } 63 | 64 | int CModelOnlineMusicTopName::rowCount(const QModelIndex &parent) const 65 | { 66 | Q_UNUSED(parent) 67 | return m_dPtr->m_datas.size(); 68 | } 69 | 70 | QVariant CModelOnlineMusicTopName::data(const QModelIndex &index, int role) const 71 | { 72 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 73 | { 74 | return QVariant(); 75 | } 76 | 77 | if (role == m_dPtr->Role_SongName) { 78 | return m_dPtr->m_datas.at(index.row()).strSongName; 79 | } 80 | else if (role == m_dPtr->Role_SingerName) { 81 | return m_dPtr->m_datas.at(index.row()).strSingerName; 82 | } 83 | else if (role == m_dPtr->Role_SingerPicUrl) { 84 | return m_dPtr->m_datas.at(index.row()).strSingerPicUrl; 85 | } 86 | else if (role == m_dPtr->Role_Score) { 87 | return m_dPtr->m_datas.at(index.row()).strScore; 88 | } 89 | else if (role == m_dPtr->Role_TopNo) { 90 | return m_dPtr->m_datas.at(index.row()).strTopNo; 91 | } 92 | else if (role == m_dPtr->Role_ExtraUrl) { 93 | return m_dPtr->m_datas.at(index.row()).strExtraUrl; 94 | } 95 | else if (role == m_dPtr->Role_CacheID) { 96 | return m_dPtr->m_datas.at(index.row()).strCacheID; 97 | } 98 | else if (role == m_dPtr->Role_LyricUrl) { 99 | return m_dPtr->m_datas.at(index.row()).strLyricUrl; 100 | } 101 | else if (role == m_dPtr->Role_PlayUrl) { 102 | return m_dPtr->m_datas.at(index.row()).strPlayUrl; 103 | } 104 | else if (role == m_dPtr->Role_SongId) { 105 | return m_dPtr->m_datas.at(index.row()).strSongID; 106 | } 107 | else if (role == m_dPtr->Role_SingerId) { 108 | return m_dPtr->m_datas.at(index.row()).strSingerID; 109 | } 110 | 111 | return QVariant(); 112 | 113 | } 114 | 115 | QHash CModelOnlineMusicTopName::roleNames() const 116 | { 117 | return m_dPtr->m_roleNames; 118 | } 119 | 120 | void CModelOnlineMusicTopName::slotForOnlineMusicTopName(const QVector &data) 121 | { 122 | beginResetModel(); 123 | m_dPtr->m_datas = data; 124 | endResetModel(); 125 | 126 | // qDebug()<<"slot For OnlineMusic TopName data size is : "<< data.size() ; 127 | } 128 | } 129 | 130 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicTopName.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICTOPNAME_H 2 | #define CMODELONLINEMUSICTOPNAME_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicTopNamePrivate; 10 | class CModelOnlineMusicTopName : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicTopName(QObject *parent = 0); 15 | ~CModelOnlineMusicTopName(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicTopNamePrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicTopName(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICTOPNAME_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicType.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicType.h" 2 | 3 | namespace QTDUDU { 4 | 5 | 6 | class CModelOnlineMusicTypePrivate 7 | { 8 | public: 9 | CModelOnlineMusicTypePrivate(CModelOnlineMusicType* model): 10 | m_model(model) 11 | { 12 | m_roleNames.insert(Role_Type, "type"); 13 | m_roleNames.insert(Role_Name, "name"); 14 | m_roleNames.insert(Role_Url, "url"); 15 | } 16 | 17 | enum { 18 | Role_Type = Qt::UserRole + 1, 19 | Role_Name, 20 | Role_Url, 21 | }; 22 | 23 | CModelOnlineMusicType* m_model; 24 | QHash m_roleNames; 25 | QVector m_datas; 26 | }; 27 | 28 | CModelOnlineMusicType::CModelOnlineMusicType(QObject *parent) : 29 | QAbstractListModel(parent), 30 | m_dPtr(new CModelOnlineMusicTypePrivate(this)) 31 | { 32 | qRegisterMetaType>("QVector"); 33 | 34 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicTopTypeData(QVector)), 35 | this, SLOT(slotForOnlineMusicType(QVector))); 36 | } 37 | 38 | CModelOnlineMusicType::~CModelOnlineMusicType() 39 | { 40 | if (NULL != m_dPtr) { 41 | delete m_dPtr; 42 | m_dPtr = NULL; 43 | } 44 | } 45 | 46 | int CModelOnlineMusicType::rowCount(const QModelIndex &parent) const 47 | { 48 | Q_UNUSED(parent) 49 | return m_dPtr->m_datas.size(); 50 | } 51 | 52 | QVariant CModelOnlineMusicType::data(const QModelIndex &index, int role) const 53 | { 54 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 55 | { 56 | return QVariant(); 57 | } 58 | 59 | if (role == m_dPtr->Role_Type) { 60 | return m_dPtr->m_datas.at(index.row()).strType; 61 | } 62 | else if (role == m_dPtr->Role_Name) { 63 | return m_dPtr->m_datas.at(index.row()).strName; 64 | } 65 | else if (role == m_dPtr->Role_Url) { 66 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 67 | } 68 | 69 | return QVariant(); 70 | } 71 | 72 | QHash CModelOnlineMusicType::roleNames() const 73 | { 74 | return m_dPtr->m_roleNames; 75 | } 76 | 77 | void CModelOnlineMusicType::slotForOnlineMusicType(const QVector &data) 78 | { 79 | //qDebug()<<"in slotForOnlineMusicType"; 80 | beginResetModel(); 81 | m_dPtr->m_datas = data; 82 | endResetModel(); 83 | //qDebug()<<"slot For OnlineMusic Type data size is : "<< data.size() ; 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicType.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICTYPE_H 2 | #define CMODELONLINEMUSICTYPE_H 3 | #include 4 | #include "../../framework/dudu.h" 5 | 6 | namespace QTDUDU { 7 | class CModelOnlineMusicTypePrivate; 8 | class CModelOnlineMusicType : public QAbstractListModel 9 | { 10 | Q_OBJECT 11 | public: 12 | CModelOnlineMusicType(QObject *parent = 0); 13 | ~CModelOnlineMusicType(); 14 | 15 | int rowCount(const QModelIndex& parent) const; 16 | 17 | QVariant data(const QModelIndex& index, int role) const; 18 | 19 | QHash roleNames() const; 20 | 21 | private: 22 | CModelOnlineMusicTypePrivate* m_dPtr; 23 | signals: 24 | 25 | public slots: 26 | void slotForOnlineMusicType(const QVector& data); 27 | 28 | }; 29 | 30 | } 31 | 32 | 33 | #endif // CMODELONLINEMUSICTYPE_H 34 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicYears.cpp: -------------------------------------------------------------------------------- 1 | #include "CModelOnlineMusicYears.h" 2 | 3 | namespace QTDUDU { 4 | 5 | class CModelOnlineMusicYearsPrivate 6 | { 7 | public: 8 | CModelOnlineMusicYearsPrivate(CModelOnlineMusicYears* model): 9 | m_model(model) 10 | { 11 | m_roleNames.insert(Role_Type, "type"); 12 | m_roleNames.insert(Role_Url, "picUrl"); 13 | } 14 | 15 | enum { 16 | Role_Type = Qt::UserRole + 1, 17 | Role_Url, 18 | }; 19 | 20 | CModelOnlineMusicYears* m_model; 21 | QHash m_roleNames; 22 | QVector m_datas; 23 | }; 24 | 25 | 26 | CModelOnlineMusicYears::CModelOnlineMusicYears(QObject *parent) : 27 | QAbstractListModel(parent), 28 | m_dPtr(new CModelOnlineMusicYearsPrivate(this)) 29 | { 30 | qRegisterMetaType>("QVector"); 31 | 32 | connect(CAppOnlineMusic::getInstance(), SIGNAL(sigForUpdateOnlineMusicYearsData(QVector)), 33 | this, SLOT(slotForOnlineMusicYears(QVector))); 34 | } 35 | 36 | CModelOnlineMusicYears::~CModelOnlineMusicYears() 37 | { 38 | if (NULL != m_dPtr) { 39 | delete m_dPtr; 40 | m_dPtr = NULL; 41 | } 42 | } 43 | 44 | int CModelOnlineMusicYears::rowCount(const QModelIndex &parent) const 45 | { 46 | Q_UNUSED(parent) 47 | return m_dPtr->m_datas.size(); 48 | } 49 | 50 | QVariant CModelOnlineMusicYears::data(const QModelIndex &index, int role) const 51 | { 52 | if (index.row() < 0 || index.row() >= m_dPtr->m_datas.count()) 53 | { 54 | return QVariant(); 55 | } 56 | 57 | if (role == m_dPtr->Role_Type) { 58 | return m_dPtr->m_datas.at(index.row()).strType; 59 | } 60 | else if (role == m_dPtr->Role_Url) { 61 | return m_dPtr->m_datas.at(index.row()).strPicUrl; 62 | } 63 | 64 | return QVariant(); 65 | 66 | } 67 | 68 | QHash CModelOnlineMusicYears::roleNames() const 69 | { 70 | return m_dPtr->m_roleNames; 71 | } 72 | 73 | void CModelOnlineMusicYears::slotForOnlineMusicYears(const QVector &data) 74 | { 75 | beginResetModel(); 76 | m_dPtr->m_datas = data; 77 | endResetModel(); 78 | 79 | //qDebug()<<"slot For OnlineMusic Years data size is : "<< data.size() ; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/CModelOnlineMusicYears.h: -------------------------------------------------------------------------------- 1 | #ifndef CMODELONLINEMUSICYEARS_H 2 | #define CMODELONLINEMUSICYEARS_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class CModelOnlineMusicYearsPrivate; 10 | class CModelOnlineMusicYears : public QAbstractListModel 11 | { 12 | Q_OBJECT 13 | public: 14 | CModelOnlineMusicYears(QObject *parent = 0); 15 | ~CModelOnlineMusicYears(); 16 | 17 | int rowCount(const QModelIndex& parent) const; 18 | 19 | QVariant data(const QModelIndex& index, int role) const; 20 | 21 | QHash roleNames() const; 22 | 23 | private: 24 | CModelOnlineMusicYearsPrivate* m_dPtr; 25 | signals: 26 | 27 | public slots: 28 | void slotForOnlineMusicYears(const QVector& data); 29 | 30 | }; 31 | } 32 | 33 | 34 | #endif // CMODELONLINEMUSICYEARS_H 35 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/onlinemusic/cnetworkmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef CNETWORKMANAGER_H 2 | #define CNETWORKMANAGER_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | #include 7 | #include 8 | #include 9 | namespace QTDUDU { 10 | class CNetworkManager : public QObject 11 | { 12 | Q_OBJECT 13 | protected: 14 | explicit CNetworkManager(QObject *parent = 0); 15 | public: 16 | static CNetworkManager* getInstance(); 17 | 18 | void getData(UINT type); 19 | void addParam(QString key, QString val); 20 | void setOpenId(QString openid) {m_strOpenId = openid;} 21 | void setOpenKey(QString openkey) {m_strOpenKey = openkey;} 22 | void setPrefix(QString prefix) {m_strPrefix = prefix;} 23 | private: 24 | static CNetworkManager* m_pInstance; 25 | 26 | void createSign(bool special=false); 27 | QString sortHash(bool specail=false); 28 | QString createOnlineMusicUrlString(UINT apitype); 29 | QNetworkRequest createRequest(UINT apiType); 30 | void accessNewWork(UINT apitype); 31 | private: 32 | // request参数值 33 | // http://autoapi.openspeech.cn/api/v2/music/songs/?words=刘德华&openid=123456& 34 | // clientType =4&sId=1001&sign=08a376375b1a5d84ce7ff0360a06095232ccbf82 35 | QString m_strOpenId; // 厂商唯一标识,用于标识厂商,后续增加定制需求所用 36 | QString m_strOpenKey; 37 | QString m_strSign; // 请求签名,对除sign外所有参数进行签名 38 | QString m_strPrefix; 39 | QHash m_paramMap; 40 | QHash m_specialMap; 41 | QNetworkAccessManager *m_networkAccess; 42 | UINT m_currentRequest; 43 | UINT m_nameIndex; 44 | UINT m_IDIndex; 45 | bool m_isRequest; 46 | bool m_hasSort; 47 | QVector m_waitList; 48 | QTimer m_tm; 49 | 50 | signals: 51 | void dataReady(UINT type,QString data); 52 | void downloadError(); 53 | void requestOccur(); 54 | public slots: 55 | void downloadFinished(QNetworkReply *reply); 56 | void previousFinished(); 57 | //void slotForUSBDeviceChanged(const DeviceStateChange& state); 58 | //void slotForCarLifeDeviceChanged(QString id, QString type, QString status); 59 | void handleTimeOut(); 60 | }; 61 | } 62 | 63 | 64 | #endif // CNETWORKMANAGER_H 65 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/video/dudumediaplayer.cpp: -------------------------------------------------------------------------------- 1 | #include "dudumediaplayer.h" 2 | namespace QTDUDU { 3 | 4 | DuDuMediaPlayer* DuDuMediaPlayer::m_pInstance = nullptr; 5 | 6 | void DuDuMediaPlayer::play() 7 | { 8 | qDebug()<<"play :.."; 9 | QMediaPlayer ::setMedia(QUrl::fromLocalFile(QStringLiteral("D:/KuGou/MV/mv.mp4"))); 10 | QMediaPlayer ::play(); 11 | 12 | } 13 | 14 | void DuDuMediaPlayer::pause() 15 | { 16 | qDebug()<<"pause"; 17 | QMediaPlayer ::pause(); 18 | } 19 | 20 | void DuDuMediaPlayer::setPosition(int position) 21 | { 22 | QMediaPlayer::setPosition(position); 23 | } 24 | 25 | DuDuMediaPlayer::DuDuMediaPlayer(QObject *parent, Flags flags) : QMediaPlayer(parent, flags) 26 | { 27 | //connect(this, SIGNAL(videoAvailableChanged(bool)), this, SLOT(VideoAvailableChanged(bool))); 28 | connect(this, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(slotMetaDataAvailableChanged(bool))); 29 | connect(this, SIGNAL(positionChanged(qint64)), this, SLOT(slotForPositionChanged(qint64))); 30 | connect(this, SIGNAL(durationChanged(qint64)), this, SLOT(slotForDurationChanged(qint64))); 31 | connect(this, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(slotForState(QMediaPlayer::State))); 32 | } 33 | 34 | DuDuMediaPlayer *DuDuMediaPlayer::getInstance() 35 | { 36 | if(m_pInstance == nullptr) 37 | { 38 | m_pInstance = new DuDuMediaPlayer(0, 0); 39 | } 40 | return m_pInstance; 41 | } 42 | 43 | DuDuMediaPlayer::DuDuMediaPlayer() 44 | { 45 | 46 | } 47 | 48 | DuDuMediaPlayer::~DuDuMediaPlayer() 49 | { 50 | 51 | } 52 | 53 | void DuDuMediaPlayer::VideoAvailableChanged(bool bavaliable) 54 | { 55 | qDebug()<<"bavaliable :"<setCurrentIndex(++count); 91 | } 92 | */ 93 | } 94 | 95 | void DuDuMediaPlayer::slotForState(QMediaPlayer::State state) 96 | { 97 | emit sigState(static_cast(state)); 98 | } 99 | } 100 | 101 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/video/dudumediaplayer.h: -------------------------------------------------------------------------------- 1 | #ifndef DUDUMEDIAPLAYER_H 2 | #define DUDUMEDIAPLAYER_H 3 | 4 | #include 5 | #include "../../framework/dudu.h" 6 | 7 | namespace QTDUDU { 8 | 9 | class DuDuMediaPlayer : public QMediaPlayer 10 | { 11 | Q_OBJECT 12 | public: 13 | Q_PROPERTY(QAbstractVideoSurface* videoSurface READ getVideoSurface WRITE setVideoSurface ) 14 | Q_INVOKABLE void play(); 15 | Q_INVOKABLE void pause(); 16 | Q_INVOKABLE void setPosition(int position); 17 | public: 18 | explicit DuDuMediaPlayer(QObject *parent = 0, Flags flags = 0); 19 | static DuDuMediaPlayer *getInstance(); 20 | 21 | private: 22 | DuDuMediaPlayer(); 23 | ~DuDuMediaPlayer(); 24 | private: 25 | QAbstractVideoSurface* m_surface; 26 | static DuDuMediaPlayer* m_pInstance; 27 | void VideoAvailableChanged(bool bavaliable); 28 | signals: 29 | void sigPositionChanged(int position); 30 | void sigDurationChanged(int duration); 31 | void sigState(int state); 32 | public slots: 33 | void setVideoSurface(QAbstractVideoSurface* surface); 34 | QAbstractVideoSurface* getVideoSurface(); 35 | void slotForPositionChanged(qint64 position); 36 | void slotForDurationChanged(qint64 duration); 37 | void slotMetaDataAvailableChanged(bool available); 38 | void slotForState(QMediaPlayer::State state); 39 | 40 | 41 | }; 42 | 43 | } 44 | 45 | 46 | #endif // DUDUMEDIAPLAYER_H 47 | -------------------------------------------------------------------------------- /DuDuPlayer/code/app/video/新建文本文档.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/code/app/video/新建文本文档.txt -------------------------------------------------------------------------------- /DuDuPlayer/code/clogic.cpp: -------------------------------------------------------------------------------- 1 | #include "clogic.h" 2 | 3 | CLogic::CLogic(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /DuDuPlayer/code/clogic.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOGIC_H 2 | #define CLOGIC_H 3 | 4 | #include 5 | 6 | class CLogic : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit CLogic(QObject *parent = 0); 11 | 12 | signals: 13 | 14 | public slots: 15 | }; 16 | 17 | #endif // CLOGIC_H -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/TypeDefine.h: -------------------------------------------------------------------------------- 1 | #ifndef __OPENHMI_TYPEDEFINE_H_INCLUDED__ 2 | #define __OPENHMI_TYPEDEFINE_H_INCLUDED__ 3 | #include 4 | namespace QTDUDU 5 | { 6 | typedef wchar_t CHAR; 7 | 8 | typedef char INT8; 9 | typedef unsigned char BYTE; 10 | typedef short SHORT; 11 | typedef unsigned short USHORT; 12 | typedef int INT; 13 | typedef unsigned int UINT; 14 | typedef long LONG; 15 | typedef unsigned long ULONG; 16 | typedef long long LLONG; 17 | 18 | typedef float FLOAT; 19 | typedef double DOUBLE; 20 | typedef bool BOOLEAN; 21 | 22 | typedef QString String; 23 | 24 | ///////////////////////////////////////////// 25 | typedef CHAR* PCHAR; 26 | 27 | typedef INT8* PINT8; 28 | typedef BYTE* PBYTE; 29 | typedef SHORT* PSHORT; 30 | typedef USHORT* PUSHORT; 31 | typedef INT* PINT; 32 | typedef UINT* PUINT; 33 | typedef LONG* PLONG; 34 | typedef ULONG* PULONG; 35 | typedef LLONG* PLLONG; 36 | 37 | typedef FLOAT* PFLOAT; 38 | typedef DOUBLE* PDOULBE; 39 | typedef BOOLEAN* PBOOLEAN; 40 | 41 | ///////////////////////////////////////////// 42 | 43 | ///////////////////////////////////////////// 44 | #define TRUE true 45 | #define FALSE false 46 | #ifndef NULL 47 | #define NULL 0 48 | #endif 49 | #define STRING_NULL QString() 50 | ///////////////////////////////////////////// 51 | 52 | #define INVALID_THREAD_ID 0 53 | 54 | ///////////////////////////////////////////// 55 | #ifdef OS_QNX 56 | typedef INT SOCKET; 57 | #define INVALID_SOCKET 0 58 | #endif 59 | 60 | #ifdef OS_LINUX 61 | typedef INT SOCKET; 62 | #define INVALID_SOCKET 0 63 | #endif 64 | 65 | } 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/dudu.h: -------------------------------------------------------------------------------- 1 | #ifndef DUDU_H 2 | #define DUDU_H 3 | #pragma once 4 | // qt class 5 | #include "./qtdudu.h" 6 | 7 | // common class 8 | #include "./TypeDefine.h" 9 | #include "./JsonLite.h" 10 | #include "../logic/clogic.h" 11 | #include "./commondata.h" 12 | #include "./CAppDataBase.h" 13 | 14 | 15 | // network class 16 | #include "../app/onlinemusic/cnetworkonlineserver.h" 17 | #include "../app/onlinemusic/cnetworkmanager.h" 18 | 19 | // system class 20 | #ifdef OS_WIN 21 | #include 22 | #endif 23 | 24 | // app class 25 | #include "../playlist/TreeModel.h" 26 | #include "../playlist/TreeItem.h" 27 | 28 | #include "../app/localmusic/localmusic.h" 29 | #include "../app/localmusic/localmusicmodel.h" 30 | 31 | // onlinemusic class 32 | #include "../app/onlinemusic/JConNetRspData.h" 33 | #include "../app/onlinemusic/CAppOnlineMusic.h" 34 | #include "../app/onlinemusic/CModelOnlineMusicCollect.h" 35 | #include "../app/onlinemusic/CModelOnlineMusicEmotion.h" 36 | #include "../app/onlinemusic/CModelOnlineMusicHistory.h" 37 | #include "../app/onlinemusic/CModelOnlineMusicLanguage.h" 38 | #include "../app/onlinemusic/CModelOnlineMusicSearched.h" 39 | #include "../app/onlinemusic/CModelOnlineMusicSence.h" 40 | #include "../app/onlinemusic/CModelOnlineMusicStyle.h" 41 | #include "../app/onlinemusic/CModelOnlineMusicTopName.h" 42 | #include "../app/onlinemusic/CModelOnlineMusicType.h" 43 | #include "../app/onlinemusic/CModelOnlineMusicYears.h" 44 | 45 | // video class 46 | #include "../app/video/dudumediaplayer.h" 47 | #endif // DUDU_H 48 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/CJSONUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "./json/json.h" 4 | #include "./json/config.h" 5 | #include "./json/assertions.h" 6 | #include "./json/autolink.h" 7 | #include "./json/features.h" 8 | #include "./json/forwards.h" 9 | #include "./json/reader.h" 10 | #include "./json/value.h" 11 | #include "./json/version.h" 12 | #include "./json/writer.h" 13 | #include 14 | #include 15 | #include "../dudu.h" 16 | 17 | namespace QTDUDU 18 | { 19 | class JSON_API CJSONUtils 20 | { 21 | public: 22 | static void encode (const Json::Value &json, QString &strJson); 23 | static BOOLEAN decode (const QString &strJson, Json::Value &json); 24 | 25 | static QString getStrValue (const char *pcKey, const Json::Value &json); 26 | static void getStrAryValue (const char *pcKey, const Json::Value &json, QVector& aryOutStrs); 27 | static BOOLEAN getBoolValue (const char *pcKey, const Json::Value &json); 28 | static INT getIntValue (const char *pcKey, const Json::Value &json); 29 | static UINT getUIntValue (const char *pcKey, const Json::Value &json); 30 | static DOUBLE getDoubleValue (const char *pcKey, const Json::Value &json); 31 | static Json::Value getJsonValue (const char *pcKey, const Json::Value &json); 32 | static void getJsonAryValue (const char *pcKey, const Json::Value &json, QVector& aryOutJsons); 33 | 34 | static QString getStrValue (const QString &strKey, const Json::Value &json); 35 | static void getStrAryValue (const QString &strKey, const Json::Value &json, QVector& aryOutStrs); 36 | static BOOLEAN getBoolValue (const QString &strKey, const Json::Value &json); 37 | static INT getIntValue (const QString &strKey, const Json::Value &json); 38 | static UINT getUIntValue (const QString &strKey, const Json::Value &json); 39 | static DOUBLE getDoubleValue (const QString &strKey, const Json::Value &json); 40 | static Json::Value getJsonValue (const QString &strKey, const Json::Value &json); 41 | static void getJsonAryValue (const QString &strKey, const Json::Value &json, QVector& aryOutJsons); 42 | 43 | static void setStrValue (Json::Value &json, const char *pcKey, const QString &strValue); 44 | static void setBoolValue (Json::Value &json, const char *pcKey, BOOLEAN bValue); 45 | static void setIntValue (Json::Value &json, const char *pcKey, INT iValue); 46 | static void setIntAryValue (Json::Value &json, const char *pcKey, QVector &aryInt); 47 | static void setUIntValue (Json::Value &json, const char *pcKey, UINT uiValue); 48 | static void setUintAryValue (Json::Value &json, const char *pcKey, QVector &aryUint); 49 | static void setDoubleValue (Json::Value &json, const char *pcKey, DOUBLE dValue); 50 | static void setStrAryValue (Json::Value &json, const char *pcKey, QVector &aryStr); 51 | static void setJsonValue (Json::Value &json, const char *pcKey, Json::Value &jsonValue); 52 | static void setJsonAryValue (Json::Value &json, const char *pcKey, QVector &aryJson); 53 | 54 | static void setStrValue (Json::Value &json, const QString &strKey, const QString &strValue); 55 | static void setBoolValue (Json::Value &json, const QString &strKey, BOOLEAN bValue); 56 | static void setIntValue (Json::Value &json, const QString &strKey, INT iValue); 57 | static void setIntAryValue (Json::Value &json, const QString &strKey, QVector &aryInt); 58 | static void setUIntValue (Json::Value &json, const QString &strKey, UINT uiValue); 59 | static void setUintAryValue (Json::Value &json, const QString &strKey, QVector &aryUint); 60 | static void setDoubleValue (Json::Value &json, const QString &strKey, DOUBLE dValue); 61 | static void setStrAryValue (Json::Value &json, const QString &strKey, QVector &aryStr); 62 | static void setJsonValue (Json::Value &json, const QString &strKey, Json::Value &jsonValue); 63 | static void setJsonAryValue (Json::Value &json, const QString &strKey, QVector &aryJson); 64 | 65 | static BOOLEAN hasProperty (const char *pcKey, const Json::Value &json); 66 | static BOOLEAN hasProperty (const QString &strKey, const Json::Value &json); 67 | 68 | static QString toString (const Json::Value &json); 69 | static char* QStringToCharPointer(const QString& str); 70 | }; 71 | } 72 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/assertions.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED 7 | #define CPPTL_JSON_ASSERTIONS_H_INCLUDED 8 | 9 | #include 10 | 11 | #if !defined(JSON_IS_AMALGAMATION) 12 | #include "../json/config.h" 13 | #endif // if !defined(JSON_IS_AMALGAMATION) 14 | 15 | #if JSON_USE_EXCEPTION 16 | #include 17 | #define JSON_ASSERT(condition) \ 18 | assert(condition); // @todo <= change this into an exception throw 19 | #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); 20 | #else // JSON_USE_EXCEPTION 21 | #define JSON_ASSERT(condition) assert(condition); 22 | 23 | // The call to assert() will show the failure message in debug builds. In 24 | // release bugs we write to invalid memory in order to crash hard, so that a 25 | // debugger or crash reporter gets the chance to take over. We still call exit() 26 | // afterward in order to tell the compiler that this macro doesn't return. 27 | #define JSON_FAIL_MESSAGE(message) \ 28 | { \ 29 | assert(false &&message); \ 30 | strcpy(reinterpret_cast(666), message); \ 31 | exit(123); \ 32 | } 33 | 34 | #endif 35 | 36 | #define JSON_ASSERT_MESSAGE(condition, message) \ 37 | if (!(condition)) { \ 38 | JSON_FAIL_MESSAGE(message) \ 39 | } 40 | 41 | #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED 42 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/autolink.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_AUTOLINK_H_INCLUDED 7 | #define JSON_AUTOLINK_H_INCLUDED 8 | 9 | #include "config.h" 10 | 11 | #ifdef JSON_IN_CPPTL 12 | #include 13 | #endif 14 | 15 | #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ 16 | !defined(JSON_IN_CPPTL) 17 | #define CPPTL_AUTOLINK_NAME "json" 18 | #undef CPPTL_AUTOLINK_DLL 19 | #ifdef JSON_DLL 20 | #define CPPTL_AUTOLINK_DLL 21 | #endif 22 | #include "autolink.h" 23 | #endif 24 | 25 | #endif // JSON_AUTOLINK_H_INCLUDED 26 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/config.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_CONFIG_H_INCLUDED 7 | #define JSON_CONFIG_H_INCLUDED 8 | 9 | /// If defined, indicates that json library is embedded in CppTL library. 10 | //# define JSON_IN_CPPTL 1 11 | 12 | /// If defined, indicates that json may leverage CppTL library 13 | //# define JSON_USE_CPPTL 1 14 | /// If defined, indicates that cpptl vector based map should be used instead of 15 | /// std::map 16 | /// as Value container. 17 | //# define JSON_USE_CPPTL_SMALLMAP 1 18 | /// If defined, indicates that Json specific container should be used 19 | /// (hash table & simple deque container with customizable allocator). 20 | /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 21 | //# define JSON_VALUE_USE_INTERNAL_MAP 1 22 | /// Force usage of standard new/malloc based allocator instead of memory pool 23 | /// based allocator. 24 | /// The memory pools allocator used optimization (initializing Value and 25 | /// ValueInternalLink 26 | /// as if it was a POD) that may cause some validation tool to report errors. 27 | /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. 28 | //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 29 | 30 | // If non-zero, the library uses exceptions to report bad input instead of C 31 | // assertion macros. The default is to use exceptions. 32 | #ifndef JSON_USE_EXCEPTION 33 | #define JSON_USE_EXCEPTION 1 34 | #endif 35 | 36 | /// If defined, indicates that the source file is amalgated 37 | /// to prevent private header inclusion. 38 | /// Remarks: it is automatically defined in the generated amalgated header. 39 | // #define JSON_IS_AMALGAMATION 40 | 41 | #ifdef JSON_IN_CPPTL 42 | #include 43 | #ifndef JSON_USE_CPPTL 44 | #define JSON_USE_CPPTL 1 45 | #endif 46 | #endif 47 | 48 | #ifdef JSON_IN_CPPTL 49 | #define JSON_API CPPTL_API 50 | #elif defined(JSON_DLL_BUILD) 51 | #if defined(_MSC_VER) 52 | #define JSON_API __declspec(dllexport) 53 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 54 | #endif // if defined(_MSC_VER) 55 | #elif defined(JSON_DLL) 56 | #if defined(_MSC_VER) 57 | #define JSON_API __declspec(dllimport) 58 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 59 | #endif // if defined(_MSC_VER) 60 | #endif // ifdef JSON_IN_CPPTL 61 | #if !defined(JSON_API) 62 | #define JSON_API 63 | #endif 64 | 65 | // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for 66 | // integer 67 | // Storages, and 64 bits integer support is disabled. 68 | // #define JSON_NO_INT64 1 69 | 70 | #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 71 | // Microsoft Visual Studio 6 only support conversion from __int64 to double 72 | // (no conversion from unsigned __int64). 73 | #define JSON_USE_INT64_DOUBLE_CONVERSION 1 74 | // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' 75 | // characters in the debug information) 76 | // All projects I've ever seen with VS6 were using this globally (not bothering 77 | // with pragma push/pop). 78 | #pragma warning(disable : 4786) 79 | #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 80 | 81 | #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 82 | /// Indicates that the following function is deprecated. 83 | #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) 84 | #endif 85 | 86 | #if !defined(JSONCPP_DEPRECATED) 87 | #define JSONCPP_DEPRECATED(message) 88 | #endif // if !defined(JSONCPP_DEPRECATED) 89 | 90 | namespace Json { 91 | typedef int Int; 92 | typedef unsigned int UInt; 93 | #if defined(JSON_NO_INT64) 94 | typedef int LargestInt; 95 | typedef unsigned int LargestUInt; 96 | #undef JSON_HAS_INT64 97 | #else // if defined(JSON_NO_INT64) 98 | // For Microsoft Visual use specific types as long long is not supported 99 | #if defined(_MSC_VER) // Microsoft Visual Studio 100 | typedef __int64 Int64; 101 | typedef unsigned __int64 UInt64; 102 | #else // if defined(_MSC_VER) // Other platforms, use long long 103 | typedef long long int Int64; 104 | typedef unsigned long long int UInt64; 105 | #endif // if defined(_MSC_VER) 106 | typedef Int64 LargestInt; 107 | typedef UInt64 LargestUInt; 108 | #define JSON_HAS_INT64 109 | #endif // if defined(JSON_NO_INT64) 110 | } // end namespace Json 111 | 112 | #endif // JSON_CONFIG_H_INCLUDED 113 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/features.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef CPPTL_JSON_FEATURES_H_INCLUDED 7 | #define CPPTL_JSON_FEATURES_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace Json { 14 | 15 | /** \brief Configuration passed to reader and writer. 16 | * This configuration object can be used to force the Reader or Writer 17 | * to behave in a standard conforming way. 18 | */ 19 | class JSON_API Features { 20 | public: 21 | /** \brief A configuration that allows all features and assumes all strings 22 | * are UTF-8. 23 | * - C & C++ comments are allowed 24 | * - Root object can be any JSON value 25 | * - Assumes Value strings are encoded in UTF-8 26 | */ 27 | static Features all(); 28 | 29 | /** \brief A configuration that is strictly compatible with the JSON 30 | * specification. 31 | * - Comments are forbidden. 32 | * - Root object must be either an array or an object value. 33 | * - Assumes Value strings are encoded in UTF-8 34 | */ 35 | static Features strictMode(); 36 | 37 | /** \brief Initialize the configuration like JsonConfig::allFeatures; 38 | */ 39 | Features(); 40 | 41 | /// \c true if comments are allowed. Default: \c true. 42 | bool allowComments_; 43 | 44 | /// \c true if root must be either an array or an object value. Default: \c 45 | /// false. 46 | bool strictRoot_; 47 | 48 | /// \c true if dropped null placeholders are allowed. Default: \c false. 49 | bool allowDroppedNullPlaceholders_; 50 | 51 | /// \c true if numeric object key are allowed. Default: \c false. 52 | bool allowNumericKeys_; 53 | }; 54 | 55 | } // namespace Json 56 | 57 | #endif // CPPTL_JSON_FEATURES_H_INCLUDED 58 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/forwards.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FORWARDS_H_INCLUDED 7 | #define JSON_FORWARDS_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "config.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace Json { 14 | 15 | // writer.h 16 | class FastWriter; 17 | class StyledWriter; 18 | 19 | // reader.h 20 | class Reader; 21 | 22 | // features.h 23 | class Features; 24 | 25 | // value.h 26 | typedef unsigned int ArrayIndex; 27 | class StaticString; 28 | class Path; 29 | class PathArgument; 30 | class Value; 31 | class ValueIteratorBase; 32 | class ValueIterator; 33 | class ValueConstIterator; 34 | #ifdef JSON_VALUE_USE_INTERNAL_MAP 35 | class ValueMapAllocator; 36 | class ValueInternalLink; 37 | class ValueInternalArray; 38 | class ValueInternalMap; 39 | #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP 40 | 41 | } // namespace Json 42 | 43 | #endif // JSON_FORWARDS_H_INCLUDED 44 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "autolink.h" 10 | #include "value.h" 11 | #include "reader.h" 12 | #include "writer.h" 13 | #include "features.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/json/version.h: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This file is generated by CMake from "version" 2 | // and "version.h.in" files. 3 | // Run CMake configure step to update it. 4 | #ifndef JSON_VERSION_H_INCLUDED 5 | #define JSON_VERSION_H_INCLUDED 6 | 7 | #define JSONCPP_VERSION_STRING "0.6.0-dev" 8 | #define JSONCPP_VERSION_MAJOR 0 9 | #define JSONCPP_VERSION_MINOR 6 10 | #define JSONCPP_VERSION_PATCH 0 11 | #define JSONCPP_VERSION_QUALIFIER -dev 12 | #define JSONCPP_VERSION_HEXA \ 13 | ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ 14 | (JSONCPP_VERSION_PATCH << 8)) 15 | 16 | #endif // JSON_VERSION_H_INCLUDED 17 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/src/json_batchallocator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED 7 | #define JSONCPP_BATCHALLOCATOR_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 13 | 14 | namespace Json { 15 | 16 | /* Fast memory allocator. 17 | * 18 | * This memory allocator allocates memory for a batch of object (specified by 19 | * the page size, the number of object in each page). 20 | * 21 | * It does not allow the destruction of a single object. All the allocated 22 | * objects can be destroyed at once. The memory can be either released or reused 23 | * for future allocation. 24 | * 25 | * The in-place new operator must be used to construct the object using the 26 | * pointer returned by allocate. 27 | */ 28 | template 29 | class BatchAllocator { 30 | public: 31 | BatchAllocator(unsigned int objectsPerPage = 255) 32 | : freeHead_(0), objectsPerPage_(objectsPerPage) { 33 | // printf( "Size: %d => %s\n", sizeof(AllocatedType), 34 | // typeid(AllocatedType).name() ); 35 | assert(sizeof(AllocatedType) * objectPerAllocation >= 36 | sizeof(AllocatedType *)); // We must be able to store a slist in the 37 | // object free space. 38 | assert(objectsPerPage >= 16); 39 | batches_ = allocateBatch(0); // allocated a dummy page 40 | currentBatch_ = batches_; 41 | } 42 | 43 | ~BatchAllocator() { 44 | for (BatchInfo *batch = batches_; batch;) { 45 | BatchInfo *nextBatch = batch->next_; 46 | free(batch); 47 | batch = nextBatch; 48 | } 49 | } 50 | 51 | /// allocate space for an array of objectPerAllocation object. 52 | /// @warning it is the responsability of the caller to call objects 53 | /// constructors. 54 | AllocatedType *allocate() { 55 | if (freeHead_) // returns node from free list. 56 | { 57 | AllocatedType *object = freeHead_; 58 | freeHead_ = *(AllocatedType **)object; 59 | return object; 60 | } 61 | if (currentBatch_->used_ == currentBatch_->end_) { 62 | currentBatch_ = currentBatch_->next_; 63 | while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) 64 | currentBatch_ = currentBatch_->next_; 65 | 66 | if (!currentBatch_) // no free batch found, allocate a new one 67 | { 68 | currentBatch_ = allocateBatch(objectsPerPage_); 69 | currentBatch_->next_ = batches_; // insert at the head of the list 70 | batches_ = currentBatch_; 71 | } 72 | } 73 | AllocatedType *allocated = currentBatch_->used_; 74 | currentBatch_->used_ += objectPerAllocation; 75 | return allocated; 76 | } 77 | 78 | /// Release the object. 79 | /// @warning it is the responsability of the caller to actually destruct the 80 | /// object. 81 | void release(AllocatedType *object) { 82 | assert(object != 0); 83 | *(AllocatedType **)object = freeHead_; 84 | freeHead_ = object; 85 | } 86 | 87 | private: 88 | struct BatchInfo { 89 | BatchInfo *next_; 90 | AllocatedType *used_; 91 | AllocatedType *end_; 92 | AllocatedType buffer_[objectPerAllocation]; 93 | }; 94 | 95 | // disabled copy constructor and assignement operator. 96 | BatchAllocator(const BatchAllocator &); 97 | void operator=(const BatchAllocator &); 98 | 99 | static BatchInfo *allocateBatch(unsigned int objectsPerPage) { 100 | const unsigned int mallocSize = 101 | sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + 102 | sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; 103 | BatchInfo *batch = static_cast(malloc(mallocSize)); 104 | batch->next_ = 0; 105 | batch->used_ = batch->buffer_; 106 | batch->end_ = batch->buffer_ + objectsPerPage; 107 | return batch; 108 | } 109 | 110 | BatchInfo *batches_; 111 | BatchInfo *currentBatch_; 112 | /// Head of a single linked list within the allocated space of freeed object 113 | AllocatedType *freeHead_; 114 | unsigned int objectsPerPage_; 115 | }; 116 | 117 | } // namespace Json 118 | 119 | #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION 120 | 121 | #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED 122 | // vim: et ts=3 sts=3 sw=3 tw=0 123 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/jsoncpp/src/json_tool.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED 7 | #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED 8 | 9 | /* This header provides common string manipulation support, such as UTF-8, 10 | * portable conversion from/to string... 11 | * 12 | * It is an internal header that must not be exposed. 13 | */ 14 | 15 | namespace Json { 16 | 17 | /// Converts a unicode code-point to UTF-8. 18 | static inline std::string codePointToUTF8(unsigned int cp) { 19 | std::string result; 20 | 21 | // based on description from http://en.wikipedia.org/wiki/UTF-8 22 | 23 | if (cp <= 0x7f) { 24 | result.resize(1); 25 | result[0] = static_cast(cp); 26 | } else if (cp <= 0x7FF) { 27 | result.resize(2); 28 | result[1] = static_cast(0x80 | (0x3f & cp)); 29 | result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); 30 | } else if (cp <= 0xFFFF) { 31 | result.resize(3); 32 | result[2] = static_cast(0x80 | (0x3f & cp)); 33 | result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); 34 | result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); 35 | } else if (cp <= 0x10FFFF) { 36 | result.resize(4); 37 | result[3] = static_cast(0x80 | (0x3f & cp)); 38 | result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); 39 | result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); 40 | result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); 41 | } 42 | 43 | return result; 44 | } 45 | 46 | /// Returns true if ch is a control character (in range [0,32[). 47 | static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } 48 | 49 | enum { 50 | /// Constant that specify the size of the buffer that must be passed to 51 | /// uintToString. 52 | uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 53 | }; 54 | 55 | // Defines a char buffer for use with uintToString(). 56 | typedef char UIntToStringBuffer[uintToStringBufferSize]; 57 | 58 | /** Converts an unsigned integer to string. 59 | * @param value Unsigned interger to convert to string 60 | * @param current Input/Output string buffer. 61 | * Must have at least uintToStringBufferSize chars free. 62 | */ 63 | static inline void uintToString(LargestUInt value, char *¤t) { 64 | *--current = 0; 65 | do { 66 | *--current = char(value % 10) + '0'; 67 | value /= 10; 68 | } while (value != 0); 69 | } 70 | 71 | } // namespace Json { 72 | 73 | #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED 74 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/metadata.cpp: -------------------------------------------------------------------------------- 1 | #include "metadata.h" 2 | #include "./dudu.h" 3 | 4 | using namespace QTDUDU; 5 | 6 | void registerQmlProperty(std::map >& properties, QQmlContext* contex, const char* name, QObject* object) { 7 | properties[name] = std::shared_ptr(object); 8 | contex->setContextProperty(name, object); 9 | } 10 | 11 | void registerQmlClasses(QQmlContext* context) { 12 | //qmlRegisterType("DuDuMediaPlayer", 1, 0, "DuDuMediaPlayer"); 13 | } 14 | 15 | void registerCpp2Property(std::map >& properties, QQmlContext* ctx) { 16 | // 如果包含了vld头文件进行内存泄漏检测,或者是编译QNX版本则用上面的代码 17 | // 否则用下面的代码,这样可以在qt creator里面使用提示功能 18 | 19 | //registerQmlProperty(properties, ctx, "lstModelMusic", CListModelMusic::getInstance()); 20 | 21 | registerQmlProperty(properties, ctx, "lstModelMusic", new TreeModel()); 22 | registerQmlProperty(properties, ctx, "localMusicModel", new LocalMusicModel()); 23 | registerQmlProperty(properties, ctx, "CppLocalMusic", LocalMusic::getInstance()); 24 | 25 | registerQmlProperty(properties, ctx, "JCNet_AppOnlineMusic", CAppOnlineMusic::getInstance()); 26 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeHot", new CModelOnlineMusicType()); 27 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeSence", new CModelOnlineMusicSence()); 28 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeEmotion", new CModelOnlineMusicEmotion()); 29 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeStyle", new CModelOnlineMusicStyle()); 30 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeYears", new CModelOnlineMusicYears()); 31 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeLanguage", new CModelOnlineMusicLanguage()); 32 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeTopName", new CModelOnlineMusicTopName()); 33 | registerQmlProperty(properties, ctx, "modelOnlineMusicTypeSearched", new CModelOnlineMusicSearched()); 34 | registerQmlProperty(properties, ctx, "modelOnlineMusicHistory", new CModelOnlineMusicHistory()); 35 | registerQmlProperty(properties, ctx, "modelOnlineMusicCollect", new CModelOnlineMusicCollect()); 36 | registerQmlProperty(properties, ctx, "duduMediaPlayer", DuDuMediaPlayer::getInstance()); 37 | 38 | if (0) { 39 | //ctx->setContextProperty("modelOnlineMusicTypeLanguage", new CModelOnlineMusicLanguage()); 40 | 41 | } 42 | 43 | //ChinaCityList::getInstance()->init(); 44 | } 45 | 46 | void regiserMetaData(std::map >& properties, QQmlContext* context) { 47 | registerQmlClasses(context); 48 | registerCpp2Property(properties, context); 49 | } 50 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/metadata.h: -------------------------------------------------------------------------------- 1 | #ifndef METADATA_H 2 | #define METADATA_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void registerQmlClasses(QQmlContext* context); 10 | void registerCpp2Property(std::map >& properties, QQmlContext* ctx); 11 | void regiserMetaData(std::map >& properties, QQmlContext* context); 12 | 13 | #endif // METADATA_H 14 | -------------------------------------------------------------------------------- /DuDuPlayer/code/framework/qtdudu.h: -------------------------------------------------------------------------------- 1 | #ifndef QTDUDU_H 2 | #define QTDUDU_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #endif // QTDUDU_H 24 | -------------------------------------------------------------------------------- /DuDuPlayer/code/logic/clogic.cpp: -------------------------------------------------------------------------------- 1 | #include "clogic.h" 2 | #include "../framework/dudu.h" 3 | namespace QTDUDU { 4 | Clogic::Clogic() 5 | { 6 | 7 | } 8 | 9 | void Clogic::registerAll() 10 | { 11 | LocalMusic::getInstance(); 12 | DuDuMediaPlayer::getInstance(); 13 | } 14 | 15 | void Clogic::unregisterAll() 16 | { 17 | 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /DuDuPlayer/code/logic/clogic.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOGIC_H 2 | #define CLOGIC_H 3 | #include "../framework/dudu.h" 4 | namespace QTDUDU { 5 | class Clogic 6 | { 7 | public: 8 | Clogic(); 9 | static void registerAll(); 10 | static void unregisterAll(); 11 | }; 12 | } 13 | 14 | 15 | #endif // CLOGIC_H 16 | -------------------------------------------------------------------------------- /DuDuPlayer/code/playlist/TreeItem.cpp: -------------------------------------------------------------------------------- 1 | #include "TreeItem.h" 2 | 3 | TreeItem::TreeItem() :m_parentItem(NULL) 4 | { 5 | } 6 | TreeItem::TreeItem(const QList &data, TreeItem* parent) : m_parentItem(NULL) 7 | { 8 | m_parentItem = parent; 9 | m_itemData = data; 10 | } 11 | TreeItem::~TreeItem() 12 | { 13 | qDeleteAll(m_childItems); 14 | } 15 | 16 | void TreeItem::appendChild(TreeItem *item) 17 | { 18 | item->setParent(this); 19 | m_childItems.append(item); 20 | } 21 | void TreeItem::deleteAllChild() 22 | { 23 | for (int index = 0; index < m_childItems.size(); index++) 24 | { 25 | m_childItems[index]->deleteAllChild(); 26 | } 27 | qDeleteAll(m_childItems); 28 | m_childItems.clear(); 29 | } 30 | TreeItem *TreeItem::child(int row) 31 | { 32 | return m_childItems.value(row); 33 | } 34 | int TreeItem::childCount() const 35 | { 36 | return m_childItems.count(); 37 | } 38 | int TreeItem::columnCount() const 39 | { 40 | return m_itemData.count(); 41 | //return 1; 42 | } 43 | QVariant TreeItem::data(int column) const 44 | { 45 | return m_itemData .value(column); 46 | } 47 | TreeItem *TreeItem::parent() 48 | { 49 | return m_parentItem; 50 | } 51 | void TreeItem::setParent(TreeItem *parent) 52 | { 53 | m_parentItem = parent; 54 | } 55 | int TreeItem::row() const 56 | { 57 | if (!m_parentItem) { return 0; } 58 | 59 | return m_parentItem->m_childItems.indexOf(const_cast(this)); 60 | } -------------------------------------------------------------------------------- /DuDuPlayer/code/playlist/TreeItem.h: -------------------------------------------------------------------------------- 1 | #ifndef TREEITEM_H 2 | #define TREEITEM_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class TreeItem 10 | { 11 | public: 12 | TreeItem(); 13 | TreeItem(const QList &data, TreeItem* parent); 14 | ~TreeItem(); 15 | 16 | void appendChild(TreeItem *child); 17 | void deleteAllChild(); 18 | 19 | TreeItem *child(int row); 20 | int childCount() const; 21 | int columnCount() const; 22 | QVariant data(int column) const; 23 | int row() const; 24 | TreeItem *parent(); 25 | void setParent(TreeItem *parent); 26 | private: 27 | TreeItem *m_parentItem; 28 | QList m_childItems; 29 | QList m_itemData; 30 | }; 31 | #endif 32 | -------------------------------------------------------------------------------- /DuDuPlayer/code/playlist/TreeModel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/code/playlist/TreeModel.cpp -------------------------------------------------------------------------------- /DuDuPlayer/code/playlist/TreeModel.h: -------------------------------------------------------------------------------- 1 | #ifndef TREEMODEL_H 2 | #define TREEMODEL_H 3 | 4 | // Qt lib import 5 | #include 6 | #include 7 | #include 8 | 9 | #include "TreeItem.h" 10 | 11 | class TreeModel : public QAbstractItemModel 12 | { 13 | Q_OBJECT 14 | enum ItemRoles { 15 | NAME = Qt::UserRole + 1, 16 | SIMPLIFY 17 | }; 18 | public: 19 | TreeModel(QObject *parent = NULL); 20 | ~TreeModel(); 21 | 22 | void appendChild(const QModelIndex& index); 23 | bool removeRows(int row, int count, QModelIndex parent); 24 | 25 | QModelIndex parent(const QModelIndex &index) const; 26 | Qt::ItemFlags flags(const QModelIndex &index) const; 27 | QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; 28 | int rowCount(const QModelIndex &parent = QModelIndex()) const; 29 | int columnCount(const QModelIndex &parent = QModelIndex()) const; 30 | QVariant data(const QModelIndex &index, int role) const; 31 | QHash roleNames() const; 32 | 33 | private: 34 | TreeItem *m_rootItem; 35 | }; 36 | 37 | #endif // TREEMODEL_H -------------------------------------------------------------------------------- /DuDuPlayer/images/128cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128cloud.png -------------------------------------------------------------------------------- /DuDuPlayer/images/128download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128download.png -------------------------------------------------------------------------------- /DuDuPlayer/images/128gadget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128gadget.png -------------------------------------------------------------------------------- /DuDuPlayer/images/128music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128music.png -------------------------------------------------------------------------------- /DuDuPlayer/images/128radiotower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128radiotower.png -------------------------------------------------------------------------------- /DuDuPlayer/images/128smartphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/128smartphone.png -------------------------------------------------------------------------------- /DuDuPlayer/images/64last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/64last.png -------------------------------------------------------------------------------- /DuDuPlayer/images/64next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/64next.png -------------------------------------------------------------------------------- /DuDuPlayer/images/64pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/64pause.png -------------------------------------------------------------------------------- /DuDuPlayer/images/64play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/64play.png -------------------------------------------------------------------------------- /DuDuPlayer/images/anchor-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/anchor-left.png -------------------------------------------------------------------------------- /DuDuPlayer/images/anchor-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/anchor-right.png -------------------------------------------------------------------------------- /DuDuPlayer/images/btn-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/btn-delete.png -------------------------------------------------------------------------------- /DuDuPlayer/images/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/cancel.png -------------------------------------------------------------------------------- /DuDuPlayer/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/close.png -------------------------------------------------------------------------------- /DuDuPlayer/images/collect24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/collect24.png -------------------------------------------------------------------------------- /DuDuPlayer/images/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/comment.png -------------------------------------------------------------------------------- /DuDuPlayer/images/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/default.png -------------------------------------------------------------------------------- /DuDuPlayer/images/download16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/download16.png -------------------------------------------------------------------------------- /DuDuPlayer/images/dudu-default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/dudu-default.jpg -------------------------------------------------------------------------------- /DuDuPlayer/images/dudu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/dudu.jpg -------------------------------------------------------------------------------- /DuDuPlayer/images/film16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/film16.png -------------------------------------------------------------------------------- /DuDuPlayer/images/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/game.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-col-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-col-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-col.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-delete.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-history-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-history-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-history.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-music.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-net.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-net.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-person-center-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-person-center-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-person-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-person-center.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-search.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-singer22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-singer22.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-titlebar-person-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-titlebar-person-default.png -------------------------------------------------------------------------------- /DuDuPlayer/images/icon-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/icon-up.png -------------------------------------------------------------------------------- /DuDuPlayer/images/iconSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/iconSearch.png -------------------------------------------------------------------------------- /DuDuPlayer/images/last-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/last-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/last.png -------------------------------------------------------------------------------- /DuDuPlayer/images/loop24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/loop24.png -------------------------------------------------------------------------------- /DuDuPlayer/images/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/maximize.png -------------------------------------------------------------------------------- /DuDuPlayer/images/more16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/more16.png -------------------------------------------------------------------------------- /DuDuPlayer/images/music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/music.png -------------------------------------------------------------------------------- /DuDuPlayer/images/music24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/music24.png -------------------------------------------------------------------------------- /DuDuPlayer/images/next--click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/next--click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/next.png -------------------------------------------------------------------------------- /DuDuPlayer/images/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/null.png -------------------------------------------------------------------------------- /DuDuPlayer/images/options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/options.png -------------------------------------------------------------------------------- /DuDuPlayer/images/play-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/play-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/play.png -------------------------------------------------------------------------------- /DuDuPlayer/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/refresh.png -------------------------------------------------------------------------------- /DuDuPlayer/images/search-press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/search-press.png -------------------------------------------------------------------------------- /DuDuPlayer/images/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/search.png -------------------------------------------------------------------------------- /DuDuPlayer/images/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/skin.png -------------------------------------------------------------------------------- /DuDuPlayer/images/sound-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/sound-off.png -------------------------------------------------------------------------------- /DuDuPlayer/images/sound-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/sound-on.png -------------------------------------------------------------------------------- /DuDuPlayer/images/stop-click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/stop-click.png -------------------------------------------------------------------------------- /DuDuPlayer/images/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/images/stop.png -------------------------------------------------------------------------------- /DuDuPlayer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "./code/framework/metadata.h" 7 | #include "./code/framework/dudu.h" 8 | 9 | using namespace QTDUDU; 10 | 11 | //QQmlApplicationEngine* g_pEngine = NULL; 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | QGuiApplication app(argc, argv); 16 | 17 | // 注册Logic 18 | Clogic::registerAll(); 19 | 20 | QQmlApplicationEngine engine ; 21 | //g_pEngine = &engine; 22 | std::map > properties; 23 | regiserMetaData(properties, engine.rootContext()); 24 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 25 | 26 | 27 | 28 | /* 29 | // 无边框 背景透明 30 | QQuickView view; 31 | view.setFlags(Qt::FramelessWindowHint); 32 | view.setColor(QColor(Qt::transparent)); 33 | 34 | std::map > properties; 35 | regiserMetaData(properties, view.rootContext()); 36 | 37 | view.setSource(QUrl(QStringLiteral("qrc:/main.qml"))); 38 | view.show(); 39 | // 将view设置成main.qml属性 40 | view.rootContext()->setContextProperty("mainwindow", &view); 41 | 42 | // 查找MediaPlayer 43 | QObject* player = view.findChild("audioPlayer"); 44 | if(player) 45 | { 46 | 47 | } 48 | */ 49 | 50 | 51 | return app.exec(); 52 | } 53 | -------------------------------------------------------------------------------- /DuDuPlayer/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import QtQuick.Window 2.2 3 | import "qrc:/qml/" as HomePage 4 | /*** 5 | * 主页 6 | */ 7 | /* 8 | // 这个采用QuickView 来显示无边框拖动 9 | Rectangle { 10 | visible: true 11 | width: 1247 12 | height: 733 13 | 14 | //灰色0.9透明度 15 | color:Qt.rgba(0.5,0.5,0.5,0.9) 16 | MouseArea { 17 | id: dragRegion 18 | anchors.fill: parent 19 | property point clickPos: "0,0" 20 | onPressed: { 21 | clickPos = Qt.point(mouse.x,mouse.y) 22 | } 23 | onPositionChanged: { 24 | //鼠标偏移量 25 | var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) 26 | //如果mainwindow继承自QWidget,用setPos 27 | mainwindow.setX(mainwindow.x+delta.x) 28 | mainwindow.setY(mainwindow.y+delta.y) 29 | } 30 | } 31 | 32 | HomePage.Home { 33 | id: homePage 34 | anchors.verticalCenter: parent.verticalCenter; 35 | anchors.horizontalCenter: parent.horizontalCenter; 36 | } 37 | 38 | } 39 | */ 40 | // 还是采用 QQmlApplicationEngine 来处理无边框拖动 41 | Window { 42 | objectName: "rootObject"; 43 | visible: true 44 | width: 1247 45 | height: 733 46 | flags: Qt.FramelessWindowHint; 47 | 48 | //灰色0.9透明度 49 | //color:Qt.rgba(0.5,0.5,0.5,0.9) 50 | color: "transparent"; 51 | id: root; 52 | MouseArea { 53 | id: dragRegion 54 | anchors.fill: parent 55 | property point clickPos: "0,0" 56 | onPressed: { 57 | clickPos = Qt.point(mouse.x,mouse.y) 58 | } 59 | onPositionChanged: { 60 | //鼠标偏移量 61 | var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y) 62 | //如果mainwindow继承自QWidget,用setPos 63 | root.x = (root.x+delta.x) 64 | root.y = (root.y+delta.y) 65 | } 66 | } 67 | // MouseArea { //为窗口添加鼠标事件 68 | // property int xMouse //存储鼠标x坐标 69 | // property int yMouse //存储鼠标y坐标 70 | // anchors.fill: parent 71 | // acceptedButtons: Qt.LeftButton //只处理鼠标左键 72 | // drag.filterChildren: true 73 | // onPressed: { //接收鼠标按下事件 74 | // xMouse = mouse.x 75 | // yMouse = mouse.y 76 | // } 77 | // onPositionChanged: { //鼠标按下后改变位置 78 | // root.x = root.x + (mouse.x - xMouse) 79 | // root.y = root.y + (mouse.y - yMouse) 80 | // } 81 | // } 82 | 83 | HomePage.Home { 84 | id: homePage 85 | anchors.verticalCenter: parent.verticalCenter; 86 | anchors.horizontalCenter: parent.horizontalCenter; 87 | mainFrame: root; 88 | } 89 | 90 | } 91 | 92 | -------------------------------------------------------------------------------- /DuDuPlayer/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | MainForm.ui.qml 5 | qml/common/FlatButton.qml 6 | qml/Home.qml 7 | qml/common/PicButton.qml 8 | qml/TitleBar.qml 9 | images/icon-titlebar-person-default.png 10 | images/anchor-left.png 11 | images/anchor-right.png 12 | images/iconSearch.png 13 | images/search-press.png 14 | images/refresh.png 15 | images/icon-singer22.png 16 | images/search.png 17 | images/maximize.png 18 | images/close.png 19 | images/game.png 20 | images/options.png 21 | images/skin.png 22 | qml/LeftMain.qml 23 | qml/RightMain.qml 24 | qml/sub/TreeViewTest.qml 25 | qml/sub/LocalMusicList.qml 26 | images/music.png 27 | images/music24.png 28 | images/collect24.png 29 | images/download16.png 30 | images/film16.png 31 | images/more16.png 32 | images/128cloud.png 33 | images/128download.png 34 | images/128gadget.png 35 | images/128music.png 36 | images/128radiotower.png 37 | qml/sub/LeftMainTitleBar.qml 38 | images/128smartphone.png 39 | qml/sub/RightMainTitlebar.qml 40 | qml/common/TextButton.qml 41 | qml/sub/PageList.qml 42 | images/icon-search.png 43 | images/icon-person-center.png 44 | images/icon-person-center-click.png 45 | images/next.png 46 | images/next--click.png 47 | images/play.png 48 | images/play-click.png 49 | images/stop.png 50 | images/stop-click.png 51 | images/null.png 52 | images/icon-music.png 53 | images/icon-col.png 54 | images/icon-col-click.png 55 | images/icon-delete.png 56 | images/icon-net.png 57 | images/btn-delete.png 58 | images/icon-up.png 59 | images/default.png 60 | images/last.png 61 | images/last-click.png 62 | images/icon-history.png 63 | images/icon-history-click.png 64 | qml/MusicMediaPlayerBar.qml 65 | images/loop24.png 66 | images/sound-off.png 67 | images/sound-on.png 68 | images/comment.png 69 | images/dudu-default.jpg 70 | images/dudu.jpg 71 | qml/sub/PageMV.qml 72 | qml/sub/PageLive.qml 73 | qml/sub/PageKTV.qml 74 | qml/sub/PageLyric.qml 75 | qml/sub/PopupSkin.qml 76 | images/cancel.png 77 | qml/common/DuDuTabViewStyle.qml 78 | qml/common/PlayProgressBar.qml 79 | qml/sub/onlinemusic/pageEmotion.qml 80 | qml/sub/onlinemusic/pageHot.qml 81 | qml/sub/onlinemusic/PageItem.qml 82 | qml/sub/onlinemusic/pageLanguage.qml 83 | qml/sub/onlinemusic/PagePersonalCenter.qml 84 | qml/sub/onlinemusic/PagePlay.qml 85 | qml/sub/onlinemusic/PageSearch.qml 86 | qml/sub/onlinemusic/PageSearchedList.qml 87 | qml/sub/onlinemusic/pageSence.qml 88 | qml/sub/onlinemusic/pageStyle.qml 89 | qml/sub/onlinemusic/pageYears.qml 90 | qml/common/ColorButton.qml 91 | qml/sub/PageRadio.qml 92 | qml/sub/onlinemusic/PageSingerList.qml 93 | qml/common/KeyboardSymbol.qml 94 | qml/common/KeyboardQWERTY.qml 95 | qml/sub/PageSongList.qml 96 | qml/sub/video/DuDuVideo.qml 97 | images/64last.png 98 | images/64next.png 99 | images/64pause.png 100 | images/64play.png 101 | qml/common/Function.js 102 | qml/sub/PageOnlineMusic.qml 103 | 104 | 105 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/Home.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | /*** 4 | * 主页 5 | */ 6 | Rectangle { 7 | id: home 8 | width: 1000; 9 | height: 700; 10 | color:Qt.rgba(0.1, 0.1, 0.1,0.1) 11 | radius: 10; 12 | property var mainFrame; 13 | Image { 14 | id: bkImg; 15 | anchors.fill : parent; 16 | source: "qrc:/images/dudu.jpg"; 17 | } 18 | 19 | TitleBar { 20 | id: titlebar; 21 | anchors.left: parent.left; 22 | anchors.top: parent.top; 23 | anchors.right: parent.right; 24 | height: 50; 25 | mainFrame: root.mainFrame; 26 | } 27 | LeftMain { 28 | id: leftMain; 29 | anchors.left: parent.left; 30 | anchors.top: titlebar.bottom; 31 | anchors.bottom: parent.bottom; 32 | anchors.bottomMargin: 60; 33 | width: 310; 34 | } 35 | RightMain { 36 | id: rightMain; 37 | anchors.left: leftMain.right; 38 | anchors.leftMargin: 3; 39 | anchors.right: parent.right; 40 | anchors.top: titlebar.bottom; 41 | anchors.bottom: parent.bottom; 42 | anchors.bottomMargin: 60; 43 | } 44 | MusicMediaPlayerBar { 45 | id: mediaPlayer; 46 | anchors.left: parent.left; 47 | anchors.bottom: parent.bottom; 48 | anchors.right: parent.right; 49 | height: 60; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/LeftMain.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Controls 1.4 3 | import "qrc:/qml/sub" as Sub 4 | /*** 5 | * 左边主区域 6 | */ 7 | 8 | Rectangle { 9 | 10 | id: leftMain; 11 | color: Qt.rgba(51/255, 51/255, 51/255, 0.5); 12 | 13 | /* 14 | // 测试TreeView来显示列表,后续优化会用该控件。 15 | Sub.TreeViewTest { 16 | id: playList; 17 | anchors.left: parent.left; 18 | anchors.top: parent.top; 19 | anchors.bottom: parent.bottom; 20 | width: 310; 21 | model: lstModelMusic; 22 | 23 | } 24 | */ 25 | 26 | // 本地音乐标题栏 27 | Sub.LeftMainTitleBar { 28 | id: localMusicTitleBar; 29 | anchors.left: parent.left; 30 | anchors.top: parent.top; 31 | anchors.right: parent.right; 32 | height: 40; 33 | } 34 | 35 | // 本地音乐列表 36 | Sub.LocalMusicList { 37 | id: localMusic; 38 | anchors.left: parent.left; 39 | anchors.top: localMusicTitleBar.bottom; 40 | anchors.right: parent.right; 41 | anchors.bottom: parent.bottom; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/RightMain.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import "qrc:/qml/sub/" as Sub 3 | import "qrc:/qml/sub/onlinemusic/" as SubOnline 4 | /*** 5 | * 右边主区域 6 | */ 7 | Rectangle { 8 | id: root; 9 | color: Qt.rgba(51/255, 51/255, 51/255, 0.3); 10 | 11 | property int nCurShowIndex: 0; 12 | Sub.RightMainTitlebar { 13 | id: rightMainTitleBar; 14 | anchors.left: parent.left; 15 | anchors.top: parent.top; 16 | anchors.right: parent.right; 17 | height: 40; 18 | onSelectTab: { 19 | if(number === nCurShowIndex) 20 | { 21 | return; 22 | } 23 | showTab(nCurShowIndex, false); 24 | showTab(number,true); 25 | nCurShowIndex = number; 26 | } 27 | } 28 | Sub.PageOnlineMusic { 29 | id: onlineMusic; 30 | anchors.left: parent.left; 31 | anchors.top: rightMainTitleBar.bottom; 32 | anchors.right: parent.right; 33 | anchors.bottom: parent.bottom; 34 | visible: true; 35 | } 36 | Sub.PageRadio { 37 | id: radio; 38 | anchors.left: parent.left; 39 | anchors.top: rightMainTitleBar.bottom; 40 | anchors.right: parent.right; 41 | anchors.bottom: parent.bottom; 42 | visible: false; 43 | } 44 | Sub.PageSongList { 45 | id: songlist; 46 | anchors.left: parent.left; 47 | anchors.top: rightMainTitleBar.bottom; 48 | anchors.right: parent.right; 49 | anchors.bottom: parent.bottom; 50 | visible: false; 51 | } 52 | Sub.PageMV { 53 | id: mv; 54 | anchors.left: parent.left; 55 | anchors.top: rightMainTitleBar.bottom; 56 | anchors.right: parent.right; 57 | anchors.bottom: parent.bottom; 58 | visible: false; 59 | } 60 | Sub.PageLive { 61 | id: live; 62 | anchors.left: parent.left; 63 | anchors.top: rightMainTitleBar.bottom; 64 | anchors.right: parent.right; 65 | anchors.bottom: parent.bottom; 66 | visible: false; 67 | } 68 | Sub.PageKTV { 69 | id: ktv; 70 | anchors.left: parent.left; 71 | anchors.top: rightMainTitleBar.bottom; 72 | anchors.right: parent.right; 73 | anchors.bottom: parent.bottom; 74 | visible: false; 75 | } 76 | Sub.PageLyric { 77 | id: lyric; 78 | anchors.left: parent.left; 79 | anchors.top: rightMainTitleBar.bottom; 80 | anchors.right: parent.right; 81 | anchors.bottom: parent.bottom; 82 | visible: false; 83 | } 84 | function showTab(number, visibl) 85 | { 86 | switch (number) 87 | { 88 | case 0: 89 | onlineMusic.visible = visibl; 90 | break; 91 | case 1: 92 | radio.visible = visibl; 93 | break; 94 | case 2: 95 | songlist.visible = visibl; 96 | break; 97 | case 3: 98 | mv.visible = visibl; 99 | break; 100 | case 4: 101 | live.visible = visibl; 102 | break; 103 | case 5: 104 | ktv.visible = visibl; 105 | break; 106 | case 6: 107 | lyric.visible = visibl; 108 | break; 109 | } 110 | } 111 | Component.onCompleted: { 112 | nCurShowIndex = 0; 113 | showTab(0, true); 114 | //console.log("component completed ..."); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/ColorButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Rectangle { 4 | id: btn; 5 | property color borderColor: "#eeeeee"; 6 | //property alias borderWidth: btn.border.width; 7 | property color textColor : "#ffffff"; 8 | property color disabledBorderColor : "#666666"; 9 | property color disabledTextColor : "#666666"; 10 | property color normalColor : "transparent"; 11 | property color disabledColor : "transparent"; 12 | property color pressedColor : "#ff9400"; 13 | property alias text: txt.text; 14 | property alias textSize: txt.font.pixelSize; 15 | property bool selected: false; 16 | property alias iconSource: icon.source; 17 | //property color 18 | width: 100 19 | height: 62 20 | 21 | signal pressed(); 22 | signal released(); 23 | signal canceled(); 24 | signal clicked(); 25 | 26 | color: enabled ? (selected ? pressedColor : normalColor) : disabledColor; 27 | radius: 8; 28 | border.width: 1; 29 | border.color: enabled ? borderColor : disabledBorderColor; 30 | 31 | MouseArea { 32 | anchors.fill: parent; 33 | visible: btn.enabled; 34 | onPressed: { 35 | parent.color = pressedColor; 36 | btn.pressed(); 37 | } 38 | 39 | onReleased: { 40 | refresh(); 41 | btn.released(); 42 | } 43 | 44 | onCanceled: { 45 | refresh(); 46 | btn.canceled(); 47 | } 48 | 49 | onClicked: { 50 | refresh(); 51 | btn.clicked(); 52 | } 53 | } 54 | 55 | Text { 56 | id: txt; 57 | anchors.fill: parent; 58 | verticalAlignment: Text.AlignVCenter; 59 | horizontalAlignment: Text.AlignHCenter; 60 | anchors.verticalCenter: parent.verticalCenter; 61 | font.pixelSize: 40; 62 | font.family: "Simhei"; 63 | color: btn.enabled ? textColor : disabledTextColor; 64 | } 65 | 66 | Image { 67 | id: icon; 68 | source: ""; 69 | anchors.centerIn: parent; 70 | } 71 | 72 | function refresh() { 73 | color = enabled ? (selected ? pressedColor : normalColor) : disabledColor; 74 | } 75 | 76 | onSelectedChanged: { 77 | refresh(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/DuDuTabViewStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Controls.Styles 1.4 3 | import QtQuick.Layouts 1.3 4 | /******************************************************************************************************* 5 | * tabviewstyle 6 | * Common control style 7 | ********************************************************************************************************/ 8 | TabViewStyle { 9 | tab: Item{ 10 | implicitWidth: Math.max(text.width + 8, 80); 11 | implicitHeight: 48; 12 | Rectangle { 13 | width: (styleData.index < control.count - 1) ? (parent.width - 2) : parent.width; 14 | height: parent.height - 4; 15 | anchors.top: parent.top; 16 | anchors.left: parent.left; 17 | anchors.leftMargin: 1; 18 | visible: styleData.selected; 19 | gradient: Gradient { 20 | GradientStop{position: 0.0; color: "#606060";} 21 | GradientStop{position: 0.5; color: "#c0c0c0";} 22 | GradientStop{position: 1.0; color: "#a0a0a0";} 23 | } 24 | } 25 | Rectangle { 26 | width: 2; 27 | height: parent.height - 4; 28 | anchors.top: parent.top; 29 | anchors.right: parent.right; 30 | visible: styleData.index < control.count - 1; 31 | gradient: Gradient { 32 | GradientStop{position: 0.0; color: "#404040";} 33 | GradientStop{position: 0.5; color: "#707070";} 34 | GradientStop{position: 1.0; color: "#404040";} 35 | } 36 | } 37 | RowLayout { 38 | implicitWidth: Math.max(text.width, 72); 39 | height: 48; 40 | anchors.centerIn: parent; 41 | z: 1; 42 | // Image{ 43 | // width: 48; 44 | // height: 48; 45 | // source: warnrect.icons[styleData.index%3]; 46 | // } 47 | Text { 48 | id: text; 49 | text: styleData.title; 50 | font.pointSize: 20; 51 | color: styleData.selected ? "blue" : (styleData.hovered ? "green" : "white"); 52 | } 53 | } 54 | } 55 | tabBar: Rectangle { 56 | height: 56; 57 | gradient: Gradient { 58 | GradientStop{position: 0.0; color: "#484848";} 59 | GradientStop{position: 0.3; color: "#787878";} 60 | GradientStop{position: 1.0; color: "#a0a0a0";} 61 | } 62 | Rectangle { 63 | width: parent.width; 64 | height: 4; 65 | anchors.bottom: parent.bottom; 66 | border.width: 2; 67 | border.color: "#c7c7c7"; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/FlatButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | /*** 3 | * icon + text button 4 | */ 5 | Rectangle { 6 | id: bkgrd 7 | implicitHeight: 50; 8 | implicitWidth: 120; 9 | color: "transparent"; 10 | radius: 6; 11 | 12 | property alias iconSource: icon.source; 13 | property alias iconWidth: icon.width; 14 | property alias iconHeight: icon.height; 15 | property alias textColor: btnText.color; 16 | property alias textFont: btnText.font; 17 | property alias text: btnText.text; 18 | property bool bHovered: false; 19 | signal clicked; 20 | 21 | Image { 22 | id: icon 23 | anchors.verticalCenter: parent.verticalCenter; 24 | } 25 | Text { 26 | id: btnText; 27 | anchors.left: icon.right; 28 | anchors.verticalCenter: parent.verticalCenter; 29 | anchors.margins: 4; 30 | color: ma.pressed ? "blue" : (parent.bHovered ? "#0000a0" : "white"); 31 | } 32 | MouseArea { 33 | id: ma; 34 | anchors.fill: parent; 35 | hoverEnabled: true; 36 | onEnabledChanged: { 37 | bkgrd.bHovered = true; 38 | } 39 | onExited: { 40 | bkgrd.bHovered = false; 41 | } 42 | onClicked: { 43 | bkgrd.bHovered = false; 44 | bkgrd.clicked(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/Function.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 函 数: dateFormat 3 | * 功 能: 时间字符串转换函数 4 | * 参 数: nSeconds [in] 传入的时间值 单位S 5 | * 返回值: 无 6 | */ 7 | 8 | function dateFormat(second){ 9 | var timeTxt=""; 10 | var hh,mm,ss; 11 | 12 | hh = second / 3600 | 0; 13 | second = Math.round(second) - hh * 3600; 14 | mm = second / 60 | 0; 15 | ss = Math.round(second) - mm * 60; 16 | 17 | if(hh!==0) 18 | { 19 | if(hh<10) 20 | { 21 | timeTxt = "0"+hh+":"; 22 | } 23 | else 24 | { 25 | timeTxt = hh+":"; 26 | } 27 | } 28 | if(mm<10) 29 | { 30 | mm = "0"+mm; 31 | } 32 | timeTxt = timeTxt+mm; 33 | 34 | if(ss<10) 35 | { 36 | ss = "0"+ss; 37 | } 38 | timeTxt = timeTxt+":"+ss; 39 | 40 | return timeTxt; 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/PicButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | /*** 3 | * 设置一张图片 4 | */ 5 | Rectangle { 6 | id: root 7 | 8 | color: "transparent"; 9 | property alias picSource: pic.source; 10 | property alias picRadius: root.radius; 11 | signal clicked; 12 | 13 | Image { 14 | id: pic 15 | anchors.fill: parent; 16 | } 17 | 18 | MouseArea { 19 | id: ma; 20 | anchors.fill: parent; 21 | onClicked: { 22 | root.clicked(); 23 | } 24 | onPressed: { 25 | root.color = "green"; 26 | } 27 | onReleased: { 28 | root.color = "transparent"; 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/common/TextButton.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | /*** 4 | * text button 5 | * 选中标记 6 | */ 7 | Rectangle { 8 | id: bkgrd 9 | //implicitHeight: 50; 10 | //implicitWidth: 120; 11 | color: bSelected ? Qt.rgba(128/255, 36/255, 14/255, 1.0) : "transparent"; 12 | radius: width / 3; 13 | 14 | property alias textColor: btnText.color; 15 | property alias text: btnText.text; 16 | property alias textFontSize: btnText.font.pointSize; 17 | property alias bold: btnText.font.bold; 18 | property bool bHovered: false; 19 | property bool bSelected: false; 20 | signal clicked; 21 | 22 | Text { 23 | id: btnText; 24 | anchors.verticalCenter: parent.verticalCenter; 25 | anchors.horizontalCenter: parent.horizontalCenter; 26 | color: ma.pressed ? "blue" : (parent.bHovered ? "#0000a0" : "white"); 27 | font.pointSize: 12; 28 | } 29 | MouseArea { 30 | id: ma; 31 | anchors.fill: parent; 32 | hoverEnabled: true; 33 | onEnabledChanged: { 34 | bkgrd.bHovered = true; 35 | } 36 | onExited: { 37 | bkgrd.bHovered = false; 38 | } 39 | onClicked: { 40 | bkgrd.bHovered = false; 41 | bkgrd.clicked(); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/LeftMainTitleBar.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | /*** 3 | * 标题栏 4 | * 属于LeftMain的标题栏 5 | */ 6 | Rectangle { 7 | id: root; 8 | color: Qt.rgba(161/255, 45/255, 18/255, 1.0); // 后续会做皮肤 统一赋值 9 | 10 | property int nSpace: 60; 11 | // 音乐 12 | Image { 13 | id: imgMusic; 14 | source: "qrc:/images/128music.png" 15 | anchors.left: parent.left; 16 | anchors.leftMargin: 25; 17 | anchors.verticalCenter: parent.verticalCenter; 18 | width: 24; 19 | height: 24; 20 | } 21 | // 云 22 | Image { 23 | id: imgCloud; 24 | source: "qrc:/images/128cloud.png" 25 | anchors.left: imgMusic.left; 26 | anchors.leftMargin: nSpace; 27 | anchors.verticalCenter: parent.verticalCenter; 28 | width: 24; 29 | height: 24; 30 | } 31 | // 电台 32 | Image { 33 | id: imgRadio; 34 | source: "qrc:/images/128radiotower.png" 35 | anchors.left: imgCloud.left; 36 | anchors.leftMargin: nSpace; 37 | anchors.verticalCenter: parent.verticalCenter; 38 | width: 24; 39 | height: 24; 40 | } 41 | // 手机 42 | Image { 43 | id: imgPhone; 44 | source: "qrc:/images/128smartphone.png" 45 | anchors.left: imgRadio.left; 46 | anchors.leftMargin: nSpace; 47 | anchors.verticalCenter: parent.verticalCenter; 48 | width: 24; 49 | height: 24; 50 | } 51 | // 下载 52 | Image { 53 | id: imgDownload; 54 | source: "qrc:/images/128download.png" 55 | anchors.left: imgPhone.left; 56 | anchors.leftMargin: nSpace; 57 | anchors.verticalCenter: parent.verticalCenter; 58 | width: 24; 59 | height: 24; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/MusicMediaPlayerBar.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root; 5 | width: 1000; 6 | height: 60; 7 | color: Qt.rgba(161/255, 45/255, 18/255, 1.0); // 后续会做皮肤 统一赋值 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageKTV.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root; 5 | width: 687; 6 | height: 517; 7 | color: "red"; 8 | clip: true; 9 | } 10 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageList.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | 4 | Rectangle { 5 | id: root; 6 | width: 448; 7 | height: 625; 8 | property var strCurrentSongId: ""; 9 | signal clicked(int index); 10 | color: "transparent"; 11 | 12 | Rectangle{ 13 | id: vline; 14 | color: "#ff9400" 15 | width: 3; 16 | height: 625; 17 | opacity:0.1; 18 | 19 | anchors.left: parent.left; 20 | anchors.top: parent.top; 21 | anchors.bottom: parent.bottom; 22 | 23 | } 24 | 25 | Component{ 26 | id: listelegate; 27 | Rectangle{ 28 | id: mainItem 29 | width: parent.width; 30 | height: 91 31 | //color: "transparent"; 32 | color: ListView.isCurrentItem ? "#ff9400" : "transparent"; 33 | radius: 10; 34 | Image{ 35 | id: imgSong; 36 | source: "qrc:/icon-music.png"; 37 | width: 48; 38 | height: 48; 39 | anchors.verticalCenter: mainItem.verticalCenter; 40 | anchors.left: mainItem.left; 41 | anchors.leftMargin: 20; 42 | 43 | 44 | } 45 | Text{ 46 | id: songNameText; 47 | text: songname; 48 | width: 276; 49 | font.pixelSize: 36; 50 | color: "white"; 51 | anchors.left: imgSong.right; 52 | anchors.leftMargin: 36; 53 | anchors.verticalCenter: mainItem.verticalCenter; 54 | font.bold: true; 55 | elide: Text.ElideRight; 56 | } 57 | Rectangle{ 58 | id: lineRect; 59 | width: 360; 60 | height: 2; 61 | color: mainItem.ListView.isCurrentItem ? "#ff9400" : "#2d2d34"; 62 | 63 | anchors.bottom: parent.bottom; 64 | anchors.left: imgSong.left; 65 | } 66 | 67 | MouseArea{ 68 | anchors.fill: parent; 69 | onClicked: { 70 | console.log("clicked list...index : " + index); 71 | console.log("clicked list...name : " + songname); 72 | mainItem.ListView.view.currentIndex = index; 73 | strCurrentSongId = songId; 74 | JCNet_AppOnlineMusic.playMusic(index); 75 | root.clicked(index); 76 | 77 | } 78 | onPressed:{ 79 | //mainItem.color = pressedColor; 80 | } 81 | onReleased: { 82 | //mainItem.color = normalColor; 83 | } 84 | } 85 | 86 | } 87 | } 88 | ListView{ 89 | id: view; 90 | model: modelOnlineMusicTypeTopName; 91 | delegate: listelegate 92 | orientation: ListView.Vertical; 93 | anchors.fill: parent; 94 | clip: true; 95 | //highlight: Rectangle { color: "#ff9400" } 96 | 97 | onContentYChanged: { 98 | if (view.contentY < 0) { 99 | button.y = 0; 100 | return; 101 | } 102 | 103 | button.y = view.contentY * (rectLine0.height-button.height) / (view.contentHeight-view.height) > (rectLine0.height - button.height) ? 104 | (rectLine0.height - button.height) : 105 | view.contentY * (rectLine0.height-button.height) / (view.contentHeight-view.height); 106 | } 107 | 108 | } 109 | // 竖直滚动条 110 | Rectangle { 111 | id: rectLine0; 112 | 113 | height: 540; 114 | width: 2; 115 | color: Qt.rgba(39/255, 41/255, 47/255, 1.0); 116 | anchors.right: parent.right; 117 | anchors.rightMargin: 36; 118 | anchors.top: parent.top; 119 | anchors.topMargin: 30; 120 | visible: view.contentHeight>view.height ? true : false; 121 | 122 | // 按钮 123 | Rectangle { 124 | id: button; 125 | 126 | x: -4; 127 | width: 9; 128 | height: 95; 129 | radius: 4; 130 | color: Qt.rgba(1.0, 148/255, 0, 1.0); 131 | 132 | // 鼠标区域 133 | MouseArea { 134 | id: mouseArea 135 | 136 | anchors.fill: button; 137 | drag.target: button; 138 | drag.axis: Drag.YAxis; 139 | drag.minimumY: 0; 140 | drag.maximumY: rectLine0.height - button.height; 141 | 142 | // 拖动 143 | onMouseYChanged: { 144 | view.contentY = button.y * (view.contentHeight-view.height) / (rectLine0.height-button.height); 145 | } 146 | } 147 | } 148 | }// Rectangle-rectLine0 149 | 150 | Component.onCompleted: { 151 | view.currentIndex = 0; 152 | } 153 | } 154 | 155 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageLive.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root; 5 | width: 687; 6 | height: 517; 7 | color: "gray"; 8 | clip: true; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageLyric.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | 4 | Rectangle { 5 | id: lyricRect; 6 | width: 687; 7 | height: 517; 8 | color: "transparent"; 9 | clip: true; 10 | 11 | property var m_indexTime: 0; 12 | property bool bNeedGetLycPos: false; // 在收到nowPlaying或者拖动进度条时,需要重新定位歌词 13 | 14 | Component { 15 | id: delegateComp; 16 | 17 | Rectangle { 18 | id: rectLyric; 19 | 20 | width: lyricRect.width; 21 | height: lyricRect.height / 10; 22 | color: "transparent"; 23 | 24 | Text { 25 | id: txtLyric; 26 | 27 | anchors.horizontalCenter: parent.horizontalCenter 28 | 29 | text: qsTr(modelData); 30 | color: rectLyric.ListView.isCurrentItem ? "white" : "gray"; 31 | scale: rectLyric.ListView.isCurrentItem ? 2.0 : 1.5; 32 | font.family: "微软雅黑"; 33 | font.pixelSize: 15; 34 | } 35 | } 36 | } 37 | 38 | // listView 39 | ListView { 40 | id: listViewLyric; 41 | 42 | model: CppLocalMusic.lyrics; 43 | delegate: delegateComp; 44 | //preferredHighlightBegin:0.5; 45 | //preferredHighlightEnd: 0.5; 46 | contentY:getlyricContentY(); 47 | 48 | function getlyricContentY() 49 | { 50 | if(listViewLyric.currentIndex <= 3) 51 | { 52 | return 0; 53 | } 54 | else 55 | { 56 | return lyricRect.height/10*3/2 * (listViewLyric.currentIndex - 4); 57 | } 58 | 59 | } 60 | 61 | anchors.fill: parent; 62 | 63 | spacing: 10; 64 | 65 | Behavior on contentY { 66 | NumberAnimation { duration: 1000; } 67 | } 68 | } 69 | 70 | Connections { 71 | target: CppLocalMusic; 72 | 73 | 74 | 75 | onLyricsChanged:{ 76 | // 切歌 77 | bNeedGetLycPos = true; 78 | 79 | listViewLyric.currentIndex = 0; 80 | m_indexTime = 0; 81 | } 82 | onSigQMLPositionChanged: { 83 | //console.log(" qml sig PositonChanged: " + position); 84 | var time = position * 1000; 85 | 86 | if(bNeedGetLycPos === true) 87 | { 88 | m_indexTime = CppLocalMusic.getIndexByTime(time); 89 | bNeedGetLycPos = false; 90 | listViewLyric.incrementCurrentIndex(); 91 | //listViewLyric.contentY = lyricRect.height/10*3/2 * (listViewLyric.currentIndex - 4) 92 | listViewLyric.currentIndex = m_indexTime + 1; 93 | m_indexTime++; 94 | } 95 | else 96 | { 97 | if(time+800 >= CppLocalMusic.times[m_indexTime]) 98 | { 99 | listViewLyric.incrementCurrentIndex(); 100 | //listViewLyric.contentY = lyricRect.height/10*3/2 * (listViewLyric.currentIndex - 4) 101 | m_indexTime++; 102 | } 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageRadio.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | /*** 3 | * 右边电台 4 | */ 5 | Rectangle { 6 | id: root; 7 | width: 687; 8 | height: 517; 9 | color: "yellow"; 10 | clip: true; 11 | } 12 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/PageSongList.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | id: root; 5 | width: 687; 6 | height: 517; 7 | color: "gray"; 8 | clip: true; 9 | } 10 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/TreeViewTest.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | import QtQuick.Layouts 1.2 3 | import QtQuick.Controls 1.4 4 | import QtQuick.Controls.Styles 1.4 5 | 6 | /*** 7 | * 测试treeview 8 | */ 9 | Rectangle { 10 | id: root 11 | 12 | property var ctrl 13 | property var model 14 | 15 | x:100 16 | y:50 17 | TreeView { 18 | id:view 19 | width: 500 20 | anchors.fill: parent; 21 | TableViewColumn { 22 | title: "Name" 23 | role: "name" 24 | width: 250 25 | } 26 | TableViewColumn { 27 | title: "Simplify" 28 | role: "simplify" 29 | width: 50 30 | } 31 | model: root.model 32 | itemDelegate: Item { 33 | Text { 34 | anchors.verticalCenter: parent.verticalCenter 35 | color: "black" 36 | elide: styleData.elideMode 37 | text: styleData.value 38 | font.pixelSize: 12; 39 | font.bold: true; 40 | } 41 | } 42 | headerDelegate: Rectangle{ 43 | id: head; 44 | width: 100; 45 | height: 40; 46 | color: styleData.pressed ?"red" : "gray"; 47 | Text{ 48 | anchors.verticalCenter: parent.verticalCenter 49 | color: styleData.pressed ? "blue" : "green"; 50 | text: styleData.value 51 | font.pixelSize: 20; 52 | font.bold: true; 53 | } 54 | } 55 | 56 | rowDelegate: Rectangle { 57 | id: rowRect; 58 | //color: "transparent" 59 | width: 250; 60 | height: 40; 61 | Text{ 62 | anchors.verticalCenter: parent.verticalCenter 63 | color: styleData.pressed ? "blue" : "green"; 64 | font.pixelSize: 14; 65 | font.bold: true; 66 | } 67 | Rectangle{ 68 | id:line 69 | width: 250; 70 | height: 1; 71 | color: "gray"; 72 | 73 | } 74 | } 75 | 76 | property bool isCollapse: true 77 | onClicked: { 78 | console.log("onClicked:", index) 79 | console.log("isExpanded:",isExpanded(index)) 80 | //isExpanded(index) 81 | /*if (isCollapse) 82 | { 83 | console.log("expand") 84 | emit: view.expand(index); 85 | isCollapse = false; 86 | } 87 | else 88 | { 89 | console.log("collapse") 90 | emit: view.collapse(index); 91 | isCollapse = true; 92 | } 93 | if (isExpanded(index)) 94 | { 95 | collapse(index); 96 | } 97 | else 98 | { 99 | expand(index); 100 | }*/ 101 | } 102 | onDoubleClicked: { 103 | if (isExpanded(index)) 104 | { 105 | collapse(index); 106 | } 107 | else 108 | { 109 | expand(index); 110 | } 111 | } 112 | } 113 | 114 | // Rectangle { 115 | // width: 50 116 | // height: 50 117 | // color: "red" 118 | // anchors.top: view.bottom 119 | // anchors.topMargin: 50 120 | // Button { 121 | // anchors.fill: parent 122 | // text: qsTr("Add") 123 | // style: ButtonStyle{ 124 | // background: Rectangle{ 125 | // anchors.fill: parent 126 | // color: "transparent" 127 | // } 128 | // label: Label{ 129 | // anchors.centerIn: parent 130 | // text: control.text 131 | // font.pixelSize: 20 132 | // } 133 | // } 134 | // onClicked: { 135 | // //addDataClicked(QModelIndex index) 136 | // root.ctrl.addDataClicked(view.currentIndex); 137 | // } 138 | // } 139 | // } 140 | } 141 | 142 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/PageItem.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | 4 | Rectangle { 5 | id: root; 6 | 7 | property alias setImg: itemImg.source; 8 | property alias setTxt: itemTxt.text; 9 | 10 | signal sigRelease(url src, string txt); 11 | 12 | width: 250; 13 | height: 160; 14 | 15 | Image { 16 | id: itemImg 17 | width: 250; 18 | height: 160; 19 | source: "qrc:/images/null.png"; 20 | } 21 | 22 | Text{ 23 | id: itemTxt; 24 | anchors.top: root.top; 25 | anchors.topMargin: 116; 26 | anchors.horizontalCenter: parent.horizontalCenter; 27 | font.pixelSize: 36; 28 | color: "white"; 29 | } 30 | MouseArea { 31 | anchors.fill: parent; 32 | 33 | onReleased: { 34 | sigRelease(itemImg.source, itemTxt.text); 35 | } 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/PageSingerList.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | Rectangle { 3 | id: root; 4 | 5 | width: 1280; 6 | height: 625; 7 | color: "transparent"; 8 | clip: true; 9 | property alias listModel: item.model; 10 | 11 | Component{ 12 | id: listDelegate; 13 | Rectangle { 14 | id: root; 15 | 16 | property alias setImg: itemImg.source; 17 | property alias setTxt: itemTxt.text; 18 | 19 | signal sigRelease(url src, string txt); 20 | 21 | width: 250; 22 | height: 290; 23 | color: "transparent"; 24 | 25 | Image { 26 | id: itemImg 27 | width: 250; 28 | height: 250; 29 | source: singerpicurl != "" ? singerpicurl : "qrc:/images/null.png"; 30 | } 31 | 32 | Text{ 33 | id: itemTxt; 34 | anchors.top: itemImg.bottom; 35 | anchors.topMargin: 4; 36 | anchors.horizontalCenter: parent.horizontalCenter; 37 | font.pixelSize: 36; 38 | color: "white"; 39 | text: singername; 40 | } 41 | MouseArea { 42 | anchors.fill: parent; 43 | 44 | onReleased: { 45 | sigRelease(itemImg.source, itemTxt.text); 46 | } 47 | } 48 | 49 | } 50 | } 51 | 52 | 53 | Flickable { 54 | id: hotFlicker; 55 | 56 | anchors.fill: parent; 57 | clip: true; 58 | anchors.top: parent.top; 59 | anchors.topMargin: 34; 60 | anchors.left: parent.left; 61 | anchors.leftMargin: 158; 62 | anchors.right: parent.right; 63 | anchors.rightMargin: 158; 64 | 65 | contentWidth: hotGrid.width; 66 | contentHeight: hotGrid.height; 67 | boundsBehavior: Flickable.StopAtBounds; 68 | 69 | Grid { 70 | id: hotGrid; 71 | 72 | columns: 2; 73 | columnSpacing: 107; 74 | rowSpacing: 30; 75 | anchors.horizontalCenter: parent.horizontalCenter; 76 | Repeater { 77 | id: item 78 | model: modelOnlineMusicTypeTopName; 79 | delegate: listDelegate; 80 | } 81 | 82 | } 83 | 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageEmotion.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Rectangle { 4 | id: root; 5 | 6 | anchors.fill: parent; 7 | color: "transparent"; 8 | clip: true; 9 | property alias listModel: item.model; 10 | 11 | Flickable { 12 | id: hotFlicker; 13 | 14 | anchors.fill: parent; 15 | clip: true; 16 | anchors.top: parent.top; 17 | anchors.topMargin: 34; 18 | anchors.left: parent.left; 19 | anchors.leftMargin: 50; 20 | anchors.right: parent.right; 21 | anchors.rightMargin: 50; 22 | 23 | contentWidth: hotGrid.width; 24 | contentHeight: hotGrid.height; 25 | boundsBehavior: Flickable.StopAtBounds; 26 | 27 | Grid { 28 | id: hotGrid; 29 | 30 | columns: 2; 31 | columnSpacing: 107; 32 | rowSpacing: 30; 33 | anchors.horizontalCenter: parent.horizontalCenter; 34 | Repeater { 35 | id: item 36 | model: listModel; 37 | delegate: PageItem{ 38 | setImg: picUrl; 39 | setTxt: type; 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | 47 | } 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageHot.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Rectangle { 4 | id: root; 5 | 6 | anchors.fill: parent; 7 | color: "transparent"; 8 | clip: true; 9 | 10 | signal sigChooseTopItem(var name, var url); 11 | 12 | property int nSpace: 50 13 | Flickable { 14 | id: hotFlicker; 15 | 16 | anchors.fill: parent; 17 | clip: true; 18 | anchors.top: parent.top; 19 | anchors.topMargin: 34; 20 | anchors.left: parent.left; 21 | anchors.leftMargin: nSpace; 22 | anchors.right: parent.right; 23 | anchors.rightMargin: nSpace; 24 | contentWidth: hotGrid.width; 25 | contentHeight: hotGrid.height; 26 | boundsBehavior: Flickable.StopAtBounds; 27 | property int nIndex: 0 28 | Grid { 29 | id: hotGrid; 30 | 31 | columns: 2; 32 | columnSpacing: 107; 33 | rowSpacing: 30; 34 | 35 | Repeater { 36 | anchors.horizontalCenter: parent.horizontalCenter; 37 | model: modelOnlineMusicTypeHot; 38 | delegate: PageItem{ 39 | setImg: url; 40 | setTxt: name; 41 | 42 | onSigRelease: { 43 | hotFlicker.nIndex = index; 44 | root.sigChooseTopItem(name, url); 45 | } 46 | 47 | } 48 | 49 | } 50 | 51 | } 52 | 53 | onNIndexChanged: { 54 | //console.log("------: " + nIndex); 55 | } 56 | 57 | 58 | } 59 | Component.onCompleted: { 60 | //console.log("qml getData ..."); 61 | //JCNet_AppOnlineMusic.getHotData(); 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageLanguage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | 4 | 5 | Rectangle { 6 | id: root; 7 | 8 | anchors.fill: parent; 9 | color: "transparent"; 10 | clip: true; 11 | property alias listModel: item.model; 12 | 13 | Flickable { 14 | id: hotFlicker; 15 | 16 | anchors.fill: parent; 17 | clip: true; 18 | anchors.top: parent.top; 19 | anchors.topMargin: 34; 20 | anchors.left: parent.left; 21 | anchors.leftMargin: 50; 22 | anchors.right: parent.right; 23 | anchors.rightMargin: 50; 24 | 25 | contentWidth: hotGrid.width; 26 | contentHeight: hotGrid.height; 27 | boundsBehavior: Flickable.StopAtBounds; 28 | 29 | Grid { 30 | id: hotGrid; 31 | 32 | columns: 2; 33 | columnSpacing: 107; 34 | rowSpacing: 30; 35 | anchors.horizontalCenter: parent.horizontalCenter; 36 | Repeater { 37 | id: item 38 | model: listModel; 39 | delegate: PageItem{ 40 | setImg: picUrl; 41 | setTxt: type; 42 | 43 | } 44 | 45 | } 46 | 47 | } 48 | 49 | } 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageSence.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | 4 | Rectangle { 5 | id: root; 6 | 7 | anchors.fill: parent; 8 | color: "transparent"; 9 | clip: true; 10 | property alias listModel: item.model; 11 | 12 | Flickable { 13 | id: hotFlicker; 14 | 15 | anchors.fill: parent; 16 | clip: true; 17 | anchors.top: parent.top; 18 | anchors.topMargin: 34; 19 | anchors.left: parent.left; 20 | anchors.leftMargin: 50; 21 | anchors.right: parent.right; 22 | anchors.rightMargin: 50; 23 | 24 | contentWidth: hotGrid.width; 25 | contentHeight: hotGrid.height; 26 | boundsBehavior: Flickable.StopAtBounds; 27 | 28 | Grid { 29 | id: hotGrid; 30 | 31 | columns: 2; 32 | columnSpacing: 107; 33 | rowSpacing: 30; 34 | anchors.horizontalCenter: parent.horizontalCenter; 35 | Repeater { 36 | id: item 37 | model: listModel; 38 | delegate: PageItem{ 39 | setImg: picUrl; 40 | setTxt: type; 41 | 42 | } 43 | 44 | } 45 | 46 | } 47 | 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageStyle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | 4 | Rectangle { 5 | id: root; 6 | 7 | anchors.fill: parent; 8 | color: "transparent"; 9 | clip: true; 10 | property alias listModel: item.model; 11 | 12 | Flickable { 13 | id: hotFlicker; 14 | 15 | anchors.fill: parent; 16 | clip: true; 17 | anchors.top: parent.top; 18 | anchors.topMargin: 34; 19 | anchors.left: parent.left; 20 | anchors.leftMargin: 50; 21 | anchors.right: parent.right; 22 | anchors.rightMargin: 50; 23 | 24 | contentWidth: hotGrid.width; 25 | contentHeight: hotGrid.height; 26 | boundsBehavior: Flickable.StopAtBounds; 27 | 28 | Grid { 29 | id: hotGrid; 30 | 31 | columns: 2; 32 | columnSpacing: 107; 33 | rowSpacing: 30; 34 | anchors.horizontalCenter: parent.horizontalCenter; 35 | Repeater { 36 | id: item 37 | model: listModel; 38 | delegate: PageItem{ 39 | setImg: picUrl; 40 | setTxt: type; 41 | 42 | } 43 | 44 | } 45 | 46 | } 47 | 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/onlinemusic/pageYears.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Rectangle { 4 | id: root; 5 | 6 | anchors.fill: parent; 7 | color: "transparent"; 8 | clip: true; 9 | property alias listModel: item.model; 10 | 11 | Flickable { 12 | id: hotFlicker; 13 | 14 | anchors.fill: parent; 15 | clip: true; 16 | anchors.top: parent.top; 17 | anchors.topMargin: 34; 18 | anchors.left: parent.left; 19 | anchors.leftMargin: 50; 20 | anchors.right: parent.right; 21 | anchors.rightMargin: 50; 22 | 23 | contentWidth: hotGrid.width; 24 | contentHeight: hotGrid.height; 25 | boundsBehavior: Flickable.StopAtBounds; 26 | 27 | Grid { 28 | id: hotGrid; 29 | 30 | columns: 2; 31 | columnSpacing: 107; 32 | rowSpacing: 30; 33 | anchors.horizontalCenter: parent.horizontalCenter; 34 | Repeater { 35 | id: item 36 | model: listModel; 37 | delegate: PageItem{ 38 | setImg: picUrl; 39 | setTxt: type; 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | 47 | } 48 | 49 | } 50 | 51 | -------------------------------------------------------------------------------- /DuDuPlayer/qml/sub/video/DuDuVideo.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtMultimedia 5.6 3 | /*** 4 | * 视频播放界面 5 | */ 6 | Rectangle { 7 | id: root 8 | color: "transparent" 9 | 10 | MediaPlayer { 11 | id: meadiaPlayer; 12 | 13 | } 14 | 15 | VideoOutput { 16 | id: videoOutput; 17 | width: parent.width; 18 | height: parent.height; 19 | source: meadiaPlayer; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /DuDuPlayer/设计图/主页.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AiLoverer/DuDuPlayer/d997e05d3134057757d4c6d094ae4b65fde17fdf/DuDuPlayer/设计图/主页.png -------------------------------------------------------------------------------- /DuDuPlayer/设计图/规格.txt: -------------------------------------------------------------------------------- 1 | mainpage----1000 x 700 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DuDuPlayer 2 | create by qml 3 | --------------------------------------------------------------------------------