From 84da08d7b7fcda12c85caeb5a10b4903770a6f69 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- noatun-plugins/alsaplayer/AlsaPlayer.ui | 2640 +++++++++++++++++++++++++ noatun-plugins/alsaplayer/Custom.cw | 20 + noatun-plugins/alsaplayer/Makefile.am | 24 + noatun-plugins/alsaplayer/alsaplayerui.cpp | 35 + noatun-plugins/alsaplayer/alsaplayerui.plugin | 84 + noatun-plugins/alsaplayer/configmodule.cpp | 72 + noatun-plugins/alsaplayer/configmodule.h | 53 + noatun-plugins/alsaplayer/seeker.cpp | 61 + noatun-plugins/alsaplayer/seeker.h | 50 + noatun-plugins/alsaplayer/userinterface.cpp | 339 ++++ noatun-plugins/alsaplayer/userinterface.h | 91 + 11 files changed, 3469 insertions(+) create mode 100644 noatun-plugins/alsaplayer/AlsaPlayer.ui create mode 100644 noatun-plugins/alsaplayer/Custom.cw create mode 100644 noatun-plugins/alsaplayer/Makefile.am create mode 100644 noatun-plugins/alsaplayer/alsaplayerui.cpp create mode 100644 noatun-plugins/alsaplayer/alsaplayerui.plugin create mode 100644 noatun-plugins/alsaplayer/configmodule.cpp create mode 100644 noatun-plugins/alsaplayer/configmodule.h create mode 100644 noatun-plugins/alsaplayer/seeker.cpp create mode 100644 noatun-plugins/alsaplayer/seeker.h create mode 100644 noatun-plugins/alsaplayer/userinterface.cpp create mode 100644 noatun-plugins/alsaplayer/userinterface.h (limited to 'noatun-plugins/alsaplayer') diff --git a/noatun-plugins/alsaplayer/AlsaPlayer.ui b/noatun-plugins/alsaplayer/AlsaPlayer.ui new file mode 100644 index 0000000..772af81 --- /dev/null +++ b/noatun-plugins/alsaplayer/AlsaPlayer.ui @@ -0,0 +1,2640 @@ + +APMainWindow + + + APMainWindow + + + + 0 + 0 + 385 + 118 + + + + Noaplayer + + + true + + + + + + + + unnamed + + + 4 + + + 2 + + + + Frame3 + + + + + + 0 + 0 + 0 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 10 + 95 + 137 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 10 + 95 + 137 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 0 + 0 + 0 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 10 + 95 + 137 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + NoFrame + + + Plain + + + + + + + + unnamed + + + 2 + + + 4 + + + + speedLabelLeft + + + + 1 + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + Speed: + + + AlignVCenter|AlignRight + + + + + + + timeLabel + + + + 1 + 5 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + No time data + + + + + speedLabel + + + + 1 + 5 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + 100% + + + + + titleLabel + + + + 7 + 5 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + No stream + + + + + volumeLabel + + + + 1 + 1 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + 100% + + + + + volumeLabelLeft + + + + 1 + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + Volume: + + + AlignVCenter|AlignRight + + + + + + + infoLabel + + + + 7 + 5 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 241 + 241 + 241 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 128 + 128 + 128 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 128 + 128 + 128 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + 255 + 255 + 255 + + + 228 + 228 + 228 + + + 255 + 255 + 255 + + + 255 + 255 + 255 + + + 114 + 114 + 114 + + + 152 + 152 + 152 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + 8 + 93 + 139 + + + 255 + 255 + 255 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + + 0 + + + ... + + + + + + + seeker + + + + 32 + 16 + + + + + + Layout10 + + + + + + unnamed + + + 0 + + + 4 + + + + Layout9 + + + + + + unnamed + + + 0 + + + 0 + + + + Spacer1 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + Layout8 + + + + + + unnamed + + + 0 + + + 2 + + + + menuButton + + + + + + image0 + + + 0 + + + true + + + Menu + + + + + previousButton + + + + + + image1 + + + true + + + Skip to previous track + + + + + playButton + + + + + + image2 + + + true + + + Play + + + + + nextButton + + + + + + image3 + + + true + + + Skip to next track + + + + + stopButton + + + + + + image4 + + + true + + + Stop + + + + + playlistButton + + + + + + image5 + + + true + + + Show playlist + + + + + + + Spacer2 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + + Layout5 + + + + + + unnamed + + + 0 + + + 2 + + + + Layout3 + + + + + + unnamed + + + 0 + + + 2 + + + + pauseButton + + + true + + + + + + image6 + + + true + + + Pause + + + + + forwardButton + + + true + + + + + + image7 + + + true + + + Forwards, normal speed + + + + + speedSlider + + + true + + + 233 + + + 66 + + + Horizontal + + + Playback speed and direction + + + + + + + Layout4 + + + + + + unnamed + + + 0 + + + 2 + + + + PixmapLabel2 + + + false + + + image8 + + + false + + + Balance + + + + + balanceSlider + + + false + + + 50 + + + Horizontal + + + Balance + + + + + PixmapLabel1 + + + image9 + + + false + + + Volume + + + + + volumeSlider + + + 100 + + + Horizontal + + + Volume + + + + + + + + + + + + + Seeker +
seeker.h
+ + 64 + 22 + + 0 + + 7 + 5 + 0 + 0 + + image10 +
+
+ + + 789c8dd4c972db461006e0bb9e82a5bea952bf89958372e5a0c5a23652a256caa91c060b454924b5905a5379770fba7b60a62c25117cf93c3f67d0e806beacb58647bdd6da9795f9c22eae8b5631b68fadb5f2693a7dfbe3cfdfff5a590db256fd2fe8b4c2d5df5656078b56d1eadfcdaa1a74e9406dfeab0d52c7ea99388803364dd52630bc7e210efdef536f5d3ff20ee5f7dfd4715bd607deba7ea636ba5fdb3bccd877ea42f27869ccebd413476df5c43b0a38ffaa2ea41e84deba9ff18ee4bca1386e8b69e61df37ea4f5c7b15aef2736b165435d88712c4efcfd04de0937876ed5895acf4f83546cd5895afb9566a99c772e36a5c9d9fabcb2208bf9bcefea2c2bd8da0f1b58593f54276a9d0f5b59ced38d380f7359cfd4a9baafaef2922df3629afeca3c9834d0e775ef2df5a2a81d34fdc4b5b8e95f47adf38877b5ce23e5de7ade01db34f3b22b6efa5d8a7dff70af36ea37b5cff7c4852da4bebdda61d36fdca8b5dff42af6cf979ed959a4f34ca762d76ea9f7405c54b23f71fd511019a99fae1acbef47623f8fb06a3f6f9be2322c13cef3fb16074999c8fab6d8f703cfe2a67f5be23295df839f6f6cfdfc81e72d09fdfce244dcd17ed29bd8e8fc625fecebc393b8b4257f8fb0c17612139f9fbafd74de4fd47efeb7bd3b11fb589de979ebe2e6bcb9b80aab94f363b675fb49bf1ec4468d85d8e791d4ee449d40cec38e3ad3f3b99e4eeeccef1fbaea524c92cf4da0eb1371652ba997fb65ea7196fdfaea44cdefa7c97d7f88e7398bddfb2cefdf58dcf4eb513c0a4772fffc7dcd8ae6fbb01037df87486c13fd3e3c889be7c5fdb1b1cf5321b656bf1715bbf0f5e0565d697ddcffbccc43fd9eeca9add653aa7d7debe222d4791c8947ee8fd7f9bc2269f67b57a762c46abfdf5c5ca6badf95d8ef077e1fcb9ff9aed8cda7bc3ffc3ccbaad0f5c1e2ff5ccb49102cf2e62a3e4fba6c890a23775db96b8cebcf932e7b835bce8e3071d9e9a77bce70877b3ce011732cf08467bc7c789f33bce20def2ebb8e0d97dcc416bef9eccf24e7b6d1c50e76b1877d1ca087bebb0e71b49cc400c738c129ce5cf61c1718e29273f5f51d339f441b014244885d36714ad181d16c4640db2789c8524e059588a9a2115dd198ae61e8c65db734a169939cd11dddd383cb3dd29c4a5aa04b4ff48c21bdd0a43e7be93e0dbdd21bbdbbdc7a7d0fb4419bb445ae72c92dd74edbd4a51ddaa53db76749fbd8a103ead1f4a3e7497d3aa4231ad0319dd0299df9733fec9171f76b5dd50603ea2de77eedbbabeddc3d87095e68bafcffbf265df6c2ed3bfce77e1f27eb39a5cb7f9fe4ff98f9bfbfaefc00c86f7cfc + + + 789c5dd0cf0a824010c7f1bb4fb1b837894a5048a247283a06d1e1b733b3d4a182fe1c227af766560b7510dcefc7c5456785db6dd7ae9865f7071e277274c4cd15fc3c9f5ffbc3ea9de565edf45ab8329f64f9d491db5c2f626baf6b3f4f63c99635eaa686252c9baa299bca522c4100c892ba9436a365e020812d83654c930ef53ad334b66809a1254ff4239644fa280c494f8a71401e08227d52a1382015dbd427483bfd5dcc0c19bd4b6d44661891d998f40efcc8a3fb46e63f0dfec467997d0195cb6726 + + + 789c6dd04d0b823018c0f1fb3ec570378974a898441fa1e8184487672fba0e16941d22faeef5cc692ef7e061ff1f43b625313decb7344ec8bd83ee2ca93470a3b17ab4edf378dabc48c45714bf94f26841a225957477bd685cc377cd523b9806b380a22a00b3c12cb3929719a6c2acf28a573926c3841c38d814362500484ced52f759630a25b4509812b3b6638f341bab2ca8002ca40220a052f9deab56ca73f707a93c778a9b27eeb4df3cfaa0a21e067dd4a61fe3ed9d9aafe6ff0c9efdd404ee6682efe09bd3f9abbfd7e403068c8c08 + + + 789c5dd04d0ac2301005e07d4e119a5d91d6428304f1088a4b415c4c6622baa882d6858877372fa5d274c862dec790bfbad487fd5697b57af6d45f59f3851eba9457d7bd8fa7cd47158dd571ad74532c545169d6bbfb2da037b137cb54888268c93a4b888ce85ad7b81691108989881103a2171fbc207ac473aa748a31a64a65d00d443498f13c92470b221929044a362122cfb08ce258b48c30c6262714e7c422329b82e47b3124a724536296f9ed879948fc7f76fe13dfb5fa01cc9062ba + + + 789cc590bd0ac2301080f73cc5916c41aca16806f1112a8e8238dc5d2a3a54c1d641c477b7179bf8f7007e64b8ef1b02778585f5aa025ba8b6c3eec0c07b3c830d97a6b96eb68b9bd26e0afd9b81d323a5c7c0b03c1d6b994d3f9b494494457de99d2f4583283222b2288952a09a82288aee22f1db4f6232ef0c0929c129516afc4a149efc35f180c9893379a1df1dbf2e719fab0784606704 + + + 789c75d0414bc33014c0f17b3f45e8bb15d9da39c782ec23383c0ae2e1f525693298829b8731f6ddcdcb6b9ae9b4f490ffaf2149336fd4cbf3936ae6d5e188c7408a3c7eaac67cedf7a7d7b7cdb9aabbb5e277a1bafaaeaa678ad4f6e3ddf218e218daf470f69c9ada5613e78e1397d8e1929338c968ed1c274a124a7a4ebb5a3fc85296d3b9fb716527a9b5a4c9291b054942f93ae45c2dd2816f9e6b85bf14b0871b0524a4d127054466f1ac1929f9a88c136785fe076685e489cbba00c6422fe8cadc010c3b46b430ede69919d8a693c130b20f01ca797d64c7167c5981270710bafee33839d2eed7ed00948b9cfd73eb97c7ea1b79808d44 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232345130345230563054d2e152d2534856f0cbcf4b05b195816c650330007113415c4b134b434b13b04a14804b4419086024542431511946d25c04c376026eaeb5e6020001a43bf5 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232345130345230563054d2e152d2534856f0cbcf4b05b195816c650330007113415c4b134b434b13b04a1480534459194324112e0617498489218940c5f08aa0ebc23019c376fc6eaeb5e60200d5d93b89 + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade652323253b05430563054d2e152d2534856f0cbcf4b05b195816c650b630b430b63103711c44d4d4d4d4c05cbeae9e929eb6100901044162aa90c033069b82c4844391102946122605965986e659824541a21ab0c93069b822e8b6431aa5eb834c264655457a1eb4592c5e9df5a6b2e00611245be + + + 789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232345330345430563054d2e152d2534856f0cbcf4b05b195816c650b630b430b63103711c44d4d4d4d4c05cbeaa1018498b2329884892903f9ca89ca7a50418858a2b27222484c19452c112c0611441153c62286a60ed33c2cf662731fba3f6aadb900b64e3d13 + + + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + + + +
diff --git a/noatun-plugins/alsaplayer/Custom.cw b/noatun-plugins/alsaplayer/Custom.cw new file mode 100644 index 0000000..d2e037b --- /dev/null +++ b/noatun-plugins/alsaplayer/Custom.cw @@ -0,0 +1,20 @@ + + + + Seeker +
seeker.h
+ + 64 + 22 + + 0 + + 7 + 5 + + + 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 + +
+
+
diff --git a/noatun-plugins/alsaplayer/Makefile.am b/noatun-plugins/alsaplayer/Makefile.am new file mode 100644 index 0000000..3b149f6 --- /dev/null +++ b/noatun-plugins/alsaplayer/Makefile.am @@ -0,0 +1,24 @@ +INCLUDES= $(all_includes) + +kde_module_LTLIBRARIES = noatunalsaplayer.la + +noatunalsaplayer_la_SOURCES = \ + AlsaPlayer.ui \ + alsaplayerui.cpp \ + userinterface.cpp \ + configmodule.cpp \ + seeker.cpp + +noatunalsaplayer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module + +noatunalsaplayer_la_LIBADD = -lnoatuncontrols -lnoatun + +noatunalsaplayer_la_METASOURCES = AUTO + +noinst_HEADERS = userinterface.h configmodule.h seeker.h + +noatun_DATA = alsaplayerui.plugin +noatundir = $(kde_datadir)/noatun + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/alsaplayerui.pot diff --git a/noatun-plugins/alsaplayer/alsaplayerui.cpp b/noatun-plugins/alsaplayer/alsaplayerui.cpp new file mode 100644 index 0000000..1620b78 --- /dev/null +++ b/noatun-plugins/alsaplayer/alsaplayerui.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "userinterface.h" +#include + +extern "C" +{ + Plugin * create_plugin() + { + KGlobal::locale()->insertCatalogue("alsaplayerui"); + return new AlsaPlayer; + } +} + +// vim:ts=2:sw=2:tw=78:noet diff --git a/noatun-plugins/alsaplayer/alsaplayerui.plugin b/noatun-plugins/alsaplayer/alsaplayerui.plugin new file mode 100644 index 0000000..49dce46 --- /dev/null +++ b/noatun-plugins/alsaplayer/alsaplayerui.plugin @@ -0,0 +1,84 @@ +Filename=noatunalsaplayer.la +Author=Rik Hemsley +Site=http://noatun.kde.org/plugins/alsaplayer/ +Email=rik@kde.org +Type=userinterface +License=Artistic +Name=AlsaPlayer +Name[af]=Alsa-speler +Name[ar]=مشغل Alsa +Name[cy]=ChwaraewrAlsa +Name[eo]=Alsaludilo +Name[fy]=Alsaspiler +Name[hi]=अल्सा-प्लेयर +Name[nb]=Alsaspiller +Name[ne]=एल्साप्लेएर +Name[nl]=Alsaspeler +Name[nn]=Alsaspelar +Name[nso]=Sbapadi sa Alsa +Name[ro]=Redare Alsa +Name[sv]=Alsaplayer +Name[ta]=Alsa இயக்கி +Name[tr]=Alsa Çalıcı +Name[uz]=Alsa pleyer +Name[uz@cyrillic]=Alsa плейер +Name[xh]=Umdlali weAlsa +Name[zh_CN]=Alsa 播放器 +Comment=AlsaPlayer UI clone +Comment[af]=Alsa-speler Ui kloon +Comment[az]=AlsaPlayer İA bənzəri +Comment[bg]=Версия на графичния интерфейс на плеъра AlsaPlayer +Comment[bs]=AlsaPlayer UI klon +Comment[ca]=Clon de la interfície d'usuari per a l'AlsaPlayer +Comment[cs]=Klon uživatelského rozhraní AlsaPlayer +Comment[cy]=Clôn UI ChwaraewrAlsa +Comment[da]=AlsaPlayer UI-klon +Comment[de]=Benutzeroberfläche für AlsaPlayer +Comment[el]=Κλώνος του περιβάλλοντος χρήσης AlsaPlayer +Comment[eo]=Klono de Alsaludilo +Comment[es]=Clon del reproductor AlsaPlayer +Comment[et]=AlsaPlayeri kasutajaliides +Comment[eu]=AlsaPlayer UI klona +Comment[fa]=بدل دقیق واسط کاربر AlsaPlayer +Comment[fi]=AlsaPlayer käyttöliittymäklooni +Comment[fr]=Clone de l'interface AlsaPlayer +Comment[fy]=Kloan fan AlsaSpiler UI +Comment[gl]=Clone da interface de AlsaPlayer +Comment[he]=תואם ממשק המשתמש של AlsaPlayer +Comment[hi]=अल्सा-प्लेयर यूआई क्लोन +Comment[hr]=AlsaPlayer UI klon +Comment[hu]=AlsaPlayer-változat +Comment[is]=AlsaPlayer eftirlíking +Comment[it]=Clone UI di AlsaPlayer +Comment[ja]=AlsaPlayer UI クローン +Comment[ka]=AlsaPlayer UI კლონი +Comment[kk]=AlsaPlayer интерфейсі +Comment[km]=AlsaPlayer ក្លូន UI +Comment[lt]=AlsaPlayer naudotojo sąsajos klonas +Comment[mk]=Клон на AlsaPlayer +Comment[ms]=Klon UI AlsaPlayer +Comment[nb]=UI-klon for Alsa-spiller +Comment[nds]=AlsaPlayer-Böversietkloon +Comment[ne]=एल्साप्लेएर यूआई क्लोन +Comment[nl]=Kloon van AlsaPlayer UI +Comment[nn]=UI-klon av AlsaPlayer +Comment[pl]=Klon interfejsu użytkownika dla AlsaPlayer +Comment[pt]=Clone da interface do AlsaPlayer +Comment[pt_BR]=Clone do AlsaPlayer +Comment[ro]=Clonă interfaţă grafică "Redare Alsa" +Comment[ru]=Интерфейс к AlsaPlayer +Comment[sk]=Klon AlsaPlayer UI +Comment[sl]=Klon uporabniškega vmensnika AlsaPlayer +Comment[sr]=UI клон AlsaPlayer-а +Comment[sr@Latn]=UI klon AlsaPlayer-a +Comment[sv]=Kopia av Alsaplayer-gränssnitt +Comment[ta]=Alsaஇயக்கி UI clone +Comment[tg]=Интерфейси дигар ба AlsaPlayer +Comment[tr]=AlsaPlayer arayüzü +Comment[uk]=Дублікат зовнішнього інтерфейсу AlsaPlayer +Comment[uz]=Alsa pleyer uchun grafik interfeys +Comment[uz@cyrillic]=Alsa плейер учун график интерфейс +Comment[vi]=Bộ nhái giao diện AlsaPlayer +Comment[xh]=Umdlali weAlsa Indlela yokwenza into efana nenye ye UI +Comment[zh_CN]=Alsa 播放器的界面复制品 +Comment[zh_TW]=AlsaPlayer 使用者介面 diff --git a/noatun-plugins/alsaplayer/configmodule.cpp b/noatun-plugins/alsaplayer/configmodule.cpp new file mode 100644 index 0000000..07c5cfd --- /dev/null +++ b/noatun-plugins/alsaplayer/configmodule.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include +#include +#include + +#include +#include + +#include "configmodule.h" + +AlsaPlayerConfigModule::AlsaPlayerConfigModule(QObject * parent) + : + CModule + ( + i18n("AlsaPlayer"), + i18n("AlsaPlayer Interface Settings"), + "appearance", + parent + ) +{ + scroll_ = new QCheckBox(i18n("Scroll song title"), this); + + QVBoxLayout * layout = new QVBoxLayout(this); + + layout->addWidget(scroll_); + + layout->addStretch(100); + + reopen(); +} + + void +AlsaPlayerConfigModule::save() +{ + KConfig * c(KGlobal::config()); + c->setGroup("AlsaPlayerInterface"); + c->writeEntry("ScrollTitle", scroll_->isChecked()); + c->sync(); + emit(saved()); +} + + void +AlsaPlayerConfigModule::reopen() +{ + KConfig * c(KGlobal::config()); + c->setGroup("AlsaPlayerInterface"); + scroll_->setChecked(c->readBoolEntry("ScrollTitle", true)); +} + +// vim:ts=2:sw=2:tw=78:noet +#include "configmodule.moc" diff --git a/noatun-plugins/alsaplayer/configmodule.h b/noatun-plugins/alsaplayer/configmodule.h new file mode 100644 index 0000000..2104fdf --- /dev/null +++ b/noatun-plugins/alsaplayer/configmodule.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef ALSAPLAYER_CONFIG_MODULE_H +#define ALSAPLAYER_CONFIG_MODULE_H + +#include + +class QCheckBox; + +class AlsaPlayerConfigModule : public CModule +{ + Q_OBJECT + + public: + + AlsaPlayerConfigModule(QObject *); + + signals: + + void saved(); + + public slots: + + virtual void save(); + virtual void reopen(); + + private: + + QCheckBox * scroll_; +}; + +#endif // ALSAPLAYER_CONFIG_MODULE_H +// vim:ts=2:sw=2:tw=78:noet diff --git a/noatun-plugins/alsaplayer/seeker.cpp b/noatun-plugins/alsaplayer/seeker.cpp new file mode 100644 index 0000000..6ffac8c --- /dev/null +++ b/noatun-plugins/alsaplayer/seeker.cpp @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include + +#include +#include +#include "seeker.h" + +Seeker::Seeker(QWidget * parent, const char * name) + : L33tSlider(0, 1000, 10, 0, Horizontal, parent, name) +{ + connect(this, SIGNAL(userChanged(int)), SLOT(slotValueChanged(int))); + + connect(napp->player(), SIGNAL(timeout()), SLOT(slotTimeout())); +} + +Seeker::~Seeker() +{ +} + +void Seeker::slotValueChanged(int i) +{ + napp->player()->skipTo((int)(i*1000)); +} + +void Seeker::slotTimeout() +{ + if(!napp->player()->current()) return; + if(currentlyPressed()) return; + + setRange(0, (int)napp->player()->getLength() / 1000 ); + setValue((int)napp->player()->getTime() / 1000 ); +} + +void Seeker::wheelEvent(QWheelEvent *) +{ + // ignore +} + +// vim:ts=2:sw=2:tw=78:noet +#include "seeker.moc" diff --git a/noatun-plugins/alsaplayer/seeker.h b/noatun-plugins/alsaplayer/seeker.h new file mode 100644 index 0000000..ec5504e --- /dev/null +++ b/noatun-plugins/alsaplayer/seeker.h @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef SEEKER_H +#define SEEKER_H + +#include + +class Seeker : public L33tSlider +{ + Q_OBJECT + + public: + + Seeker(QWidget * parent, const char * name = 0); + virtual ~Seeker(); + + protected slots: + + void slotValueChanged(int i); + void slotTimeout(); + + protected: + + void wheelEvent(QWheelEvent *); + + private: +}; + +#endif +// vim:ts=2:sw=2:tw=78:noet diff --git a/noatun-plugins/alsaplayer/userinterface.cpp b/noatun-plugins/alsaplayer/userinterface.cpp new file mode 100644 index 0000000..1071736 --- /dev/null +++ b/noatun-plugins/alsaplayer/userinterface.cpp @@ -0,0 +1,339 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "seeker.h" +#include "userinterface.h" +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "configmodule.h" + +AlsaPlayer::AlsaPlayer() + : APMainWindow (0, "AlsaPlayer"), + UserInterface (), + speed_ (100) +{ + connect + ( + playlistButton, + SIGNAL(clicked()), + napp->player(), + SLOT(toggleListView()) + ); + + connect + ( + previousButton, + SIGNAL(clicked()), + napp->player(), + SLOT(back()) + ); + + connect + ( + nextButton, + SIGNAL(clicked()), + napp->player(), + SLOT(forward()) + ); + + connect + ( + stopButton, + SIGNAL(clicked()), + napp->player(), + SLOT(stop()) + ); + + connect + ( + playButton, + SIGNAL(clicked()), + napp->player(), + SLOT(playpause()) + ); + + connect(napp, SIGNAL(hideYourself()), SLOT(hide())); + connect(napp, SIGNAL(showYourself()), SLOT(show())); + + connect(napp->player(), SIGNAL(playlistShown()), SLOT(slotPlayListShown())); + connect(napp->player(), SIGNAL(playlistHidden()), SLOT(slotPlayListHidden())); + connect(napp->player(), SIGNAL(playing()), SLOT(slotPlaying())); + connect(napp->player(), SIGNAL(stopped()), SLOT(slotStopped())); + connect(napp->player(), SIGNAL(paused()), SLOT(slotPaused())); + + connect(napp->player(), SIGNAL(timeout()), SLOT(slotTimeout())); + connect(napp->player(), SIGNAL(changed()), SLOT(slotTrackChanged())); + + connect + ( + napp->player(), + SIGNAL(volumeChanged(int)), + SLOT(slotVolumeChanged(int)) + ); + + connect + ( + new AlsaPlayerConfigModule(this), + SIGNAL(saved()), + SLOT(slotConfigChanged()) + ); + + connect + ( + volumeSlider, + SIGNAL(valueChanged(int)), + napp->player(), + SLOT(setVolume(int)) + ); + + connect + ( + forwardButton, + SIGNAL(clicked()), + SLOT(slotForward()) + ); + + connect + ( + pauseButton, + SIGNAL(clicked()), + SLOT(slotPause()) + ); + + connect(speedSlider, SIGNAL(valueChanged(int)), SLOT(slotSetSpeed(int))); + + menuButton->setPopup(NoatunStdAction::ContextMenu::contextMenu()); + + setIcon(BarIcon("noatun")); + + napp->player()->handleButtons(); + + loadConfig(); + + resize(sizeHint().width(), minimumSizeHint().height()); + + show(); +} + +AlsaPlayer::~AlsaPlayer() +{ + // Empty. +} + +void AlsaPlayer::closeEvent(QCloseEvent *) +{ + unload(); +} + +void AlsaPlayer::dragEnterEvent(QDragEnterEvent *event) +{ + event->accept(KURLDrag::canDecode(event)); +} + +void AlsaPlayer::dropEvent(QDropEvent *event) +{ + KURL::List uri; + if (KURLDrag::decode(event, uri)) + { + for (KURL::List::Iterator i = uri.begin(); i != uri.end(); ++i) + napp->player()->openFile(*i, false); + } +} + +void AlsaPlayer::setTitleText(const QString & s) +{ + QString titleText + (s.isNull() ? napp->player()->current().title() : s); + + if (titleLabel->text() != titleText) + titleLabel->setText(titleText); +} + +void AlsaPlayer::slotPlaying() +{ + setTitleText(QString::null); + + playButton->setOn(true); + stopButton->setEnabled(true); +} + +void AlsaPlayer::slotStopped() +{ + setTitleText(i18n("No File Loaded")); + + stopButton->setEnabled(false); + playButton->setOn(false); +} + +void AlsaPlayer::slotPaused() +{ + setTitleText(QString::null); + + stopButton->setEnabled(true); + playButton->setOn(false); +} + +bool AlsaPlayer::eventFilter(QObject *o, QEvent *e) +{ + switch (e->type()) + { + case QEvent::MouseButtonPress: + mousePressEvent(static_cast(e)); + break; + + case QEvent::Wheel: + wheelEvent(static_cast(e)); + return true; + break; + + default: + break; + } + + return QWidget::eventFilter(o, e); +} + +void AlsaPlayer::slotPlayListShown() +{ + playlistButton->setOn(true); +} + +void AlsaPlayer::slotPlayListHidden() +{ + playlistButton->setOn(false); +} + +void AlsaPlayer::mousePressEvent(QMouseEvent * e) +{ + if (e->button() == RightButton) + { + NoatunStdAction::ContextMenu::showContextMenu(); + return; + } + + return QWidget::mousePressEvent(e); +} + +void AlsaPlayer::wheelEvent(QWheelEvent * e) +{ + int newVolume = napp->player()->volume() + (e->delta() / 120); + napp->player()->setVolume(newVolume); +} + +void AlsaPlayer::slotConfigChanged() +{ + loadConfig(); +} + +void AlsaPlayer::slotVolumeChanged(int i) +{ + QString text("%1%"); + volumeLabel->setText(text.arg(i)); + volumeSlider->setValue(i); +} + +void AlsaPlayer::slotTimeout() +{ + // noatun bug: napp->player()->lengthString() will crash if there's + // no 'current track'. + if (!napp->player()->current()) + return; + + setTitleText(QString::null); + + QString lengthText(napp->player()->lengthString()); + + if (timeLabel->text() != lengthText) + timeLabel->setText(lengthText); +} + +void AlsaPlayer::loadConfig() +{ + // Empty. +} + +void AlsaPlayer::slotRestart() +{ + napp->player()->skipTo(0); +} + +void AlsaPlayer::slotTrackChanged() +{ + slotSetSpeed(speed_); +} + +void AlsaPlayer::slotSetSpeed(int newSpeed) +{ + speed_ = newSpeed; + + pauseButton->setEnabled(0 != speed_); + speedLabel->setText(QString("%1%").arg(speed_)); + + Arts::PlayObject playobject(napp->player()->engine()->playObject()); + Arts::PitchablePlayObject pitchable = Arts::DynamicCast(playobject); + + if (!pitchable.isNull()) + { + float f = (float(speed_) / 100.f); + pitchable.speed(f); + } +} + +void AlsaPlayer::slotPause() +{ + speedSlider->setValue(0); + pauseButton->setEnabled(false); +} + +void AlsaPlayer::slotForward() +{ + speedSlider->setValue(100); +} + +#include "userinterface.moc" +// vim:ts=2:sw=2:tw=78:noet diff --git a/noatun-plugins/alsaplayer/userinterface.h b/noatun-plugins/alsaplayer/userinterface.h new file mode 100644 index 0000000..2a97b86 --- /dev/null +++ b/noatun-plugins/alsaplayer/userinterface.h @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2001 Rik Hemsley (rikkus) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef USERINTERFACE_H +#define USERINTERFACE_H + +#include + +#include "AlsaPlayer.h" + +class Seeker; + +/** + * @short Main window class + * @author Rik Hemsley + * @version 1.0 + */ +class AlsaPlayer : public APMainWindow, public UserInterface +{ + Q_OBJECT + + public: + + AlsaPlayer(); + virtual ~AlsaPlayer(); + + void load(const QString & url); + + protected slots: + + virtual void slotConfigChanged(); + + virtual void slotVolumeChanged(int); + + virtual void slotPlaying(); + virtual void slotStopped(); + virtual void slotPaused(); + + virtual void slotPlayListShown(); + virtual void slotPlayListHidden(); + + virtual void slotTimeout(); + + virtual void slotRestart(); + + virtual void slotTrackChanged(); + virtual void slotSetSpeed(int); + + virtual void slotPause(); + virtual void slotForward(); + + protected: + + virtual void mousePressEvent (QMouseEvent *); + virtual void dragEnterEvent (QDragEnterEvent *); + virtual void dropEvent (QDropEvent *); + virtual void closeEvent (QCloseEvent *); + virtual bool eventFilter (QObject *, QEvent *); + virtual void wheelEvent (QWheelEvent *); + virtual void setTitleText (const QString &); + + void loadConfig(); + + private: + + Seeker * seeker_; + + int speed_; +}; + +#endif +// vim:ts=2:sw=2:tw=78:noet -- cgit v1.2.1