aboutsummaryrefslogtreecommitdiffstats
path: root/examples/winextras/musicplayer/doc
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-09-30 23:02:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-04 16:21:24 +0200
commita8699963b98fe2d1dcc33658ac006100b69444b1 (patch)
tree49889bb003740d573afd9c311b7ac96a39e0e099 /examples/winextras/musicplayer/doc
parentf3bc479f070dbe4ee3e784480101dad1c2e84296 (diff)
A music player example
Change-Id: Ie28baa6373a8852b31137ed3c076ab4309d1c98f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'examples/winextras/musicplayer/doc')
-rw-r--r--examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.pngbin0 -> 123581 bytes
-rw-r--r--examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.pngbin0 -> 59305 bytes
-rw-r--r--examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.pngbin0 -> 12622 bytes
-rw-r--r--examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.pngbin0 -> 56812 bytes
-rw-r--r--examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc128
5 files changed, 128 insertions, 0 deletions
diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png
new file mode 100644
index 0000000..3ae91f9
--- /dev/null
+++ b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png
Binary files differ
diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png
new file mode 100644
index 0000000..682449b
--- /dev/null
+++ b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png
Binary files differ
diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png
new file mode 100644
index 0000000..b03d192
--- /dev/null
+++ b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png
Binary files differ
diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png
new file mode 100644
index 0000000..2198ec8
--- /dev/null
+++ b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png
Binary files differ
diff --git a/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc b/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc
new file mode 100644
index 0000000..d6b088b
--- /dev/null
+++ b/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+ \example musicplayer
+ \title Music Player
+ \ingroup examples-qtwinextras
+ \brief Demonstrates managing Windows DWM features, jump lists,
+ taskbar button overlay, and thumbnail toolbar.
+
+ \image qtwinextras-musicplayer-composited.png Screenshot of the Music Player example
+
+ The Music Player example demonstrates how to use the various features
+ provided by the QtWinExtras module.
+
+ \note The example uses QMediaPlayer from the QtMultimedia module to play
+ the music, but this article focuses on the parts where QtWinExtras features
+ are used.
+
+ \section1 DWM Features
+
+ The example uses Windows DWM (Desktop Window Manager) features to visually
+ integrate the window content to the window frame and to make the main window
+ and the volume popup translucent and blurred.
+
+ The example applies a different look based on whether composition is enabled
+ or not. When composition is enabled, the main window is made translucent and
+ the window frame is extended to the client area to make the window content
+ integrate seamlessly to the window frame as shown above. When composition
+ is disabled, the colorization color is used as a background color. The
+ following screenshot illustrates how the Music Player example looks when
+ composition is disabled.
+
+ \image qtwinextras-musicplayer-non-composited.png Screenshot of the Music Player example
+
+ The respective code is a combination of extending or resetting the system
+ frame, adjusting the necessary QWidget attributes, and setting an appropriate
+ style sheet to achieve the desired look.
+
+ \snippet musicplayer/musicplayer.cpp 1
+
+ The volume popup does not have a window frame so it is enough to make the
+ popup blurred when composition is enabled. Additionally, a style sheet is
+ applied to get a border that follows the colorization color. Just like for
+ the main window, when composition is disabled, the colorization color is
+ used as a background color.
+
+ \snippet musicplayer/volumebutton.cpp 0
+
+ The example application respects the user's composition settings, reacts
+ to dynamic composition changes, and looks solid regardless of whether
+ composition is enabled or not. It accomplishes this by catching
+ QWinEvent::CompositionChange and QWinEvent::ColorizationChange events
+ and adjusting its looks accordingly.
+
+ \snippet musicplayer/musicplayer.cpp 0
+
+ \section1 Jump List
+
+ The example creates a custom jump list to provide the user with fast
+ access to recently played music files.
+
+ \snippet musicplayer/musicplayer.cpp 4
+
+ To enable the application jump list to show the desired recent files,
+ the corresponding file types are registered using the following helper
+ function.
+
+ \snippet musicplayer/main.cpp 0
+
+ \section1 Taskbar Overlay and Progress
+
+ The example uses Windows Taskbar for two things; it sets an overlay icon
+ that represents the current music playback state, and it indicates the
+ playback progress in the taskbar button.
+
+ \image qtwinextras-musicplayer-taskbar.png Screenshot of the Music Player taskbar
+
+ The following snippet shows how the taskbar button is prepared. The playback
+ progress is wired directly to the taskbar progress indicator by using signals
+ and slots.
+
+ \snippet musicplayer/musicplayer.cpp 5
+
+ The overlay icon and the progress indicator are updated whenever the state
+ of the music playback changes.
+
+ \snippet musicplayer/musicplayer.cpp 2
+
+ \section1 Thumbnail Toolbar
+
+ \image qtwinextras-musicplayer-thumbnail.png Screenshot of the Music Player thumbnail
+
+ The Windows Thumbnail Toolbar is used for providing basic music playback
+ controls. These controls can be used to control the application without
+ having to activate the application.
+
+ \snippet musicplayer/musicplayer.cpp 6
+
+ The buttons in the thumbnail toolbar are updated accordingly whenever the state
+ of the music playback changes.
+
+ \snippet musicplayer/musicplayer.cpp 3
+*/