Linking to http://www.kubuntuforums.net/showthr...295#post331295
Standard warning
This is quick&dirty: http://en.wikipedia.org/wiki/Quick-and-dirty - it is working at here, there it may eat the puppies&kittens and tease the hens: https://www.youtube.com/watch?v=6PFrfB685zs&hd=1
Concept
The Dolphin tooltips (.../kde-baseapps/dolphin/src/views/tooltips/tooltipmanager.cpp) have:
Code:
void ToolTipManager::showToolTip()
Code:
void ToolTipManager::hideToolTip()
1) Starting a media player when the tooltip is shown.
2) Terminating a media player when the tooltip is removed.
Needed
- The Dolphin source
- media player, tested with the Sox (play) & FFmpeg (ffplay)
man play:
SoX(1) Sound eXchange SoX(1)
NAME
SoX - Sound eXchange, the Swiss Army knife of audio manipulation
...
play [global-options] [format-options] infile1
[[format-options] infile2] ... [format-options]
[effect [effect-options]] ...
...
NAME
SoX - Sound eXchange, the Swiss Army knife of audio manipulation
...
play [global-options] [format-options] infile1
[[format-options] infile2] ... [format-options]
[effect [effect-options]] ...
...
Simple media player
usage: ffplay [options] input_file
...
ffplay version 2.0 Copyright (c) 2003-2013 the FFmpeg developers
built on Jul 15 2013 07:09:57 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared...
usage: ffplay [options] input_file
...
ffplay version 2.0 Copyright (c) 2003-2013 the FFmpeg developers
built on Jul 15 2013 07:09:57 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
configuration: --prefix=/opt/ffmpeg --libdir=/opt/ffmpeg/lib/ --enable-shared...
Packages:
- build-essential
- dpkg-dev
- fakeroot
- kde-baseapps build-dependencies (the build will tell what is missing)
Audio preview with Sox - play
Adding:
Code:
#include <QProcess>
Code:
void ToolTipManager::showToolTip() { ... //Start Play QObject *parent; QString program = "/usr/bin/play"; QStringList arguments; arguments << m_item.localPath(); QProcess *startPlay = new QProcess(parent); startPlay->start(program, arguments); ... }
Code:
void ToolTipManager::hideToolTip() { ... //Kill PLay QObject *parent; QString program = "/usr/bin/pkill"; QStringList arguments; arguments << "-f" << "/usr/bin/play"; QProcess *killPlay = new QProcess(parent); killPlay->start(program, arguments); ... }
Media preview with FFmpeg - ffplay
The difference file for the ffplay: http://pastebin.com/TXR3APd7
Example
1) Getting the Dolphin source
$ sudo apt-get source dolphin
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'kde-baseapps' as source package instead of 'dolphin'
NOTICE: 'kde-baseapps' packaging is maintained in the 'Bzr' version control system at:
https://code.launchpad.net/~kubuntu-...g/kde-baseapps
Please use:
bzr branch https://code.launchpad.net/~kubuntu-...g/kde-baseapps
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 2,687 kB of source archives.
Get:1 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (dsc) [3,731 B]
Get:2 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (tar) [2,589 kB]
Get:3 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (diff) [94.3 kB]
Fetched 2,687 kB in 19s (135 kB/s)
gpgv: Signature made Fri 28 Jun 2013 09:13:10 PM EEST using RSA key ID F2672094
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./kde-baseapps_4.10.90-0ubuntu1.dsc
dpkg-source: info: extracting kde-baseapps in kde-baseapps-4.10.90
dpkg-source: info: unpacking kde-baseapps_4.10.90.orig.tar.xz
dpkg-source: info: unpacking kde-baseapps_4.10.90-0ubuntu1.debian.tar.gz
dpkg-source: info: applying enable_debianabimanager.diff
dpkg-source: info: applying kubuntu_folderview_livecd_directory.diff
dpkg-source: info: applying kubuntu_folderwidget_drawing.diff
dpkg-source: info: applying kubuntu_install_flash.diff
dpkg-source: info: applying kubuntu_konq_scans_nsplugins_at_startup.diff
dpkg-source: info: applying enable_dlrestrictions.diff
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'kde-baseapps' as source package instead of 'dolphin'
NOTICE: 'kde-baseapps' packaging is maintained in the 'Bzr' version control system at:
https://code.launchpad.net/~kubuntu-...g/kde-baseapps
Please use:
bzr branch https://code.launchpad.net/~kubuntu-...g/kde-baseapps
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 2,687 kB of source archives.
Get:1 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (dsc) [3,731 B]
Get:2 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (tar) [2,589 kB]
Get:3 http://fi.archive.ubuntu.com/ubuntu/ saucy/universe kde-baseapps 4:4.10.90-0ubuntu1 (diff) [94.3 kB]
Fetched 2,687 kB in 19s (135 kB/s)
gpgv: Signature made Fri 28 Jun 2013 09:13:10 PM EEST using RSA key ID F2672094
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./kde-baseapps_4.10.90-0ubuntu1.dsc
dpkg-source: info: extracting kde-baseapps in kde-baseapps-4.10.90
dpkg-source: info: unpacking kde-baseapps_4.10.90.orig.tar.xz
dpkg-source: info: unpacking kde-baseapps_4.10.90-0ubuntu1.debian.tar.gz
dpkg-source: info: applying enable_debianabimanager.diff
dpkg-source: info: applying kubuntu_folderview_livecd_directory.diff
dpkg-source: info: applying kubuntu_folderwidget_drawing.diff
dpkg-source: info: applying kubuntu_install_flash.diff
dpkg-source: info: applying kubuntu_konq_scans_nsplugins_at_startup.diff
dpkg-source: info: applying enable_dlrestrictions.diff
Adding the code snippets, saving...
3) Moving to the /kde-baseapps-4.X.X directory.
Trying the build:
Code:
dpkg-buildpackage -b -rfakeroot -us -uc
dpkg-checkbuilddeps: Unmet build dependencies: libdlrestrictions-dev (>= 0.14) libkactivities-dev (>= 4:4.10.90) nepomuk-core-dev (>= 4:4.10.90) libnepomukwidgets-dev (>= 4:4.10.90) libqimageblitz-dev (>= 1:0.0.4-2) libstreamanalyzer-dev (>= 0.6.3) libtidy-dev
Trying the build again.
=> Lot of packages. Only the Dolphin is needed. The Konqueror is sharing the tooltips.
4) Installing the Dolphin
5) Testing
- Shutting all Dolphins.
- Starting the Dolphin and enabling the tooltips.
- testing
Note #1
The ffplay needs the focus stealing prevention !!!!!!!!!!!!!!!!: KDE System Settings > Window Behavior > Window rules.
Note #2
Back to the standard Dolphin:
Code:
sudo apt-get clean sudo apt-get install --reinstall dolphin
Comment