From b8b7804fcc229e9c34e18dc3ec6dfafd2e3485b0 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 1 Jul 2011 18:54:41 +0000 Subject: moved skinned ui to separate plugin git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2252 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Ui/Ui.pro | 4 + src/plugins/Ui/skinned/aboutdialog.cpp | 131 ++ src/plugins/Ui/skinned/aboutdialog.h | 47 + src/plugins/Ui/skinned/actionmanager.cpp | 147 ++ src/plugins/Ui/skinned/actionmanager.h | 111 ++ src/plugins/Ui/skinned/addurldialog.cpp | 134 ++ src/plugins/Ui/skinned/addurldialog.h | 60 + src/plugins/Ui/skinned/balancebar.cpp | 137 ++ src/plugins/Ui/skinned/balancebar.h | 67 + src/plugins/Ui/skinned/button.cpp | 82 + src/plugins/Ui/skinned/button.h | 58 + src/plugins/Ui/skinned/configdialog.cpp | 591 +++++++ src/plugins/Ui/skinned/configdialog.h | 83 + src/plugins/Ui/skinned/cursorimage.cpp | 118 ++ src/plugins/Ui/skinned/cursorimage.h | 26 + src/plugins/Ui/skinned/default/balance.png | Bin 0 -> 1121 bytes src/plugins/Ui/skinned/default/cbuttons.png | Bin 0 -> 5583 bytes src/plugins/Ui/skinned/default/eq_ex.png | Bin 0 -> 2846 bytes src/plugins/Ui/skinned/default/eqmain.png | Bin 0 -> 12447 bytes src/plugins/Ui/skinned/default/main.png | Bin 0 -> 10144 bytes src/plugins/Ui/skinned/default/monoster.png | Bin 0 -> 1291 bytes src/plugins/Ui/skinned/default/numbers.png | Bin 0 -> 1417 bytes src/plugins/Ui/skinned/default/playpaus.png | Bin 0 -> 534 bytes src/plugins/Ui/skinned/default/pledit.png | Bin 0 -> 6942 bytes src/plugins/Ui/skinned/default/pledit.txt | 8 + src/plugins/Ui/skinned/default/posbar.png | Bin 0 -> 300 bytes src/plugins/Ui/skinned/default/readme.txt | 2 + src/plugins/Ui/skinned/default/shufrep.png | Bin 0 -> 5044 bytes src/plugins/Ui/skinned/default/text.png | Bin 0 -> 1939 bytes src/plugins/Ui/skinned/default/titlebar.png | Bin 0 -> 5981 bytes src/plugins/Ui/skinned/default/viscolor.txt | 24 + src/plugins/Ui/skinned/default/volume.png | Bin 0 -> 3237 bytes src/plugins/Ui/skinned/display.cpp | 357 ++++ src/plugins/Ui/skinned/display.h | 122 ++ src/plugins/Ui/skinned/dock.cpp | 266 +++ src/plugins/Ui/skinned/dock.h | 61 + src/plugins/Ui/skinned/eqgraph.cpp | 163 ++ src/plugins/Ui/skinned/eqgraph.h | 53 + src/plugins/Ui/skinned/eqpreset.cpp | 56 + src/plugins/Ui/skinned/eqpreset.h | 47 + src/plugins/Ui/skinned/eqslider.cpp | 153 ++ src/plugins/Ui/skinned/eqslider.h | 70 + src/plugins/Ui/skinned/eqtitlebar.cpp | 189 ++ src/plugins/Ui/skinned/eqtitlebar.h | 75 + src/plugins/Ui/skinned/eqwidget.cpp | 446 +++++ src/plugins/Ui/skinned/eqwidget.h | 102 ++ src/plugins/Ui/skinned/fft.c | 296 ++++ src/plugins/Ui/skinned/fft.h | 45 + src/plugins/Ui/skinned/forms/aboutdialog.ui | 162 ++ src/plugins/Ui/skinned/forms/addurldialog.ui | 99 ++ src/plugins/Ui/skinned/forms/configdialog.ui | 1576 +++++++++++++++++ src/plugins/Ui/skinned/forms/jumptotrackdialog.ui | 152 ++ src/plugins/Ui/skinned/forms/playlistbrowser.ui | 126 ++ src/plugins/Ui/skinned/forms/popupsettings.ui | 251 +++ src/plugins/Ui/skinned/forms/preseteditor.ui | 120 ++ src/plugins/Ui/skinned/forms/shortcutdialog.ui | 120 ++ src/plugins/Ui/skinned/images/16x16/qmmp.png | Bin 0 -> 520 bytes src/plugins/Ui/skinned/images/32x32/qmmp.png | Bin 0 -> 1297 bytes src/plugins/Ui/skinned/images/48x48/qmmp.png | Bin 0 -> 2268 bytes src/plugins/Ui/skinned/images/56x56/qmmp.png | Bin 0 -> 2805 bytes src/plugins/Ui/skinned/images/advanced.png | Bin 0 -> 1054 bytes src/plugins/Ui/skinned/images/images.qrc | 14 + src/plugins/Ui/skinned/images/interface.png | Bin 0 -> 1418 bytes src/plugins/Ui/skinned/images/logo-qmmp.png | Bin 0 -> 22844 bytes src/plugins/Ui/skinned/images/network.png | Bin 0 -> 1465 bytes src/plugins/Ui/skinned/images/playlist.png | Bin 0 -> 743 bytes src/plugins/Ui/skinned/images/plugins.png | Bin 0 -> 1378 bytes src/plugins/Ui/skinned/images/replaygain.png | Bin 0 -> 624 bytes .../Ui/skinned/images/scalable/qmmp-simple.svgz | Bin 0 -> 4639 bytes src/plugins/Ui/skinned/images/scalable/qmmp.svgz | Bin 0 -> 4892 bytes src/plugins/Ui/skinned/images/shortcuts.png | Bin 0 -> 603 bytes src/plugins/Ui/skinned/images/ui_no_cover.png | Bin 0 -> 4170 bytes src/plugins/Ui/skinned/inlines.h | 57 + src/plugins/Ui/skinned/jumptotrackdialog.cpp | 138 ++ src/plugins/Ui/skinned/jumptotrackdialog.h | 62 + src/plugins/Ui/skinned/keyboardmanager.cpp | 280 +++ src/plugins/Ui/skinned/keyboardmanager.h | 67 + src/plugins/Ui/skinned/listwidget.cpp | 569 ++++++ src/plugins/Ui/skinned/listwidget.h | 165 ++ src/plugins/Ui/skinned/lxdesupport.cpp | 40 + src/plugins/Ui/skinned/lxdesupport.h | 33 + src/plugins/Ui/skinned/mainvisual.cpp | 613 +++++++ src/plugins/Ui/skinned/mainvisual.h | 145 ++ src/plugins/Ui/skinned/mainwindow.cpp | 616 +++++++ src/plugins/Ui/skinned/mainwindow.h | 123 ++ src/plugins/Ui/skinned/monostereo.cpp | 69 + src/plugins/Ui/skinned/monostereo.h | 51 + src/plugins/Ui/skinned/number.cpp | 45 + src/plugins/Ui/skinned/number.h | 49 + src/plugins/Ui/skinned/pixmapwidget.cpp | 47 + src/plugins/Ui/skinned/pixmapwidget.h | 50 + src/plugins/Ui/skinned/playlist.cpp | 616 +++++++ src/plugins/Ui/skinned/playlist.h | 140 ++ src/plugins/Ui/skinned/playlistbrowser.cpp | 117 ++ src/plugins/Ui/skinned/playlistbrowser.h | 54 + src/plugins/Ui/skinned/playlistcontrol.cpp | 58 + src/plugins/Ui/skinned/playlistcontrol.h | 57 + src/plugins/Ui/skinned/playlistselector.cpp | 303 ++++ src/plugins/Ui/skinned/playlistselector.h | 79 + src/plugins/Ui/skinned/playlistslider.cpp | 135 ++ src/plugins/Ui/skinned/playlistslider.h | 63 + src/plugins/Ui/skinned/playlisttitlebar.cpp | 275 +++ src/plugins/Ui/skinned/playlisttitlebar.h | 80 + src/plugins/Ui/skinned/playstatus.cpp | 63 + src/plugins/Ui/skinned/playstatus.h | 55 + src/plugins/Ui/skinned/pluginitem.cpp | 188 ++ src/plugins/Ui/skinned/pluginitem.h | 73 + src/plugins/Ui/skinned/popupsettings.cpp | 88 + src/plugins/Ui/skinned/popupsettings.h | 52 + src/plugins/Ui/skinned/popupwidget.cpp | 136 ++ src/plugins/Ui/skinned/popupwidget.h | 66 + src/plugins/Ui/skinned/positionbar.cpp | 136 ++ src/plugins/Ui/skinned/positionbar.h | 65 + src/plugins/Ui/skinned/preseteditor.cpp | 82 + src/plugins/Ui/skinned/preseteditor.h | 57 + src/plugins/Ui/skinned/qmmp.desktop | 27 + src/plugins/Ui/skinned/qmmp_enqueue.desktop | 24 + src/plugins/Ui/skinned/shadedbar.cpp | 143 ++ src/plugins/Ui/skinned/shadedbar.h | 76 + src/plugins/Ui/skinned/shadedvisual.cpp | 181 ++ src/plugins/Ui/skinned/shadedvisual.h | 70 + src/plugins/Ui/skinned/shortcutdialog.cpp | 63 + src/plugins/Ui/skinned/shortcutdialog.h | 49 + src/plugins/Ui/skinned/shortcutitem.cpp | 39 + src/plugins/Ui/skinned/shortcutitem.h | 45 + src/plugins/Ui/skinned/skin.cpp | 852 +++++++++ src/plugins/Ui/skinned/skin.h | 390 +++++ src/plugins/Ui/skinned/skinned.pro | 166 ++ src/plugins/Ui/skinned/skinnedfactory.cpp | 43 + src/plugins/Ui/skinned/skinnedfactory.h | 42 + src/plugins/Ui/skinned/skinreader.cpp | 207 +++ src/plugins/Ui/skinned/skinreader.h | 52 + src/plugins/Ui/skinned/stuff.qrc | 88 + src/plugins/Ui/skinned/symboldisplay.cpp | 91 + src/plugins/Ui/skinned/symboldisplay.h | 67 + src/plugins/Ui/skinned/textscroller.cpp | 314 ++++ src/plugins/Ui/skinned/textscroller.h | 81 + src/plugins/Ui/skinned/timeindicator.cpp | 139 ++ src/plugins/Ui/skinned/timeindicator.h | 68 + src/plugins/Ui/skinned/titlebar.cpp | 223 +++ src/plugins/Ui/skinned/titlebar.h | 85 + src/plugins/Ui/skinned/titlebarcontrol.cpp | 65 + src/plugins/Ui/skinned/titlebarcontrol.h | 58 + src/plugins/Ui/skinned/togglebutton.cpp | 108 ++ src/plugins/Ui/skinned/togglebutton.h | 63 + src/plugins/Ui/skinned/translations/qmmp_cs.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_de.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_es.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_fr.ts | 1081 ++++++++++++ src/plugins/Ui/skinned/translations/qmmp_hu.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_it.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_ja.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_kk.ts | 1247 +++++++++++++ .../Ui/skinned/translations/qmmp_locales.qrc | 22 + src/plugins/Ui/skinned/translations/qmmp_lt.ts | 1837 ++++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_nl.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_pl_PL.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_pt_BR.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_ru.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_sk.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_tr.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_uk_UA.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_zh_CN.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/translations/qmmp_zh_TW.ts | 1835 +++++++++++++++++++ src/plugins/Ui/skinned/txt/authors_cs.txt | 16 + src/plugins/Ui/skinned/txt/authors_de.txt | 14 + src/plugins/Ui/skinned/txt/authors_en.txt | 14 + src/plugins/Ui/skinned/txt/authors_es.txt | 14 + src/plugins/Ui/skinned/txt/authors_it.txt | 13 + src/plugins/Ui/skinned/txt/authors_ja.txt | 14 + src/plugins/Ui/skinned/txt/authors_lt.txt | 13 + src/plugins/Ui/skinned/txt/authors_nl.txt | 14 + src/plugins/Ui/skinned/txt/authors_pl.txt | 14 + src/plugins/Ui/skinned/txt/authors_ru.txt | 13 + src/plugins/Ui/skinned/txt/authors_tr.txt | 13 + src/plugins/Ui/skinned/txt/authors_uk_UA.txt | 16 + src/plugins/Ui/skinned/txt/authors_zh_CN.txt | 12 + src/plugins/Ui/skinned/txt/authors_zh_TW.txt | 13 + src/plugins/Ui/skinned/txt/description_cs.txt | 1 + src/plugins/Ui/skinned/txt/description_de.txt | 1 + src/plugins/Ui/skinned/txt/description_en.txt | 1 + src/plugins/Ui/skinned/txt/description_es.txt | 1 + src/plugins/Ui/skinned/txt/description_it.txt | 1 + src/plugins/Ui/skinned/txt/description_ja.txt | 1 + src/plugins/Ui/skinned/txt/description_lt.txt | 1 + src/plugins/Ui/skinned/txt/description_nl.txt | 1 + src/plugins/Ui/skinned/txt/description_pl.txt | 1 + src/plugins/Ui/skinned/txt/description_ru.txt | 1 + src/plugins/Ui/skinned/txt/description_tr.txt | 1 + src/plugins/Ui/skinned/txt/description_uk_UA.txt | 1 + src/plugins/Ui/skinned/txt/description_zh_CN.txt | 1 + src/plugins/Ui/skinned/txt/description_zh_TW.txt | 1 + src/plugins/Ui/skinned/txt/thanks_cs.txt | 3 + src/plugins/Ui/skinned/txt/thanks_de.txt | 17 + src/plugins/Ui/skinned/txt/thanks_en.txt | 21 + src/plugins/Ui/skinned/txt/thanks_es.txt | 17 + src/plugins/Ui/skinned/txt/thanks_it.txt | 3 + src/plugins/Ui/skinned/txt/thanks_ja.txt | 21 + src/plugins/Ui/skinned/txt/thanks_lt.txt | 17 + src/plugins/Ui/skinned/txt/thanks_nl.txt | 17 + src/plugins/Ui/skinned/txt/thanks_pl.txt | 21 + src/plugins/Ui/skinned/txt/thanks_ru.txt | 21 + src/plugins/Ui/skinned/txt/thanks_tr.txt | 3 + src/plugins/Ui/skinned/txt/thanks_uk_UA.txt | 20 + src/plugins/Ui/skinned/txt/thanks_zh_CN.txt | 21 + src/plugins/Ui/skinned/txt/thanks_zh_TW.txt | 21 + src/plugins/Ui/skinned/txt/translators_cs.txt | 24 + src/plugins/Ui/skinned/txt/translators_de.txt | 53 + src/plugins/Ui/skinned/txt/translators_en.txt | 56 + src/plugins/Ui/skinned/txt/translators_es.txt | 47 + src/plugins/Ui/skinned/txt/translators_it.txt | 34 + src/plugins/Ui/skinned/txt/translators_ja.txt | 53 + src/plugins/Ui/skinned/txt/translators_lt.txt | 50 + src/plugins/Ui/skinned/txt/translators_nl.txt | 47 + src/plugins/Ui/skinned/txt/translators_pl.txt | 53 + src/plugins/Ui/skinned/txt/translators_ru.txt | 56 + src/plugins/Ui/skinned/txt/translators_tr.txt | 35 + src/plugins/Ui/skinned/txt/translators_uk_UA.txt | 53 + src/plugins/Ui/skinned/txt/translators_zh_CN.txt | 54 + src/plugins/Ui/skinned/txt/translators_zh_TW.txt | 53 + src/plugins/Ui/skinned/visualmenu.cpp | 63 + src/plugins/Ui/skinned/visualmenu.h | 57 + src/plugins/Ui/skinned/volumebar.cpp | 127 ++ src/plugins/Ui/skinned/volumebar.h | 76 + src/plugins/Ui/skinned/windowsystem.cpp | 213 +++ src/plugins/Ui/skinned/windowsystem.h | 39 + src/plugins/plugins.pro | 3 +- src/qmmpui/qmmpui.pro | 7 +- src/qmmpui/uifactory.h | 78 + src/qmmpui/uiloader.cpp | 96 + src/qmmpui/uiloader.h | 58 + src/ui/aboutdialog.cpp | 131 -- src/ui/aboutdialog.h | 47 - src/ui/actionmanager.cpp | 147 -- src/ui/actionmanager.h | 111 -- src/ui/addurldialog.cpp | 134 -- src/ui/addurldialog.h | 60 - src/ui/balancebar.cpp | 137 -- src/ui/balancebar.h | 67 - src/ui/builtincommandlineoption.cpp | 49 +- src/ui/builtincommandlineoption.h | 4 +- src/ui/button.cpp | 82 - src/ui/button.h | 58 - src/ui/configdialog.cpp | 591 ------- src/ui/configdialog.h | 83 - src/ui/cursorimage.cpp | 118 -- src/ui/cursorimage.h | 26 - src/ui/default/balance.png | Bin 1121 -> 0 bytes src/ui/default/cbuttons.png | Bin 5583 -> 0 bytes src/ui/default/eq_ex.png | Bin 2846 -> 0 bytes src/ui/default/eqmain.png | Bin 12447 -> 0 bytes src/ui/default/main.png | Bin 10144 -> 0 bytes src/ui/default/monoster.png | Bin 1291 -> 0 bytes src/ui/default/numbers.png | Bin 1417 -> 0 bytes src/ui/default/playpaus.png | Bin 534 -> 0 bytes src/ui/default/pledit.png | Bin 6942 -> 0 bytes src/ui/default/pledit.txt | 8 - src/ui/default/posbar.png | Bin 300 -> 0 bytes src/ui/default/readme.txt | 2 - src/ui/default/shufrep.png | Bin 5044 -> 0 bytes src/ui/default/text.png | Bin 1939 -> 0 bytes src/ui/default/titlebar.png | Bin 5981 -> 0 bytes src/ui/default/viscolor.txt | 24 - src/ui/default/volume.png | Bin 3237 -> 0 bytes src/ui/display.cpp | 357 ---- src/ui/display.h | 122 -- src/ui/dock.cpp | 266 --- src/ui/dock.h | 61 - src/ui/eqgraph.cpp | 163 -- src/ui/eqgraph.h | 53 - src/ui/eqpreset.cpp | 56 - src/ui/eqpreset.h | 47 - src/ui/eqslider.cpp | 153 -- src/ui/eqslider.h | 70 - src/ui/eqtitlebar.cpp | 189 -- src/ui/eqtitlebar.h | 75 - src/ui/eqwidget.cpp | 446 ----- src/ui/eqwidget.h | 102 -- src/ui/fft.c | 296 ---- src/ui/fft.h | 45 - src/ui/forms/aboutdialog.ui | 162 -- src/ui/forms/addurldialog.ui | 99 -- src/ui/forms/configdialog.ui | 1576 ----------------- src/ui/forms/jumptotrackdialog.ui | 152 -- src/ui/forms/playlistbrowser.ui | 126 -- src/ui/forms/popupsettings.ui | 251 --- src/ui/forms/preseteditor.ui | 120 -- src/ui/forms/shortcutdialog.ui | 120 -- src/ui/inlines.h | 57 - src/ui/jumptotrackdialog.cpp | 138 -- src/ui/jumptotrackdialog.h | 62 - src/ui/keyboardmanager.cpp | 280 --- src/ui/keyboardmanager.h | 67 - src/ui/listwidget.cpp | 569 ------ src/ui/listwidget.h | 165 -- src/ui/main.cpp | 56 + src/ui/mainvisual.cpp | 613 ------- src/ui/mainvisual.h | 145 -- src/ui/mainwindow.cpp | 616 ------- src/ui/mainwindow.h | 123 -- src/ui/monostereo.cpp | 69 - src/ui/monostereo.h | 51 - src/ui/mp3player.cpp | 57 - src/ui/number.cpp | 45 - src/ui/number.h | 49 - src/ui/pixmapwidget.cpp | 47 - src/ui/pixmapwidget.h | 50 - src/ui/playlist.cpp | 616 ------- src/ui/playlist.h | 140 -- src/ui/playlistbrowser.cpp | 117 -- src/ui/playlistbrowser.h | 54 - src/ui/playlistcontrol.cpp | 58 - src/ui/playlistcontrol.h | 57 - src/ui/playlistselector.cpp | 303 ---- src/ui/playlistselector.h | 79 - src/ui/playlistslider.cpp | 135 -- src/ui/playlistslider.h | 63 - src/ui/playlisttitlebar.cpp | 275 --- src/ui/playlisttitlebar.h | 80 - src/ui/playstatus.cpp | 63 - src/ui/playstatus.h | 55 - src/ui/pluginitem.cpp | 188 -- src/ui/pluginitem.h | 73 - src/ui/popupsettings.cpp | 88 - src/ui/popupsettings.h | 52 - src/ui/popupwidget.cpp | 136 -- src/ui/popupwidget.h | 66 - src/ui/positionbar.cpp | 136 -- src/ui/positionbar.h | 65 - src/ui/preseteditor.cpp | 82 - src/ui/preseteditor.h | 57 - src/ui/qmmpstarter.cpp | 37 +- src/ui/qmmpstarter.h | 2 +- src/ui/shadedbar.cpp | 143 -- src/ui/shadedbar.h | 76 - src/ui/shadedvisual.cpp | 181 -- src/ui/shadedvisual.h | 70 - src/ui/shortcutdialog.cpp | 63 - src/ui/shortcutdialog.h | 49 - src/ui/shortcutitem.cpp | 39 - src/ui/shortcutitem.h | 45 - src/ui/skin.cpp | 852 --------- src/ui/skin.h | 390 ----- src/ui/skinreader.cpp | 207 --- src/ui/skinreader.h | 52 - src/ui/stuff.qrc | 88 - src/ui/symboldisplay.cpp | 91 - src/ui/symboldisplay.h | 67 - src/ui/textscroller.cpp | 314 ---- src/ui/textscroller.h | 81 - src/ui/timeindicator.cpp | 139 -- src/ui/timeindicator.h | 68 - src/ui/titlebar.cpp | 223 --- src/ui/titlebar.h | 85 - src/ui/titlebarcontrol.cpp | 65 - src/ui/titlebarcontrol.h | 58 - src/ui/togglebutton.cpp | 108 -- src/ui/togglebutton.h | 63 - src/ui/ui.pro | 138 +- src/ui/visualmenu.cpp | 63 - src/ui/visualmenu.h | 57 - src/ui/volumebar.cpp | 127 -- src/ui/volumebar.h | 76 - src/ui/windowsystem.cpp | 213 --- src/ui/windowsystem.h | 39 - 365 files changed, 50877 insertions(+), 17529 deletions(-) create mode 100644 src/plugins/Ui/Ui.pro create mode 100644 src/plugins/Ui/skinned/aboutdialog.cpp create mode 100644 src/plugins/Ui/skinned/aboutdialog.h create mode 100644 src/plugins/Ui/skinned/actionmanager.cpp create mode 100644 src/plugins/Ui/skinned/actionmanager.h create mode 100644 src/plugins/Ui/skinned/addurldialog.cpp create mode 100644 src/plugins/Ui/skinned/addurldialog.h create mode 100644 src/plugins/Ui/skinned/balancebar.cpp create mode 100644 src/plugins/Ui/skinned/balancebar.h create mode 100644 src/plugins/Ui/skinned/button.cpp create mode 100644 src/plugins/Ui/skinned/button.h create mode 100644 src/plugins/Ui/skinned/configdialog.cpp create mode 100644 src/plugins/Ui/skinned/configdialog.h create mode 100644 src/plugins/Ui/skinned/cursorimage.cpp create mode 100644 src/plugins/Ui/skinned/cursorimage.h create mode 100644 src/plugins/Ui/skinned/default/balance.png create mode 100644 src/plugins/Ui/skinned/default/cbuttons.png create mode 100644 src/plugins/Ui/skinned/default/eq_ex.png create mode 100644 src/plugins/Ui/skinned/default/eqmain.png create mode 100644 src/plugins/Ui/skinned/default/main.png create mode 100644 src/plugins/Ui/skinned/default/monoster.png create mode 100644 src/plugins/Ui/skinned/default/numbers.png create mode 100644 src/plugins/Ui/skinned/default/playpaus.png create mode 100644 src/plugins/Ui/skinned/default/pledit.png create mode 100644 src/plugins/Ui/skinned/default/pledit.txt create mode 100644 src/plugins/Ui/skinned/default/posbar.png create mode 100644 src/plugins/Ui/skinned/default/readme.txt create mode 100644 src/plugins/Ui/skinned/default/shufrep.png create mode 100644 src/plugins/Ui/skinned/default/text.png create mode 100644 src/plugins/Ui/skinned/default/titlebar.png create mode 100644 src/plugins/Ui/skinned/default/viscolor.txt create mode 100644 src/plugins/Ui/skinned/default/volume.png create mode 100644 src/plugins/Ui/skinned/display.cpp create mode 100644 src/plugins/Ui/skinned/display.h create mode 100644 src/plugins/Ui/skinned/dock.cpp create mode 100644 src/plugins/Ui/skinned/dock.h create mode 100644 src/plugins/Ui/skinned/eqgraph.cpp create mode 100644 src/plugins/Ui/skinned/eqgraph.h create mode 100644 src/plugins/Ui/skinned/eqpreset.cpp create mode 100644 src/plugins/Ui/skinned/eqpreset.h create mode 100644 src/plugins/Ui/skinned/eqslider.cpp create mode 100644 src/plugins/Ui/skinned/eqslider.h create mode 100644 src/plugins/Ui/skinned/eqtitlebar.cpp create mode 100644 src/plugins/Ui/skinned/eqtitlebar.h create mode 100644 src/plugins/Ui/skinned/eqwidget.cpp create mode 100644 src/plugins/Ui/skinned/eqwidget.h create mode 100644 src/plugins/Ui/skinned/fft.c create mode 100644 src/plugins/Ui/skinned/fft.h create mode 100644 src/plugins/Ui/skinned/forms/aboutdialog.ui create mode 100644 src/plugins/Ui/skinned/forms/addurldialog.ui create mode 100644 src/plugins/Ui/skinned/forms/configdialog.ui create mode 100644 src/plugins/Ui/skinned/forms/jumptotrackdialog.ui create mode 100644 src/plugins/Ui/skinned/forms/playlistbrowser.ui create mode 100644 src/plugins/Ui/skinned/forms/popupsettings.ui create mode 100644 src/plugins/Ui/skinned/forms/preseteditor.ui create mode 100644 src/plugins/Ui/skinned/forms/shortcutdialog.ui create mode 100644 src/plugins/Ui/skinned/images/16x16/qmmp.png create mode 100644 src/plugins/Ui/skinned/images/32x32/qmmp.png create mode 100644 src/plugins/Ui/skinned/images/48x48/qmmp.png create mode 100644 src/plugins/Ui/skinned/images/56x56/qmmp.png create mode 100644 src/plugins/Ui/skinned/images/advanced.png create mode 100644 src/plugins/Ui/skinned/images/images.qrc create mode 100644 src/plugins/Ui/skinned/images/interface.png create mode 100644 src/plugins/Ui/skinned/images/logo-qmmp.png create mode 100644 src/plugins/Ui/skinned/images/network.png create mode 100644 src/plugins/Ui/skinned/images/playlist.png create mode 100644 src/plugins/Ui/skinned/images/plugins.png create mode 100644 src/plugins/Ui/skinned/images/replaygain.png create mode 100644 src/plugins/Ui/skinned/images/scalable/qmmp-simple.svgz create mode 100644 src/plugins/Ui/skinned/images/scalable/qmmp.svgz create mode 100644 src/plugins/Ui/skinned/images/shortcuts.png create mode 100644 src/plugins/Ui/skinned/images/ui_no_cover.png create mode 100644 src/plugins/Ui/skinned/inlines.h create mode 100644 src/plugins/Ui/skinned/jumptotrackdialog.cpp create mode 100644 src/plugins/Ui/skinned/jumptotrackdialog.h create mode 100644 src/plugins/Ui/skinned/keyboardmanager.cpp create mode 100644 src/plugins/Ui/skinned/keyboardmanager.h create mode 100644 src/plugins/Ui/skinned/listwidget.cpp create mode 100644 src/plugins/Ui/skinned/listwidget.h create mode 100644 src/plugins/Ui/skinned/lxdesupport.cpp create mode 100644 src/plugins/Ui/skinned/lxdesupport.h create mode 100644 src/plugins/Ui/skinned/mainvisual.cpp create mode 100644 src/plugins/Ui/skinned/mainvisual.h create mode 100644 src/plugins/Ui/skinned/mainwindow.cpp create mode 100644 src/plugins/Ui/skinned/mainwindow.h create mode 100644 src/plugins/Ui/skinned/monostereo.cpp create mode 100644 src/plugins/Ui/skinned/monostereo.h create mode 100644 src/plugins/Ui/skinned/number.cpp create mode 100644 src/plugins/Ui/skinned/number.h create mode 100644 src/plugins/Ui/skinned/pixmapwidget.cpp create mode 100644 src/plugins/Ui/skinned/pixmapwidget.h create mode 100644 src/plugins/Ui/skinned/playlist.cpp create mode 100644 src/plugins/Ui/skinned/playlist.h create mode 100644 src/plugins/Ui/skinned/playlistbrowser.cpp create mode 100644 src/plugins/Ui/skinned/playlistbrowser.h create mode 100644 src/plugins/Ui/skinned/playlistcontrol.cpp create mode 100644 src/plugins/Ui/skinned/playlistcontrol.h create mode 100644 src/plugins/Ui/skinned/playlistselector.cpp create mode 100644 src/plugins/Ui/skinned/playlistselector.h create mode 100644 src/plugins/Ui/skinned/playlistslider.cpp create mode 100644 src/plugins/Ui/skinned/playlistslider.h create mode 100644 src/plugins/Ui/skinned/playlisttitlebar.cpp create mode 100644 src/plugins/Ui/skinned/playlisttitlebar.h create mode 100644 src/plugins/Ui/skinned/playstatus.cpp create mode 100644 src/plugins/Ui/skinned/playstatus.h create mode 100644 src/plugins/Ui/skinned/pluginitem.cpp create mode 100644 src/plugins/Ui/skinned/pluginitem.h create mode 100644 src/plugins/Ui/skinned/popupsettings.cpp create mode 100644 src/plugins/Ui/skinned/popupsettings.h create mode 100644 src/plugins/Ui/skinned/popupwidget.cpp create mode 100644 src/plugins/Ui/skinned/popupwidget.h create mode 100644 src/plugins/Ui/skinned/positionbar.cpp create mode 100644 src/plugins/Ui/skinned/positionbar.h create mode 100644 src/plugins/Ui/skinned/preseteditor.cpp create mode 100644 src/plugins/Ui/skinned/preseteditor.h create mode 100644 src/plugins/Ui/skinned/qmmp.desktop create mode 100644 src/plugins/Ui/skinned/qmmp_enqueue.desktop create mode 100644 src/plugins/Ui/skinned/shadedbar.cpp create mode 100644 src/plugins/Ui/skinned/shadedbar.h create mode 100644 src/plugins/Ui/skinned/shadedvisual.cpp create mode 100644 src/plugins/Ui/skinned/shadedvisual.h create mode 100644 src/plugins/Ui/skinned/shortcutdialog.cpp create mode 100644 src/plugins/Ui/skinned/shortcutdialog.h create mode 100644 src/plugins/Ui/skinned/shortcutitem.cpp create mode 100644 src/plugins/Ui/skinned/shortcutitem.h create mode 100644 src/plugins/Ui/skinned/skin.cpp create mode 100644 src/plugins/Ui/skinned/skin.h create mode 100644 src/plugins/Ui/skinned/skinned.pro create mode 100644 src/plugins/Ui/skinned/skinnedfactory.cpp create mode 100644 src/plugins/Ui/skinned/skinnedfactory.h create mode 100644 src/plugins/Ui/skinned/skinreader.cpp create mode 100644 src/plugins/Ui/skinned/skinreader.h create mode 100644 src/plugins/Ui/skinned/stuff.qrc create mode 100644 src/plugins/Ui/skinned/symboldisplay.cpp create mode 100644 src/plugins/Ui/skinned/symboldisplay.h create mode 100644 src/plugins/Ui/skinned/textscroller.cpp create mode 100644 src/plugins/Ui/skinned/textscroller.h create mode 100644 src/plugins/Ui/skinned/timeindicator.cpp create mode 100644 src/plugins/Ui/skinned/timeindicator.h create mode 100644 src/plugins/Ui/skinned/titlebar.cpp create mode 100644 src/plugins/Ui/skinned/titlebar.h create mode 100644 src/plugins/Ui/skinned/titlebarcontrol.cpp create mode 100644 src/plugins/Ui/skinned/titlebarcontrol.h create mode 100644 src/plugins/Ui/skinned/togglebutton.cpp create mode 100644 src/plugins/Ui/skinned/togglebutton.h create mode 100644 src/plugins/Ui/skinned/translations/qmmp_cs.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_de.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_es.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_fr.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_hu.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_it.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_ja.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_kk.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_locales.qrc create mode 100644 src/plugins/Ui/skinned/translations/qmmp_lt.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_nl.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_pl_PL.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_pt_BR.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_ru.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_sk.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_tr.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_uk_UA.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_zh_CN.ts create mode 100644 src/plugins/Ui/skinned/translations/qmmp_zh_TW.ts create mode 100644 src/plugins/Ui/skinned/txt/authors_cs.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_de.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_en.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_es.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_it.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_ja.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_lt.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_nl.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_pl.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_ru.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_tr.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_uk_UA.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_zh_CN.txt create mode 100644 src/plugins/Ui/skinned/txt/authors_zh_TW.txt create mode 100644 src/plugins/Ui/skinned/txt/description_cs.txt create mode 100644 src/plugins/Ui/skinned/txt/description_de.txt create mode 100644 src/plugins/Ui/skinned/txt/description_en.txt create mode 100644 src/plugins/Ui/skinned/txt/description_es.txt create mode 100644 src/plugins/Ui/skinned/txt/description_it.txt create mode 100644 src/plugins/Ui/skinned/txt/description_ja.txt create mode 100644 src/plugins/Ui/skinned/txt/description_lt.txt create mode 100644 src/plugins/Ui/skinned/txt/description_nl.txt create mode 100644 src/plugins/Ui/skinned/txt/description_pl.txt create mode 100644 src/plugins/Ui/skinned/txt/description_ru.txt create mode 100644 src/plugins/Ui/skinned/txt/description_tr.txt create mode 100644 src/plugins/Ui/skinned/txt/description_uk_UA.txt create mode 100644 src/plugins/Ui/skinned/txt/description_zh_CN.txt create mode 100644 src/plugins/Ui/skinned/txt/description_zh_TW.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_cs.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_de.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_en.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_es.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_it.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_ja.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_lt.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_nl.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_pl.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_ru.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_tr.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_uk_UA.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_zh_CN.txt create mode 100644 src/plugins/Ui/skinned/txt/thanks_zh_TW.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_cs.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_de.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_en.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_es.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_it.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_ja.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_lt.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_nl.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_pl.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_ru.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_tr.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_uk_UA.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_zh_CN.txt create mode 100644 src/plugins/Ui/skinned/txt/translators_zh_TW.txt create mode 100644 src/plugins/Ui/skinned/visualmenu.cpp create mode 100644 src/plugins/Ui/skinned/visualmenu.h create mode 100644 src/plugins/Ui/skinned/volumebar.cpp create mode 100644 src/plugins/Ui/skinned/volumebar.h create mode 100644 src/plugins/Ui/skinned/windowsystem.cpp create mode 100644 src/plugins/Ui/skinned/windowsystem.h create mode 100644 src/qmmpui/uifactory.h create mode 100644 src/qmmpui/uiloader.cpp create mode 100644 src/qmmpui/uiloader.h delete mode 100644 src/ui/aboutdialog.cpp delete mode 100644 src/ui/aboutdialog.h delete mode 100644 src/ui/actionmanager.cpp delete mode 100644 src/ui/actionmanager.h delete mode 100644 src/ui/addurldialog.cpp delete mode 100644 src/ui/addurldialog.h delete mode 100644 src/ui/balancebar.cpp delete mode 100644 src/ui/balancebar.h delete mode 100644 src/ui/button.cpp delete mode 100644 src/ui/button.h delete mode 100644 src/ui/configdialog.cpp delete mode 100644 src/ui/configdialog.h delete mode 100644 src/ui/cursorimage.cpp delete mode 100644 src/ui/cursorimage.h delete mode 100644 src/ui/default/balance.png delete mode 100644 src/ui/default/cbuttons.png delete mode 100644 src/ui/default/eq_ex.png delete mode 100644 src/ui/default/eqmain.png delete mode 100644 src/ui/default/main.png delete mode 100644 src/ui/default/monoster.png delete mode 100644 src/ui/default/numbers.png delete mode 100644 src/ui/default/playpaus.png delete mode 100644 src/ui/default/pledit.png delete mode 100644 src/ui/default/pledit.txt delete mode 100644 src/ui/default/posbar.png delete mode 100644 src/ui/default/readme.txt delete mode 100644 src/ui/default/shufrep.png delete mode 100644 src/ui/default/text.png delete mode 100644 src/ui/default/titlebar.png delete mode 100644 src/ui/default/viscolor.txt delete mode 100644 src/ui/default/volume.png delete mode 100644 src/ui/display.cpp delete mode 100644 src/ui/display.h delete mode 100644 src/ui/dock.cpp delete mode 100644 src/ui/dock.h delete mode 100644 src/ui/eqgraph.cpp delete mode 100644 src/ui/eqgraph.h delete mode 100644 src/ui/eqpreset.cpp delete mode 100644 src/ui/eqpreset.h delete mode 100644 src/ui/eqslider.cpp delete mode 100644 src/ui/eqslider.h delete mode 100644 src/ui/eqtitlebar.cpp delete mode 100644 src/ui/eqtitlebar.h delete mode 100644 src/ui/eqwidget.cpp delete mode 100644 src/ui/eqwidget.h delete mode 100644 src/ui/fft.c delete mode 100644 src/ui/fft.h delete mode 100644 src/ui/forms/aboutdialog.ui delete mode 100644 src/ui/forms/addurldialog.ui delete mode 100644 src/ui/forms/configdialog.ui delete mode 100644 src/ui/forms/jumptotrackdialog.ui delete mode 100644 src/ui/forms/playlistbrowser.ui delete mode 100644 src/ui/forms/popupsettings.ui delete mode 100644 src/ui/forms/preseteditor.ui delete mode 100644 src/ui/forms/shortcutdialog.ui delete mode 100644 src/ui/inlines.h delete mode 100644 src/ui/jumptotrackdialog.cpp delete mode 100644 src/ui/jumptotrackdialog.h delete mode 100644 src/ui/keyboardmanager.cpp delete mode 100644 src/ui/keyboardmanager.h delete mode 100644 src/ui/listwidget.cpp delete mode 100644 src/ui/listwidget.h create mode 100644 src/ui/main.cpp delete mode 100644 src/ui/mainvisual.cpp delete mode 100644 src/ui/mainvisual.h delete mode 100644 src/ui/mainwindow.cpp delete mode 100644 src/ui/mainwindow.h delete mode 100644 src/ui/monostereo.cpp delete mode 100644 src/ui/monostereo.h delete mode 100644 src/ui/mp3player.cpp delete mode 100644 src/ui/number.cpp delete mode 100644 src/ui/number.h delete mode 100644 src/ui/pixmapwidget.cpp delete mode 100644 src/ui/pixmapwidget.h delete mode 100644 src/ui/playlist.cpp delete mode 100644 src/ui/playlist.h delete mode 100644 src/ui/playlistbrowser.cpp delete mode 100644 src/ui/playlistbrowser.h delete mode 100644 src/ui/playlistcontrol.cpp delete mode 100644 src/ui/playlistcontrol.h delete mode 100644 src/ui/playlistselector.cpp delete mode 100644 src/ui/playlistselector.h delete mode 100644 src/ui/playlistslider.cpp delete mode 100644 src/ui/playlistslider.h delete mode 100644 src/ui/playlisttitlebar.cpp delete mode 100644 src/ui/playlisttitlebar.h delete mode 100644 src/ui/playstatus.cpp delete mode 100644 src/ui/playstatus.h delete mode 100644 src/ui/pluginitem.cpp delete mode 100644 src/ui/pluginitem.h delete mode 100644 src/ui/popupsettings.cpp delete mode 100644 src/ui/popupsettings.h delete mode 100644 src/ui/popupwidget.cpp delete mode 100644 src/ui/popupwidget.h delete mode 100644 src/ui/positionbar.cpp delete mode 100644 src/ui/positionbar.h delete mode 100644 src/ui/preseteditor.cpp delete mode 100644 src/ui/preseteditor.h delete mode 100644 src/ui/shadedbar.cpp delete mode 100644 src/ui/shadedbar.h delete mode 100644 src/ui/shadedvisual.cpp delete mode 100644 src/ui/shadedvisual.h delete mode 100644 src/ui/shortcutdialog.cpp delete mode 100644 src/ui/shortcutdialog.h delete mode 100644 src/ui/shortcutitem.cpp delete mode 100644 src/ui/shortcutitem.h delete mode 100644 src/ui/skin.cpp delete mode 100644 src/ui/skin.h delete mode 100644 src/ui/skinreader.cpp delete mode 100644 src/ui/skinreader.h delete mode 100644 src/ui/stuff.qrc delete mode 100644 src/ui/symboldisplay.cpp delete mode 100644 src/ui/symboldisplay.h delete mode 100644 src/ui/textscroller.cpp delete mode 100644 src/ui/textscroller.h delete mode 100644 src/ui/timeindicator.cpp delete mode 100644 src/ui/timeindicator.h delete mode 100644 src/ui/titlebar.cpp delete mode 100644 src/ui/titlebar.h delete mode 100644 src/ui/titlebarcontrol.cpp delete mode 100644 src/ui/titlebarcontrol.h delete mode 100644 src/ui/togglebutton.cpp delete mode 100644 src/ui/togglebutton.h delete mode 100644 src/ui/visualmenu.cpp delete mode 100644 src/ui/visualmenu.h delete mode 100644 src/ui/volumebar.cpp delete mode 100644 src/ui/volumebar.h delete mode 100644 src/ui/windowsystem.cpp delete mode 100644 src/ui/windowsystem.h diff --git a/src/plugins/Ui/Ui.pro b/src/plugins/Ui/Ui.pro new file mode 100644 index 000000000..b6c44ce0d --- /dev/null +++ b/src/plugins/Ui/Ui.pro @@ -0,0 +1,4 @@ +include(../../../qmmp.pri) +TEMPLATE = subdirs + +SUBDIRS += skinned diff --git a/src/plugins/Ui/skinned/aboutdialog.cpp b/src/plugins/Ui/skinned/aboutdialog.cpp new file mode 100644 index 000000000..5728697b9 --- /dev/null +++ b/src/plugins/Ui/skinned/aboutdialog.cpp @@ -0,0 +1,131 @@ +/*************************************************************************** +* Copyright (C) 2006 by Ilya Kotov * +* forkotov02@hotmail.ru * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "aboutdialog.h" + +static QString getstringFromResource(const QString& res_file) +{ + QString ret_string; + QFile file(res_file); + if (file.open(QIODevice::ReadOnly)) + { + QTextStream ts(&file); + ts.setCodec("UTF-8"); + ret_string = ts.readAll(); + file.close(); + } + return ret_string; +} + +AboutDialog::AboutDialog(QWidget* parent, Qt::WFlags fl) + : QDialog( parent, fl ) +{ + setupUi(this); + setAttribute(Qt::WA_QuitOnClose, false); + licenseTextEdit->setPlainText(getstringFromResource(":COPYING")); + aboutTextEdit->setHtml(loadAbout()); + authorsTextEdit->setPlainText(getstringFromResource(tr(":/txt/authors_en.txt"))); + thanksToTextEdit->setPlainText(getstringFromResource(tr(":/txt/thanks_en.txt"))); + translatorsTextEdit->setPlainText(getstringFromResource(tr(":/txt/translators_en.txt"))); +} + +AboutDialog::~AboutDialog() +{} + +/*$SPECIALIZATION$*/ +void AboutDialog::accept() +{ + QDialog::accept(); +} + +QString AboutDialog::loadAbout() +{ + QString text; + text.append(""); + text.append(""); + text.append(""); + text.append("

"+tr("Qt-based Multimedia Player (Qmmp)")+"

"); + text.append("

"+tr("Version:")+" "+ Qmmp::strVersion() + "

"); + text.append("

"+getstringFromResource(tr(":txt/description_en.txt"))+"

"); + text.append("
"+tr("Input plugins:")+"
"); + text.append("
    "); + foreach(DecoderFactory *fact, *Decoder::factories()) + { + text.append("
  • "); + text.append(fact->properties().name); + text.append("
  • "); + } + text.append("
"); + text.append("
"+tr("Output plugins:")+"
"); + text.append("
    "); + foreach(OutputFactory *fact, *Output::factories()) + { + text.append("
  • "); + text.append(fact->properties().name); + text.append("
  • "); + } + text.append("
"); + text.append("
"+tr("Visual plugins:")+"
"); + text.append("
    "); + foreach(VisualFactory *fact, *Visual::factories()) + { + text.append("
  • "); + text.append(fact->properties().name); + text.append("
  • "); + } + text.append("
"); + text.append("
"+tr("Effect plugins:")+"
"); + text.append("
    "); + foreach(EffectFactory *fact, *Effect::factories()) + { + text.append("
  • "); + text.append(fact->properties().name); + text.append("
  • "); + } + text.append("
"); + text.append("
"+tr("General plugins:")+"
"); + text.append("
    "); + foreach(GeneralFactory *fact, *General::factories()) + { + text.append("
  • "); + text.append(fact->properties().name); + text.append("
  • "); + } + text.append("
"); + + return text; +} diff --git a/src/plugins/Ui/skinned/aboutdialog.h b/src/plugins/Ui/skinned/aboutdialog.h new file mode 100644 index 000000000..2d8384ea4 --- /dev/null +++ b/src/plugins/Ui/skinned/aboutdialog.h @@ -0,0 +1,47 @@ +/*************************************************************************** +* Copyright (C) 2006 by Ilya Kotov * +* forkotov02@hotmail.ru * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ + +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include +#include "ui_aboutdialog.h" + +/** + @author Vladimir Kuznetsov + */ + +class AboutDialog : public QDialog, private Ui::AboutDialog +{ + Q_OBJECT +public: + AboutDialog(QWidget* parent = 0, Qt::WFlags fl = 0 ); + ~AboutDialog(); + +protected slots: + virtual void accept(); + +private: + QString loadAbout(); + +}; + +#endif + diff --git a/src/plugins/Ui/skinned/actionmanager.cpp b/src/plugins/Ui/skinned/actionmanager.cpp new file mode 100644 index 000000000..f4689ecd0 --- /dev/null +++ b/src/plugins/Ui/skinned/actionmanager.cpp @@ -0,0 +1,147 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include "actionmanager.h" + +ActionManager *ActionManager::m_instance = 0; + +ActionManager::ActionManager(QObject *parent) : + QObject(parent) +{ + m_instance = this; + m_settings = new QSettings(Qmmp::configFile(), QSettings::IniFormat); + m_settings->beginGroup("Shortcuts"); + //playback + m_actions[PLAY] = createAction(tr("&Play"), "play", tr("X"), "media-playback-start"); + m_actions[PAUSE] = createAction(tr("&Pause"), "pause", tr("C"), "media-playback-pause"); + m_actions[STOP] = createAction(tr("&Stop"), "stop", tr("V"), "media-playback-stop"); + m_actions[PREVIOUS] = createAction(tr("&Previous"), "previous", tr("Z"), "media-skip-backward"); + m_actions[NEXT] = createAction(tr("&Next"), "next", tr("B"), "media-skip-forward"); + m_actions[PLAY_PAUSE] = createAction(tr("&Play/Pause"), "play_pause", tr("Space")); + m_actions[JUMP] = createAction(tr("&Jump to File"), "jump", tr("J"), "go-up"); + m_actions[REPEAT_ALL] = createAction2(tr("&Repeat Playlist"), "repeate_playlist", tr("R")); + m_actions[REPEAT_TRACK] = createAction2(tr("&Repeat Track"), "repeate_track", tr("Ctrl+R")); + m_actions[SHUFFLE] = createAction2(tr("&Shuffle"), "shuffle", tr("S")); + m_actions[NO_PL_ADVANCE] = createAction2(tr("&No Playlist Advance"), "no_playlist_advance", + tr("Ctrl+N")); + m_actions[STOP_AFTER_SELECTED] = createAction(tr("&Stop After Selected"), "stop_after_selected", + tr("Ctrl+S")); + m_actions[CLEAR_QUEUE] = createAction(tr("&Clear Queue"), "clear_queue", tr("Alt+Q")); + //view + m_actions[SHOW_PLAYLIST] = createAction2(tr("Show Playlist"), "show_playlist", tr("Alt+E")); + m_actions[SHOW_EQUALIZER] = createAction2(tr("Show Equalizer"), "show_equalizer", tr("Alt+G")); + m_actions[WM_ALLWAYS_ON_TOP] = createAction2(tr("Always on Top"), "always_on_top", ""); + m_actions[WM_STICKY] = createAction2(tr("Put on All Workspaces"), "General/always_on_top", ""); + m_actions[WM_DOUBLE_SIZE] = createAction2(tr("Double Size"), "double_size", tr("Meta+D")); + //playlist + m_actions[PL_ADD_FILE] = createAction(tr("&Add File"), "add_file", tr("F"), "audio-x-generic"); + m_actions[PL_ADD_DIRECTORY] = createAction(tr("&Add Directory"), "add_dir", tr("D"), "folder"); + m_actions[PL_ADD_URL] = createAction(tr("&Add Url"), "add_url", tr("U"), "network-server"); + m_actions[PL_REMOVE_SELECTED] = createAction(tr("&Remove Selected"), "remove_selected", + tr("Del"), "edit-delete"); + m_actions[PL_REMOVE_ALL] = createAction(tr("&Remove All"), "remove_all", "", "edit-clear"); + m_actions[PL_REMOVE_UNSELECTED] = createAction(tr("&Remove Unselected"), "remove_unselected", + "", "edit-delete"); + m_actions[PL_REMOVE_INVALID] = createAction(tr("Remove unavailable files"), "remove_invalid", + "", "dialog-error"); + m_actions[PL_REMOVE_DUPLICATES] = createAction(tr("Remove duplicates"), "remove_duplicates", ""); + m_actions[PL_ENQUEUE] = createAction(tr("&Queue Toggle"), "enqueue", tr("Q")); + m_actions[PL_INVERT_SELECTION] = createAction(tr("Invert Selection"), "invert_selection", ""); + m_actions[PL_CLEAR_SELECTION] = createAction(tr("&Select None"), "clear_selection", ""); + m_actions[PL_SELECT_ALL] = createAction(tr("&Select All"), "select_all", + tr("Ctrl+A"), "edit-select-all"); + m_actions[PL_SHOW_INFO] = createAction(tr("&View Track Details"), "show_info", tr("Alt+I"), + "dialog-information"); + m_actions[PL_NEW] = createAction(tr("&New List"), "new_pl", tr("Ctrl+T"), "document-new"); + m_actions[PL_CLOSE] = createAction(tr("&Delete List"), "close_pl", tr("Ctrl+W"), "window-close"); + m_actions[PL_LOAD] = createAction(tr("&Load List"), "load_pl", tr("O"), "document-open"); + m_actions[PL_SAVE] = createAction(tr("&Save List"), "save_pl", tr("Shift+S"), "document-save-as"); + m_actions[PL_SELECT_NEXT] = createAction(tr("&Select Next Playlist"), "next_pl", + tr("Ctrl+PgDown"), "go-next"); + m_actions[PL_SELECT_PREVIOUS] = createAction(tr("&Select Previous Playlist"), "prev_pl", + tr("Ctrl+PgUp"), "go-previous"); + m_actions[PL_SHOW_MANAGER] = createAction(tr("&Show Playlists"), "show_playlists", + tr("P"), "view-list-details"); + //other + m_actions[SETTINGS] = createAction(tr("&Settings"), "show_settings", tr("Ctrl+P"), "configure"); + m_actions[ABOUT] = createAction(tr("&About"), "about", "", ":/32x32/qmmp.png"); + m_actions[ABOUT_QT] = createAction(tr("&About Qt"), "about_qt", ""); + m_actions[QUIT] = createAction(tr("&Exit"), "exit", tr("Ctrl+Q"), "application-exit"); + m_settings->endGroup(); + delete m_settings; + m_settings = 0; +} + +ActionManager::~ActionManager() +{ + m_instance = 0; +} + +QAction *ActionManager::action(int type) +{ + return m_actions[type]; +} + +QAction *ActionManager::use(int type, const QObject *receiver, const char *member) +{ + QAction *act = m_actions[type]; + connect(act,SIGNAL(triggered(bool)), receiver, member); + return act; +} + +ActionManager* ActionManager::instance() +{ + return m_instance; +} + +QAction *ActionManager::createAction(QString name, QString confKey, QString key, QString iconName) +{ + QAction *action = new QAction(name, this); + action->setShortcut(m_settings->value(confKey, key).toString()); + action->setObjectName(confKey); + if(iconName.isEmpty()) + return action; + if(QFile::exists(iconName)) + action->setIcon(QIcon(iconName)); + else + action->setIcon(QIcon::fromTheme(iconName)); + return action; +} + +QAction *ActionManager::createAction2(QString name, QString confKey, QString key) +{ + QAction *action = createAction(name, confKey, key); + action->setCheckable(true); + return action; +} + +void ActionManager::saveActions() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + foreach(QAction *action, m_actions.values()) + { + settings.setValue(QString("Shortcuts/")+action->objectName(), action->shortcut()); + } +} diff --git a/src/plugins/Ui/skinned/actionmanager.h b/src/plugins/Ui/skinned/actionmanager.h new file mode 100644 index 000000000..33e6302fb --- /dev/null +++ b/src/plugins/Ui/skinned/actionmanager.h @@ -0,0 +1,111 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef ACTIONMANAGER_H +#define ACTIONMANAGER_H + +#include +#include +#include + +class QAction; +class QSettings; + +#define SET_ACTION(type, receiver, member) ActionManager::instance()->use(type, receiver, member) +#define ACTION(type) ActionManager::instance()->action(type) + +/** + @author Ilya Kotov +*/ +class ActionManager : public QObject +{ + Q_OBJECT +public: + explicit ActionManager(QObject *parent = 0); + ~ActionManager(); + + enum Type + { + PLAY = 0, + PAUSE, + STOP, + PREVIOUS, + NEXT, + PLAY_PAUSE, + JUMP, + + REPEAT_ALL, + REPEAT_TRACK, + SHUFFLE, + NO_PL_ADVANCE, + STOP_AFTER_SELECTED, + CLEAR_QUEUE, + + SHOW_PLAYLIST, + SHOW_EQUALIZER, + + WM_ALLWAYS_ON_TOP, + WM_STICKY, + WM_DOUBLE_SIZE, + + PL_ADD_FILE, + PL_ADD_DIRECTORY, + PL_ADD_URL, + PL_REMOVE_SELECTED, + PL_REMOVE_ALL, + PL_REMOVE_UNSELECTED, + PL_REMOVE_INVALID, + PL_REMOVE_DUPLICATES, + PL_ENQUEUE, + PL_INVERT_SELECTION, + PL_CLEAR_SELECTION, + PL_SELECT_ALL, + PL_SHOW_INFO, + PL_NEW, + PL_CLOSE, + PL_LOAD, + PL_SAVE, + PL_SELECT_NEXT, + PL_SELECT_PREVIOUS, + PL_SHOW_MANAGER, + + SETTINGS, + ABOUT, + ABOUT_QT, + QUIT, + }; + + QAction *action(int type); + QAction *use(int type, const QObject *receiver, const char *member); + QList actions(); + void saveActions(); + static ActionManager* instance(); + +private: + QAction *createAction(QString name, QString confKey, QString key, QString iconName = QString()); + QAction *createAction2(QString name, QString confKey, QString key); + + QSettings *m_settings; + QHash m_actions; + static ActionManager *m_instance; + +}; + +#endif // ACTIONMANAGER_H diff --git a/src/plugins/Ui/skinned/addurldialog.cpp b/src/plugins/Ui/skinned/addurldialog.cpp new file mode 100644 index 000000000..5b65337db --- /dev/null +++ b/src/plugins/Ui/skinned/addurldialog.cpp @@ -0,0 +1,134 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "addurldialog.h" + +#define HISTORY_SIZE 10 + +AddUrlDialog::AddUrlDialog( QWidget * parent, Qt::WindowFlags f) : QDialog(parent,f) +{ + setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + setAttribute(Qt::WA_QuitOnClose, false); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_history = settings.value("URLDialog/history").toStringList(); + urlComboBox->addItems(m_history); + m_http = new QNetworkAccessManager(this); + //load global proxy settings + QmmpSettings *gs = QmmpSettings::instance(); + if (gs->isProxyEnabled()) + { + QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); + if(gs->useProxyAuth()) + { + proxy.setUser(gs->proxy().userName()); + proxy.setPassword(gs->proxy().password()); + } + m_http->setProxy(proxy); + } +} + +AddUrlDialog::~AddUrlDialog() +{ + if ( m_history.size() > HISTORY_SIZE) + m_history.removeLast(); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.setValue("URLDialog/history", m_history); +} + +QPointer AddUrlDialog::instance = 0; + +void AddUrlDialog::popup(QWidget* parent,PlayListModel* model ) +{ + if (!instance) + { + instance = new AddUrlDialog(parent); + instance->setModel(model); + } + instance->show(); + instance->raise(); +} + +void AddUrlDialog::accept( ) +{ + if (!urlComboBox->currentText().isEmpty()) + { + QString s = urlComboBox->currentText(); + if (!s.startsWith("http://") && !s.contains("://")) + s.prepend("http://"); + m_history.removeAll(s); + m_history.prepend(s); + + if (s.startsWith("http://")) + { + //try to download playlist + PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); + if (prs) + { + connect(m_http, SIGNAL(finished (QNetworkReply *)), SLOT(readResponse(QNetworkReply *))); + QNetworkRequest request; + request.setUrl(QUrl(s)); + request.setRawHeader("User-Agent", QString("qmmp/%1").arg(Qmmp::strVersion()).toAscii()); + addButton->setEnabled(false); + m_http->get(request); + return; + } + } + m_model->add(s); + } + QDialog::accept(); +} + +void AddUrlDialog::readResponse(QNetworkReply *reply) +{ + addButton->setEnabled(true); + disconnect(m_http, SIGNAL(finished (QNetworkReply *)), 0, 0); + if (reply->error() != QNetworkReply::NoError) + QMessageBox::critical (this, tr("Error"), reply->errorString ()); + else if (!urlComboBox->currentText().isEmpty()) + { + QString s = urlComboBox->currentText(); + PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); + if (prs) + { + m_model->add(prs->decode(reply->readAll())); + QDialog::accept(); + } + } + reply->deleteLater(); +} + +void AddUrlDialog::setModel( PlayListModel *m ) +{ + m_model = m; +} diff --git a/src/plugins/Ui/skinned/addurldialog.h b/src/plugins/Ui/skinned/addurldialog.h new file mode 100644 index 000000000..49858ce11 --- /dev/null +++ b/src/plugins/Ui/skinned/addurldialog.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef ADDURLDIALOG_H +#define ADDURLDIALOG_H + +#include "ui_addurldialog.h" +#include +#include + +class QNetworkAccessManager; +class QNetworkReply; +class PlayListModel; + +/** + @author Vladimir Kuznetsov + */ + +class AddUrlDialog : public QDialog , private Ui::AddUrlDialog +{ + Q_OBJECT +public: + static void popup(QWidget* parent ,PlayListModel*); + +protected: + AddUrlDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 ); + ~AddUrlDialog(); + +protected slots: + virtual void accept(); + +private slots: + void readResponse(QNetworkReply *reply); + +private: + void setModel(PlayListModel*); + static QPointer instance; + PlayListModel* m_model; + QStringList m_history; + QNetworkAccessManager *m_http; + +}; +#endif //ADDURLDIALOG_H diff --git a/src/plugins/Ui/skinned/balancebar.cpp b/src/plugins/Ui/skinned/balancebar.cpp new file mode 100644 index 000000000..07a56ce7a --- /dev/null +++ b/src/plugins/Ui/skinned/balancebar.cpp @@ -0,0 +1,137 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include "skin.h" +#include "button.h" +#include "mainwindow.h" +#include "balancebar.h" + +BalanceBar::BalanceBar(QWidget *parent) + : PixmapWidget(parent) +{ + m_skin = Skin::instance(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setPixmap(m_skin->getBalanceBar(0)); + m_moving = false; + m_min = -100; + m_max = 100; + m_old = m_value = 0; + draw(false); +} + + +BalanceBar::~BalanceBar() +{} + +void BalanceBar::mousePressEvent(QMouseEvent *e) +{ + m_moving = true; + press_pos = e->x(); + if(e->button() == Qt::MidButton) + { + m_value = 0; + emit sliderPressed(); + emit sliderMoved(m_value); + } + else if(m_posx() && e->x()ratio()) + { + press_pos = e->x()-m_pos; + emit sliderPressed(); + } + else + { + m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); + press_pos = 6*m_skin->ratio(); + emit sliderPressed(); + if (m_value != m_old) + { + emit sliderMoved(m_value); + } + } + draw(); +} + +void BalanceBar::mouseMoveEvent (QMouseEvent *e) +{ + if(m_moving) + { + int po = e->x(); + po = po - press_pos; + + if(0 <= po && po <= width()-13*m_skin->ratio()) + { + m_value = convert(po); + draw(); + emit sliderMoved(m_value); + } + } +} + +void BalanceBar::mouseReleaseEvent(QMouseEvent*) +{ + m_moving = false; + draw(false); + m_old = m_value; + emit sliderReleased(); +} + +void BalanceBar::setValue(int v) +{ + if (m_moving || m_max == 0) + return; + m_value = v; + draw(false); +} + +void BalanceBar::setMax(int max) +{ + m_max = max; + draw(false); +} + +void BalanceBar::updateSkin() +{ + resize(m_skin->getBalanceBar(0).size()); + draw(false); +} + +void BalanceBar::draw(bool pressed) +{ + if(abs(m_value)<6) + m_value = 0; + int p=int(ceil(double(m_value-m_min)*(width()-13*m_skin->ratio())/(m_max-m_min))); + m_pixmap = m_skin->getBalanceBar(abs(27*m_value/m_max)); + QPainter paint(&m_pixmap); + if(pressed) + paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_P)); + else + paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_N)); + setPixmap(m_pixmap); + m_pos = p; +} + +int BalanceBar::convert(int p) +{ + return int(ceil(double(m_max-m_min)*(p)/(width()-13*m_skin->ratio())+m_min)); +} + diff --git a/src/plugins/Ui/skinned/balancebar.h b/src/plugins/Ui/skinned/balancebar.h new file mode 100644 index 000000000..68e967568 --- /dev/null +++ b/src/plugins/Ui/skinned/balancebar.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef BALANCEBAR_H +#define BALANCEBAR_H + +#include "pixmapwidget.h" + +class Skin; + +/** + @author Ilya Kotov +*/ +class BalanceBar : public PixmapWidget +{ +Q_OBJECT +public: + BalanceBar(QWidget *parent = 0); + + ~BalanceBar(); + + int value() {return m_value; } + +public slots: + void setValue(int); + void setMax(int); + +signals: + void sliderMoved (int); + void sliderPressed(); + void sliderReleased(); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + bool m_moving; + int press_pos; + int m_max, m_min, m_pos, m_value, m_old; + QPixmap m_pixmap; + int convert(int); // value = convert(position); + void draw(bool pressed = true); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/button.cpp b/src/plugins/Ui/skinned/button.cpp new file mode 100644 index 000000000..f07088b0b --- /dev/null +++ b/src/plugins/Ui/skinned/button.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2007-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * Based on Promoe, an XMMS2 Client * + * Copyright (C) 2005-2006 by XMMS2 Team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "button.h" +#include "skin.h" +#include + +Button::Button (QWidget *parent, uint normal, uint pressed, uint cursor) + : PixmapWidget (parent) +{ + name_normal = normal; + name_pressed = pressed; + name_cursor = cursor; + m_pressed = false; + skin = Skin::instance(); + setON (false); + setCursor (skin->getCursor (name_cursor)); + connect (skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); +} + + +Button::~Button() +{} + +void Button::updateSkin() +{ + setPixmap (skin->getButton (name_normal)); + setCursor (skin->getCursor (name_cursor)); +} + +void Button::setON (bool on) +{ + if (on) + setPixmap (skin->getButton (name_pressed)); + else + setPixmap (skin->getButton (name_normal)); +} +void Button::mousePressEvent (QMouseEvent *e) +{ + if(e->button() != Qt::LeftButton) + return; + setON (true); + m_pressed = true; + QWidget::mousePressEvent(e); +} + +void Button::mouseReleaseEvent (QMouseEvent *e) +{ + if (!m_pressed) + return; + m_pressed = false; + if(rect().contains(e->pos())) + { + setON (false); + emit clicked(); + } +} + +void Button::mouseMoveEvent (QMouseEvent *e) +{ + setON (m_pressed && rect().contains(e->pos())); +} diff --git a/src/plugins/Ui/skinned/button.h b/src/plugins/Ui/skinned/button.h new file mode 100644 index 000000000..e00bd7dc7 --- /dev/null +++ b/src/plugins/Ui/skinned/button.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef BUTTON_H +#define BUTTON_H + +#include "pixmapwidget.h" + +class Skin; + +/** + @author Ilya Kotov +*/ +class Button : public PixmapWidget +{ +Q_OBJECT +public: + Button(QWidget *parent, uint normal, uint pressed, uint cursor); + + ~Button(); + +signals: + void clicked(); + +private slots: + void updateSkin(); + +private: + Skin *skin; + //bool m_cursorin; + bool m_pressed; + void setON(bool); + uint name_normal, name_pressed; + uint name_cursor; + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/configdialog.cpp b/src/plugins/Ui/skinned/configdialog.cpp new file mode 100644 index 000000000..26a71e38d --- /dev/null +++ b/src/plugins/Ui/skinned/configdialog.cpp @@ -0,0 +1,591 @@ +/*************************************************************************** + * Copyright (C) 2007-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#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 +#include +#include +#include +#include "shortcutdialog.h" +#include "actionmanager.h" +#include "shortcutitem.h" +#include "popupsettings.h" +#include "skin.h" +#include "pluginitem.h" +#include "configdialog.h" +#include "skinreader.h" + +ConfigDialog::ConfigDialog (QWidget *parent) + : QDialog (parent) +{ + ui.setupUi (this); + setAttribute(Qt::WA_QuitOnClose, false); + setAttribute(Qt::WA_DeleteOnClose, false); + ui.preferencesButton->setEnabled(false); + ui.informationButton->setEnabled(false); + connect (ui.mainFontButton, SIGNAL (clicked()), SLOT (setMainFont())); + connect (ui.plFontButton, SIGNAL (clicked()), SLOT (setPlFont())); + connect (this, SIGNAL(rejected()),SLOT(saveSettings())); + connect (ui.fileDialogComboBox, SIGNAL (currentIndexChanged (int)), SLOT(updateDialogButton(int))); + connect (ui.skinInstallButton, SIGNAL (clicked()), SLOT(installSkin())); + connect (ui.skinReloadButton, SIGNAL (clicked()), SLOT(loadSkins())); + connect (ui.listWidget, SIGNAL (itemClicked (QListWidgetItem *)), this, SLOT (changeSkin())); + ui.listWidget->setIconSize (QSize (105,34)); + m_skin = Skin::instance(); + ui.replayGainModeComboBox->addItem (tr("Track"), QmmpSettings::REPLAYGAIN_TRACK); + ui.replayGainModeComboBox->addItem (tr("Album"), QmmpSettings::REPLAYGAIN_ALBUM); + ui.replayGainModeComboBox->addItem (tr("Disabled"), QmmpSettings::REPLAYGAIN_DISABLED); + readSettings(); + m_reader = new SkinReader(this); + loadSkins(); + loadPluginsInfo(); + loadShortcuts(); + loadFonts(); + createMenus(); + //setup icons + ui.skinInstallButton->setIcon(QIcon::fromTheme("list-add")); + ui.skinReloadButton->setIcon(QIcon::fromTheme("view-refresh")); + ui.popupTemplateButton->setIcon(QIcon::fromTheme("configure")); + ui.preferencesButton->setIcon(QIcon::fromTheme("configure")); + ui.informationButton->setIcon(QIcon::fromTheme("dialog-information")); + ui.fdInformationButton->setIcon(QIcon::fromTheme("dialog-information")); + ui.outputInformationButton->setIcon(QIcon::fromTheme("dialog-information")); + ui.outputPreferencesButton->setIcon(QIcon::fromTheme("configure")); +} + +ConfigDialog::~ConfigDialog() +{} + +void ConfigDialog::readSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + if (MediaPlayer *player = MediaPlayer::instance()) + { + ui.formatLineEdit->setText(player->playListManager()->format()); + ui.metadataCheckBox->setChecked(player->playListManager()->useMetadata()); + ui.underscoresCheckBox->setChecked(player->playListManager()->convertUnderscore()); + ui.per20CheckBox->setChecked(player->playListManager()->convertTwenty()); + } + ui.protocolCheckBox->setChecked(settings.value ("PlayList/show_protocol", false).toBool()); + ui.numbersCheckBox->setChecked(settings.value ("PlayList/show_numbers", true).toBool()); + ui.alignCheckBox->setChecked(settings.value ("PlayList/align_numbers", false).toBool()); + ui.anchorCheckBox->setChecked(settings.value("PlayList/show_anchor", false).toBool()); + ui.playlistsCheckBox->setChecked(settings.value("PlayList/show_plalists", false).toBool()); + ui.popupCheckBox->setChecked(settings.value("PlayList/show_popup", false).toBool()); + QmmpSettings *gs = QmmpSettings::instance(); + //proxy settings + ui.enableProxyCheckBox->setChecked(gs->isProxyEnabled()); + ui.authProxyCheckBox->setChecked(gs->useProxyAuth()); + ui.hostLineEdit->setText(gs->proxy().host()); + if (gs->proxy().port(0)) + ui.portLineEdit->setText(QString::number(gs->proxy().port(0))); + ui.proxyUserLineEdit->setText(gs->proxy().userName()); + ui.proxyPasswLineEdit->setText(gs->proxy().password()); + + ui.hostLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); + ui.portLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); + ui.proxyUserLineEdit->setEnabled(ui.authProxyCheckBox->isChecked()); + ui.proxyPasswLineEdit->setEnabled(ui.authProxyCheckBox->isChecked()); + //transparency + ui.mwTransparencySlider->setValue(100 - settings.value("MainWindow/opacity", 1.0).toDouble()*100); + ui.eqTransparencySlider->setValue(100 - settings.value("Equalizer/opacity", 1.0).toDouble()*100); + ui.plTransparencySlider->setValue(100 - settings.value("PlayList/opacity", 1.0).toDouble()*100); + //view + ui.skinCursorsCheckBox->setChecked(settings.value("General/skin_cursors", false).toBool()); + m_currentSkinName = settings.value("General/skin_name", "default").toString(); + ui.hiddenCheckBox->setChecked(settings.value("MainWindow/start_hidden", false).toBool()); + ui.hideOnCloseCheckBox->setChecked(settings.value("MainWindow/hide_on_close", false).toBool()); + //resume playback + ui.continuePlaybackCheckBox->setChecked(settings.value("General/resume_on_startup", false).toBool()); + //cover options + ui.coverIncludeLineEdit->setText(gs->coverNameFilters(true).join(",")); + ui.coverExcludeLineEdit->setText(gs->coverNameFilters(false).join(",")); + ui.coverDepthSpinBox->setValue(gs->coverSearchDepth()); + ui.useCoverFilesCheckBox->setChecked(gs->useCoverFiles()); + //replay gain + ui.clippingCheckBox->setChecked(gs->replayGainPreventClipping()); + ui.replayGainModeComboBox->setCurrentIndex(ui.replayGainModeComboBox->findData(gs->replayGainMode())); + ui.preampDoubleSpinBox->setValue(gs->replayGainPreamp()); + ui.defaultGainDoubleSpinBox->setValue(gs->replayGainDefaultGain()); + //audio + ui.softVolumeCheckBox->setChecked(gs->useSoftVolume()); + ui.use16BitCheckBox->setChecked(gs->use16BitOutput()); + ui.bufferSizeSpinBox->setValue(gs->bufferSize()); +} + +void ConfigDialog::on_contentsWidget_currentItemChanged (QListWidgetItem *current, + QListWidgetItem *previous) +{ + if (!current) + current = previous; + ui.stackedWidget->setCurrentIndex (ui.contentsWidget->row (current)); + ui.hiddenCheckBox->setEnabled(GeneralHandler::instance()->visibilityControl()); + ui.hideOnCloseCheckBox->setEnabled(GeneralHandler::instance()->visibilityControl()); +} + +void ConfigDialog::changeSkin() +{ + int row = ui.listWidget->currentRow(); + QString path; + if (m_skinList.at (row).isDir()) + { + path = m_skinList.at (row).canonicalFilePath(); + m_skin->setSkin (path); + } + else if (m_skinList.at (row).isFile()) + { + m_reader->unpackSkin(m_skinList.at (row).canonicalFilePath()); + m_skin->setSkin(QDir::homePath() +"/.qmmp/cache/skin"); + } + if(ui.listWidget->currentItem()) + m_currentSkinName = ui.listWidget->currentItem()->text(); + else + m_currentSkinName.clear(); +} + +void ConfigDialog::loadSkins() +{ + m_reader->generateThumbs(); + m_skinList.clear(); + ui.listWidget->clear(); + QFileInfo fileInfo (":/default"); + QPixmap preview = Skin::getPixmap ("main", QDir (fileInfo.filePath())); + QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); + item->setIcon (preview); + ui.listWidget->addItem (item); + m_skinList << fileInfo; + if(item->text() == m_currentSkinName) + ui.listWidget->setCurrentItem(item); + + findSkins(QDir::homePath() +"/.qmmp/skins"); +#ifdef Q_OS_WIN32 + findSkins(qApp->applicationDirPath()+"/skins"); +#else + findSkins(qApp->applicationDirPath()+"/../share/qmmp/skins"); +#endif + foreach(QString path, m_reader->skins()) + { + QListWidgetItem *item = new QListWidgetItem (path.section('/', -1)); + item->setIcon (m_reader->getPreview(path)); + item->setToolTip(tr("Archived skin") + " " + path); + ui.listWidget->addItem (item); + m_skinList << QFileInfo(path); + if(item->text() == m_currentSkinName) + ui.listWidget->setCurrentItem(item); + } +} + +void ConfigDialog::findSkins(const QString &path) +{ + QDir dir(path); + dir.setFilter (QDir::Dirs | QDir::NoDotAndDotDot); + QList fileList = dir.entryInfoList(); + if (fileList.count() == 0) + return; + foreach (QFileInfo fileInfo, fileList) + { + QPixmap preview = Skin::getPixmap ("main", QDir(fileInfo.filePath ())); + if (!preview.isNull()) + { + QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); + item->setIcon (preview); + item->setToolTip(tr("Unarchived skin") + " " + fileInfo.filePath ()); + ui.listWidget->addItem (item); + m_skinList << fileInfo; + } + } +} + +void ConfigDialog::loadPluginsInfo() +{ + ui.treeWidget->blockSignals(true); + /* + load transport plugin information + */ + QTreeWidgetItem *item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Transports")); + QList *transports = InputSource::factories(); + QStringList files = InputSource::files(); + for (int i = 0; i < transports->count (); ++i) + new PluginItem (item, transports->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + + /* + load input plugins information + */ + item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Decoders")); + QList *decoders = Decoder::factories(); + files = Decoder::files(); + for (int i = 0; i < decoders->count (); ++i) + new PluginItem (item, decoders->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + /* + load audio engines information + */ + item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Engines")); + QList *engines = AbstractEngine::factories(); + files = AbstractEngine::files(); + for (int i = 0; i < engines->count (); ++i) + new PluginItem (item, engines->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + /* + load effect plugin information + */ + item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Effects")); + QList *effects = Effect::factories(); + files = Effect::files(); + for (int i = 0; i < effects->count (); ++i) + new PluginItem (item, effects->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + /* + load visual plugin information + */ + item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Visualization")); + QList *visuals = Visual::factories(); + files = Visual::files(); + for (int i = 0; i < visuals->count (); ++i) + new PluginItem (item, visuals->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + /* + load general plugin information + */ + item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("General")); + QList *generals = General::factories(); + files = General::files(); + for (int i = 0; i < generals->count (); ++i) + new PluginItem (item, generals->at(i), files.at (i)); + ui.treeWidget->addTopLevelItem(item); + item->setExpanded(true); + + ui.treeWidget->blockSignals(false); + ui.treeWidget->resizeColumnToContents(0); + ui.treeWidget->resizeColumnToContents(1); + /* + load output plugins information + */ + ui.outputInformationButton->setEnabled(false); + ui.outputPreferencesButton->setEnabled(false); + QList *outputs = Output::factories(); + for (int i = 0; i < outputs->count (); ++i) + { + ui.outputComboBox->addItem(outputs->at(i)->properties().name); + if(Output::currentFactory() == outputs->at(i)) + { + ui.outputComboBox->setCurrentIndex(i); + on_outputComboBox_activated (i); + } + } + /* + load file dialog information + */ + foreach(FileDialogFactory *factory, FileDialog::registeredFactories()) + { + ui.fileDialogComboBox->addItem(factory->properties().name); + if (FileDialog::isEnabled(factory)) + ui.fileDialogComboBox->setCurrentIndex(ui.fileDialogComboBox->count()-1); + } +} + +void ConfigDialog::loadFonts() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + QString fontname = settings.value ("PlayList/Font").toString(); + QFont font = QApplication::font(); + if(!fontname.isEmpty()) + font.fromString(fontname); + ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); + ui.plFontLabel->setFont(font); + + font = QApplication::font (); + fontname = settings.value ("MainWindow/Font").toString(); + if(!fontname.isEmpty()) + font.fromString(fontname); + ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); + ui.mainFontLabel->setFont(font); + ui.useBitmapCheckBox->setChecked(settings.value("MainWindow/bitmap_font", false).toBool()); +} + +void ConfigDialog::loadShortcuts() +{ + //playback + QTreeWidgetItem *item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Playback")); + for(int i = ActionManager::PLAY; i <= ActionManager::CLEAR_QUEUE; ++i) + new ShortcutItem(item, i); + item->setExpanded(true); + ui.shortcutTreeWidget->addTopLevelItem(item); + //view + item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("View")); + for(int i = ActionManager::SHOW_PLAYLIST; i <= ActionManager::WM_DOUBLE_SIZE; ++i) + new ShortcutItem(item, i); + item->setExpanded(true); + ui.shortcutTreeWidget->addTopLevelItem(item); + //playlist + item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Playlist")); + for(int i = ActionManager::PL_ADD_FILE; i <= ActionManager::PL_SHOW_MANAGER; ++i) + new ShortcutItem(item, i); + item->setExpanded(true); + ui.shortcutTreeWidget->addTopLevelItem(item); + //misc + item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Misc")); + for(int i = ActionManager::SETTINGS; i <= ActionManager::QUIT; ++i) + new ShortcutItem(item, i); + item->setExpanded(true); + ui.shortcutTreeWidget->addTopLevelItem(item); + + ui.shortcutTreeWidget->resizeColumnToContents(0); + ui.shortcutTreeWidget->resizeColumnToContents(1); +} + +void ConfigDialog::setPlFont() +{ + bool ok; + QFont font = ui.plFontLabel->font(); + font = QFontDialog::getFont (&ok, font, this); + if (ok) + { + ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); + ui.plFontLabel->setFont(font); + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("PlayList/Font", font.toString()); + } +} + +void ConfigDialog::setMainFont() +{ + bool ok; + QFont font = ui.mainFontLabel->font(); + font = QFontDialog::getFont (&ok, font, this); + if (ok) + { + ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); + ui.mainFontLabel->setFont(font); + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("MainWindow/Font", font.toString()); + } +} + +void ConfigDialog::on_preferencesButton_clicked() +{ + QTreeWidgetItem *item = ui.treeWidget->currentItem(); + if(item && item->type() >= PluginItem::TRANSPORT) + dynamic_cast(item)->showSettings(this); + +} + +void ConfigDialog::on_informationButton_clicked() +{ + QTreeWidgetItem *item = ui.treeWidget->currentItem(); + if(item && item->type() >= PluginItem::TRANSPORT) + dynamic_cast(item)->showAbout(this); +} + +void ConfigDialog::createMenus() +{ + QMenu *menu = new QMenu(this); + + menu->addAction(tr("Artist"))->setData("%p"); + menu->addAction(tr("Album"))->setData("%a"); + menu->addAction(tr("Title"))->setData("%t"); + menu->addAction(tr("Track number"))->setData("%n"); + menu->addAction(tr("Two-digit track number"))->setData("%NN"); + menu->addAction(tr("Genre"))->setData("%g"); + menu->addAction(tr("Comment"))->setData("%c"); + menu->addAction(tr("Composer"))->setData("%C"); + menu->addAction(tr("Disc number"))->setData("%D"); + menu->addAction(tr("File name"))->setData("%f"); + menu->addAction(tr("File path"))->setData("%F"); + menu->addAction(tr("Year"))->setData("%y"); + menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); + + ui.titleButton->setMenu(menu); + ui.titleButton->setPopupMode(QToolButton::InstantPopup); + connect(menu, SIGNAL(triggered (QAction *)), SLOT(addTitleString(QAction *))); +} + +void ConfigDialog::addTitleString(QAction * a) +{ + if (ui.formatLineEdit->cursorPosition () < 1) + ui.formatLineEdit->insert(a->data().toString()); + else + ui.formatLineEdit->insert(" - "+a->data().toString()); +} + +void ConfigDialog::saveSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + if (MediaPlayer *player = MediaPlayer::instance()) + { + player->playListManager()->setFormat(ui.formatLineEdit->text().trimmed()); + player->playListManager()->setUseMetadata(ui.metadataCheckBox->isChecked()); + player->playListManager()->setConvertUnderscore(ui.underscoresCheckBox->isChecked()); + player->playListManager()->setConvertTwenty(ui.per20CheckBox->isChecked()); + } + settings.setValue ("PlayList/show_protocol", ui.protocolCheckBox->isChecked()); + settings.setValue ("PlayList/show_numbers", ui.numbersCheckBox->isChecked()); + settings.setValue ("PlayList/align_numbers", ui.alignCheckBox->isChecked()); + settings.setValue ("PlayList/show_anchor", ui.anchorCheckBox->isChecked()); + settings.setValue ("PlayList/show_plalists", ui.playlistsCheckBox->isChecked()); + settings.setValue ("PlayList/show_popup", ui.popupCheckBox->isChecked()); + FileDialog::setEnabled(FileDialog::registeredFactories().at(ui.fileDialogComboBox->currentIndex())); + QmmpSettings *gs = QmmpSettings::instance(); + //proxy + QUrl proxyUrl; + proxyUrl.setHost(ui.hostLineEdit->text()); + proxyUrl.setPort(ui.portLineEdit->text().toUInt()); + proxyUrl.setUserName(ui.proxyUserLineEdit->text()); + proxyUrl.setPassword(ui.proxyPasswLineEdit->text()); + gs->setNetworkSettings(ui.enableProxyCheckBox->isChecked(), + ui.authProxyCheckBox->isChecked(), + proxyUrl); + + + settings.setValue ("MainWindow/opacity", 1.0 - (double)ui.mwTransparencySlider->value()/100); + settings.setValue ("Equalizer/opacity", 1.0 - (double)ui.eqTransparencySlider->value()/100); + settings.setValue ("PlayList/opacity", 1.0 - (double)ui.plTransparencySlider->value()/100); + settings.setValue ("General/resume_on_startup", ui.continuePlaybackCheckBox->isChecked()); + settings.setValue ("MainWindow/bitmap_font", ui.useBitmapCheckBox->isChecked()); + settings.setValue ("General/skin_cursors", ui.skinCursorsCheckBox->isChecked()); + settings.setValue ("General/skin_name", m_currentSkinName); + settings.setValue ("MainWindow/start_hidden", ui.hiddenCheckBox->isChecked()); + settings.setValue ("MainWindow/hide_on_close", ui.hideOnCloseCheckBox->isChecked()); + gs->setCoverSettings(ui.coverIncludeLineEdit->text().split(","), + ui.coverExcludeLineEdit->text().split(","), + ui.coverDepthSpinBox->value(), + ui.useCoverFilesCheckBox->isChecked()); + int i = ui.replayGainModeComboBox->currentIndex(); + gs->setReplayGainSettings((QmmpSettings::ReplayGainMode) + ui.replayGainModeComboBox->itemData(i).toInt(), + ui.preampDoubleSpinBox->value(), + ui.defaultGainDoubleSpinBox->value(), + ui.clippingCheckBox->isChecked()); + gs->setAudioSettings(ui.softVolumeCheckBox->isChecked(), ui.use16BitCheckBox->isChecked()); + gs->setBufferSize(ui.bufferSizeSpinBox->value()); + QList *outputs = Output::factories(); + if(ui.outputComboBox->currentIndex() >= 0 && outputs->count()) + Output::setCurrentFactory(outputs->at(ui.outputComboBox->currentIndex())); +} + +void ConfigDialog::updateDialogButton(int index) +{ + ui.fdInformationButton->setEnabled(FileDialog::registeredFactories()[index]->properties().hasAbout); +} + +void ConfigDialog::on_fdInformationButton_clicked() +{ + int index = ui.fileDialogComboBox->currentIndex (); + FileDialog::registeredFactories()[index]->showAbout(this); +} + +void ConfigDialog::installSkin() +{ + QStringList files = FileDialog::getOpenFileNames(this,tr("Select Skin Files"), QDir::homePath(), + tr("Skin files") + " (*.tar.gz *.tgz *.tar.bz2 *.zip *.wsz)"); + foreach(QString path, files) + { + QFile file(path); + file.copy(QDir::homePath() +"/.qmmp/skins/" + QFileInfo(path).fileName()); + } + loadSkins(); +} + +void ConfigDialog::on_popupTemplateButton_clicked() +{ + PopupSettings *p = new PopupSettings(this); + p->exec(); + p->deleteLater(); +} + +void ConfigDialog::on_treeWidget_itemChanged (QTreeWidgetItem *item, int column) +{ + if(column == 0 && item->type() >= PluginItem::TRANSPORT) + dynamic_cast(item)->setEnabled(item->checkState(0) == Qt::Checked); +} + +void ConfigDialog::on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *) +{ + if(current->type() >= PluginItem::TRANSPORT) + { + ui.preferencesButton->setEnabled(dynamic_cast(current)->hasSettings()); + ui.informationButton->setEnabled(dynamic_cast(current)->hasAbout()); + } + else + { + ui.preferencesButton->setEnabled(false); + ui.informationButton->setEnabled(false); + } +} + +void ConfigDialog::on_outputComboBox_activated (int index) +{ + OutputFactory *factory = Output::factories()->at(index); + ui.outputInformationButton->setEnabled(factory->properties().hasAbout); + ui.outputPreferencesButton->setEnabled(factory->properties().hasSettings); +} + +void ConfigDialog::on_outputPreferencesButton_clicked() +{ + int index = ui.outputComboBox->currentIndex(); + Output::factories()->at(index)->showSettings(this); +} + +void ConfigDialog::on_outputInformationButton_clicked() +{ + int index = ui.outputComboBox->currentIndex(); + Output::factories()->at(index)->showAbout(this); +} + +void ConfigDialog::on_changeShortcutButton_clicked() +{ + ShortcutItem *item = dynamic_cast (ui.shortcutTreeWidget->currentItem()); + if(!item) + return; + ShortcutDialog editor(item->action()->shortcut().toString(), this); + if(editor.exec() == QDialog::Accepted) + { + item->action()->setShortcut(editor.key()); + item->setText(1, item->action()->shortcut().toString()); + } +} diff --git a/src/plugins/Ui/skinned/configdialog.h b/src/plugins/Ui/skinned/configdialog.h new file mode 100644 index 000000000..ad8d62ae5 --- /dev/null +++ b/src/plugins/Ui/skinned/configdialog.h @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (C) 2007-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef CONFIGDIALOG_H +#define CONFIGDIALOG_H + +#include +#include + +#include "ui_configdialog.h" + + +/** + @author Ilya Kotov +*/ +class QFileInfo; + +class Skin; +class SkinReader; + +class ConfigDialog : public QDialog +{ + Q_OBJECT +public: + ConfigDialog(QWidget *parent = 0); + + ~ConfigDialog(); + +private slots: + void on_contentsWidget_currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous); + void changeSkin(); + void setPlFont(); + void setMainFont(); + void on_preferencesButton_clicked(); + void on_informationButton_clicked(); + void addTitleString(QAction *); + void saveSettings(); + void updateDialogButton(int); + void on_fdInformationButton_clicked(); + void installSkin(); + void loadSkins(); + void on_popupTemplateButton_clicked(); + void on_treeWidget_itemChanged (QTreeWidgetItem *item, int column); + void on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *); + void on_outputComboBox_activated (int index); + void on_outputPreferencesButton_clicked(); + void on_outputInformationButton_clicked(); + void on_changeShortcutButton_clicked(); + +private: + void readSettings(); + void findSkins(const QString &path); + void loadPluginsInfo(); + void loadFonts(); + void loadShortcuts(); + void createMenus(); + + + QList m_skinList; + Ui::ConfigDialog ui; + QString m_currentSkinName; + Skin *m_skin; + QPixmap pixmap; + SkinReader *m_reader; +}; + +#endif diff --git a/src/plugins/Ui/skinned/cursorimage.cpp b/src/plugins/Ui/skinned/cursorimage.cpp new file mode 100644 index 000000000..30fcf0173 --- /dev/null +++ b/src/plugins/Ui/skinned/cursorimage.cpp @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (C) 2009 by Erik Ölsar * + * erlk.ozlr@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "cursorimage.h" + +QCursor createCursor(QString path) +{ + if (path.isEmpty()) + return QCursor(); + + // read file headers + QFile curFile(path); + curFile.open(QIODevice::ReadOnly); + QDataStream curStream(&curFile); + curStream.setByteOrder(QDataStream::LittleEndian); + + struct { + quint16 zero; + quint16 type; + quint16 icons; + } header2; + curStream >> header2.zero >> header2.type >> header2.icons; + + struct { + quint8 width; + quint8 height; + quint8 ncolours; + quint8 zero; + quint16 xhot; + quint16 yhot; + quint32 bytes; + quint32 dibOffset; + } directory2; + curStream >> directory2.width >> directory2.height >> directory2.ncolours >> directory2.zero >> directory2.xhot >> directory2.yhot >> directory2.bytes >> directory2.dibOffset; + + curFile.seek(directory2.dibOffset); + + // prepare a .bmp for delegating decoding to qt + struct { + unsigned char magic[2]; + quint32 size; + quint32 zero; + quint32 rdataOffset; + } bmpHeader; + int bmpHeaderSize = (2+4+4+4); + struct { + quint32 hdrSize; + quint32 width; + quint32 height; + quint16 planes; + quint16 bpp; + quint32 compression; + quint32 dataSize; + quint32 unused1; + quint32 unused2; + quint32 unused3; + quint32 unused4; + } dibHeader; + int dibHeaderSize = (4+4+4+2+2+4+4+4+4+4+4); + + bmpHeader.magic[0] = 'B'; bmpHeader.magic[1] = 'M'; + bmpHeader.zero = 0; + bmpHeader.size = bmpHeaderSize + directory2.bytes; + bmpHeader.rdataOffset = bmpHeaderSize + dibHeaderSize + directory2.ncolours * 4; + + curStream >> dibHeader.hdrSize >> dibHeader.width >> dibHeader.height >> dibHeader.planes >> dibHeader.bpp >> dibHeader.compression >> dibHeader.dataSize >> dibHeader.unused1 >> dibHeader.unused2 >> dibHeader.unused3 >> dibHeader.unused4; + dibHeader.height >>= 1; + + // the bmp bytes are in 'bmpData' + QByteArray bmpData; + QDataStream bmpStream(&bmpData, QIODevice::WriteOnly); + bmpStream.setByteOrder(QDataStream::LittleEndian); + bmpStream.writeRawData((char*) bmpHeader.magic, 2); + bmpStream << bmpHeader.size << bmpHeader.zero << bmpHeader.rdataOffset; + bmpStream << dibHeader.hdrSize << dibHeader.width << dibHeader.height << dibHeader.planes << dibHeader.bpp << dibHeader.compression << dibHeader.dataSize << dibHeader.unused1 << dibHeader.unused2 << dibHeader.unused3 << dibHeader.unused4; + bmpData.append(curFile.read(directory2.bytes - dibHeaderSize)); + + // decode the image into 'pix' + int width = directory2.width; + int height = directory2.height; + QImage image; + image.loadFromData(bmpData); + //qDebug() << image.rect() << path; + QPixmap pix = QPixmap::fromImage(image); + + // now we need the mask (transparency) + QByteArray maskData = bmpData.right((width * height) / 8); + QImage maskImage = QBitmap::fromData(QSize(width, height), (const uchar*) maskData.constData(), QImage::Format_Mono).toImage().mirrored(false, true); + maskImage.invertPixels(); + pix.setMask(QBitmap::fromImage(maskImage)); + + return QCursor(pix, directory2.xhot, directory2.yhot); +} diff --git a/src/plugins/Ui/skinned/cursorimage.h b/src/plugins/Ui/skinned/cursorimage.h new file mode 100644 index 000000000..cde27d62d --- /dev/null +++ b/src/plugins/Ui/skinned/cursorimage.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (C) 2009 by Erik Ölsar * + * erlk.ozlr@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef CURSORIMAGE_H +#define CURSORIMAGE_H + +QCursor createCursor(QString path); + +#endif diff --git a/src/plugins/Ui/skinned/default/balance.png b/src/plugins/Ui/skinned/default/balance.png new file mode 100644 index 000000000..1c2467f49 Binary files /dev/null and b/src/plugins/Ui/skinned/default/balance.png differ diff --git a/src/plugins/Ui/skinned/default/cbuttons.png b/src/plugins/Ui/skinned/default/cbuttons.png new file mode 100644 index 000000000..15666b838 Binary files /dev/null and b/src/plugins/Ui/skinned/default/cbuttons.png differ diff --git a/src/plugins/Ui/skinned/default/eq_ex.png b/src/plugins/Ui/skinned/default/eq_ex.png new file mode 100644 index 000000000..172a57c83 Binary files /dev/null and b/src/plugins/Ui/skinned/default/eq_ex.png differ diff --git a/src/plugins/Ui/skinned/default/eqmain.png b/src/plugins/Ui/skinned/default/eqmain.png new file mode 100644 index 000000000..8e332d178 Binary files /dev/null and b/src/plugins/Ui/skinned/default/eqmain.png differ diff --git a/src/plugins/Ui/skinned/default/main.png b/src/plugins/Ui/skinned/default/main.png new file mode 100644 index 000000000..3980c579d Binary files /dev/null and b/src/plugins/Ui/skinned/default/main.png differ diff --git a/src/plugins/Ui/skinned/default/monoster.png b/src/plugins/Ui/skinned/default/monoster.png new file mode 100644 index 000000000..fe941fc44 Binary files /dev/null and b/src/plugins/Ui/skinned/default/monoster.png differ diff --git a/src/plugins/Ui/skinned/default/numbers.png b/src/plugins/Ui/skinned/default/numbers.png new file mode 100644 index 000000000..009d0228c Binary files /dev/null and b/src/plugins/Ui/skinned/default/numbers.png differ diff --git a/src/plugins/Ui/skinned/default/playpaus.png b/src/plugins/Ui/skinned/default/playpaus.png new file mode 100644 index 000000000..268e2a43a Binary files /dev/null and b/src/plugins/Ui/skinned/default/playpaus.png differ diff --git a/src/plugins/Ui/skinned/default/pledit.png b/src/plugins/Ui/skinned/default/pledit.png new file mode 100644 index 000000000..7e8c7bc1a Binary files /dev/null and b/src/plugins/Ui/skinned/default/pledit.png differ diff --git a/src/plugins/Ui/skinned/default/pledit.txt b/src/plugins/Ui/skinned/default/pledit.txt new file mode 100644 index 000000000..1a8813b69 --- /dev/null +++ b/src/plugins/Ui/skinned/default/pledit.txt @@ -0,0 +1,8 @@ +[Text] +Normal=#A8AEAE +Current=#ffffff +NormalBG=#000000 +SelectedBG=#525555 +Font=Sans +mbBG=#000000 +mbFG=#ffffff \ No newline at end of file diff --git a/src/plugins/Ui/skinned/default/posbar.png b/src/plugins/Ui/skinned/default/posbar.png new file mode 100644 index 000000000..1f1608c8b Binary files /dev/null and b/src/plugins/Ui/skinned/default/posbar.png differ diff --git a/src/plugins/Ui/skinned/default/readme.txt b/src/plugins/Ui/skinned/default/readme.txt new file mode 100644 index 000000000..323706573 --- /dev/null +++ b/src/plugins/Ui/skinned/default/readme.txt @@ -0,0 +1,2 @@ +Ergo created for QMMP project by Andrey Andreev +andreev00@gmail.com \ No newline at end of file diff --git a/src/plugins/Ui/skinned/default/shufrep.png b/src/plugins/Ui/skinned/default/shufrep.png new file mode 100644 index 000000000..aa063c810 Binary files /dev/null and b/src/plugins/Ui/skinned/default/shufrep.png differ diff --git a/src/plugins/Ui/skinned/default/text.png b/src/plugins/Ui/skinned/default/text.png new file mode 100644 index 000000000..dcf1559e5 Binary files /dev/null and b/src/plugins/Ui/skinned/default/text.png differ diff --git a/src/plugins/Ui/skinned/default/titlebar.png b/src/plugins/Ui/skinned/default/titlebar.png new file mode 100644 index 000000000..9ff2e1f22 Binary files /dev/null and b/src/plugins/Ui/skinned/default/titlebar.png differ diff --git a/src/plugins/Ui/skinned/default/viscolor.txt b/src/plugins/Ui/skinned/default/viscolor.txt new file mode 100644 index 000000000..bac3f6bb9 --- /dev/null +++ b/src/plugins/Ui/skinned/default/viscolor.txt @@ -0,0 +1,24 @@ +152,152,152, // Bg +152,152,152, // Dots +255,128,0, // Analyzer +240,128,16, // Analyzer +225,128,32, // Analyzer +210,128,48, // Analyzer +195,128,64, // Analyzer +180,128,80, // Analyzer +165,128,96, // Analyzer +150,128,112, // Analyzer +128,128,128, // Analyzer +110,110,110, // Analyzer +92,92,92, // Analyzer +74,74,74, // Analyzer +56,56,56, // Analyzer +38,38,38, // Analyzer +20,20,20, // Analyzer +2,2,2, // Analyzer +2,2,2, // Osc +20,20,20, // Osc +20,20,20, // Osc +38,38,38, // Osc +38,38,38, // Osc +255,255,255, // Peak \ No newline at end of file diff --git a/src/plugins/Ui/skinned/default/volume.png b/src/plugins/Ui/skinned/default/volume.png new file mode 100644 index 000000000..cd33da4cf Binary files /dev/null and b/src/plugins/Ui/skinned/default/volume.png differ diff --git a/src/plugins/Ui/skinned/display.cpp b/src/plugins/Ui/skinned/display.cpp new file mode 100644 index 000000000..9b54306d2 --- /dev/null +++ b/src/plugins/Ui/skinned/display.cpp @@ -0,0 +1,357 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include "skin.h" +#include "mainvisual.h" +#include "button.h" +#include "titlebar.h" +#include "positionbar.h" +#include "number.h" +#include "togglebutton.h" +#include "symboldisplay.h" +#include "textscroller.h" +#include "monostereo.h" +#include "playstatus.h" +#include "volumebar.h" +#include "balancebar.h" +#include "mainwindow.h" +#include "timeindicator.h" +#include "actionmanager.h" +#include "display.h" + +MainDisplay::MainDisplay (QWidget *parent) + : PixmapWidget (parent) +{ + m_shaded = false; + m_skin = Skin::instance(); + setPixmap (m_skin->getMain()); + setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); + m_mw = qobject_cast(parent); + m_titlebar = new TitleBar(this); + m_titlebar->move(0,0); + m_titlebar->setActive(true); + m_previous = new Button (this, Skin::BT_PREVIOUS_N, Skin::BT_PREVIOUS_P, Skin::CUR_NORMAL); + m_previous->setToolTip(tr("Previous")); + connect (m_previous, SIGNAL (clicked()), parent, SLOT (previous())); + + m_play = new Button (this, Skin::BT_PLAY_N, Skin::BT_PLAY_P, Skin::CUR_NORMAL); + m_play->setToolTip(tr("Play")); + connect (m_play, SIGNAL (clicked()),parent,SLOT (play())); + m_pause = new Button (this, Skin::BT_PAUSE_N,Skin::BT_PAUSE_P, Skin::CUR_NORMAL); + m_pause->setToolTip(tr("Pause")); + connect (m_pause,SIGNAL (clicked()),parent,SLOT (pause())); + m_stop = new Button (this, Skin::BT_STOP_N,Skin::BT_STOP_P, Skin::CUR_NORMAL); + m_stop->setToolTip(tr("Stop")); + connect (m_stop,SIGNAL (clicked()),parent,SLOT (stop())); + m_next = new Button (this, Skin::BT_NEXT_N,Skin::BT_NEXT_P, Skin::CUR_NORMAL); + m_next->setToolTip(tr("Next")); + connect (m_next,SIGNAL (clicked()),parent,SLOT (next())); + m_eject = new Button (this, Skin::BT_EJECT_N,Skin::BT_EJECT_P, Skin::CUR_NORMAL); + m_eject->setToolTip(tr("Add file")); + connect (m_eject,SIGNAL (clicked()),parent,SLOT (addFile())); + connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); + m_vis = new MainVisual (this); + + m_eqButton = new ToggleButton (this,Skin::BT_EQ_ON_N,Skin::BT_EQ_ON_P, + Skin::BT_EQ_OFF_N,Skin::BT_EQ_OFF_P); + m_eqButton->setToolTip(tr("Equalizer")); + m_plButton = new ToggleButton (this,Skin::BT_PL_ON_N,Skin::BT_PL_ON_P, + Skin::BT_PL_OFF_N,Skin::BT_PL_OFF_P); + m_plButton->setToolTip(tr("Playlist")); + + m_repeatButton = new ToggleButton (this,Skin::REPEAT_ON_N,Skin::REPEAT_ON_P, + Skin::REPEAT_OFF_N,Skin::REPEAT_OFF_P); + connect(m_repeatButton,SIGNAL(clicked(bool)),this,SIGNAL(repeatableToggled(bool))); + m_repeatButton->setToolTip(tr("Repeat playlist")); + m_shuffleButton = new ToggleButton (this,Skin::SHUFFLE_ON_N,Skin::SHUFFLE_ON_P, + Skin::SHUFFLE_OFF_N,Skin::SHUFFLE_OFF_P); + m_shuffleButton->setToolTip(tr("Shuffle")); + connect(m_shuffleButton,SIGNAL(clicked(bool)),this,SIGNAL(shuffleToggled(bool))); + + m_kbps = new SymbolDisplay(this,3); + m_freq = new SymbolDisplay(this,2); + m_text = new TextScroller (this); + m_monoster = new MonoStereo (this); + m_playstatus = new PlayStatus(this); + + m_volumeBar = new VolumeBar(this); + m_volumeBar->setToolTip(tr("Volume")); + connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + connect(m_volumeBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); + connect(m_volumeBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); + + m_balanceBar = new BalanceBar(this); + m_balanceBar->setToolTip(tr("Balance")); + connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + connect(m_balanceBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); + connect(m_balanceBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); + + m_posbar = new PositionBar(this); + connect(m_posbar, SIGNAL(sliderPressed()),SLOT(showPosition())); + connect(m_posbar, SIGNAL(sliderMoved(qint64)),SLOT(showPosition())); + connect(m_posbar, SIGNAL(sliderReleased()),SLOT(updatePosition())); + + m_timeIndicator = new TimeIndicator(this); + m_aboutWidget = new QWidget(this); + m_core = SoundCore::instance(); + connect(m_core, SIGNAL(elapsedChanged(qint64)), SLOT(setTime(qint64))); + connect(m_core, SIGNAL(bitrateChanged(int)), m_kbps, SLOT(display(int))); + connect(m_core, SIGNAL(frequencyChanged(quint32)), SLOT(setSampleRate(quint32))); + connect(m_core, SIGNAL(channelsChanged(int)), m_monoster, SLOT(setChannels(int))); + connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(setState(Qmmp::State))); + connect(m_core, SIGNAL(volumeChanged(int,int)), SLOT(setVolume(int, int))); + connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64))); + PlayListManager *pl_manager = MediaPlayer::instance()->playListManager(); + connect(pl_manager, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setON(bool))); + connect(pl_manager, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setON(bool))); + updatePositions(); + updateMask(); +} + +MainDisplay::~MainDisplay() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("Playlist/visible",m_plButton->isChecked()); + settings.setValue ("Equalizer/visible",m_eqButton->isChecked()); +} + +void MainDisplay::updatePositions() +{ + int r = m_skin->ratio(); + m_previous->move (r*16, r*88); + m_play->move (r*39, r*88); + m_pause->move (r*62, r*88); + m_vis->move(r*24, r*43); + m_stop->move (r*85, r*88); + m_next->move (r*108, r*88); + m_eject->move (r*136, r*89); + m_posbar->move (r*16, r*72); + m_eqButton->move (r*219, r*58); + m_plButton->move (r*241, r*58); + m_repeatButton->move (r*210, r*89); + m_shuffleButton->move (r*164, r*89); + m_kbps->move (r*111, r*43); + m_freq->move (r*156, r*43); + m_text->resize (r*154, r*15); + m_text->move (r*109, r*23); + m_monoster->move (r*212, r*41); + m_playstatus->move(r*24, r*28); + m_volumeBar->move(r*107, r*57); + m_balanceBar->move(r*177, r*57); + m_timeIndicator->move(r*34, r*26); + m_aboutWidget->setGeometry(r*247,r*83,r*20,r*25); +} + +void MainDisplay::setTime (qint64 t) +{ + m_posbar->setValue (t); + m_timeIndicator->setTime(t/1000); +} +void MainDisplay::setDuration(qint64 t) +{ + m_posbar->setMaximum (t); + m_timeIndicator->setSongDuration(t/1000); +} + +void MainDisplay::setState(Qmmp::State state) +{ + switch ((int) state) + { + case Qmmp::Playing: + m_playstatus->setStatus(PlayStatus::PLAY); + m_timeIndicator->setNeedToShowTime(true); + setDuration(m_core->totalTime()); + break; + case Qmmp::Paused: + m_playstatus->setStatus(PlayStatus::PAUSE); + break; + case Qmmp::Stopped: + m_playstatus->setStatus(PlayStatus::STOP); + m_monoster->setChannels (0); + m_timeIndicator->setNeedToShowTime(false); + m_posbar->setValue (0); + m_posbar->setMaximum (0); + m_titlebar->setTime(-1); + } +} + +void MainDisplay::setVolume(int left, int right) +{ + int maxVol = qMax(left, right); + m_volumeBar->setValue(maxVol); + if (maxVol && !m_volumeBar->isPressed()) + m_balanceBar->setValue((right - left) * 100/maxVol); +} + +void MainDisplay::updateSkin() +{ + setPixmap (m_skin->getMain()); + m_mw->resize(size()); + setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); + setMinimalMode(m_shaded); + updatePositions(); +} + +void MainDisplay::updateMask() +{ + m_mw->clearMask(); + m_mw->setMask(QRegion(0,0,m_mw->width(),m_mw->height())); + QRegion region = m_skin->getRegion(m_shaded? Skin::WINDOW_SHADE : Skin::NORMAL); + if (!region.isEmpty()) + m_mw->setMask(region); +} + +void MainDisplay::setMinimalMode(bool b) +{ + m_shaded = b; + int r = m_skin->ratio(); + + if(m_shaded) + m_mw->resize(r*275,r*14); + else + m_mw->resize(r*275,r*116); + updateMask(); +} + +void MainDisplay::setActive(bool b) +{ + m_titlebar->setActive(b); +} + +void MainDisplay::setSampleRate(quint32 rate) +{ + m_freq->display((int) rate/1000); +} +//TODO optimize this connections +void MainDisplay::setEQ (QWidget* w) +{ + m_equlizer = w; + m_eqButton->setON (m_equlizer->isVisible()); + ACTION(ActionManager::SHOW_EQUALIZER)->setChecked(m_equlizer->isVisible()); + + connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), + m_equlizer, SLOT (setVisible (bool))); + connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), + m_eqButton, SLOT (setON (bool))); + + connect (m_eqButton, SIGNAL(clicked(bool)), + ACTION(ActionManager::SHOW_EQUALIZER), SLOT(setChecked (bool))); + connect (m_eqButton, SIGNAL(clicked(bool)), m_equlizer, SLOT (setVisible (bool))); + connect (m_equlizer, SIGNAL(closed ()), m_eqButton, SLOT (click())); +} + +void MainDisplay::setPL (QWidget* w) +{ + m_playlist = w; + m_plButton->setON (m_playlist->isVisible()); + ACTION(ActionManager::SHOW_PLAYLIST)->setChecked(m_playlist->isVisible()); + + connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), + m_playlist, SLOT (setVisible (bool))); + connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), + m_plButton, SLOT (setON (bool))); + + connect (m_plButton, SIGNAL(clicked(bool)), + ACTION(ActionManager::SHOW_PLAYLIST), SLOT(setChecked (bool))); + connect (m_plButton, SIGNAL (clicked (bool)), m_playlist, SLOT (setVisible (bool))); + connect (m_playlist, SIGNAL (closed ()), m_plButton, SLOT (click())); +} + +bool MainDisplay::isPlaylistVisible() const +{ + return m_plButton->isChecked(); +} + +bool MainDisplay::isEqualizerVisible() const +{ + return m_eqButton->isChecked(); +} + +void MainDisplay::updateVolume() +{ + if(sender() == m_volumeBar) + m_text->setText(tr("Volume: %1%").arg(m_volumeBar->value())); + if(sender() == m_balanceBar) + { + if(m_balanceBar->value() > 0) + m_text->setText(tr("Balance: %1% right").arg(m_balanceBar->value())); + else if(m_balanceBar->value() < 0) + m_text->setText(tr("Balance: %1% left").arg(-m_balanceBar->value())); + else + m_text->setText(tr("Balance: center")); + } + m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); +} + +void MainDisplay::showPosition() +{ + int sec = m_posbar->value() / 1000; + if(sec > 3600) + sec /= 60; + QString time = QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); + m_text->setText(tr("Seek to: %1").arg(time)); +} + +void MainDisplay::updatePosition() +{ + m_text->clear(); + m_core->seek(m_posbar->value()); +} + +void MainDisplay::wheelEvent (QWheelEvent *e) +{ + m_mw->setVolume(m_volumeBar->value()+e->delta()/10, m_balanceBar->value()); +} + +bool MainDisplay::isRepeatable() const +{ + return m_repeatButton->isChecked(); +} + +bool MainDisplay::isShuffle() const +{ + return m_shuffleButton->isChecked(); +} + +void MainDisplay::setIsRepeatable(bool yes) +{ + m_repeatButton->setON(yes); +} + +void MainDisplay::setIsShuffle(bool yes) +{ + m_shuffleButton->setON(yes); +} + +void MainDisplay::mousePressEvent(QMouseEvent *e) +{ + if (e->button() == Qt::RightButton) + m_mw->menu()->exec(e->globalPos()); + else if(e->button() == Qt::LeftButton && m_aboutWidget->underMouse()) + m_mw->about(); + PixmapWidget::mousePressEvent(e); +} + diff --git a/src/plugins/Ui/skinned/display.h b/src/plugins/Ui/skinned/display.h new file mode 100644 index 000000000..1a7a05b82 --- /dev/null +++ b/src/plugins/Ui/skinned/display.h @@ -0,0 +1,122 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DISPLAY_H +#define DISPLAY_H + +#include +#include +#include "pixmapwidget.h" + +class TimeIndicator; +class PositionBar; +class Skin; +class ToggleButton; +class TitleBar; +class NumberDisplay; +class SymbolDisplay; +class MonoStereo; +class PlayStatus; +class VolumeBar; +class BalanceBar; +class MainWindow; +class SoundCore; +class Button; +class TextScroller; +class MainVisual; +class TitleBar; + +/** + @author Ilya Kotov +*/ +class MainDisplay : public PixmapWidget +{ + Q_OBJECT +public: + MainDisplay(QWidget *parent = 0); + + ~MainDisplay(); + + void setEQ(QWidget*); + void setPL(QWidget*); + bool isEqualizerVisible()const; + bool isPlaylistVisible()const; + bool isRepeatable()const; + bool isShuffle()const; + void setIsRepeatable(bool); + void setIsShuffle(bool); + void setMinimalMode(bool b = true); + void setActive(bool b); + +public slots: + void setDuration(qint64); + +signals: + void repeatableToggled(bool); + void shuffleToggled(bool); + +protected: + void wheelEvent(QWheelEvent *); + void mousePressEvent(QMouseEvent*); + +private slots: + void updateSkin(); + void updateVolume(); + void showPosition(); + void updatePosition(); + void setSampleRate(quint32 rate); + void setTime(qint64); + void setState(Qmmp::State state); + void setVolume(int left, int right); + + +private: + void updatePositions(); + void updateMask(); + QWidget* m_equlizer; + QWidget* m_playlist; + bool m_shaded; + Skin *m_skin; + PositionBar *m_posbar; + Button *m_previous; + Button *m_play; + Button *m_pause; + Button *m_stop; + Button *m_next; + Button *m_eject; + TextScroller *m_text; + ToggleButton *m_eqButton; + ToggleButton *m_plButton; + ToggleButton *m_shuffleButton; + ToggleButton *m_repeatButton; + SymbolDisplay* m_kbps; + SymbolDisplay* m_freq; + MonoStereo* m_monoster; + PlayStatus* m_playstatus; + VolumeBar* m_volumeBar; + BalanceBar* m_balanceBar; + MainWindow* m_mw; + MainVisual* m_vis; + TimeIndicator* m_timeIndicator; + TitleBar *m_titlebar; + SoundCore *m_core; + QWidget *m_aboutWidget; +}; + +#endif diff --git a/src/plugins/Ui/skinned/dock.cpp b/src/plugins/Ui/skinned/dock.cpp new file mode 100644 index 000000000..a4e5d52d2 --- /dev/null +++ b/src/plugins/Ui/skinned/dock.cpp @@ -0,0 +1,266 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include + +#include "dock.h" + + +Dock *Dock::m_instance = 0; + +Dock *Dock::instance() +{ + if (!m_instance) + m_instance = new Dock(); + return m_instance; +} + +Dock::Dock (QObject *parent) + : QObject (parent) +{ + m_instance = this; + m_mainWidget = 0; +} + +Dock::~Dock() +{ + m_instance = 0; +} + +void Dock::setMainWidget (QWidget *widget) +{ + m_mainWidget = widget; + m_widgetList.prepend (widget); + m_dockedList.prepend (false); +} + + +QPoint Dock::snap (QPoint npos, QWidget* mv, QWidget* st) +{ + int nx = npos.x() - st->x(); + int ny = abs (npos.y() - st->y() + mv->height()); + + if (abs (nx) < 13 && ny < 13) //above + npos.rx() = st->x(); + if (ny < 13 && nx > -mv->width() && nx < st->width()) + npos.ry() = st->y() - mv->height(); + nx = abs (npos.x() + mv->width() - st->x() - st->width()); + if (nx < 13 && ny < 13) + npos.rx() = st->x() + st->width() - mv->width(); + + /***********/ + nx = npos.x() - st->x(); + ny = abs (npos.y() - st->y() - st->height()); + + if (abs (nx) < 13 && ny < 13) //near + npos.rx() = st->x(); + if (ny < 13 && nx > -mv->width() && nx < st->width()) + npos.ry() = st->y() + st->height(); + nx = abs (npos.x() + mv->width() - st->x() - st->width()); + if (nx < 13 && ny < 13) + npos.rx() = st->x() + st->width() - mv->width(); + /**************/ + nx = abs (npos.x() - st->x() + mv->width()); + ny = npos.y() - st->y(); + + if (nx < 13 && abs (ny) < 13) //left + npos.ry() = st->y(); + if (nx < 13 && ny > -mv->height() && ny < st->height()) + npos.rx() = st->x() - mv->width(); + + ny = abs (npos.y() + mv->height() - st->y() - st->height()); + if (nx < 13 && ny < 13) + npos.ry() = st->y() + st->height() - mv->height(); + /*****************/ + nx = abs (npos.x() - st->x() - st->width()); + ny = npos.y() - st->y(); + + if (nx < 13 && abs (ny) < 13) //right + npos.ry() = st->y(); + if (nx < 13 && ny > -mv->height() && ny < st->height()) + npos.rx() = st->x() + st->width(); + + ny = abs (npos.y() + mv->height() - st->y() - st->height()); + if (nx < 13 && ny < 13) + npos.ry() = st->y() + st->height() - mv->height(); + + return (npos); +} + +void Dock::addWidget (QWidget *widget) +{ + m_widgetList.append (widget); + m_dockedList.append (false); + widget->addActions(m_actions); + +} + +void Dock::move (QWidget* mv, QPoint npos) +{ + QRect DesktopRect = QApplication::desktop()->availableGeometry(m_mainWidget); + if(npos.y() < DesktopRect.y()) + npos.setY(DesktopRect.y()); + if(npos.x() < DesktopRect.x()) + npos.setX(DesktopRect.x()); + if (mv == m_mainWidget) + { + + for (int i = 1; iisVisible()) + npos = snap (npos, mv, m_widgetList.at (i)); + + } + else + { + QPoint pos = QPoint (npos.x() + x_list.at (i), + npos.y() + y_list.at (i)); + for (int j = 1; jisVisible()) + { + pos = snap (pos, m_widgetList.at (i), m_widgetList.at (j)); + npos = QPoint (pos.x() - x_list.at (i), + pos.y() - y_list.at (i)); + } + } + } + } + mv->move (npos); + for (int i = 1; imove(npos.x() + x_list.at (i), + npos.y() + y_list.at (i)); + } + } + else + { + for (int i = 0; iisVisible()) + { + npos = snap (npos, mv, m_widgetList.at (i)); + } + } + mv->move (npos); + } +} + +void Dock::calculateDistances() +{ + x_list.clear(); + y_list.clear(); + foreach (QWidget *w, m_widgetList) + { + if (w!=m_mainWidget) + { + x_list.append (- m_mainWidget->x() + w->x()); + y_list.append (- m_mainWidget->y() + w->y()); + } + else + { + x_list.prepend (0); + y_list.prepend (0); + } + } +} + +void Dock::updateDock() +{ + QWidget *mv = m_widgetList.at (0); + for (int j = 1; jx() - st->x(); + int ny = abs (mv->y() - st->y() + mv->height()); + if (ny < 2 && nx > -mv->width() && nx < st->width()) //above + return true; + + /***********/ + nx = mv->x() - st->x(); + ny = abs (mv->y() - st->y() - st->height()); + if (ny < 2 && nx > -mv->width() && nx < st->width()) //near + return true; + + /**************/ + nx = abs (mv->x() - st->x() + mv->width()); + ny = mv->y() - st->y(); + if (nx < 2 && ny > -mv->height() && ny < st->height()) //left + return true; + + /*****************/ + nx = abs (mv->x() - st->x() - st->width()); + ny = mv->y() - st->y(); + if (nx < 2 && ny > -mv->height() && ny < st->height()) //right + return true; + return false; +} + +void Dock::addActions (QList actions) +{ + m_actions << actions; + for (int i = 0; iaddActions (actions); +} + +bool Dock::isUnder(QWidget* upper, QWidget* nether, int dy) +{ + int nx = upper->x() - nether->x(); + return abs (upper->y() + upper->height() -dy - nether->y()) < 2 && + nx > -upper->width() && nx < nether->width(); +} + +void Dock::align(QWidget* w, int dy) +{ + for (int i = 0; imove(m_widgetList.at(i)->x(), m_widgetList.at(i)->y()+dy); + align(m_widgetList.at(i), dy); + } + } +} diff --git a/src/plugins/Ui/skinned/dock.h b/src/plugins/Ui/skinned/dock.h new file mode 100644 index 000000000..e843ed142 --- /dev/null +++ b/src/plugins/Ui/skinned/dock.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DOCK_H +#define DOCK_H + +#include +#include +#include + +class QAction; +/** + @author Ilya Kotov +*/ +class Dock : public QObject +{ + Q_OBJECT +public: + Dock(QObject *parent = 0); + + ~Dock(); + + static Dock *instance(); + void setMainWidget(QWidget*); + void addWidget(QWidget *); + void move(QWidget*, QPoint); + void calculateDistances(); + void updateDock(); + QPoint snap(QPoint, QWidget*, QWidget*); + void addActions(QList actions); + void align(QWidget*, int dy); + +private: + bool isDocked(QWidget*, QWidget*); + bool isUnder(QWidget*, QWidget*, int); + static Dock *m_instance; + QWidget *m_mainWidget; + QList m_widgetList; + QList m_dockedList; + QList x_list; + QList y_list; + QList m_actions; +}; + +#endif diff --git a/src/plugins/Ui/skinned/eqgraph.cpp b/src/plugins/Ui/skinned/eqgraph.cpp new file mode 100644 index 000000000..1d7d070f7 --- /dev/null +++ b/src/plugins/Ui/skinned/eqgraph.cpp @@ -0,0 +1,163 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include + +#include "skin.h" +#include "eqgraph.h" + +EQGraph::EQGraph (QWidget *parent) + : PixmapWidget (parent) +{ + m_skin = Skin::instance(); + setPixmap (m_skin->getEqPart (Skin::EQ_GRAPH)); + clear(); + m_ratio = m_skin->ratio(); + draw(); + connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); + setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); +} + +EQGraph::~EQGraph() +{} + +void EQGraph::addValue (int value) +{ + if (m_values.size() >= 10) + return; + m_values.append (value); + if (m_values.size() == 10) + { + draw(); + } +} + +void EQGraph::clear () +{ + m_values.clear(); + update(); +} + +void EQGraph::init_spline (double * x, double * y, int n, double * y2) +{ + int i, k; + double p, qn, sig, un, *u; + + u = new double[n]; + + y2[0] = u[0] = 0.0; + + for (i = 1; i < n - 1; i++) + { + sig = ((double) x[i] - x[i - 1]) / ((double) x[i + 1] - x[i - 1]); + p = sig * y2[i - 1] + 2.0; + y2[i] = (sig - 1.0) / p; + u[i] = + (((double) y[i + 1] - y[i]) / (x[i + 1] - x[i])) - + (((double) y[i] - y[i - 1]) / (x[i] - x[i - 1])); + u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p; + } + qn = un = 0.0; + + y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0); + for (k = n - 2; k >= 0; k--) + y2[k] = y2[k] * y2[k + 1] + u[k]; + delete[] u; +} + +double EQGraph::eval_spline (double xa[], double ya[], double y2a[], int n, double x) +{ + int klo, khi, k; + double h, b, a; + + klo = 0; + khi = n - 1; + while (khi - klo > 1) + { + k = (khi + klo) >> 1; + if (xa[k] > x) + khi = k; + else + klo = k; + } + h = xa[khi] - xa[klo]; + a = (xa[khi] - x) / h; + b = (x - xa[klo]) / h; + return (a * ya[klo] + b * ya[khi] + + ((a * a * a - a) * y2a[klo] + + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0); +} + +void EQGraph::draw() +{ + QPixmap pixmap = m_skin->getEqPart (Skin::EQ_GRAPH); + if (pixmap.isNull()) + pixmap = QPixmap(113*m_ratio,19*m_ratio); + + if (m_values.size()!=10) + { + setPixmap (pixmap); + return; + } + + int i, y, ymin, ymax, py = 0; + double x[] = { 0, 11, 23, 35, 47, 59, 71, 83, 97, 109 }, yf[10]; + double *bands = new double[10]; + + for (int i = 0; i < 10; ++i) + { + bands[i] = m_values.at (i); + } + + init_spline (x, bands, 10, yf); + for (i = 0; i < 113; i++) + { + y = 9 - (int) ((eval_spline (x, bands, yf, 10, i) * 9.0) / 20.0); + if (y < 0) + y = 0; + if (y > 18) + y = 18; + if (!i) + py = y; + if (y < py) + { + ymin = y; + ymax = py; + } + else + { + ymin = py; + ymax = y; + } + py = y; + + QPainter paint (&pixmap); + paint.drawPixmap (i*m_ratio, y*m_ratio, m_skin->getEqSpline (y)); + } + setPixmap (pixmap); + delete [] bands; +} + +void EQGraph::updateSkin() +{ + m_ratio = m_skin->ratio(); + draw(); + setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); +} + diff --git a/src/plugins/Ui/skinned/eqgraph.h b/src/plugins/Ui/skinned/eqgraph.h new file mode 100644 index 000000000..96e5db521 --- /dev/null +++ b/src/plugins/Ui/skinned/eqgraph.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EQGRAPH_H +#define EQGRAPH_H + +#include "pixmapwidget.h" + +class Skin; +/** + @author Ilya Kotov +*/ +class EQGraph : public PixmapWidget +{ + Q_OBJECT +public: + EQGraph (QWidget *parent = 0); + + ~EQGraph(); + + void addValue (int); + void clear(); + +private slots: + void updateSkin(); + +private: + QList m_values; + Skin *m_skin; + void init_spline (double * x, double * y, int n, double * y2); + double eval_spline (double xa[], double ya[], double y2a[], int n, double x); + void draw(); + int m_ratio; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/eqpreset.cpp b/src/plugins/Ui/skinned/eqpreset.cpp new file mode 100644 index 000000000..533dd4f67 --- /dev/null +++ b/src/plugins/Ui/skinned/eqpreset.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "eqpreset.h" + +EQPreset::EQPreset() + : QListWidgetItem() +{ + m_preamp = 0; + for(int i = 0; i < 10; ++i) + m_bands[i] = 0; +} + + +EQPreset::~EQPreset() +{} + +void EQPreset::setGain(int n, double value) +{ + if(n > 9 || n < 0) + return; + m_bands[n] = value; +} + +void EQPreset::setPreamp(double preamp) +{ + m_preamp = preamp; +} + +double EQPreset::gain(int n) +{ + if(n > 9 || n < 0) + return 0; + return m_bands[n]; +} + +double EQPreset::preamp() +{ + return m_preamp; +} diff --git a/src/plugins/Ui/skinned/eqpreset.h b/src/plugins/Ui/skinned/eqpreset.h new file mode 100644 index 000000000..fd99e6826 --- /dev/null +++ b/src/plugins/Ui/skinned/eqpreset.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EQPRESET_H +#define EQPRESET_H + +#include + +/** + @author Ilya Kotov +*/ +class EQPreset : public QListWidgetItem +{ +public: + EQPreset(); + + ~EQPreset(); + + void setGain(int n, double value); + void setPreamp(double); + + double gain(int n); + double preamp(); + +private: + double m_bands[10]; + double m_preamp; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/eqslider.cpp b/src/plugins/Ui/skinned/eqslider.cpp new file mode 100644 index 000000000..5c1925a4f --- /dev/null +++ b/src/plugins/Ui/skinned/eqslider.cpp @@ -0,0 +1,153 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include + +#include "skin.h" + +#include "eqslider.h" + + +EqSlider::EqSlider(QWidget *parent): PixmapWidget(parent) +{ + m_skin = Skin::instance(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setPixmap(m_skin->getEqSlider(0)); + m_moving = false; + m_min = -20; + m_max = 20; + m_old = m_value = 0; + draw(false); + setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); +} + +EqSlider::~EqSlider() +{} + +void EqSlider::mousePressEvent(QMouseEvent *e) +{ + m_moving = true; + press_pos = e->y(); + if (e->button() == Qt::MidButton) + { + m_value = 0; + emit sliderMoved(m_value); + m_old = m_value; + } + else if (m_posy() && e->y()ratio()) + { + press_pos = e->y()-m_pos; + } + else + { + m_value = convert(qMax(qMin(height()-12*m_skin->ratio(),e->y()-6*m_skin->ratio()),0)); + press_pos = 6*m_skin->ratio(); + if (m_value!=m_old) + { + emit sliderMoved(m_value); + m_old = m_value; + } + } + draw(); +} + +void EqSlider::mouseReleaseEvent(QMouseEvent*) +{ + m_moving = false; + draw(false); +} + +void EqSlider::mouseMoveEvent(QMouseEvent* e) +{ + if (m_moving) + { + int po = e->y(); + po = po - press_pos; + + if (0<=po && po<=height()-12*m_skin->ratio()) + { + m_value = convert(po); + draw(); + if (m_value!=m_old) + { + + m_old = m_value; + //qDebug ("%d",-m_value); + emit sliderMoved(-m_value); + } + } + } +} + +double EqSlider::value() +{ + return - m_value; +} + +void EqSlider::setValue(double p) +{ + if (m_moving) + return; + m_value = -p; + draw(false); +} + +void EqSlider::setMax(double m) +{ + m_max = m; + draw(false); +} + +void EqSlider::updateSkin() +{ + resize(m_skin->getEqSlider(0).size()); + draw(false); + setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); +} + +void EqSlider::draw(bool pressed) +{ + int p=int(ceil(double(m_value-m_min)*(height()-12*m_skin->ratio())/(m_max-m_min))); + m_pixmap = m_skin->getEqSlider(27-27*(m_value-m_min)/(m_max-m_min)); + QPainter paint(&m_pixmap); + if (pressed) + paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_P)); + else + paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_N)); + setPixmap(m_pixmap); + m_pos = p; +} + +double EqSlider::convert(int p) +{ + return (m_max - m_min)*(p)/(height() - 12*m_skin->ratio()) + m_min; +} + +void EqSlider::wheelEvent(QWheelEvent *e) +{ + m_value -= e->delta()/60; + m_value = m_value > m_max ? m_max : m_value; + m_value = m_value < m_min ? m_min : m_value; + draw(false); + emit sliderMoved(m_value); +} + diff --git a/src/plugins/Ui/skinned/eqslider.h b/src/plugins/Ui/skinned/eqslider.h new file mode 100644 index 000000000..0a36a16ee --- /dev/null +++ b/src/plugins/Ui/skinned/eqslider.h @@ -0,0 +1,70 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EQSLIDER_H +#define EQSLIDER_H + +#include "pixmapwidget.h" + +class QMouseEvent; +class QWheelEvent; +class Skin; + +/** + @author Ilya Kotov +*/ +class EqSlider : public PixmapWidget +{ +Q_OBJECT +public: + EqSlider(QWidget *parent = 0); + + ~EqSlider(); + + double value(); + +public slots: + void setValue(double); + void setMax(double); + +signals: + void sliderMoved (double); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + bool m_moving; + int press_pos; + double m_max, m_min, m_pos, m_value, m_old; + QPixmap m_pixmap; + double convert(int); // value = convert(position); + void draw(bool pressed = true); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void wheelEvent(QWheelEvent *); + + +}; + +#endif diff --git a/src/plugins/Ui/skinned/eqtitlebar.cpp b/src/plugins/Ui/skinned/eqtitlebar.cpp new file mode 100644 index 000000000..e26a35e89 --- /dev/null +++ b/src/plugins/Ui/skinned/eqtitlebar.cpp @@ -0,0 +1,189 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include "eqwidget.h" +#include "skin.h" +#include "shadedbar.h" +#include "dock.h" +#include "mainwindow.h" +#include "button.h" +#include "eqtitlebar.h" + +EqTitleBar::EqTitleBar(QWidget *parent) + : PixmapWidget(parent) +{ + m_volumeBar = 0; + m_balanceBar = 0; + m_shade2 = 0; + m_left = 0; + m_right = 0; + m_shaded = false; + m_align = false; + m_skin = Skin::instance(); + m_eq = parentWidget(); + m_mw = qobject_cast(m_eq->parent()); + m_close = new Button(this, Skin::EQ_BT_CLOSE_N, Skin::EQ_BT_CLOSE_P, Skin::CUR_EQCLOSE); + connect(m_close, SIGNAL(clicked()),m_eq, SIGNAL(closed())); + m_shade = new Button(this, Skin::EQ_BT_SHADE1_N, Skin::EQ_BT_SHADE1_P, Skin::CUR_EQNORMAL); + connect(m_shade, SIGNAL(clicked()), SLOT(shade())); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + if (settings.value("Equalizer/shaded", false).toBool()) + shade(); + m_align = true; + setActive(false); + setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); + connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); + updatePositions(); +} + + +EqTitleBar::~EqTitleBar() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.setValue("Equalizer/shaded", m_shaded); +} + +void EqTitleBar::updatePositions() +{ + int r = m_skin->ratio(); + m_close->move(r*264,r*3); + m_shade->move(r*254,r*3); + if(m_volumeBar) + m_volumeBar->move(r*61,r*4); + if(m_balanceBar) + m_balanceBar->move(r*164,r*4); + if(m_shade2) + m_shade2->move(r*254,r*3); +} + +void EqTitleBar::setActive(bool active) +{ + if (active) + { + if (m_shaded) + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); + else + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); + } + else + { + if (m_shaded) + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_I)); + else + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_I)); + } +} + +void EqTitleBar::setVolume(int left, int right) +{ + m_left = left; + m_right = right; + if (m_volumeBar && m_balanceBar) + { + int maxVol = qMax(left, right); + m_volumeBar->setValue(maxVol); + if (maxVol && !m_volumeBar->isPressed()) + m_balanceBar->setValue((right - left)*100/maxVol); + } +} + +void EqTitleBar::mousePressEvent(QMouseEvent* event) +{ + switch ((int) event->button ()) + { + case Qt::LeftButton: + m_pos = event->pos(); + break; + case Qt::RightButton: + m_mw->menu()->exec(event->globalPos()); + } +} + +void EqTitleBar::mouseMoveEvent(QMouseEvent* event) +{ + if (m_pos.x() < width() - 30 * m_skin->ratio()) + { + QPoint npos = (event->globalPos()-m_pos); + Dock::instance()->move(m_eq, npos); + } +} + +void EqTitleBar::mouseReleaseEvent(QMouseEvent*) +{ + Dock::instance()->updateDock(); +} + +void EqTitleBar::mouseDoubleClickEvent (QMouseEvent *) +{ + EqTitleBar::shade(); +} + +void EqTitleBar::shade() +{ + m_shaded = !m_shaded; + int r = m_skin->ratio(); + + if (m_shaded) + { + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); + m_shade->hide(); + m_shade2 = new Button(this, Skin::EQ_BT_SHADE2_N, Skin::EQ_BT_SHADE2_P, Skin::CUR_EQNORMAL); + m_shade2->move(r*254,r*3); + connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); + m_shade2->show(); + m_volumeBar = new ShadedBar(this, Skin::EQ_VOLUME1, Skin::EQ_VOLUME2, Skin::EQ_VOLUME3); + m_volumeBar->move(r*61,r*4); + m_volumeBar->show(); + connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + m_balanceBar = new ShadedBar(this, Skin::EQ_BALANCE1, Skin::EQ_BALANCE2, Skin::EQ_BALANCE3); + m_balanceBar->move(r*164,r*4); + m_balanceBar->setRange(-100, 100); + m_balanceBar->show(); + connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); + setVolume(m_left, m_right); //show current volume and balance + } + else + { + setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); + m_shade2->deleteLater(); + m_volumeBar->deleteLater(); + m_balanceBar->deleteLater(); + m_volumeBar = 0; + m_balanceBar = 0; + m_shade2 = 0; + m_shade->show(); + } + qobject_cast(m_eq)->setMimimalMode(m_shaded); + if (m_align) + Dock::instance()->align(m_eq, m_shaded? -102*r: 102*r); +} + +void EqTitleBar::updateVolume() +{ + m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); +} + +void EqTitleBar::updateSkin() +{ + setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); + updatePositions(); +} diff --git a/src/plugins/Ui/skinned/eqtitlebar.h b/src/plugins/Ui/skinned/eqtitlebar.h new file mode 100644 index 000000000..d2ea09c6a --- /dev/null +++ b/src/plugins/Ui/skinned/eqtitlebar.h @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EQTITLEBAR_H +#define EQTITLEBAR_H + +#include "pixmapwidget.h" + +class QMouseEvent; +class Skin; +class MainWindow; +class Button; +class ShadedBar; + +/** + @author Ilya Kotov +*/ +class EqTitleBar : public PixmapWidget +{ +Q_OBJECT +public: + EqTitleBar(QWidget *parent = 0); + + ~EqTitleBar(); + + void setActive(bool); + +public slots: + void setVolume(int left, int right); + +private slots: + void shade(); + void updateVolume(); + void updateSkin(); + +private: + void updatePositions(); + Skin* m_skin; + bool m_active; + int m_left; + int m_right; + QPoint m_pos; + QWidget* m_eq; + MainWindow* m_mw; + Button* m_close; + Button* m_shade; + Button* m_shade2; + bool m_shaded, m_align; + ShadedBar* m_volumeBar; + ShadedBar* m_balanceBar; + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseDoubleClickEvent (QMouseEvent *); +}; + +#endif diff --git a/src/plugins/Ui/skinned/eqwidget.cpp b/src/plugins/Ui/skinned/eqwidget.cpp new file mode 100644 index 000000000..1327b1bd9 --- /dev/null +++ b/src/plugins/Ui/skinned/eqwidget.cpp @@ -0,0 +1,446 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "skin.h" +#include "eqslider.h" +#include "eqtitlebar.h" +#include "togglebutton.h" +#include "eqgraph.h" +#include "button.h" +#include "eqpreset.h" +#include "preseteditor.h" +#include "mainwindow.h" +#include "playlist.h" +#include "windowsystem.h" +#include "eqwidget.h" + +EqWidget::EqWidget (QWidget *parent) + : PixmapWidget (parent) +{ + setWindowTitle(tr("Equalizer")); + m_shaded = false; + m_skin = Skin::instance(); + setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); + setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); + m_titleBar = new EqTitleBar (this); + m_titleBar->move (0,0); + connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); + + m_preamp = new EqSlider (this); + connect (m_preamp,SIGNAL (sliderMoved (double)),SLOT (writeEq())); + + m_on = new ToggleButton (this,Skin::EQ_BT_ON_N,Skin::EQ_BT_ON_P, Skin::EQ_BT_OFF_N,Skin::EQ_BT_OFF_P); + connect (m_on, SIGNAL (clicked(bool)), SLOT(writeEq())); + + m_autoButton = new ToggleButton(this, Skin::EQ_BT_AUTO_1_N, Skin::EQ_BT_AUTO_1_P, + Skin::EQ_BT_AUTO_0_N, Skin::EQ_BT_AUTO_0_P); + m_eqg = new EQGraph(this); + m_presetsMenu = new QMenu(this); + m_presetButton = new Button (this, Skin::EQ_BT_PRESETS_N, Skin::EQ_BT_PRESETS_P, Skin::CUR_EQNORMAL); + connect(m_presetButton, SIGNAL(clicked()), SLOT(showPresetsMenu())); + connect(SoundCore::instance(), SIGNAL(eqSettingsChanged()), SLOT(readEq())); + + for (int i = 0; i<10; ++i) + { + m_sliders << new EqSlider (this); + connect (m_sliders.at (i), SIGNAL (sliderMoved (double)),SLOT (writeEq())); + } + readSettings(); + createActions(); + updatePositions(); + updateMask(); + connect(SoundCore::instance(), SIGNAL(volumeChanged(int, int)), m_titleBar, SLOT(setVolume(int, int))); +#ifdef Q_WS_X11 + QString wm_name = WindowSystem::netWindowManagerName(); + if(wm_name.contains("metacity", Qt::CaseInsensitive) || + wm_name.contains("openbox", Qt::CaseInsensitive)) + setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); + else +#endif + setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); +} + +EqWidget::~EqWidget() +{ + while (!m_presets.isEmpty()) + delete m_presets.takeFirst(); + while (!m_autoPresets.isEmpty()) + delete m_autoPresets.takeFirst(); +} + +void EqWidget::updatePositions() +{ + int r = m_skin->ratio(); + m_preamp->move (21*r,38*r); + m_on->move (14*r,18*r); + m_autoButton->move(39*r,18*r); + m_eqg->move(87*r,17*r); + m_presetButton->move(217*r,18*r); + for (int i = 0; i < 10; ++i) + m_sliders.at (i)->move ((78+i*18)*r,38*r); +} + +void EqWidget::changeEvent (QEvent * event) +{ + if (event->type() == QEvent::ActivationChange) + { + m_titleBar->setActive(isActiveWindow()); + } +} + +void EqWidget::closeEvent (QCloseEvent* e) +{ + if (e->spontaneous ()) + emit closed(); + writeSettings(); +} + +void EqWidget::updateSkin() +{ + m_titleBar->setActive (false); + setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); + setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); + setMimimalMode(m_shaded); + updatePositions(); +} + +void EqWidget::setMimimalMode(bool b) +{ + m_shaded = b; + int r = m_skin->ratio(); + + if(m_shaded) + resize(r*275,r*14); + else + resize(r*275,r*116); + updateMask(); +} + +void EqWidget::readSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + move (settings.value ("Equalizer/pos", QPoint (100, 216)).toPoint()); //geometry + readEq(); + //equalizer presets + QSettings eq_preset (QDir::homePath() +"/.qmmp/eq.preset", QSettings::IniFormat); + for (int i = 1; true; ++i) + { + if (eq_preset.contains("Presets/Preset"+QString("%1").arg(i))) + { + QString name = eq_preset.value("Presets/Preset"+QString("%1").arg(i), + tr("preset")).toString(); + EQPreset *preset = new EQPreset(); + preset->setText(name); + eq_preset.beginGroup(name); + for (int j = 0; j < 10; ++j) + { + preset->setGain(j,eq_preset.value("Band"+QString("%1").arg(j), + 0).toDouble()); + } + preset->setPreamp(eq_preset.value("Preamp",0).toDouble()); + m_presets.append(preset); + eq_preset.endGroup(); + } + else + break; + } + //equalizer auto-load presets + QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", QSettings::IniFormat); + for (int i = 1; true; ++i) + { + if (eq_auto.contains("Presets/Preset"+QString("%1").arg(i))) + { + QString name = eq_auto.value("Presets/Preset"+QString("%1").arg(i), + tr("preset")).toString(); + EQPreset *preset = new EQPreset(); + preset->setText(name); + eq_auto.beginGroup(name); + for (int j = 0; j < 10; ++j) + { + preset->setGain(j,eq_auto.value("Band"+QString("%1").arg(j), + 0).toDouble()); + } + preset->setPreamp(eq_auto.value("Preamp",0).toDouble()); + m_autoPresets.append(preset); + eq_auto.endGroup(); + } + else + break; + } +} + +void EqWidget::writeSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("Equalizer/pos", this->pos()); //geometry + //equalizer presets + QSettings eq_preset (QDir::homePath() +"/.qmmp/eq.preset", QSettings::IniFormat); + eq_preset.clear (); + for (int i = 0; i < m_presets.size(); ++i) + { + eq_preset.setValue("Presets/Preset"+QString("%1").arg(i+1), + m_presets.at(i)->text()); + eq_preset.beginGroup(m_presets.at(i)->text()); + for (int j = 0; j < 10; ++j) + { + eq_preset.setValue("Band"+QString("%1").arg(j),m_presets.at(i)->gain(j)); + } + eq_preset.setValue("Preamp",m_presets.at(i)->preamp()); + eq_preset.endGroup(); + } + //equalizer auto-load presets + QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", + QSettings::IniFormat); + eq_auto.clear(); + for (int i = 0; i < m_autoPresets.size(); ++i) + { + eq_auto.setValue("Presets/Preset"+QString("%1").arg(i+1), + m_autoPresets.at(i)->text()); + eq_auto.beginGroup(m_autoPresets.at(i)->text()); + for (int j = 0; j < 10; ++j) + { + eq_auto.setValue("Band"+QString("%1").arg(j),m_autoPresets.at(i)->gain(j)); + } + eq_auto.setValue("Preamp",m_autoPresets.at(i)->preamp()); + eq_auto.endGroup(); + } +} + +void EqWidget::readEq() +{ + m_eqg->clear(); + EqSettings eqSettings = SoundCore::instance()->eqSettings(); + m_preamp->setValue(eqSettings.preamp()); + for (int i=0; i<10; ++i) + { + m_sliders.at(i)->setValue(eqSettings.gain(i)); + m_eqg->addValue(m_sliders.at(i)->value()); + } + m_on->setON(eqSettings.isEnabled()); +} + +void EqWidget::writeEq() +{ + m_eqg->clear(); + EqSettings eqSettings; + eqSettings.setPreamp(m_preamp->value()); + for (int i=0; i<10; ++i) + { + eqSettings.setGain(i,m_sliders.at(i)->value()); + m_eqg->addValue(m_sliders.at(i)->value()); + } + eqSettings.setEnabled(m_on->isChecked()); + SoundCore::instance()->setEqSettings(eqSettings); +} + +void EqWidget::createActions() +{ + m_presetsMenu->addAction(tr("&Load/Delete"),this, SLOT(showEditor())); + m_presetsMenu->addSeparator(); + m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Preset"), + this, SLOT(savePreset())); + m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Auto-load Preset"), + this, SLOT(saveAutoPreset())); + m_presetsMenu->addAction(QIcon::fromTheme("document-open"), tr("&Import"), + this, SLOT(importWinampEQF())); + m_presetsMenu->addSeparator(); + m_presetsMenu->addAction(QIcon::fromTheme("edit-clear"), tr("&Clear"), this, SLOT(reset())); +} + +void EqWidget::showPresetsMenu() +{ + m_presetsMenu->exec(m_presetButton->mapToGlobal(QPoint(0, 0))); +} + +void EqWidget::reset() +{ + for (int i = 0; i < m_sliders.size(); ++i) + m_sliders.at(i)->setValue(0); + m_preamp->setValue(0); + writeEq(); +} + +void EqWidget::showEditor() +{ + PresetEditor *editor = new PresetEditor(this); + editor->addPresets(m_presets); + editor->addAutoPresets(m_autoPresets); + connect (editor, SIGNAL(presetLoaded(EQPreset*)), SLOT(setPreset(EQPreset*))); + connect (editor, SIGNAL(presetDeleted(EQPreset*)), SLOT(deletePreset(EQPreset*))); + editor->show(); +} + +void EqWidget::savePreset() +{ + bool ok; + QString text = QInputDialog::getText(this, tr("Saving Preset"), + tr("Preset name:"), QLineEdit::Normal, + tr("preset #")+QString("%1").arg(m_presets.size()+1), &ok); + if (ok) + { + EQPreset* preset = new EQPreset; + preset->setText(text); + preset->setPreamp(m_preamp->value()); + for (int i = 0; i<10; ++i) + preset->setGain(i, m_sliders.at (i)->value()); + foreach(EQPreset *p, m_presets) //remove preset with same name + { + if (p->text() == text) + { + m_presets.removeAll(p); + delete p; + } + } + m_presets.append(preset); + } +} + +void EqWidget::saveAutoPreset() +{ + PlayList* playlist = qobject_cast(parent())->playlist(); + if (!playlist->currentItem()) + return; + //delete preset if it already exists + EQPreset* preset = findPreset(playlist->currentItem()->url().section("/",-1)); + if (preset) + deletePreset(preset); + //create new preset + preset = new EQPreset(); + preset->setText(playlist->currentItem()->url().section("/",-1)); + preset->setPreamp(m_preamp->value()); + for (int i = 0; i<10; ++i) + { + preset->setGain(i, m_sliders.at (i)->value()); + } + m_autoPresets.append(preset); +} + +void EqWidget::setPreset(EQPreset* preset) +{ + for (int i = 0; i<10; ++i) + m_sliders.at(i)->setValue(preset->gain(i)); + m_preamp->setValue(preset->preamp()); + writeEq(); +} + +void EqWidget::deletePreset(EQPreset* preset) +{ + int p = m_presets.indexOf(preset); + if (p != -1) + { + delete m_presets.takeAt(p); + return; + } + p = m_autoPresets.indexOf(preset); + if (p != -1) + { + delete m_autoPresets.takeAt(p); + return; + } +} + +void EqWidget::loadPreset(const QString &name) +{ + if (m_autoButton->isChecked()) + { + EQPreset *preset = findPreset(name); + if (preset) + setPreset(preset); + else + reset(); + } +} + +EQPreset *EqWidget::findPreset(const QString &name) +{ + foreach(EQPreset *preset, m_autoPresets) + { + if (preset->text() == name) + return preset; + } + return 0; +} + +void EqWidget::importWinampEQF() +{ + char header[31]; + char name[257]; + char bands[11]; + QString path = FileDialog::getOpenFileName(this, tr("Import Preset"), + "/home", + QString("Winamp EQF (*.q1)")); + + QFile file(path); + file.open(QIODevice::ReadOnly); + file.read (header, 31); + if (QString::fromAscii(header).contains("Winamp EQ library file v1.1")) + { + while (file.read (name, 257)) + { + EQPreset* preset = new EQPreset; + preset->setText(QString::fromAscii(name)); + + file.read(bands,11); + + for (int i = 0; i<10; ++i) + { + preset->setGain(i, 20 - bands[i]*40/64); + } + preset->setPreamp(20 - bands[10]*40/64); + m_presets.append(preset); + } + } + file.close(); + +} + +void EqWidget::keyPressEvent (QKeyEvent *ke) +{ + QKeyEvent event = QKeyEvent(ke->type(), ke->key(), + ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); + QApplication::sendEvent(qobject_cast(parent())->playlist(), &event); +} + +#ifdef Q_WS_X11 +bool EqWidget::event (QEvent *event) +{ + if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) + { + WindowSystem::ghostWindow(winId()); + WindowSystem::setWinHint(winId(), "equalizer", "Qmmp"); + } + return QWidget::event(event); +} +#endif + +void EqWidget::updateMask() +{ + clearMask(); + setMask(QRegion(0,0,width(),height())); + QRegion region = m_skin->getRegion(m_shaded? Skin::EQUALIZER_WS : Skin::EQUALIZER); + if (!region.isEmpty()) + setMask(region); +} diff --git a/src/plugins/Ui/skinned/eqwidget.h b/src/plugins/Ui/skinned/eqwidget.h new file mode 100644 index 000000000..7d0fb6086 --- /dev/null +++ b/src/plugins/Ui/skinned/eqwidget.h @@ -0,0 +1,102 @@ +/*************************************************************************** + * Copyright (C) 2006-2008 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef EQWIDGET_H +#define EQWIDGET_H + +#include "pixmapwidget.h" +#include + +/** + @author Ilya Kotov +*/ + +class QMenu; +class Skin; +class EqTitleBar; +class EqSlider; +class ToggleButton; +class EQGraph; +class Button; +class EQPreset; +class PlayListItem; +class SoundCore; + +class EqWidget : public PixmapWidget +{ + Q_OBJECT +public: + EqWidget(QWidget *parent = 0); + + ~EqWidget(); + + /*! + * necessary for auto-load presets + */ + void loadPreset(const QString &name); + void setMimimalMode(bool b = true); + +signals: + void closed(); + +private slots: + void updateSkin(); + void readEq(); + void writeEq(); + void showPresetsMenu(); + void reset(); + void showEditor(); + void savePreset(); + void saveAutoPreset(); + void setPreset(EQPreset*); + void deletePreset(EQPreset*); + void importWinampEQF(); + +private: + void updatePositions(); + void readSettings(); + void writeSettings(); + void createActions(); + void updateMask(); + EQPreset *findPreset(const QString &name); + //events + virtual void keyPressEvent (QKeyEvent *); + virtual void changeEvent(QEvent*); + virtual void closeEvent(QCloseEvent*); +#ifdef Q_WS_X11 + virtual bool event (QEvent *event); +#endif + + Skin *m_skin; + EqTitleBar *m_titleBar; + EqSlider *m_preamp; + Button *m_presetButton; + QList m_sliders; + QPoint m_pos; + ToggleButton *m_on; + ToggleButton *m_autoButton; + EQGraph *m_eqg; + QMenu *m_presetsMenu; + QList m_presets; + QList m_autoPresets; + QString m_autoName; + bool m_shaded; +}; + +#endif diff --git a/src/plugins/Ui/skinned/fft.c b/src/plugins/Ui/skinned/fft.c new file mode 100644 index 000000000..7ca1978a5 --- /dev/null +++ b/src/plugins/Ui/skinned/fft.c @@ -0,0 +1,296 @@ +/* fft.c: Iterative implementation of a FFT + * Copyright (C) 1999 Richard Boulton + * Convolution stuff by Ralph Loader + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * TODO + * Remove compiling in of FFT_BUFFER_SIZE? (Might slow things down, but would + * be nice to be able to change size at runtime.) + * Finish making / checking thread-safety. + * More optimisations. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "fft.h" + +//#include +#include +#include +#ifndef PI +#ifdef M_PI +#define PI M_PI +#else +#define PI 3.14159265358979323846 /* pi */ +#endif +#endif + +/* ########### */ +/* # Structs # */ +/* ########### */ + +struct _struct_fft_state { + /* Temporary data stores to perform FFT in. */ + float real[FFT_BUFFER_SIZE]; + float imag[FFT_BUFFER_SIZE]; +}; + +/* ############################# */ +/* # Local function prototypes # */ +/* ############################# */ + +static void fft_prepare(const sound_sample * input, float *re, float *im); +static void fft_calculate(float *re, float *im); +static void fft_output(const float *re, const float *im, float *output); +static int reverseBits(unsigned int initial); + +/* #################### */ +/* # Global variables # */ +/* #################### */ + +/* Table to speed up bit reverse copy */ +static unsigned int bitReverse[FFT_BUFFER_SIZE]; + +/* The next two tables could be made to use less space in memory, since they + * overlap hugely, but hey. */ +static float sintable[FFT_BUFFER_SIZE / 2]; +static float costable[FFT_BUFFER_SIZE / 2]; + +/* ############################## */ +/* # Externally called routines # */ +/* ############################## */ + +/* --------- */ +/* FFT stuff */ +/* --------- */ + +/* + * Initialisation routine - sets up tables and space to work in. + * Returns a pointer to internal state, to be used when performing calls. + * On error, returns NULL. + * The pointer should be freed when it is finished with, by fft_close(). + */ +fft_state * +fft_init(void) +{ + fft_state *state; + unsigned int i; + + state = (fft_state *) malloc(sizeof(fft_state)); + if (!state) + return NULL; + + for (i = 0; i < FFT_BUFFER_SIZE; i++) { + bitReverse[i] = reverseBits(i); + } + for (i = 0; i < FFT_BUFFER_SIZE / 2; i++) { + float j = 2 * PI * i / FFT_BUFFER_SIZE; + costable[i] = cos(j); + sintable[i] = sin(j); + } + + return state; +} + +/* + * Do all the steps of the FFT, taking as input sound data (as described in + * sound.h) and returning the intensities of each frequency as floats in the + * range 0 to ((FFT_BUFFER_SIZE / 2) * 32768) ^ 2 + * + * FIXME - the above range assumes no frequencies present have an amplitude + * larger than that of the sample variation. But this is false: we could have + * a wave such that its maximums are always between samples, and it's just + * inside the representable range at the places samples get taken. + * Question: what _is_ the maximum value possible. Twice that value? Root + * two times that value? Hmmm. Think it depends on the frequency, too. + * + * The input array is assumed to have FFT_BUFFER_SIZE elements, + * and the output array is assumed to have (FFT_BUFFER_SIZE / 2 + 1) elements. + * state is a (non-NULL) pointer returned by fft_init. + */ +void +fft_perform(const sound_sample * input, float *output, fft_state * state) +{ + /* Convert data from sound format to be ready for FFT */ + fft_prepare(input, state->real, state->imag); + + /* Do the actual FFT */ + fft_calculate(state->real, state->imag); + + /* Convert the FFT output into intensities */ + fft_output(state->real, state->imag, output); +} + +/* + * Free the state. + */ +void +fft_close(fft_state * state) +{ + if (state) + free(state); +} + +/* ########################### */ +/* # Locally called routines # */ +/* ########################### */ + +/* + * Prepare data to perform an FFT on + */ +static void +fft_prepare(const sound_sample * input, float *re, float *im) +{ + unsigned int i; + float *realptr = re; + float *imagptr = im; + + /* Get input, in reverse bit order */ + for (i = 0; i < FFT_BUFFER_SIZE; i++) { + *realptr++ = input[bitReverse[i]]; + *imagptr++ = 0; + } +} + +/* + * Take result of an FFT and calculate the intensities of each frequency + * Note: only produces half as many data points as the input had. + * This is roughly a consequence of the Nyquist sampling theorm thingy. + * (FIXME - make this comment better, and helpful.) + * + * The two divisions by 4 are also a consequence of this: the contributions + * returned for each frequency are split into two parts, one at i in the + * table, and the other at FFT_BUFFER_SIZE - i, except for i = 0 and + * FFT_BUFFER_SIZE which would otherwise get float (and then 4* when squared) + * the contributions. + */ +static void +fft_output(const float *re, const float *im, float *output) +{ + float *outputptr = output; + const float *realptr = re; + const float *imagptr = im; + float *endptr = output + FFT_BUFFER_SIZE / 2; + +#ifdef DEBUG + unsigned int i, j; +#endif + + while (outputptr <= endptr) { + *outputptr = (*realptr * *realptr) + (*imagptr * *imagptr); + outputptr++; + realptr++; + imagptr++; + } + /* Do divisions to keep the constant and highest frequency terms in scale + * with the other terms. */ + *output /= 4; + *endptr /= 4; + +#ifdef DEBUG + printf("Recalculated input:\n"); + for (i = 0; i < FFT_BUFFER_SIZE; i++) { + float val_real = 0; + float val_imag = 0; + for (j = 0; j < FFT_BUFFER_SIZE; j++) { + float fact_real = cos(-2 * j * i * PI / FFT_BUFFER_SIZE); + float fact_imag = sin(-2 * j * i * PI / FFT_BUFFER_SIZE); + val_real += fact_real * re[j] - fact_imag * im[j]; + val_imag += fact_real * im[j] + fact_imag * re[j]; + } + printf("%5d = %8f + i * %8f\n", i, + val_real / FFT_BUFFER_SIZE, val_imag / FFT_BUFFER_SIZE); + } + printf("\n"); +#endif +} + +/* + * Actually perform the FFT + */ +static void +fft_calculate(float *re, float *im) +{ + unsigned int i, j, k; + unsigned int exchanges; + float fact_real, fact_imag; + float tmp_real, tmp_imag; + unsigned int factfact; + + /* Set up some variables to reduce calculation in the loops */ + exchanges = 1; + factfact = FFT_BUFFER_SIZE / 2; + + /* Loop through the divide and conquer steps */ + for (i = FFT_BUFFER_SIZE_LOG; i != 0; i--) { + /* In this step, we have 2 ^ (i - 1) exchange groups, each with + * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges + */ + /* Loop through the exchanges in a group */ + for (j = 0; j != exchanges; j++) { + /* Work out factor for this exchange + * factor ^ (exchanges) = -1 + * So, real = cos(j * PI / exchanges), + * imag = sin(j * PI / exchanges) + */ + fact_real = costable[j * factfact]; + fact_imag = sintable[j * factfact]; + + /* Loop through all the exchange groups */ + for (k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { + int k1 = k + exchanges; + /* newval[k] := val[k] + factor * val[k1] + * newval[k1] := val[k] - factor * val[k1] + **/ +#ifdef DEBUG + printf("%d %d %d\n", i, j, k); + printf("Exchange %d with %d\n", k, k1); + printf("Factor %9f + i * %8f\n", fact_real, fact_imag); +#endif + /* FIXME - potential scope for more optimization here? */ + tmp_real = fact_real * re[k1] - fact_imag * im[k1]; + tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; + re[k1] = re[k] - tmp_real; + im[k1] = im[k] - tmp_imag; + re[k] += tmp_real; + im[k] += tmp_imag; +#ifdef DEBUG + for (k1 = 0; k1 < FFT_BUFFER_SIZE; k1++) { + printf("%5d = %8f + i * %8f\n", k1, real[k1], imag[k1]); + } +#endif + } + } + exchanges <<= 1; + factfact >>= 1; + } +} + +static int +reverseBits(unsigned int initial) +{ + unsigned int reversed = 0, loop; + for (loop = 0; loop < FFT_BUFFER_SIZE_LOG; loop++) { + reversed <<= 1; + reversed += (initial & 1); + initial >>= 1; + } + return reversed; +} diff --git a/src/plugins/Ui/skinned/fft.h b/src/plugins/Ui/skinned/fft.h new file mode 100644 index 000000000..431afa365 --- /dev/null +++ b/src/plugins/Ui/skinned/fft.h @@ -0,0 +1,45 @@ +/* fft.h: Header for iterative implementation of a FFT + * Copyright (C) 1999 Richard Boulton + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _FFT_H_ +#define _FFT_H_ + +#define FFT_BUFFER_SIZE_LOG 9 + +#define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) + +/* sound sample - should be an signed 16 bit value */ +typedef short int sound_sample; + +#ifdef __cplusplus +extern "C" { +#endif + +/* FFT library */ + typedef struct _struct_fft_state fft_state; + fft_state *fft_init(void); + void fft_perform(const sound_sample * input, float *output, + fft_state * state); + void fft_close(fft_state * state); + + + +#ifdef __cplusplus +} +#endif +#endif /* _FFT_H_ */ diff --git a/src/plugins/Ui/skinned/forms/aboutdialog.ui b/src/plugins/Ui/skinned/forms/aboutdialog.ui new file mode 100644 index 000000000..f9ea40fca --- /dev/null +++ b/src/plugins/Ui/skinned/forms/aboutdialog.ui @@ -0,0 +1,162 @@ + + + AboutDialog + + + + 0 + 0 + 523 + 511 + + + + About Qmmp + + + + 9 + + + + + + + + :/logo-qmmp.png + + + Qt::AlignCenter + + + + + + + 0 + + + + About + + + + + + true + + + + + + + + Authors + + + + + + true + + + + + + + + Translators + + + + + + true + + + + + + + + Thanks To + + + + + + true + + + + + + + + License Agreement + + + + + + true + + + true + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + AboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/plugins/Ui/skinned/forms/addurldialog.ui b/src/plugins/Ui/skinned/forms/addurldialog.ui new file mode 100644 index 000000000..64ac928fc --- /dev/null +++ b/src/plugins/Ui/skinned/forms/addurldialog.ui @@ -0,0 +1,99 @@ + + AddUrlDialog + + + + 0 + 0 + 394 + 77 + + + + Enter URL to add + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + true + + + + + + + Qt::Horizontal + + + + 181 + 20 + + + + + + + + &Add + + + + + + + &Cancel + + + + + + + + + addButton + clicked() + AddUrlDialog + accept() + + + 248 + 51 + + + 184 + 72 + + + + + cancelButton + clicked() + AddUrlDialog + reject() + + + 343 + 62 + + + 392 + 60 + + + + + diff --git a/src/plugins/Ui/skinned/forms/configdialog.ui b/src/plugins/Ui/skinned/forms/configdialog.ui new file mode 100644 index 000000000..d6a6f7a47 --- /dev/null +++ b/src/plugins/Ui/skinned/forms/configdialog.ui @@ -0,0 +1,1576 @@ + + + ConfigDialog + + + + 0 + 0 + 659 + 466 + + + + Qmmp Settings + + + + 6 + + + 6 + + + 9 + + + 6 + + + 6 + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 170 + 0 + + + + + 180 + 16777215 + + + + + 38 + 38 + + + + QListView::Static + + + QListView::TopToBottom + + + false + + + QListView::Adjust + + + 2 + + + QListView::ListMode + + + false + + + 100 + + + false + + + 0 + + + + Appearance + + + + :/interface.png:/interface.png + + + + + Playlist + + + + :/playlist.png:/playlist.png + + + + + Plugins + + + + :/plugins.png:/plugins.png + + + + + Advanced + + + + :/advanced.png:/advanced.png + + + + + Connectivity + + + + :/network.png:/network.png + + + + + Audio + + + + :/replaygain.png:/replaygain.png + + + + + Shortcuts + + + + :/shortcuts.png:/shortcuts.png + + + + + + + + + 0 + 0 + + + + QFrame::Raised + + + 0 + + + + + + + 0 + + + + Skins + + + + + + true + + + QListView::Static + + + QListView::TopToBottom + + + QListView::ListMode + + + 0 + + + + + + + + 0 + 0 + + + + Add... + + + + + + + + 0 + 0 + + + + Refresh + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + Miscellaneous + + + + + + View + + + + + + Hide on close + + + + + + + Start hidden + + + + + + + Use skin cursors + + + + + + + + + + + 0 + 0 + + + + Fonts + + + + + + + 0 + 0 + + + + + 80 + 16777215 + + + + Player: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + ??? + + + + + + + ... + + + + + + + + 0 + 0 + + + + + 80 + 16777215 + + + + Playlist: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + ??? + + + + + + + ... + + + + + + + Use bitmap font if available + + + + + + + + + + Transparency + + + + + + Main window + + + + + + + 90 + + + Qt::Horizontal + + + + + + + + 25 + 0 + + + + 0 + + + + + + + Equalizer + + + + + + + 90 + + + Qt::Horizontal + + + + + + + 0 + + + + + + + Playlist + + + + + + + 90 + + + Qt::Horizontal + + + + + + + 0 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + Metadata + + + + 9 + + + 6 + + + + + Load metadata from files + + + + + + + + + + Song Display + + + + + + Title format: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + ... + + + + + + + Convert underscores to blanks + + + + + + + Convert %20 to blanks + + + + + + + Show protocol + + + + + + + Show song numbers + + + + + + + Show playlists + + + + + + + + + Show popup information + + + + + + + false + + + Edit template + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Show anchor + + + + + + + false + + + Align song numbers + + + + + + + + + + Qt::Vertical + + + + 20 + 54 + + + + + + + + + + 9 + + + 5 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + Preferences + + + + + + + + 0 + 0 + + + + Information + + + + + + + Qt::Horizontal + + + + 101 + 20 + + + + + + + + true + + + QAbstractItemView::SelectRows + + + true + + + false + + + 2 + + + + Description + + + + + Filename + + + + + + + + + + + + File Dialog + + + + + + + + + Information + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + Cover Image Retrieve + + + + + + Use separate image files + + + true + + + + + + + Include files: + + + + + + + + + + Exclude files: + + + + + + + + + + + + Recursive search depth: + + + + + + + 6 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Playback + + + + + + Continue playback on startup + + + + + + + + + + + + 9 + + + 5 + + + 0 + + + 0 + + + + + Proxy + + + false + + + false + + + + + + Enable proxy usage + + + + + + + Proxy host name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Proxy port: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Use authentication with proxy + + + + + + + Proxy user name: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + Proxy password: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + QLineEdit::Password + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Replay Gain + + + + + + Replay Gain mode: + + + + + + + + 0 + 0 + + + + + + + + Preamp: + + + + + + + + 0 + 0 + + + + -15.000000000000000 + + + 15.000000000000000 + + + 0.010000000000000 + + + + + + + + 0 + 0 + + + + dB + + + + + + + + 0 + 0 + + + + Default gain: + + + + + + + + 0 + 0 + + + + -15.000000000000000 + + + 15.000000000000000 + + + 0.010000000000000 + + + + + + + + 0 + 0 + + + + dB + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Use peak info to prevent clipping + + + + + + + + + + Audio + + + + + + Output: + + + + + + + + + + + 0 + 0 + + + + Preferences + + + + + + + + 0 + 0 + + + + Information + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Buffer size: + + + + + + + + 0 + 0 + + + + ms + + + 500 + + + 6000 + + + 50 + + + + + + + Qt::Horizontal + + + + 266 + 20 + + + + + + + + Use software volume control + + + + + + + 16-bit output + + + + + + + + + + Qt::Vertical + + + + 20 + 132 + + + + + + + + + + + + true + + + true + + + + Action + + + + + Shortcut + + + + + + + + Change shortcut... + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + 6 + + + 0 + + + + + Qt::Horizontal + + + + 341 + 20 + + + + + + + + QDialogButtonBox::Close + + + + + + + + + + + + + enableProxyCheckBox + toggled(bool) + hostLineEdit + setEnabled(bool) + + + 286 + 39 + + + 286 + 39 + + + + + enableProxyCheckBox + toggled(bool) + portLineEdit + setEnabled(bool) + + + 286 + 39 + + + 272 + 39 + + + + + authProxyCheckBox + toggled(bool) + proxyUserLineEdit + setEnabled(bool) + + + 272 + 38 + + + 272 + 38 + + + + + authProxyCheckBox + toggled(bool) + proxyPasswLineEdit + setEnabled(bool) + + + 272 + 38 + + + 272 + 37 + + + + + popupCheckBox + toggled(bool) + popupTemplateButton + setEnabled(bool) + + + 362 + 310 + + + 455 + 315 + + + + + mwTransparencySlider + valueChanged(int) + mwTransparencyLabel + setNum(int) + + + 252 + 90 + + + 283 + 90 + + + + + eqTransparencySlider + valueChanged(int) + eqTransparencyLabel + setNum(int) + + + 252 + 84 + + + 274 + 84 + + + + + plTransparencySlider + valueChanged(int) + plTransparencyLabel + setNum(int) + + + 252 + 78 + + + 274 + 78 + + + + + useCoverFilesCheckBox + toggled(bool) + coverIncludeLineEdit + setEnabled(bool) + + + 286 + 39 + + + 286 + 39 + + + + + useCoverFilesCheckBox + toggled(bool) + coverExcludeLineEdit + setEnabled(bool) + + + 286 + 39 + + + 286 + 39 + + + + + useCoverFilesCheckBox + toggled(bool) + coverDepthSpinBox + setEnabled(bool) + + + 286 + 39 + + + 286 + 39 + + + + + buttonBox + rejected() + ConfigDialog + reject() + + + 651 + 458 + + + 225 + 421 + + + + + buttonBox + accepted() + ConfigDialog + accept() + + + 651 + 458 + + + 141 + 414 + + + + + numbersCheckBox + toggled(bool) + alignCheckBox + setEnabled(bool) + + + 278 + 208 + + + 271 + 236 + + + + + diff --git a/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui b/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui new file mode 100644 index 000000000..7f94a2845 --- /dev/null +++ b/src/plugins/Ui/skinned/forms/jumptotrackdialog.ui @@ -0,0 +1,152 @@ + + + JumpToTrackDialog + + + + 0 + 0 + 487 + 315 + + + + Jump To Track + + + + 6 + + + 6 + + + 6 + + + + + 6 + + + 0 + + + + + Filter + + + + + + + + + + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SelectRows + + + + + + + + + + 0 + 0 + + + + Queue + + + + + + + + 0 + 0 + + + + Refresh + + + + + + + + 0 + 0 + + + + Jump To + + + + + + + Qt::Horizontal + + + QSizePolicy::MinimumExpanding + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + rejected() + JumpToTrackDialog + hide() + + + 457 + 294 + + + 481 + 279 + + + + + diff --git a/src/plugins/Ui/skinned/forms/playlistbrowser.ui b/src/plugins/Ui/skinned/forms/playlistbrowser.ui new file mode 100644 index 000000000..0f9280905 --- /dev/null +++ b/src/plugins/Ui/skinned/forms/playlistbrowser.ui @@ -0,0 +1,126 @@ + + + PlayListBrowser + + + + 0 + 0 + 402 + 298 + + + + Playlist Browser + + + + 6 + + + 9 + + + 6 + + + 6 + + + 6 + + + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + + + + + New + + + + + + + Delete + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + ... + + + true + + + + + + + ... + + + Qt::ToolButtonIconOnly + + + true + + + + + + + + + buttonBox + accepted() + PlayListBrowser + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + PlayListBrowser + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/plugins/Ui/skinned/forms/popupsettings.ui b/src/plugins/Ui/skinned/forms/popupsettings.ui new file mode 100644 index 000000000..c59db2b72 --- /dev/null +++ b/src/plugins/Ui/skinned/forms/popupsettings.ui @@ -0,0 +1,251 @@ + + + PopupSettings + + + + 0 + 0 + 277 + 335 + + + + Popup Information Settings + + + + 6 + + + 6 + + + 6 + + + + + Template + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 138 + 20 + + + + + + + + Reset + + + + + + + Insert + + + + + + + + + + Show cover + + + + + + + 0 + + + + + + + Cover size: + + + + + + + 32 + + + 128 + + + 1 + + + 16 + + + Qt::Horizontal + + + + + + + Transparency: + + + + + + + 90 + + + Qt::Horizontal + + + + + + + + 18 + 0 + + + + 0 + + + + + + + Delay: + + + + + + + 20 + + + 7000 + + + 500 + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + ms + + + + + + + + + buttonBox + accepted() + PopupSettings + accept() + + + 281 + 286 + + + 62 + 299 + + + + + buttonBox + rejected() + PopupSettings + reject() + + + 281 + 286 + + + 95 + 299 + + + + + transparencySlider + valueChanged(int) + trasparencyLabel + setNum(int) + + + 258 + 251 + + + 282 + 251 + + + + + coverSizeSlider + valueChanged(int) + coverSizeLabel + setNum(int) + + + 258 + 223 + + + 282 + 223 + + + + + diff --git a/src/plugins/Ui/skinned/forms/preseteditor.ui b/src/plugins/Ui/skinned/forms/preseteditor.ui new file mode 100644 index 000000000..224a41ed3 --- /dev/null +++ b/src/plugins/Ui/skinned/forms/preseteditor.ui @@ -0,0 +1,120 @@ + + + PresetEditor + + + + 0 + 0 + 330 + 275 + + + + Preset Editor + + + false + + + + 6 + + + 6 + + + 6 + + + + + 0 + + + + Preset + + + + 6 + + + 9 + + + + + + + + + Auto-preset + + + + 6 + + + 9 + + + + + QAbstractItemView::NoEditTriggers + + + + + + + + + + + + + Load + + + + + + + Delete + + + + + + + QDialogButtonBox::Close + + + + + + + + + qPixmapFromMimeSource + + + + buttonBox + clicked(QAbstractButton*) + PresetEditor + accept() + + + 269 + 235 + + + 298 + 192 + + + + + diff --git a/src/plugins/Ui/skinned/forms/shortcutdialog.ui b/src/plugins/Ui/skinned/forms/shortcutdialog.ui new file mode 100644 index 000000000..db1cf466e --- /dev/null +++ b/src/plugins/Ui/skinned/forms/shortcutdialog.ui @@ -0,0 +1,120 @@ + + + ShortcutDialog + + + + 0 + 0 + 310 + 89 + + + + Change Shortcut + + + + 6 + + + 6 + + + 6 + + + + + Press the key combination you want to assign + + + + + + + true + + + + + + + Clear + + + + + + + Qt::Horizontal + + + + 106 + 20 + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + HotkeyDialog + accept() + + + 212 + 70 + + + 192 + 269 + + + + + buttonBox + rejected() + HotkeyDialog + reject() + + + 212 + 70 + + + 246 + 214 + + + + + clearButton + clicked() + keyLineEdit + clear() + + + 195 + 22 + + + 113 + 25 + + + + + diff --git a/src/plugins/Ui/skinned/images/16x16/qmmp.png b/src/plugins/Ui/skinned/images/16x16/qmmp.png new file mode 100644 index 000000000..d6bca13fd Binary files /dev/null and b/src/plugins/Ui/skinned/images/16x16/qmmp.png differ diff --git a/src/plugins/Ui/skinned/images/32x32/qmmp.png b/src/plugins/Ui/skinned/images/32x32/qmmp.png new file mode 100644 index 000000000..32126f83b Binary files /dev/null and b/src/plugins/Ui/skinned/images/32x32/qmmp.png differ diff --git a/src/plugins/Ui/skinned/images/48x48/qmmp.png b/src/plugins/Ui/skinned/images/48x48/qmmp.png new file mode 100644 index 000000000..3f8a8f3a0 Binary files /dev/null and b/src/plugins/Ui/skinned/images/48x48/qmmp.png differ diff --git a/src/plugins/Ui/skinned/images/56x56/qmmp.png b/src/plugins/Ui/skinned/images/56x56/qmmp.png new file mode 100644 index 000000000..4a3b7903a Binary files /dev/null and b/src/plugins/Ui/skinned/images/56x56/qmmp.png differ diff --git a/src/plugins/Ui/skinned/images/advanced.png b/src/plugins/Ui/skinned/images/advanced.png new file mode 100644 index 000000000..862464242 Binary files /dev/null and b/src/plugins/Ui/skinned/images/advanced.png differ diff --git a/src/plugins/Ui/skinned/images/images.qrc b/src/plugins/Ui/skinned/images/images.qrc new file mode 100644 index 000000000..45909a993 --- /dev/null +++ b/src/plugins/Ui/skinned/images/images.qrc @@ -0,0 +1,14 @@ + + + 32x32/qmmp.png + interface.png + playlist.png + advanced.png + plugins.png + network.png + logo-qmmp.png + replaygain.png + ui_no_cover.png + shortcuts.png + + diff --git a/src/plugins/Ui/skinned/images/interface.png b/src/plugins/Ui/skinned/images/interface.png new file mode 100644 index 000000000..ebedddde2 Binary files /dev/null and b/src/plugins/Ui/skinned/images/interface.png differ diff --git a/src/plugins/Ui/skinned/images/logo-qmmp.png b/src/plugins/Ui/skinned/images/logo-qmmp.png new file mode 100644 index 000000000..d6c7e9bd8 Binary files /dev/null and b/src/plugins/Ui/skinned/images/logo-qmmp.png differ diff --git a/src/plugins/Ui/skinned/images/network.png b/src/plugins/Ui/skinned/images/network.png new file mode 100644 index 000000000..3a52c1130 Binary files /dev/null and b/src/plugins/Ui/skinned/images/network.png differ diff --git a/src/plugins/Ui/skinned/images/playlist.png b/src/plugins/Ui/skinned/images/playlist.png new file mode 100644 index 000000000..7b750db0a Binary files /dev/null and b/src/plugins/Ui/skinned/images/playlist.png differ diff --git a/src/plugins/Ui/skinned/images/plugins.png b/src/plugins/Ui/skinned/images/plugins.png new file mode 100644 index 000000000..931d4d1da Binary files /dev/null and b/src/plugins/Ui/skinned/images/plugins.png differ diff --git a/src/plugins/Ui/skinned/images/replaygain.png b/src/plugins/Ui/skinned/images/replaygain.png new file mode 100644 index 000000000..d2f78947b Binary files /dev/null and b/src/plugins/Ui/skinned/images/replaygain.png differ diff --git a/src/plugins/Ui/skinned/images/scalable/qmmp-simple.svgz b/src/plugins/Ui/skinned/images/scalable/qmmp-simple.svgz new file mode 100644 index 000000000..8ac48346b Binary files /dev/null and b/src/plugins/Ui/skinned/images/scalable/qmmp-simple.svgz differ diff --git a/src/plugins/Ui/skinned/images/scalable/qmmp.svgz b/src/plugins/Ui/skinned/images/scalable/qmmp.svgz new file mode 100644 index 000000000..7050b41c9 Binary files /dev/null and b/src/plugins/Ui/skinned/images/scalable/qmmp.svgz differ diff --git a/src/plugins/Ui/skinned/images/shortcuts.png b/src/plugins/Ui/skinned/images/shortcuts.png new file mode 100644 index 000000000..45d917220 Binary files /dev/null and b/src/plugins/Ui/skinned/images/shortcuts.png differ diff --git a/src/plugins/Ui/skinned/images/ui_no_cover.png b/src/plugins/Ui/skinned/images/ui_no_cover.png new file mode 100644 index 000000000..ac8c587e3 Binary files /dev/null and b/src/plugins/Ui/skinned/images/ui_no_cover.png differ diff --git a/src/plugins/Ui/skinned/inlines.h b/src/plugins/Ui/skinned/inlines.h new file mode 100644 index 000000000..39b81bd57 --- /dev/null +++ b/src/plugins/Ui/skinned/inlines.h @@ -0,0 +1,57 @@ +// Copyright (c) 2000-2001 Brad Hughes +// +// Use, modification and distribution is allowed without limitation, +// warranty, or liability of any kind. +// + +#ifndef INLINES_H +#define INLINES_H + +#include "fft.h" + +// *fast* convenience functions +static inline void calc_freq(short* dest, short *src) +{ + static fft_state *state = NULL; + float tmp_out[257]; + int i; + + if (!state) + state = fft_init(); + + fft_perform(src, tmp_out, state); + + for (i = 0; i < 256; i++) + dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; +} + +static inline void stereo16_from_multichannel(register short *l, + register short *r, + register short *s, + long cnt, int chan) +{ + while (cnt > 0) + { + l[0] = s[0]; + r[0] = s[1]; + s += chan; + l++; + r++; + cnt--; + } +} + +static inline void mono16_from_multichannel(register short *l, + register short *s, + long cnt, int chan) +{ + while (cnt > 0) + { + l[0] = s[0]; + s += chan; + l++; + cnt--; + } +} + +#endif // INLINES_H diff --git a/src/plugins/Ui/skinned/jumptotrackdialog.cpp b/src/plugins/Ui/skinned/jumptotrackdialog.cpp new file mode 100644 index 000000000..d9df0bb75 --- /dev/null +++ b/src/plugins/Ui/skinned/jumptotrackdialog.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "jumptotrackdialog.h" +#include +#include +#include +#include +#include +#include + +JumpToTrackDialog::JumpToTrackDialog(PlayListManager *manager, QWidget* parent) + : QDialog (parent) +{ + setupUi(this); + setAttribute(Qt::WA_QuitOnClose, false); + m_pl_manager = manager; + m_listModel = new QStringListModel(this); + + m_proxyModel = new QSortFilterProxyModel; + m_proxyModel->setDynamicSortFilter(true); + m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); + m_proxyModel->setSourceModel(m_listModel); + songsListView->setModel(m_proxyModel); + + connect(songsListView,SIGNAL(doubleClicked(const QModelIndex &)), + this,SLOT(jumpTo(const QModelIndex&))); + connect(songsListView,SIGNAL(activated(const QModelIndex &)), + this,SLOT(jumpTo(const QModelIndex&))); + connect(songsListView,SIGNAL(activated(const QModelIndex &)), + this,SLOT(accept())); + connect(songsListView->selectionModel(), + SIGNAL(currentRowChanged(const QModelIndex&,const QModelIndex&)), + this,SLOT(queueUnqueue(const QModelIndex&,const QModelIndex&))); + + new QShortcut(tr("Q"),this,SLOT(on_queuePushButton_clicked())); + new QShortcut(tr("J"),this,SLOT(on_jumpToPushButton_clicked())); + new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked())); + + QAction *selectSongViewAction = new QAction(filterLineEdit); + selectSongViewAction->setShortcut(Qt::Key_Down); + selectSongViewAction->setShortcutContext(Qt::WidgetShortcut); + filterLineEdit->addAction(selectSongViewAction); + connect(selectSongViewAction, SIGNAL(triggered()),songsListView, SLOT(setFocus())); + //setup icons + refreshPushButton->setIcon(QIcon::fromTheme("view-refresh")); + jumpToPushButton->setIcon(QIcon::fromTheme("go-top")); +} + +JumpToTrackDialog::~JumpToTrackDialog() +{ +} + +void JumpToTrackDialog::on_refreshPushButton_clicked() +{ + refresh(); +} + +void JumpToTrackDialog::on_queuePushButton_clicked() +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + int selected = (m_proxyModel->mapToSource(mi_list.at(0))).row(); + m_pl_manager->selectedPlayList()->setQueued(m_pl_manager->selectedPlayList()->item(selected)); + if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(selected))) + queuePushButton->setText(tr("Unqueue")); + else + queuePushButton->setText(tr("Queue")); + } +} + +void JumpToTrackDialog::on_jumpToPushButton_clicked() +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + jumpTo(mi_list.at(0)); + } +} + +void JumpToTrackDialog::refresh() +{ + filterLineEdit->clear(); + QStringList titles = m_pl_manager->selectedPlayList()->getTitles(0, m_pl_manager->selectedPlayList()->count()); + m_listModel->setStringList(titles); + filterLineEdit->setFocus(); +} + +void JumpToTrackDialog::on_filterLineEdit_textChanged(const QString &str) +{ + m_proxyModel->setFilterFixedString(str); + if (m_proxyModel->hasIndex(0,0)) + songsListView->setCurrentIndex (m_proxyModel->index (0,0)); +} + +void JumpToTrackDialog::on_filterLineEdit_returnPressed () +{ + QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); + if (!mi_list.isEmpty()) + { + jumpTo(mi_list.at(0)); + accept(); + } +} + +void JumpToTrackDialog::jumpTo(const QModelIndex & index) +{ + int selected = (m_proxyModel->mapToSource(index)).row(); + m_pl_manager->selectedPlayList()->setCurrent(selected); + emit playRequest(); +} + +void JumpToTrackDialog::queueUnqueue(const QModelIndex& curr,const QModelIndex&) +{ + int row = m_proxyModel->mapToSource(curr).row(); + if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(row))) + queuePushButton->setText(tr("Unqueue")); + else + queuePushButton->setText(tr("Queue")); +} diff --git a/src/plugins/Ui/skinned/jumptotrackdialog.h b/src/plugins/Ui/skinned/jumptotrackdialog.h new file mode 100644 index 000000000..36186d72c --- /dev/null +++ b/src/plugins/Ui/skinned/jumptotrackdialog.h @@ -0,0 +1,62 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef JUMPTOTRACKDIALOG_H +#define JUMPTOTRACKDIALOG_H + +#include +#include "ui_jumptotrackdialog.h" + +class QStringListModel; +class QSortFilterProxyModel; +class PlayListManager; + +/** + @author Vladimir Kuznetsov + */ +class JumpToTrackDialog : public QDialog, private Ui::JumpToTrackDialog +{ + Q_OBJECT + +public: + JumpToTrackDialog(PlayListManager *manager, QWidget* parent = 0); + ~JumpToTrackDialog(); + void refresh(); + +protected slots: + void on_refreshPushButton_clicked(); + void on_queuePushButton_clicked(); + void on_jumpToPushButton_clicked(); + void on_filterLineEdit_textChanged(const QString&); + void on_filterLineEdit_returnPressed (); + void jumpTo(const QModelIndex&); + void queueUnqueue(const QModelIndex&,const QModelIndex&); + +signals: + void playRequest(); + +private: + QStringListModel* m_listModel; + QSortFilterProxyModel* m_proxyModel; + PlayListManager *m_pl_manager; +}; + +#endif + diff --git a/src/plugins/Ui/skinned/keyboardmanager.cpp b/src/plugins/Ui/skinned/keyboardmanager.cpp new file mode 100644 index 000000000..cbdc70c33 --- /dev/null +++ b/src/plugins/Ui/skinned/keyboardmanager.cpp @@ -0,0 +1,280 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#include +#include +#include "playlist.h" +#include "listwidget.h" +#include "keyboardmanager.h" +#include "mainwindow.h" + + +KeyboardManager::KeyboardManager (PlayList* pl) +{ + m_playlist = pl; +} + +bool KeyboardManager::handleKeyPress (QKeyEvent* ke) +{ + bool handled = true; + switch (ke->key()) + { + case Qt::Key_Up: + keyUp (ke); + break; + case Qt::Key_Down: + keyDown (ke); + break; + case Qt::Key_PageUp: + keyPgUp (ke); + break; + case Qt::Key_PageDown: + keyPgDown (ke); + break; + case Qt::Key_Enter: + case Qt::Key_Return: + keyEnter (ke); + break; + case Qt::Key_Home: + keyHome(ke); + break; + case Qt::Key_End: + keyEnd(ke); + break; + default: + handled = false; + } + return handled; +} + +bool KeyboardManager::handleKeyRelease (QKeyEvent*) +{ + return false; +} + +void KeyboardManager::keyUp (QKeyEvent * ke) +{ + QList rows = m_playlist->listWidget()->model()->getSelectedRows(); + ListWidget* list_widget = m_playlist->listWidget(); + + if (rows.count() > 0) + { + if(rows[0] == 0 && rows.count() == 1) + return; + + if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) + { + m_playlist->listWidget()->model()->clearSelection(); + list_widget->setAnchorRow(-1); + } + + bool select_top = false; + int first_visible = list_widget->firstVisibleRow(); + int last_visible = list_widget->visibleRows() + first_visible - 1; + foreach (int i, rows) + { + if (i > last_visible || i < first_visible) + { + select_top = true; + break; + } + } + + if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) + { + if (ke->modifiers() == Qt::AltModifier) + { + m_playlist->listWidget()->model()->moveItems (rows[0],rows[0] - 1); + list_widget->setAnchorRow (list_widget->getAnchorRow() - 1); + } + else + { + if (rows.last() > list_widget->getAnchorRow() && ke->modifiers() & Qt::ShiftModifier) + { + m_playlist->listWidget()->model()->setSelected (rows.last(),false); + } + else if (rows[0] > 0) + { + m_playlist->listWidget()->model()->setSelected (rows[0] - 1,true); + } + else + { + m_playlist->listWidget()->model()->setSelected (rows[0],true); + if(list_widget->getAnchorRow() == -1) + list_widget->setAnchorRow(rows[0]); + } + + if (! (ke->modifiers() & Qt::ShiftModifier) && rows[0] > 0) + list_widget->setAnchorRow (rows[0] - 1); + } + } + else + { + m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); + list_widget->setAnchorRow(list_widget->firstVisibleRow()); + } + + rows = m_playlist->listWidget()->model()->getSelectedRows(); + + if (rows[0] < list_widget->firstVisibleRow() && list_widget->firstVisibleRow() > 0) + { + int r = rows.last() > list_widget->getAnchorRow() ? rows.last(): rows.first(); + if(ke->modifiers() & Qt::ShiftModifier && (r >= list_widget->firstVisibleRow())) + ; + else + list_widget->scroll (list_widget->firstVisibleRow() - 1); + } + } + else + { + //if(list_widget->getAnchorRow() == -1) + list_widget->setAnchorRow(list_widget->firstVisibleRow()); + m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); + } +} + +void KeyboardManager::keyDown (QKeyEvent * ke) +{ + QList rows = m_playlist->listWidget()->model()->getSelectedRows(); + ListWidget* list_widget = m_playlist->listWidget(); + //qWarning("count: %d",rows.count()); + if (rows.count() > 0) + { + if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) + { + m_playlist->listWidget()->model()->clearSelection(); + list_widget->setAnchorRow(-1); + } + + bool select_top = false; + int first_visible = list_widget->firstVisibleRow(); + int last_visible = list_widget->visibleRows() + first_visible - 1; + foreach (int i, rows) + { + if (i > last_visible || i < first_visible) + { + select_top = true; + break; + } + } + + if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) + { + if (ke->modifiers() == Qt::AltModifier) + { + m_playlist->listWidget()->model()->moveItems (rows.last(),rows.last() + 1); + list_widget->setAnchorRow (list_widget->getAnchorRow() + 1); + } + else + { + //qWarning("list_widget %d",list_widget->getAnchorRow()); + //qWarning("model count: %d rows.last(): %d",m_playlist->listWidget()->model()->count(),rows.last()); + if (rows[0] < list_widget->getAnchorRow() && ke->modifiers() & Qt::ShiftModifier) + m_playlist->listWidget()->model()->setSelected (rows[0],false); + else if (rows.last() < m_playlist->listWidget()->model()->count() - 1) + { + m_playlist->listWidget()->model()->setSelected (rows.last() + 1,true); + } + else + { + m_playlist->listWidget()->model()->setSelected (rows.last(),true); + if(list_widget->getAnchorRow() == -1) + list_widget->setAnchorRow(rows.last()); + } + + if (! (ke->modifiers() & Qt::ShiftModifier) && rows.last() < m_playlist->listWidget()->model()->count() - 1) + list_widget->setAnchorRow (rows.last() + 1); + } + } + else + { + m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); + list_widget->setAnchorRow(list_widget->firstVisibleRow()); + } + + rows = m_playlist->listWidget()->model()->getSelectedRows(); + + if (!rows.isEmpty() && rows.last() >= list_widget->visibleRows() + list_widget->firstVisibleRow()) + { + int r = rows.first() < list_widget->getAnchorRow() ? rows.first(): rows.last(); + if(ke->modifiers() & Qt::ShiftModifier && + (r < list_widget->firstVisibleRow() + list_widget->visibleRows())) + ; + else + list_widget->scroll (list_widget->firstVisibleRow() + 1); + } + } + else + { + m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); + //if(list_widget->getAnchorRow() == -1) + list_widget->setAnchorRow(list_widget->firstVisibleRow()); + } +} + +void KeyboardManager::keyPgUp (QKeyEvent *) +{ + ListWidget* list_widget = m_playlist->listWidget(); + int page_size = list_widget->visibleRows(); + int offset= (list_widget->firstVisibleRow()-page_size >= 0) ?list_widget->firstVisibleRow()-page_size:0; + list_widget->scroll (offset); +} + +void KeyboardManager::keyPgDown (QKeyEvent *) +{ + ListWidget* list_widget = m_playlist->listWidget(); + int page_size = list_widget->visibleRows(); + int offset = (list_widget->firstVisibleRow() +page_size < m_playlist->listWidget()->model()->count()) ? + list_widget->firstVisibleRow() +page_size:m_playlist->listWidget()->model()->count() - 1; + list_widget->scroll (offset); +} + +void KeyboardManager::keyEnter (QKeyEvent *) +{ + QList rows = m_playlist->listWidget()->model()->getSelectedRows(); + MainWindow* mw = qobject_cast (m_playlist->parentWidget()); + if (mw && rows.count() > 0) + { + m_playlist->listWidget()->model()->setCurrent (rows[0]); + mw->replay(); + } +} + +void KeyboardManager::keyHome(QKeyEvent *ke) +{ + ListWidget* list_widget = m_playlist->listWidget(); + m_playlist->listWidget()->scroll (0); + if(ke->modifiers() & Qt::ShiftModifier) + for(int i = 0; i <= list_widget->getAnchorRow(); ++i) + m_playlist->listWidget()->model()->setSelected (i,true); +} + +void KeyboardManager::keyEnd(QKeyEvent *ke) +{ + ListWidget* list_widget = m_playlist->listWidget(); + int page_size = list_widget->visibleRows(); + int scroll_to = m_playlist->listWidget()->model()->count() - page_size; + if(scroll_to >= 0) + list_widget->scroll(scroll_to); + if(ke->modifiers() & Qt::ShiftModifier) + for(int i = list_widget->getAnchorRow(); i < m_playlist->listWidget()->model()->count(); ++i) + m_playlist->listWidget()->model()->setSelected (i,true); +} diff --git a/src/plugins/Ui/skinned/keyboardmanager.h b/src/plugins/Ui/skinned/keyboardmanager.h new file mode 100644 index 000000000..120dbe9dc --- /dev/null +++ b/src/plugins/Ui/skinned/keyboardmanager.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef _KEYBOARDMANAGER_H +#define _KEYBOARDMANAGER_H + +class PlayList; +class QKeyEvent; + + +/*! + * Class \b KeyboardManager represents key handler object that processes + * all key events passed to the \b PlayList + * @author Vladimir Kuznetsov + */ +class KeyboardManager +{ + public: + /*! + * Constructor. Takes \b PlayList object as an argument. + */ + KeyboardManager (PlayList*); + + /*! + * Handles key press events from \b PlayList object. Returns \b true + * if the key was handled, otherwise \b false. + */ + bool handleKeyPress (QKeyEvent*); + + /*! + * Handles key release events from \b PlayList object. Returns \b true + * if the key was handled, otherwise \b false. + */ + bool handleKeyRelease (QKeyEvent*); + + protected: + void keyUp (QKeyEvent* ke); + void keyDown (QKeyEvent* ke); + void keyPgUp (QKeyEvent* ke); + void keyPgDown (QKeyEvent* ke); + void keyEnter (QKeyEvent* ke); + void keyHome(QKeyEvent* ke); + void keyEnd(QKeyEvent* ke); + private: + PlayList* m_playlist; +}; + +#endif + diff --git a/src/plugins/Ui/skinned/listwidget.cpp b/src/plugins/Ui/skinned/listwidget.cpp new file mode 100644 index 000000000..fe261c24a --- /dev/null +++ b/src/plugins/Ui/skinned/listwidget.cpp @@ -0,0 +1,569 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "listwidget.h" +#include "skin.h" +#include "popupwidget.h" +#include "playlist.h" + +#define INVALID_ROW -1 + +ListWidget::ListWidget(QWidget *parent) + : QWidget(parent) +{ + m_update = false; + m_skin = Skin::instance(); + m_popupWidget = 0; + m_metrics = 0; + m_extra_metrics = 0; + loadColors(); + m_menu = new QMenu(this); + m_scroll_direction = NONE; + m_prev_y = 0; + m_anchor_row = INVALID_ROW; + m_player = MediaPlayer::instance(); + connect (m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateList())); + m_first = 0; + m_rows = 0; + m_scroll = false; + m_select_on_release = false; + readSettings(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setAcceptDrops(true); + setMouseTracking(true); + m_timer = new QTimer(this); + m_timer->setInterval(50); + connect(m_timer, SIGNAL(timeout()), SLOT(autoscroll())); +} + + +ListWidget::~ListWidget() +{ + if(m_metrics) + delete m_metrics; + if(m_extra_metrics) + delete m_extra_metrics; +} + +void ListWidget::readSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); + m_extra_font = m_font; + m_extra_font.setPointSize(m_font.pointSize() - 1); + m_show_protocol = settings.value ("PlayList/show_protocol", false).toBool(); + m_show_number = settings.value ("PlayList/show_numbers", true).toBool(); + m_align_numbres = settings.value ("PlayList/align_numbers", false).toBool(); + m_show_anchor = settings.value("PlayList/show_anchor", false).toBool(); + bool show_popup = settings.value("PlayList/show_popup", false).toBool(); + + if (m_update) + { + delete m_metrics; + delete m_extra_metrics; + m_metrics = new QFontMetrics(m_font); + m_extra_metrics = new QFontMetrics(m_extra_font); + m_rows = height() / (m_metrics->lineSpacing() + 2); + updateList(); + if(m_popupWidget) + { + m_popupWidget->deleteLater(); + m_popupWidget = 0; + } + } + else + { + m_update = true; + m_metrics = new QFontMetrics(m_font); + m_extra_metrics = new QFontMetrics(m_extra_font); + } + if(show_popup) + m_popupWidget = new PlayListPopup::PopupWidget(this); +} + +void ListWidget::loadColors() +{ + m_normal.setNamedColor(m_skin->getPLValue("normal")); + m_current.setNamedColor(m_skin->getPLValue("current")); + m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); + m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); +} + +void ListWidget::paintEvent(QPaintEvent *) +{ + QPainter m_painter(this); + m_painter.setFont(m_font); + m_painter.setBrush(QBrush(m_normal_bg)); + m_painter.drawRect(-1,-1,width()+1,height()+1); + int font_y = 0; + + for (int i = 0; i < m_titles.size(); ++i ) + { + if (m_show_anchor && i == m_anchor_row - m_first) + { + m_painter.setBrush(m_model->isSelected(i + m_first) ? m_selected_bg : m_normal_bg); + m_painter.setPen(m_normal); + m_painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), + width() - 10, m_metrics->lineSpacing() + 1); + } + else + { + if (m_model->isSelected(i + m_first)) + { + m_painter.setBrush(QBrush(m_selected_bg)); + m_painter.setPen(m_selected_bg); + m_painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), + width() - 10, m_metrics->lineSpacing() + 1); + } + } + + if (m_model->currentRow() == i + m_first) + m_painter.setPen(m_current); + else + m_painter.setPen(m_normal); //243,58 + + font_y = (i + 1) * (2 + m_metrics->lineSpacing()) - 2 - m_metrics->descent(); + + + + if(m_number_width) + { + QString number = QString("%1").arg(m_first+i+1); + m_painter.drawText(10 + m_number_width - m_extra_metrics->width(number), + font_y, number); + m_painter.drawText(10 + m_number_width + m_metrics->width("9"), font_y, m_titles.at(i)); + } + else + m_painter.drawText(10, font_y, m_titles.at(i)); + + + QString extra_string = getExtraString(m_first + i); + if(!extra_string.isEmpty()) + { + m_painter.setFont(m_extra_font); + + if(m_times.at(i).isEmpty()) + m_painter.drawText(width() - 7 - m_extra_metrics->width(extra_string), + font_y, extra_string); + else + m_painter.drawText(width() - 10 - m_extra_metrics->width(extra_string) - + m_metrics->width(m_times.at(i)), font_y, extra_string); + m_painter.setFont(m_font); + } + m_painter.drawText(width() - 7 - m_metrics->width(m_times.at(i)), font_y, m_times.at(i)); + } + //draw line + if(m_number_width) + { + m_painter.setPen(m_normal); + m_painter.drawLine(10 + m_number_width + m_metrics->width("9") / 2, 2, + 10 + m_number_width + m_metrics->width("9") / 2, font_y); + } +} + +void ListWidget::mouseDoubleClickEvent (QMouseEvent *e) +{ + int y = e->y(); + int row = rowAt(y); + if (INVALID_ROW != row) + { + m_model->setCurrent(row); + emit selectionChanged(); + update(); + } +} + + +void ListWidget::mousePressEvent(QMouseEvent *e) +{ + if(m_popupWidget) + m_popupWidget->hide(); + m_scroll = true; + int y = e->y(); + int row = rowAt(y); + + if (INVALID_ROW != row && m_model->count() > row) + { + m_pressed_row = row; + if(e->button() == Qt::RightButton && !m_model->isSelected(row)) + { + m_model->clearSelection(); + m_model->setSelected(row, true); + m_anchor_row = m_pressed_row; + QWidget::mousePressEvent(e); + return; + } + + if (m_model->isSelected(row) && (e->modifiers() == Qt::NoModifier)) + { + m_select_on_release = true; + QWidget::mousePressEvent(e); + return; + } + + if ((Qt::ShiftModifier & e->modifiers())) + { + bool select = true; + if (m_pressed_row > m_anchor_row) + { + for (int j = m_anchor_row;j <= m_pressed_row;j++) + { + m_model->setSelected(j, select); + } + } + else + { + for (int j = m_anchor_row;j >= m_pressed_row;j--) + { + m_model->setSelected(j, select); + } + } + m_anchor_row = m_pressed_row; + } + else //ShiftModifier released + { + if ((Qt::ControlModifier & e->modifiers())) + { + m_model->setSelected(row, !m_model->isSelected(row)); + } + else //ControlModifier released + { + m_model->clearSelection(); + m_model->setSelected(row, true); + } + m_anchor_row = m_pressed_row; + } + update(); + } + QWidget::mousePressEvent(e); +} + +void ListWidget::resizeEvent(QResizeEvent *e) +{ + m_rows = e->size().height() / (m_metrics->lineSpacing() + 2); + m_scroll = true; + updateList(); + QWidget::resizeEvent(e); +} + +void ListWidget::wheelEvent (QWheelEvent *e) +{ + if (m_model->count() <= m_rows) + return; + if ((m_first == 0 && e->delta() > 0) || + ((m_first == m_model->count() - m_rows) && e->delta() < 0)) + return; + m_first -= e->delta()/40; //40*3 TODO: add step to config + if (m_first < 0) + m_first = 0; + + if (m_first > m_model->count() - m_rows) + m_first = m_model->count() - m_rows; + + m_scroll = false; + updateList(); +} + +bool ListWidget::event (QEvent *e) +{ + if(m_popupWidget) + { + if(e->type() == QEvent::ToolTip) + { + QHelpEvent *helpEvent = (QHelpEvent *) e; + int row = rowAt(helpEvent->y()); + if(row < 0) + { + m_popupWidget->deactivate(); + return QWidget::event(e); + } + e->accept(); + m_popupWidget->prepare(m_model->item(row), helpEvent->globalPos()); + return true; + } + else if(e->type() == QEvent::Leave) + m_popupWidget->deactivate(); + } + return QWidget::event(e); +} + +void ListWidget::updateList() +{ + if (m_model->count() < (m_rows+m_first+1) && m_rows< m_model->count()) + { + m_first = m_model->count() - m_rows; + } + if (m_model->count() < m_rows + 1) + { + m_first = 0; + emit positionChanged(0,0); + } + else + emit positionChanged(m_first, m_model->count() - m_rows); + if (m_model->count() <= m_first) + { + m_first = 0; + emit positionChanged(0, qMax(0, m_model->count() - m_rows)); + } + + m_titles = m_model->getTitles(m_first, m_rows); + m_times = m_model->getTimes(m_first, m_rows); + m_scroll = false; + //add numbers + for (int i = 0; i < m_titles.size() && m_show_number && !m_align_numbres; ++i) + { + QString title = m_titles.at(i); + m_titles.replace(i, title.prepend(QString("%1").arg(m_first+i+1)+". ")); + + } + //song numbers width + if(m_show_number && m_align_numbres && m_model->count()) + { + m_number_width = m_metrics->width("9") * QString::number(m_model->count()).size(); + } + else + m_number_width = 0; + + //elide title + QString extra_string; + for (int i=0; iwidth(extra_string); + if(m_number_width) + extra_string_space += m_number_width + m_metrics->width("9"); + m_titles.replace(i, m_metrics->elidedText (m_titles.at(i), Qt::ElideRight, + width() - m_metrics->width(m_times.at(i)) - 22 - extra_string_space)); + } + + update(); +} + +void ListWidget::autoscroll() +{ + SimpleSelection sel = m_model->getSelection(m_pressed_row); + if ((sel.m_top == 0 && m_scroll_direction == TOP && sel.count() > 1) || + (sel.m_bottom == m_model->count() - 1 && m_scroll_direction == DOWN && sel.count() > 1)) + return; + + if(m_scroll_direction == DOWN) + { + int row = m_first + m_rows; + (m_first + m_rows < m_model->count()) ? m_first ++ : m_first; + m_model->moveItems(m_pressed_row,row); + m_pressed_row = row; + } + else if(m_scroll_direction == TOP && m_first > 0) + { + m_first --; + m_model->moveItems(m_pressed_row, m_first); + m_pressed_row = m_first; + } +} + +void ListWidget::setModel(PlayListModel *selected, PlayListModel *previous) +{ + if(previous) + disconnect(previous, 0, this, 0); //disconnect previous model + qApp->processEvents(); + m_model = selected; + m_first = 0; + m_scroll = false; + recenterCurrent(); + updateList(); + connect (m_model, SIGNAL(currentChanged()), SLOT(recenterCurrent())); + connect (m_model, SIGNAL(listChanged()), SLOT(updateList())); +} + +void ListWidget::scroll(int sc) +{ + if (m_model->count() <= m_rows) + return; + m_first = sc; //*(m_model->count() - m_rows)/99; + m_scroll = true; + updateList(); +} + +void ListWidget::updateSkin() +{ + loadColors(); + update(); +} + +void ListWidget::dragEnterEvent(QDragEnterEvent *event) +{ + if (event->mimeData()->hasFormat("text/uri-list")) + event->acceptProposedAction(); +} + + +void ListWidget::dropEvent(QDropEvent *event) +{ + if (event->mimeData()->hasUrls()) + { + QList list_urls = event->mimeData()->urls(); + event->acceptProposedAction(); + QApplication::restoreOverrideCursor(); + + foreach(QUrl u,list_urls) + { + QString add_string = u.toString(QUrl::RemoveScheme); + if (!add_string.isEmpty()) + processFileInfo(QFileInfo(add_string)); + } + } +} + +void ListWidget::processFileInfo(const QFileInfo& info) +{ + m_model->add(info.absoluteFilePath()); +} + +const QString ListWidget::getExtraString(int i) +{ + QString extra_string; + + if (m_show_protocol && m_model->item(i)->url().contains("://")) + extra_string = "[" + m_model->item(i)->url().split("://").at(0) + "]"; + + if (m_model->isQueued(m_model->item(i))) + { + int index = m_model->queuedIndex(m_model->item(i)); + extra_string += "|"+QString::number(index + 1)+"|"; + } + + if(m_model->currentRow() == i && m_player->isRepeatable()) + extra_string += "|R|"; + else if(m_model->isStopAfter(m_model->item(i))) + extra_string += "|S|"; + + extra_string = extra_string.trimmed(); //remove white space + if(!extra_string.isEmpty()) + extra_string.prepend(" "); + return extra_string; +} + +void ListWidget::mouseMoveEvent(QMouseEvent *e) +{ + if(e->buttons() == Qt::LeftButton) + { + m_scroll = true; + if (m_prev_y > e->y()) + m_scroll_direction = TOP; + else if (m_prev_y < e->y()) + m_scroll_direction = DOWN; + else + m_scroll_direction = NONE; + + if(e->y() < 0 || e->y() > height()) + { + if(!m_timer->isActive()) + m_timer->start(); + return; + } + m_timer->stop(); + + int row = rowAt(e->y()); + + if (INVALID_ROW != row) + { + SimpleSelection sel = m_model->getSelection(m_pressed_row); + if(sel.count() > 1 && m_scroll_direction == TOP) + { + if(sel.m_top == 0 || sel.m_top == m_first) + return; + } + else if(sel.count() > 1 && m_scroll_direction == DOWN) + { + if(sel.m_bottom == m_model->count() - 1 || sel.m_bottom == m_first + m_rows) + return; + } + m_model->moveItems(m_pressed_row,row); + + m_prev_y = e->y(); + m_scroll = false; + m_pressed_row = row; + m_anchor_row = row; + } + } + else if(m_popupWidget) + { + int row = rowAt(e->y()); + if(row < 0 || m_popupWidget->item() != m_model->item(row)) + m_popupWidget->deactivate(); + } +} + +void ListWidget::mouseReleaseEvent(QMouseEvent *e) +{ + if (m_select_on_release) + { + m_model->clearSelection(); + m_model->setSelected(m_pressed_row,true); + m_anchor_row = m_pressed_row; + m_select_on_release = false; + } + m_pressed_row = INVALID_ROW; + m_scroll_direction = NONE; + m_timer->stop(); + m_scroll = false; + QWidget::mouseReleaseEvent(e); +} + +int ListWidget::rowAt(int y) const +{ + for (int i = 0; i < qMin(m_rows, m_model->count() - m_first); ++i) + { + if ((y >= i * (m_metrics->lineSpacing() + 2)) && (y <= (i+1) * (m_metrics->lineSpacing() + 2))) + return m_first + i; + } + return INVALID_ROW; +} + +void ListWidget::contextMenuEvent(QContextMenuEvent * event) +{ + if (menu()) + menu()->exec(event->globalPos()); +} + +void ListWidget::recenterCurrent() +{ + if (!m_scroll && m_rows) + { + if (m_first + m_rows < m_model->currentRow() + 1) + m_first = qMin(m_model->count() - m_rows, + m_model->currentRow() - m_rows/2); + else if (m_first > m_model->currentRow()) + m_first = qMax (m_model->currentRow() - m_rows/2, 0); + } +} diff --git a/src/plugins/Ui/skinned/listwidget.h b/src/plugins/Ui/skinned/listwidget.h new file mode 100644 index 000000000..7e901d34f --- /dev/null +++ b/src/plugins/Ui/skinned/listwidget.h @@ -0,0 +1,165 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef LISTWIDGET_H +#define LISTWIDGET_H + +#include +#include +#include +#include + +class QFont; +class QFontMetrics; +class QMenu; +class QAction; +class QTimer; +class PlayList; +class PlayListModel; +class Skin; +class PlayListItem; +class MediaPlayer; +namespace PlayListPopup{ +class PopupWidget; +} + +/** + @author Ilya Kotov +*/ +class ListWidget : public QWidget +{ + Q_OBJECT +public: + ListWidget(QWidget *parent = 0); + + ~ListWidget(); + + void readSettings(); + /*! + * Returns count of currently visible rows. + */ + int visibleRows()const + { + return m_rows; + } + + /*! + * Returns number of first visible row. + */ + int firstVisibleRow()const + { + return m_first; + } + + int getAnchorRow()const + { + return m_anchor_row; + } + + void setAnchorRow(int r) + { + m_anchor_row = r; + } + + QMenu *menu() + { + return m_menu; + } + + PlayListModel *model() + { + Q_ASSERT(!m_model); + return m_model; + } + + +public slots: + void updateList(); + void scroll(int); //0-99 + void recenterCurrent(); + void setModel(PlayListModel *selected, PlayListModel *previous = 0); + + +signals: + void selectionChanged(); + void positionChanged(int, int); //current position, maximum value + +protected: + void paintEvent(QPaintEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void resizeEvent(QResizeEvent *); + void wheelEvent(QWheelEvent *); + int rowAt(int)const; + void dragEnterEvent(QDragEnterEvent *event); + void dropEvent(QDropEvent *event); + void contextMenuEvent (QContextMenuEvent * event); + bool event (QEvent *e); + +private slots: + void updateSkin(); + void autoscroll(); + +private: + void loadColors(); + void processFileInfo(const QFileInfo&); + bool m_update; + bool m_scroll; + int m_pressed_row; + QMenu *m_menu; + PlayListModel *m_model; + /*! + * Returns string with queue number or(and) repeate flag for the item number \b i. + */ + const QString getExtraString(int i); + int m_rows, m_first; + QList m_titles; + QList m_times; + PlayList *m_pl; + QFont m_font, m_extra_font; + QFontMetrics *m_metrics; + QFontMetrics *m_extra_metrics; + Skin *m_skin; + QColor m_normal, m_current, m_normal_bg, m_selected_bg; + int m_anchor_row; + + enum ScrollDirection + { + NONE = 0,TOP,DOWN + }; + + /*! + * Scroll direction that is preforming in current moment. + */ + ScrollDirection m_scroll_direction; + int m_prev_y; + bool m_select_on_release; + bool m_show_protocol; + bool m_show_number; + bool m_show_anchor; + bool m_align_numbres; + int m_number_width; + MediaPlayer *m_player; + PlayListPopup::PopupWidget *m_popupWidget; + QTimer *m_timer; +}; + +#endif diff --git a/src/plugins/Ui/skinned/lxdesupport.cpp b/src/plugins/Ui/skinned/lxdesupport.cpp new file mode 100644 index 000000000..827cbd60c --- /dev/null +++ b/src/plugins/Ui/skinned/lxdesupport.cpp @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include "lxdesupport.h" + +void LXDESupport::load() +{ + if(qgetenv("XDG_CURRENT_DESKTOP") != "LXDE") + return; + + QString conf_path = qgetenv("XDG_CONFIG_HOME"); + if(conf_path.isEmpty()) + conf_path = QDir::homePath() + "/.config"; + conf_path.append("/lxsession/LXDE/desktop.conf"); + + QSettings lxde_settings(conf_path, QSettings::IniFormat); + QString themeName = lxde_settings.value("GTK/sNet/IconThemeName").toString(); + if(!themeName.isEmpty()) + QIcon::setThemeName(themeName); +} diff --git a/src/plugins/Ui/skinned/lxdesupport.h b/src/plugins/Ui/skinned/lxdesupport.h new file mode 100644 index 000000000..99f0aac62 --- /dev/null +++ b/src/plugins/Ui/skinned/lxdesupport.h @@ -0,0 +1,33 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef LXDESUPPORT_H +#define LXDESUPPORT_H + +/** + @author Ilya Kotov +*/ +class LXDESupport +{ +public: + static void load(); +}; + +#endif // LXDESUPPORT_H diff --git a/src/plugins/Ui/skinned/mainvisual.cpp b/src/plugins/Ui/skinned/mainvisual.cpp new file mode 100644 index 000000000..222878e36 --- /dev/null +++ b/src/plugins/Ui/skinned/mainvisual.cpp @@ -0,0 +1,613 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "skin.h" +#include "fft.h" +#include "inlines.h" +#include "mainvisual.h" + +#define VISUAL_NODE_SIZE 512 //samples +#define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) + + +MainVisual *MainVisual::m_instance = 0; + +MainVisual *MainVisual::instance() +{ + if (!m_instance) + qFatal ("MainVisual: this object is not created!"); + return m_instance; +} + +MainVisual::MainVisual (QWidget *parent) + : Visual (parent), m_vis (0), m_playing (false) +{ + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSettings())); + m_timer = new QTimer (this); + connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); + createMenu(); + readSettings(); + m_left_buffer = new short[VISUAL_BUFFER_SIZE]; + m_buffer_at = 0; + m_instance = this; +} + +MainVisual::~MainVisual() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + if (m_vis) + { + settings.setValue("Visualization/type",m_vis->name()); + delete m_vis; + m_vis = 0; + } + else + settings.setValue("Visualization/type", "None"); + settings.setValue("Visualization/rate", 1000/m_timer->interval()); + delete [] m_left_buffer; + m_instance = 0; +} + +void MainVisual::setVisual (VisualBase *newvis) +{ + m_timer->stop(); + if (m_vis) + delete m_vis; + m_vis = newvis; + if (m_vis) + m_timer->start(); + else + { + m_pixmap.fill (Qt::transparent); + update(); + } +} + +void MainVisual::clear() +{ + m_buffer_at = 0; + if (m_vis) + m_vis->clear(); + m_pixmap = m_bg; + update(); +} + +void MainVisual::add (unsigned char *data, qint64 size, int chan) +{ + if (!m_timer->isActive () || !m_vis) + return; + + if(VISUAL_BUFFER_SIZE == m_buffer_at) + { + m_buffer_at -= VISUAL_NODE_SIZE; + memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + return; + } + + int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); + + if (chan >= 2) + { + mono16_from_multichannel(m_left_buffer + m_buffer_at, (short *) data, frames, chan); + } + else + { + memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); + } + + m_buffer_at += frames; +} + +void MainVisual::timeout() +{ + mutex()->lock (); + + if(m_buffer_at < VISUAL_NODE_SIZE) + { + mutex()->unlock (); + return; + } + + if (m_vis) + { + m_vis->process (m_left_buffer); + m_buffer_at -= VISUAL_NODE_SIZE; + memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + m_pixmap = m_bg; + QPainter p(&m_pixmap); + m_vis->draw (&p); + } + mutex()->unlock (); + update(); +} + +void MainVisual::paintEvent (QPaintEvent *) +{ + QPainter painter (this); + painter.drawPixmap (0,0, m_pixmap); +} + +void MainVisual::hideEvent (QHideEvent *) +{ + m_timer->stop(); +} + +void MainVisual::showEvent (QShowEvent *) +{ + if (m_vis) + m_timer->start(); +} + +void MainVisual::mousePressEvent (QMouseEvent *e) +{ + if (e->button() == Qt::RightButton) + m_menu->exec(e->globalPos()); + else + { + m_pixmap = m_bg; + if (!m_vis) + setVisual(new mainvisual::Analyzer); + else if (m_vis->name() == "Analyzer") + setVisual(new mainvisual::Scope); + else if (m_vis->name() == "Scope") + setVisual(0); + + QString str = "Off"; + if (m_vis) + str = m_vis->name(); + foreach(QAction *act, m_visModeGroup->actions ()) + if (str == act->data().toString()) + { + act->setChecked(true); + break; + } + } +} + +void MainVisual::drawBackGround() +{ + m_bg = QPixmap (76 * m_ratio, 16 * m_ratio); + if (m_transparentAction->isChecked()) + { + m_bg.fill (Qt::transparent); + return; + } + QPainter painter(&m_bg); + for (int x = 0; x < 76 * m_ratio; x += 2) + { + painter.setPen(m_skin->getVisColor(0)); + painter.drawLine(x + 1, 0, x + 1, 16 *m_ratio); + for (int y = 0; y < 16 *m_ratio; y += 2) + { + painter.setPen(m_skin->getVisColor(0)); + painter.drawPoint(x,y); + painter.setPen(m_skin->getVisColor(1)); + painter.drawPoint(x,y + 1); + } + } +} + +void MainVisual::updateSettings() +{ + m_ratio = m_skin->ratio(); + resize(76 * m_ratio, 16 * m_ratio); + m_pixmap = QPixmap (76 * m_ratio, 16 * m_ratio); + drawBackGround(); + m_pixmap = m_bg; + update(); + QAction *act = m_fpsGroup->checkedAction (); + if (act) + m_timer->setInterval (1000/act->data().toInt()); + else + m_timer->setInterval (40); + + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + act = m_peaksFalloffGroup->checkedAction (); + if (act) + settings.setValue("Visualization/peaks_falloff", act->data().toInt()); + else + settings.setValue("Visualization/peaks_falloff", 3); + + act = m_analyzerFalloffGroup->checkedAction (); + if (act) + settings.setValue("Visualization/analyzer_falloff", act->data().toInt()); + else + settings.setValue("Visualization/analyzer_falloff", 3); + + settings.setValue("Visualization/show_peaks", m_peaksAction->isChecked()); + + act = m_analyzerModeGroup->checkedAction(); + if (act) + settings.setValue("Visualization/analyzer_mode", act->data().toInt()); + else + settings.setValue("Visualization/analyzer_mode", 0); + + act = m_analyzerTypeGroup->checkedAction(); + if (act) + settings.setValue("Visualization/analyzer_type", act->data().toInt()); + else + settings.setValue("Visualization/analyzer_type", 1); + + settings.setValue("Visualization/transparent_bg", m_transparentAction->isChecked()); + + act = m_visModeGroup->checkedAction (); + QString visName; + if (act) + visName = act->data().toString(); + else + visName == "Off"; + + if (visName == "Analyzer") + setVisual(new mainvisual::Analyzer); + else if (visName == "Scope") + setVisual(new mainvisual::Scope); + else + setVisual(0); + +} + +void MainVisual::createMenu() +{ + m_menu = new QMenu (this); + connect(m_menu, SIGNAL(triggered (QAction *)),SLOT(updateSettings())); + QMenu *visMode = m_menu->addMenu(tr("Visualization Mode")); + m_visModeGroup = new QActionGroup(this); + m_visModeGroup->setExclusive(true); + m_visModeGroup->addAction(tr("Analyzer"))->setData("Analyzer"); + m_visModeGroup->addAction(tr("Scope"))->setData("Scope"); + m_visModeGroup->addAction(tr("Off"))->setData("None"); + foreach(QAction *act, m_visModeGroup->actions ()) + { + act->setCheckable(true); + visMode->addAction(act); + } + + QMenu *analyzerMode = m_menu->addMenu(tr("Analyzer Mode")); + m_analyzerModeGroup = new QActionGroup(this); + m_analyzerTypeGroup = new QActionGroup(this); + m_analyzerModeGroup->addAction(tr("Normal"))->setData(0); + m_analyzerModeGroup->addAction(tr("Fire"))->setData(1); + m_analyzerModeGroup->addAction(tr("Vertical Lines"))->setData(2); + m_analyzerTypeGroup->addAction(tr("Lines"))->setData(0); + m_analyzerTypeGroup->addAction(tr("Bars"))->setData(1); + foreach(QAction *act, m_analyzerModeGroup->actions ()) + { + act->setCheckable(true); + analyzerMode->addAction(act); + } + analyzerMode->addSeparator (); + foreach(QAction *act, m_analyzerTypeGroup->actions ()) + { + act->setCheckable(true); + analyzerMode->addAction(act); + } + analyzerMode->addSeparator (); + m_peaksAction = analyzerMode->addAction(tr("Peaks")); + m_peaksAction->setCheckable(true); + + + QMenu *refreshRate = m_menu->addMenu(tr("Refresh Rate")); + m_fpsGroup = new QActionGroup(this); + m_fpsGroup->setExclusive(true); + m_fpsGroup->addAction(tr("50 fps"))->setData(50); + m_fpsGroup->addAction(tr("25 fps"))->setData(25); + m_fpsGroup->addAction(tr("10 fps"))->setData(10); + m_fpsGroup->addAction(tr("5 fps"))->setData(5); + foreach(QAction *act, m_fpsGroup->actions ()) + { + act->setCheckable(true); + refreshRate->addAction(act); + } + + QMenu *analyzerFalloff = m_menu->addMenu(tr("Analyzer Falloff")); + m_analyzerFalloffGroup = new QActionGroup(this); + m_analyzerFalloffGroup->setExclusive(true); + m_analyzerFalloffGroup->addAction(tr("Slowest"))->setData(1); + m_analyzerFalloffGroup->addAction(tr("Slow"))->setData(2); + m_analyzerFalloffGroup->addAction(tr("Medium"))->setData(3); + m_analyzerFalloffGroup->addAction(tr("Fast"))->setData(4); + m_analyzerFalloffGroup->addAction(tr("Fastest"))->setData(5); + foreach(QAction *act, m_analyzerFalloffGroup->actions ()) + { + act->setCheckable(true); + analyzerFalloff->addAction(act); + } + + QMenu *peaksFalloff = m_menu->addMenu(tr("Peaks Falloff")); + m_peaksFalloffGroup = new QActionGroup(this); + m_peaksFalloffGroup->setExclusive(true); + m_peaksFalloffGroup->addAction(tr("Slowest"))->setData(1); + m_peaksFalloffGroup->addAction(tr("Slow"))->setData(2); + m_peaksFalloffGroup->addAction(tr("Medium"))->setData(3); + m_peaksFalloffGroup->addAction(tr("Fast"))->setData(4); + m_peaksFalloffGroup->addAction(tr("Fastest"))->setData(5); + foreach(QAction *act, m_peaksFalloffGroup->actions ()) + { + act->setCheckable(true); + peaksFalloff->addAction(act); + } + QMenu *background = m_menu->addMenu(tr("Background")); + m_transparentAction = background->addAction(tr("Transparent")); + m_transparentAction->setCheckable(true); + update(); +} + + +void MainVisual::readSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + + QString name = settings.value("Visualization/type","Analyzer").toString(); + m_visModeGroup->actions ()[0]->setChecked(true); + foreach(QAction *act, m_visModeGroup->actions ()) + if (name == act->data().toString()) + act->setChecked(true); + + m_peaksAction->setChecked( + settings.value("Visualization/show_peaks", true).toBool()); + + int fps = settings.value("Visualization/rate", 25).toInt(); + m_fpsGroup->actions ()[1]->setChecked(true); + foreach(QAction *act, m_fpsGroup->actions ()) + if (fps == act->data().toInt()) + act->setChecked(true); + + int mode = settings.value("Visualization/analyzer_mode", 0).toInt(); + m_analyzerModeGroup->actions ()[0]->setChecked(true); + foreach(QAction *act, m_analyzerModeGroup->actions ()) + if (mode == act->data().toInt()) + act->setChecked(true); + + int type = settings.value("Visualization/analyzer_type", 1).toInt(); + m_analyzerTypeGroup->actions ()[1]->setChecked(true); + foreach(QAction *act, m_analyzerTypeGroup->actions ()) + if (type == act->data().toInt()) + act->setChecked(true); + + int speed = settings.value("Visualization/peaks_falloff", 3).toInt(); + m_peaksFalloffGroup->actions ()[2]->setChecked(true); + foreach(QAction *act, m_peaksFalloffGroup->actions ()) + if (speed == act->data().toInt()) + act->setChecked(true); + + speed = settings.value("Visualization/analyzer_falloff", 3).toInt(); + m_analyzerFalloffGroup->actions ()[2]->setChecked(true); + foreach(QAction *act, m_analyzerFalloffGroup->actions ()) + if (speed == act->data().toInt()) + act->setChecked(true); + + m_transparentAction->setChecked( + settings.value("Visualization/transparent_bg", false).toBool()); + + updateSettings(); +} + +using namespace mainvisual; + +Analyzer::Analyzer() + : m_analyzerBarWidth (4), m_fps (20) +{ + clear(); + m_skin = Skin::instance(); + m_size = QSize(76*m_skin->ratio(), 16*m_skin->ratio()); + + double peaks_speed[] = { 0.05, 0.1, 0.2, 0.4, 0.8 }; + double analyzer_speed[] = { 1.2, 1.8, 2.2, 2.8, 2.4 }; + + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_peaks_falloff = + peaks_speed[settings.value("Visualization/peaks_falloff", 3).toInt()-1]; + m_analyzer_falloff = + analyzer_speed[settings.value("Visualization/analyzer_falloff", 3).toInt()-1]; + m_show_peaks = settings.value("Visualization/show_peaks", true).toBool(); + + m_lines = settings.value("Visualization/analyzer_type", 1).toInt() == 0; + m_mode = settings.value("Visualization/analyzer_mode", 0).toInt(); +} + +Analyzer::~Analyzer() +{} + +void Analyzer::clear() +{ + for (int i = 0; i< 75; ++i) + { + m_intern_vis_data[i] = 0; + m_peaks[i] = 0; + } +} + +bool Analyzer::process (short *l) +{ + static fft_state *state = 0; + if (!state) + state = fft_init(); + short dest[256]; + + static const int xscale_long[] = + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 61, 66, 71, 76, 81, 87, 93, 100, 107, + 114, 122, 131, 140, 150, 161, 172, 184, 255 + }; + + static const int xscale_short[] = + { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 20, 27, + 36, 47, 62, 82, 107, 141, 184, 255 + }; + + calc_freq (dest, l); + + const double y_scale = 3.60673760222; /* 20.0 / log(256) */ + int max = m_lines ? 75 : 19, y, j; + + for (int i = 0; i < max; i++) + { + if (m_lines) + for (j = xscale_long[i], y = 0; j < xscale_long[i + 1]; j++) + { + if (dest[j] > y) + y = dest[j]; + } + else + for (j = xscale_short[i], y = 0; j < xscale_short[i + 1]; j++) + { + if (dest[j] > y) + y = dest[j]; + } + y >>= 7; + int magnitude = 0; + if (y != 0) + { + magnitude = int(log (y) * y_scale); + if (magnitude > 15) + magnitude = 15; + if (magnitude < 0) + magnitude = 0; + } + + m_intern_vis_data[i] -= m_analyzer_falloff; + m_intern_vis_data[i] = magnitude > m_intern_vis_data[i] + ? magnitude : m_intern_vis_data[i]; + if (m_show_peaks) + { + m_peaks[i] -= m_peaks_falloff; + m_peaks[i] = magnitude > m_peaks[i] + ? magnitude : m_peaks[i]; + } + } + return true; +} + +void Analyzer::draw (QPainter *p) +{ + int r = m_skin->ratio(); + if (m_lines) + for (int j = 0; j < 75; ++j) + { + for (int i = 0; i <= m_intern_vis_data[j]; ++i) + { + if (m_mode == 0) + p->setPen (m_skin->getVisColor (18-i)); + else if (m_mode == 1) + p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); + else + p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); + p->drawPoint (j*r, m_size.height() - r*i); + if(r == 2) + p->drawPoint (j*r+1, m_size.height() - r*i); + } + p->setPen (m_skin->getVisColor (23)); + if (m_show_peaks) + { + p->drawPoint (j*r, m_size.height() - r*m_peaks[j]); + if(r == 2) + p->drawPoint (j*r+1, m_size.height() - r*m_peaks[j]); + } + } + else + for (int j = 0; j < 19; ++j) + { + for (int i = 0; i <= m_intern_vis_data[j]; ++i) + { + if (m_mode == 0) + p->setPen (m_skin->getVisColor (18-i)); + else if (m_mode == 1) + p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); + else + p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); + + p->drawLine (j*4*r,m_size.height()-r*i, (j*4+2)*r,m_size.height()-r*i); + if(r == 2) + p->drawLine (j*4*r, m_size.height()-r*i +1, (j*4+2)*r,m_size.height()-r*i+1); + } + p->setPen (m_skin->getVisColor (23)); + if (m_show_peaks) + { + p->drawLine (j*4*r,m_size.height()-r*m_peaks[j], + (j*4+2)*r,m_size.height()-r*m_peaks[j]); + if(r == 2) + p->drawLine (j*4*r,m_size.height()-r*m_peaks[j]+1, + (j*4+2)*r,m_size.height()-r*m_peaks[j]+1); + } + } +} + +Scope::Scope() +{ + clear(); + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); +} + +void Scope::clear() +{ + for (int i = 0; i< 76; ++i) + m_intern_vis_data[i] = 5; +} + +Scope::~Scope() +{} + +bool Scope::process(short *l) +{ + int step = (VISUAL_NODE_SIZE << 8)/76; + int pos = 0; + + for (int i = 0; i < 76; ++i) + { + pos += step; + m_intern_vis_data[i] = (l[pos >> 8] >> 12); + + if (m_intern_vis_data[i] > 4) + m_intern_vis_data[i] = 4; + else if (m_intern_vis_data[i] < -4) + m_intern_vis_data[i] = -4; + } + return true; +} + +void Scope::draw(QPainter *p) +{ + for (int i = 0; i<75; ++i) + { + int h1 = 8 - m_intern_vis_data[i]; + int h2 = 8 - m_intern_vis_data[i+1]; + if (h1 > h2) + qSwap(h1, h2); + p->setPen (m_skin->getVisColor(18 + qAbs(8 - h2))); + p->drawLine(i*m_ratio, h1*m_ratio, (i+1)*m_ratio, h2*m_ratio); + } + for (int i = 0; i< 76; ++i) + m_intern_vis_data[i] = 0; +} diff --git a/src/plugins/Ui/skinned/mainvisual.h b/src/plugins/Ui/skinned/mainvisual.h new file mode 100644 index 000000000..9807483d7 --- /dev/null +++ b/src/plugins/Ui/skinned/mainvisual.h @@ -0,0 +1,145 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MAINVISUAL_H +#define MAINVISUAL_H + +#include +#include +#include + +class QTimer; +class QMenu; +class QActionGroup; + +class VisualBase +{ +public: + virtual ~VisualBase(){} + virtual void clear() = 0; + virtual bool process(short *l) = 0; + virtual void draw(QPainter *) = 0; + virtual const QString name() = 0; +}; + +class Skin; + +class MainVisual : public Visual +{ + Q_OBJECT + +public: + MainVisual( QWidget *parent = 0); + virtual ~MainVisual(); + + static MainVisual *instance(); + void setVisual(VisualBase *newvis); + void add(unsigned char *data, qint64 size, int chan); + void clear(); + void paintEvent(QPaintEvent *); + +protected: + virtual void hideEvent (QHideEvent *); + virtual void showEvent (QShowEvent *); + virtual void mousePressEvent (QMouseEvent *); + +public slots: + void timeout(); + +private slots: + void updateSettings(); + +private: + void drawBackGround(); + void createMenu(); + void readSettings(); + static MainVisual *m_instance; + VisualBase *m_vis; + QPixmap m_pixmap; + QPixmap m_bg; + QTimer *m_timer; + bool m_playing; + Skin *m_skin; + //menu and actions + QMenu *m_menu; + //action groups + QActionGroup *m_visModeGroup; + QActionGroup *m_fpsGroup; + QActionGroup *m_peaksFalloffGroup; + QActionGroup *m_analyzerFalloffGroup; + QActionGroup *m_analyzerModeGroup; + QActionGroup *m_analyzerTypeGroup; + QAction *m_peaksAction; + QAction *m_transparentAction; + int m_ratio; + short *m_left_buffer; + short *m_right_buffer; + int m_buffer_at; +}; + +namespace mainvisual +{ +class Analyzer : public VisualBase +{ +public: + Analyzer(); + virtual ~Analyzer(); + + void clear(); + bool process(short *l); + void draw(QPainter *p); + const QString name() + { + return "Analyzer"; + } + +private: + QSize m_size; + int m_analyzerBarWidth, m_fps; + double m_intern_vis_data[75]; + double m_peaks[75]; + double m_peaks_falloff; + double m_analyzer_falloff; + bool m_show_peaks; + bool m_lines; + int m_mode; + Skin *m_skin; +}; + +class Scope : public VisualBase +{ +public: + Scope(); + virtual ~Scope(); + void clear(); + bool process(short *l); + void draw(QPainter *p); + const QString name() + { + return "Scope"; + } + +private: + int m_intern_vis_data[76]; + Skin *m_skin; + int m_ratio; +}; +} + +#endif diff --git a/src/plugins/Ui/skinned/mainwindow.cpp b/src/plugins/Ui/skinned/mainwindow.cpp new file mode 100644 index 000000000..fdbe51adb --- /dev/null +++ b/src/plugins/Ui/skinned/mainwindow.cpp @@ -0,0 +1,616 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mainwindow.h" +#include "skin.h" +#include "playlist.h" +#include "configdialog.h" +#include "dock.h" +#include "eqwidget.h" +#include "mainvisual.h" +#include "jumptotrackdialog.h" +#include "aboutdialog.h" +#include "addurldialog.h" +#include "listwidget.h" +#include "visualmenu.h" +#include "windowsystem.h" +#include "actionmanager.h" +//#include "builtincommandlineoption.h" + +#define KEY_OFFSET 10000 + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) +{ +#ifdef Q_WS_X11 + qDebug("MainWindow: detected wm: %s", qPrintable(WindowSystem::netWindowManagerName())); +#endif + m_vis = 0; + m_update = false; + setWindowIcon(QIcon(":/32x32/qmmp.png")); + setWindowFlags(Qt::Window | Qt::FramelessWindowHint | + Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint); + setWindowTitle("Qmmp"); + + new ActionManager(); + + //prepare libqmmp and libqmmpui libraries for playing + m_player = MediaPlayer::instance(); + m_core = SoundCore::instance(); + m_pl_manager = PlayListManager::instance(); + //additional featuries + //new PlaylistParser(this); + m_generalHandler = GeneralHandler::instance(); + + //user interface + m_skin = new Skin(this); + resize(275 * m_skin->ratio(),116 * m_skin->ratio()); + Dock *dock = new Dock(this); + dock->setMainWidget(this); + m_display = new MainDisplay(this); + setCentralWidget(m_display); + m_display->setFocus (); + + m_playlist = new PlayList(m_pl_manager, this); + dock->addWidget(m_playlist); + + m_equalizer = new EqWidget(this); + dock->addWidget(m_equalizer); + + m_jumpDialog = new JumpToTrackDialog(m_pl_manager, this); + m_jumpDialog->hide(); + + createActions(); + //prepare visualization + Visual::initialize(this, m_visMenu, SLOT(updateActions())); + m_vis = MainVisual::instance(); + Visual::add(m_vis); + //connections + connect (m_playlist,SIGNAL(next()),SLOT(next())); + connect (m_playlist,SIGNAL(prev()),SLOT(previous())); + connect (m_playlist,SIGNAL(play()),SLOT(play())); + connect (m_playlist,SIGNAL(pause()), m_core ,SLOT(pause())); + connect (m_playlist,SIGNAL(stop()),SLOT(stop())); + connect (m_playlist,SIGNAL(eject()),SLOT(addFile())); + connect (m_playlist,SIGNAL(loadPlaylist()),SLOT(loadPlaylist())); + connect (m_playlist,SIGNAL(savePlaylist()),SLOT(savePlaylist())); + + connect(m_display,SIGNAL(shuffleToggled(bool)),m_pl_manager,SLOT(setShuffle(bool))); + connect(m_display,SIGNAL(repeatableToggled(bool)),m_pl_manager,SLOT(setRepeatableList(bool))); + + connect(m_jumpDialog,SIGNAL(playRequest()), SLOT(replay())); + + connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State))); + connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64))); + connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData())); + connect(m_generalHandler, SIGNAL(toggleVisibilityCalled()), SLOT(toggleVisibility())); + connect(m_generalHandler, SIGNAL(exitCalled()), SLOT(close())); + + readSettings(); + m_display->setEQ(m_equalizer); + m_display->setPL(m_playlist); + dock->updateDock(); + m_pl_manager->currentPlayList()->doCurrentVisibleRequest(); + if (m_startHidden && m_generalHandler->visibilityControl()) + toggleVisibility(); +} + +MainWindow::~MainWindow() +{} + +void MainWindow::play() +{ + m_player->play(); +} + +void MainWindow::replay() +{ + stop(); + m_pl_manager->activatePlayList(m_pl_manager->selectedPlayList()); + play(); +} + +void MainWindow::forward() +{ + m_core->seek(m_core->elapsed() + KEY_OFFSET); +} + +void MainWindow::backward() +{ + m_core->seek(qMax(qint64(0), m_core->elapsed() - KEY_OFFSET)); +} + +void MainWindow::setVolume(int volume, int balance) +{ + m_core->setVolume(volume-qMax(balance,0)*volume/100, + volume+qMin(balance,0)*volume/100); +} + +void MainWindow::pause(void) +{ + m_core->pause(); +} + +void MainWindow::stop() +{ + m_player->stop(); +} + +void MainWindow::next() +{ + m_player->next(); +} + +void MainWindow::previous() +{ + m_player->previous(); +} + +void MainWindow::showState(Qmmp::State state) +{ + disconnectPl(); + switch ((int) state) + { + case Qmmp::Playing: + if (m_pl_manager->currentPlayList()->currentItem()) + m_equalizer->loadPreset(m_pl_manager->currentPlayList()->currentItem()->url().section("/",-1)); + break; + case Qmmp::Paused: + break; + case Qmmp::Stopped: + m_playlist->setTime(-1); + if (m_playlist->currentItem()) + setWindowTitle(m_playlist->currentItem()->text()); + else + setWindowTitle("Qmmp"); + break; + } +} + +void MainWindow::showMetaData() +{ + if (m_playlist->currentItem() && + m_playlist->currentItem()->url() == m_core->metaData().value(Qmmp::URL)) + { + setWindowTitle(m_playlist->currentItem()->text()); + } +} + +void MainWindow::closeEvent (QCloseEvent *) +{ + writeSettings(); + m_playlist->close(); + m_equalizer->close(); + QApplication::quit (); +} + +void MainWindow::addDir() +{ + FileDialog::popup(this, FileDialog::AddDirs, &m_lastDir, + m_pl_manager->selectedPlayList(), SLOT(add(const QStringList&)), + tr("Choose a directory")); +} + +void MainWindow::addFile() +{ + QStringList filters; + filters << tr("All Supported Bitstreams")+" (" + + MetaDataManager::instance()->nameFilters().join (" ") +")"; + filters << MetaDataManager::instance()->filters(); + FileDialog::popup(this, FileDialog::AddDirsFiles, &m_lastDir, + m_pl_manager->selectedPlayList(), SLOT(add(const QStringList&)), + tr("Select one or more files to open"), filters.join(";;")); +} + +void MainWindow::changeEvent (QEvent * event) +{ + if (event->type() == QEvent::ActivationChange) + { + m_display->setActive(isActiveWindow()); + } +} + +void MainWindow::readSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + if (!m_update) + { + settings.beginGroup("MainWindow"); + + move(settings.value("pos", QPoint(100, 100)).toPoint()); //geometry + + m_lastDir = settings.value("last_dir","/").toString(); //last directory + m_startHidden = settings.value("start_hidden", false).toBool(); + settings.endGroup(); + + if(settings.value("General/always_on_top", false).toBool()) + { + ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->setChecked(true); + setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); + } + ACTION(ActionManager::WM_STICKY)->setChecked(settings.value("General/show_on_all_desktops", + false).toBool()); + show(); + qApp->processEvents(); + //visibility + m_playlist->setVisible(settings.value("Playlist/visible",true).toBool()); + qApp->processEvents(); + m_equalizer->setVisible(settings.value("Equalizer/visible",true).toBool()); + qApp->processEvents(); + bool val = settings.value("Playlist/repeatable",false).toBool(); + + // Repeat/Shuffle + m_pl_manager->setRepeatableList(val); + m_display->setIsRepeatable(val); + val = settings.value("Playlist/shuffle",false).toBool(); + m_display->setIsShuffle(val); + m_pl_manager->setShuffle(val); + + m_update = true; + } + else + { + if(ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()) + { + setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); + m_playlist->setWindowFlags(m_playlist->windowFlags() | Qt::WindowStaysOnTopHint); + m_equalizer->setWindowFlags(m_equalizer->windowFlags() | Qt::WindowStaysOnTopHint); + } + else + { + setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); + m_playlist->setWindowFlags(m_playlist->windowFlags() & ~Qt::WindowStaysOnTopHint); + m_equalizer->setWindowFlags(m_equalizer->windowFlags() & ~Qt::WindowStaysOnTopHint); + } + show(); + qApp->processEvents(); + m_playlist->setVisible(m_display->isPlaylistVisible()); + m_equalizer->setVisible(m_display->isEqualizerVisible()); + } +#ifdef Q_WS_X11 + WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); + WindowSystem::setWinHint(winId(), "player", "Qmmp"); +#endif + //Call setWindowOpacity only if needed + double opacity = settings.value("MainWindow/opacity", 1.0).toDouble(); + if(opacity != windowOpacity ()) + setWindowOpacity(opacity); + + opacity = settings.value("Equalizer/opacity", 1.0).toDouble(); + if(opacity != m_equalizer->windowOpacity ()) + m_equalizer->setWindowOpacity(opacity); + + opacity = settings.value("PlayList/opacity", 1.0).toDouble(); + if(opacity != m_playlist->windowOpacity ()) + m_playlist->setWindowOpacity(opacity); + + m_hideOnClose = settings.value("MainWindow/hide_on_close", false).toBool(); +} + +void MainWindow::writeSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("MainWindow"); + //geometry + settings.setValue("pos", this->pos()); + //last directory + settings.setValue("last_dir",m_lastDir); + settings.endGroup(); + // Repeat/Shuffle + settings.beginGroup("Playlist"); + settings.setValue("repeatable",m_display->isRepeatable()); + settings.setValue("shuffle",m_display->isShuffle()); + settings.endGroup(); + // playback state + settings.beginGroup("General"); + settings.setValue("resume_playback", m_core->state() == Qmmp::Playing && + settings.value("resume_on_startup", false).toBool()); + settings.setValue("resume_playback_time", m_core->totalTime() > 0 ? m_core->elapsed() : 0); + settings.setValue("double_size", ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked()); + settings.setValue("always_on_top", ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()); + settings.setValue("show_on_all_desktops", ACTION(ActionManager::WM_STICKY)->isChecked()); + settings.endGroup(); +} + +void MainWindow::showSettings() +{ + ConfigDialog *confDialog = new ConfigDialog(this); + confDialog->exec(); + updateSettings(); + confDialog->deleteLater(); + ActionManager::instance()->saveActions(); +} + +void MainWindow::toggleVisibility() +{ + if (isHidden()) + { + show(); + raise(); + activateWindow(); + m_playlist->setVisible(m_display->isPlaylistVisible()); + m_equalizer->setVisible(m_display->isEqualizerVisible()); +#ifdef Q_WS_X11 + if(WindowSystem::netWindowManagerName() == "Metacity") + { + m_playlist->activateWindow(); + m_equalizer->activateWindow(); + } +#endif + qApp->processEvents(); + setFocus (); + if (isMinimized()) + { + if (isMaximized()) + showMaximized(); + else + showNormal(); + } +#ifdef Q_WS_X11 + WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); + WindowSystem::setWinHint(winId(), "player", "Qmmp"); + raise(); +#endif + } + else + { + if (m_playlist->isVisible()) + m_playlist->hide(); + if (m_equalizer->isVisible()) + m_equalizer->hide(); + hide(); + } + qApp->processEvents(); +} + +void MainWindow::createActions() +{ + m_mainMenu = new QMenu(this); + m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY, this, SLOT(play()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::PAUSE, this, SLOT(pause()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::STOP, this, SLOT(stop()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::PREVIOUS, this, SLOT(previous()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::NEXT, this, SLOT(next()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY_PAUSE, this, SLOT(playPause()))); + m_mainMenu->addSeparator(); + m_mainMenu->addAction(QIcon::fromTheme("go-up"), tr("&Jump To File"), + this, SLOT(jumpToFile()), tr("J")); + m_mainMenu->addSeparator(); + QMenu *viewMenu = m_mainMenu->addMenu(tr("View")); + viewMenu->addAction(ACTION(ActionManager::SHOW_PLAYLIST)); + viewMenu->addAction(ACTION(ActionManager::SHOW_EQUALIZER)); + viewMenu->addSeparator(); + viewMenu->addAction(SET_ACTION(ActionManager::WM_ALLWAYS_ON_TOP, this, SLOT(updateSettings()))); + viewMenu->addAction(SET_ACTION(ActionManager::WM_STICKY, this, SLOT(updateSettings()))); + viewMenu->addAction(SET_ACTION(ActionManager::WM_DOUBLE_SIZE, this, SLOT(updateSettings()))); + + QMenu *plMenu = m_mainMenu->addMenu(tr("Playlist")); + plMenu->addAction(SET_ACTION(ActionManager::REPEAT_ALL, m_pl_manager, SLOT(setRepeatableList(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::REPEAT_TRACK, m_player, SLOT(setRepeatable(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::SHUFFLE, m_pl_manager, SLOT(setShuffle(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::NO_PL_ADVANCE, m_player, + SLOT(setNoPlaylistAdvance(bool)))); + plMenu->addAction(SET_ACTION(ActionManager::STOP_AFTER_SELECTED, m_pl_manager, + SLOT(stopAfterSelected()))); + plMenu->addAction(SET_ACTION(ActionManager::CLEAR_QUEUE, m_pl_manager, SLOT(clearQueue()))); + connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), + ACTION(ActionManager::REPEAT_ALL), SLOT(setChecked(bool))); + connect(m_player, SIGNAL (repeatableChanged(bool)), + ACTION(ActionManager::REPEAT_TRACK), SLOT(setChecked(bool))); + connect(m_player, SIGNAL (noPlaylistAdvanceChanged(bool)), + ACTION(ActionManager::NO_PL_ADVANCE), SLOT(setChecked(bool))); + connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), + ACTION(ActionManager::SHUFFLE), SLOT(setChecked(bool))); + + m_visMenu = new VisualMenu(this); + m_mainMenu->addMenu(m_visMenu); + m_mainMenu->addMenu(m_generalHandler->createMenu(GeneralHandler::TOOLS_MENU, tr("Tools"), this)); + m_mainMenu->addSeparator(); + m_mainMenu->addAction(SET_ACTION(ActionManager::SETTINGS, this, SLOT(showSettings()))); + m_mainMenu->addSeparator(); + m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT, this, SLOT(about()))); + m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT_QT, qApp, SLOT(aboutQt()))); + m_mainMenu->addSeparator(); + m_mainMenu->addAction(SET_ACTION(ActionManager::QUIT, this, SLOT(close()))); + + QAction* forward = new QAction(this); + forward->setShortcut(QKeySequence(Qt::Key_Right)); + connect(forward,SIGNAL(triggered(bool)),this,SLOT(forward())); + QAction* backward = new QAction(this); + backward->setShortcut(QKeySequence(Qt::Key_Left)); + connect(backward,SIGNAL(triggered(bool)),this,SLOT(backward())); + + Dock::instance()->addActions(QList() << forward << backward); + Dock::instance()->addActions(m_mainMenu->actions()); +} + + +void MainWindow::about() +{ + AboutDialog dlg(this); + dlg.exec(); +} + +void MainWindow::updateSettings() +{ + readSettings(); + m_playlist->readSettings(); + m_visMenu->updateActions(); + m_skin->reloadSkin(); + Dock::instance()->updateDock(); +} + +QMenu* MainWindow::menu() +{ + return m_mainMenu; +} + +void MainWindow::loadPlaylist() +{ + QStringList l; + QList p_list = PlaylistParser::instance()->formats(); + if (!p_list.isEmpty()) + { + foreach(PlaylistFormat* fmt,p_list) + l << fmt->getExtensions(); + + QString mask = tr("Playlist Files")+" (" + l.join(" *.").prepend("*.") + ")"; + //TODO use nonmodal dialog and multiplier playlists + QString f_name = FileDialog::getOpenFileName(this,tr("Open Playlist"),m_lastDir,mask); + if (!f_name.isEmpty()) + { + m_pl_manager->selectedPlayList()->clear(); + m_pl_manager->selectedPlayList()->loadPlaylist(f_name); + m_pl_manager->selectedPlayList()->setName(QFileInfo(f_name).baseName()); + m_lastDir = QFileInfo(f_name).absoluteDir().path(); + } + } + else + { + qWarning("Error: There is no registered playlist parsers"); + } +} + +void MainWindow::savePlaylist() +{ + QStringList l; + QList p_list = PlaylistParser::instance()->formats(); + if (!p_list.isEmpty()) + { + foreach(PlaylistFormat* fmt,p_list) + l << fmt->getExtensions(); + + QString mask = tr("Playlist Files")+" (" + l.join(" *.").prepend("*.") + ")"; + QString f_name = FileDialog::getSaveFileName(this, tr("Save Playlist"),m_lastDir + "/" + + m_pl_manager->selectedPlayList()->name() + "." + l[0],mask); + + if (!f_name.isEmpty()) + { + m_pl_manager->selectedPlayList()->savePlaylist(f_name); + m_lastDir = QFileInfo(f_name).absoluteDir().path(); + } + } + else + qWarning("Error: There is no registered playlist parsers"); +} + +void MainWindow::setFileList(const QStringList &l, bool clear) +{ + m_pl_manager->activatePlayList(m_pl_manager->selectedPlayList()); + if(!clear) + { + m_pl_manager->selectedPlayList()->add(l); + return; + } + if (m_core->state() != Qmmp::Stopped) + { + stop(); + qApp->processEvents(); //receive stop signal + } + m_model = m_pl_manager->selectedPlayList(); + m_model->clear(); + connect(m_model, SIGNAL(itemAdded(PlayListItem*)), SLOT(play())); + connect(m_model, SIGNAL(loaderFinished()), SLOT(disconnectPl())); + m_model->add(l); +} + +void MainWindow::playPause() +{ + if (m_core->state() == Qmmp::Playing) + m_core->pause(); + else + play(); +} + +void MainWindow::jumpToFile() +{ + if (m_jumpDialog->isHidden()) + { + m_jumpDialog->show(); + m_jumpDialog->refresh(); + } +} + +void MainWindow::handleCloseRequest() +{ + if (m_hideOnClose && m_generalHandler->visibilityControl()) + toggleVisibility(); + else + QApplication::closeAllWindows(); +} + +void MainWindow::disconnectPl() +{ + if(m_model) + { + disconnect(m_model, SIGNAL(itemAdded(PlayListItem*)), this, SLOT(play())); + disconnect(m_model, SIGNAL(loaderFinished()), this, SLOT(disconnectPl())); + m_model = 0; + } +} + +void MainWindow::addUrl() +{ + AddUrlDialog::popup(this, m_pl_manager->selectedPlayList()); +} + +SoundCore * MainWindow::soundCore() const +{ + return m_core; +} + +MainDisplay * MainWindow::mainDisplay() const +{ + return m_display; +} + +void MainWindow::keyPressEvent(QKeyEvent *ke) +{ + QKeyEvent event = QKeyEvent(ke->type(), ke->key(), + ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); + QApplication::sendEvent(m_playlist,&event); +} + +void MainWindow::resume() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("General"); + if(settings.value("resume_playback", false).toBool()) + { + qint64 pos = settings.value("resume_playback_time").toLongLong(); + m_player->play(pos); + } +} diff --git a/src/plugins/Ui/skinned/mainwindow.h b/src/plugins/Ui/skinned/mainwindow.h new file mode 100644 index 000000000..a3cfa8b99 --- /dev/null +++ b/src/plugins/Ui/skinned/mainwindow.h @@ -0,0 +1,123 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include "display.h" +#include "titlebar.h" + +class PlayList; +class PlayListManager; +class EqWidget; +class MainVisual; +class Skin; +class SoundCore; +class JumpToTrackDialog; +class VisualMenu; +class GeneralHandler; +class MediaPlayer; +class QMenu; +class QKeyEvent; + +/** + @author Ilya Kotov +*/ +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + MainWindow(QWidget *parent = 0); + + ~MainWindow(); + + PlayList *playlist(){return m_playlist;} + + QMenu* menu(); + void setVolume(int volume, int balance); + SoundCore* soundCore()const; + MainDisplay* mainDisplay()const; + void resume(); + +public slots: + void previous(); + void play(); + void pause(); + void playPause(); + void stop(); + void next(); + void replay(); + void jumpToFile(); + void toggleVisibility(); + + void addDir(); + void addFile(); + void addUrl(); + + void loadPlaylist(); + void savePlaylist(); + void setFileList(const QStringList&, bool clear = true); + void about(); + + void updateSettings(); + +protected: + virtual void closeEvent (QCloseEvent *); + virtual void changeEvent (QEvent *event); + virtual void keyPressEvent (QKeyEvent* ); + +private slots: + void showState(Qmmp::State state); + void showMetaData(); + void showSettings(); + void forward(); + void backward(); + void handleCloseRequest(); + void disconnectPl(); + +private: + void readSettings(); + void writeSettings(); + void createActions(); + SoundCore *m_core; + QMenu *m_mainMenu; + MainDisplay *m_display; + PlayList *m_playlist; + PlayListManager *m_pl_manager; + QPointer m_model; + int m_preamp; + EqWidget *m_equalizer; + MainVisual *m_vis; + QString m_lastDir; + bool m_update; + Skin *m_skin; + JumpToTrackDialog* m_jumpDialog; + bool m_hideOnClose, m_startHidden; + VisualMenu *m_visMenu; + GeneralHandler *m_generalHandler; + MediaPlayer *m_player; +}; + +#endif diff --git a/src/plugins/Ui/skinned/monostereo.cpp b/src/plugins/Ui/skinned/monostereo.cpp new file mode 100644 index 000000000..89f3621e5 --- /dev/null +++ b/src/plugins/Ui/skinned/monostereo.cpp @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include + +#include "skin.h" +#include "monostereo.h" + +MonoStereo::MonoStereo (QWidget *parent) + : PixmapWidget (parent) +{ + m_skin = Skin::instance(); + m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); + setChannels (0); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); +} + + +MonoStereo::~MonoStereo() +{} + +void MonoStereo::setChannels (int c) +{ + m_channels = c; + QPainter paint (&m_pixmap); + switch ((int) c) + { + case 0: + { + paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); + paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); + break; + } + case 1: + { + paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_A)); + paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); + break; + } + } + if (c > 1) + { + paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); + paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_A)); + } + setPixmap (m_pixmap); +} + +void MonoStereo::updateSkin() +{ + m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); + setChannels (m_channels); +} diff --git a/src/plugins/Ui/skinned/monostereo.h b/src/plugins/Ui/skinned/monostereo.h new file mode 100644 index 000000000..547a545da --- /dev/null +++ b/src/plugins/Ui/skinned/monostereo.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MONOSTEREO_H +#define MONOSTEREO_H + +#include "pixmapwidget.h" + +class Skin; + +/** + @author Ilya Kotov +*/ +class MonoStereo : public PixmapWidget +{ +Q_OBJECT +public: + MonoStereo(QWidget *parent = 0); + + ~MonoStereo(); + +public slots: + void setChannels(int); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + QPixmap m_pixmap; + int m_channels; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/number.cpp b/src/plugins/Ui/skinned/number.cpp new file mode 100644 index 000000000..d818da72f --- /dev/null +++ b/src/plugins/Ui/skinned/number.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "number.h" +#include "skin.h" + +Number::Number(QWidget *parent) + : PixmapWidget(parent) +{ + m_skin = Skin::instance(); + //TODO default value?? + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); +} + + +Number::~Number() +{ +} + +void Number::setValue(int n) +{ + setPixmap(m_skin->getNumber(n)); + m_value = n; +} + +void Number::updateSkin(void) +{ + setValue(m_value); +} diff --git a/src/plugins/Ui/skinned/number.h b/src/plugins/Ui/skinned/number.h new file mode 100644 index 000000000..1c89f71d4 --- /dev/null +++ b/src/plugins/Ui/skinned/number.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef NUMBER_H +#define NUMBER_H + +#include "pixmapwidget.h" + +/** + @author Ilya Kotov +*/ +class Skin; + +class Number : public PixmapWidget +{ +Q_OBJECT +public: + Number(QWidget *parent = 0); + + ~Number(); + + void setValue(int); + +private slots: + void updateSkin(void); + +private: + Skin *m_skin; + int m_value; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/pixmapwidget.cpp b/src/plugins/Ui/skinned/pixmapwidget.cpp new file mode 100644 index 000000000..081298df5 --- /dev/null +++ b/src/plugins/Ui/skinned/pixmapwidget.cpp @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include "pixmapwidget.h" + +PixmapWidget::PixmapWidget(QWidget *parent) + : QWidget(parent) +{} + + +PixmapWidget::~PixmapWidget() +{} + +void PixmapWidget::setPixmap(const QPixmap pixmap) +{ + m_pixmap = pixmap; + resize(m_pixmap.size()); + update(); +} + +void PixmapWidget::paintEvent (QPaintEvent *e) +{ + Q_UNUSED(e); + QPainter paint(this); + style()->drawItemPixmap(&paint, rect(), Qt::AlignCenter, m_pixmap); +} + diff --git a/src/plugins/Ui/skinned/pixmapwidget.h b/src/plugins/Ui/skinned/pixmapwidget.h new file mode 100644 index 000000000..24d34260e --- /dev/null +++ b/src/plugins/Ui/skinned/pixmapwidget.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PIXMAPWIDGET_H +#define PIXMAPWIDGET_H + +#include + +/** + @author Ilya Kotov +*/ +class QPixmap; + +class PixmapWidget : public QWidget +{ +Q_OBJECT +public: + PixmapWidget(QWidget *parent = 0); + + ~PixmapWidget(); + + virtual void setPixmap(const QPixmap); + +protected: + void paintEvent ( QPaintEvent * event ); + +private: + QPixmap m_pixmap; + + + +}; + +#endif diff --git a/src/plugins/Ui/skinned/playlist.cpp b/src/plugins/Ui/skinned/playlist.cpp new file mode 100644 index 000000000..75a6110ea --- /dev/null +++ b/src/plugins/Ui/skinned/playlist.cpp @@ -0,0 +1,616 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "dock.h" +#include "skin.h" +#include "listwidget.h" +#include "button.h" +#include "playlisttitlebar.h" +#include "playlistslider.h" +#include "pixmapwidget.h" +#include "symboldisplay.h" +#include "playlistcontrol.h" +#include "keyboardmanager.h" +#include "playlistbrowser.h" +#include "playlistselector.h" +#include "windowsystem.h" +#include "actionmanager.h" +#include "playlist.h" + +PlayList::PlayList (PlayListManager *manager, QWidget *parent) + : QWidget (parent) +{ + setAttribute(Qt::WA_AlwaysShowToolTips,true); + setWindowTitle(tr("Playlist")); + m_pl_manager = manager; + m_update = false; + m_resize = false; + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + m_shaded = false; + m_pl_browser = 0; + m_pl_selector = 0; + + resize (275*m_ratio, 116*m_ratio); + setSizeIncrement (25*m_ratio, 29*m_ratio); + setMinimumSize(275*m_ratio, 116*m_ratio); + + m_listWidget = new ListWidget (this); + m_plslider = new PlayListSlider (this); + m_buttonAdd = new Button (this,Skin::PL_BT_ADD,Skin::PL_BT_ADD, Skin::CUR_PNORMAL); + m_buttonSub = new Button (this,Skin::PL_BT_SUB,Skin::PL_BT_SUB, Skin::CUR_PNORMAL); + m_selectButton = new Button (this,Skin::PL_BT_SEL,Skin::PL_BT_SEL, Skin::CUR_PNORMAL); + m_sortButton= new Button (this,Skin::PL_BT_SORT,Skin::PL_BT_SORT, Skin::CUR_PNORMAL); + m_playlistButton = new Button (this,Skin::PL_BT_LST,Skin::PL_BT_LST, Skin::CUR_PNORMAL); + m_resizeWidget = new QWidget(this); + m_resizeWidget->resize(25,25); + m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); + m_pl_control = new PlaylistControl (this); + + m_length_totalLength = new SymbolDisplay (this,14); + m_length_totalLength->setAlignment (Qt::AlignLeft); + + m_current_time = new SymbolDisplay (this,6); + m_keyboardManager = new KeyboardManager (this); + + connect (m_listWidget, SIGNAL (selectionChanged()), parent, SLOT (replay())); + + connect (m_plslider, SIGNAL (sliderMoved (int)), m_listWidget, SLOT (scroll (int))); + connect (m_listWidget, SIGNAL (positionChanged (int, int)), m_plslider, + SLOT (setPos (int, int))); + connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); + connect (m_buttonAdd, SIGNAL (clicked()), SLOT (showAddMenu())); + connect (m_buttonSub, SIGNAL (clicked()), SLOT (showSubMenu())); + connect (m_selectButton, SIGNAL (clicked()), SLOT (showSelectMenu())); + connect (m_sortButton, SIGNAL (clicked()), SLOT (showSortMenu())); + connect (m_playlistButton, SIGNAL (clicked()), SLOT (showPlaylistMenu())); + + connect (m_pl_control, SIGNAL (nextClicked()), SIGNAL (next())); + connect (m_pl_control, SIGNAL (previousClicked()), SIGNAL (prev())); + connect (m_pl_control, SIGNAL (playClicked()), SIGNAL (play())); + connect (m_pl_control, SIGNAL (pauseClicked()), SIGNAL (pause())); + connect (m_pl_control, SIGNAL (stopClicked()), SIGNAL (stop())); + connect (m_pl_control, SIGNAL (ejectClicked()), SIGNAL (eject())); + + connect (m_pl_manager, SIGNAL (selectedPlayListChanged(PlayListModel *, PlayListModel *)), + m_listWidget, SLOT(setModel(PlayListModel*))); + m_listWidget->setModel(m_pl_manager->selectedPlayList()); + + m_titleBar = new PlayListTitleBar (this); + m_titleBar->move (0,0); + connect (m_pl_manager, SIGNAL (currentPlayListChanged(PlayListModel *, PlayListModel *)), + m_titleBar, SLOT(setModel(PlayListModel*))); + m_titleBar->setModel(m_pl_manager->currentPlayList()); + + createMenus(); + createActions(); + + readSettings(); + setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); + updatePositions(); +#ifdef Q_WS_X11 + QString wm_name = WindowSystem::netWindowManagerName(); + if(wm_name.contains("metacity", Qt::CaseInsensitive) || + wm_name.contains("openbox", Qt::CaseInsensitive)) + setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); + else +#endif + setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); +} + +PlayList::~PlayList() +{ + delete m_keyboardManager; +} + +void PlayList::updatePositions() +{ + int sx = (width()-275*m_ratio)/25; + int sy = (height()-116*m_ratio)/29; + if (sx < 0 || sy < 0 || m_shaded) //skip shaded mode + return; + + m_titleBar->resize (275*m_ratio+25*sx, 20*m_ratio); + m_plslider->resize (20*m_ratio, 58*m_ratio+sy*29); + + if(m_pl_selector) + { + m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy - m_pl_selector->height()); + m_pl_selector->resize(243*m_ratio+25*sx, m_pl_selector->height()); + m_pl_selector->move(12*m_ratio, 20*m_ratio + 58*m_ratio+29*sy - m_pl_selector->height()); + } + else + m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy); + m_listWidget->move (12*m_ratio,20*m_ratio); + + m_buttonAdd->move (11*m_ratio, 86*m_ratio+29*sy); + m_buttonSub->move (40*m_ratio, 86*m_ratio+29*sy); + m_selectButton->move (70*m_ratio, 86*m_ratio+29*sy); + m_sortButton->move (99*m_ratio, 86*m_ratio+29*sy); + + m_pl_control->move (128*m_ratio+sx*25, 100*m_ratio+29*sy); + m_playlistButton->move (228*m_ratio+sx*25,86*m_ratio+29*sy); + + m_length_totalLength -> move (131*m_ratio+sx*25,88*m_ratio+29*sy); + m_current_time->move (190*m_ratio+sx*25,101*m_ratio+29*sy); + + m_plslider->move (255*m_ratio+sx*25,20*m_ratio); + m_resizeWidget->move(width() - 25, height() - 29); +} + +void PlayList::createMenus() +{ + m_addMenu = new QMenu (this); + m_subMenu = new QMenu (this); + m_selectMenu = new QMenu (this); + m_sortMenu = new QMenu (this); + m_playlistMenu = new QMenu (this); + m_copySelectedMenu = new QMenu (tr("&Copy Selection To"), m_listWidget->menu()); + m_copySelectedMenu->setIcon(QIcon::fromTheme("edit-copy")); + connect (m_copySelectedMenu, SIGNAL (aboutToShow () ), this, SLOT (generateCopySelectedMenu ())); + connect (m_copySelectedMenu, SIGNAL (triggered ( QAction *) ), this, SLOT (copySelectedMenuActionTriggered( QAction *))); +} + +void PlayList::createActions() +{ + //add menu + m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_FILE, parent(), SLOT(addFile()))); + m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_DIRECTORY, parent(), SLOT(addDir()))); + m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_URL, parent(), SLOT(addUrl()))); + //sub menu + m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_SELECTED, m_pl_manager, SLOT(removeSelected()))); + m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_ALL, m_pl_manager, SLOT(clear()))); + m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_UNSELECTED, m_pl_manager, + SLOT(removeUnselected()))); + m_subMenu->addSeparator(); + m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_INVALID, m_pl_manager, + SLOT(removeInvalidItems()))); + m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_DUPLICATES, m_pl_manager, + SLOT(removeDuplicates()))); + //sort menu + m_sortMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_INFO, m_pl_manager, SLOT (showDetails ()))); + m_sortMenu->addAction (ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); + m_sortMenu->addSeparator(); + + QMenu* sort_mode_menu = new QMenu (tr("Sort List"), m_sortMenu); + sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); + QSignalMapper* signalMapper = new QSignalMapper (this); + QAction* titleAct = sort_mode_menu->addAction (tr ("By Title")); + connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (titleAct, PlayListModel::TITLE); + + QAction* albumAct = sort_mode_menu->addAction (tr ("By Album")); + connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (albumAct, PlayListModel::ALBUM); + + QAction* artistAct = sort_mode_menu->addAction (tr ("By Artist")); + connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (artistAct, PlayListModel::ARTIST); + + QAction* nameAct = sort_mode_menu->addAction (tr ("By Filename")); + connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (nameAct, PlayListModel::FILENAME); + + QAction* pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); + connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); + + QAction* dateAct = sort_mode_menu->addAction (tr ("By Date")); + connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (dateAct, PlayListModel::DATE); + + QAction* trackAct = sort_mode_menu->addAction (tr("By Track Number")); + connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (trackAct, PlayListModel::TRACK); + + connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sort (int))); + + m_sortMenu->addMenu (sort_mode_menu); + + sort_mode_menu = new QMenu (tr("Sort Selection"), m_sortMenu); + sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); + signalMapper = new QSignalMapper (this); + titleAct = sort_mode_menu->addAction (tr ("By Title")); + connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (titleAct, PlayListModel::TITLE); + + albumAct = sort_mode_menu->addAction (tr ("By Album")); + connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (albumAct, PlayListModel::ALBUM); + + artistAct = sort_mode_menu->addAction (tr ("By Artist")); + connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (artistAct, PlayListModel::ARTIST); + + nameAct = sort_mode_menu->addAction (tr ("By Filename")); + connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (nameAct, PlayListModel::FILENAME); + + pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); + connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); + + dateAct = sort_mode_menu->addAction (tr ("By Date")); + connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (dateAct, PlayListModel::DATE); + + trackAct = sort_mode_menu->addAction (tr ("By Track Number")); + connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); + signalMapper->setMapping (trackAct, PlayListModel::TRACK); + + connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sortSelection (int))); + + m_sortMenu->addMenu (sort_mode_menu); + m_sortMenu->addSeparator(); + m_sortMenu->addAction (QIcon::fromTheme("media-playlist-shuffle"), tr("Randomize List"), + m_pl_manager, SLOT(randomizeList())); + m_sortMenu->addAction (QIcon::fromTheme("view-sort-descending"), tr("Reverse List"), + m_pl_manager, SLOT(reverseList())); + //playlist context menu + m_listWidget->menu()->addAction(ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); + m_listWidget->menu()->addSeparator(); + m_listWidget->menu()->addActions (m_subMenu->actions().mid(0,3)); //use 3 first actions + m_listWidget->menu()->addMenu(GeneralHandler::instance()->createMenu(GeneralHandler::PLAYLIST_MENU, + tr("Actions"), this)); + m_listWidget->menu()->addSeparator(); + m_listWidget->menu()->addAction(SET_ACTION(ActionManager::PL_ENQUEUE, m_pl_manager, SLOT(addToQueue()))); + //select menu + m_selectMenu->addAction(SET_ACTION(ActionManager::PL_INVERT_SELECTION, m_pl_manager, + SLOT(invertSelection ()))); + m_selectMenu->addSeparator(); + m_selectMenu->addAction(SET_ACTION(ActionManager::PL_CLEAR_SELECTION, m_pl_manager, + SLOT(clearSelection ()))); + m_selectMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_ALL, m_pl_manager, SLOT(selectAll()))); + //Playlist Menu + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_NEW, m_pl_manager, SLOT(createPlayList()))); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_CLOSE, this, SLOT(deletePlaylist()))); + m_playlistMenu->addSeparator(); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_LOAD, this, SIGNAL(loadPlaylist()))); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SAVE, this, SIGNAL(savePlaylist()))); + m_playlistMenu->addSeparator(); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_NEXT, m_pl_manager, + SLOT(selectNextPlayList()))); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_PREVIOUS, m_pl_manager, + SLOT(selectPreviousPlayList()))); + m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_MANAGER, this, SLOT(showPlayLists()))); + Dock::instance()->addActions (m_addMenu->actions()); + Dock::instance()->addActions (m_subMenu->actions()); + Dock::instance()->addActions (m_sortMenu->actions()); + Dock::instance()->addActions (m_listWidget->menu()->actions()); + Dock::instance()->addActions (m_selectMenu->actions()); + Dock::instance()->addActions (m_playlistMenu->actions()); +} + +void PlayList::closeEvent (QCloseEvent *e) +{ + if (e->spontaneous ()) + emit closed(); + writeSettings(); +} + +void PlayList::paintEvent (QPaintEvent *) +{ + int sx = (width()-275*m_ratio) /25; + int sy = (height()-116*m_ratio) /29; + + QPainter paint(this); + drawPixmap (&paint, 0, 20*m_ratio, m_skin->getPlPart (Skin::PL_LFILL)); + for (int i = 1; igetPlPart (Skin::PL_LFILL)); + } + drawPixmap (&paint, 0, 78*m_ratio+29*sy, m_skin->getPlPart (Skin::PL_LSBAR)); + + for (int i = 0; igetPlPart (Skin::PL_SFILL1)); + } + drawPixmap (&paint,125*m_ratio+sx*25,78*m_ratio+sy*29,m_skin->getPlPart (Skin::PL_RSBAR)); + +} + +void PlayList::drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix) +{ + style()->drawItemPixmap(painter, QRect(x, y, pix.width(), pix.height()), Qt::AlignCenter, pix); +} + +void PlayList::resizeEvent (QResizeEvent *) +{ + updatePositions(); +} + +void PlayList::mousePressEvent (QMouseEvent *e) +{ + m_pos = e->pos (); + if (m_resizeWidget->underMouse()) + { + m_resize = true; + setCursor (m_skin->getCursor (Skin::CUR_PSIZE)); + } + else + m_resize = false; +} + +void PlayList::mouseMoveEvent (QMouseEvent *e) +{ + if (m_resize) + { +#ifdef Q_OS_WIN32 + int sx = (width()-275) /25; + int sy = (height()-116) /29; + if(width() < e->x() - 14) + sx++; + else if(width() > e->x() + 14) + sx--; + if(height() < e->y() - 14) + sy++; + else if(height() > e->y() + 14) + sy--; + resize (275+25*sx,116+29*sy); +#else + resize (e->x() +25, e->y() +25); +#endif + } +} + +void PlayList::mouseReleaseEvent (QMouseEvent *) +{ + setCursor (m_skin->getCursor (Skin::CUR_PNORMAL)); + /*if (m_resize) + m_listWidget->updateList();*/ + m_resize = false; + Dock::instance()->updateDock(); +} + +void PlayList::changeEvent (QEvent * event) +{ + if (event->type() == QEvent::ActivationChange) + { + m_titleBar->setActive (isActiveWindow()); + } +} + +void PlayList::readSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + if (settings.value("PlayList/show_plalists", false).toBool()) + { + if(!m_pl_selector) + m_pl_selector = new PlayListSelector(m_pl_manager, this); + m_pl_selector->show(); + m_listWidget->menu()->insertMenu(m_listWidget->menu()->actions().at(2),m_copySelectedMenu); + } + else + { + if(m_pl_selector) + { + m_pl_selector->deleteLater(); + m_listWidget->menu()->removeAction(m_copySelectedMenu->menuAction()); + } + m_pl_selector = 0; + } + if (m_update) + { + m_listWidget->readSettings(); + m_titleBar->readSettings(); + if(m_pl_selector) + m_pl_selector->readSettings(); + updatePositions(); + } + else + { + move (settings.value ("PlayList/pos", QPoint (100, 332)).toPoint()); //position + m_update = true; + } +} + +#ifdef Q_WS_X11 +bool PlayList::event (QEvent *event) +{ + if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) + { + WindowSystem::ghostWindow(winId()); + WindowSystem::setWinHint(winId(), "playlist", "Qmmp"); + } + return QWidget::event(event); +} +#endif + +void PlayList::writeSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup ("PlayList"); + //position + settings.setValue ("pos", this->pos()); + settings.endGroup(); +} + +void PlayList::showAddMenu() +{ + m_addMenu->exec (m_buttonAdd->mapToGlobal (QPoint (0,0))); +} + +void PlayList::showSubMenu() +{ + m_subMenu->exec (m_buttonSub->mapToGlobal (QPoint (0,0))); +} + +void PlayList::showSelectMenu() +{ + m_selectMenu->exec (m_selectButton->mapToGlobal (QPoint (0,0))); +} + +void PlayList::showSortMenu() +{ + m_sortMenu->exec (m_sortButton->mapToGlobal (QPoint (0,0))); +} + +QString PlayList::formatTime (int sec) +{ + if(sec > 3600) + sec /= 60; + return QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); +} + +void PlayList::setTime(qint64 time) +{ + if (time < 0) + m_current_time->display ("--:--"); + else + m_current_time->display (formatTime (time/1000)); + m_current_time->update(); + + if (SoundCore::instance()) + { + QString str_length = formatTime (m_pl_manager->currentPlayList()->totalLength()) + + "/" + formatTime (SoundCore::instance()->totalTime()/1000); + m_length_totalLength->display (str_length); + m_length_totalLength->update(); + } +} + +void PlayList::updateList() +{ + m_listWidget->updateList(); + m_titleBar->showCurrent(); +} + +PlayListItem *PlayList::currentItem() +{ + return m_pl_manager->currentPlayList()->currentItem(); +} + +void PlayList::showPlaylistMenu() +{ + m_playlistMenu->exec (m_playlistButton->mapToGlobal (QPoint (0,0))); +} + +void PlayList::keyPressEvent (QKeyEvent *ke) +{ + if (m_keyboardManager->handleKeyPress (ke)) + update(); +} + +void PlayList::updateSkin() +{ + setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); // TODO shaded + m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); + m_ratio = m_skin->ratio(); + setMinimalMode(m_shaded); +} + +void PlayList::deletePlaylist() +{ + m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); +} + +void PlayList::showPlayLists() +{ + if(!m_pl_browser) + { + m_pl_browser = new PlayListBrowser(m_pl_manager, this); + m_pl_browser->show(); + } + else + m_pl_browser->show(); +} + +void PlayList::generateCopySelectedMenu() +{ + m_copySelectedMenu->clear(); + QAction* action = m_copySelectedMenu->addAction (tr ("&New PlayList")); + action->setIcon(QIcon::fromTheme("document-new")); + m_copySelectedMenu->addSeparator(); + + foreach(QString name, m_pl_manager->playListNames()) + { + action = m_copySelectedMenu->addAction("&"+name.replace("&", "&&")); + } +} + +void PlayList::copySelectedMenuActionTriggered( QAction * action) +{ + PlayListModel *targetPlayList = 0; + QString actionText=action->text(); + if(action == m_copySelectedMenu->actions().at(0))//actionText == tr ("&New PlayList")) + { + targetPlayList = m_pl_manager->createPlayList(m_pl_manager->selectedPlayList()->name()); + } + else + { + actionText.remove(0,1).replace("&&", "&"); + foreach(PlayListModel *model, m_pl_manager->playLists()) + { + //if("&" + model->name().replace("&", "&&") == actionText) + if(model->name() == actionText) + { + targetPlayList=model; + break; + } + } + } + if(!targetPlayList) + { + qWarning("Error: Cannot find target playlist '%s'",qPrintable(actionText)); + return; + } + QList theCopy; + foreach(PlayListItem *item, m_pl_manager->selectedPlayList()->getSelectedItems()) + { + PlayListItem *newItem = new PlayListItem(*item); + theCopy << newItem; + } + targetPlayList->add(theCopy); +} + +void PlayList::setMinimalMode(bool b) +{ + if(!m_shaded) + m_height = height(); + m_shaded = b; + if(m_shaded) + { + m_height = height(); + setSizeIncrement (25*m_ratio, 1); + setMinimumSize (275*m_ratio, 14*m_ratio); + resize(width(), 14*m_ratio); + } + else + { + setMinimumSize(275*m_ratio, 116*m_ratio); + resize (width(), m_height); + setSizeIncrement (25*m_ratio, 29*m_ratio); + + } + updatePositions(); + update(); +} diff --git a/src/plugins/Ui/skinned/playlist.h b/src/plugins/Ui/skinned/playlist.h new file mode 100644 index 000000000..ae4d5cda8 --- /dev/null +++ b/src/plugins/Ui/skinned/playlist.h @@ -0,0 +1,140 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLAYLIST_H +#define PLAYLIST_H + +#include +#include + +class QMenu;; +class Skin; +class ListWidget; +class PlayListItem; +class Button; +class PlayListModel; +class PlayListTitleBar; +class PlayListSlider; +class MainWindow; +class SymbolDisplay; +class OutputState; +class PixmapWidget; +class PlaylistControl; +class KeyboardManager; +class PlayListManager; +class PlayListBrowser; +class PlayListSelector; + +/** + @author Ilya Kotov +*/ +class PlayList : public QWidget +{ + Q_OBJECT + public: + PlayList (PlayListManager *manager, QWidget *parent = 0); + + ~PlayList(); + void load (PlayListItem *); + void readSettings(); + PlayListItem *currentItem(); + ListWidget* listWidget() const + { + return m_listWidget; + } + void setMinimalMode(bool b = true); + + signals: + void play(); + void next(); + void prev(); + void pause(); + void stop(); + void eject(); + void loadPlaylist(); + void savePlaylist(); + void closed(); + + public slots: + void setTime(qint64 time); + void updateList(); + + private slots: + void showAddMenu(); + void showSubMenu(); + void showSelectMenu(); + void showSortMenu(); + void showPlaylistMenu(); + void updateSkin(); + void deletePlaylist(); + void showPlayLists(); + void generateCopySelectedMenu(); + void copySelectedMenuActionTriggered( QAction * action); + + private: + void updatePositions(); + QString formatTime (int sec); + void drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix); + void writeSettings(); + void createMenus(); + void createActions(); + //events + virtual void paintEvent (QPaintEvent *); + virtual void resizeEvent (QResizeEvent *); + virtual void mouseMoveEvent (QMouseEvent *); + virtual void mousePressEvent (QMouseEvent *); + virtual void mouseReleaseEvent (QMouseEvent *); + virtual void changeEvent (QEvent*); + virtual void closeEvent (QCloseEvent*); + virtual void keyPressEvent (QKeyEvent*); +#ifdef Q_WS_X11 + virtual bool event (QEvent *event); +#endif + QMenu *m_addMenu; + QMenu *m_subMenu; + QMenu *m_selectMenu; + QMenu *m_sortMenu; + QMenu *m_playlistMenu; + QMenu *m_copySelectedMenu; + QWidget *m_resizeWidget; + Button *m_buttonAdd; + Button *m_buttonSub; + Button *m_selectButton; + Button *m_sortButton; + Button* m_playlistButton; + PlaylistControl* m_pl_control; + SymbolDisplay* m_length_totalLength; + SymbolDisplay* m_current_time; + Skin *m_skin; + ListWidget *m_listWidget; + PlayListTitleBar *m_titleBar; + PlayListSlider *m_plslider; + QPoint m_pos; + bool m_resize; + bool m_update; + int m_ratio; + int m_height; + bool m_shaded; + PlayListManager *m_pl_manager; + KeyboardManager* m_keyboardManager; + QPointer m_pl_browser; + PlayListSelector *m_pl_selector; +}; + +#endif diff --git a/src/plugins/Ui/skinned/playlistbrowser.cpp b/src/plugins/Ui/skinned/playlistbrowser.cpp new file mode 100644 index 000000000..d7e630c43 --- /dev/null +++ b/src/plugins/Ui/skinned/playlistbrowser.cpp @@ -0,0 +1,117 @@ +/*************************************************************************** + * Copyright (C) 2009-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include "playlistbrowser.h" + +PlayListBrowser::PlayListBrowser(PlayListManager *manager, QWidget *parent) : QDialog(parent) +{ + setAttribute(Qt::WA_DeleteOnClose, true); + setAttribute(Qt::WA_QuitOnClose, false); + setWindowModality(Qt::NonModal); + ui.setupUi(this); + m_pl_manager = manager; + connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateList())); + connect(ui.newButton, SIGNAL(clicked()), m_pl_manager, SLOT(createPlayList())); + updateList(); + //actions + QAction *renameAct = new QAction(tr("Rename"), this); + QAction *removeAct = new QAction(tr("Delete"), this); + connect(renameAct,SIGNAL(triggered()), SLOT(rename())); + connect(removeAct,SIGNAL(triggered()), SLOT(on_deleteButton_clicked())); + ui.listWidget->setContextMenuPolicy(Qt::ActionsContextMenu); + ui.listWidget->addAction(renameAct); + ui.listWidget->addAction(removeAct); + ui.downButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown)); + ui.upButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowUp)); + ui.newButton->setIcon(QIcon::fromTheme("document-new")); + ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); +} + +PlayListBrowser::~PlayListBrowser() +{} + +void PlayListBrowser::updateList() +{ + ui.listWidget->clear(); + foreach(PlayListModel *model, m_pl_manager->playLists()) + ui.listWidget->addItem(model->name()); + ui.listWidget->setCurrentRow (m_pl_manager->selectedPlayListIndex()); + //mark current playlist + int current = m_pl_manager->currentPlayListIndex(); + QListWidgetItem *item = ui.listWidget->item(current); + if(item) + { + QFont font = item->font(); + font.setBold(true); + item->setFont(font); + } +} + +void PlayListBrowser::on_listWidget_itemDoubleClicked(QListWidgetItem *item) +{ + m_pl_manager->activatePlayList(ui.listWidget->row(item)); +} + +void PlayListBrowser::on_listWidget_itemChanged(QListWidgetItem *item) +{ + m_pl_manager->playListAt(ui.listWidget->row(item))->setName(item->text()); +} + +void PlayListBrowser::on_listWidget_itemPressed (QListWidgetItem *item) +{ + m_pl_manager->selectPlayList(ui.listWidget->row(item)); +} + +void PlayListBrowser::rename() +{ + QListWidgetItem *item = ui.listWidget->currentItem(); + if(item) + { + item->setFlags(Qt::ItemIsEditable | item->flags()); + ui.listWidget->editItem(item); + } +} + +void PlayListBrowser::on_deleteButton_clicked() +{ + QList models; + foreach(QListWidgetItem *item, ui.listWidget->selectedItems()) + models.append(m_pl_manager->playListAt(ui.listWidget->row (item))); + foreach(PlayListModel *model, models) + m_pl_manager->removePlayList(model); +} + +void PlayListBrowser::on_downButton_clicked() +{ + int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); + if(pos < m_pl_manager->count() - 1) + m_pl_manager->move(pos, pos + 1); +} + +void PlayListBrowser::on_upButton_clicked() +{ + int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); + if(pos > 0) + m_pl_manager->move(pos, pos - 1); +} diff --git a/src/plugins/Ui/skinned/playlistbrowser.h b/src/plugins/Ui/skinned/playlistbrowser.h new file mode 100644 index 000000000..563b527a5 --- /dev/null +++ b/src/plugins/Ui/skinned/playlistbrowser.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef PLAYLISTBROWSER_H +#define PLAYLISTBROWSER_H + +#include +#include "ui_playlistbrowser.h" + +class PlayListManager; + +/** + @author Ilya Kotov +*/ +class PlayListBrowser : public QDialog +{ +Q_OBJECT +public: + PlayListBrowser(PlayListManager *manager, QWidget *parent = 0); + ~PlayListBrowser(); + +private slots: + void updateList(); + void on_listWidget_itemDoubleClicked(QListWidgetItem *item); + void on_listWidget_itemChanged(QListWidgetItem *item); + void on_listWidget_itemPressed (QListWidgetItem *item); + void rename(); + void on_deleteButton_clicked(); + void on_downButton_clicked(); + void on_upButton_clicked(); + +private: + Ui::PlayListBrowser ui; + PlayListManager *m_pl_manager; +}; + +#endif // PLAYLISTBROWSER_H diff --git a/src/plugins/Ui/skinned/playlistcontrol.cpp b/src/plugins/Ui/skinned/playlistcontrol.cpp new file mode 100644 index 000000000..9f6f1cb60 --- /dev/null +++ b/src/plugins/Ui/skinned/playlistcontrol.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include + +#include "playlistcontrol.h" +#include "skin.h" + +PlaylistControl::PlaylistControl(QWidget* parent) : PixmapWidget(parent) +{ + m_skin = Skin::instance(); + setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); + m_ratio = m_skin->ratio(); + connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); +} + +void PlaylistControl::mouseReleaseEvent(QMouseEvent *me) +{ + QPoint pt = me->pos(); + if(QRect(4*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit previousClicked(); + else if(QRect(12*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit playClicked(); + else if(QRect(21*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit pauseClicked(); + else if(QRect(31*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit stopClicked(); + else if(QRect(40*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit nextClicked(); + else if(QRect(49*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) + emit ejectClicked(); +} + +void PlaylistControl::updateSkin() +{ + setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); + setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); + m_ratio = m_skin->ratio(); +} diff --git a/src/plugins/Ui/skinned/playlistcontrol.h b/src/plugins/Ui/skinned/playlistcontrol.h new file mode 100644 index 000000000..6c0ed0eaf --- /dev/null +++ b/src/plugins/Ui/skinned/playlistcontrol.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _PALYLISTCONTROL_H +#define _PALYLISTCONTROL_H + +#include "pixmapwidget.h" + +class QMouseEvent; +class PaintEvent; +class Skin; + + /** + @author Vladimir Kuznetsov + */ +class PlaylistControl : public PixmapWidget +{ +Q_OBJECT +public: + PlaylistControl(QWidget* parent = 0); + + +signals: + void previousClicked(); + void nextClicked(); + void pauseClicked(); + void playClicked(); + void stopClicked(); + void ejectClicked(); + +private slots: + void updateSkin(); + +private: + void mouseReleaseEvent(QMouseEvent*); + int m_ratio; + Skin* m_skin; +}; + +#endif diff --git a/src/plugins/Ui/skinned/playlistselector.cpp b/src/plugins/Ui/skinned/playlistselector.cpp new file mode 100644 index 000000000..132c708ea --- /dev/null +++ b/src/plugins/Ui/skinned/playlistselector.cpp @@ -0,0 +1,303 @@ +/*************************************************************************** + * Copyright (C) 2009-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "skin.h" +#include "playlistselector.h" + +PlayListSelector::PlayListSelector(PlayListManager *manager, QWidget *parent) : QWidget(parent) +{ + m_update = false; + m_scrollable = false; + m_left_pressed = false; + m_right_pressed = false; + m_offset = 0; + m_offset_max = 0; + m_skin = Skin::instance(); + m_pl_manager = manager; + connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateTabs())); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + loadColors(); + readSettings(); + updateTabs(); + m_menu = new QMenu(this); + m_menu->addAction(tr("&Load"), parent, SIGNAL (loadPlaylist())); + m_menu->addAction(tr("&Save As..."), parent, SIGNAL (savePlaylist())); + m_menu->addSeparator(); + m_menu->addAction(tr("Rename"),this, SLOT (renamePlaylist())); + m_menu->addAction(tr("&Delete"),parent, SLOT (deletePlaylist())); +} + +PlayListSelector::~PlayListSelector() +{} + +void PlayListSelector::readSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); + if (m_update) + { + delete m_metrics; + m_metrics = new QFontMetrics(m_font); + updateTabs(); + } + else + { + m_update = true; + } + m_metrics = new QFontMetrics(m_font); + + resize(width(), m_metrics->height () +1); + drawButtons(); +} + +void PlayListSelector::updateTabs() +{ + m_rects.clear(); + QRect rect; + foreach(QString text, m_pl_manager->playListNames()) + { + if(m_rects.isEmpty()) + rect.setX(9); + else + rect.setX(m_rects.last().right() + m_metrics->width(" | ")); + rect.setY(0); + rect.setWidth(m_metrics->width(text)); + rect.setHeight(m_metrics->ascent ()); + m_rects.append(rect); + } + updateScrollers(); + update(); +} + +void PlayListSelector::updateSkin() +{ + loadColors(); + drawButtons(); + updateTabs(); +} + +void PlayListSelector::renamePlaylist() +{ + bool ok = false; + QString name = QInputDialog::getText (this, + tr("Rename Playlist"), tr("Playlist name:"), + QLineEdit::Normal, + m_pl_manager->selectedPlayList()->name(), &ok); + if(ok) + m_pl_manager->selectedPlayList()->setName(name); +} + +void PlayListSelector::paintEvent(QPaintEvent *) +{ + QPainter painter(this); + painter.setFont(m_font); + painter.setBrush(QBrush(m_normal_bg)); + painter.drawRect(-1,-1,width()+1,height()+1); + QStringList names = m_pl_manager->playListNames(); + int current = m_pl_manager->indexOf(m_pl_manager->currentPlayList()); + int selected = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); + painter.setBrush(QBrush(m_selected_bg)); + painter.setPen(m_selected_bg); + painter.drawRect(m_rects.at(selected).x()- 3 - m_offset, 0, + m_rects.at(selected).width()+4, height()-1); + + for (int i = 0; i < m_rects.size(); ++i) + { + if(i == current) + painter.setPen(m_current); + else + painter.setPen(m_normal); + painter.drawText(m_rects[i].x() - m_offset, m_metrics->ascent(), names.at(i)); + if(i < m_rects.size() - 1) + { + painter.setPen(m_normal); + painter.drawText(m_rects[i].x() + m_rects[i].width() - m_offset, m_metrics->ascent(), " | "); + } + } + if(m_scrollable) + { + painter.drawPixmap(width()-40, 0, m_pixmap); + painter.setBrush(QBrush(m_normal_bg)); + painter.setPen(m_normal_bg); + painter.drawRect(0,0,6,height()); + } +} + +void PlayListSelector::mousePressEvent (QMouseEvent *e) +{ + if(m_scrollable && e->x() > width() - 20) + { + m_offset += m_rects.at(lastVisible()).right() - m_offset - width() + 42; + m_offset = qMin(m_offset, m_offset_max); + m_right_pressed = true; + drawButtons(); + update(); + return; + } + if(m_scrollable && (width() - 40 < e->x()) && (e->x() <= width() - 20)) + { + m_offset -= 11 - m_rects.at(firstVisible()).x() + m_offset; + m_offset = qMax(0, m_offset); + m_left_pressed = true; + drawButtons(); + update(); + return; + } + + QPoint pp = e->pos(); + pp.rx() += m_offset; + bool selected = false; + for(int i = 0; i < m_rects.count(); ++i) + { + if(m_rects.at(i).contains(pp)) + { + selected = true; + m_pl_manager->selectPlayList(i); + break; + } + } + update(); + if(e->button() == Qt::RightButton) + m_menu->exec(e->globalPos()); + else if(e->button() == Qt::MidButton && selected) + m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); + else + QWidget::mousePressEvent(e); +} + +void PlayListSelector::mouseReleaseEvent (QMouseEvent *e) +{ + m_left_pressed = false; + m_right_pressed = false; + drawButtons(); + update(); + QWidget::mouseReleaseEvent(e); +} + +void PlayListSelector::mouseDoubleClickEvent (QMouseEvent *e) +{ + if(e->button() == Qt::LeftButton && !(m_scrollable && (e->x() > width() - 40))) + renamePlaylist(); + else + QWidget::mouseDoubleClickEvent(e); +} + +void PlayListSelector::mouseMoveEvent(QMouseEvent *e) +{ + QPoint mp = e->pos(); + mp.rx() += m_offset; + int dest = -1; + for(int i = 0; i < m_rects.count(); ++i) + { + if(mp.x() >= m_rects.at(i).x() && mp.x() <= m_rects.at(i).x() + m_rects.at(i).width()) + { + dest = i; + break; + } + } + if(dest == -1 || dest == m_pl_manager->selectedPlayListIndex()) + { + QWidget::mouseMoveEvent(e); + return; + } + m_pl_manager->move(m_pl_manager->selectedPlayListIndex(), dest); +} + +void PlayListSelector::resizeEvent (QResizeEvent *) +{ + updateScrollers(); +} + +void PlayListSelector::loadColors() +{ + m_normal.setNamedColor(m_skin->getPLValue("normal")); + m_current.setNamedColor(m_skin->getPLValue("current")); + m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); + m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); +} + +void PlayListSelector::drawButtons() +{ + m_pixmap = QPixmap(40, height()); + m_pixmap.fill(m_normal_bg); + QPainter painter(&m_pixmap); + painter.setPen(m_left_pressed ? m_current : m_normal); + painter.setBrush(QBrush(m_left_pressed ? m_current : m_normal)); + QPoint points[3] = { + QPoint(m_pixmap.width() - 25, height()/2 - 5), + QPoint(m_pixmap.width() - 35, height()/2-1), + QPoint(m_pixmap.width() - 25, height()/2 + 3), + }; + painter.drawPolygon(points, 3); + painter.setPen(m_right_pressed ? m_current : m_normal); + painter.setBrush(QBrush(m_right_pressed ? m_current : m_normal)); + QPoint points2[3] = { + QPoint(m_pixmap.width() - 20, height()/2 - 5), + QPoint(m_pixmap.width() - 10, height()/2-1), + QPoint(m_pixmap.width() - 20, height()/2 + 3), + }; + painter.drawPolygon(points2, 3); +} + +void PlayListSelector::updateScrollers() +{ + m_scrollable = m_rects.last().right() > width(); + if(m_scrollable) + { + m_offset_max = m_rects.last().right() - width() + 42; + m_offset = qMin(m_offset, m_offset_max); + } + else + { + m_offset = 0; + m_offset_max = 0; + } +} + +int PlayListSelector::firstVisible() +{ + for(int i = 0; i < m_rects.size(); ++i) + { + if(m_rects.at(i).right() - m_offset + m_metrics->width(" - ") + 2 >= 9) + return i; + } + return 0; +} + +int PlayListSelector::lastVisible() +{ + for(int i = m_rects.size() - 1; i >= 0; --i) + { + if(m_rects.at(i).x() - m_offset - m_metrics->width(" - ") - 2 <= width() - 40) + return i; + } + return m_rects.count() - 1; +} diff --git a/src/plugins/Ui/skinned/playlistselector.h b/src/plugins/Ui/skinned/playlistselector.h new file mode 100644 index 000000000..67e281f75 --- /dev/null +++ b/src/plugins/Ui/skinned/playlistselector.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2009-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef PLAYLISTSELECTOR_H +#define PLAYLISTSELECTOR_H + +#include +#include +#include + +class QFontMetrics; +class QFont; +class QMouseEvent; +class QMenu; +class PlayListManager; +class Skin; + +/** + @author Ilya Kotov +*/ +class PlayListSelector : public QWidget +{ +Q_OBJECT +public: + PlayListSelector(PlayListManager *manager, QWidget *parent = 0); + ~PlayListSelector(); + void readSettings(); + +private slots: + void updateTabs(); + void updateSkin(); + void renamePlaylist(); + +private: + void paintEvent(QPaintEvent *); + void mousePressEvent (QMouseEvent *e); + void mouseReleaseEvent (QMouseEvent *e); + void mouseDoubleClickEvent (QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void resizeEvent (QResizeEvent *); + void updateOffsets(); + void loadColors(); + void drawButtons(); + void updateScrollers(); + int firstVisible(); + int lastVisible(); + PlayListManager *m_pl_manager; + QFontMetrics *m_metrics; + QFont m_font; + QMenu *m_menu; + bool m_update; + bool m_scrollable; + QList m_rects; + Skin *m_skin; + QColor m_normal, m_current, m_normal_bg, m_selected_bg; + QPixmap m_pixmap; + bool m_showButtons; + int m_offset, m_offset_max; + bool m_left_pressed, m_right_pressed; +}; + +#endif // PLAYLISTSELECTOR_H diff --git a/src/plugins/Ui/skinned/playlistslider.cpp b/src/plugins/Ui/skinned/playlistslider.cpp new file mode 100644 index 000000000..df958fa6b --- /dev/null +++ b/src/plugins/Ui/skinned/playlistslider.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include + +#include "skin.h" +#include "playlistslider.h" +#include "pixmapwidget.h" + +PlayListSlider::PlayListSlider(QWidget *parent) + : QWidget(parent) +{ + m_skin = Skin::instance(); + m_moving = false; + m_pressed = false; + m_min = 0; + m_max = 0; + m_value = 0; + pos = 0; + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); +} + + +PlayListSlider::~PlayListSlider() +{} + +void PlayListSlider::paintEvent(QPaintEvent *) +{ + int sy = (height()-58)/29; + int p=int(ceil(double(m_value-m_min)*(height()-18)/(m_max-m_min))); + QPainter paint(this); + paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_RFILL)); + paint.drawPixmap(0,29,m_skin->getPlPart(Skin::PL_RFILL)); + + for (int i = 0; igetPlPart(Skin::PL_RFILL)); + } + if (m_pressed) + paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_P)); + else + paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_N)); + m_pos = p; +} + +void PlayListSlider::mousePressEvent(QMouseEvent *e) +{ + m_moving = true; + m_pressed = true; + press_pos = e->y(); + if (m_posy() && e->y()ratio()) + { + press_pos = e->y()-m_pos; + } + else + { + m_value = convert(qMax(qMin(height()-18*m_skin->ratio(),e->y()-9*m_skin->ratio()),0)); + press_pos = 9*m_skin->ratio(); + if (m_value!=m_old) + { + emit sliderMoved(m_value); + m_old = m_value; + //qDebug ("%d",m_value); + } + } + update(); +} + +void PlayListSlider::mouseReleaseEvent(QMouseEvent*) +{ + m_moving = false; + m_pressed = false; + update(); +} + +void PlayListSlider::mouseMoveEvent(QMouseEvent* e) +{ + if (m_moving) + { + int po = e->y(); + po = po - press_pos; + + if (0<=po && po<=height()-18*m_skin->ratio()) + { + m_value = convert(po); + update(); + if (m_value!=m_old) + { + + m_old = m_value; + emit sliderMoved(m_value); + } + } + } +} + +void PlayListSlider::setPos(int p, int max) +{ + m_max = max; + m_value = p; + if(m_moving) + return; + update(); +} + +void PlayListSlider::updateSkin() +{ + update(); + setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); +} + +int PlayListSlider::convert(int p) +{ + return int(floor(double(m_max-m_min)*(p)/(height()-18*m_skin->ratio())+m_min)); +} + diff --git a/src/plugins/Ui/skinned/playlistslider.h b/src/plugins/Ui/skinned/playlistslider.h new file mode 100644 index 000000000..cd42a6c3a --- /dev/null +++ b/src/plugins/Ui/skinned/playlistslider.h @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLAYLISTSLIDER_H +#define PLAYLISTSLIDER_H + +#include + +class Skin; +class PixmapWidget; +/** + @author Ilya Kotov +*/ +class PlayListSlider : public QWidget +{ +Q_OBJECT +public: + PlayListSlider(QWidget *parent = 0); + + ~PlayListSlider(); + +public slots: + void setPos(int pos, int max); + +signals: + void sliderMoved (int); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + PixmapWidget *m_scroll; + int m_old; + bool m_moving, m_pressed; + int press_pos; + int m_min, m_max, m_value, pos, m_pos; + int convert(int); // value = convert(position); + +protected: + void paintEvent(QPaintEvent*); + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/playlisttitlebar.cpp b/src/plugins/Ui/skinned/playlisttitlebar.cpp new file mode 100644 index 000000000..ddcc2b244 --- /dev/null +++ b/src/plugins/Ui/skinned/playlisttitlebar.cpp @@ -0,0 +1,275 @@ +/*************************************************************************** + * Copyright (C) 2007-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "dock.h" +#include "button.h" +#include "playlisttitlebar.h" +#include "skin.h" + +// TODO {shademode, updateskin} -> do we have the shaded cursor +PlayListTitleBar::PlayListTitleBar(QWidget *parent) + : PixmapWidget(parent) +{ + m_active = false; + m_resize = false; + m_shade2 = 0; + m_model = 0; + m_shaded = false; + m_align = false; + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + m_pl = qobject_cast(parent); + m_mw = qobject_cast(m_pl->parent()); + + m_close = new Button(this,Skin::PL_BT_CLOSE_N, Skin::PL_BT_CLOSE_P, Skin::CUR_PCLOSE); + connect (m_close, SIGNAL(clicked()), m_pl, SIGNAL(closed())); + + m_shade = new Button(this, Skin::PL_BT_SHADE1_N, Skin::PL_BT_SHADE1_P, Skin::CUR_PWINBUT); + connect(m_shade, SIGNAL(clicked()), SLOT(shade())); + + resize(275*m_ratio,20*m_ratio); + setMinimumWidth(275*m_ratio); + + readSettings(); + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + m_pl->resize (settings.value ("PlayList/size", QSize (m_ratio*275, m_ratio*116)).toSize()); + if (settings.value ("PlayList/shaded", false).toBool()) + shade(); + resize(m_pl->width(),height()); + m_align = true; + setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); + updatePositions(); +} + + +PlayListTitleBar::~PlayListTitleBar() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("PlayList/size", QSize (m_pl->width(), m_shaded ? m_height:m_pl->height())); + settings.setValue ("PlayList/shaded", m_shaded); +} + +void PlayListTitleBar::updatePositions() +{ + int sx = (width()-275*m_ratio)/25; + m_ratio = m_skin->ratio(); + m_close->move(m_ratio*264+sx*25,m_ratio*3); + m_shade->move(m_ratio*255+sx*25,m_ratio*3); + if (m_shade2) + m_shade2->move(m_ratio*255+sx*25,m_ratio*3); +} + +void PlayListTitleBar::updatePixmap() +{ + int sx = ((m_shaded ? m_pl->width() : width())-275*m_ratio)/25; + QPixmap pixmap(275*m_ratio+sx*25,20*m_ratio); + QPainter paint; + paint.begin(&pixmap); + if (m_shaded) + { + paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED2)); + for (int i = 1; igetPlPart(Skin::PL_TFILL_SHADED)); + } + } + + if (m_active) + { + if (m_shaded) + paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_A)); + else + { + paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_A)); + for (int i = 1; igetPlPart(Skin::PL_TFILL1_A)); + } + paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_A)); + paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_A)); + } + } + else + { + if (m_shaded) + paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_I)); + else + { + paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_I)); + for (int i = 1; igetPlPart(Skin::PL_TFILL1_I)); + } + paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_I)); + paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_I)); + } + } + if (m_shaded) + { + QColor col; + col.setNamedColor(QString(m_skin->getPLValue("mbbg"))); + paint.setBrush(QBrush(col)); + paint.setPen(col); + paint.drawRect(8*m_ratio, m_ratio, 235*m_ratio + sx*25, 11*m_ratio); + //draw text + paint.setFont(m_font); + paint.setPen(QString(m_skin->getPLValue("mbfg"))); + paint.drawText(9*m_ratio, 11*m_ratio, m_truncatedText); + } + paint.end(); + setPixmap(pixmap); +} + +void PlayListTitleBar::resizeEvent(QResizeEvent *) +{ + QFontMetrics metrics(m_font); + m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); + updatePixmap(); + updatePositions(); +} + +void PlayListTitleBar::mousePressEvent(QMouseEvent* event) +{ + switch ((int) event->button ()) + { + case Qt::LeftButton: + pos = event->pos(); + if (m_shaded && (width() - 30*m_ratio) < pos.x() && pos.x() < (width() - 22*m_ratio)) + { + m_resize = true; + setCursor (Qt::SizeHorCursor); + } + break; + case Qt::RightButton: + m_mw->menu()->exec(event->globalPos()); + } +} + +void PlayListTitleBar::mouseReleaseEvent(QMouseEvent*) +{ + Dock::instance()->updateDock(); + m_resize = false; + setCursor (Qt::ArrowCursor); +} + +void PlayListTitleBar::mouseMoveEvent(QMouseEvent* event) +{ + QPoint npos = (event->globalPos()-pos); + QPoint oldpos = npos; + if (m_shaded && m_resize) + { + resize((event->x() + 25*m_ratio), height()); + m_pl->resize((event->x() + 25*m_ratio), m_pl->height()); + } + else if (pos.x() < width() - 30*m_ratio) + Dock::instance()->move(m_pl, npos); +} + +void PlayListTitleBar::setActive(bool a) +{ + m_active = a; + updatePixmap(); +} + + +void PlayListTitleBar::setModel(PlayListModel *selected, PlayListModel *previous) +{ + if(previous) + disconnect(previous, 0, this, 0); //disconnect previous model + m_model = selected; + connect (m_model, SIGNAL(listChanged()), SLOT(showCurrent())); + showCurrent(); +} + +void PlayListTitleBar::readSettings() +{ + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); + m_font.setPointSize(8); +} + +void PlayListTitleBar::updateSkin() +{ + setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); + if(m_ratio != m_skin->ratio()) + { + m_ratio = m_skin->ratio(); + setMinimumWidth(275*m_ratio); + updatePositions(); + } + updatePixmap(); +} + +void PlayListTitleBar::shade() +{ + m_shaded = !m_shaded; + if (m_shaded) + { + m_height = m_pl->height(); + m_shade->hide(); + m_shade2 = new Button(this, Skin::PL_BT_SHADE2_N, Skin::PL_BT_SHADE2_P, Skin::CUR_PWSNORM); + m_shade2->move(254,3); + connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); + m_shade2->show(); + } + else + { + m_shade2->deleteLater(); + m_shade2 = 0; + m_shade->show(); + } + m_pl->setMinimalMode(m_shaded); + showCurrent(); + update(); + if (m_align) + Dock::instance()->align(m_pl, m_shaded? -m_height+14*m_ratio: m_height-14*m_ratio); + updatePositions(); +} + +void PlayListTitleBar::mouseDoubleClickEvent (QMouseEvent *) +{ + PlayListTitleBar::shade(); +} + +void PlayListTitleBar::showCurrent() +{ + if (m_model) + { + PlayListItem* info = m_model->currentItem(); + if (info) + { + m_text = QString("%1. ").arg(m_model->currentRow()+1); + m_text.append(info->text()); + m_text.append(QString(" (%1:%2)").arg(info->length()/60) + .arg(info->length()%60, 2, 10, QChar('0'))); + } + else + m_text.clear(); + } + QFontMetrics metrics(m_font); + m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); + updatePixmap(); +} diff --git a/src/plugins/Ui/skinned/playlisttitlebar.h b/src/plugins/Ui/skinned/playlisttitlebar.h new file mode 100644 index 000000000..01163f987 --- /dev/null +++ b/src/plugins/Ui/skinned/playlisttitlebar.h @@ -0,0 +1,80 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLAYLISTTITLEBAR_H +#define PLAYLISTTITLEBAR_H + +#include "playlist.h" +#include "pixmapwidget.h" +#include "mainwindow.h" + +/** + @author Ilya Kotov +*/ +class Skin; +class MainWindow; +class Button; +class PlayListModel; + +class PlayListTitleBar : public PixmapWidget +{ +Q_OBJECT +public: + PlayListTitleBar(QWidget *parent = 0); + ~PlayListTitleBar(); + void setActive(bool); + void readSettings(); + +public slots: + void showCurrent(); + void setModel(PlayListModel *selected, PlayListModel *previous = 0); + +private slots: + void updateSkin(); + void shade(); + +private: + void updatePositions(); + void updatePixmap(); + Skin *m_skin; + QPoint pos; + bool m_active; + PlayList* m_pl; + MainWindow* m_mw; + Button* m_close; + Button* m_shade; + Button* m_shade2; + bool m_shaded; + bool m_align, m_resize; + int m_ratio; + int m_height; + PlayListModel* m_model; + QString m_text; + QString m_truncatedText; + QFont m_font; + +protected: + void resizeEvent(QResizeEvent*); + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseDoubleClickEvent(QMouseEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/playstatus.cpp b/src/plugins/Ui/skinned/playstatus.cpp new file mode 100644 index 000000000..f12efb258 --- /dev/null +++ b/src/plugins/Ui/skinned/playstatus.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "skin.h" +#include "playstatus.h" + +PlayStatus::PlayStatus ( QWidget *parent ) + : PixmapWidget ( parent ) +{ + m_skin = Skin::instance(); + setStatus ( STOP ); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); +} + + +PlayStatus::~PlayStatus() +{} + +void PlayStatus::setStatus ( Type st ) +{ + m_status = st; + switch ( ( uint ) st ) + { + case PLAY: + { + setPixmap ( m_skin->getItem ( Skin::PLAY )); + break; + } + case STOP: + { + setPixmap ( m_skin->getItem ( Skin::STOP )); + break; + } + case PAUSE: + { + setPixmap ( m_skin->getItem ( Skin::PAUSE )); + break; + } + } +} + +void PlayStatus::updateSkin() +{ + setStatus ( m_status ); +} + + diff --git a/src/plugins/Ui/skinned/playstatus.h b/src/plugins/Ui/skinned/playstatus.h new file mode 100644 index 000000000..1ddf9748c --- /dev/null +++ b/src/plugins/Ui/skinned/playstatus.h @@ -0,0 +1,55 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLAYSTATUS_H +#define PLAYSTATUS_H + +#include "pixmapwidget.h" + +/** + @author Ilya Kotov +*/ +class Skin; + +class PlayStatus : public PixmapWidget +{ +Q_OBJECT +public: + PlayStatus(QWidget *parent = 0); + + ~PlayStatus(); + + enum Type + { + PLAY, + STOP, + PAUSE, + }; + +void setStatus(Type); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + Type m_status; +}; + +#endif diff --git a/src/plugins/Ui/skinned/pluginitem.cpp b/src/plugins/Ui/skinned/pluginitem.cpp new file mode 100644 index 000000000..0f0fa1f58 --- /dev/null +++ b/src/plugins/Ui/skinned/pluginitem.cpp @@ -0,0 +1,188 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pluginitem.h" + + +PluginItem::PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), TRANSPORT) +{ + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + + +PluginItem::PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), DECODER) +{ + setCheckState(0, Decoder::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + +PluginItem::PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), ENGINE) +{ + setCheckState(0, AbstractEngine::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + +PluginItem::PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), EFFECT) +{ + setCheckState(0, Effect::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + +PluginItem::PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), VISUAL) +{ + setCheckState(0, Visual::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + +PluginItem::PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path) + : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), GENERAL) +{ + setCheckState(0, General::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); + m_has_about = factory->properties().hasAbout; + m_has_config = factory->properties().hasSettings; + m_factory = factory; +} + +PluginItem::~PluginItem() +{ + +} + +bool PluginItem::hasAbout() const +{ + return m_has_about; +} +bool PluginItem::hasSettings() const +{ + return m_has_config; +} + +void PluginItem::showAbout(QWidget *parent) +{ + switch(type()) + { + case PluginItem::TRANSPORT: + static_cast(m_factory)->showAbout(parent); + break; + case PluginItem::DECODER: + static_cast(m_factory)->showAbout(parent); + break; + case PluginItem::ENGINE: + static_cast(m_factory)->showAbout(parent); + break; + case PluginItem::EFFECT: + static_cast(m_factory)->showAbout(parent); + break; + case PluginItem::VISUAL: + static_cast(m_factory)->showAbout(parent); + break; + case PluginItem::GENERAL: + static_cast(m_factory)->showAbout(parent); + break; + default: + ; + } + +} + +void PluginItem::showSettings(QWidget *parent) +{ + switch(type()) + { + case PluginItem::TRANSPORT: + static_cast(m_factory)->showSettings(parent); + break; + case PluginItem::DECODER: + static_cast(m_factory)->showSettings (parent); + break; + case PluginItem::ENGINE: + static_cast(m_factory)->showSettings (parent); + break; + case PluginItem::EFFECT: + static_cast(m_factory)->showSettings (parent); + break; + case PluginItem::VISUAL: + Visual::showSettings(static_cast(m_factory), parent); + break; + case PluginItem::GENERAL: + GeneralHandler::instance()->showSettings(static_cast(m_factory), parent); + break; + default: + ; + } +} + +void PluginItem::setEnabled(bool enabled) +{ + switch(type()) + { + case PluginItem::TRANSPORT: + //dynamic_cast(m_factory) + break; + case PluginItem::DECODER: + Decoder::setEnabled(static_cast(m_factory), enabled); + break; + case PluginItem::ENGINE: + AbstractEngine::setEnabled(static_cast(m_factory), enabled); + break; + case PluginItem::EFFECT: + Effect::setEnabled(static_cast(m_factory), enabled); + break; + case PluginItem::VISUAL: + Visual::setEnabled(static_cast(m_factory), enabled); + break; + case PluginItem::GENERAL: + GeneralHandler::instance()->setEnabled(static_cast(m_factory), enabled); + break; + default: + ; + } +} diff --git a/src/plugins/Ui/skinned/pluginitem.h b/src/plugins/Ui/skinned/pluginitem.h new file mode 100644 index 000000000..da1ba4909 --- /dev/null +++ b/src/plugins/Ui/skinned/pluginitem.h @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLUGINITEM_H +#define PLUGINITEM_H + +#include + +/** + @author Ilya Kotov +*/ + +class QWidget; +class InputSourceFactory; +class DecoderFactory; +class EngineFactory; +class OutputFactory; +class VisualFactory; +class EffectFactory; +class GeneralFactory; + +class PluginItem : public QTreeWidgetItem +{ +public: + + PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path); + PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path); + PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path); + PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path); + PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path); + PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path); + ~PluginItem(); + + enum PluginType + { + TRANSPORT = QTreeWidgetItem::UserType, + DECODER, + ENGINE, + EFFECT, + VISUAL, + GENERAL + }; + + bool hasAbout() const; + bool hasSettings() const; + void showAbout(QWidget *parent); + void showSettings(QWidget *parent); + void setEnabled(bool enabled); + + +private: + bool m_has_about; + bool m_has_config; + void *m_factory; +}; + +#endif diff --git a/src/plugins/Ui/skinned/popupsettings.cpp b/src/plugins/Ui/skinned/popupsettings.cpp new file mode 100644 index 000000000..837afbf3c --- /dev/null +++ b/src/plugins/Ui/skinned/popupsettings.cpp @@ -0,0 +1,88 @@ +/*************************************************************************** + * Copyright (C) 2009-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include "popupwidget.h" +#include "popupsettings.h" + +PopupSettings::PopupSettings(QWidget *parent) + : QDialog(parent) +{ + ui.setupUi(this); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("PlayList"); + ui.transparencySlider->setValue(100 - settings.value("popup_opacity", 1.0).toDouble()*100); + ui.coverSizeSlider->setValue(settings.value ("popup_cover_size", 48).toInt()); + ui.textEdit->setPlainText(settings.value ("popup_template", DEFAULT_TEMPLATE).toString()); + ui.delaySpinBox->setValue(settings.value("popup_delay", 2500).toInt()); + ui.coverCheckBox->setChecked(settings.value("popup_show_cover",true).toBool()); + settings.endGroup(); + createMenu(); +} + + +PopupSettings::~PopupSettings() +{} + +void PopupSettings::accept() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("PlayList"); + settings.setValue("popup_opacity", 1.0 - (double)ui.transparencySlider->value()/100); + settings.setValue("popup_cover_size", ui.coverSizeSlider->value()); + settings.setValue("popup_template", ui.textEdit->toPlainText()); + settings.setValue("popup_delay", ui.delaySpinBox->value()); + settings.setValue("popup_show_cover", ui.coverCheckBox->isChecked()); + settings.endGroup(); + QDialog::accept(); +} + +void PopupSettings::createMenu() +{ + QMenu *menu = new QMenu(this); + menu->addAction(tr("Artist"))->setData("%p"); + menu->addAction(tr("Album"))->setData("%a"); + menu->addAction(tr("Title"))->setData("%t"); + menu->addAction(tr("Track number"))->setData("%n"); + menu->addAction(tr("Two-digit track number"))->setData("%NN"); + menu->addAction(tr("Genre"))->setData("%g"); + menu->addAction(tr("Comment"))->setData("%c"); + menu->addAction(tr("Composer"))->setData("%C"); + menu->addAction(tr("Duration"))->setData("%l"); + menu->addAction(tr("Disc number"))->setData("%D"); + menu->addAction(tr("File name"))->setData("%f"); + menu->addAction(tr("File path"))->setData("%F"); + menu->addAction(tr("Year"))->setData("%y"); + menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); + ui.insertButton->setMenu(menu); + connect(menu, SIGNAL(triggered (QAction *)), SLOT(insertExpression(QAction *))); +} + +void PopupSettings::insertExpression(QAction *a) +{ + ui.textEdit->insertPlainText(a->data().toString()); +} + +void PopupSettings::on_resetButton_clicked() +{ + ui.textEdit->setPlainText(DEFAULT_TEMPLATE); +} diff --git a/src/plugins/Ui/skinned/popupsettings.h b/src/plugins/Ui/skinned/popupsettings.h new file mode 100644 index 000000000..ed7dde6c4 --- /dev/null +++ b/src/plugins/Ui/skinned/popupsettings.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) 2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include +#include "ui_popupsettings.h" + +class Action; + +/** + @author Ilya Kotov +*/ +class PopupSettings : public QDialog +{ +Q_OBJECT +public: + PopupSettings(QWidget *parent = 0); + ~PopupSettings(); + + +public slots: + virtual void accept(); + +private slots: + void insertExpression(QAction *); + void on_resetButton_clicked(); + +private: + void createMenu(); + Ui::PopupSettings ui; + QMap m_buttons; +}; + +#endif diff --git a/src/plugins/Ui/skinned/popupwidget.cpp b/src/plugins/Ui/skinned/popupwidget.cpp new file mode 100644 index 000000000..08768b5f9 --- /dev/null +++ b/src/plugins/Ui/skinned/popupwidget.cpp @@ -0,0 +1,136 @@ +/*************************************************************************** + * Copyright (C) 2008-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "popupwidget.h" + +using namespace PlayListPopup; + +PopupWidget::PopupWidget(QWidget *parent) + : QWidget(parent) +{ + setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::Dialog | Qt::FramelessWindowHint); + //setFrameStyle(QFrame::Box | QFrame::Plain); + setAttribute(Qt::WA_QuitOnClose, false); + m_item = 0; + QHBoxLayout *hlayout = new QHBoxLayout(this); //layout + m_pixlabel = new QLabel(this); + hlayout->addWidget(m_pixlabel); + + m_label1 = new QLabel(this); + hlayout->addWidget (m_label1); + + //settings + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("PlayList"); + setWindowOpacity(settings.value("popup_opacity", 1.0).toDouble()); + m_coverSize = settings.value("popup_cover_size", 48).toInt(); + m_template = settings.value("popup_template",DEFAULT_TEMPLATE).toString(); + int delay = settings.value("popup_delay", 2500).toInt(); + bool show_cover = settings.value("popup_show_cover",true).toBool(); + settings.endGroup(); + //timer + m_timer = new QTimer(this); + m_timer->setInterval(delay); + m_timer->setSingleShot (true); + connect(m_timer, SIGNAL(timeout ()), SLOT(show())); + if(show_cover) + connect(m_timer, SIGNAL(timeout ()), SLOT(loadCover())); + else + m_pixlabel->hide(); + setMouseTracking(true); +} + +PopupWidget::~PopupWidget() +{} + +void PopupWidget::mousePressEvent (QMouseEvent *) +{ + hide(); +} + +void PopupWidget::mouseMoveEvent (QMouseEvent *) +{ + hide(); +} + +void PopupWidget::prepare(PlayListItem *item, QPoint pos) +{ + pos += QPoint(15,10); + + m_item = item; + hide(); + if(!item) + { + m_timer->stop(); + return; + } + + QString title = m_template; + MetaDataFormatter f(title); + title = f.parse(item); + m_label1->setText(title); + qApp->processEvents(); + updateGeometry (); + resize(sizeHint()); + qApp->processEvents(); + m_timer->start(); + QRect rect = QApplication::desktop()->availableGeometry(this); + if(pos.x() + width() > rect.x() + rect.width()) + pos.rx() -= width(); + move(pos); +} + +void PopupWidget::deactivate() +{ + m_timer->stop(); + hide(); +} + +PlayListItem *PopupWidget::item() +{ + return m_item; +} + +void PopupWidget::loadCover() +{ + if(!m_item) + return; + QPixmap pix = MetaDataManager::instance()->getCover(m_item->url()); + if(pix.isNull()) + pix = QPixmap(":/ui_no_cover.png"); + m_pixlabel->setFixedSize(m_coverSize,m_coverSize); + m_pixlabel->setPixmap(pix.scaled(m_coverSize,m_coverSize)); + qApp->processEvents(); + updateGeometry (); + resize(sizeHint()); + qApp->processEvents(); +} diff --git a/src/plugins/Ui/skinned/popupwidget.h b/src/plugins/Ui/skinned/popupwidget.h new file mode 100644 index 000000000..5e630313e --- /dev/null +++ b/src/plugins/Ui/skinned/popupwidget.h @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (C) 2008-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef POPUPWIDGET_H +#define POPUPWIDGET_H + +#include + +#define DEFAULT_TEMPLATE "%if(%t,%t,%f)\n%if(%p,
%p,)\n%if(%a,
%a,)" + +class QTimer; +class QLabel; +class PlayListItem; + +namespace PlayListPopup { +/** + @author Ilya Kotov +*/ +class PopupWidget : public QWidget +{ + Q_OBJECT +public: + PopupWidget(QWidget *parent = 0); + + ~PopupWidget(); + + void prepare(PlayListItem *item, QPoint pos); + void deactivate(); + PlayListItem *item(); + +protected: + virtual void mousePressEvent (QMouseEvent *); + virtual void mouseMoveEvent (QMouseEvent *); + +private slots: + void loadCover(); + +private: + QTimer *m_timer; + QLabel *m_label1; + QLabel *m_pixlabel; + QString m_template; + uint m_pos; + int m_coverSize; + PlayListItem *m_item; + +}; +} + +#endif diff --git a/src/plugins/Ui/skinned/positionbar.cpp b/src/plugins/Ui/skinned/positionbar.cpp new file mode 100644 index 000000000..7b27f68e9 --- /dev/null +++ b/src/plugins/Ui/skinned/positionbar.cpp @@ -0,0 +1,136 @@ +/*************************************************************************** + * Copyright (C) 2009-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include "skin.h" +#include "button.h" +#include "positionbar.h" + +PositionBar::PositionBar(QWidget *parent) : PixmapWidget(parent) +{ + m_skin = Skin::instance(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setPixmap(m_skin->getPosBar()); + m_moving = false; + m_min = 0; + m_max = 0; + m_old = m_value = 0; + draw(false); + setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); +} + + +PositionBar::~PositionBar() +{} + +void PositionBar::mousePressEvent(QMouseEvent *e) +{ + if(m_max <= 0) + return; + m_moving = true; + press_pos = e->x(); + if (m_posx() && e->x()ratio()) + { + press_pos = e->x()-m_pos; + emit sliderPressed(); + } + else + { + m_value = convert(qMax(qMin(width()-30*m_skin->ratio(),e->x()-15*m_skin->ratio()),0)); + press_pos = 15*m_skin->ratio(); + emit sliderPressed(); + if (m_value!=m_old) + { + emit sliderMoved(m_value); + + } + } + draw(); +} + +void PositionBar::mouseMoveEvent (QMouseEvent *e) +{ + if (m_moving) + { + qint64 po = e->x(); + po = po - press_pos; + + if (0<=po && po<=width()-30*m_skin->ratio()) + { + m_value = convert(po); + draw(); + emit sliderMoved(m_value); + } + } +} + +void PositionBar::mouseReleaseEvent(QMouseEvent*) +{ + draw(false); + if (m_value != m_old && m_max > 0) + m_old = m_value; + m_moving = false; + if(m_max > 0) + emit sliderReleased(); +} + +void PositionBar::setValue(qint64 v) +{ + if (m_moving || m_max == 0) + return; + m_value = v; + draw(false); +} + +void PositionBar::setMaximum(qint64 max) +{ + m_max = max; + draw(false); +} + +void PositionBar::updateSkin() +{ + resize(m_skin->getPosBar().size()); + draw(false); + setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); +} + +void PositionBar::draw(bool pressed) +{ + qint64 p=qint64(ceil(double(m_value-m_min)*(width()-30*m_skin->ratio())/(m_max-m_min))); + m_pixmap = m_skin->getPosBar(); + if (m_max > 0) + { + QPainter paint(&m_pixmap); + if (pressed) + paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_P)); + else + paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_N)); + } + setPixmap(m_pixmap); + m_pos = p; +} + +qint64 PositionBar::convert(qint64 p) +{ + return qint64(ceil(double(m_max-m_min)*(p)/(width()-30*m_skin->ratio())+m_min)); +} diff --git a/src/plugins/Ui/skinned/positionbar.h b/src/plugins/Ui/skinned/positionbar.h new file mode 100644 index 000000000..8fb768664 --- /dev/null +++ b/src/plugins/Ui/skinned/positionbar.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2009-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef POSITIONBAR_H +#define POSITIONBAR_H + +#include "pixmapwidget.h" + +class QMouseEvent; +class Skin; + +/** + @author Ilya Kotov +*/ +class PositionBar : public PixmapWidget +{ + Q_OBJECT +public: + PositionBar(QWidget *parent = 0); + virtual ~PositionBar(); + +public slots: + void setValue(qint64); + qint64 value()const{return m_value;} + void setMaximum(qint64); + qint64 maximum() const {return m_max;} + +signals: + void sliderMoved (qint64); + void sliderPressed(); + void sliderReleased(); + +private slots: + void updateSkin(); + +private: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + Skin *m_skin; + bool m_moving; + qint64 press_pos; + qint64 m_max, m_min, m_pos, m_value, m_old; + QPixmap m_pixmap; + qint64 convert(qint64); // value = convert(position); + void draw(bool pressed = true); +}; + +#endif diff --git a/src/plugins/Ui/skinned/preseteditor.cpp b/src/plugins/Ui/skinned/preseteditor.cpp new file mode 100644 index 000000000..8e5249c0c --- /dev/null +++ b/src/plugins/Ui/skinned/preseteditor.cpp @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2006-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include "eqpreset.h" +#include "preseteditor.h" + +PresetEditor::PresetEditor(QWidget *parent) + : QDialog(parent) +{ + ui.setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + connect(ui.loadButton,SIGNAL(clicked()),SLOT(loadPreset())); + connect(ui.deleteButton,SIGNAL(clicked()),SLOT(deletePreset())); + ui.loadButton->setIcon(QIcon::fromTheme("document-open")); + ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); +} + + +PresetEditor::~PresetEditor() +{ + while (ui.presetListWidget->count () !=0) + ui.presetListWidget->takeItem (0); + + while (ui.autoPresetListWidget->count () !=0) + ui.autoPresetListWidget->takeItem (0); +} + +void PresetEditor::addPresets(const QList &presets) +{ + foreach(QListWidgetItem *item, presets) + { + ui.presetListWidget->addItem(item); + } +} + +void PresetEditor::addAutoPresets(const QList &presets) +{ + foreach(QListWidgetItem *item, presets) + { + ui.autoPresetListWidget->addItem(item); + } +} + +void PresetEditor::loadPreset() +{ + EQPreset* preset = 0; + if (ui.tabWidget->currentIndex () == 0) + preset = (EQPreset *) ui.presetListWidget->currentItem (); + if (ui.tabWidget->currentIndex () == 1) + preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); + if (preset) + emit presetLoaded(preset); +} + +void PresetEditor::deletePreset() +{ + EQPreset* preset = 0; + if (ui.tabWidget->currentIndex () == 0) + preset = (EQPreset *) ui.presetListWidget->currentItem (); + if (ui.tabWidget->currentIndex () == 1) + preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); + if (preset) + emit presetDeleted(preset); +} diff --git a/src/plugins/Ui/skinned/preseteditor.h b/src/plugins/Ui/skinned/preseteditor.h new file mode 100644 index 000000000..35302b185 --- /dev/null +++ b/src/plugins/Ui/skinned/preseteditor.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PRESETEDITOR_H +#define PRESETEDITOR_H + +#include + +#include "ui_preseteditor.h" + +/** + @author Ilya Kotov +*/ + +class EQPreset; + +class PresetEditor : public QDialog +{ +Q_OBJECT +public: + PresetEditor(QWidget *parent = 0); + + ~PresetEditor(); + + void addPresets(const QList&); + void addAutoPresets(const QList&); + +signals: + void presetLoaded(EQPreset*); + void presetDeleted(EQPreset*); + +private slots: + void loadPreset(); + void deletePreset(); + +private: + Ui::PresetEditor ui; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/qmmp.desktop b/src/plugins/Ui/skinned/qmmp.desktop new file mode 100644 index 000000000..d1602a19b --- /dev/null +++ b/src/plugins/Ui/skinned/qmmp.desktop @@ -0,0 +1,27 @@ +[Desktop Entry] +X-Desktop-File-Install-Version=0.11 +Name=Qmmp +Comment=Qt4-based Multimedia Player +Comment[ru]=Медиа-проигрыватель на базе Qt4 +Comment[uk]=Медіа-програвач на базі Qt4 +Comment[cs]=PÅ™ehrávaÄ hudby založený na Qt +Comment[tr]=Qt4 tabanlı Çokluortam Oynatıcı +Comment[de]=Qt4-basierter Audio-Player +Comment[zh_CN]=基于Qt4的多媒体播放器 +Comment[zh_TW]=基于Qt4的多媒體播放器 +GenericName=Audio player +GenericName[cs]=PÅ™ehrávaÄ hudby +GenericName[de]=Audio-Player +GenericName[ru]=Ðудио-проигрыватель +GenericName[uk]=Медіа-програвач +GenericName[tr]=Ses Oynatıcı +GenericName[zh_CN]=éŸ³ä¹æ’­æ”¾å™¨ +GenericName[zh_TW]=音樂播放器 +Exec=qmmp %F +Icon=qmmp +Terminal=false +Type=Application +Categories=AudioVideo;Player;Audio;Qt; +MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mpegurl;audio/x-it;audio/x-mod;audio/x-ape;application/x-cue;audio/x-ffmpeg-shorten;inode/directory; +X-KDE-StartupNotify=false + diff --git a/src/plugins/Ui/skinned/qmmp_enqueue.desktop b/src/plugins/Ui/skinned/qmmp_enqueue.desktop new file mode 100644 index 000000000..b42e2b18b --- /dev/null +++ b/src/plugins/Ui/skinned/qmmp_enqueue.desktop @@ -0,0 +1,24 @@ +[Desktop Entry] +X-Desktop-File-Install-Version=0.11 +Name=Enqueue in Qmmp +Name[cs]=ZaÅ™adit do fronty v Qmmp +Name[de]=Zur Qmmp-Wiedergabeliste hinzufügen +Name[ru]=Добавить в Qmmp +Name[uk]=Додати до черги Qmmp +Name[zh_CN]=加入 Qmmp 播放列表 +Name[zh_TW]=加入 Qmmp 播放清單 +Comment=Add file(s) to the Qmmp playlist +Comment[cs]=PÅ™idat soubor(y) do seznamu stop v Qmmp +Comment[de]=Datei(en) zur Qmmp-Wiedergabeliste hinzufügen +Comment[ru]=Добавить файл(Ñ‹) в ÑпиÑок Qmmp +Comment[uk]=Додати файл(и) до переліку Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð²Ð°Ð½Ð½Ñ Qmmp +Comment[zh_CN]=添加一个或多个文件到 Qmmp 播放列表 +Comment[zh_TW]=添加一個或多個檔案到 Qmmp 播放清單 +Exec=qmmp -e %F +Icon=qmmp +Categories=AudioVideo;Player;Audio;Qt; +MimeType=application/x-ogg;audio/mp3;audio/mpeg;audio/x-flac;audio/x-mp3;audio/x-mpeg;audio/x-ms-wma;audio/x-musepack;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mpegurl;audio/x-it;audio/x-mod;audio/x-ape;application/x-cue;audio/x-ffmpeg-shorten;inode/directory; +Type=Application +X-KDE-StartupNotify=false +NoDisplay=true +Terminal=false diff --git a/src/plugins/Ui/skinned/shadedbar.cpp b/src/plugins/Ui/skinned/shadedbar.cpp new file mode 100644 index 000000000..bdabbe516 --- /dev/null +++ b/src/plugins/Ui/skinned/shadedbar.cpp @@ -0,0 +1,143 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include "skin.h" +#include "shadedbar.h" + +ShadedBar::ShadedBar(QWidget *parent, uint slider1, uint slider2, uint slider3) + : QWidget(parent) +{ + m_slider1 = slider1; + m_slider2 = slider2; + m_slider3 = slider3; + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + if(slider1 == Skin::EQ_VOLUME1) + resize(m_ratio*97,m_ratio*7); + else + resize(m_ratio*42,m_ratio*7); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + m_moving = false; + m_min = 0; + m_max = 100; + m_old = m_value = 0; + draw(); +} + + +ShadedBar::~ShadedBar() +{ +} + +void ShadedBar::mousePressEvent(QMouseEvent *e) +{ + m_moving = true; + press_pos = e->x(); + if(m_posx() && e->x()x()-m_pos; + } + else + { + m_value = convert(qMax(qMin(width()-3,e->x()-1),0)); + press_pos = 1; + if (m_value!=m_old) + { + emit sliderMoved(m_value); + } + } + draw(); +} + +void ShadedBar::mouseMoveEvent (QMouseEvent *e) +{ + if(m_moving) + { + int po = e->x(); + po = po - press_pos; + + if(0<=po && po<=width()-3) + { + m_value = convert(po); + draw(); + emit sliderMoved(m_value); + } + } +} + +void ShadedBar::mouseReleaseEvent(QMouseEvent*) +{ + m_moving = false; + draw(); + m_old = m_value; +} + +void ShadedBar::setValue(int v) +{ + if (m_moving || m_max == 0) + return; + m_value = v; + draw(); +} + +void ShadedBar::setRange(int min, int max) +{ + m_max = max; + m_min = min; + draw(); +} + +void ShadedBar::updateSkin() +{ + m_ratio = m_skin->ratio(); + if(m_slider1 == Skin::EQ_VOLUME1) + resize(m_ratio*97,m_ratio*7); + else + resize(m_ratio*42,m_ratio*7); + draw(); +} + +void ShadedBar::draw() +{ + if (m_value <= m_min + (m_max - m_min)/3) + m_pixmap = m_skin->getEqPart(m_slider1); + else if(m_min + (m_max - m_min)/3 < m_value && m_value <= m_min + 2*(m_max - m_min)/3) + m_pixmap = m_skin->getEqPart(m_slider2); + else + m_pixmap = m_skin->getEqPart(m_slider3); + m_pos = int(ceil(double(m_value-m_min)*(width()-3*m_ratio)/(m_max-m_min))); + update(); +} + +int ShadedBar::convert(int p) +{ + return int(ceil(double(m_max-m_min)*(p)/(width()-3)+m_min)); +} + +void ShadedBar::paintEvent(QPaintEvent*) +{ + QPainter paint(this); + paint.drawPixmap(m_pos,0,m_pixmap); +} + diff --git a/src/plugins/Ui/skinned/shadedbar.h b/src/plugins/Ui/skinned/shadedbar.h new file mode 100644 index 000000000..09272e9e1 --- /dev/null +++ b/src/plugins/Ui/skinned/shadedbar.h @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SHADEDBAR_H +#define SHADEDBAR_H + +#include + +class QMouseEvent; +class QPaintEvent; +class Skin; + +/** + @author Ilya Kotov +*/ +class ShadedBar : public QWidget +{ + Q_OBJECT +public: + ShadedBar(QWidget *parent = 0, uint slider1 = 0, uint slider2 = 0, uint slider3 = 0); + + ~ShadedBar(); + int value() + { + return m_value; + } + int isPressed() + { + return m_moving; + } + void setRange(int min, int max); + +public slots: + void setValue(int); + +signals: + void sliderMoved (int); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + bool m_moving; + int press_pos; + int m_max, m_min, m_pos, m_value, m_old, m_x; + QPixmap m_pixmap; + int convert(int); // value = convert(position); + void draw(); + uint m_slider1, m_slider2, m_slider3; + int m_ratio; + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void paintEvent(QPaintEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/shadedvisual.cpp b/src/plugins/Ui/skinned/shadedvisual.cpp new file mode 100644 index 000000000..e249752ca --- /dev/null +++ b/src/plugins/Ui/skinned/shadedvisual.cpp @@ -0,0 +1,181 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include "skin.h" +#include "mainvisual.h" +#include "inlines.h" +#include "shadedvisual.h" + +#define VISUAL_NODE_SIZE 512 //samples +#define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) + +ShadedVisual::ShadedVisual(QWidget *parent) : Visual(parent) +{ + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + resize(m_ratio*38,m_ratio*5); + m_pixmap = QPixmap (m_ratio*38,m_ratio*5); + m_timer = new QTimer(this); + connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + m_left_buffer = new short[VISUAL_BUFFER_SIZE]; + m_right_buffer = new short[VISUAL_BUFFER_SIZE]; + m_buffer_at = 0; + m_timer->setInterval(50); + m_timer->start(); + clear(); +} + +ShadedVisual::~ShadedVisual() +{ + delete [] m_left_buffer; + delete [] m_right_buffer; +} + +void ShadedVisual::add(unsigned char *data, qint64 size, int chan) +{ + if (!m_timer->isActive ()) + return; + + if(VISUAL_BUFFER_SIZE == m_buffer_at) + { + m_buffer_at -= VISUAL_NODE_SIZE; + memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + return; + } + + int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); + + if (chan >= 2) + { + stereo16_from_multichannel(m_left_buffer + m_buffer_at, + m_right_buffer + m_buffer_at,(short *) data, frames, chan); + } + else + { + memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); + memcpy(m_right_buffer + m_buffer_at, (short *) data, frames << 1); + } + + m_buffer_at += frames; +} + +void ShadedVisual::clear() +{ + m_buffer_at = 0; + m_l = 0; + m_r = 0; + m_pixmap.fill(m_skin->getVisColor(0)); + update(); +} + +void ShadedVisual::timeout() +{ + m_pixmap.fill(m_skin->getVisColor(0)); + + mutex()->lock (); + if(m_buffer_at < VISUAL_NODE_SIZE) + { + mutex()->unlock (); + return; + } + + process (m_left_buffer, m_right_buffer); + m_buffer_at -= VISUAL_NODE_SIZE; + memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); + QPainter p(&m_pixmap); + draw (&p); + mutex()->unlock (); + update(); +} + +void ShadedVisual::process (short *left, short *right) +{ + int step = (VISUAL_NODE_SIZE << 8)/74; + int pos = 0; + int l = 0; + int r = 0; + int j_l = 0, j_r = 0; + + for (int i = 0; i < 75; ++i) + { + pos += step; + + if (left) + { + j_l = abs((left[pos >> 8] >> 12)); + + if (j_l > 15) + j_l = 15; + l = qMax(l, j_l); + } + if (right) + { + j_r = abs((right[pos >> 8] >> 12)); + if (j_r > 15) + j_r = 15; + r = qMax(r, j_r); + } + } + m_l -= 0.5; + m_l = m_l > l ? m_l : l; + m_r -= 0.5; + m_r = m_r > r ? m_r : r; +} + +void ShadedVisual::draw (QPainter *p) +{ + for (int i = 0; i < m_l; ++i) + { + p->fillRect (i*3*m_ratio, 0, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); + } + for (int i = 0; i < m_r; ++i) + { + p->fillRect (i*3*m_ratio, 3*m_ratio, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); + } +} + +void ShadedVisual::paintEvent (QPaintEvent *) +{ + QPainter painter (this); + painter.drawPixmap (0,0,m_pixmap); +} + +void ShadedVisual::hideEvent (QHideEvent *) +{ + m_timer->stop(); +} + +void ShadedVisual::showEvent (QShowEvent *) +{ + m_timer->start(); +} + +void ShadedVisual::updateSkin() +{ + m_ratio = m_skin->ratio(); + resize(m_ratio*38,m_ratio*5); + m_pixmap = QPixmap (m_ratio*38,m_ratio*5); + clear(); +} diff --git a/src/plugins/Ui/skinned/shadedvisual.h b/src/plugins/Ui/skinned/shadedvisual.h new file mode 100644 index 000000000..0592ec78f --- /dev/null +++ b/src/plugins/Ui/skinned/shadedvisual.h @@ -0,0 +1,70 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SHADEDVISUAL_H +#define SHADEDVISUAL_H + +#include +#include +#include + +class QTimer; +class QPixmap; +class Skin; +//class VisualNode; + +/** + @author Ilya Kotov +*/ +class ShadedVisual : public Visual +{ + Q_OBJECT +public: + ShadedVisual(QWidget *parent = 0); + + ~ShadedVisual(); + + void add(unsigned char *data, qint64 size, int chan); + void clear(); + + void paintEvent (QPaintEvent *); + void hideEvent (QHideEvent *); + void showEvent (QShowEvent *); + +public slots: + void timeout(); + +private slots: + void updateSkin(); + +private: + void process (short *l, short *r); + void draw (QPainter *); + Skin *m_skin; + QTimer *m_timer; + QPixmap m_pixmap; + short *m_left_buffer; + short *m_right_buffer; + int m_buffer_at; + double m_l, m_r; + int m_ratio; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/shortcutdialog.cpp b/src/plugins/Ui/skinned/shortcutdialog.cpp new file mode 100644 index 000000000..421c08169 --- /dev/null +++ b/src/plugins/Ui/skinned/shortcutdialog.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include "shortcutdialog.h" + +ShortcutDialog::ShortcutDialog(const QString &key, QWidget *parent) + : QDialog(parent) +{ + ui.setupUi(this); + ui.keyLineEdit->setText(key); +} + +ShortcutDialog::~ShortcutDialog() +{ +} + +void ShortcutDialog::keyPressEvent (QKeyEvent *event) +{ + int key = event->key(); + switch (key) + { + case Qt::Key_Shift: + case Qt::Key_Control: + case Qt::Key_Meta: + case Qt::Key_Alt: + case Qt::Key_AltGr: + case Qt::Key_Super_L: + case Qt::Key_Super_R: + case Qt::Key_Menu: + case 0: + case Qt::Key_unknown: + key = 0; + ui.keyLineEdit->clear(); + QWidget::keyPressEvent(event); + return; + } + QKeySequence seq(event->modifiers() + event->key()); + ui.keyLineEdit->setText(seq.toString()); + QWidget::keyPressEvent(event); +} + +const QString ShortcutDialog::key() +{ + return ui.keyLineEdit->text(); +} diff --git a/src/plugins/Ui/skinned/shortcutdialog.h b/src/plugins/Ui/skinned/shortcutdialog.h new file mode 100644 index 000000000..62aedd5a5 --- /dev/null +++ b/src/plugins/Ui/skinned/shortcutdialog.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SHORTCUTDIALOG_H +#define SHORTCUTDIALOG_H + +#include +#include "ui_shortcutdialog.h" + +class QKeyEvent; + +/** + @author Ilya Kotov +*/ +class ShortcutDialog : public QDialog +{ + Q_OBJECT +public: + ShortcutDialog(const QString &key, QWidget *parent = 0); + + ~ShortcutDialog(); + + const QString key(); + +protected: + virtual void keyPressEvent (QKeyEvent *event); + +private: + Ui::ShortcutDialog ui; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/shortcutitem.cpp b/src/plugins/Ui/skinned/shortcutitem.cpp new file mode 100644 index 000000000..eb8baf164 --- /dev/null +++ b/src/plugins/Ui/skinned/shortcutitem.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include "actionmanager.h" +#include "shortcutitem.h" + +ShortcutItem::ShortcutItem(QTreeWidgetItem *parent, int type) : QTreeWidgetItem(parent, QStringList() + << ActionManager::instance()->action(type)->text().remove("&") + << ActionManager::instance()->action(type)->shortcut()) +{ + m_action = ActionManager::instance()->action(type); + setIcon(0, m_action->icon()); +} + +ShortcutItem::~ShortcutItem() +{} + +QAction *ShortcutItem::action() +{ + return m_action; +} diff --git a/src/plugins/Ui/skinned/shortcutitem.h b/src/plugins/Ui/skinned/shortcutitem.h new file mode 100644 index 000000000..a8cbd9f7c --- /dev/null +++ b/src/plugins/Ui/skinned/shortcutitem.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SHORTCUTITEM_H +#define SHORTCUTITEM_H + +#include + +class QWidget; +class QAction; + +/** + @author Ilya Kotov +*/ + +class ShortcutItem : public QTreeWidgetItem +{ +public: + + ShortcutItem(QTreeWidgetItem *parent, int type); + ~ShortcutItem(); + QAction *action(); + +private: + QAction *m_action; + +}; + +#endif //SHORTCUTITEM_H diff --git a/src/plugins/Ui/skinned/skin.cpp b/src/plugins/Ui/skinned/skin.cpp new file mode 100644 index 000000000..c17471d2f --- /dev/null +++ b/src/plugins/Ui/skinned/skin.cpp @@ -0,0 +1,852 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * Based on Promoe, an XMMS2 Client * + * Copyright (C) 2005-2006 by XMMS2 Team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "actionmanager.h" +#include "skin.h" +#include "cursorimage.h" + +Skin *Skin::m_instance = 0; + +Skin *Skin::instance() +{ + if (!m_instance) + m_instance = new Skin(); + return m_instance; +} + +QPixmap Skin::getPixmap (const QString& name, QDir dir) +{ + dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = dir.entryInfoList(); + for (int j = 0; j < f.size(); ++j) + { + QFileInfo fileInfo = f.at (j); + QString fn = fileInfo.fileName().toLower(); + if (fn.section (".",0,0) == name) + { + return QPixmap (fileInfo.filePath()); + } + } + return QPixmap(); +} + +Skin::Skin (QObject *parent) : QObject (parent) +{ + m_instance = this; + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + QString path = settings.value("General/skin_path").toString(); + if (path.isEmpty() || !QDir(path).exists ()) + path = ":/default"; + m_double_size = settings.value("General/double_size", false).toBool(); + ACTION(ActionManager::WM_DOUBLE_SIZE)->setChecked(m_double_size); + setSkin (QDir::cleanPath(path)); + /* skin directory */ + QDir skinDir(QDir::homePath()+"/.qmmp"); + skinDir.mkdir ("skins"); +} + +Skin::~Skin() +{} + +void Skin::setSkin (const QString& path) +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_use_cursors = settings.value("General/skin_cursors", false).toBool(); + m_double_size = ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked(); + settings.setValue("General/skin_path",path); + qDebug ("Skin: using %s",qPrintable(path)); + m_skin_dir = QDir (path); + //clear old values + m_pledit_txt.clear(); + buttons.clear(); + titlebar.clear(); + m_numbers.clear(); + m_pl_parts.clear(); + m_eq_parts.clear(); + m_eq_bar.clear(); + m_eq_spline.clear(); + m_vis_colors.clear(); + cursors.clear(); + //load skin parts + loadPLEdit(); + loadMain(); + loadButtons(); + loadShufRep(); + loadTitleBar(); + loadPosBar(); + loadNumbers(); + loadPlayList(); + loadEq_ex(); + loadEqMain(); + loadVisColor(); + loadLetters(); + loadMonoSter(); + loadVolume(); + loadBalance(); + loadRegion(); + loadCursors(); + if(m_double_size) + { + uint key; + foreach(key, buttons.keys()) + buttons[key] = scalePixmap(buttons[key]); + foreach(key, titlebar.keys()) + titlebar[key] = scalePixmap(titlebar[key]); + foreach(key, m_pl_parts.keys()) + m_pl_parts[key] = scalePixmap(m_pl_parts[key]); + foreach(key, m_eq_parts.keys()) + m_eq_parts[key] = scalePixmap(m_eq_parts[key]); + foreach(key, m_ms_parts.keys()) + m_ms_parts[key] = scalePixmap(m_ms_parts[key]); + foreach(key, m_parts.keys()) + m_parts[key] = scalePixmap(m_parts[key]); + foreach(QChar c, m_letters.keys()) + m_letters[c] = scalePixmap(m_letters[c]); + m_main = scalePixmap(m_main); + posbar = scalePixmap(posbar); + int i; + for(i = 0; i < m_numbers.size(); ++i) + m_numbers[i] = scalePixmap(m_numbers[i]); + + for(i = 0; i < m_eq_bar.size(); ++i) + m_eq_bar[i] = scalePixmap(m_eq_bar[i]); + + for(i = 0; i < m_eq_spline.size(); ++i) + m_eq_spline[i] = scalePixmap(m_eq_spline[i]); + + for(i = 0; i < m_volume.size(); ++i) + m_volume[i] = scalePixmap(m_volume[i]); + for(i = 0; i < m_balance.size(); ++i) + m_balance[i] = scalePixmap(m_balance[i]); + } + emit skinChanged(); +} + +void Skin::reloadSkin() +{ + setSkin (m_skin_dir.absolutePath ()); +} + +void Skin::loadMain() +{ + QPixmap *pixmap = getPixmap ("main"); + if (!pixmap) + pixmap = getDummyPixmap("main"); + + m_main = pixmap->copy (0,0,275,116); + delete pixmap; +} + +void Skin::loadCursors() +{ + if(!m_use_cursors) + { + for(int i = CUR_NORMAL; i <= CUR_WSWINBUT; ++i) + cursors[i] = QCursor(Qt::ArrowCursor); + cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); + return; + } + cursors[CUR_NORMAL] = createCursor(getPath("normal")); + cursors[CUR_CLOSE] = createCursor(getPath("close")); + cursors[CUR_MAINMENU] = createCursor(getPath("mainmenu")); + cursors[CUR_MIN] = createCursor(getPath("min")); + cursors[CUR_POSBAR] = createCursor(getPath("posbar.cur")); + cursors[CUR_SONGNAME] = createCursor(getPath("songname")); + cursors[CUR_TITLEBAR] = createCursor(getPath("titlebar.cur")); + cursors[CUR_VOLBAL] = createCursor(getPath("volbal")); + cursors[CUR_WINBUT] = createCursor(getPath("winbut")); + + cursors[CUR_WSNORMAL] = createCursor(getPath("wsnormal")); + cursors[CUR_WSPOSBAR] = createCursor(getPath("wsposbar")); + + cursors[CUR_EQCLOSE] = createCursor(getPath("eqclose")); + cursors[CUR_EQNORMAL] = createCursor(getPath("eqnormal")); + cursors[CUR_EQSLID] = createCursor(getPath("eqslid")); + cursors[CUR_EQTITLE] = createCursor(getPath("eqtitle")); + + cursors[CUR_PCLOSE] = createCursor(getPath("pclose")); + cursors[CUR_PNORMAL] = createCursor(getPath("pnormal")); + cursors[CUR_PSIZE] = createCursor(getPath("psize")); + if(cursors[CUR_PSIZE].shape() == Qt::ArrowCursor) + cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); + cursors[CUR_PTBAR] = createCursor(getPath("ptbar")); + cursors[CUR_PVSCROLL] = createCursor(getPath("pvscroll")); + cursors[CUR_PWINBUT] = createCursor(getPath("pwinbut")); + + cursors[CUR_PWSNORM] = createCursor(getPath("pwsnorm")); + cursors[CUR_PWSSIZE] = createCursor(getPath("pwssize")); + + cursors[CUR_VOLBAR] = createCursor(getPath("volbar")); + cursors[CUR_WSCLOSE] = createCursor(getPath("wsclose")); + cursors[CUR_WSMIN] = createCursor(getPath("wsmin")); + cursors[CUR_WSWINBUT] = createCursor(getPath("wswinbut")); +} + +void Skin::loadButtons() +{ + + QPixmap *pixmap = getPixmap ("cbuttons"); + + if (!pixmap) + pixmap = getDummyPixmap("cbuttons"); + + buttons[BT_PREVIOUS_N] = pixmap->copy (0, 0,23,18); + buttons[BT_PREVIOUS_P] = pixmap->copy (0,18,23,18); + + buttons[BT_PLAY_N] = pixmap->copy (23, 0,23,18); + buttons[BT_PLAY_P] = pixmap->copy (23,18,23,18); + + buttons[BT_PAUSE_N] = pixmap->copy (46, 0,23,18); + buttons[BT_PAUSE_P] = pixmap->copy (46,18,23,18); + + buttons[BT_STOP_N] = pixmap->copy (69, 0,23,18); + buttons[BT_STOP_P] = pixmap->copy (69,18,23,18); + + buttons[BT_NEXT_N] = pixmap->copy (92, 0,22,18); + buttons[BT_NEXT_P] = pixmap->copy (92,18,22,18); + + buttons[BT_EJECT_N] = pixmap->copy (114, 0,22,16); + buttons[BT_EJECT_P] = pixmap->copy (114,16,22,16); + delete pixmap; +} + +void Skin::loadTitleBar() +{ + QPixmap *pixmap = getPixmap ("titlebar"); + + if (!pixmap) + pixmap = getDummyPixmap("titlebar"); + + buttons[BT_MENU_N] = pixmap->copy (0,0,9,9); + buttons[BT_MENU_P] = pixmap->copy (0,9,9,9); + buttons[BT_MINIMIZE_N] = pixmap->copy (9,0,9,9); + buttons[BT_MINIMIZE_P] = pixmap->copy (9,9,9,9); + buttons[BT_CLOSE_N] = pixmap->copy (18,0,9,9); + buttons[BT_CLOSE_P] = pixmap->copy (18,9,9,9); + buttons[BT_SHADE1_N] = pixmap->copy (0,18,9,9); + buttons[BT_SHADE1_P] = pixmap->copy (9,18,9,9); + buttons[BT_SHADE2_N] = pixmap->copy (0,27,9,9); + buttons[BT_SHADE2_P] = pixmap->copy (9,27,9,9); + titlebar[TITLEBAR_A] = pixmap->copy (27, 0,275,14); + titlebar[TITLEBAR_I] = pixmap->copy (27,15,275,14); + titlebar[TITLEBAR_SHADED_A] = pixmap->copy (27,29,275,14); + titlebar[TITLEBAR_SHADED_I] = pixmap->copy (27,42,275,14); + delete pixmap; +} + +void Skin::loadPosBar() +{ + QPixmap *pixmap = getPixmap ("posbar"); + + if (!pixmap) + pixmap = getDummyPixmap("posbar"); + + if (pixmap->width() > 249) + { + buttons[BT_POSBAR_N] = pixmap->copy (248,0,29, pixmap->height()); + buttons[BT_POSBAR_P] = pixmap->copy (278,0,29, pixmap->height()); + } + else + { + QPixmap dummy(29, pixmap->height()); + dummy.fill(Qt::transparent); + buttons[BT_POSBAR_N] = dummy; + buttons[BT_POSBAR_P] = dummy; + } + posbar = pixmap->copy (0,0,248,pixmap->height()); + delete pixmap; +} + +void Skin::loadNumbers() +{ + QPixmap *pixmap = getPixmap ("nums_ex"); + if (!pixmap) + pixmap = getPixmap ("numbers"); + if (!pixmap) + pixmap = getDummyPixmap("numbers"); + + for (uint i = 0; i < 10; i++) + m_numbers << pixmap->copy (i*9, 0, 9, pixmap->height()); + + if (pixmap->width() > 107) + m_numbers << pixmap->copy(99, 0, 9, pixmap->height()); + else + { + // We didn't find "-" symbol. So we have to extract it from "2". + // Winamp uses this method too. + QPixmap pix; + if(pixmap->width() > 98) + pix = pixmap->copy(90,0,9,pixmap->height()); + else + { + pix = QPixmap(9, pixmap->height()); + pix.fill(Qt::transparent); + } + QPixmap minus = pixmap->copy(18,pixmap->height()/2,9,1); + QPainter paint(&pix); + paint.drawPixmap(0,pixmap->height()/2, minus); + m_numbers << pix; + } + delete pixmap; +} + +void Skin::loadPlayList() +{ + QPixmap *pixmap = getPixmap ("pledit"); + + if (!pixmap) + pixmap = getDummyPixmap("pledit"); + + m_pl_parts[PL_CORNER_UL_A] = pixmap->copy (0,0,25,20); + m_pl_parts[PL_CORNER_UL_I] = pixmap->copy (0,21,25,20); + + m_pl_parts[PL_CORNER_UR_A] = pixmap->copy (153,0,25,20); + m_pl_parts[PL_CORNER_UR_I] = pixmap->copy (153,21,25,20); + + m_pl_parts[PL_TITLEBAR_A] = pixmap->copy (26,0,100,20); + m_pl_parts[PL_TITLEBAR_I] = pixmap->copy (26,21,100,20); + + m_pl_parts[PL_TFILL1_A] = pixmap->copy (127,0,25,20); + m_pl_parts[PL_TFILL1_I] = pixmap->copy (127,21,25,20); + + //m_pl_parts[PL_TFILL2_A] = pixmap->copy();//FIXME: ����� + //m_pl_parts[PL_TFILL2_I] = pixmap->copy(); + + m_pl_parts[PL_LFILL] = pixmap->copy (0,42,12,29); + m_pl_parts[PL_RFILL] = pixmap->copy (31,42,20,29); //??? + + m_pl_parts[PL_LSBAR] = pixmap->copy (0,72,125,38); + m_pl_parts[PL_RSBAR] = pixmap->copy (126,72,150,38); + m_pl_parts[PL_SFILL1] = pixmap->copy (179,0,25,38); + m_pl_parts[PL_SFILL2] = pixmap->copy (250,21,75,38); + m_pl_parts[PL_TITLEBAR_SHADED1_A] = pixmap->copy (99,42,50,14); + m_pl_parts[PL_TITLEBAR_SHADED1_I] = pixmap->copy (99,57,50,14); + m_pl_parts[PL_TITLEBAR_SHADED2] = pixmap->copy (72,42,25,14); + m_pl_parts[PL_TFILL_SHADED] = pixmap->copy (72,57,25,14); + + m_pl_parts[PL_CONTROL] = pixmap->copy(129,94,60,8); + + buttons[PL_BT_ADD] = pixmap->copy (11,80,25,18); + buttons[PL_BT_SUB] = pixmap->copy (40,80,25,18); + buttons[PL_BT_SEL] = pixmap->copy (70,80,25,18); + buttons[PL_BT_SORT] = pixmap->copy (99,80,25,18); + buttons[PL_BT_LST] = pixmap->copy(229, 80, 25, 18); + buttons[PL_BT_SCROLL_N] = pixmap->copy (52,53,8,18); + buttons[PL_BT_SCROLL_P] = pixmap->copy (61,53,8,18); + + buttons[PL_BT_CLOSE_N] = pixmap->copy (167,3,9,9); + buttons[PL_BT_CLOSE_P] = pixmap->copy (52,42,9,9); + buttons[PL_BT_SHADE1_N] = pixmap->copy (158,3,9,9); + buttons[PL_BT_SHADE1_P] = pixmap->copy (62,42,9,9); + buttons[PL_BT_SHADE2_N] = pixmap->copy (129,45,9,9); + buttons[PL_BT_SHADE2_P] = pixmap->copy (150,42,9,9); + +} + +QPixmap *Skin::getPixmap (const QString& name) +{ + m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = m_skin_dir.entryInfoList(); + for (int j = 0; j < f.size(); ++j) + { + QFileInfo fileInfo = f.at (j); + QString fn = fileInfo.fileName().toLower(); + if (fn.section (".",0,0) == name) + { + return new QPixmap (fileInfo.filePath()); + } + } + return 0; +} + +QString Skin::getPath (const QString& name) +{ + m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = m_skin_dir.entryInfoList(); + bool nameHasExt = name.contains('.'); + for (int j = 0; j < f.size(); ++j) + { + QFileInfo fileInfo = f.at (j); + QString fn = fileInfo.fileName().toLower(); + if (!nameHasExt && fn.section (".",0,0) == name) + { + return fileInfo.filePath(); + } else if (nameHasExt && fn == name) + { + return fileInfo.filePath(); + } + } + return QString(); +} + + +void Skin::loadPLEdit() +{ + QString path = findFile("pledit.txt", m_skin_dir); + if (path.isEmpty()) + path = findFile("pledit.txt", ":/default"); + if (path.isEmpty()) + qFatal("Skin: invalid default skin"); + + QFile file(path); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + qFatal("Skin: unable to open %s", qPrintable(path)); + + while (!file.atEnd ()) + { + QByteArray line = file.readLine (); + QList l = line.split ('='); + if (l.count () == 2) + { + m_pledit_txt[l[0].toLower () ] = l[1].trimmed(); + } + else if (line.length() == 0) + { + break; + } + } + if (!m_pledit_txt.keys().contains("mbbg")) + m_pledit_txt["mbbg"] = m_pledit_txt["normalbg"]; + if (!m_pledit_txt.keys().contains("mbfg")) + m_pledit_txt["mbfg"] = m_pledit_txt["normal"]; +} + +void Skin::loadEqMain() +{ + QPixmap *pixmap = getPixmap ("eqmain"); + + if (!pixmap) + pixmap = getDummyPixmap("eqmain"); + + m_eq_parts[ EQ_MAIN ] = pixmap->copy (0,0,275,116); + m_eq_parts[ EQ_TITLEBAR_A ] = pixmap->copy (0,134,275,14); + m_eq_parts[ EQ_TITLEBAR_I ] = pixmap->copy (0,149,275,14); + + if (pixmap->height() > 295) + m_eq_parts[ EQ_GRAPH ] = pixmap->copy (0,294,113,19); + else + m_eq_parts[ EQ_GRAPH ] = QPixmap(); + + for (int i = 0; i < 14; ++i) + { + m_eq_bar << pixmap->copy (13 + i*15,164,14,63); + } + for (int i = 0; i < 14; ++i) + { + m_eq_bar << pixmap->copy (13 + i*15,229,14,63); + } + buttons[ EQ_BT_BAR_N ] = pixmap->copy (0,164,11,11); + buttons[ EQ_BT_BAR_P ] = pixmap->copy (0,164+12,11,11); + + buttons[ EQ_BT_ON_N ] = pixmap->copy (69,119,28,12); + buttons[ EQ_BT_ON_P ] = pixmap->copy (128,119,28,12); + buttons[ EQ_BT_OFF_N ] = pixmap->copy (10, 119,28,12); + buttons[ EQ_BT_OFF_P ] = pixmap->copy (187,119,28,12); + + buttons[ EQ_BT_PRESETS_N ] = pixmap->copy (224,164,44,12); + buttons[ EQ_BT_PRESETS_P ] = pixmap->copy (224,176,44,12); + + buttons[ EQ_BT_AUTO_1_N ] = pixmap->copy (94,119,33,12); + buttons[ EQ_BT_AUTO_1_P ] = pixmap->copy (153,119,33,12); + buttons[ EQ_BT_AUTO_0_N ] = pixmap->copy (35, 119,33,12); + buttons[ EQ_BT_AUTO_0_P ] = pixmap->copy (212,119,33,12); + + buttons[ EQ_BT_CLOSE_N ] = pixmap->copy (0,116,9,9); + buttons[ EQ_BT_CLOSE_P ] = pixmap->copy (0,125,9,9); + buttons[ EQ_BT_SHADE1_N ] = pixmap->copy (254,137,9,9); + + for (int i = 0; i < 19; ++i) + { + m_eq_spline << pixmap->copy (115, 294+i, 1, 1); + } + delete pixmap; +} + +void Skin::loadEq_ex() +{ + QPixmap *pixmap = getPixmap ("eq_ex"); + + if (!pixmap) + pixmap = getDummyPixmap("eq_ex"); + + buttons[ EQ_BT_SHADE1_P ] = pixmap->copy (1,38,9,9); + buttons[ EQ_BT_SHADE2_N ] = pixmap->copy (254,3,9,9); + buttons[ EQ_BT_SHADE2_P ] = pixmap->copy (1,47,9,9); + m_eq_parts[ EQ_TITLEBAR_SHADED_A ] = pixmap->copy(0,0,275,14); + m_eq_parts[ EQ_TITLEBAR_SHADED_I ] = pixmap->copy(0,15,275,14); + m_eq_parts[ EQ_VOLUME1 ] = pixmap->copy(1,30,3,8); + m_eq_parts[ EQ_VOLUME2 ] = pixmap->copy(4,30,3,8); + m_eq_parts[ EQ_VOLUME3 ] = pixmap->copy(7,30,3,8); + m_eq_parts[ EQ_BALANCE1 ] = pixmap->copy(11,30,3,8); + m_eq_parts[ EQ_BALANCE2 ] = pixmap->copy(14,30,3,8); + m_eq_parts[ EQ_BALANCE3 ] = pixmap->copy(17,30,3,8); + + delete pixmap; +} + +void Skin::loadVisColor() +{ + QString path = findFile("viscolor.txt", m_skin_dir); + if (path.isEmpty()) + path = findFile("viscolor.txt", ":/default"); + if (path.isEmpty()) + qFatal("Skin: invalid default skin"); + + QFile file(path); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + qFatal("Skin: unable to open %s", qPrintable(path)); + + int j = 0; + while (!file.atEnd () && j<24) + { + j++; + QByteArray line = file.readLine (); + QString tmp = QString::fromAscii (line); + tmp = tmp.trimmed (); + int i = tmp.indexOf ("//"); + if (i>0) + tmp.truncate (tmp.indexOf ("//")); + QStringList list = tmp.split (","); + if (list.count () >= 3) + { + //colors + int r = list.at (0).toInt(); + int g = list.at (1).toInt(); + int b = list.at (2).toInt(); + m_vis_colors << QColor (r,g,b); + } + else if (line.length() == 0) + { + break; + } + } + if (m_vis_colors.size() < 24) + { + qWarning ("Skin: cannot parse viscolor.txt"); + while (m_vis_colors.size() < 24) + m_vis_colors << QColor (0,0,0); + } +} + +void Skin::loadShufRep() +{ + QPixmap *pixmap = getPixmap ("shufrep"); + + if (!pixmap) + pixmap = getDummyPixmap("shufrep"); + + buttons[ BT_EQ_ON_N ] = pixmap->copy (0,73,23,12); + buttons[ BT_EQ_ON_P ] = pixmap->copy (46,73,23,12); + buttons[ BT_EQ_OFF_N ] = pixmap->copy (0,61,23,12); + buttons[ BT_EQ_OFF_P ] = pixmap->copy (46,61,23,12); + + buttons[ BT_PL_ON_N ] = pixmap->copy (23,73,23,12); + buttons[ BT_PL_ON_P ] = pixmap->copy (69,73,23,12); + buttons[ BT_PL_OFF_N ] = pixmap->copy (23,61,23,12); + buttons[ BT_PL_OFF_P ] = pixmap->copy (69,61,23,12); + + //buttons[ BT_PL_CLOSE_N ] = pixmap->copy (); + //buttons[ BT_PL_CLOSE_P ] = pixmap->copy (); + + buttons[REPEAT_ON_N] = pixmap->copy (0,30, 28, 15); + buttons[REPEAT_ON_P] = pixmap->copy (0,45, 28, 15); + + buttons[REPEAT_OFF_N] = pixmap->copy (0, 0,28,15); + buttons[REPEAT_OFF_P] = pixmap->copy (0,15,28,15); + + buttons[SHUFFLE_ON_N] = pixmap->copy (28,30,46,15); + buttons[SHUFFLE_ON_P] = pixmap->copy (28,45,46,15); + + buttons[SHUFFLE_OFF_N] = pixmap->copy (28, 0,46,15); + buttons[SHUFFLE_OFF_P] = pixmap->copy (28,15,46,15); + + delete pixmap; +} + +void Skin::loadLetters(void) +{ + QPixmap *img = getPixmap("text"); + + if (!img) + img = getDummyPixmap("text"); + + QList > (letters); + for (int i = 0; i < 3; i++) + { + QList (l); + for (int j = 0; j < 31; j++) + { + l.append (img->copy (j*5, i*6, 5, 6)); + } + letters.append (l); + } + + delete img; + + + /* alphabet */ + for (uint i = 97; i < 123; i++) + { + m_letters.insert(i, letters[0][i-97]); + } + + /* digits */ + for (uint i = 0; i <= 9; i++) + { + m_letters.insert (i+48, letters[1][i]); + } + + /* special characters */ + m_letters.insert('"', letters[0][27]); + m_letters.insert('@', letters[0][28]); + m_letters.insert(':', letters[1][12]); + m_letters.insert('(', letters[1][13]); + m_letters.insert(')', letters[1][14]); + m_letters.insert('-', letters[1][15]); + m_letters.insert('\'', letters[1][16]); + m_letters.insert('`', letters[1][16]); + m_letters.insert('!', letters[1][17]); + m_letters.insert('_', letters[1][18]); + m_letters.insert('+', letters[1][19]); + m_letters.insert('\\', letters[1][20]); + m_letters.insert('/', letters[1][21]); + m_letters.insert('[', letters[1][22]); + m_letters.insert(']', letters[1][23]); + m_letters.insert('^', letters[1][24]); + m_letters.insert('&', letters[1][25]); + m_letters.insert('%', letters[1][26]); + m_letters.insert('.', letters[1][27]); + m_letters.insert(',', letters[1][27]); + m_letters.insert('=', letters[1][28]); + m_letters.insert('$', letters[1][29]); + m_letters.insert('#', letters[1][30]); + + m_letters.insert(229, letters[2][0]); + m_letters.insert(246, letters[2][1]); + m_letters.insert(228, letters[2][2]); + m_letters.insert('?', letters[2][3]); + m_letters.insert('*', letters[2][4]); + m_letters.insert(' ', letters[2][5]); + + /* text background */ + //m_items->insert (TEXTBG, letters[2][6]); +} + +void Skin::loadMonoSter() +{ + QPixmap *pixmap = getPixmap("monoster"); + + if (!pixmap) + pixmap = getDummyPixmap("monoster"); + + m_ms_parts.clear(); + m_ms_parts[ MONO_A ] = pixmap->copy (29,0,27,12); + m_ms_parts[ MONO_I ] = pixmap->copy (29,12,27,12); + m_ms_parts[ STEREO_A ] = pixmap->copy (0,0,27,12); + m_ms_parts[ STEREO_I ] = pixmap->copy (0,12,27,12); + + delete pixmap; + + m_parts.clear(); + QPainter paint; + pixmap = getPixmap("playpaus"); + + if (!pixmap) + pixmap = getDummyPixmap("playpaus"); + + QPixmap part(11, 9); + paint.begin(&part); + paint.drawPixmap (0, 0, 3, 9, *pixmap, 36, 0, 3, 9); + paint.drawPixmap (3, 0, 8, 9, *pixmap, 1, 0, 8, 9); + paint.end(); + m_parts [PLAY] = part.copy(); + + part = QPixmap(11, 9); + paint.begin(&part); + paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); + paint.drawPixmap (2, 0, 9, 9, *pixmap, 9, 0, 9, 9); + paint.end(); + m_parts [PAUSE] = part.copy(); + + part = QPixmap(11, 9); + paint.begin(&part); + paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); + paint.drawPixmap (2, 0, 9, 9, *pixmap, 18, 0, 9, 9); + paint.end(); + m_parts [STOP] = part.copy(); + + delete pixmap; +} + +void Skin::loadVolume() +{ + QPixmap *pixmap = getPixmap("volume"); + + if (!pixmap) + pixmap = getDummyPixmap("volume"); + + m_volume.clear(); + for (int i = 0; i < 28; ++i) + m_volume.append(pixmap->copy (0,i*15, pixmap->width(),13)); + if (pixmap->height() > 425) + { + buttons [BT_VOL_N] = pixmap->copy (15,422,14, pixmap->height() - 422); + buttons [BT_VOL_P] = pixmap->copy (0, 422,14, pixmap->height() - 422); + } + else + { + buttons [BT_VOL_N] = QPixmap(); + buttons [BT_VOL_P] = QPixmap(); + } + delete pixmap; +} + +void Skin::loadBalance() +{ + QPixmap *pixmap = getPixmap ("balance"); + if (!pixmap) + pixmap = getPixmap ("volume"); + + if (!pixmap) + pixmap = getDummyPixmap("balance"); + + m_balance.clear(); + for (int i = 0; i < 28; ++i) + m_balance.append(pixmap->copy (9,i*15,38,13)); + if (pixmap->height() > 427) + { + buttons [BT_BAL_N] = pixmap->copy (15, 422,14,pixmap->height()-422); + buttons [BT_BAL_P] = pixmap->copy (0,422,14,pixmap->height()-422); + } + else + { + buttons [BT_BAL_N] = QPixmap(); + buttons [BT_BAL_P] = QPixmap(); + } + delete pixmap; +} + +void Skin::loadRegion() +{ + m_regions.clear(); + QString path = findFile("region.txt", m_skin_dir); + + if (path.isNull ()) + { + qDebug ("Skin: cannot find region.txt. Transparency disabled"); + return; + } + m_regions[NORMAL] = createRegion(path, "Normal"); + m_regions[EQUALIZER] = createRegion(path, "Equalizer"); + m_regions[WINDOW_SHADE] = createRegion(path, "WindowShade"); + m_regions[EQUALIZER_WS] = createRegion(path, "EqualizerWS"); +} + +QRegion Skin::createRegion(const QString &path, const QString &key) +{ + QRegion region; + QSettings settings(path, QSettings::IniFormat); + QStringList numPoints = settings.value(key+"/NumPoints").toStringList(); + QStringList value = settings.value(key+"/PointList").toStringList(); + QStringList numbers; + foreach(QString str, value) + numbers << str.split(" ", QString::SkipEmptyParts); + + QList regions; + + QList::iterator n; + n = numbers.begin(); + int r = m_double_size ? 2 : 1; + for (int i = 0; i < numPoints.size(); ++i) + { + QList lp; + for (int j = 0; j < numPoints.at(i).toInt()*2; j++) + { + lp << n->toInt(); + n ++; + } + QVector points; + + for (int l = 0; l < lp.size(); l+=2) + { + points << QPoint(lp.at(l)*r, lp.at(l+1)*r); + } + region = region.united(QRegion(QPolygon(points))); + } + return region; +} + +QPixmap * Skin::getDummyPixmap(const QString& name) +{ + QDir dir (":/default"); + dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = dir.entryInfoList(); + for (int j = 0; j < f.size(); ++j) + { + QFileInfo fileInfo = f.at (j); + QString fn = fileInfo.fileName().toLower(); + if (fn.section (".",0,0) == name) + { + return new QPixmap (fileInfo.filePath()); + } + } + qFatal("Skin: default skin is corrupted"); + return 0; +} + +QPixmap Skin::scalePixmap(const QPixmap &pix, int ratio) +{ + return pix.scaled(pix.width() * ratio, pix.height() * ratio, + Qt::KeepAspectRatio); +} + +const QString Skin::findFile(const QString &name, QDir dir) +{ + dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QString path; + QFileInfoList list = dir.entryInfoList(); + for (int i = 0; i < list.size(); ++i) + { + QFileInfo fileInfo = list.at (i); + if (fileInfo.fileName().toLower() == name) + { + path = fileInfo.filePath (); + break; + } + } + return path; +} + +const QString Skin::findFile(const QString &name, const QString &dir) +{ + return findFile(name, QDir(dir)); +} diff --git a/src/plugins/Ui/skinned/skin.h b/src/plugins/Ui/skinned/skin.h new file mode 100644 index 000000000..adb4b6c20 --- /dev/null +++ b/src/plugins/Ui/skinned/skin.h @@ -0,0 +1,390 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * Based on Promoe, an XMMS2 Client * + * Copyright (C) 2005-2006 by XMMS2 Team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef SKIN_H +#define SKIN_H + +#include +#include +#include +#include +#include +#include + +class Skin : public QObject +{ + Q_OBJECT +public: + Skin(QObject *parent = 0); + + ~Skin(); + + static Skin *instance(); + static QPixmap getPixmap(const QString&, QDir); + int ratio() + { + return m_double_size ? 2 : 1; + } + const QPixmap getMain() const + { + return m_main; + } + const QPixmap getButton(uint bt) const + { + return buttons[bt]; + } + const QCursor getCursor(uint cu) const + { + return cursors[cu]; + } + const QPixmap getTitleBar(uint tb) const + { + return titlebar[tb]; + } + const QPixmap getPosBar() const + { + return posbar; + } + const QPixmap getNumber(uint n) const + { + return m_numbers[n]; + } + /*! + * Returns count of numbers in number list. + * We need this to check if we have "-" in pixmaps. + * if no we should draw it manually. + */ + uint getNumCount(void) const + { + return m_numbers.count(); + } + const QPixmap getPlPart(uint p) const + { + return m_pl_parts[p]; + } + const QPixmap getEqPart(uint p) const + { + return m_eq_parts[p]; + } + const QPixmap getEqSlider(uint n) const + { + return m_eq_bar[n]; + } + const QPixmap getEqSpline(uint n) const + { + return m_eq_spline[n]; + } + const QPixmap getMSPart(uint n) const + { + return m_ms_parts[n]; + } + const QPixmap getLetter(const QChar& ch) const + { + return m_letters[ch]; + } + const QPixmap getItem(uint n) const + { + return m_parts[n]; + } + const QPixmap getVolumeBar(int n) const + { + return m_volume[n]; + } + const QPixmap getBalanceBar(int n) const + { + return m_balance[n]; + } + const QByteArray getPLValue (QByteArray c) const + { + return m_pledit_txt[c]; + } + const QColor getVisColor(int n) const + { + return m_vis_colors[n]; + } + const QRegion getRegion(uint r) const + { + return m_regions[r]; + } + + enum Buttons + { + BT_PREVIOUS_N = 0, + BT_PREVIOUS_P, + BT_PLAY_N, + BT_PLAY_P, + BT_PAUSE_N, + BT_PAUSE_P, + BT_STOP_N, + BT_STOP_P, + BT_NEXT_N, + BT_NEXT_P, + BT_EJECT_N, + BT_EJECT_P, + /*titlebar.* */ + BT_MENU_N, + BT_MENU_P, + BT_MINIMIZE_N, + BT_MINIMIZE_P, + BT_CLOSE_N, + BT_CLOSE_P, + BT_SHADE1_N, + BT_SHADE1_P, + BT_SHADE2_N, + BT_SHADE2_P, + BT_CLOSE_SHADED_N, + BT_CLOSE_SHADED_P, + + /* posbar.* */ + BT_POSBAR_N, + BT_POSBAR_P, + /* pledit.* */ + PL_BT_ADD, + PL_BT_SUB, + PL_BT_SEL, + PL_BT_SORT, + PL_BT_LST, + PL_BT_SCROLL_N, + PL_BT_SCROLL_P, + PL_BT_CLOSE_N, + PL_BT_CLOSE_P, + PL_BT_SHADE1_N, + PL_BT_SHADE1_P, + PL_BT_SHADE2_N, + PL_BT_SHADE2_P, + + /* eqmain.* */ + EQ_BT_BAR_N, + EQ_BT_BAR_P, + EQ_BT_ON_N, + EQ_BT_ON_P, + EQ_BT_OFF_N, + EQ_BT_OFF_P, + EQ_BT_PRESETS_N, + EQ_BT_PRESETS_P, + EQ_BT_AUTO_1_N, + EQ_BT_AUTO_1_P, + EQ_BT_AUTO_0_N, + EQ_BT_AUTO_0_P, + EQ_BT_CLOSE_N, + EQ_BT_CLOSE_P, + EQ_BT_SHADE1_N, + + /* eq_ex.* */ + EQ_BT_SHADE1_P, + EQ_BT_SHADE2_N, + EQ_BT_SHADE2_P, + + /* shufrep.* */ + BT_EQ_ON_N, + BT_EQ_ON_P, + BT_EQ_OFF_N, + BT_EQ_OFF_P, + BT_PL_ON_N, + BT_PL_ON_P, + BT_PL_OFF_N, + BT_PL_OFF_P, + BT_PL_CLOSE_N, + BT_PL_CLOSE_P, + REPEAT_ON_N, + REPEAT_ON_P, + REPEAT_OFF_N, + REPEAT_OFF_P, + SHUFFLE_ON_N, + SHUFFLE_ON_P, + SHUFFLE_OFF_N, + SHUFFLE_OFF_P, + /* volume.* */ + BT_VOL_N, + BT_VOL_P, + /* balance.* */ + BT_BAL_N, + BT_BAL_P, + }; + enum TitleBar + { + TITLEBAR_A = 0, + TITLEBAR_I, + TITLEBAR_SHADED_A, + TITLEBAR_SHADED_I, + }; + enum PlayList + { + PL_CORNER_UL_A = 0, + PL_CORNER_UL_I, + PL_CORNER_UR_A, + PL_CORNER_UR_I, + PL_TITLEBAR_A, + PL_TITLEBAR_I, + PL_TFILL1_A, + PL_TFILL1_I, + PL_TFILL2_A, + PL_TFILL2_I, + PL_LFILL, + PL_RFILL, + PL_LSBAR, + PL_RSBAR, + PL_SFILL1, + PL_SFILL2, + PL_CONTROL, + PL_TITLEBAR_SHADED1_A, + PL_TITLEBAR_SHADED1_I, + PL_TITLEBAR_SHADED2, + PL_TFILL_SHADED, + }; + enum Equalizer + { + EQ_MAIN = 0, + EQ_TITLEBAR_A, + EQ_TITLEBAR_I, + EQ_GRAPH, + EQ_TITLEBAR_SHADED_A, + EQ_TITLEBAR_SHADED_I, + EQ_VOLUME1, + EQ_VOLUME2, + EQ_VOLUME3, + EQ_BALANCE1, + EQ_BALANCE2, + EQ_BALANCE3, + }; + enum MonoSter + { + MONO_A = 0, + MONO_I, + STEREO_A, + STEREO_I, + }; + enum OtherParts + { + PLAY = 0, + PAUSE, + STOP, + }; + enum Regions + { + NORMAL = 0, + EQUALIZER, + WINDOW_SHADE, + EQUALIZER_WS, + }; + enum Cursors + { + CUR_NORMAL = 0, + CUR_CLOSE, + CUR_MAINMENU, + CUR_MIN, + CUR_POSBAR, + CUR_SONGNAME, + CUR_TITLEBAR, + CUR_VOLBAL, + CUR_WINBUT, + + CUR_WSNORMAL, + CUR_WSPOSBAR, + + CUR_EQCLOSE, + CUR_EQNORMAL, + CUR_EQSLID, + CUR_EQTITLE, + + CUR_PCLOSE, + CUR_PNORMAL, + CUR_PSIZE, + CUR_PTBAR, + CUR_PVSCROLL, + CUR_PWINBUT, + + CUR_PWSNORM, + CUR_PWSSIZE, + + CUR_VOLBAR, + CUR_WSCLOSE, + CUR_WSMIN, + CUR_WSWINBUT, + }; + +public slots: + void setSkin(const QString& path); + void reloadSkin(); + +signals: + void skinChanged(); + +private: + QPixmap *getPixmap(const QString&); + QString getPath(const QString&); + const QString findFile(const QString&, QDir); + const QString findFile(const QString&, const QString&); + + /*! + * As far as there is no standard in skin making we cannot be sure + * that all needful images we can find in skin :( This will cause + * segfaults and asserts. So to prevent this we need such method + * to load pixmap from default skin. + */ + QPixmap *getDummyPixmap(const QString&); + QPixmap scalePixmap(const QPixmap &pix, int ratio = 2); + static Skin *m_instance; + QDir m_skin_dir; + QMap buttons; + QMap cursors; + QMap titlebar; + QMap m_pl_parts; + QMap m_eq_parts; + QMap m_ms_parts; + QMap m_parts; + QMap m_letters; + QMap m_pledit_txt; + QMap m_regions; + QPixmap m_main; + QPixmap posbar; + QList m_numbers; + QList m_eq_bar; + QList m_eq_spline; + QList m_volume; + QList m_balance; + QList m_vis_colors; + bool m_use_cursors; + bool m_double_size; + + void loadMain(); + void loadButtons(); + void loadCursors(); + void loadTitleBar(); + void loadPosBar(); + void loadNumbers(); + void loadPlayList(); + void loadPLEdit(); + void loadEqMain(); + void loadEq_ex(); + void loadVisColor(); + void loadShufRep(); + void loadLetters(); + void loadMonoSter(); + void loadVolume(); + void loadBalance(); + void loadRegion(); + QRegion createRegion(const QString &path, const QString &key); +}; + +#endif diff --git a/src/plugins/Ui/skinned/skinned.pro b/src/plugins/Ui/skinned/skinned.pro new file mode 100644 index 000000000..f664e110d --- /dev/null +++ b/src/plugins/Ui/skinned/skinned.pro @@ -0,0 +1,166 @@ +include(../../plugins.pri) +FORMS += forms/configdialog.ui \ + forms/preseteditor.ui \ + forms/jumptotrackdialog.ui \ + forms/aboutdialog.ui \ + forms/addurldialog.ui \ + forms/playlistbrowser.ui \ + forms/popupsettings.ui \ + forms/shortcutdialog.ui +HEADERS += mainwindow.h \ + button.h \ + display.h \ + skin.h \ + titlebar.h \ + positionbar.h \ + number.h \ + playlist.h \ + listwidget.h \ + pixmapwidget.h \ + playlisttitlebar.h \ + configdialog.h \ + playlistslider.h \ + dock.h \ + eqwidget.h \ + eqtitlebar.h \ + eqslider.h \ + togglebutton.h \ + eqgraph.h \ + mainvisual.h \ + inlines.h \ + fft.h \ + textscroller.h \ + monostereo.h \ + playstatus.h \ + pluginitem.h \ + volumebar.h \ + balancebar.h \ + symboldisplay.h \ + playlistcontrol.h \ + eqpreset.h \ + preseteditor.h \ + jumptotrackdialog.h \ + aboutdialog.h \ + timeindicator.h \ + keyboardmanager.h \ + addurldialog.h \ + skinreader.h \ + visualmenu.h \ + titlebarcontrol.h \ + shadedvisual.h \ + shadedbar.h \ + cursorimage.h \ + playlistbrowser.h \ + playlistselector.h \ + popupwidget.h \ + popupsettings.h \ + windowsystem.h \ + lxdesupport.h \ + actionmanager.h \ + shortcutitem.h \ + shortcutdialog.h \ + skinnedfactory.h +SOURCES += mainwindow.cpp \ + button.cpp \ + display.cpp \ + skin.cpp \ + titlebar.cpp \ + positionbar.cpp \ + number.cpp \ + playlist.cpp \ + listwidget.cpp \ + pixmapwidget.cpp \ + playlisttitlebar.cpp \ + configdialog.cpp \ + playlistslider.cpp \ + dock.cpp \ + eqwidget.cpp \ + eqtitlebar.cpp \ + eqslider.cpp \ + togglebutton.cpp \ + eqgraph.cpp \ + mainvisual.cpp \ + fft.c \ + textscroller.cpp \ + monostereo.cpp \ + playstatus.cpp \ + pluginitem.cpp \ + volumebar.cpp \ + balancebar.cpp \ + symboldisplay.cpp \ + playlistcontrol.cpp \ + eqpreset.cpp \ + preseteditor.cpp \ + jumptotrackdialog.cpp \ + aboutdialog.cpp \ + timeindicator.cpp \ + keyboardmanager.cpp \ + addurldialog.cpp \ + skinreader.cpp \ + visualmenu.cpp \ + titlebarcontrol.cpp \ + shadedvisual.cpp \ + shadedbar.cpp \ + cursorimage.cpp \ + playlistbrowser.cpp \ + playlistselector.cpp \ + popupwidget.cpp \ + popupsettings.cpp \ + windowsystem.cpp \ + lxdesupport.cpp \ + actionmanager.cpp \ + shortcutitem.cpp \ + shortcutdialog.cpp \ + skinnedfactory.cpp + + +QT += network +TEMPLATE = lib +unix:QMAKE_LIBDIR += ../../../../lib +unix:LIBS += -lqmmpui -lqmmp + +win32:QMAKE_LIBDIR += ../../../../bin +win32:LIBS += -lqmmpui0 -lqmmp0 + +CONFIG += release \ + warn_on \ + plugin + + +TARGET =$$PLUGINS_PREFIX/Ui/skinned + +unix:LIBS += -lqmmp -lqmmpui +win32:LIBS += -lqmmp0 -lqmmpui0 + +RESOURCES = images/images.qrc stuff.qrc + +unix{ +isEmpty(LIB_DIR){ + LIB_DIR = /lib +} +target.path = $$LIB_DIR/qmmp/Ui +INSTALLS += target +} + +INCLUDEPATH += ../../../ + +RESOURCES += translations/qmmp_locales.qrc +TRANSLATIONS = translations/qmmp_ru.ts \ + translations/qmmp_tr.ts \ + translations/qmmp_zh_CN.ts \ + translations/qmmp_cs.ts \ + translations/qmmp_pt_BR.ts \ + translations/qmmp_uk_UA.ts \ + translations/qmmp_zh_TW.ts \ + translations/qmmp_de.ts \ + translations/qmmp_pl_PL.ts \ + translations/qmmp_it.ts \ + translations/qmmp_lt.ts \ + translations/qmmp_hu.ts \ + translations/qmmp_nl.ts \ + translations/qmmp_ja.ts \ + translations/qmmp_es.ts \ + translations/qmmp_sk.ts + + CONFIG += link_pkgconfig + PKGCONFIG += x11 diff --git a/src/plugins/Ui/skinned/skinnedfactory.cpp b/src/plugins/Ui/skinned/skinnedfactory.cpp new file mode 100644 index 000000000..b220f2ca8 --- /dev/null +++ b/src/plugins/Ui/skinned/skinnedfactory.cpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include "mainwindow.h" +#include "skinnedfactory.h" + +const UiProperties SkinnedFactory::properties() const +{ + UiProperties props; + return props; +} + +QObject *SkinnedFactory::SkinnedFactory::create() +{ + return new MainWindow(); +} + +void SkinnedFactory::showAbout(QWidget *parent){} + +QTranslator *SkinnedFactory::createTranslator(QObject *parent) +{ + return 0; +} + +Q_EXPORT_PLUGIN2(skinned, SkinnedFactory) diff --git a/src/plugins/Ui/skinned/skinnedfactory.h b/src/plugins/Ui/skinned/skinnedfactory.h new file mode 100644 index 000000000..f8fb8aef9 --- /dev/null +++ b/src/plugins/Ui/skinned/skinnedfactory.h @@ -0,0 +1,42 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SKINNEDFACTORY_H +#define SKINNEDFACTORY_H + +#include +#include +#include + + +/*! + * @author Ilya Kotov + */ +class SkinnedFactory : public QObject, public UiFactory +{ + Q_OBJECT + Q_INTERFACES(UiFactory) +public: + const UiProperties properties() const; + QObject *create(); + void showAbout(QWidget *parent); + QTranslator *createTranslator(QObject *parent); +}; + +#endif diff --git a/src/plugins/Ui/skinned/skinreader.cpp b/src/plugins/Ui/skinned/skinreader.cpp new file mode 100644 index 000000000..390ac4b8b --- /dev/null +++ b/src/plugins/Ui/skinned/skinreader.cpp @@ -0,0 +1,207 @@ +/*************************************************************************** + * Copyright (C) 2008 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "skinreader.h" + +SkinReader::SkinReader(QObject *parent) + : QObject(parent) +{ + m_process = new QProcess(this); + //create cache dir + QDir dir(QDir::homePath() +"/.qmmp/"); + dir.mkdir("cache"); + dir.cd("cache"); + dir.mkdir("thumbs"); + dir.mkdir("skin"); +} + + +SkinReader::~SkinReader() +{} + +void SkinReader::generateThumbs() +{ + m_previewMap.clear(); + QDir dir(QDir::homePath() +"/.qmmp/skins"); + dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = dir.entryInfoList(); + dir.setPath(qApp->applicationDirPath()+"/../share/qmmp/skins"); + dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); + f << dir.entryInfoList(); + QDir cache_dir(QDir::homePath() +"/.qmmp/cache/thumbs"); + cache_dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList d = cache_dir.entryInfoList(); + //clear removed skins from cache + foreach(QFileInfo thumbFile, d) + { + bool del = true; + foreach(QFileInfo fileInfo, f) + { + if (fileInfo.baseName () == thumbFile.baseName ()) + { + del = false; + break; + } + } + if (del) + { + qDebug("SkinReader: deleting %s from cache", + qPrintable(thumbFile.fileName ())); + + cache_dir.remove(thumbFile.fileName ()); + } + } + //add new skins to cache + foreach(QFileInfo fileInfo, f) + { + bool create = true; + foreach(QFileInfo thumbInfo, d) + { + if (fileInfo.baseName () == thumbInfo.baseName ()) + { + create = false; + break; + } + } + if (create) + { + qDebug("SkinReader: adding %s to cache", + qPrintable(fileInfo.fileName ())); + QString name = fileInfo.fileName ().toLower(); + + if (name.endsWith(".tgz") || name.endsWith(".tar.gz") || name.endsWith(".tar.bz2")) + untar(fileInfo.filePath (), cache_dir.absolutePath (), true); + if (name.endsWith(".zip") || name.endsWith(".wsz")) + unzip(fileInfo.filePath (), cache_dir.absolutePath (), true); + } + } + //add thumbs to map + cache_dir.refresh(); + d = cache_dir.entryInfoList(); + foreach(QFileInfo fileInfo, f) + { + foreach(QFileInfo thumbInfo, d) + { + if (fileInfo.baseName () == thumbInfo.baseName ()) + { + m_previewMap.insert(fileInfo.absoluteFilePath (), + thumbInfo.absoluteFilePath ()); + break; + } + } + } +} + +void SkinReader::unpackSkin(const QString &path) +{ + //remove old skin + QDir dir(QDir::homePath() +"/.qmmp/cache/skin"); + dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList f = dir.entryInfoList(); + foreach(QFileInfo file, f) + dir.remove(file.fileName()); + //unpack + if (path.endsWith(".tgz") || path.endsWith(".tar.gz") || path.endsWith(".tar.bz2")) + untar(path, QDir::homePath() +"/.qmmp/cache/skin", false); + if (path.endsWith(".zip") || path.endsWith(".wsz")) + unzip(path, QDir::homePath() +"/.qmmp/cache/skin", false); +} + +const QStringList SkinReader::skins() +{ + return m_previewMap.keys(); +} + +const QPixmap SkinReader::getPreview(const QString &skinPath) +{ + return QPixmap(m_previewMap.value(skinPath)); +} + +void SkinReader::untar(const QString &from, const QString &to, bool preview) +{ + QByteArray array; + QStringList args; + //list archive + args << "tf" <start("tar", args); + m_process->waitForFinished(); + array = m_process->readAllStandardOutput (); + QString str = QString(array); + QStringList outputList = str.split("\n", QString::SkipEmptyParts); + foreach(QString str, outputList) + { + str = str.trimmed(); + args.clear(); + if (!preview || (str.contains("/main.", Qt::CaseInsensitive) + || str.startsWith("main.", Qt::CaseInsensitive))) + { + args << "xvfk" << from << "-O" << str; + m_process->start("tar", args); + m_process->waitForStarted(); + m_process->waitForFinished(); + array = m_process->readAllStandardOutput (); + + QString name; + if (preview) + name = from.section('/',-1) + (".") + str.section('.', -1); + else + name = str.contains('/') ? str.section('/',-1).toLower() : str.toLower(); + + QFile file(to+"/"+name); + file.open(QIODevice::WriteOnly); + file.write(array); + file.close(); + } + } +} + +void SkinReader::unzip(const QString &from, const QString &to, bool preview) +{ + QStringList args; + if (preview) + { + args << "-C" << "-j" << "-o" << "-qq" << "-d" << to << from << "main.*" << "*/main.*"; + QProcess::execute("unzip", args); + QDir dir(to); + dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); + QFileInfoList fileList = dir.entryInfoList(); + foreach(QFileInfo thumbInfo, fileList) + { + if (thumbInfo.fileName().startsWith("main.", Qt::CaseInsensitive)) + { + dir.rename(thumbInfo.fileName(), from.section('/', -1) + + "." + thumbInfo.suffix ()); + } + } + } + else + { + args << "-j" << "-o" << "-qq" << "-d" << to << from; + QProcess::execute("unzip", args); + } +} diff --git a/src/plugins/Ui/skinned/skinreader.h b/src/plugins/Ui/skinned/skinreader.h new file mode 100644 index 000000000..e12e604a1 --- /dev/null +++ b/src/plugins/Ui/skinned/skinreader.h @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) 2008 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SKINREADER_H +#define SKINREADER_H + +#include +#include +#include + +/** + @author Ilya Kotov +*/ +class QProcess; + +class SkinReader : public QObject +{ + Q_OBJECT +public: + SkinReader(QObject *parent = 0); + + ~SkinReader(); + + void generateThumbs(); + void unpackSkin(const QString &path); + const QStringList skins(); + const QPixmap getPreview(const QString &skinPath); + +private: + QProcess *m_process; + void untar(const QString &from, const QString &to, bool preview); + void unzip(const QString &from, const QString &to, bool preview); + QMap m_previewMap; +}; + +#endif diff --git a/src/plugins/Ui/skinned/stuff.qrc b/src/plugins/Ui/skinned/stuff.qrc new file mode 100644 index 000000000..db6770f66 --- /dev/null +++ b/src/plugins/Ui/skinned/stuff.qrc @@ -0,0 +1,88 @@ + + + + ../../../../COPYING + + txt/description_en.txt + txt/authors_en.txt + txt/thanks_en.txt + txt/translators_en.txt + + txt/authors_uk_UA.txt + txt/thanks_uk_UA.txt + txt/translators_uk_UA.txt + txt/description_uk_UA.txt + + txt/authors_zh_TW.txt + txt/thanks_zh_TW.txt + txt/translators_zh_TW.txt + txt/description_zh_TW.txt + + txt/description_cs.txt + txt/authors_cs.txt + txt/thanks_cs.txt + txt/translators_cs.txt + + txt/authors_ru.txt + txt/thanks_ru.txt + txt/translators_ru.txt + txt/description_ru.txt + + txt/authors_zh_CN.txt + txt/thanks_zh_CN.txt + txt/translators_zh_CN.txt + txt/description_zh_CN.txt + + txt/authors_de.txt + txt/thanks_de.txt + txt/translators_de.txt + txt/description_de.txt + + txt/authors_it.txt + txt/thanks_it.txt + txt/translators_it.txt + txt/description_it.txt + + txt/authors_tr.txt + txt/thanks_tr.txt + txt/translators_tr.txt + txt/description_tr.txt + + txt/authors_lt.txt + txt/thanks_lt.txt + txt/translators_lt.txt + txt/description_lt.txt + + txt/authors_nl.txt + txt/thanks_nl.txt + txt/translators_nl.txt + txt/description_nl.txt + + txt/authors_ja.txt + txt/thanks_ja.txt + txt/translators_ja.txt + txt/description_ja.txt + + txt/authors_es.txt + txt/thanks_es.txt + txt/translators_es.txt + txt/description_es.txt + + default/balance.png + default/eqmain.png + default/numbers.png + default/pledit.txt + default/text.png + default/volume.png + default/cbuttons.png + default/main.png + default/playpaus.png + default/posbar.png + default/titlebar.png + default/eq_ex.png + default/monoster.png + default/pledit.png + default/shufrep.png + default/viscolor.txt + + diff --git a/src/plugins/Ui/skinned/symboldisplay.cpp b/src/plugins/Ui/skinned/symboldisplay.cpp new file mode 100644 index 000000000..e33533f08 --- /dev/null +++ b/src/plugins/Ui/skinned/symboldisplay.cpp @@ -0,0 +1,91 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include + +#include "skin.h" + +#include "symboldisplay.h" + +SymbolDisplay::SymbolDisplay ( QWidget *parent, int digits ) + : PixmapWidget ( parent ), m_digits ( digits ), m_text(), m_max(0) +{ + m_alignment = Qt::AlignRight; + m_skin = Skin::instance(); + connect ( m_skin, SIGNAL ( skinChanged() ), this, SLOT (draw())); + draw(); + for (int i=0; igetLetter ( ' ' ); + int w = bg.size().width(); + int h = bg.size().height(); + QPixmap tmp ( m_digits*w,h ); + QPainter paint ( &tmp ); + int j; + for ( int i = 0; i < m_digits; ++i ) + { + if (m_alignment == Qt::AlignRight) // TODO: add align Center + { + j = str.size() -1 - i; + if ( j >= 0 ) + paint.drawPixmap ( ( m_digits-1-i ) *w,0,m_skin->getLetter ( str.at ( j ) ) ); + else + paint.drawPixmap ( ( m_digits-1-i ) *w,0,m_skin->getLetter ( ' ' ) ); + } + else + { + if (i < str.size()) + paint.drawPixmap ( i * w,0,m_skin->getLetter ( str.at ( i ) ) ); + else + paint.drawPixmap ( i * w,0,m_skin->getLetter ( ' ' ) ); + ; + } + } + setPixmap(tmp); +} + +void SymbolDisplay::display(int val) +{ + if (val < m_max) + display(QString::number(val)); + else + display(QString("%1h").arg(val/100)); +} + diff --git a/src/plugins/Ui/skinned/symboldisplay.h b/src/plugins/Ui/skinned/symboldisplay.h new file mode 100644 index 000000000..720bad315 --- /dev/null +++ b/src/plugins/Ui/skinned/symboldisplay.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2006-2008 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SYMBOLDISPLAY_H +#define SYMBOLDISPLAY_H + +#include + +#include "pixmapwidget.h" + +/** + @author Vladimir Kuznetsov + */ + +class Skin; + +class SymbolDisplay : public PixmapWidget +{ + Q_OBJECT +public: + SymbolDisplay(QWidget *parent = 0, int digits = 3); + + ~SymbolDisplay(); + + void setAlignment(Qt::Alignment a) + { + m_alignment = a; + } + Qt::Alignment alignment()const + { + return m_alignment; + } + +public slots: + void display(const QString&); + void display(int); + +private slots: + void draw(); + +private: + Skin* m_skin; + QPixmap m_pixmap; + int m_digits; + QString m_text; + Qt::Alignment m_alignment; + int m_max; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/textscroller.cpp b/src/plugins/Ui/skinned/textscroller.cpp new file mode 100644 index 000000000..1fac2a753 --- /dev/null +++ b/src/plugins/Ui/skinned/textscroller.cpp @@ -0,0 +1,314 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "skin.h" +#include "textscroller.h" + +#define SCROLL_SEP " *** " +#define TITLE_FORMAT "%if(%p&%t,%p - %t,%p%t)%if(%p&%t,,%f)%if(%l, - %l,)" + +TextScroller::TextScroller (QWidget *parent) + : QWidget (parent) +{ + m_pressed = false; + m_press_pos = 0; + m_metrics = 0; + m_defautText = QString("Qmmp ") + Qmmp::strVersion(); + m_core = SoundCore::instance(); + m_skin = Skin::instance(); + m_ratio = m_skin->ratio(); + + m_timer = new QTimer (this); + m_timer->setInterval(50); + m_timer->start(); + + m_menu = new QMenu(this); + m_scrollAction = m_menu->addAction(tr("Autoscroll Songname")); + m_scrollAction->setCheckable(true); + connect(m_scrollAction, SIGNAL(toggled(bool)), SLOT(updateText())); + connect(m_timer, SIGNAL (timeout()), SLOT (addOffset())); + connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); + connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(processState(Qmmp::State))); + connect(m_core, SIGNAL(metaDataChanged()), SLOT(processMetaData())); + //readSettings(); + updateSkin(); +} + +TextScroller::~TextScroller() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.setValue("TextScroller/autoscroll", m_scrollAction->isChecked()); + if(m_metrics) + delete m_metrics; +} + +void TextScroller::setText(const QString &text) +{ + m_sliderText = text; + updateText(); +} + +void TextScroller::clear() +{ + setText(QString()); +} + +void TextScroller::addOffset() +{ + if(!m_scroll) + { + m_timer->stop(); + return; + } + m_x1--; + m_x2--; + if(m_x1 < - m_pixmap.width()) + m_x1 = m_pixmap.width(); + if(m_x2 < - m_pixmap.width()) + m_x2 = m_pixmap.width(); + update(); +} + +void TextScroller::updateSkin() +{ + m_color.setNamedColor(m_skin->getPLValue("mbfg")); + setCursor(m_skin->getCursor(Skin::CUR_SONGNAME)); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + m_bitmap = settings.value("MainWindow/bitmap_font", false).toBool(); + m_ratio = m_skin->ratio(); + QString fontname = settings.value("MainWindow/Font").toString(); + m_font.fromString(fontname); + if (m_metrics) + delete m_metrics; + else + m_scrollAction->setChecked(settings.value("TextScroller/autoscroll", true).toBool()); + m_metrics = new QFontMetrics(m_font); + updateText(); +} + +void TextScroller::setProgress(int progress) +{ + m_bufferText = tr("Buffering: %1%").arg(progress); + updateText(); +} + +void TextScroller::hideEvent (QHideEvent *) +{ + m_timer->stop(); +} + +void TextScroller::showEvent (QShowEvent *) +{ + if (m_scroll) + m_timer->start(); +} + +inline void drawBitmapText(int x, int y, const QString &text, QPainter *paint, Skin *skin) +{ + QString lowertext = text.toLower(); + int chwidth, ypix; + { + QPixmap samplechar = skin->getLetter('a'); + chwidth = samplechar.width(); + ypix = y - samplechar.height(); + } + for (int i = 0; i < lowertext.size(); i++) + { + QPixmap pixchar = skin->getLetter(lowertext[i]); + paint->drawPixmap(x, ypix, pixchar); + x += chwidth; + } +} + +void TextScroller::paintEvent (QPaintEvent *) +{ + QPainter paint(this); + if(m_scroll) + { + paint.drawPixmap(m_x1,0, m_pixmap); + paint.drawPixmap(m_x2,0, m_pixmap); + } + else + paint.drawPixmap(4,0, m_pixmap); +} + +void TextScroller::mousePressEvent (QMouseEvent *e) +{ + if (e->button() == Qt::RightButton) + m_menu->exec(e->globalPos()); + else if (e->button() == Qt::LeftButton && m_scroll) + { + m_timer->stop(); + m_press_pos = e->x() - m_x1; + m_pressed = true; + } + else + QWidget::mousePressEvent(e); +} + +void TextScroller::mouseReleaseEvent (QMouseEvent *e) +{ + if(e->button() == Qt::RightButton) + m_menu->exec(e->globalPos()); + else if (e->button() == Qt::LeftButton && m_scroll) + m_timer->start(); + else + QWidget::mouseReleaseEvent(e); + m_pressed = false; +} + +void TextScroller::mouseMoveEvent (QMouseEvent *e) +{ + if (m_pressed) + { + int bound = m_pixmap.width(); + m_x1 = (e->x() - m_press_pos) % bound; + if (m_x1 > 0) + m_x1 -= bound; + m_x2 = m_x1 + m_pixmap.width(); + update(); + } + else + QWidget::mouseMoveEvent(e); +} + +void TextScroller::processState(Qmmp::State state) +{ + switch(state) + { + case Qmmp::Buffering: + { + connect(m_core, SIGNAL(bufferingProgress(int)), SLOT(setProgress(int))); + break; + } + case Qmmp::Playing: + { + disconnect(m_core, SIGNAL(bufferingProgress(int)), this, 0); + m_bufferText.clear(); + updateText(); + break; + } + case Qmmp::Paused: + { + break; + } + case Qmmp::Stopped: + { + m_bufferText.clear(); + m_titleText.clear(); + updateText(); + break; + } + default: + break; + } +} + +void TextScroller::processMetaData() +{ + MetaDataFormatter formater(TITLE_FORMAT); + if(m_core->state() == Qmmp::Playing) + { + m_titleText = formater.parse(m_core->metaData(), m_core->totalTime()/1000); + updateText(); + } +} + +void TextScroller::preparePixmap(const QString &text, bool scrollable) +{ + m_scroll = scrollable; + bool bitmap = m_bitmap && (text.toLatin1() == text.toLocal8Bit()); //use bitmap font if possible + if(scrollable) + { + int textWidth = m_bitmap ? QString(text + SCROLL_SEP).size() * 5 + : m_metrics->width(text + SCROLL_SEP); + int count = 150*m_ratio / textWidth + 1; + int width = count * textWidth; + QString fullText; + for(int i = 0; i < count; ++i) + { + fullText.append(text + SCROLL_SEP); + } + m_pixmap = QPixmap(width,15*m_ratio); + m_pixmap.fill(Qt::transparent); + QPainter painter(&m_pixmap); + painter.setPen(m_color); + painter.setFont(m_font); + if(m_bitmap) + drawBitmapText (0,12, fullText, &painter, m_skin); + else + painter.drawText (0,12, fullText); + m_x1 = 0; + m_x2 = m_pixmap.width(); + } + else + { + m_pixmap = QPixmap(150*m_ratio,15*m_ratio); + m_pixmap.fill(Qt::transparent); + QPainter painter(&m_pixmap); + painter.setPen(m_color); + painter.setFont(m_font); + if(bitmap) + drawBitmapText (0,12, text, &painter, m_skin); + else + painter.drawText (0,12, text); + } +} + +void TextScroller::updateText() //draw text according priority +{ + if(!m_sliderText.isEmpty()) + { + preparePixmap(m_sliderText); + m_timer->stop(); + } + else if(!m_bufferText.isEmpty()) + { + preparePixmap(m_bufferText); + m_timer->stop(); + } + else if (!m_titleText.isEmpty()) + { + preparePixmap(m_titleText, m_scrollAction->isChecked()); + m_timer->start(); + } + else if(!m_defautText.isEmpty()) + { + preparePixmap(m_defautText); + m_timer->stop(); + } + else + { + m_timer->stop(); + m_pixmap = QPixmap (150*m_ratio,15*m_ratio); + m_pixmap.fill(Qt::transparent); + m_scroll = false; + } + update(); +} diff --git a/src/plugins/Ui/skinned/textscroller.h b/src/plugins/Ui/skinned/textscroller.h new file mode 100644 index 000000000..3fe50bf7e --- /dev/null +++ b/src/plugins/Ui/skinned/textscroller.h @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TEXTSCROLLER_H +#define TEXTSCROLLER_H + +#include +#include + +class QTimer; +class QMenu; +class QAction; +class Skin; +class SoundCore; + +/** + @author Ilya Kotov +*/ +class TextScroller : public QWidget +{ +Q_OBJECT +public: + TextScroller(QWidget *parent = 0); + virtual ~TextScroller(); + + void setText(const QString &text); + +public slots: + void clear(); + +private slots: + void setProgress(int); + void addOffset(); + void updateSkin(); + void processState(Qmmp::State state); + void processMetaData(); + void updateText(); + +private: + void hideEvent(QHideEvent *); + void showEvent(QShowEvent *); + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void preparePixmap(const QString &text, bool scrollable = false); + QString m_defautText; + QString m_bufferText; + QString m_sliderText; + QString m_titleText; + QPixmap m_pixmap; + int m_x1, m_x2, m_ratio; + bool m_scroll, m_bitmap, m_pressed; + int m_press_pos; + QFont m_font; + QFontMetrics *m_metrics; + Skin *m_skin; + QColor m_color; + QTimer *m_timer; + QMenu *m_menu; + QAction *m_scrollAction; + SoundCore *m_core; +}; + +#endif diff --git a/src/plugins/Ui/skinned/timeindicator.cpp b/src/plugins/Ui/skinned/timeindicator.cpp new file mode 100644 index 000000000..02c185b36 --- /dev/null +++ b/src/plugins/Ui/skinned/timeindicator.cpp @@ -0,0 +1,139 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include + +#include "skin.h" +#include "timeindicator.h" + +TimeIndicator::TimeIndicator (QWidget *parent) + : PixmapWidget (parent) +{ + m_skin = Skin::instance(); + m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); + m_elapsed = true; + m_time = m_songDuration = 0; + readSettings(); + m_needToShowTime = false; + updateSkin(); + reset(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + m_timer = new QTimer(this); + m_timer->setInterval(125); + m_timer->setSingleShot (true); + connect(m_timer, SIGNAL(timeout()),SLOT(reset())); +} + +void TimeIndicator::setTime (int t) +{ + m_time = t; + m_pixmap.fill (Qt::transparent); + int r = m_skin->ratio(); + QPainter paint (&m_pixmap); + + if (!m_elapsed) + { + t = m_songDuration - t; + paint.drawPixmap(r*2,0,m_skin->getNumber(10)); + } + if (t < 0) + t = 0; + + if(t > 3600) + t /= 60; + + paint.drawPixmap(r*13,0,m_skin->getNumber(t/600%10)); + paint.drawPixmap(r*26,0,m_skin->getNumber(t/60%10)); + paint.drawPixmap(r*43,0,m_skin->getNumber(t%60/10)); + paint.drawPixmap(r*56,0,m_skin->getNumber(t%60%10)); + + setPixmap (m_pixmap); + +} + +void TimeIndicator::reset() +{ + m_pixmap.fill (Qt::transparent); + QPainter paint (&m_pixmap); + setPixmap (m_pixmap ); +} + +void TimeIndicator::mousePressEvent(QMouseEvent* e) +{ + if (m_needToShowTime && e->button() & Qt::LeftButton) + { + m_elapsed = m_elapsed ? false : true; + setTime(m_time); + } + PixmapWidget::mousePressEvent(e); +} + +void TimeIndicator::setSongDuration(int d) +{ + m_songDuration = d; +} + +TimeIndicator::~TimeIndicator() +{ + writeSettings(); +} + + +void TimeIndicator::updateSkin() +{ + m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); + if (m_needToShowTime) + setTime(m_time); +} + +void TimeIndicator::readSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("Display"); + m_elapsed = settings.value("Elapsed",true).toBool(); + settings.endGroup(); +} + +void TimeIndicator::writeSettings() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.beginGroup("Display"); + settings.setValue("Elapsed",m_elapsed); + settings.endGroup(); +} + +void TimeIndicator::setNeedToShowTime(bool need) +{ + m_needToShowTime = need; + if (!need) + m_timer->start(); + else + m_timer->stop(); +} + +void TimeIndicator::mouseMoveEvent(QMouseEvent *) +{} + +void TimeIndicator::mouseReleaseEvent(QMouseEvent *) +{} + diff --git a/src/plugins/Ui/skinned/timeindicator.h b/src/plugins/Ui/skinned/timeindicator.h new file mode 100644 index 000000000..55e74c43f --- /dev/null +++ b/src/plugins/Ui/skinned/timeindicator.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * Copyright (C) 2006-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TIMEINDICATOR_H +#define TIMEINDICATOR_H + +#include "pixmapwidget.h" + +class QMouseEvent; +class QTimer; + +class Skin; + + +/** Class TimeIndicator + * @author Vladimir Kuznetsov + * + * Represents time indicator in the main display. Can show elapsed + * and rest time of song (mouse press on indicator changes mode) + */ +class TimeIndicator : public PixmapWidget +{ + Q_OBJECT +public: + TimeIndicator(QWidget *parent = 0); + ~TimeIndicator(); + void setTime ( int t ); + void setSongDuration(int); + void setNeedToShowTime(bool); + +protected: + virtual void mousePressEvent(QMouseEvent*); + virtual void mouseMoveEvent(QMouseEvent*); + virtual void mouseReleaseEvent(QMouseEvent*); + void writeSettings(); + void readSettings(); + +private slots: + void updateSkin(); + void reset(); + +private: + QPixmap m_pixmap; + Skin *m_skin; + int m_time; + int m_songDuration; + bool m_elapsed; + bool m_needToShowTime; + QTimer *m_timer; +}; + +#endif diff --git a/src/plugins/Ui/skinned/titlebar.cpp b/src/plugins/Ui/skinned/titlebar.cpp new file mode 100644 index 000000000..52ba97d32 --- /dev/null +++ b/src/plugins/Ui/skinned/titlebar.cpp @@ -0,0 +1,223 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include + +#include "symboldisplay.h" +#include "skin.h" +#include "button.h" +#include "dock.h" +#include "titlebarcontrol.h" +#include "shadedvisual.h" +#include "display.h" +#include "titlebar.h" + +// TODO skin cursor with shade mode +TitleBar::TitleBar(QWidget *parent) + : PixmapWidget(parent) +{ + m_align = false; + m_skin = Skin::instance(); + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); + m_mw = qobject_cast(parent->parent()); + m_shaded = false; + m_shade2 = 0; + m_currentTime = 0; + m_control = 0; + m_visual = 0; + //buttons + m_menu = new Button(this,Skin::BT_MENU_N,Skin::BT_MENU_P, Skin::CUR_MAINMENU); + connect(m_menu,SIGNAL(clicked()),this,SLOT(showMainMenu())); + m_menu->move(6,3); + m_minimize = new Button(this,Skin::BT_MINIMIZE_N,Skin::BT_MINIMIZE_P, Skin::CUR_MIN); + connect(m_minimize, SIGNAL(clicked()), m_mw, SLOT(showMinimized())); + m_shade = new Button(this,Skin::BT_SHADE1_N,Skin::BT_SHADE1_P, Skin::CUR_WINBUT); + connect(m_shade, SIGNAL(clicked()), SLOT(shade())); + m_close = new Button(this,Skin::BT_CLOSE_N,Skin::BT_CLOSE_P, Skin::CUR_CLOSE); + connect(m_close, SIGNAL(clicked()), m_mw, SLOT(handleCloseRequest())); + setActive(false); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + if (settings.value("Display/shaded", false).toBool()) + shade(); + m_align = true; + setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); + updatePositions(); +} + +TitleBar::~TitleBar() +{ + QSettings settings(Qmmp::configFile(), QSettings::IniFormat); + settings.setValue("Display/shaded", m_shaded); +} + +void TitleBar::updatePositions() +{ + int r = m_skin->ratio(); + m_menu->move(r*6, r*3); + m_minimize->move(r*244, r*3); + m_shade->move(r*254, r*3); + m_close->move(r*264, r*3); + if(m_shade2) + m_shade2->move(r*254, r*3); + if(m_currentTime) + m_currentTime->move(r*127, r*4); + if(m_control) + m_control->move(r*168, r*2); + if(m_visual) + m_visual->move(r*79,r*5); +} + +void TitleBar::mousePressEvent(QMouseEvent* event) +{ + switch ((int) event->button ()) + { + case Qt::LeftButton: + m_pos = event->pos(); + Dock::instance()->calculateDistances(); + Dock::instance()->updateDock(); + break; + case Qt::RightButton: + m_mw->menu()->exec(event->globalPos()); + } +} + +void TitleBar::mouseReleaseEvent(QMouseEvent*) +{ + Dock::instance()->updateDock(); +} +void TitleBar::mouseMoveEvent(QMouseEvent* event) +{ + if (m_pos.x() < width() - m_skin->ratio() * 37) + { + QPoint npos = (event->globalPos()-m_pos); + Dock::instance()->move(m_mw, npos); + } +} + +void TitleBar::setActive(bool a) +{ + if (a) + { + if (m_shaded) + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); + else + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); + } + else + { + if (m_shaded) + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_I)); + else + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_I)); + } +} + +void TitleBar::updateSkin() +{ + setActive(false); + setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); + updatePositions(); +} + +void TitleBar::showMainMenu() +{ + m_mw->menu()->exec(m_menu->mapToGlobal(m_menu->pos())); +} + +void TitleBar::shade() +{ + m_shaded = !m_shaded; + int r = m_skin->ratio(); + if (m_shaded) + { + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); + m_shade->hide(); + m_shade2 = new Button(this,Skin::BT_SHADE2_N, Skin::BT_SHADE2_P, Skin::CUR_WSNORMAL); + connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); + m_shade2->show(); + m_currentTime = new SymbolDisplay(this, 6); + m_currentTime->show(); + m_currentTime->display("--:--"); + m_control = new TitleBarControl(this); + m_control->show(); + connect (m_control, SIGNAL (nextClicked()), m_mw, SLOT (next())); + connect (m_control, SIGNAL (previousClicked()), m_mw, SLOT (previous())); + connect (m_control, SIGNAL (playClicked()), m_mw, SLOT (play())); + connect (m_control, SIGNAL (pauseClicked()), m_mw, SLOT (pause())); + connect (m_control, SIGNAL (stopClicked()), m_mw, SLOT (stop())); + connect (m_control, SIGNAL (ejectClicked()), m_mw, SLOT (addFile())); + m_visual = new ShadedVisual(this); + Visual::add(m_visual); + m_visual->show(); + } + else + { + setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); + m_shade2->deleteLater(); + m_currentTime->deleteLater(); + m_control->deleteLater(); + Visual::remove(m_visual); + m_visual->deleteLater(); + m_shade2 = 0; + m_currentTime = 0; + m_control = 0; + m_visual = 0; + m_shade->show(); + } + qobject_cast (parent())->setMinimalMode(m_shaded); + if (m_align) + Dock::instance()->align(m_mw, m_shaded? -r*102: r*102); + updatePositions(); +} + +void TitleBar::mouseDoubleClickEvent (QMouseEvent *) +{ + TitleBar::shade(); +} + +QString TitleBar::formatTime (int sec) +{ + int minutes = sec / 60; + int seconds = sec % 60; + + QString str_minutes = QString::number (minutes); + QString str_seconds = QString::number (seconds); + + if (minutes < 10) str_minutes.prepend ("0"); + if (seconds < 10) str_seconds.prepend ("0"); + + return str_minutes + ":" + str_seconds; +} + +void TitleBar::setTime(qint64 time) +{ + if (!m_currentTime) + return; + if (time < 0) + m_currentTime->display("--:--"); + else + m_currentTime->display(formatTime(time/1000)); +} + diff --git a/src/plugins/Ui/skinned/titlebar.h b/src/plugins/Ui/skinned/titlebar.h new file mode 100644 index 000000000..55f59f7cc --- /dev/null +++ b/src/plugins/Ui/skinned/titlebar.h @@ -0,0 +1,85 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TITLEBAR_H +#define TITLEBAR_H + +#include +#include + +#include "pixmapwidget.h" +#include "playlist.h" +#include "mainwindow.h" + +class MainWindow; +class QMouseEvent; +class Skin; +class Button; +class SymbolDisplay; +class TitleBarControl; +class ShadedVisual; + +/** + @author Ilya Kotov +*/ +class TitleBar : public PixmapWidget +{ +Q_OBJECT +public: + TitleBar(QWidget *parent = 0); + + ~TitleBar(); + + void setActive(bool); + +public slots: + void setTime(qint64 time); + +private slots: + void updateSkin(); + void showMainMenu(); + void shade(); + +private: + Skin *m_skin; + QPoint m_pos; + MainWindow *m_mw; + Button *m_menu; + Button *m_minimize; + Button *m_shade; + Button *m_shade2; + Button *m_close; + SymbolDisplay *m_currentTime; + QString formatTime (int); + bool m_shaded; + bool m_align; + TitleBarControl *m_control; + ShadedVisual *m_visual; + void updatePositions(); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseDoubleClickEvent(QMouseEvent*); +}; + + + +#endif diff --git a/src/plugins/Ui/skinned/titlebarcontrol.cpp b/src/plugins/Ui/skinned/titlebarcontrol.cpp new file mode 100644 index 000000000..d4f064c75 --- /dev/null +++ b/src/plugins/Ui/skinned/titlebarcontrol.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include "skin.h" +#include "titlebarcontrol.h" + +TitleBarControl::TitleBarControl(QWidget *parent) : QWidget(parent) +{ + //setAutoFillBackground(true); + m_ratio = Skin::instance()->ratio(); + resize(m_ratio*57, m_ratio*10); + connect(Skin::instance(), SIGNAL(skinChanged()),SLOT(updateSkin())); +} + + +TitleBarControl::~TitleBarControl() +{ +} + +void TitleBarControl::mousePressEvent (QMouseEvent *) +{} + +void TitleBarControl::mouseReleaseEvent (QMouseEvent * event) +{ + QPoint pt = event->pos(); + if(QRect(0,0,m_ratio*8,m_ratio*10).contains(pt)) + emit previousClicked(); + else if(QRect(m_ratio*8,0,m_ratio*11,m_ratio*10).contains(pt)) + emit playClicked(); + else if(QRect(m_ratio*19,0,m_ratio*10,m_ratio*10).contains(pt)) + emit pauseClicked(); + else if(QRect(m_ratio*29,0,m_ratio*8,m_ratio*10).contains(pt)) + emit stopClicked(); + else if(QRect(m_ratio*37,0,m_ratio*10,m_ratio*10).contains(pt)) + emit nextClicked(); + else if(QRect(m_ratio*47,0,m_ratio*10,m_ratio*10).contains(pt)) + emit ejectClicked(); +} + +void TitleBarControl::mouseMoveEvent(QMouseEvent*) +{} + +void TitleBarControl::updateSkin() +{ + m_ratio = Skin::instance()->ratio(); + resize(m_ratio*57, m_ratio*10); +} diff --git a/src/plugins/Ui/skinned/titlebarcontrol.h b/src/plugins/Ui/skinned/titlebarcontrol.h new file mode 100644 index 000000000..3631cce1d --- /dev/null +++ b/src/plugins/Ui/skinned/titlebarcontrol.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2007-2009 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TITLEBARCONTROL_H +#define TITLEBARCONTROL_H + +#include + +class QMouseEvent; + +/** + @author Ilya Kotov +*/ +class TitleBarControl : public QWidget +{ +Q_OBJECT +public: + TitleBarControl(QWidget *parent = 0); + ~TitleBarControl(); + +signals: + void previousClicked(); + void nextClicked(); + void pauseClicked(); + void playClicked(); + void stopClicked(); + void ejectClicked(); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + +private slots: + void updateSkin(); + +private: + int m_ratio; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/togglebutton.cpp b/src/plugins/Ui/skinned/togglebutton.cpp new file mode 100644 index 000000000..994ac9f20 --- /dev/null +++ b/src/plugins/Ui/skinned/togglebutton.cpp @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2007-2008 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * Based on Promoe, an XMMS2 Client * + * Copyright (C) 2005-2006 by XMMS2 Team * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "skin.h" +#include "togglebutton.h" +#include + +ToggleButton::ToggleButton ( QWidget *parent,uint on_n,uint on_p,uint off_n,uint off_p ) + : PixmapWidget ( parent ) +{ + m_on_n = on_n; + m_on_p = on_p; + m_off_n = off_n; + m_off_p = off_p; + m_on = false; + skin = Skin::instance(); + setON ( false ); + connect ( skin, SIGNAL ( skinChanged() ), this, SLOT ( updateSkin() ) ); +} + + +ToggleButton::~ToggleButton() +{} + +bool ToggleButton::isChecked() +{ + return m_on; +} + +void ToggleButton::updateSkin() +{ + //setPixmap ( skin->getButton ( name_normal ) ); + setON ( m_on ); +} + +void ToggleButton::click() +{ + m_on = !m_on; + setON (m_on); + emit clicked(m_on); +} + +void ToggleButton::setON ( bool on ) +{ + m_on = on; + if ( on ) + setPixmap ( skin->getButton ( m_on_n ) ); + else + setPixmap ( skin->getButton ( m_off_n ) ); +} +void ToggleButton::mousePressEvent ( QMouseEvent* ) +{ + m_cursorin = true; + m_old_on = m_on; + if ( m_on ) + setPixmap ( skin->getButton ( m_off_p ) ); + else + setPixmap ( skin->getButton ( m_on_p ) ); +} + +void ToggleButton::mouseReleaseEvent ( QMouseEvent* ) +{ + if ( m_cursorin ) { + m_on = !m_old_on; + setON ( m_on ); + emit clicked( m_on ); + } else { + m_on = m_old_on; + setON ( m_on ); + } +} + +void ToggleButton::mouseMoveEvent (QMouseEvent *e) +{ + if ( !m_cursorin && rect().contains(e->pos()) ) { + m_cursorin = true; + if ( m_old_on ) + setPixmap ( skin->getButton ( m_off_p ) ); + else + setPixmap ( skin->getButton ( m_on_p ) ); + } else if ( m_cursorin && !rect().contains(e->pos()) ) { + m_cursorin = false; + if ( m_old_on ) + setPixmap ( skin->getButton ( m_on_n ) ); + else + setPixmap ( skin->getButton ( m_off_n ) ); + } +} diff --git a/src/plugins/Ui/skinned/togglebutton.h b/src/plugins/Ui/skinned/togglebutton.h new file mode 100644 index 000000000..220d427cc --- /dev/null +++ b/src/plugins/Ui/skinned/togglebutton.h @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2006 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TOGGLEBUTTON_H +#define TOGGLEBUTTON_H + +#include "pixmapwidget.h" + +/** + @author Ilya Kotov +*/ +class Skin; + +class ToggleButton : public PixmapWidget +{ +Q_OBJECT +public: + ToggleButton( QWidget *parent, uint on_n, uint on_p, uint off_n, uint off_p ); + + ~ToggleButton(); + + bool isChecked(); + +signals: + void clicked(bool); + +public slots: + void setON(bool); + void click(); + +private slots: + void updateSkin(); + +private: + Skin *skin; + bool m_cursorin, m_old_on; + uint m_on_n, m_on_p, m_off_n, m_off_p; + bool m_on; + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); +}; + + +#endif diff --git a/src/plugins/Ui/skinned/translations/qmmp_cs.ts b/src/plugins/Ui/skinned/translations/qmmp_cs.ts new file mode 100644 index 000000000..750283b44 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_cs.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + O Qmmp + + + + About + O aplikaci + + + + Authors + AutoÅ™i + + + + Thanks To + PodÄ›kování + + + + License Agreement + Licence + + + + :/txt/authors_en.txt + :/txt/authors_cs.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_cs.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-based Multimedia Player (Qmmp) + + + + Version: + Verze: + + + + :txt/description_en.txt + :txt/description_cs.txt + + + + Input plugins: + Vstupní moduly: + + + + Output plugins: + Výstupní moduly: + + + + Visual plugins: + VizualizaÄní moduly: + + + + Effect plugins: + Efektové moduly: + + + + General plugins: + Obecné moduly: + + + + Translators + PÅ™ekladatelé + + + + :/txt/translators_en.txt + :/txt/translators_cs.txt + + + + ActionManager + + + &Play + PÅ™e&hrát + + + + X + X + + + + &Pause + Pau&za + + + + C + C + + + + &Stop + &Stop + + + + V + V + + + + &Previous + &PÅ™edchozí + + + + Z + Z + + + + &Next + &Další + + + + B + B + + + + &Play/Pause + &PÅ™ehrát/Pauza + + + + Space + Mezerník + + + + &Jump to File + + + + + J + J + + + + &Repeat Playlist + &Opakovat seznam skladeb + + + + R + O + + + + &Repeat Track + &Opakovat stopu + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + Za&míchat + + + + S + M + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + PÅ™idat &soubor + + + + F + F + + + + &Add Directory + PÅ™idat &adresář + + + + D + D + + + + &Add Url + PÅ™idat &URL + + + + U + U + + + + &Remove Selected + &Odstranit vybrané + + + + Del + Del + + + + &Remove All + Odstranit &vÅ¡e + + + + &Remove Unselected + Odstranit &nevybrané + + + + Remove unavailable files + Odstranit nedostupné soubory + + + + Remove duplicates + Odstranit duplicity + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Invertovat výbÄ›r + + + + &Select None + &ZruÅ¡it výbÄ›r + + + + &Select All + &Vybrat vÅ¡e + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + Zobrazit &informace o skladbÄ› + + + + Alt+I + Alt+I + + + + &New List + &Nový seznam + + + + Ctrl+T + Ctrl+T + + + + &Delete List + O&dstranit seznam + + + + Ctrl+W + Ctrl+W + + + + &Load List + NaÄíst &seznam + + + + O + O + + + + &Save List + &Uložit seznam + + + + Shift+S + Shift+S + + + + &Select Next Playlist + Vybrat další &seznam skladeb + + + + Ctrl+PgDown + Ctrl+PgDown + + + + &Select Previous Playlist + Vybrat pÅ™edchozí &seznam skladeb + + + + Ctrl+PgUp + Ctrl+PgUp + + + + &Show Playlists + Zobrazit &seznamy skladeb + + + + P + P + + + + &Settings + &Nastavení + + + + Ctrl+P + Ctrl+P + + + + &About + O &aplikaci + + + + &About Qt + O knihovnÄ› &Qt + + + + &Exit + U&konÄit + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Enter URL to add + PÅ™idat URL + + + + Error + Chyba + + + + &Add + PÅ™id&at + + + + &Cancel + Z&ruÅ¡it + + + + BuiltinCommandLineOption + + + Skip forward in playlist + PÅ™ejít vpÅ™ed v seznamu skladeb + + + + Skip backwards in playlist + PÅ™ejít zpÄ›t v seznamu skladeb + + + + Start playing current song + Spustit pÅ™ehrávání aktuální skladby + + + + Don't clear the playlist + Nevyprazdňovat seznam skladeb + + + + Pause current song + Pozastavit aktuální skladbu + + + + Pause if playing, play otherwise + Pozastavit, pÅ™ehrává-li se, jinak pÅ™ehrávat + + + + Stop current song + Zastavit aktuální skladbu + + + + Display Jump to File dialog + Zobrazit dialog PÅ™eskoÄit na soubor + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Nastavit hlasitost pÅ™ehrávání (příklad: qmmp --volume 20) + + + + Show/hide application + Zobrazit/skrýt aplikaci + + + + Display Add File dialog + Zobrazit dialog PÅ™idat soubor + + + + Display Add Directory dialog + Zobrazit dialog PÅ™idat adresář + + + + ConfigDialog + + + Description + Popis + + + + Filename + Soubor + + + + Artist + UmÄ›lec + + + + + Album + Album + + + + Track + Stopa + + + + Disabled + Vypnuto + + + + Transports + Protokoly + + + + Decoders + Dekodéry + + + + Engines + PÅ™ehrávaÄe + + + + Misc + + + + + Title + Název + + + + Track number + Číslo stopy + + + + Two-digit track number + Dvoumístné Äíslo stopy + + + + Disc number + Číslo disku + + + + Condition + Stav + + + + Composer + Skladatel + + + + File name + Název souboru + + + + File path + Cesta k souboru + + + + Genre + Žánr + + + + Year + Rok + + + + Comment + Poznámka + + + + Qmmp Settings + Nastavení Qmmp + + + + Appearance + Vzhled + + + + + + Playlist + Seznam skladeb + + + + Plugins + Moduly + + + + Advanced + PokroÄilé + + + + Skins + Témata + + + + Fonts + Písma + + + + Player: + PÅ™ehrávaÄ: + + + + Playlist: + Seznam skladeb: + + + + + ??? + ??? + + + + Replay Gain + Zisk pÅ™i pÅ™ehrávání + + + + Miscellaneous + Různé + + + + + + ... + ... + + + + Use bitmap font if available + Použít bitmapové písmo, je-li dostupné + + + + Use skin cursors + Použít kurzory z tématu + + + + Shortcuts + + + + + Metadata + Metadata + + + + Load metadata from files + Číst ze souborů metadata + + + + Song Display + Zobrazení skladby + + + + Title format: + Formát titulku: + + + + Show song numbers + Zobrazit Äísla skladeb + + + + Show playlists + Zobrazit seznam skladeb + + + + Show popup information + Zobrazit informace ve vyskakovacím oknÄ› + + + + Show anchor + + + + + Align song numbers + + + + + + Preferences + Nastavení + + + + + + Information + Informace + + + + Cover Image Retrieve + Získat obrázek obalu + + + + Use separate image files + Použít samostatné obrázky + + + + Include files: + Zahrnout soubory: + + + + Exclude files: + Vynechat soubory: + + + + Recursive search depth: + Hloubka rekurzivního hledání: + + + + + Playback + PÅ™ehrávání + + + + Continue playback on startup + Po startu pokraÄovat v pÅ™ehrávání + + + + Replay Gain mode: + Režim úpravy zisku pÅ™i pÅ™ehrávání: + + + + Preamp: + PÅ™edzesílení: + + + + + dB + dB + + + + Default gain: + Výchozí zisk: + + + + Use peak info to prevent clipping + Použít informaci o vrcholu k zabránÄ›ní oÅ™ezu + + + + Output: + Výstup: + + + + Buffer size: + + + + + ms + ms + + + + 16-bit output + 16bitový výstup + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Connectivity + Síť + + + + + View + Zobrazení + + + + Edit template + + + + + File Dialog + Souborový dialog + + + + Proxy + Proxy + + + + Enable proxy usage + Povolit používání proxy + + + + Proxy host name: + Adresa proxy: + + + + Proxy port: + Port proxy: + + + + Use authentication with proxy + Použít autorizaci pro proxy + + + + Proxy user name: + Uživatelské jméno: + + + + Proxy password: + Heslo: + + + + Archived skin + Sbalené téma + + + + Unarchived skin + Rozbalené téma + + + + Visualization + Vizualizace + + + + Effects + Efekty + + + + General + Obecné + + + + + Audio + Zvuk + + + + Use software volume control + Používat softwarové ovládání hlasitosti + + + + Hide on close + Skrýt pÅ™i zavÅ™ení + + + + Start hidden + Spustit skryté + + + + Convert underscores to blanks + PÅ™evést podtržítka na mezery + + + + Convert %20 to blanks + PÅ™evést %20 na mezery + + + + Select Skin Files + Vybrat soubory s tématy + + + + Skin files + Soubory s tématy + + + + Add... + PÅ™idat... + + + + Refresh + Obnovit + + + + Show protocol + Zobrazit protokol + + + + Transparency + Průhlednost + + + + Main window + Hlavní okno + + + + + + 0 + 0 + + + + Equalizer + Ekvalizér + + + + EqWidget + + + Equalizer + Ekvalizér + + + + + preset + pÅ™edvolba + + + + &Load/Delete + &NaÄíst/Odstranit + + + + &Save Preset + &Uložit pÅ™edvolbu + + + + &Save Auto-load Preset + Uložit &automatickou pÅ™edvolbu + + + + &Import + &Importovat + + + + &Clear + &Vynulovat + + + + Saving Preset + Uložení pÅ™edvolby + + + + Preset name: + Název pÅ™edvolby: + + + + preset # + pÅ™edvolba # + + + + Import Preset + Importovat pÅ™edvolbu + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + VyÅ™adit + + + + + + Queue + ZaÅ™adit + + + + Jump To Track + PÅ™eskoÄit na skladbu + + + + Filter + Filtr + + + + Refresh + NaÄíst znovu + + + + Jump To + PÅ™eskoÄit na + + + + MainDisplay + + + Previous + PÅ™edchozí + + + + Play + PÅ™ehrát + + + + Pause + Pozastavit + + + + Stop + Zastavit + + + + Next + Další + + + + Add file + PÅ™idat soubor + + + + Equalizer + Ekvalizér + + + + Playlist + Seznam skladeb + + + + Repeat playlist + Opakovat seznam skladeb + + + + Shuffle + Zamíchat + + + + Volume + Hlasitost + + + + Balance + Vyvážení + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + Režim vizualizace + + + + Analyzer + FrekvenÄní analýza + + + + Scope + Osciloskop + + + + Off + Vypnuto + + + + Analyzer Mode + Režim analýzy + + + + Normal + Normální + + + + Fire + Oheň + + + + Vertical Lines + Sloupce + + + + Lines + Úzké + + + + Bars + Å iroké + + + + Peaks + Å piÄky + + + + Refresh Rate + Obnovovací frekvence + + + + 50 fps + 50 Hz + + + + 25 fps + 25 Hz + + + + 10 fps + 10 Hz + + + + 5 fps + 5 Hz + + + + Analyzer Falloff + Pokles analyzátoru + + + + + Slowest + Nejpomalejší + + + + + Slow + Pomalý + + + + + Medium + StÅ™ední + + + + + Fast + Rychlý + + + + + Fastest + Nejrychlejší + + + + Peaks Falloff + Pokles Å¡piÄek + + + + Background + Pozadí + + + + Transparent + Průhledné + + + + MainWindow + + + Choose a directory + VýbÄ›r adresáře + + + + Select one or more files to open + Vyberte jeden Äi více souborů k otevÅ™ení + + + + &Jump To File + PÅ™eskoÄit na soubo&r + + + + J + J + + + + View + Zobrazení + + + + Playlist + Seznam skladeb + + + + + Playlist Files + Seznamy skladeb + + + + Open Playlist + NaÄíst seznam skladeb + + + + Save Playlist + Uložit seznam skladeb + + + + All Supported Bitstreams + VÅ¡echny podporované formáty + + + + Tools + Nástroje + + + + PlayList + + + Sort List + SeÅ™adit seznam + + + + + By Title + Podle názvu skladby + + + + + By Album + Podle alba + + + + + By Artist + Podle umÄ›lce + + + + + By Filename + Podle názvu souboru + + + + + By Path + Filename + Podle cesty a názvu souboru + + + + + By Date + Podle data + + + + Sort Selection + SeÅ™adit výbÄ›r + + + + Randomize List + Zamíchat seznam + + + + Reverse List + Obrátit poÅ™adí seznamu + + + + &New PlayList + + + + + &Copy Selection To + + + + + Playlist + Seznam skladeb + + + + + By Track Number + Podle Äísla skladby + + + + Actions + ÄŒinnosti + + + + PlayListBrowser + + + Playlist Browser + ProhlížeÄ seznamů skladeb + + + + New + Nový + + + + + Delete + Odstranit + + + + + ... + ... + + + + Rename + PÅ™ejmenovat + + + + PlayListSelector + + + &Load + &NaÄíst + + + + &Save As... + Uložit j&ako... + + + + Rename + PÅ™ejmenovat + + + + &Delete + O&dstranit + + + + Rename Playlist + PÅ™ejmenovat seznam skladeb + + + + Playlist name: + Název seznamu skladeb: + + + + PopupSettings + + + Popup Information Settings + Nastavení informací ve vyskakovacím oknÄ› + + + + Show cover + Zobrazit obal + + + + Transparency: + Průhlednost: + + + + Delay: + Prodleva: + + + + ms + ms + + + + Cover size: + Velikost obalu: + + + + Template + Å ablona + + + + Reset + Původní + + + + Insert + Vložit + + + + Artist + UmÄ›lec + + + + Album + Album + + + + Title + Název + + + + Track number + Číslo stopy + + + + Two-digit track number + Dvoumístné Äíslo stopy + + + + Genre + Žánr + + + + Comment + Poznámka + + + + Composer + Skladatel + + + + Duration + Délka + + + + Disc number + Číslo disku + + + + File name + Název souboru + + + + File path + Cesta k souboru + + + + Year + Rok + + + + Condition + Stav + + + + PresetEditor + + + Preset Editor + Editor pÅ™edvoleb + + + + Load + NaÄíst + + + + Delete + Odstranit + + + + Preset + PÅ™edvolba + + + + Auto-preset + Automatická pÅ™edvolba + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Použití: qmmp [volby] [soubory] + + + + Options: + Volby: + + + + Don't start the application + + + + + Print version number and exit + Vypsat Äíslo verze a skonÄit + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Nápady, patche, hlášení chyb posílejte na forkotov02@hotmail.ru (anglicky) + + + + Display this text and exit + Zobrazit tento text a skonÄit + + + + Unknown command + Neznámý příkaz + + + + QMMP version: + Verze QMMP: + + + + Qt version: + Verze Qt: + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + Automaticky rolovat název skladby + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + Vizualizace + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_de.ts b/src/plugins/Ui/skinned/translations/qmmp_de.ts new file mode 100644 index 000000000..9c5968ee3 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_de.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Über Qmmp + + + + About + Info + + + + Authors + Autoren + + + + Thanks To + Dank an + + + + License Agreement + Lizenz + + + + :/txt/authors_en.txt + :/txt/authors_de.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_de.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-basierter Multimedia-Player (Qmmp) + + + + Version: + Version: + + + + :txt/description_en.txt + :txt/description_de.txt + + + + Input plugins: + Eingabe-Module: + + + + Output plugins: + Ausgabe-Module: + + + + Visual plugins: + Visualisierungsmodule: + + + + Effect plugins: + Effekt-Module: + + + + General plugins: + Sonstige Module: + + + + Translators + Übersetzer + + + + :/txt/translators_en.txt + :/txt/translators_de.txt + + + + ActionManager + + + &Play + &Wiedergabe + + + + X + X + + + + &Pause + &Pause + + + + C + C + + + + &Stop + &Stopp + + + + V + V + + + + &Previous + &Vorheriger Titel + + + + Z + Z + + + + &Next + &Nächster Titel + + + + B + B + + + + &Play/Pause + Wieder&gabe/Pause + + + + Space + Leertaste + + + + &Jump to File + &Zu Datei springen + + + + J + J + + + + &Repeat Playlist + W&iedergabeliste wiederholen + + + + R + R + + + + &Repeat Track + Tite&l wiederholen + + + + Ctrl+R + Strg+R + + + + &Shuffle + &Zufallswiedergabe + + + + S + S + + + + &No Playlist Advance + + + + + Ctrl+N + Strg+N + + + + &Stop After Selected + + + + + Ctrl+S + Strg+S + + + + &Clear Queue + Wartes&chlange löschen + + + + Alt+Q + Alt+Q + + + + Show Playlist + Wiedergabeliste anzeigen + + + + Alt+E + Alt+E + + + + Show Equalizer + Equalizer anzeigen + + + + Alt+G + Alt+G + + + + Always on Top + Immer im Vordergrund + + + + Put on All Workspaces + Auf allen Arbeitsflächen anzeigen + + + + Double Size + Doppelte Größe + + + + Meta+D + Meta+D + + + + &Add File + &Datei hinzufügen + + + + F + F + + + + &Add Directory + &Verzeichnis hinzufügen + + + + D + D + + + + &Add Url + &URL hinzufügen + + + + U + U + + + + &Remove Selected + &Ausgewählte entfernen + + + + Del + Entf + + + + &Remove All + Alle &entfernen + + + + &Remove Unselected + &Nicht ausgewählte entfernen + + + + Remove unavailable files + Nichtverfügbare Dateien entfernen + + + + Remove duplicates + Duplikate entfernen + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Auswahl umkehren + + + + &Select None + &Auswahl aufheben + + + + &Select All + Alle aus&wählen + + + + Ctrl+A + Strg+A + + + + &View Track Details + &Titeldetails anzeigen + + + + Alt+I + Alt+I + + + + &New List + &Neue Wiedergabeliste + + + + Ctrl+T + Strg+T + + + + &Delete List + Wie&dergabeliste löschen + + + + Ctrl+W + Strg+W + + + + &Load List + Wiedergabeliste &laden + + + + O + O + + + + &Save List + Wiedergabeliste &speichern + + + + Shift+S + Umschalt+S + + + + &Select Next Playlist + Näch&ste Wiedergabeliste auswählen + + + + Ctrl+PgDown + Strg+Bild ab + + + + &Select Previous Playlist + Vorherige Wiedergabeli&ste auswählen + + + + Ctrl+PgUp + Strg+Bild auf + + + + &Show Playlists + Wiedergabeli&sten anzeigen + + + + P + P + + + + &Settings + Ein&stellungen + + + + Ctrl+P + Strg+P + + + + &About + Ü&ber + + + + &About Qt + Übe&r Qt + + + + &Exit + Be&enden + + + + Ctrl+Q + Strg+Q + + + + AddUrlDialog + + + Enter URL to add + Hinzuzufügende URL eingeben + + + + Error + Fehler + + + + &Add + &Hinzufügen + + + + &Cancel + &Abbrechen + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Nächsten Titel in Wiedergabeliste abspielen + + + + Skip backwards in playlist + Vorherigen Titel in Wiedergabeliste abspielen + + + + Start playing current song + Aktuellen Titel abspielen + + + + Don't clear the playlist + Titel an Wiedergabeliste anhängen + + + + Pause current song + Aktuellen Titel anhalten + + + + Pause if playing, play otherwise + Wiedergabe anhalten oder fortsetzen + + + + Stop current song + Aktuellen Titel stoppen + + + + Display Jump to File dialog + „Springe zu Titel“-Dialog anzeigen + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Lautstärke der Wiedergabe einstellen (Beispiel: qmmp --volume 20) + + + + Show/hide application + Anwendung ein-/ausblenden + + + + Display Add File dialog + „Datei hinzufügen“-Dialog anzeigen + + + + Display Add Directory dialog + „Verzeichnis hinzufügen“-Dialog anzeigen + + + + ConfigDialog + + + Description + Beschreibung + + + + Filename + Dateiname + + + + Artist + Interpret + + + + + Album + Album + + + + Track + Stück + + + + Disabled + Deaktiviert + + + + Transports + Transporte + + + + Decoders + Dekoder + + + + Engines + + + + + Misc + Verschiedenes + + + + Title + Titel + + + + Track number + Stücknummer + + + + Two-digit track number + Zweistellige Stücknummer + + + + Disc number + CD-Nummer + + + + Condition + Zustand + + + + Genre + Genre + + + + Composer + Komponist + + + + File name + Dateiname + + + + File path + Dateipfad + + + + Year + Jahr + + + + Comment + Kommentar + + + + Qmmp Settings + Einstellungen + + + + Appearance + Erscheinungsbild + + + + + + Playlist + Wiedergabeliste + + + + Plugins + Module + + + + Advanced + Erweitert + + + + Skins + Designs + + + + Fonts + Schriftarten + + + + Player: + Player: + + + + Playlist: + Wiedergabeliste: + + + + + ??? + ??? + + + + Replay Gain + Replay Gain + + + + Miscellaneous + Verschiedenes + + + + + + ... + ... + + + + Use bitmap font if available + Bitmap-Schriftart verwenden, falls verfügbar + + + + Use skin cursors + Design-Mauszeiger verwenden + + + + Shortcuts + Kurzbefehle + + + + Metadata + Metadaten + + + + Load metadata from files + Metadaten aus Dateien laden + + + + Song Display + Titelanzeige + + + + Title format: + Titelformat: + + + + Show song numbers + Titelnummern anzeigen + + + + Show playlists + Wiedergabelisten anzeigen + + + + Show popup information + Informationen in einem Aufklapp-Fenster anzeigen + + + + Show anchor + + + + + Align song numbers + Stücknummern ausrichten + + + + + Preferences + Konfiguration + + + + + + Information + Information + + + + Cover Image Retrieve + Holen von Cover-Bildern + + + + Use separate image files + Separate Bilddateien verwenden + + + + Include files: + Einzubeziehende Dateien: + + + + Exclude files: + Auszuschließende Dateien: + + + + Recursive search depth: + Rekursive Suchtiefe: + + + + + Playback + Wiedergabe + + + + Continue playback on startup + Wiedergabe beim Start fortsetzen + + + + Replay Gain mode: + Replay-Gain-Modus: + + + + Preamp: + Vorverstärkung: + + + + + dB + dB + + + + Default gain: + + + + + Use peak info to prevent clipping + Peak-Informationen verwenden, um Clipping zu verhindern + + + + Output: + Ausgabe: + + + + Buffer size: + Puffergröße: + + + + ms + ms + + + + 16-bit output + 16-Bit-Ausgabe + + + + Action + Aktion + + + + Shortcut + Kurzbefehl + + + + Change shortcut... + Kurzbefehl ändern ... + + + + Connectivity + Verbindung + + + + + View + Ansicht + + + + Edit template + Vorlage bearbeiten + + + + File Dialog + Datei-Dialog + + + + Proxy + Proxyserver + + + + Enable proxy usage + Proxyserver verwenden + + + + Proxy host name: + Name des Proxyservers: + + + + Proxy port: + Port: + + + + Use authentication with proxy + Authentisierung verwenden + + + + Proxy user name: + Benutzername: + + + + Proxy password: + Passwort: + + + + Archived skin + Archiviertes Design + + + + Unarchived skin + Nicht archiviertes Design + + + + Visualization + Visualisierung + + + + Effects + Effekte + + + + General + Sonstige + + + + + Audio + Audio + + + + Use software volume control + Softwaregesteuerte Lautstärkeregelung + + + + Hide on close + Beim Schließen in den Systemabschnitt der Kontrollleiste minimieren + + + + Start hidden + Minimiert starten + + + + Convert underscores to blanks + Unterstriche in Leerzeichen umwandeln + + + + Convert %20 to blanks + %20 in Leerzeichen umwandeln + + + + Select Skin Files + Design-Dateien auswählen + + + + Skin files + Design-Dateien + + + + Add... + Hinzufügen... + + + + Refresh + Aktualisieren + + + + Show protocol + Protokoll anzeigen + + + + Transparency + Transparenz + + + + Main window + Hauptfenster + + + + + + 0 + 0 + + + + Equalizer + Equalizer + + + + EqWidget + + + Equalizer + Equalizer + + + + + preset + Voreinstellung + + + + &Load/Delete + &Laden/Löschen + + + + &Save Preset + &Voreinstellung speichern + + + + &Save Auto-load Preset + &Automatische Voreinstellungen speichern + + + + &Import + &Importieren + + + + &Clear + &Zurücksetzen + + + + Saving Preset + Voreinstellung speichern + + + + Preset name: + Name der Voreinstellung: + + + + preset # + Voreinstellung # + + + + Import Preset + Voreinstellung importieren + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + Aus Warteschlange entfernen + + + + + + Queue + In Warteschlange + + + + Jump To Track + Zu Titel springen + + + + Filter + Filter + + + + Refresh + Aktualisieren + + + + Jump To + Springen zu + + + + MainDisplay + + + Previous + Vorheriger Titel + + + + Play + Wiedergabe + + + + Pause + Pause + + + + Stop + Stopp + + + + Next + Nächster Titel + + + + Add file + Datei hinzufügen + + + + Equalizer + Equalizer + + + + Playlist + Wiedergabeliste + + + + Repeat playlist + Wiedergabeliste wiederholen + + + + Shuffle + Zufallswiedergabe + + + + Volume + Lautstärke + + + + Balance + Balance + + + + Volume: %1% + Lautstärke: %1 % + + + + Balance: %1% right + Balance: %1 % rechts + + + + Balance: %1% left + Balance: %1 % links + + + + Balance: center + Balance: Mitte + + + + Seek to: %1 + Springen zu: %1 + + + + MainVisual + + + Visualization Mode + Visualisierungsmodus + + + + Analyzer + Analyzer + + + + Scope + Oszilloskop + + + + Off + Aus + + + + Analyzer Mode + Analyzer-Modus + + + + Normal + Normal + + + + Fire + Feuer + + + + Vertical Lines + Vertikale Linien + + + + Lines + Linien + + + + Bars + Balken + + + + Peaks + Spitzen + + + + Refresh Rate + Wiederholfrequenz + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Analyzer-Abfall + + + + + Slowest + Sehr langsam + + + + + Slow + Langsam + + + + + Medium + Mittel + + + + + Fast + Schnell + + + + + Fastest + Sehr schnell + + + + Peaks Falloff + Abfallen der Spitzen + + + + Background + Hintergrund + + + + Transparent + Transparent + + + + MainWindow + + + Choose a directory + Verzeichnis wählen + + + + Select one or more files to open + Dateien hinzufügen + + + + &Jump To File + Springe zu &Titel + + + + J + J + + + + View + Ansicht + + + + Playlist + Wiedergabeliste + + + + + Playlist Files + Wiedergabelisten + + + + Open Playlist + Wiedergabeliste öffnen + + + + Save Playlist + Wiedergabeliste speichern + + + + All Supported Bitstreams + Alle unterstützten Formate + + + + Tools + Werkzeuge + + + + PlayList + + + Sort List + Wiedergabeliste sortieren + + + + + By Title + Nach Titel + + + + + By Album + Nach Album + + + + + By Artist + Nach Interpret + + + + + By Filename + Nach Dateinamen + + + + + By Path + Filename + Nach Pfad + Dateinamen + + + + + By Date + Nach Datum + + + + Sort Selection + Auswahl sortieren + + + + Randomize List + Wiedergabeliste mischen + + + + Reverse List + Wiedergabeliste umkehren + + + + &New PlayList + &Neue Wiedergabeliste + + + + &Copy Selection To + Auswahl kopieren na&ch + + + + Playlist + Wiedergabeliste + + + + + By Track Number + Nach Titelnummer + + + + Actions + Aktionen + + + + PlayListBrowser + + + Playlist Browser + Wiedergabelisten durchsuchen + + + + New + Neu + + + + + Delete + Löschen + + + + + ... + … + + + + Rename + Umbenennen + + + + PlayListSelector + + + &Load + &Laden + + + + &Save As... + &Speichern unter … + + + + Rename + Umbenennen + + + + &Delete + L&öschen + + + + Rename Playlist + Wiedergabeliste umbenennen + + + + Playlist name: + Name der Wiedergabeliste: + + + + PopupSettings + + + Popup Information Settings + Einstellungen Aufklapp-Informationen + + + + Show cover + Cover anzeigen + + + + Transparency: + Transparenz: + + + + Delay: + Verzögerung: + + + + ms + ms + + + + Cover size: + Cover-Größe: + + + + Template + Vorlage + + + + Reset + Zurücksetzen + + + + Insert + Einfügen + + + + Artist + Interpret + + + + Album + Album + + + + Title + Titel + + + + Track number + Stücknummer + + + + Two-digit track number + Zweistellige Stücknummer + + + + Genre + Genre + + + + Comment + Kommentar + + + + Composer + Komponist + + + + Duration + Abspieldauer + + + + Disc number + CD-Nummer + + + + File name + Dateiname + + + + File path + Dateipfad + + + + Year + Jahr + + + + Condition + Zustand + + + + PresetEditor + + + Preset Editor + Bearbeiten der Voreinstellungen + + + + Load + Laden + + + + Delete + Löschen + + + + Preset + Voreinstellung + + + + Auto-preset + Automatische Voreinstellung + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Aufruf: qmmp [Optionen] [Dateien] + + + + Options: + Optionen: + + + + Don't start the application + Die Anwendung nicht starten + + + + Print version number and exit + Gibt die Versionsnummer aus + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Ideen, Patches und Bugreports an <forkotov02@hotmail.ru> senden + + + + Display this text and exit + Zeigt diesen Hilfetext an + + + + Unknown command + Unbekannter Befehl + + + + QMMP version: + Qmmp-Version: + + + + Qt version: + Qt-Version: + + + + ShortcutDialog + + + Change Shortcut + Kurzbefehl ändern + + + + Press the key combination you want to assign + Drücken Sie die Tastenkombination, die Sie zuweisen möchten + + + + Clear + Löschen + + + + TextScroller + + + Autoscroll Songname + Automatischer Bildlauf des Titelnamens + + + + Buffering: %1% + Pufferung: %1 % + + + + VisualMenu + + + Visualization + Visualisierung + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_es.ts b/src/plugins/Ui/skinned/translations/qmmp_es.ts new file mode 100644 index 000000000..b83b3fc59 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_es.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Acerca de Qmmp + + + + About + Acerca de + + + + License Agreement + Contrato de licencia + + + + Authors + Autores + + + + Thanks To + Gracias a + + + + :/txt/authors_en.txt + :/txt/authors_es.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_es.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-based Multimedia Player (Qmmp) + + + + Version: + Versión: + + + + :txt/description_en.txt + :txt/description_es.txt + + + + Input plugins: + Módulos de entrada: + + + + Output plugins: + Módulos de salida: + + + + Visual plugins: + Módulos visuales: + + + + Effect plugins: + Módulos de efectos: + + + + General plugins: + Módulos generales: + + + + Translators + Traductores + + + + :/txt/translators_en.txt + :/txt/translators_es.txt + + + + ActionManager + + + &Play + &Reproducir + + + + X + X + + + + &Pause + &Pausar + + + + C + C + + + + &Stop + &Detener + + + + V + V + + + + &Previous + &Anterior + + + + Z + Z + + + + &Next + &Siguiente + + + + B + B + + + + &Play/Pause + &Reproducir/Pausar + + + + Space + Espacio + + + + &Jump to File + &Ir al archivo + + + + J + J + + + + &Repeat Playlist + &Repetir la lista + + + + R + R + + + + &Repeat Track + &Repetir pista + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + &Revolver + + + + S + S + + + + &No Playlist Advance + &No avanzar en la lista + + + + Ctrl+N + Ctrl+N + + + + &Stop After Selected + &Parar tras los seleccionados + + + + Ctrl+S + Ctrl+S + + + + &Clear Queue + &Limpiar la Cola + + + + Alt+Q + Alt+Q + + + + Show Playlist + Mostrar la lista + + + + Alt+E + Alt+E + + + + Show Equalizer + Mostrar el ecualizador + + + + Alt+G + Alt+G + + + + Always on Top + Siempre encima + + + + Put on All Workspaces + Ver en todos los escritorios + + + + Double Size + Tamaño doble + + + + Meta+D + + + + + &Add File + &Añadir archivo + + + + F + F + + + + &Add Directory + &Añadir directorio + + + + D + D + + + + &Add Url + &Añadir URL + + + + U + U + + + + &Remove Selected + &Eliminar los seleccionados + + + + Del + Supr + + + + &Remove All + &Eliminar todo + + + + &Remove Unselected + &Eliminar los no seleccionados + + + + Remove unavailable files + Eliminar los archivos no disponibles + + + + Remove duplicates + Eliminar los duplicados + + + + &Queue Toggle + &Cambiar de cola + + + + Q + Q + + + + Invert Selection + Invertir la selección + + + + &Select None + &No seleccionar nada + + + + &Select All + &Seleccionar todo + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &Ver detalles de la pista + + + + Alt+I + Alt+I + + + + &New List + &Lista nueva + + + + Ctrl+T + Ctrl+T + + + + &Delete List + &Borrar la lista + + + + Ctrl+W + Ctrl+W + + + + &Load List + &Cargar una lista + + + + O + O + + + + &Save List + &Guardar la lista + + + + Shift+S + Shift+S + + + + &Select Next Playlist + &Seleccionar la lista siguiente + + + + Ctrl+PgDown + Ctrl+AvPág + + + + &Select Previous Playlist + &Seleccionar la lista anterior + + + + Ctrl+PgUp + Ctrl+RePág + + + + &Show Playlists + &Mostrar las listas + + + + P + P + + + + &Settings + &Configuración + + + + Ctrl+P + Ctrl+P + + + + &About + &Acerca de + + + + &About Qt + &Acerca de Qt + + + + &Exit + &Salir + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + Error + + + + Enter URL to add + Introduzca la URL a añadir + + + + &Add + &Añadir + + + + &Cancel + &Cancelar + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Avanzar en la lista de reproducción + + + + Skip backwards in playlist + Retroceder en la lista de reproducción + + + + Start playing current song + Empezar reproduciendo la canción actual + + + + Don't clear the playlist + No limpiar la lista de reproducción + + + + Pause current song + Pausar la canción actual + + + + Pause if playing, play otherwise + Pausar si se está reproduciendo, o viceversa + + + + Stop current song + Detener la canción actual + + + + Display Jump to File dialog + Mostrar el diálogo Saltar a archivo + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Cambiar el volumen de reproducción (ejemplo: qmmp --volume 20) + + + + Show/hide application + Mostrar/ocultar aplicación + + + + Display Add File dialog + Mostrar el diálogo Añadir archivo + + + + Display Add Directory dialog + Mostrar el diálogo Añadir directorio + + + + ConfigDialog + + + Description + Descripción + + + + Filename + Nombre del archivo + + + + Artist + Intérprete + + + + + Album + Album + + + + Track + Pista + + + + Disabled + Deshabilitado + + + + Transports + Transportes + + + + Decoders + Decodificadores + + + + Engines + Motores + + + + Misc + Varios + + + + Title + Título + + + + Track number + Número de pista + + + + Two-digit track number + Número de pista con dos cifras + + + + Disc number + Número de disco + + + + Condition + Condición + + + + Genre + Género + + + + Composer + Compositor + + + + File name + Nombre del archivo + + + + File path + Ruta del archivo + + + + Year + Año + + + + Comment + Comentario + + + + Qmmp Settings + Configuración de Qmmp + + + + Skins + Pieles + + + + Fonts + Fuentes + + + + Player: + Reproductor: + + + + Playlist: + Lista de reproducción: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Metainformación + + + + Load metadata from files + Cargar la metainformación de los archivos + + + + Song Display + Mostrar la canción + + + + Title format: + Formato del título: + + + + + Preferences + Preferencias + + + + + + Information + Información + + + + Appearance + Aspecto + + + + + + Playlist + Lista de reproducción + + + + Plugins + Módulos + + + + Advanced + Avanzado + + + + 16-bit output + Salida de 16 bits + + + + Archived skin + Piel archivada + + + + Unarchived skin + Piel no archivada + + + + Connectivity + Conectividad + + + + Visualization + Visualización + + + + Effects + Efectos + + + + General + General + + + + File Dialog + Diálogo de archivos + + + + + Audio + Sonido + + + + Replay Gain + Normalización + + + + Miscellaneous + Varios + + + + Use bitmap font if available + Usar fuente bitmap si está disponible + + + + Use skin cursors + Usar pieles en cursor + + + + Show song numbers + Mostrar los números de canción + + + + Show playlists + Mostrar la lista de reproducción + + + + Show popup information + Mostrar información emergente + + + + Replay Gain mode: + Método de normalización: + + + + Preamp: + Preamp: + + + + + dB + dB + + + + Default gain: + Normalización predeterminada: + + + + Use peak info to prevent clipping + Procesar picos para evitar cortes + + + + Output: + Salida: + + + + Buffer size: + Tamaño del buffer: + + + + ms + ms + + + + Use software volume control + Usar control de volumen por software + + + + + View + Ver + + + + Shortcuts + Atajos + + + + Hide on close + Esconder al cerrar + + + + Start hidden + Iniciar oculto + + + + Edit template + Editar la plantilla + + + + Show anchor + Mostrar ancla + + + + Align song numbers + Alinear los números de canción + + + + Cover Image Retrieve + Obtener las imagenes de carátula + + + + Use separate image files + Usar archivos de imágen separados + + + + Include files: + Incluir archivos: + + + + Exclude files: + Excluir archivos: + + + + Recursive search depth: + Profundidad de la búsqueda recursiva: + + + + + Playback + Reproducción + + + + Continue playback on startup + Continuar la reproducción al iniciar + + + + Proxy + Proxy + + + + Enable proxy usage + Habilitar el uso de proxy + + + + Proxy host name: + Nombre del servidor proxy: + + + + Proxy port: + Puerto del proxy: + + + + Use authentication with proxy + Usar autentificación con el proxy + + + + Proxy user name: + Usuario del proxy: + + + + Proxy password: + Contraseña del proxy: + + + + Action + Acción + + + + Shortcut + Atajo + + + + Change shortcut... + Cambiar atajo... + + + + Convert underscores to blanks + Convertir los guiones bajos en espacios + + + + Convert %20 to blanks + Convertir los %20 en espacios + + + + Select Skin Files + Seleccionar archivos de pieles + + + + Skin files + Archivos de pieles + + + + Add... + Añadir... + + + + Refresh + Actualizar + + + + Show protocol + Motrar protocolo + + + + Transparency + Transparencia + + + + Main window + Ventana principal + + + + + + 0 + 0 + + + + Equalizer + Ecualizador + + + + EqWidget + + + + preset + preprogramado + + + + &Load/Delete + &Cargar/Eliminar + + + + &Save Preset + &Guardar preprogramado + + + + &Save Auto-load Preset + &Guardar preprogramado autocargable + + + + &Clear + &Limpiar + + + + Saving Preset + Guardando preprogramado + + + + Preset name: + Nombre del preprogramado: + + + + preset # + Preprogramado nº + + + + &Import + &Importar + + + + Equalizer + Ecualizador + + + + Import Preset + Importar preprogramado + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + Desencolar + + + + + + Queue + Encolar + + + + Jump To Track + Saltar hasta pista + + + + Filter + Filtrar + + + + Refresh + Actualizar + + + + Jump To + Saltar a + + + + MainDisplay + + + Previous + Anterior + + + + Play + Reproducir + + + + Pause + Pausar + + + + Stop + Detener + + + + Next + Siguiente + + + + Add file + Añadir archivo + + + + Equalizer + Ecualizador + + + + Playlist + Lista de reproducción + + + + Repeat playlist + Repetir la lista de reproducción + + + + Shuffle + Revolver + + + + Volume + Volumen + + + + Balance + Balance + + + + Volume: %1% + Volumen: %1% + + + + Balance: %1% right + Balance: %1% derecha + + + + Balance: %1% left + Balance: %1% izquierda + + + + Balance: center + Balance: centro + + + + Seek to: %1 + Ir hasta: %1 + + + + MainVisual + + + Visualization Mode + Modo de visualización + + + + Analyzer + Analizador + + + + Scope + Osciloscopio + + + + Off + Apagado + + + + Analyzer Mode + Modo del analizador + + + + Normal + Normal + + + + Fire + Fuego + + + + Vertical Lines + Líneas verticales + + + + Lines + Líneas + + + + Bars + Barras + + + + Peaks + Picos + + + + Refresh Rate + Velocidad de actualización + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Caída del analizador + + + + + Slowest + Muy lenta + + + + + Slow + Lenta + + + + + Medium + Media + + + + + Fast + Rápida + + + + + Fastest + Muy rápida + + + + Peaks Falloff + Caída de picos + + + + Background + Fondo + + + + Transparent + Transparente + + + + MainWindow + + + Choose a directory + Seleccione un directorio + + + + Select one or more files to open + Seleccione uno o más archivos para abrir + + + + &Jump To File + &Saltar a archivo + + + + J + J + + + + View + Ver + + + + Playlist + Lista de reproducción + + + + Open Playlist + Abrir la lista de reproducción + + + + Save Playlist + Guardar la lista de reproducción + + + + + Playlist Files + Archivos a reproducir + + + + All Supported Bitstreams + Todos los flujos soportados + + + + Tools + Herramientas + + + + PlayList + + + &Copy Selection To + &Copiar la selección a + + + + Sort List + Ordenar la lista + + + + + By Title + Por título + + + + + By Album + Por album + + + + + By Artist + Por intérprete + + + + + By Filename + Por nombre de archivo + + + + + By Path + Filename + Por ruta + nombre + + + + + By Date + Por fecha + + + + Sort Selection + Ordenar la selección + + + + Randomize List + Lista aleatoria + + + + Reverse List + Invertir la lista + + + + &New PlayList + &Lista nueva + + + + + By Track Number + Por número de pista + + + + Playlist + Lista de reproducción + + + + Actions + Acciones + + + + PlayListBrowser + + + Playlist Browser + Navegador de listas de reproducción + + + + New + Nueva + + + + + Delete + Borrar + + + + + ... + ... + + + + Rename + Renombrar + + + + PlayListSelector + + + &Load + &Cargar + + + + &Save As... + &Guardar como... + + + + Rename + Renombrar + + + + &Delete + &Borrar + + + + Rename Playlist + Renombrar lista + + + + Playlist name: + Nombre de la lista: + + + + PopupSettings + + + Popup Information Settings + Configuración de información emergente + + + + Show cover + Mostrar carátula + + + + Transparency: + Transparencia: + + + + Delay: + Retardo: + + + + ms + ms + + + + Cover size: + Tamaño de la carátula: + + + + Template + Plantilla + + + + Reset + Reiniciar + + + + Insert + Insertar + + + + Artist + Intérprete + + + + Album + Album + + + + Title + Título + + + + Track number + Número de pista + + + + Two-digit track number + Número de pista con dos cifras + + + + Genre + Género + + + + Comment + Comentario + + + + Composer + Compositor + + + + Duration + Duración + + + + Disc number + Número de disco + + + + File name + Nombre del archivo + + + + File path + Ruta del archivo + + + + Year + Año + + + + Condition + Condición + + + + PresetEditor + + + Preset Editor + Editor de preprogamados + + + + Load + Cargar + + + + Delete + Borrar + + + + Preset + Preprogramado + + + + Auto-preset + Automático + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Uso: qmmp [opciones] [archivos] + + + + Options: + Opciones: + + + + Print version number and exit + Mostrar el número de versión y salir + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Enviar ideas, parches, errores a: forkotov02@hotmail.ru + + + + Qt version: + Versión de Qt: + + + + Display this text and exit + Muestra este texto y sale + + + + Unknown command + Comando desconocido + + + + Don't start the application + No iniciar la aplicación + + + + QMMP version: + Versión de QMMP: + + + + ShortcutDialog + + + Change Shortcut + Cambiar atajo + + + + Press the key combination you want to assign + Pulse la combinación de teclas que quiere asignar + + + + Clear + Borrar + + + + TextScroller + + + Autoscroll Songname + Autodesplazar el nombre de la canción + + + + Buffering: %1% + Cargando: %1% + + + + VisualMenu + + + Visualization + Visualización + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_fr.ts b/src/plugins/Ui/skinned/translations/qmmp_fr.ts new file mode 100644 index 000000000..2541e7a62 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_fr.ts @@ -0,0 +1,1081 @@ + + + + + AboutDialog + + + About Qmmp + À propos de Qmmp + + + + About + À propos + + + + License Agreement + Contrat de licence + + + + Authors + Auteurs + + + + Thanks To + Remerciements + + + + :/txt/authors_en.txt + :/txt/authors_fr.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_fr.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-based Multimedia Player (Qmmp) + + + + Version: + Version : + + + + :txt/description_en.txt + :txt/description_fr.txt + + + + Input plugins: + Modules d'entrée : + + + + Output plugins: + Modules de sortie : + + + + Visual plugins: + Modules de visualisation : + + + + Effect plugins: + Мodules d'effets : + + + + General plugins: + Modules généraux : + + + + Translators + Traducteurs + + + + :/txt/translators_en.txt + :/txt/translators_fr.txt + + + + AddUrlDialog + + + Error + Erreur + + + + Enter URL to add + Saisir un flux Internet + + + + &Add + &Ajouter + + + + &Cancel + &Annuler + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Avancer dans la liste de lecture + + + + Skip backwards in playlist + Reculer dans la liste de lecture + + + + Start playing current song + Démarrer la lecture du morceau courant + + + + Pause current song + Mettre en pause le morceau courant + + + + Pause if playing, play otherwise + Mettre en pause si le morceau est joué ; autrement, le jouer + + + + Stop current song + Arrêter le morceau courant + + + + Set playback volume(example: qmmp --volume20, qmmp --volume100) + Configurer le volume de lecture (exemple: qmmp --volume20, qmmp --volume100) + + + + Display Jump to File dialog + Afficher la boîte de dialogue « Aller au fichier » + + + + Show/hide application + Afficher ou cacher Qmmp + + + + Display Add File dialog + Afficher la boîte de dialogue « Ajouter un fichier » + + + + Display Add Directory dialog + Afficher la boîte de dialogue « Ajouter un dossier » + + + + ConfigDialog + + + Enabled + Activé + + + + Description + Description + + + + Filename + Nom du fichier + + + + Artist + Artiste + + + + Album + Album + + + + Title + Titre + + + + Tracknumber + Numéro de piste + + + + Genre + Genre + + + + Filepath + Emplacement du fichier + + + + Date + Date + + + + Year + Année + + + + Comment + Commentaire + + + + Qmmp Settings + Configuration de Qmmp + + + + Skins + Thèmes + + + + Fonts + Polices + + + + Player: + Lecteur : + + + + Playlist: + Liste de lecture : + + + + ??? + ??? + + + + ... + ... + + + + Metadata + Méta-données + + + + Load metadata from files + Charger les méta-données depuis les fichiers + + + + Song Display + Affichage du morceau + + + + Title format: + Format du titre : + + + + Input + Entrée + + + + Output + Sortie + + + + Preferences + Préférences + + + + Information + Information + + + + Appearance + Apparence + + + + Playlist + Liste de lecture + + + + Plugins + Modules + + + + Advanced + Avancé + + + + Close + Fermer + + + + Archived skin + Thème archivé + + + + Unarchived skin + Thème non-archivé + + + + Connectivity + Connectivité + + + + Visualization + Visualisation + + + + Effects + Effets + + + + General + Général + + + + File Dialog + Boîte de dialogue des fichiers + + + + Audio + Audio + + + + Use software volume control + Utiliser le contrôle du volume logiciel + + + + Visibility Control + Contrôle de l'affichage + + + + Hide on close + Masquer à la fermeture + + + + Start hidden + Démarrer masqué + + + + Proxy + Proxy + + + + Enable proxy usage + Activer l'utilisation du serveur mandataire + + + + Proxy host name: + Nom du serveur : + + + + Proxy port: + Port du serveur : + + + + Use authentication with proxy + Utiliser l'authentification avec le serveur mandataire + + + + Proxy user name: + Nom d'utilisateur : + + + + Proxy password: + Mot de passe : + + + + Convert underscores to blanks + Remplacer les caractères « _ » par des espaces + + + + Convert %20 to blanks + Remplacer les caractères « %20 » par des espaces + + + + Show full path of a stream + Afficher l'emplacement complet d'un flux + + + + EqWidget + + + preset + réglage + + + + &Load/Delete + &Charger / Supprimer + + + + &Save Preset + &Enregistrer un réglage + + + + &Save Auto-load Preset + &Enregistrer un réglage automatiquement-chargé + + + + &Clear + &Effacer + + + + Saving Preset + Réglage en cours d'enregistrement + + + + Preset name: + Nom du réglage : + + + + preset # + réglage # + + + + &Import + &Importer + + + + Import Preset + Importer un réglage + + + + JumpToTrackDialog + + + Unqueue + Supprimer de la file d'attente + + + + Queue + Mettre dans la file d'attente + + + + Jump To Track + Aller au morceau + + + + Filter + Filtre + + + + Refresh + Rafraîchir + + + + Jump To + Aller à + + + + Close + Fermer + + + + MainVisual + + + Visualization Mode + Visualisation + + + + Analyzer + Analyseur + + + + Scope + Oscilloscope + + + + Off + Arrêt + + + + Analyzer Mode + Mode analyseur + + + + Normal + Normal + + + + Fire + Feu + + + + Vertical Lines + Lignes verticales + + + + Lines + Lignes + + + + Bars + Barres + + + + Peaks + Pics + + + + Refresh Rate + Rafraîchir le taux + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Retombée de l'analyseur + + + + Slowest + Très lente + + + + Slow + Lente + + + + Medium + Moyenne + + + + Fast + Rapide + + + + Fastest + Très rapide + + + + Peaks Falloff + Retombée des pics + + + + Background + Arrière-plan + + + + Transparent + Transparent + + + + MainWindow + + + Default + Défaut + + + + Choose a directory + Choisir un dossier + + + + Select one or more files to open + Sélectionner un ou plusieurs fichiers à ouvrir + + + + &Play + &Jouer + + + + X + X + + + + &Pause + &Pause + + + + C + C + + + + &Stop + &Arrêter + + + + V + V + + + + &Previous + &Précédent + + + + Z + Z + + + + &Next + &Suivant + + + + B + B + + + + &Jump To File + &Aller au fichier + + + + J + J + + + + &Settings + &Configuration + + + + Ctrl+P + Ctrl+P + + + + &Exit + &Quitter + + + + Ctrl+Q + Ctrl+Q + + + + Open Playlist + Ouvrir une liste de lecture + + + + Save Playlist + Enregistrer une liste de lecture + + + + &About + &À propos + + + + Playlist Files + Fichiers de la liste de lecture + + + + Space + Espace + + + + &About Qt + &À propos de Qt + + + + &Play/Pause + &Jouer / Pause + + + + All Supported Bitstreams + Tout les flux supportés + + + + PlayList + + + F + F + + + + D + D + + + + Alt+I + Alt+I + + + + Ctrl+A + Ctrl+A + + + + O + O + + + + &Add File + &Ajouter un fichier + + + + &Add Directory + &Ajouter un dossier + + + + &Remove Selected + &Supprimer la sélection + + + + &Remove All + &Tout supprimer + + + + &Remove Unselected + &Ne garder que la sélection + + + + &View Track Details + &Afficher les détails du morceau + + + + Sort List + Trier la liste + + + + By Title + Par titre + + + + By Filename + Par nom de fichier + + + + By Path + Filename + Par emplacement + nom de fichier + + + + By Date + Par date + + + + Sort Selection + Trier la sélection + + + + Randomize List + Mélanger la liste + + + + Reverse List + Inverser la liste + + + + Invert Selection + Inverser la sélection + + + + &Select None + &Ne rien sélectionner + + + + &Select All + &Tout sélectionner + + + + &New List + &Nouvelle liste + + + + Shift+N + Shift+N + + + + &Load List + &Charger une liste + + + + &Save List + &Enregistrer une liste + + + + Shift+S + Shift+S + + + + Del + Suppr + + + + &Add Url + &Ajouter un flux internet + + + + U + U + + + + By Track Number + Par numéro de piste + + + + &Queue + &Mettre dans la file d'attente + + + + Q + Q + + + + PlayListModel + + + Url: + Flux Internet : + + + + Title: + Titre : + + + + Artist: + Artiste : + + + + Album: + Album : + + + + Comment: + Commentaire : + + + + PresetEditor + + + Preset Editor + Éditeur de réglages + + + + Load + Charger + + + + Delete + Supprimer + + + + Preset + Réglage + + + + Auto-preset + Réglage auto + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Usage : qmmp [options] [fichiers] + + + + Options: + Options : + + + + Print version number and exit + Imprimer le numéro de version et quitter + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Idées, patches, rapports de bogues à envoyer à : forkotov02@hotmail.ru + + + + Display this text and exit + Afficher ce texte et quitter + + + + QMMP version: + Version de Qmmp : + + + + TextScroller + + + Buffering: + Tampon : + + + + Autoscroll Songname + Détection automatique du nom de fichier + + + + VisualMenu + + + Visualization + Visualisation + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_hu.ts b/src/plugins/Ui/skinned/translations/qmmp_hu.ts new file mode 100644 index 000000000..33b2d5afc --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_hu.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + :/txt/authors_en.txt + :/txt/authors_en.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_en.txt + + + + :/txt/translators_en.txt + :/txt/translators_en.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt alapú Multimédia Lejátszó (Qmmp) + + + + Version: + Verzió: + + + + :txt/description_en.txt + :txt/description_en.txt + + + + Input plugins: + Bemeneti pluginek: + + + + Output plugins: + Kimeneti pluginek: + + + + Visual plugins: + Vizuális pluginek: + + + + Effect plugins: + Effekt pluginek: + + + + General plugins: + Ãltalános pluginek: + + + + About Qmmp + Névjegy: Qmmp + + + + About + Névjegy + + + + Authors + KészítÅ‘k + + + + Translators + Fordítók + + + + Thanks To + Köszönet + + + + License Agreement + Licensz Egyezmény + + + + ActionManager + + + &Play + &Lejátszás + + + + X + X + + + + &Pause + &Szünet + + + + C + C + + + + &Stop + &Megállítás + + + + V + V + + + + &Previous + &ElÅ‘zÅ‘ + + + + Z + Z + + + + &Next + &KövetkezÅ‘ + + + + B + B + + + + &Play/Pause + &Lejátszás/Szünet + + + + Space + Szóköz + + + + &Jump to File + + + + + J + J + + + + &Repeat Playlist + Lista &ismétlése + + + + R + + + + + &Repeat Track + Számok i&smétlése + + + + Ctrl+R + Crtl+R + + + + &Shuffle + &Véletlenszerű + + + + S + S + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + &Fájl hozzáadása + + + + F + F + + + + &Add Directory + &Könyvtár hazááadása + + + + D + D + + + + &Add Url + &Url hozzáadása + + + + U + U + + + + &Remove Selected + &Megjelöltek eltávolítása + + + + Del + Del + + + + &Remove All + &Összes eltávolítása + + + + &Remove Unselected + &Jelöletlenek eltávolítása + + + + Remove unavailable files + Elérhetetlen fájlok eltávolítása + + + + Remove duplicates + Duplikációk eltávolítása + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Fordított kijelölés + + + + &Select None + &Kijelölés megszűntetése + + + + &Select All + &Összes kijelölése + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + Szám adatainak &megnézése + + + + Alt+I + Alt+I + + + + &New List + &Új lista + + + + Ctrl+T + Ctrl+T + + + + &Delete List + &Lista törlése + + + + Ctrl+W + Ctrl+W + + + + &Load List + &Lista betöltése + + + + O + O + + + + &Save List + Lista &mentése + + + + Shift+S + Shift+S + + + + &Select Next Playlist + &KövetkezÅ‘ lista választása + + + + Ctrl+PgDown + Ctrl+PgDown + + + + &Select Previous Playlist + &ElÅ‘zÅ‘ lista választása + + + + Ctrl+PgUp + Ctrl+PgUp + + + + &Show Playlists + &Lejátszási lista mutatása + + + + P + P + + + + &Settings + &Beállítások + + + + Ctrl+P + Ctrl+P + + + + &About + &Névjegy + + + + &About Qt + N&évjegy: Qt + + + + &Exit + &Kilépés + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + Hiba + + + + Enter URL to add + Ãrj be egy URL-t a hozzáadáshoz + + + + &Add + &Hozzáad + + + + &Cancel + &Mégsem + + + + BuiltinCommandLineOption + + + Don't clear the playlist + Ne töröld a lejátszási listát + + + + Start playing current song + Aktuális szám lejátszásának indítása + + + + Pause current song + Aktuális szám szüneteltetése + + + + Pause if playing, play otherwise + Szünet ha lejátszás van, különben lejátszás + + + + Stop current song + Aktuális szám megállítása + + + + Display Jump to File dialog + Számra ugrás ablak mutatása + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Lejátszási hangerÅ‘ beállítása (pl.: qmmp --volume 20) + + + + Skip forward in playlist + Lejátszási lista következÅ‘ számának kihagyása + + + + Skip backwards in playlist + Lejátszási lista elÅ‘zÅ‘ számainak kihagyása + + + + Show/hide application + Alkalmazás mutatása/elrejtése + + + + Display Add File dialog + Fájl hozzáadása ablak mutatása + + + + Display Add Directory dialog + Könyvtár hozzáadása ablak mutatása + + + + ConfigDialog + + + Archived skin + Tömörített skin + + + + Unarchived skin + Tömörítettlen skin + + + + Description + Leírás + + + + Filename + Fájlnév + + + + Artist + ElÅ‘adó + + + + + Album + Album + + + + Title + Cím + + + + Genre + Műfaj + + + + Year + Év + + + + Comment + Megjegyzés + + + + Track + Szám + + + + Disabled + Kikapcsolva + + + + Transports + Transzportálás + + + + Decoders + Dekóderek + + + + Engines + Motorok + + + + Misc + + + + + Track number + Zeneszám + + + + Two-digit track number + Két jegyű zeneszám + + + + Composer + ZeneszerzÅ‘ + + + + Disc number + Lemezszám + + + + File name + Fájl neve + + + + File path + File útvonala + + + + Condition + Feltétel + + + + Select Skin Files + Skin fájl kiválasztása + + + + Skin files + Skin fájlok + + + + Qmmp Settings + Qmmp beállítások + + + + Appearance + Megjelenés + + + + + + Playlist + Lejátszási lista + + + + Plugins + BeépülÅ‘k + + + + Advanced + Haladó + + + + Connectivity + Összekapcsolhatóság + + + + Skins + Skinek + + + + Add... + Hozzáad... + + + + Refresh + Frissít + + + + Miscellaneous + Vegyes + + + + Fonts + Betűtípus + + + + Player: + Lejátszó: + + + + + ??? + ??? + + + + + + ... + ... + + + + Playlist: + Lejátszási lista: + + + + Use bitmap font if available + Bittérképes betűtípus használata, ha elérhetÅ‘ + + + + Use skin cursors + Skin egértéma használata + + + + Shortcuts + + + + + Metadata + Metaadatok + + + + Load metadata from files + Metaadatok betöltése fájlból + + + + Song Display + Szám kijelzÅ‘ + + + + Title format: + Cím formátum: + + + + Convert underscores to blanks + Lepontozottak átalakítása üressé + + + + Convert %20 to blanks + Ãtalakítás %20 üressé + + + + Show protocol + Protokol mutatása + + + + Show song numbers + Zene sorszámának mutatása + + + + Show playlists + Lejátszási lista mutatása + + + + Show popup information + Felugró információk mutatása + + + + Show anchor + + + + + Align song numbers + + + + + + Preferences + Tulajdonságok + + + + + + Information + Információ + + + + + Playback + Lejátszás + + + + Continue playback on startup + Lejátszás folytatása indításkor + + + + Buffer size: + + + + + ms + ms + + + + 16-bit output + 16 bites kimenet + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Visualization + Vizualizáció + + + + Effects + Effektek + + + + General + Ãltalános + + + + + Audio + Audió + + + + Replay Gain + Replay Gain + + + + Replay Gain mode: + Replay Gain mód: + + + + Preamp: + Preamp: + + + + + dB + dB + + + + Default gain: + Alapértelmezett gain: + + + + Use peak info to prevent clipping + Csúcs információ használata a klippelés megelÅ‘zéséhez + + + + Output: + Kimenet: + + + + Use software volume control + Szoftveres hangerÅ‘szabályzó használata + + + + Hide on close + Elrejtés bezáráskor + + + + Start hidden + Rejtve induljon + + + + File Dialog + Fájl ablak + + + + Transparency + Ãtlátszóság + + + + + View + Megnéz + + + + Main window + FÅ‘ ablak + + + + + + 0 + 0 + + + + Equalizer + Hangszínszabályozó + + + + Edit template + + + + + Cover Image Retrieve + Borító beszerzése + + + + Use separate image files + KülönbözÅ‘ képfájlok használata + + + + Include files: + Tartalmazott fájlok: + + + + Exclude files: + Kihagyott fájlok: + + + + Recursive search depth: + Rekúrzív keresési mélység: + + + + Proxy + Proxy + + + + Enable proxy usage + Proxy használatának engedélyezése + + + + Proxy host name: + Proxy host name: + + + + Proxy port: + Proxy port: + + + + Use authentication with proxy + Hitelesítés hasznáalta proxy-val + + + + Proxy user name: + Proxy felhasználónév: + + + + Proxy password: + Proxy jelszó: + + + + EqWidget + + + Equalizer + + + + + + preset + beállítás + + + + &Load/Delete + &Betölt/Töröl + + + + &Save Preset + Beálítás &mentése + + + + &Save Auto-load Preset + &Automatikusan betöltödÅ‘ beállítás mentése + + + + &Import + &Importálás + + + + &Clear + &Törlés + + + + Saving Preset + Beállítások mentése + + + + Preset name: + Beállítás neve: + + + + preset # + beállítás # + + + + Import Preset + Beállítás importálása + + + + JumpToTrackDialog + + + Jump To Track + Ugrás számra + + + + Filter + SzűrÅ‘ + + + + + + Queue + Sorba betesz + + + + Refresh + Frissít + + + + Jump To + Ugrás + + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + Sorból kivesz + + + + MainDisplay + + + Previous + ElÅ‘zÅ‘ + + + + Play + Lejátszás + + + + Pause + Szünet + + + + Stop + Megállít + + + + Next + KövetkezÅ‘ + + + + Add file + Fájl hozzáadása + + + + Equalizer + Hangszínszabályzó + + + + Playlist + Lejátszási lista + + + + Repeat playlist + Lista ismétlése + + + + Shuffle + Véletlenszerű + + + + Volume + HangerÅ‘ + + + + Balance + Egyensúly + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + Vizualizációs mód + + + + Analyzer + Analyzer + + + + Scope + Scope + + + + Off + Ki + + + + Analyzer Mode + Analyzer mód + + + + Normal + Hagyományos + + + + Fire + Tűz + + + + Vertical Lines + FüggÅ‘leges vonalak + + + + Lines + Vonalak + + + + Bars + Csíkok + + + + Peaks + Csúcsok + + + + Refresh Rate + Ráta frissítése + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Analízer esése + + + + + Slowest + Lassabb + + + + + Slow + Lassú + + + + + Medium + Közepes + + + + + Fast + Gyors + + + + + Fastest + Gyorsabb + + + + Peaks Falloff + Csúcsok esése + + + + Background + Háttér + + + + Transparent + Ãtlátszóság + + + + MainWindow + + + Choose a directory + Válassz egy könyvtárat + + + + All Supported Bitstreams + Minden támogatott bitráta + + + + Select one or more files to open + Válassz egy vagy több fájlat megnyitásra + + + + Playlist + Lejátszási lista + + + + &Jump To File + &Ugrás fájlra + + + + J + J + + + + View + Megnéz + + + + Tools + Eszközök + + + + + Playlist Files + Lejátszási lista fájl + + + + Open Playlist + Lista megnyitása + + + + Save Playlist + Lista mentése + + + + PlayList + + + Playlist + Lejátszási lista + + + + Sort List + Lista rendezése + + + + + By Title + Cím szerint + + + + + By Album + Album szerint + + + + + By Artist + ElÅ‘adó szerint + + + + + By Filename + Fájlnév szerint + + + + + By Path + Filename + Elérési út és fájlnév szerint + + + + + By Date + Dátum szerint + + + + + By Track Number + Zene sorszáma szerint + + + + Sort Selection + Jelöltek rendezése + + + + Randomize List + Lista összekeverése + + + + Reverse List + Fordított lista + + + + Actions + Tevékenységek + + + + &New PlayList + + + + + &Copy Selection To + + + + + PlayListBrowser + + + Playlist Browser + Lejátszási lista böngészÅ‘ + + + + New + Új + + + + + Delete + Törlés + + + + + ... + ... + + + + Rename + Ãtnevez + + + + PlayListSelector + + + &Load + &Betölt + + + + &Save As... + &Mentés másként... + + + + Rename + Ãtnevez + + + + &Delete + &Törlés + + + + Rename Playlist + Lista átnevezése + + + + Playlist name: + Lista neve: + + + + PopupSettings + + + Popup Information Settings + Popup Információs Beállítások + + + + Show cover + Borító mutatása + + + + Transparency: + Ãtlátszóság: + + + + Delay: + Késleltetés: + + + + ms + ms + + + + Cover size: + Borító mérete: + + + + Template + Sablon + + + + Reset + Visszaállít + + + + Insert + Beszúr + + + + Artist + ElÅ‘adó + + + + Album + Album + + + + Title + Cím + + + + Track number + Zeneszám + + + + Two-digit track number + Két jegyű zeneszám + + + + Genre + Műfaj + + + + Comment + Megjegyzés + + + + Composer + SzerzÅ‘ + + + + Duration + IdÅ‘tartam + + + + Disc number + Lemezszám + + + + File name + Fájl neve + + + + File path + Fájl útvonala + + + + Year + Év + + + + Condition + Feltétel + + + + PresetEditor + + + Preset Editor + Beállítás szerkesztÅ‘ + + + + Load + Betölt + + + + Delete + Töröl + + + + Preset + Beállítás + + + + Auto-preset + Automatikus beállítás + + + + QMMPStarter + + + Unknown command + Ismeretlen parancs + + + + Usage: qmmp [options] [files] + Használat: qmmp [opciók] [fájlok] + + + + Options: + Opciók: + + + + Don't start the application + + + + + Display this text and exit + Mutasd ezt a szöveget, majd lépj ki + + + + Print version number and exit + Mutasd a verziószámot, majd lépj ki + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Ötleteket, foltokat, hibajelentéseket küld a forkotov02@hotmail.ru címre + + + + QMMP version: + QMMP verzió: + + + + Qt version: + Qt verzió: + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + Számok címének görgetése + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + Vizualizáció + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_it.ts b/src/plugins/Ui/skinned/translations/qmmp_it.ts new file mode 100644 index 000000000..a94b67cc7 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_it.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Informazioni su Qmmp + + + + About + Info + + + + License Agreement + Contratto di licenza + + + + Authors + Autori + + + + Thanks To + Ringraziamenti + + + + :/txt/authors_en.txt + :/txt/authors_it.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_it.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-based Multimedia Player (Qmmp) + + + + Version: + Versione: + + + + :txt/description_en.txt + :txt/description_it.txt + + + + Input plugins: + Moduli d'entrata: + + + + Output plugins: + Moduli d'uscita : + + + + Visual plugins: + Moduli di visualizzazione: + + + + Effect plugins: + Мoduli per gli effetti: + + + + General plugins: + Moduli generali: + + + + Translators + Traduttori + + + + :/txt/translators_en.txt + :/txt/translators_it.txt + + + + ActionManager + + + &Play + &Esegui + + + + X + X + + + + &Pause + &Pausa + + + + C + C + + + + &Stop + &Arresta + + + + V + V + + + + &Previous + &Precedente + + + + Z + Z + + + + &Next + &Successivo + + + + B + B + + + + &Play/Pause + &Esegui / Pausa + + + + Space + Spazio + + + + &Jump to File + + + + + J + J + + + + &Repeat Playlist + &Ripeti lista brani + + + + R + R + + + + &Repeat Track + &Ripeti brano + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + &Ordine casuale + + + + S + S + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + &Aggiungi brani + + + + F + F + + + + &Add Directory + &Aggiungi cartelle + + + + D + D + + + + &Add Url + &Aggiungi URL + + + + U + U + + + + &Remove Selected + &Elimina la selezione + + + + Del + Canc + + + + &Remove All + &Elimina tutto + + + + &Remove Unselected + &Elimina i non selezionati + + + + Remove unavailable files + Rimuovi files non disponibili + + + + Remove duplicates + Rimuovi duplicati + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Inverti la selezione + + + + &Select None + &Non scegliere alcun brano + + + + &Select All + &Seleziona tutto + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &Dettagli della traccia + + + + Alt+I + Alt+I + + + + &New List + &Nuova lista + + + + Ctrl+T + Ctrl+T + + + + &Delete List + &Cancella lista + + + + Ctrl+W + Ctrl+W + + + + &Load List + &Carica lista + + + + O + O + + + + &Save List + &Salva lista + + + + Shift+S + Shift+S + + + + &Select Next Playlist + &Seleziona la successiva lista esecuzione brani + + + + Ctrl+PgDown + Ctrl+PgDown + + + + &Select Previous Playlist + &Seleziona la rpecedente lista esecuzione brani + + + + Ctrl+PgUp + Ctrl+PgUp + + + + &Show Playlists + Mostra lista esecuzione brani + + + + P + P + + + + &Settings + &Configurazione + + + + Ctrl+P + Ctrl+P + + + + &About + &Informazioni + + + + &About Qt + &Informazioni su Qt + + + + &Exit + &Esci + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + Errore + + + + Enter URL to add + Aggiungi un URL + + + + &Add + &Aggiungi + + + + &Cancel + &Annulla + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Scorri in avanti lista dei brani + + + + Skip backwards in playlist + Scorri indietro la lista dei brani + + + + Start playing current song + Inizia il brano scelto + + + + Don't clear the playlist + Non ripulire la lista esecuzione + + + + Pause current song + Sospendi il brano in esecuzione + + + + Pause if playing, play otherwise + Sospendi il brano se in esecuzione; lo riprende se in pausa + + + + Stop current song + Arresta il brano in esecuzione + + + + Display Jump to File dialog + Mostra il menu «Vai al brano» + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + + + + + Show/hide application + Mostra/nascondi Qmmp + + + + Display Add File dialog + Mostra il menu «Aggiungi brani» + + + + Display Add Directory dialog + Mostra il menu «Aggiungi cartella» + + + + ConfigDialog + + + Description + Descrizione + + + + Filename + File + + + + Artist + Interprete + + + + + Album + Album + + + + Track + Traccia + + + + Disabled + Disabilitato + + + + Transports + Protocolli di trasporto + + + + Decoders + Decodificatori + + + + Engines + Meccanismi + + + + Misc + + + + + Title + Titolo + + + + Track number + Traccia n° + + + + Two-digit track number + Traccia n° a due cifre + + + + Disc number + Disco n° + + + + Condition + Condizione + + + + Genre + Genere + + + + Composer + Compositore + + + + File name + Nome file + + + + File path + Percorso file + + + + Year + Anno + + + + Comment + Commento + + + + Qmmp Settings + Configurazione di Qmmp + + + + Skins + Temi + + + + Fonts + Caratteri + + + + Player: + Player: + + + + Playlist: + Lista brani : + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Metadati + + + + Load metadata from files + Carica i metadati dai brani + + + + Song Display + Mostra il brano + + + + Title format: + Formato del titolo : + + + + + Preferences + Impostazioni preferite + + + + + + Information + Informazioni + + + + Appearance + Aspetto + + + + + + Playlist + Lista dei brani + + + + Plugins + Moduli + + + + Advanced + Avanzato + + + + 16-bit output + uscita a 16 bit + + + + Archived skin + Tema archiviato + + + + Unarchived skin + Tema non archiviato + + + + Connectivity + Connettività + + + + Visualization + Visualizzazione + + + + Effects + Effetti + + + + General + Generale + + + + File Dialog + Menu brani + + + + + Audio + Audio + + + + Replay Gain + Normalizzazione + + + + Miscellaneous + Varie + + + + Use bitmap font if available + Usa carattere bitmap se disponibile + + + + Use skin cursors + Usa cursore skin + + + + Show song numbers + Mostra numero brani + + + + Show playlists + Mostra lista esecuzione brani + + + + Show popup information + Mostra informazioni popup + + + + Replay Gain mode: + Metodo di normalizzazione + + + + Preamp: + Preamp: + + + + + dB + dB + + + + Default gain: + Normalizzazione predefinita + + + + Use peak info to prevent clipping + Utilizza informazioni di picco per evitare tagli + + + + Output: + Uscita: + + + + Buffer size: + + + + + ms + ms + + + + Use software volume control + Utilizza il controllo volume del programma + + + + + View + + + + + Shortcuts + + + + + Hide on close + Nascondi alla chiusura + + + + Start hidden + Avvia nascosto + + + + Edit template + + + + + Show anchor + + + + + Align song numbers + + + + + Cover Image Retrieve + Trova immagine copertina + + + + Use separate image files + Usa immagini separate + + + + Include files: + Includi i file: + + + + Exclude files: + Escludi i file: + + + + Recursive search depth: + Profondità ricerca ricorsiva: + + + + + Playback + Riproduzione + + + + Continue playback on startup + Continua la riproduzione all'avvio + + + + Proxy + Proxy + + + + Enable proxy usage + Attiva il proxy + + + + Proxy host name: + Nome del server : + + + + Proxy port: + Porta del server : + + + + Use authentication with proxy + Usa autenticazione con il proxy + + + + Proxy user name: + Utente: + + + + Proxy password: + Password : + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Convert underscores to blanks + Converti il carattere « _ » in spazi + + + + Convert %20 to blanks + Converti il carattere « %20 » in spazi + + + + Select Skin Files + Seleziona aspetto + + + + Skin files + Aspetto + + + + Add... + Aggiungi... + + + + Refresh + Aggiorna + + + + Show protocol + Motra protocollo + + + + Transparency + Transparenza + + + + Main window + Finestra principale + + + + + + 0 + 0 + + + + Equalizer + Equalizzatore + + + + EqWidget + + + + preset + Impostazione + + + + &Load/Delete + &Carica/Elimina + + + + &Save Preset + &Salva preimpostazione + + + + &Save Auto-load Preset + &Salvare preimpostazioni caricate automaticamente + + + + &Clear + &Cancella + + + + Saving Preset + Salvataggio preimpostazioni + + + + Preset name: + Nome delle preimpostazioni: + + + + preset # + Preimpostazione # + + + + &Import + &Importa + + + + Equalizer + Equalizzatore + + + + Import Preset + Importa preimpostazione + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + Elimna dalla coda + + + + + + Queue + Metti in coda + + + + Jump To Track + Vai alla traccia + + + + Filter + Filtra + + + + Refresh + Aggiorna + + + + Jump To + Vai a + + + + MainDisplay + + + Previous + Brano precedente + + + + Play + Esegui + + + + Pause + Sospendi + + + + Stop + Ferma + + + + Next + Brano successivo + + + + Add file + Aggiungi brani + + + + Equalizer + Equalizzatore + + + + Playlist + Lista brani + + + + Repeat playlist + Ripeti la lista brani + + + + Shuffle + Ordine casuale + + + + Volume + Volume + + + + Balance + Bilanciamento + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + Modo visualizzazione + + + + Analyzer + Analizzatore + + + + Scope + Oscilloscopio + + + + Off + Chiudi + + + + Analyzer Mode + Modo analizzatore + + + + Normal + Normale + + + + Fire + Fuoco + + + + Vertical Lines + Linee verticali + + + + Lines + Linee + + + + Bars + Barre + + + + Peaks + Picchi + + + + Refresh Rate + Velocità di aggiornamento + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Ricaduta analizzatore + + + + + Slowest + Molto lenta + + + + + Slow + Lenta + + + + + Medium + Media + + + + + Fast + Rapida + + + + + Fastest + Molto veloce + + + + Peaks Falloff + Ricadua picchi + + + + Background + Sfondo + + + + Transparent + Transparente + + + + MainWindow + + + Choose a directory + Scegliere una cartella + + + + Select one or more files to open + Seleziona uno o più brani da aprire + + + + &Jump To File + &Vai al brano + + + + J + J + + + + View + + + + + Playlist + + + + + Open Playlist + Apri lista di brani + + + + Save Playlist + Salva lista di brani + + + + + Playlist Files + Brani della lista + + + + All Supported Bitstreams + Elenco di tutti i tipi di flusso accettati + + + + Tools + Strumenti + + + + PlayList + + + &Copy Selection To + + + + + Sort List + Riordina la lista + + + + + By Title + Per titolo + + + + + By Album + Per album + + + + + By Artist + PEr interprete + + + + + By Filename + Per titolo del brano + + + + + By Path + Filename + per percorso più titolo del brano + + + + + By Date + Per data + + + + Sort Selection + Riordina la selezione + + + + Randomize List + Mescola i brnai della lista + + + + Reverse List + Inverti la lista + + + + &New PlayList + + + + + + By Track Number + Per numero di traccia + + + + Playlist + + + + + Actions + Azioni + + + + PlayListBrowser + + + Playlist Browser + Esplora lista esecuzione + + + + New + Nuova + + + + + Delete + Elimina + + + + + ... + ... + + + + Rename + Rinomina + + + + PlayListSelector + + + &Load + &Carica + + + + &Save As... + &Salva come + + + + Rename + Rinomina + + + + &Delete + &Elimina + + + + Rename Playlist + Rinomina lista brani + + + + Playlist name: + Nome della lista brani: + + + + PopupSettings + + + Popup Information Settings + Popup delle impostazioni + + + + Show cover + Mostra copertina + + + + Transparency: + Trasparenza: + + + + Delay: + Ritardo: + + + + ms + ms + + + + Cover size: + Dimensione copertina: + + + + Template + Modello + + + + Reset + Azzera + + + + Insert + Inserisci + + + + Artist + Interprete + + + + Album + Album + + + + Title + Titolo + + + + Track number + Traccia n° + + + + Two-digit track number + Traccia n° a due cifre + + + + Genre + Genere + + + + Comment + Commento + + + + Composer + Compositore + + + + Duration + Durata + + + + Disc number + Disco n° + + + + File name + Nome file + + + + File path + Percorso file + + + + Year + Anno + + + + Condition + Condizione + + + + PresetEditor + + + Preset Editor + Editor delle impostazioni + + + + Load + Carica + + + + Delete + Elimina + + + + Preset + Impostazioni + + + + Auto-preset + Impostazioni automatiche + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Uso: qmmp [options] [fichiers] + + + + Options: + Opzioni: + + + + Print version number and exit + Stampa il numero di versione ed esci + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Per idee, modifiche, segnalazione di errori scrivire a: forkotov02@hotmail.ru + + + + Qt version: + Versione Qt: + + + + Display this text and exit + Mostra questo testo ed esci + + + + Unknown command + Comando sconosciuto + + + + Don't start the application + + + + + QMMP version: + Versione di Qmmp: + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + Scorrimento automatico del titolo del brano + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + Visualizzazione + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_ja.ts b/src/plugins/Ui/skinned/translations/qmmp_ja.ts new file mode 100644 index 000000000..1c434d85b --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_ja.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + QMMPã«ã¤ã„㦠+ + + + About + QMMPã«ã¤ã„㦠+ + + + Authors + 作者 + + + + Translators + 翻訳者 + + + + Thanks To + å”力者 + + + + License Agreement + 使用許諾契約 + + + + :/txt/authors_en.txt + :/txt/authors_ja.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_ja.txt + + + + :/txt/translators_en.txt + :/txt/translators_ja.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt製マルティミディアプレイヤ QMMP + + + + Version: + ãƒãƒ¼ã‚¸ãƒ§ãƒ³: + + + + :txt/description_en.txt + :txt/description_ja.txt + + + + Input plugins: + 入力å´ãƒ—ラグイン: + + + + Output plugins: + 出力å´ãƒ—ラグイン: + + + + Visual plugins: + 視覚効果プラグイン: + + + + Effect plugins: + 音響効果プラグイン: + + + + General plugins: + 一般プラグイン: + + + + ActionManager + + + &Play + å†ç”Ÿ(&Y) + + + + X + X + + + + &Pause + ä¸€æ™‚åœæ­¢(&P) + + + + C + C + + + + &Stop + 終止(&S) + + + + V + V + + + + &Previous + å‰ã®æ›²(&R) + + + + Z + Z + + + + &Next + æ¬¡ã®æ›²(&N) + + + + B + B + + + + &Play/Pause + å†ç”Ÿ/åœæ­¢(&A) + + + + Space + Space + + + + &Jump to File + ファイルを指定ã—ã¦å³åˆ»å†ç”Ÿ(&J) + + + + J + J + + + + &Repeat Playlist + プレイリストを繰り返ã™(&L) + + + + R + R + + + + &Repeat Track + トラックを繰り返ã™(&T) + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + シャッフル(&F) + + + + S + S + + + + &No Playlist Advance + æ¬¡ã®æ›²ã«é€²ã¾ãšçµ‚æ­¢(&N) + + + + Ctrl+N + Ctrl+N + + + + &Stop After Selected + é¸ã‚“ã æ›²ã‚’å†ç”Ÿå¾Œã«çµ‚æ­¢(&S) + + + + Ctrl+S + Ctrl+S + + + + &Clear Queue + キューを消去(&C) + + + + Alt+Q + Alt+Q + + + + Show Playlist + プレイリストを表示 + + + + Alt+E + Alt+E + + + + Show Equalizer + イコライザを表示 + + + + Alt+G + Alt+G + + + + Always on Top + 常ã«å‰é¢ã¸ + + + + Put on All Workspaces + 常ã«è¡¨ç¤ºä¸­ã®ãƒ¯ãƒ¼ã‚¯ã‚¹ãƒšãƒ¼ã‚¹ã«ç½®ã + + + + Double Size + å€ã‚µã‚¤ã‚º + + + + Meta+D + + + + + &Add File + ファイルを追加(&F) + + + + F + F + + + + &Add Directory + ディレクトリを追加(&D) + + + + D + D + + + + &Add Url + URLを追加(&U) + + + + U + U + + + + &Remove Selected + é¸æŠžã—ãŸã‚‚ã®ã‚’除去(&V) + + + + Del + Delele + + + + &Remove All + ã™ã¹ã¦é™¤åŽ»(&M) + + + + &Remove Unselected + é¸æŠžå¤–ã®ã‚‚ã®ã‚’除去(&N) + + + + Remove unavailable files + 無効ãªãƒ•ァイルを除去 + + + + Remove duplicates + é‡è¤‡åˆ†ã‚’除去 + + + + &Queue Toggle + é¸ã‚“ã ãƒ—レイリストをキューã«è¿½åŠ /キューã‹ã‚‰æ’¤åŽ» + + + + Q + Q + + + + Invert Selection + é¸æŠžç¯„å›²ã‚’å転 + + + + &Select None + é¸æŠžã‚’è§£é™¤(&N) + + + + &Select All + ã™ã¹ã¦é¸æŠž(&E) + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + トラックã®è©³ç´°ã‚’表示(&D) + + + + Alt+I + Alt+I + + + + &New List + æ–°è¦ãƒªã‚¹ãƒˆ(&W) + + + + Ctrl+T + Ctrl+T + + + + &Delete List + リストを削除(&D) + + + + Ctrl+W + Ctrl+W + + + + &Load List + リストを読込(&L) + + + + O + O + + + + &Save List + リストをä¿å­˜(&S) + + + + Shift+S + Shift+S + + + + &Select Next Playlist + 次ã®ãƒ—ãƒ¬ã‚¤ãƒªã‚¹ãƒˆã‚’é¸æŠž(&N) + + + + Ctrl+PgDown + Ctrl+PgDown + + + + &Select Previous Playlist + å‰ã®ãƒ—ãƒ¬ã‚¤ãƒªã‚¹ãƒˆã‚’é¸æŠž(&P) + + + + Ctrl+PgUp + Ctrl+PgUp + + + + &Show Playlists + プレイリストを表示(&H) + + + + P + P + + + + &Settings + 設定(&S) + + + + Ctrl+P + Ctrl+P + + + + &About + QMMPã«ã¤ã„ã¦(&A) + + + + &About Qt + Qtã«ã¤ã„ã¦(&Q) + + + + &Exit + 終了(&X) + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Enter URL to add + 追加ã—ãŸã„URLを記入 + + + + &Add + 追加(&A) + + + + &Cancel + キャンセル(&C) + + + + Error + 事故 + + + + BuiltinCommandLineOption + + + Don't clear the playlist + プレイリストをクリアã—ãªã„ + + + + Start playing current song + ä»Šã®æ›²ã‹ã‚‰å†ç”Ÿã‚’é–‹å§‹ + + + + Pause current song + ä»Šã®æ›²ã§ä¸€æ™‚åœæ­¢ + + + + Pause if playing, play otherwise + å†ç”Ÿä¸­ãªã‚‰ä¸€æ™‚åœæ­¢ã€ä¸€æ™‚åœæ­¢ã—ã¦ãŠã‚Œã°å†ç”Ÿ + + + + Stop current song + ä»Šã®æ›²ã§çµ‚æ­¢ + + + + Display Jump to File dialog + 「ファイルを指定ã—ã¦å³åˆ»å†ç”Ÿã€ãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’表示 + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + 音é‡è¨­å®š (例: qmmp --volume 20) + + + + Skip forward in playlist + プレイリストã§ã®æ¬¡ã®æ›²ã«ã‚¹ã‚­ãƒƒãƒ— + + + + Skip backwards in playlist + プレイリストã§å‰ã®æ›²ã«ã‚¹ã‚­ãƒƒãƒ— + + + + Show/hide application + アプリケーションウィンドウを表示/éžè¡¨ç¤º + + + + Display Add File dialog + 「ファイル追加ã€ãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’表示 + + + + Display Add Directory dialog + 「ディレクトリ追加ã€ãƒ€ã‚¤ã‚¢ãƒ­ã‚°ã‚’表示 + + + + ConfigDialog + + + Qmmp Settings + QMMP設定 + + + + Appearance + 外観 + + + + + + Playlist + プレイリスト + + + + Plugins + プラグイン + + + + Advanced + 上級 + + + + Connectivity + 接続 + + + + + Audio + 音響 + + + + Shortcuts + ショートカット + + + + Skins + スキン + + + + Add... + 追加... + + + + Refresh + æ›´æ–° + + + + Miscellaneous + å„種設定 + + + + + View + 観容 + + + + Hide on close + 「閉ã˜ã‚‹ã€ã§éš ã™ + + + + Start hidden + 開始時ã«éš ã™ + + + + Use skin cursors + スキンカーソルを使用 + + + + Fonts + 書体 + + + + Player: + プレイヤ: + + + + + ??? + ??? + + + + + + ... + ... + + + + Playlist: + プレイリスト: + + + + Use bitmap font if available + ã‚れã°ãƒ“ットマップフォントを使用 + + + + Transparency + é€éŽåŠ¹æžœ + + + + Main window + メインウィンドウ + + + + + + 0 + 0 + + + + Equalizer + イコライザ + + + + Metadata + メタデータ + + + + Load metadata from files + ファイルã‹ã‚‰ãƒ¡ã‚¿ãƒ‡ãƒ¼ã‚¿ã‚’読ã¿è¾¼ã‚€ + + + + Song Display + 演目表示 + + + + Title format: + タイトルã®è¡¨ç¤ºå½¢å¼: + + + + Convert underscores to blanks + 下線記å·_を空白文字ã§è¡¨ç¤º + + + + Convert %20 to blanks + %20を空白文字ã§è¡¨ç¤º + + + + Show protocol + プロトコルを表示 + + + + Show song numbers + 曲番å·ã¤ãã§è¡¨ç¤º + + + + Show playlists + プレイリストを表示 + + + + Show popup information + 情報å¹ã出ã—を表示 + + + + Edit template + ã²ãªåž‹ã‚’編集 + + + + Show anchor + アンカーを表示 + + + + Align song numbers + 曲番å·ã®ã¿ã‚’表示 + + + + + Preferences + プラグイン調整 + + + + + + Information + 情報 + + + + Description + プラグイン分類 + + + + Filename + ファイルå + + + + File Dialog + ファイルダイアログ + + + + Cover Image Retrieve + アルãƒãƒ è¡¨ç´™ç”»åƒã®å–å¾— + + + + Use separate image files + 分割ã•れãŸç”»åƒãƒ•ァイルを利用 + + + + Include files: + 対象ファイル形å¼: + + + + Exclude files: + 除外ファイル形å¼: + + + + Recursive search depth: + å†å¸°æ¤œç´¢ã®æ·±åº¦: + + + + + Playback + å†ç”Ÿ + + + + Continue playback on startup + å‰å›žçµ‚äº†æ™‚ã®æ›²ã‹ã‚‰ç¶™ç¶šã—ã¦å†ç”Ÿ + + + + Proxy + ä»£ç† + + + + Enable proxy usage + 代ç†ã‚’利用ã™ã‚‹ + + + + Proxy host name: + 代ç†ãƒ›ã‚¹ãƒˆå: + + + + Proxy port: + 代ç†ãƒãƒ¼ãƒˆ: + + + + Use authentication with proxy + 代ç†çµŒç”±ã®èªè¨¼ã‚’利用 + + + + Proxy user name: + 代ç†è€…ユーザå: + + + + Proxy password: + 代ç†è€…パスワード: + + + + Replay Gain + リプレイゲイン + + + + Replay Gain mode: + リプレイゲインモード: + + + + Preamp: + プリアンプ: + + + + + dB + dB + + + + Default gain: + デフォルトゲイン: + + + + Use peak info to prevent clipping + クリッピングç¾è±¡ã‚’抑ãˆã‚‹ãŸã‚ピーク情報を使ㆠ+ + + + Output: + 出力: + + + + Buffer size: + ãƒãƒƒãƒ•ァサイズ: + + + + ms + ミリ秒 + + + + Use software volume control + ソフトウェアã«ã‚ˆã‚‹éŸ³é‡åˆ¶å¾¡ã‚’利用 + + + + 16-bit output + 16ビット出力 + + + + Action + 動作 + + + + Shortcut + ショートカット + + + + Change shortcut... + 変更 + + + + Track + トラック + + + + + Album + アルãƒãƒ  + + + + Disabled + 無効 + + + + Archived skin + 書庫化スキン + + + + Unarchived skin + éžæ›¸åº«åŒ–スキン + + + + Transports + è»¢é€ + + + + Decoders + デコーダ + + + + Engines + エンジン + + + + Effects + 音響効果 + + + + Visualization + 視覚効果 + + + + General + 一般 + + + + Misc + ã„ã‚ã„ã‚ + + + + Artist + アーティスト + + + + Title + タイトル + + + + Track number + ãƒˆãƒ©ãƒƒã‚¯ç•ªå· + + + + Two-digit track number + ãƒˆãƒ©ãƒƒã‚¯ç•ªå· æ•°å­—2æ¡ + + + + Genre + ジャンル + + + + Comment + コメント + + + + Composer + 作曲者 + + + + Disc number + ãƒ‡ã‚£ã‚¹ã‚¯ç•ªå· + + + + File name + ファイルå + + + + File path + ファイルパス + + + + Year + å¹´ + + + + Condition + 定番 + + + + Select Skin Files + ã‚¹ã‚­ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«ã‚’é¸æŠž + + + + Skin files + スキンファイル + + + + EqWidget + + + Equalizer + イコライザ + + + + + preset + プリセット + + + + &Load/Delete + 読ã¿è¾¼ã¿/削除(&L) + + + + &Save Preset + プリセットをä¿å­˜(&S) + + + + &Save Auto-load Preset + 自動読ã¿è¾¼ã¿ã•れãŸãƒ—リセットをä¿å­˜(&S) + + + + &Import + 移入(&I) + + + + &Clear + 消去(&C) + + + + Saving Preset + プリセットをä¿å­˜ã—ã¦ã„ã¾ã™ + + + + Preset name: + プリセットå: + + + + preset # + ãƒ—ãƒªã‚»ãƒƒãƒˆç•ªå· + + + + Import Preset + プリセットを移入 + + + + JumpToTrackDialog + + + Jump To Track + トラックを指定ã—ã¦å³åˆ»å†ç”Ÿ + + + + Filter + フィルタ + + + + + + Queue + キューã«å…¥ã‚Œã‚‹ + + + + Refresh + å†å®Ÿè¡Œ + + + + Jump To + ã“ã®æ›²ã«è·³ã¶ + + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + キューã‹ã‚‰é™¤ã + + + + MainDisplay + + + Previous + å‰ã®æ›² + + + + Play + å†ç”Ÿ + + + + Pause + ä¸€æ™‚åœæ­¢ + + + + Stop + 終止 + + + + Next + æ¬¡ã®æ›² + + + + Add file + ファイルを追加 + + + + Equalizer + イコライザ + + + + Playlist + プレイリスト + + + + Repeat playlist + プレイリストを繰り返㗠+ + + + Shuffle + シャッフル + + + + Volume + éŸ³é‡ + + + + Balance + ãƒãƒ©ãƒ³ã‚¹ + + + + Volume: %1% + 音é‡: %1% + + + + Balance: %1% right + ãƒãƒ©ãƒ³ã‚¹: %1% å³ã¸ + + + + Balance: %1% left + ãƒãƒ©ãƒ³ã‚¹: %1% 左㸠+ + + + Balance: center + ãƒãƒ©ãƒ³ã‚¹: 中央㫠+ + + + Seek to: %1 + %1 ã«ç§»å‹• + + + + MainVisual + + + Visualization Mode + 視覚効果モード + + + + Analyzer + スペクトルアナライザ + + + + Scope + オシロスコープ + + + + Off + 使ã‚ãªã„ + + + + Analyzer Mode + アナライザモード + + + + Normal + 通常 + + + + Fire + 炎 + + + + Vertical Lines + ç·š + + + + Lines + ç·š + + + + Bars + 点 + + + + Peaks + ピーク表示 + + + + Refresh Rate + å†æç”»ã®é »åº¦ + + + + 50 fps + 50 フレーム毎秒 + + + + 25 fps + 25 フレーム毎秒 + + + + 10 fps + 10 フレーム毎秒 + + + + 5 fps + 5 フレーム毎秒 + + + + Analyzer Falloff + アナライザ減衰速度 + + + + + Slowest + ã•らã«é…ã + + + + + Slow + é…ã + + + + + Medium + é©åº¦ + + + + + Fast + 速ã + + + + + Fastest + ã•らã«é€Ÿã + + + + Peaks Falloff + ピーク減衰速度 + + + + Background + 背景 + + + + Transparent + é€éŽã•ã›ã‚‹ + + + + MainWindow + + + Choose a directory + ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’é¸æŠž + + + + All Supported Bitstreams + サãƒãƒ¼ãƒˆå¯¾è±¡ã®ã™ã¹ã¦ã®ãƒ‡ã‚¸ã‚¿ãƒ«éŒ²éŸ³ç‰© + + + + Select one or more files to open + é–‹ããŸã„ファイルをé¸ã¶ (複数å¯) + + + + Playlist + プレイリスト + + + + &Jump To File + ファイルを指定ã—ã¦å³åˆ»å†ç”Ÿ(&J) + + + + J + J + + + + View + 観容 + + + + Tools + ツール + + + + + Playlist Files + プレイリストファイル + + + + Open Playlist + プレイリストを開ã + + + + Save Playlist + プレイリストをä¿å­˜ + + + + PlayList + + + Playlist + プレイリスト + + + + &Copy Selection To + é¸ã‚“ã æ›²ç›®ã§æ–°ã—ã„プレイリストを作る(&C) + + + + Sort List + ãƒªã‚¹ãƒˆã‚’ä¸¦ã³æ›ãˆ + + + + + By Title + タイトル順㫠+ + + + + By Album + アルãƒãƒ å順㫠+ + + + + By Artist + アーティストå順㫠+ + + + + By Filename + ファイルå順㫠+ + + + + By Path + Filename + パスã¨ãƒ•ァイルåã®é †ã« + + + + + By Date + 日付順㫠+ + + + + By Track Number + トラック番å·é †ã« + + + + Sort Selection + é¸æŠžç¯„å›²å†…ã§ä¸¦ã³æ›ãˆ + + + + Randomize List + リストを順ä¸åŒã« + + + + Reverse List + リストを逆順㫠+ + + + Actions + 動作 + + + + &New PlayList + æ–°ã—ã„プレイリスト(&N) + + + + PlayListBrowser + + + Playlist Browser + プレイリストブラウザ + + + + New + æ–°è¦ + + + + + Delete + 削除 + + + + + ... + ... + + + + Rename + åå‰ã‚’変更 + + + + PlayListSelector + + + &Load + 読込(&L) + + + + &Save As... + åå‰ã‚’付ã‘ã¦ä¿å­˜(&A)... + + + + Rename + åå‰ã‚’変更 + + + + &Delete + 削除(&D) + + + + Rename Playlist + プレイリストåを変更 + + + + Playlist name: + プレイリストå: + + + + PopupSettings + + + Popup Information Settings + å¹ãå‡ºã—æƒ…å ±ã®è¨­å®š + + + + Template + 雛形 + + + + Reset + リセット + + + + Insert + 挿入 + + + + Show cover + 表紙を表示 + + + + Cover size: + 表紙ã®å¤§ãã•: + + + + Transparency: + 逿˜Žåº¦: + + + + Delay: + å¾…ã¡æ™‚é–“: + + + + ms + ミリ秒 + + + + Artist + アーティスト + + + + Album + アルãƒãƒ  + + + + Title + タイトル + + + + Track number + ãƒˆãƒ©ãƒƒã‚¯ç•ªå· + + + + Two-digit track number + ãƒˆãƒ©ãƒƒã‚¯ç•ªå· æ•°å­—2æ¡ + + + + Genre + ジャンル + + + + Comment + コメント + + + + Composer + 作曲者 + + + + Duration + å†ç”Ÿæ™‚é–“ + + + + Disc number + ãƒ‡ã‚£ã‚¹ã‚¯ç•ªå· + + + + File name + ファイルå + + + + File path + ファイルパス + + + + Year + å¹´ + + + + Condition + 定番 + + + + PresetEditor + + + Preset Editor + プリセットエディタ + + + + Preset + プリセット + + + + Auto-preset + 自動プリセット + + + + Load + 読込 + + + + Delete + 削除 + + + + QMMPStarter + + + Unknown command + 䏿˜Žãªã‚³ãƒžãƒ³ãƒ‰ã§ã™ + + + + Usage: qmmp [options] [files] + 使用法: qmmp [オプション] [ファイルå:複数å¯] + + + + Options: + オプション: + + + + Don't start the application + アプリケーションを始動ã—ãªã„ + + + + Display this text and exit + ã“ã®ãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’表示ã—ã¦çµ‚了 + + + + Print version number and exit + ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ã‚’表示ã—ã¦çµ‚了 + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + åæ¡ˆ, パッãƒ, ãƒã‚°å ±å‘Šã¯ forkotov02@hotmail.ru ã¾ã§ + + + + QMMP version: + QMMP 版番å·: + + + + Qt version: + Qt 版番å·: + + + + ShortcutDialog + + + Change Shortcut + ショートカットを変更 + + + + Press the key combination you want to assign + 割り当ã¦ãŸã„組ã¿åˆã‚ã›ã‚­ãƒ¼ã‚’押ã—ã¾ã™ + + + + Clear + 消去 + + + + TextScroller + + + Autoscroll Songname + 曲åを自動スクロール + + + + Buffering: %1% + ãƒãƒƒãƒ•ã‚¡ã¸å…ˆèª­ã¿: %1% + + + + VisualMenu + + + Visualization + 視覚効果 + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_kk.ts b/src/plugins/Ui/skinned/translations/qmmp_kk.ts new file mode 100644 index 000000000..9e338e2fc --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_kk.ts @@ -0,0 +1,1247 @@ + + + + + AboutDialog + + + About Qmmp + Qmmp туралы + + + + About + ОÑÑ‹ туралы + О программе + + + + License Agreement + ЛицензиÑÑÑ‹ + + + + Authors + Ðвторрлары + + + + Thanks To + ÐлғыÑтар + + + + :/txt/authors_en.txt + :/txt/authors_kk.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_kk.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-негізіндегі мультимедиа плеері (Qmmp) + + + + Version: + ÐÒ±ÑқаÑÑ‹: + + + + :txt/description_en.txt + :txt/description_kk.txt + + + + Input plugins: + ÐšÑ–Ñ€Ñ–Ñ Ð¼Ð¾Ð´ÑƒÐ»ÑŒÐ´ÐµÑ€Ñ–: + + + + Output plugins: + Ð¨Ñ‹Ò“Ñ‹Ñ Ð¼Ð¾Ð´ÑƒÐ»ÑŒÐ´ÐµÑ€Ñ–: + + + + Visual plugins: + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¼Ð¾Ð´ÑƒÐ»ÑŒÐ´ÐµÑ€Ñ–: + + + + Effect plugins: + Эффекттер модульдері: + + + + General plugins: + Жалпы модульдері: + + + + Translators + Ðудармашылар + + + + :/txt/translators_en.txt + :/txt/translators_kk.txt + + + + AddUrlDialog + + + Error + Қате + + + + Enter URL to add + ҚоÑу үшін адреÑті енгізіңіз + + + + &Add + Òš&оÑу + + + + &Cancel + &Ð‘Ð°Ñ Ñ‚Ð°Ñ€Ñ‚Ñƒ + + + + BuiltinCommandLineOption + + + Skip forward in playlist + КелеÑіге өту + + + + Skip backwards in playlist + ÐлдыңғыÑына өту + + + + Start playing current song + Ðғымдағы өленді ойнату + + + + Pause current song + Ðғымдағы өленді аÑлдату + + + + Pause if playing, play otherwise + ÐÑлдату/ойнату + + + + Stop current song + Ðғымдағы өленді тоқтату + + + + Set playback volume(example: qmmp --volume20, qmmp --volume100) + Ð”Ñ‹Ð±Ñ‹Ñ Ð´ÐµÒ£Ð³ÐµÐ¹Ñ–Ð½ орнату (мыÑалы: qmmp --volume20, qmmp --volume100) + + + + Display Jump to File dialog + Файлға өту Ñұхбатын көрÑету + + + + Show/hide application + Бағдарламаны көрÑету/жаÑыру + + + + Display Add File dialog + Файлдарды қоÑу Ñұхбатын көрÑету + + + + Display Add Directory dialog + Бумаларды қоÑу Ñұхбатын көрÑету + + + + ConfigDialog + + + + + + + Enabled + ҚоÑулы + + + + + + + + Description + ÐнықтамаÑÑ‹ + + + + + + + + + Filename + Файл аты + + + + Artist + Орындаушы + + + + Album + Ðльбом + + + + Title + Ðты + + + + Tracknumber + Трек нөмірі + + + + Genre + Жанры + + + + Filepath + Файл жолы + + + + Date + Күні + + + + Year + Жылы + + + + Comment + ҚоÑымша + + + + Qmmp Settings + Qmmp баптаулары + + + + Skins + Скиндар + + + + Fonts + Қаріптер + + + + Player: + Плеер: + + + + Playlist: + Тізім: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Метаақпараты + + + + Load metadata from files + Метаақпаратты файлдардан оқу + + + + Song Display + Өлендер тізімі + + + + Title format: + Ðтаудың пішімі: + + + + Input + ÐšÑ–Ñ€Ñ–Ñ + + + + Output + Ð¨Ñ‹Ò“Ñ‹Ñ + + + + Preferences + Баптаулар + + + + + Information + Ðқпараты + + + + Appearance + Сыртқы түрі + + + + + Playlist + Тізім + + + + Plugins + Модульдер + + + + Advanced + Кеңейтілген + + + + Close + Жабу + + + + Archived skin + Сығылған Ñкин + + + + Unarchived skin + Тарқатылған Ñкин + + + + Connectivity + Желі + + + + Visualization + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ + + + + Effects + Эффекттер + + + + General + Жалпы + + + + File Dialog + Файл Ñұхбат терезеÑÑ– + + + + Audio + Ðудио + + + + Use software volume control + Ð”Ð°ÑƒÑ‹Ñ Ð´ÐµÒ£Ð³ÐµÐ¹Ñ–Ð½ бағдарламалық тәÑілмен өзгертіу + + + + Visibility Control + Көрінуін баÑқару + + + + Hide on close + Жабылғанда жаÑыру + + + + Start hidden + ЖаÑырын түрінде қоÑылу + + + + Proxy + ПрокÑи + + + + Enable proxy usage + ПрокÑиді қолдану + + + + Proxy host name: + ПрокÑи Ñервері: + + + + Proxy port: + ПрокÑи порты: + + + + Use authentication with proxy + ПрокÑи аутентификациÑÑын қолдану + + + + Proxy user name: + ПрокÑи пайдаланушыÑÑ‹: + + + + Proxy password: + Паролі: + + + + Convert underscores to blanks + ÐÑтыңғы Ñызуды Ð±Ð¾Ñ Ð¾Ñ€Ñ‹Ð½Ò“Ð° алмаÑтыру + + + + Convert %20 to blanks + %20 Ð±Ð¾Ñ Ð¾Ñ€Ñ‹Ð½Ò“Ð° алмаÑытру + + + Show full path of a stream + Показывать полный путь Ð´Ð»Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÐ¾Ð² + + + + Select Skin Files + Скин файлдарын таңдау + + + + Skin files + Скин файлдары + + + + Add... + ҚоÑу... + + + + Refresh + Жаңарту + + + + Show protocol + Хаттаманы көрÑету + + + + Transparency + Мөлдірлілігі + + + + Main window + БаÑты терезе + + + + + + 0 + + + + + Equalizer + Эквалайзер + + + + EqWidget + + + + preset + орнату + + + + &Load/Delete + &Жүктеу/Өшіру + + + + &Save Preset + &Орнатуды Ñақтау + + + + &Save Auto-load Preset + &Ðвто-орнатуды Ñақтау + + + + &Clear + &Тазарту + + + + Saving Preset + Орнатуды Ñақтау + + + + Preset name: + Орнату атауы: + + + + preset # + орнату # + + + + &Import + &Импорттау + + + + Import Preset + Орнатуды импорттау + + + + JumpToTrackDialog + + + + Unqueue + Кезектен алып таÑтау + + + + + + Queue + Кезекке қою + + + + Jump To Track + Трекке өту + + + + Filter + Фильтр + + + + Refresh + Жаңарту + + + + Jump To + Өту + + + + Close + Жабу + + + + MainDisplay + + + Previous + ÐлдыңғыÑÑ‹ + + + + Play + Ойнату + + + + Pause + ÐÑлдату + + + + Stop + Тоқтату + + + + Next + КелеÑіге өту + + + + Add file + Файлды қоÑу + + + + Equalizer + Эквалайзер + + + + Playlist + Тізім + + + + Repeat playlist + Тізімді қайталау + + + + Shuffle + Кез-келген ретпен + + + + Volume + ДауÑÑ‹ + + + + Balance + Ð‘Ð°Ð»Ð°Ð½Ñ + + + + MainVisual + + + Visualization Mode + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ñ‚Ò¯Ñ€Ñ– + + + + Analyzer + Ðнализатор + + + + Scope + ОÑциллограф + + + + Off + Сөндірілген + + + + Analyzer Mode + Ðнализатор режимі + + + + Normal + Кәдімгі + + + + Fire + От + + + + Vertical Lines + Тік Ñызықтар + + + + Lines + Сызықтар + + + + Bars + Жолақшалар + + + + Peaks + Пиктер + + + + Refresh Rate + Жаңарту жиілігі + + + + 50 fps + + + + + 25 fps + + + + + 10 fps + + + + + 5 fps + + + + + Analyzer Falloff + Ðнализатор түÑуі + + + + + Slowest + Ең баÑу + + + + + Slow + БаÑу + + + + + Medium + Орташа + + + + + Fast + Жылдам + + + + + Fastest + Ең жылдам + + + + Peaks Falloff + Пиктер түÑуі + + + + Background + Фон + + + + Transparent + Мөлдір + + + + MainWindow + + + + Default + БаÑтапқы + + + + Choose a directory + Буманы таңдаңыз + + + + Select one or more files to open + Бір немеÑе бірнеше файлды таңдаңыз + + + + &Play + &Ойнату + + + + X + + + + + &Pause + &ÐÑлдату + + + + C + + + + + &Stop + &Тоқтату + + + + V + + + + + &Previous + Ðл&дыңғыÑÑ‹ + + + + Z + + + + + &Next + &КелеÑÑ–ÑÑ– + + + + B + + + + + &Jump To File + &Файлға өту + + + + J + + + + + &Settings + &Баптаулары + + + + Ctrl+P + + + + + &Exit + &Шығу + + + + Ctrl+Q + + + + + Open Playlist + Тізімді ашу + + + + Save Playlist + Тізімді Ñақтау + + + + &About + &ОÑÑ‹ туралы + + + + + Playlist Files + Тізімдер файлдары + + + + Space + + + + + &About Qt + Qt Ñ‚&уралы + + + + &Play/Pause + О&йнат/аÑлдат + + + + All Supported Bitstreams + Барлық пішімдер + + + + &Repeat Track + Т&ректі қайталау + + + + &Shuffle + Ке&з-келген ретпен + + + + R + + + + + Ctrl+R + + + + + S + + + + + &Repeat Playlist + Тізі&мді қайталау + + + + Tools + Қызмет + + + + PlayList + + + F + + + + + D + + + + + Alt+I + + + + + Ctrl+A + + + + + O + + + + + &Add File + Фа&йлды қоÑу + + + + &Add Directory + Бу&маны қоÑу + + + + &Remove Selected + Таңда&лғанды өшіру + + + + &Remove All + &Барлығын өшіру + + + + &Remove Unselected + Таң&далмағанды өшіру + + + + &View Track Details + &Ðқпараты + + + + Sort List + Сұрыптау + + + + + By Title + Ðты бойынша + + + + + By Filename + Файл аты бойынша + + + + + By Path + Filename + Жолы мен файл аты бойынша + + + + + By Date + Уақыты бойынша + + + + Sort Selection + Таңдалғанды Ñұрыптау + + + + Randomize List + Тізімді аралаÑтыру + + + + Reverse List + Тізімді кері айналдыру + + + + Invert Selection + Таңдауды кері айналдыру + + + + &Select None + Т&аңдауды алу + + + + &Select All + &Барлығын таңдау + + + + &New List + &Жаңа тізім + + + + Shift+N + + + + + &Load List + Ті&зімді жүктеу + + + + &Save List + Тізімді &Ñақтау + + + + Shift+S + + + + + Del + + + + + &Add Url + URL-д&Ñ‹ қоÑу + + + + U + + + + + + By Track Number + Трек нөмірі бойынша + + + + &Queue + &Кезекке + + + + Q + + + + + Actions + Әрекеттер + + + + PresetEditor + + + Preset Editor + Орнатулар түзеткіші + + + + Load + Жүктеу + + + + Delete + Өшіру + + + + Preset + Орнату + + + + Auto-preset + Ðвто-орнату + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Қолданылуы: qmmp [опциÑлар] [файлдар] + + + + Options: + ОпциÑлары: + + + + Print version number and exit + ÐÒ±ÑқаÑын көрÑету мен шығу + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Ò°ÑыныÑтар, түзетулер, қателер туралы хабарлаÑыңыз: forkotov02@hotmail.ru + + + + Display this text and exit + ОÑÑ‹ мәтінді көрÑету және шығу + + + + QMMP version: + QMMP нұÑқаÑÑ‹: + + + + Don't clear the playlist + Тізімді тазартпау + + + + Qt version: + Qt нұÑқаÑÑ‹: + + + + TextScroller + + + Buffering: + БуферизациÑ: + + + + Autoscroll Songname + Өлен атауын автоайналдыру + + + + VisualMenu + + + Visualization + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_locales.qrc b/src/plugins/Ui/skinned/translations/qmmp_locales.qrc new file mode 100644 index 000000000..2442f6dc1 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_locales.qrc @@ -0,0 +1,22 @@ + + + + qmmp_ru.qm + qmmp_tr.qm + qmmp_zh_CN.qm + qmmp_uk_UA.qm + qmmp_zh_TW.qm + qmmp_cs.qm + qmmp_pt_BR.qm + qmmp_de.qm + qmmp_pl_PL.qm + qmmp_fr.qm + qmmp_it.qm + qmmp_kk.qm + qmmp_lt.qm + qmmp_hu.qm + qmmp_nl.qm + qmmp_ja.qm + qmmp_sk.qm + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_lt.ts b/src/plugins/Ui/skinned/translations/qmmp_lt.ts new file mode 100644 index 000000000..87ad73c4a --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_lt.ts @@ -0,0 +1,1837 @@ + + + + + AboutDialog + + + About Qmmp + Apie Qmmp + + + + About + Apie + + + + License Agreement + Licenzija + + + + Authors + Autoriai + + + + Thanks To + DÄ—kojame + + + + :/txt/authors_en.txt + :/txt/authors_lt.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_lt.txt + + + + Qt-based Multimedia Player (Qmmp) + + + + + Version: + Versija: + + + + :txt/description_en.txt + :txt/description_lt.txt + + + + Input plugins: + Ä®einantys: + + + + Output plugins: + IÅ¡einantys: + + + + Visual plugins: + Vizualizacijos: + + + + Effect plugins: + Efektai: + + + + General plugins: + Bendriniai įskiepiai: + + + + Translators + VertÄ—jai + + + + :/txt/translators_en.txt + :/txt/translators_lt.txt + + + + ActionManager + + + &Play + &Groti + + + + X + + + + + &Pause + &Pristabdyti + + + + C + + + + + &Stop + &Sustabdyti + + + + V + + + + + &Previous + &Ankstesnis + + + + Z + + + + + &Next + &Sekantis + + + + B + + + + + &Play/Pause + &Groti/Pristabdyti + + + + Space + Tarpas + + + + &Jump to File + &PerÅ¡okti prie failo + + + + J + + + + + &Repeat Playlist + &Kartoti grojaraÅ¡tį + + + + R + + + + + &Repeat Track + &Kartoti takelį + + + + Ctrl+R + + + + + &Shuffle + &SumaiÅ¡yti + + + + S + + + + + &No Playlist Advance + ????? + &Nesislinkti grojaraÅ¡Äiu + + + + Ctrl+N + + + + + &Stop After Selected + &Stabdyti po pasirinkto + + + + Ctrl+S + + + + + &Clear Queue + &IÅ¡valyti eilÄ™ + + + + Alt+Q + + + + + Show Playlist + Rodyti grojaraÅ¡tį + + + + Alt+E + + + + + Show Equalizer + Rodyti glotintuvÄ… + + + + Alt+G + + + + + Always on Top + Visada virÅ¡uje + + + + Put on All Workspaces + Ä®kelti į visus darbastalius + + + + Double Size + Dvigubas dydis + + + + Meta+D + + + + + &Add File + &PridÄ—ti bylÄ… + + + + F + + + + + &Add Directory + &PridÄ—ti aplankÄ… + + + + D + + + + + &Add Url + &PridÄ—ti interneto adresÄ… + + + + U + + + + + &Remove Selected + &PaÅ¡alinti pasirinktus + + + + Del + + + + + &Remove All + &PaÅ¡alinti visus + + + + &Remove Unselected + &PaÅ¡alinti NEpasirinktus + + + + Remove unavailable files + PaÅ¡alinti neesamas bylas + + + + Remove duplicates + PaÅ¡alinti besidubliuojanÄius pavadinimus + + + + &Queue Toggle + &Ä®traukti į eilÄ™ + + + + Q + + + + + Invert Selection + Apverstinis pasirinkimas + + + + &Select None + &Nepasirinkti nei vieno + + + + &Select All + &Pasirinkti visus + + + + Ctrl+A + + + + + &View Track Details + &Takelio informacija + + + + Alt+I + + + + + &New List + &Naujas sÄ…raÅ¡as + + + + Ctrl+T + + + + + &Delete List + &PaÅ¡alinti sÄ…rašą + + + + Ctrl+W + + + + + &Load List + &Ä®kelti sÄ…rašą + + + + O + + + + + &Save List + &IÅ¡saugoti sÄ…rašą + + + + Shift+S + + + + + &Select Next Playlist + &Pasirinkti sekantį grojaraÅ¡tį + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + &Pasirinkti ankstesnį grojaraÅ¡tį + + + + Ctrl+PgUp + + + + + &Show Playlists + &Rodyti grojaraÅ¡Äius + + + + P + + + + + &Settings + &Nustatymai + + + + Ctrl+P + + + + + &About + &Apie + + + + &About Qt + &Apie Qt + + + + &Exit + &IÅ¡eiti + + + + Ctrl+Q + + + + + AddUrlDialog + + + Error + Klaida + + + + Enter URL to add + Ä®veskite adresÄ… + + + + &Add + &PridÄ—ti + + + + &Cancel + &AtÅ¡aukti + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Eiti prie sekanÄio elemento + + + + Skip backwards in playlist + Eiti prie ankstesnio elemento + + + + Start playing current song + Groti dainÄ… + + + + Don't clear the playlist + NeiÅ¡valyti sÄ…raÅ¡o + + + + Pause current song + Pristabdyti dainÄ… + + + + Pause if playing, play otherwise + Pristabdyti/Groti + + + + Stop current song + Sustabdyti dainÄ… + + + + Display Jump to File dialog + Parodyti langÄ… bylos pasirinkimui + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Nustatyti grojimo garsÄ… (pvz: qmmp --volume 20) + + + + Show/hide application + Parodyti/SlÄ—pti programÄ… + + + + Display Add File dialog + Parodyti langÄ… bylų pridÄ—jimui + + + + Display Add Directory dialog + Parodyti langÄ… aplanko pridÄ—jimui + + + + ConfigDialog + + + Description + ApraÅ¡ymas + + + + Filename + Bylos pavadinimas + + + + Artist + AtlikÄ—jas + + + + + Album + Albumas + + + + Track + Takelis + + + + Disabled + IÅ¡jungta + + + + Transports + Transportas + + + + Decoders + Dekoderiai + + + + Engines + Varikliai + + + + Misc + Ä®vairÅ«s + + + + Title + Pavadinimas + + + + Track number + Takelio numeris + + + + Two-digit track number + Dviejų skaiÄių takelio numeris + + + + Disc number + Disko numeris + + + + Condition + BÅ«klÄ— + + + + Composer + Autorius + + + + File name + Bylos pavadinimas + + + + File path + Bylos kelias + + + + Genre + Žanras + + + + Year + Metai + + + + Comment + Komentaras + + + + Qmmp Settings + Qmmp nustatymai + + + + Skins + Temos + + + + Fonts + Å riftai + + + + Player: + Grotuvas: + + + + Playlist: + GojaraÅ¡tis: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Meta duomenys + + + + Load metadata from files + Ä®kelti metaduomenis iÅ¡ bylų + + + + Song Display + Dainų sÄ…raÅ¡as + + + + Title format: + Pavadinimo formatas: + + + + + Preferences + Nustatymai + + + + + + Information + Informacija + + + + Appearance + IÅ¡vaizda + + + + + + Playlist + GrojaraÅ¡tis + + + + Plugins + Ä®skiepiai + + + + Advanced + Papildomi + + + + 16-bit output + 16 bitų iÅ¡vestis + + + + Archived skin + Suspausta tema + + + + Unarchived skin + IÅ¡skleista tema + + + + Connectivity + Tinklas + + + + Visualization + Vizualizacija + + + + Effects + Efektai + + + + General + Bendri + + + + File Dialog + Pasirinkimo langas + + + + + Audio + Audio + + + + Replay Gain + Neįsivaizduoju kaip verst + Replay Gain + + + + Miscellaneous + Kiti + + + + Use bitmap font if available + Naudoti bitmap Å¡riftÄ…, jei įmanoma + + + + Use skin cursors + Naudoti temos kursorių + + + + Show song numbers + Rodyti takelių numerius + + + + Show playlists + Rodyti grojaraÅ¡Äius + + + + Show popup information + Rodyti iššokanÄiÄ… informacijÄ… + + + + Replay Gain mode: + Replay Gain metodas: + + + + Preamp: + IÅ¡ankstinis stiprinimas: + + + + + dB + dB + + + + Default gain: + Stiprinimas pagal nutylÄ—jima: + + + + Use peak info to prevent clipping + Naudoti pikų informacijÄ… trÅ«kinÄ—jimo iÅ¡vengimui + + + + Output: + IÅ¡vestis + + + + Buffer size: + Buferio dydis: + + + + ms + ms + + + + Use software volume control + Naudoti programinį garso valdymÄ… + + + + + View + Rodyti + + + + Shortcuts + Santrumpos + + + + Hide on close + PaslÄ—pti iÅ¡jungus + + + + Start hidden + Ä®jungti paslÄ—ptÄ… + + + + Edit template + Taisyti Å¡ablonÄ… + + + + Show anchor + + + + + Align song numbers + Lygiuoti dainų numerius + + + + Cover Image Retrieve + Parsiųsti cd virÅ¡elį + + + + Use separate image files + Naudoti atskiras paveiksliukų bylas + + + + Include files: + Ä®traukti bylas + + + + Exclude files: + IÅ¡skirti bylas + + + + Recursive search depth: + RekursinÄ—s paieÅ¡kos gylis + + + + + Playback + Grojimas + + + + Continue playback on startup + TÄ™sti grojimÄ… įjungus + + + + Proxy + Proxy + + + + Enable proxy usage + Ä®jungti proxy palaikymÄ… + + + + Proxy host name: + Proxy serveris: + + + + Proxy port: + Proxy portas: + + + + Use authentication with proxy + Naudoti proxy autentifikavimÄ… + + + + Proxy user name: + Proxy vartotojo vardas: + + + + Proxy password: + Proxy slaptažodis: + + + + Action + Veiksmas + + + + Shortcut + Trumpinys + + + + Change shortcut... + Keisti trumpinį... + + + + Convert underscores to blanks + Paversti brÅ«kÅ¡nius į tarpus + + + + Convert %20 to blanks + Paversti %20 į tarpus + + + + Select Skin Files + Pasirinkti temų bylas + + + + Skin files + Temų bylos + + + + Add... + PridÄ—ti... + + + + Refresh + Atnaujinti + + + + Show protocol + Rodyti bylos galÅ«nÄ™ + + + + Transparency + Permatomumas + + + + Main window + Pagrindinis langas + + + + + + 0 + + + + + Equalizer + Glodintuvas + + + + EqWidget + + + + preset + Nustatymas + + + + &Load/Delete + &Ä®kelti/PaÅ¡alinti + + + + &Save Preset + &IÅ¡saugoti nustatymus + + + + &Save Auto-load Preset + &IÅ¡saugoti auto-nustatymÄ… + + + + &Clear + &iÅ¡valyti + + + + Saving Preset + IÅ¡saugojamas nustatymas + + + + Preset name: + Nustatymo pavadinimas: + + + + preset # + Nustatymas # + + + + &Import + &Importuoti + + + + Equalizer + Glotintuvas + + + + Import Preset + Importuoti nustatymus + + + + JumpToTrackDialog + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + PaÅ¡alinti iÅ¡ eilÄ—s + + + + + + Queue + Ä® eilÄ™ + + + + Jump To Track + Pereiti prie takelio + + + + Filter + Filtras + + + + Refresh + Atnaujinti + + + + Jump To + Prereiti prie + + + + MainDisplay + + + Previous + Ankstesnis + + + + Play + Groti + + + + Pause + Pristabdyti + + + + Stop + Sustoti + + + + Next + Sekantis + + + + Add file + PridÄ—ti bylÄ… + + + + Equalizer + Glotintuvas + + + + Playlist + GrojaraÅ¡tis + + + + Repeat playlist + Gartoti grojaraÅ¡tį + + + + Shuffle + Atsitiktine tvarka + + + + Volume + Garsumas + + + + Balance + Balansas + + + + Volume: %1% + Garsas: %1% + + + + Balance: %1% right + Balansas: %1% deÅ¡inÄ— + + + + Balance: %1% left + Balansas: %1% kairÄ— + + + + Balance: center + Balansas: centras + + + + Seek to: %1 + PerÅ¡okti į: %1 + + + + MainVisual + + + Visualization Mode + Vizualizacijos metodas + + + + Analyzer + Analizatorius + + + + Scope + Scope + + + + Off + IÅ¡jungta + + + + Analyzer Mode + Analizatoriaus metodas + + + + Normal + Ä®prastinis + + + + Fire + Ugnis + + + + Vertical Lines + Vertikalios linijos + + + + Lines + Linijos + + + + Bars + Bangos + + + + Peaks + Pikai + + + + Refresh Rate + Atnaujinimo dažnumas + + + + 50 fps + 50 kps + + + + 25 fps + 25 kps + + + + 10 fps + 10 kps + + + + 5 fps + 5 kps + + + + Analyzer Falloff + Analyzer Falloff + + + + + Slowest + LÄ—Äiausias + + + + + Slow + LÄ—tas + + + + + Medium + Vidutinis + + + + + Fast + Greitas + + + + + Fastest + GreiÄiausias + + + + Peaks Falloff + Peaks Falloff + + + + Background + Fonas + + + + Transparent + Permatomumas + + + + MainWindow + + + Choose a directory + Pasirinkite aplankÄ… + + + + Select one or more files to open + Pasirinkite vienÄ… ar kelias bylas atvÄ—rimui + + + + &Jump To File + &Pereiti prie bylos + + + + J + + + + + View + Rodyti + + + + Playlist + GrojaraÅ¡tis + + + + Open Playlist + Atverti grojaraÅ¡tį + + + + Save Playlist + IÅ¡saugoti grojaraÅ¡tį + + + + + Playlist Files + GrojaraÅ¡Äio bylos + + + + All Supported Bitstreams + Palaikomi bylų tipai + + + + Tools + Ä®rankiai + + + + PlayList + + + &Copy Selection To + &Kopijuoti pasirinkimÄ… į + + + + Sort List + Rūšiuoti + + + + + By Title + Pagal dainos pavadinimÄ… + + + + + By Album + Pagal albumÄ… + + + + + By Artist + Pagal atlikÄ—jÄ… + + + + + By Filename + Pagal bylos pavadinimÄ… + + + + + By Path + Filename + Pagal keliÄ… iki bylos + + + + + By Date + Pagal datÄ… + + + + Sort Selection + Rūšiuoti pasirinktus + + + + Randomize List + SumaiÅ¡yti sÄ…rašą + + + + Reverse List + Apversti + + + + &New PlayList + &Naujas grojaraÅ¡tis + + + + + By Track Number + Pagal takelio numerį + + + + Playlist + GrojaraÅ¡tis + + + + Actions + Veiksmai + + + + PlayListBrowser + + + Playlist Browser + GrojaraÅ¡Äių narÅ¡yklÄ— + + + + New + Naujas + + + + + Delete + IÅ¡trinti + + + + + ... + ... + + + + Rename + Pervadinti + + + + PlayListSelector + + + &Load + &Ä®kelti + + + + &Save As... + &Ä®raÅ¡yti kaip... + + + + Rename + Pervadinti + + + + &Delete + &IÅ¡trinti + + + + Rename Playlist + Pervadinti grojaraÅ¡tį + + + + Playlist name: + GrojaraÅ¡Äio pavadinimas + + + + PopupSettings + + + Popup Information Settings + IššokanÄios informacijos nustatymai + + + + Show cover + Rodyti virÅ¡elį + + + + Transparency: + Permatomumas + + + + Delay: + AtidÄ—jimas: + + + + ms + ms + + + + Cover size: + Nuotraukos dydis + + + + Template + Å ablonas + + + + Reset + IÅ¡trinti + + + + Insert + Ä®traukti + + + + Artist + AtlikÄ—jas + + + + Album + Albumas + + + + Title + Pavadinimas + + + + Track number + Takelio numeris + + + + Two-digit track number + Dviejų skaiÄių takelio numeris + + + + Genre + Žanras + + + + Comment + Komentaras + + + + Composer + Autorius + + + + Duration + Ilgis + + + + Disc number + Disko numeris + + + + File name + Bylos pavadinimas + + + + File path + Bylos kelias + + + + Year + Metai + + + + Condition + BÅ«klÄ— + + + + PresetEditor + + + Preset Editor + Nustatymų redaktorius + + + + Load + Ä®kelti + + + + Delete + IÅ¡trinti + + + + Preset + Nustatymas + + + + Auto-preset + Auto-nustatymas + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Naudojimas: qmmp [nuostatos] [bylos] + + + + Options: + Nustatymai: + + + + Print version number and exit + Parodyti versijÄ… ir iÅ¡eiti + + + + Display this text and exit + Parodyti šį tekstÄ… ir iÅ¡eiti + + + + Unknown command + Nežinoma komanda + + + + Don't start the application + Nepaleisti programos + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + IdÄ—jas, pataisymus, klaidas siųsti forkotov02@hotmail.ru + + + + QMMP version: + QMMP versija: + + + + Qt version: + Qt versija: + + + + ShortcutDialog + + + Change Shortcut + Keisti trumpinį + + + + Press the key combination you want to assign + Paspauskite klavišų kombinacijÄ…, kuriÄ… norite priskirti + + + + Clear + IÅ¡valyti + + + + TextScroller + + + Autoscroll Songname + Automatinis takelio slinkimas + + + + Buffering: %1% + Buferis: %1% + + + + VisualMenu + + + Visualization + Vizualizacija + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_nl.ts b/src/plugins/Ui/skinned/translations/qmmp_nl.ts new file mode 100644 index 000000000..3036c8504 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_nl.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Over Qmmp + + + + About + Over + + + + Authors + Auteurs + + + + Thanks To + Met Dank Aan + + + + License Agreement + Licentie + + + + :/txt/authors_en.txt + :/txt/authors_nl.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_nl.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt MultiMedia Player (Qmmp) + + + + Version: + Versie: + + + + :txt/description_en.txt + :txt/description_nl.txt + + + + Input plugins: + Invoer Modules: + + + + Output plugins: + Uitvoer Modules: + + + + Visual plugins: + Visuele Modules: + + + + Effect plugins: + Effecten Modules: + + + + General plugins: + Algemene Modules: + + + + Translators + Vertalers + + + + :/txt/translators_en.txt + :/txt/translators_nl.txt + + + + ActionManager + + + &Play + &Afspelen + + + + X + X + + + + &Pause + &Pauze + + + + C + C + + + + &Stop + &Stop + + + + V + V + + + + &Previous + &Vorige + + + + Z + Z + + + + &Next + &Volgende + + + + B + B + + + + &Play/Pause + &Afspelen/Pauze + + + + Space + Spatie + + + + &Jump to File + + + + + J + J + + + + &Repeat Playlist + &Herhaal Afspeellijst + + + + R + R + + + + &Repeat Track + &Herhaal Nummer + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + &Willekeurig + + + + S + S + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + &Voeg Bestand Toe + + + + F + F + + + + &Add Directory + &Voeg Map toe + + + + D + D + + + + &Add Url + &Voeg URL toe + + + + U + U + + + + &Remove Selected + &Verwijder Geselecteerd + + + + Del + Del + + + + &Remove All + &Verwijder Alles + + + + &Remove Unselected + &Verwijder Gedeselecteerde + + + + Remove unavailable files + Verwijder niet aanwezige bestanden + + + + Remove duplicates + Verwijder duplicaten + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Draai Selectie Om + + + + &Select None + &Selecteer Niets + + + + &Select All + &Selecteer Alles + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &Bekijk Nummer Details + + + + Alt+I + Alt+I + + + + &New List + &Nieuwe Lijst + + + + Ctrl+T + Ctrl+T + + + + &Delete List + &Verwijder Lijst + + + + Ctrl+W + Ctrl+W + + + + &Load List + &Laad Lijst + + + + O + O + + + + &Save List + &Bewaar Lijst + + + + Shift+S + Shift+S + + + + &Select Next Playlist + &Selecteer Volgende Afspeellijst + + + + Ctrl+PgDown + Ctrl+PgDown + + + + &Select Previous Playlist + &Selecteer Vorige Afspeellijst + + + + Ctrl+PgUp + Ctrl+PgUp + + + + &Show Playlists + &Toon Afspeellijst + + + + P + P + + + + &Settings + &Instellingen + + + + Ctrl+P + Ctrl+P + + + + &About + &Over + + + + &About Qt + &Over Qt + + + + &Exit + &Sluit + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Enter URL to add + URL om toe te voegen + + + + Error + Fout + + + + &Add + &Toevoegen + + + + &Cancel + &Annuleren + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Naar voren springen in afspeellijstb + + + + Skip backwards in playlist + Naar achteren springen in afspeellijst + + + + Start playing current song + Begin met afspelen van huidig nummer + + + + Don't clear the playlist + Niet de afspellijst leeghalen + + + + Pause current song + Pauzeer huidig nummer + + + + Pause if playing, play otherwise + Pauzeer als er wordt gespeeld, anders spelen + + + + Stop current song + Stop huidig nummer + + + + Display Jump to File dialog + Toon Ga Naar Bestandsdialoog + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Zet afspeelvolume (voorbeeld: qmmp --volume 20) + + + + Show/hide application + Toon/verberg programma + + + + Display Add File dialog + Toon venster om bestanden toe te voegen + + + + Display Add Directory dialog + Toon venster om mappen toe te voegen + + + + ConfigDialog + + + Description + Popis + + + + Filename + Bestandsnaam + + + + Artist + Artiest + + + + + Album + Album + + + + Track + Nummer + + + + Disabled + Uitgeschakeld + + + + Transports + Protocols + + + + Decoders + Decoders + + + + Engines + Engines + + + + Misc + + + + + Title + Naam + + + + Track number + Liednummer + + + + Two-digit track number + Twee-getal liednummer + + + + Disc number + CD nummer + + + + Condition + Staat + + + + Composer + Componist + + + + File name + Bestandsnaam + + + + File path + Pad + + + + Genre + Genre + + + + Year + Jaar + + + + Comment + Commentaar + + + + Qmmp Settings + Qmmp Instellingen + + + + Appearance + Vertoning + + + + + + Playlist + Afspeellijst + + + + Plugins + Modules + + + + Advanced + Geavanceerd + + + + Skins + Thema's + + + + Fonts + Lettertypen + + + + Player: + Speler: + + + + Playlist: + Afspeellijst: + + + + + ??? + ??? + + + + Replay Gain + Replay Gain + + + + Miscellaneous + Overige + + + + + + ... + ... + + + + Use bitmap font if available + Gebruik bitmap lettertype indien aanwezig + + + + Use skin cursors + Gebruik thema cursor + + + + Shortcuts + + + + + Metadata + Metadata + + + + Load metadata from files + Laad metadata van bestanden + + + + Song Display + Nummer Weergave + + + + Title format: + Titel formaat: + + + + Show song numbers + Toon liednummers + + + + Show playlists + Toon afspeellijst + + + + Show popup information + Toon popup informatie + + + + Show anchor + + + + + Align song numbers + + + + + + Preferences + Voorkeuren + + + + + + Information + Informatie + + + + Cover Image Retrieve + Lees Hoes Af + + + + Use separate image files + Gebruik aparte afbeeldingsbestanden + + + + Include files: + Inclusief de bestanden: + + + + Exclude files: + Exclusief de bestanden: + + + + Recursive search depth: + Recursieve zoekdiepte: + + + + + Playback + Afspelen + + + + Continue playback on startup + Verdergaan met afspelen bij opstarten + + + + Replay Gain mode: + Replay Gain stand: + + + + Preamp: + Voorversterking: + + + + + dB + dB + + + + Default gain: + Standaard verhoging: + + + + Use peak info to prevent clipping + Gebruik piek info om stotteren te voorkomen + + + + Output: + Uitvoer: + + + + Buffer size: + + + + + ms + ms + + + + 16-bit output + 16bit uitvoer + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Connectivity + Connectiviteit + + + + + View + Weergave + + + + Edit template + + + + + File Dialog + Bestandsdialoog + + + + Proxy + Proxy + + + + Enable proxy usage + Gebruik proxy + + + + Proxy host name: + Proxy host naam: + + + + Proxy port: + Proxy poort: + + + + Use authentication with proxy + Gebruik authenticatie bij proxy + + + + Proxy user name: + Proxy gebruikersnaam: + + + + Proxy password: + Proxy wachtwoord: + + + + Archived skin + Gearchiveerd thema + + + + Unarchived skin + Niet gearchiveerd thema + + + + Visualization + Visualisatie + + + + Effects + Effecten + + + + General + Algemeen + + + + + Audio + Audio + + + + Use software volume control + Gebruik software volume + + + + Hide on close + Verberg bij sluit + + + + Start hidden + Start verborgen + + + + Convert underscores to blanks + Zet lage strepen om in spaties + + + + Convert %20 to blanks + Zet %20 om in spaties + + + + Select Skin Files + Selecteer themabestanden + + + + Skin files + Thema bestanden + + + + Add... + Toevoegen... + + + + Refresh + Herlaad + + + + Show protocol + Laad protocol + + + + Transparency + Transparantie + + + + Main window + Hoofdscherm + + + + + + 0 + 0 + + + + Equalizer + Equalizer + + + + EqWidget + + + Equalizer + Equalizer + + + + + preset + voorinstelling + + + + &Load/Delete + &Laad/Verwijder + + + + &Save Preset + &Bewaar Instelling + + + + &Save Auto-load Preset + &Bewaar Auto-laad Instelling + + + + &Import + &Importeer + + + + &Clear + &Leeghalen + + + + Saving Preset + Bewaren van Preset + + + + Preset name: + Instellingnaam: + + + + preset # + instelling # + + + + Import Preset + Importer Instelling + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + Verwijder uit lijst + + + + + + Queue + Rij + + + + Jump To Track + Ga Naar Nummer + + + + Filter + Filter + + + + Refresh + Herlaad + + + + Jump To + Ga Naar + + + + MainDisplay + + + Previous + Vorige + + + + Play + Afspelen + + + + Pause + Pauze + + + + Stop + Stop + + + + Next + Volgende + + + + Add file + Bestand toevoegen + + + + Equalizer + Equalizer + + + + Playlist + Afspeellijst + + + + Repeat playlist + Herhaal afspeellijst + + + + Shuffle + Willekeurig + + + + Volume + Volume + + + + Balance + Balans + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + Visualisatiestand + + + + Analyzer + Analysator + + + + Scope + Scoop + + + + Off + Uit + + + + Analyzer Mode + Analysatorstand + + + + Normal + Normaal + + + + Fire + Vuur + + + + Vertical Lines + Verticale Lijnen + + + + Lines + Lijnen + + + + Bars + Strepen + + + + Peaks + Toppen + + + + Refresh Rate + Vernieuw Frequentie + + + + 50 fps + 50 Hz + + + + 25 fps + 25 Hz + + + + 10 fps + 10 Hz + + + + 5 fps + 5 Hz + + + + Analyzer Falloff + Analysator Uitval + + + + + Slowest + Traagst + + + + + Slow + Traag + + + + + Medium + Normaal + + + + + Fast + Snel + + + + + Fastest + Snelst + + + + Peaks Falloff + Toppen Uitval + + + + Background + Achtergrond + + + + Transparent + Transparantie + + + + MainWindow + + + Choose a directory + Kies een map + + + + Select one or more files to open + Kies een of meer bestanden om te openen + + + + &Jump To File + &Spring Naar Bestand + + + + J + J + + + + View + Weergave + + + + Playlist + Afspeellijst + + + + + Playlist Files + Afspeellijst Bestanden + + + + Open Playlist + Open Afspeellijst + + + + Save Playlist + Bewaar Afspeellijst + + + + All Supported Bitstreams + Alle Ondersteunde Bitstromen + + + + Tools + Gereedschappen + + + + PlayList + + + Sort List + Sorteer Lijst + + + + + By Title + Op Titel + + + + + By Album + Op Album + + + + + By Artist + Op Artiest + + + + + By Filename + Op Bestandsnaam + + + + + By Path + Filename + Op Pad + Bestandsnaam + + + + + By Date + Op Datum + + + + Sort Selection + Sorteer Selectie + + + + Randomize List + Schud Lijst + + + + Reverse List + Draai Lijst Om + + + + &New PlayList + + + + + &Copy Selection To + + + + + Playlist + Afspeellijst + + + + + By Track Number + Op Lied Nummer + + + + Actions + Acties + + + + PlayListBrowser + + + Playlist Browser + Afspeellijst Browser + + + + New + Nieuw + + + + + Delete + Verwijder + + + + + ... + ... + + + + Rename + Hernoem + + + + PlayListSelector + + + &Load + &Laad + + + + &Save As... + &Bewaar Als... + + + + Rename + Hernoem + + + + &Delete + &Verwijder + + + + Rename Playlist + Hernoem Afspeellijst + + + + Playlist name: + Afspeellijst: + + + + PopupSettings + + + Popup Information Settings + Popup Informatie Instellingen + + + + Show cover + Toon Hoes + + + + Transparency: + Transparantie: + + + + Delay: + Vertraging: + + + + ms + ms + + + + Cover size: + Hoesgrootte: + + + + Template + Layout + + + + Reset + Terugzetten + + + + Insert + Invoegen + + + + Artist + Artiest + + + + Album + Album + + + + Title + Naam + + + + Track number + Liednummer + + + + Two-digit track number + Twee-cijfer liednummer + + + + Genre + Genre + + + + Comment + Commentaar + + + + Composer + Componist + + + + Duration + Duur + + + + Disc number + CD nummer + + + + File name + Bestandsnaam + + + + File path + Pad + + + + Year + Jaar + + + + Condition + Staat + + + + PresetEditor + + + Preset Editor + Instellingen Bewerker + + + + Load + Laad + + + + Delete + Verwijder + + + + Preset + Instelling + + + + Auto-preset + Auto-instellingen + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Gebruik: qmmp [opties] [bestanden] + + + + Options: + Opties: + + + + Don't start the application + + + + + Print version number and exit + Print versienummer en sluit + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Ideëen, patches, foutrapporten zenden naar forkotov02@hotmail.ru (anglicky) + + + + Display this text and exit + Toon dit tekstje en sluit + + + + Unknown command + Onbekend commando + + + + QMMP version: + QMMP versie: + + + + Qt version: + Qt versie: + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + Automatisch naar Liednummer Scrollen + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + Visualisatie + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_pl_PL.ts b/src/plugins/Ui/skinned/translations/qmmp_pl_PL.ts new file mode 100644 index 000000000..adcf47709 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_pl_PL.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + O programie Qmmp + + + + About + O programie + + + + License Agreement + Warunki licencji + + + + Authors + Autorzy + + + + Thanks To + PodziÄ™kowania + + + + :/txt/authors_en.txt + + + + + :/txt/thanks_en.txt + + + + + Qt-based Multimedia Player (Qmmp) + Odtwarzacz Multimedialny oparty na QT (Qmmp) + + + + Version: + Wersja: + + + + :txt/description_en.txt + + + + + Input plugins: + Wtyczki wejÅ›ciowe: + + + + Output plugins: + Wtyczki wyjÅ›ciowe: + + + + Visual plugins: + Wtyczki wizualizacji: + + + + Effect plugins: + Wtyczki efektów: + + + + General plugins: + Wtyczki ogólne: + + + + Translators + TÅ‚umacze + + + + :/txt/translators_en.txt + + + + + ActionManager + + + &Play + &Odtwarzaj + + + + X + X + + + + &Pause + &Wstrzymaj + + + + C + C + + + + &Stop + &Zatrzymaj + + + + V + V + + + + &Previous + &Poprzedni + + + + Z + Z + + + + &Next + &NastÄ™pny + + + + B + B + + + + &Play/Pause + &Odtwarzaj/Wstrzymaj + + + + Space + Spacja + + + + &Jump to File + Skocz do utworu + + + + J + J + + + + &Repeat Playlist + Powtó&rz listÄ™ odtwarzania + + + + R + + + + + &Repeat Track + &Powtórz utwór + + + + Ctrl+R + + + + + &Shuffle + &Losowo + + + + S + + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + Zatrzymaj po aktualnie odtwarzanym utworze + + + + Ctrl+S + + + + + &Clear Queue + Wy&czyść kolejkÄ™ + + + + Alt+Q + + + + + Show Playlist + Pokaż listÄ™ odtwarzania + + + + Alt+E + + + + + Show Equalizer + Pokaż korektor + + + + Alt+G + + + + + Always on Top + Zawsze na wierzchu + + + + Put on All Workspaces + Na wszystkie pulpity + + + + Double Size + Podwójny rozmiar + + + + Meta+D + + + + + &Add File + &Dodaj plik + + + + F + F + + + + &Add Directory + Dodaj &katalog + + + + D + D + + + + &Add Url + Dod&aj Url + + + + U + U + + + + &Remove Selected + &UsuÅ„ zaznaczone + + + + Del + Del + + + + &Remove All + UsuÅ„ &wszystkie + + + + &Remove Unselected + UsuÅ„ &niezaznaczone + + + + Remove unavailable files + UsuÅ„ niedostÄ™pne pliki + + + + Remove duplicates + UsuÅ„ duplikaty + + + + &Queue Toggle + Dodaj do/UsuÅ„ z kolejki + + + + Q + Q + + + + Invert Selection + Odwróć zaznaczenie + + + + &Select None + &Odznacz wszystkie + + + + &Select All + &Zaznacz wszystkie + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &Pokaż informacje o pliku + + + + Alt+I + Alt+I + + + + &New List + &Nowa lista + + + + Ctrl+T + + + + + &Delete List + UsuÅ„ listÄ™ o&dtwarzania + + + + Ctrl+W + + + + + &Load List + &Åaduj listÄ™ + + + + O + O + + + + &Save List + &Zapisz listÄ™ + + + + Shift+S + Shift+S + + + + &Select Next Playlist + Wybierz na&stÄ™pnÄ… listÄ™ + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + Wybierz poprzedniÄ… li&stÄ™ + + + + Ctrl+PgUp + + + + + &Show Playlists + Pokaż li&sty odtwarzania + + + + P + + + + + &Settings + &Ustawienia + + + + Ctrl+P + Ctrl+P + + + + &About + &O programie + + + + &About Qt + &O Qt + + + + &Exit + &WyjÅ›cie + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + Błąd + + + + Enter URL to add + Wpisz URL + + + + &Add + &Dodaj + + + + &Cancel + &Anuluj + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Przeskocz do przodu na liÅ›cie odtwarzania + + + + Skip backwards in playlist + Przeskocz do tyÅ‚u na liÅ›cie odtwarzania + + + + Start playing current song + Zacznij odtwarzać bieżący utwór + + + + Don't clear the playlist + Nie czyść listy + + + + Pause current song + Wstrzymaj bieżący utwór + + + + Pause if playing, play otherwise + Wstrzymaj jeÅ›li odtwarza, odtwarzaj w przeciwnym wypadku + + + + Stop current song + Zatrzymaj bieżący utwór + + + + Display Jump to File dialog + WyÅ›wietl okno dialogowe Skocz do + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + Ustaw gÅ‚oÅ›ność odtwarzania (np: qmmp --volume 20) + + + + Show/hide application + Pokaż/ukryj aplikacjÄ™ + + + + Display Add File dialog + WyÅ›wietl okno dialogowe dodawania plików + + + + Display Add Directory dialog + WyÅ›wietl okno dialogowe dodawania katalogów + + + + ConfigDialog + + + Description + Opis + + + + Filename + Nazwa pliku + + + + Artist + Artysta + + + + + Album + Album + + + + Track + Utwór + + + + Disabled + Wyłączone + + + + Transports + Transporty + + + + Decoders + Dekodery + + + + Engines + Silniki + + + + Misc + Inne + + + + Title + TytuÅ‚ + + + + Track number + Numer utworu + + + + Two-digit track number + Dwuznakowy numer utworu + + + + Disc number + Numer albumu + + + + Condition + Warunek + + + + Genre + Gatunek + + + + Composer + Kompozytor + + + + File name + Nazwa pliku + + + + File path + Lokalizacja + + + + Year + Rok + + + + Comment + Komentarz + + + + Qmmp Settings + Ustawienia Qmmp + + + + Skins + Skóry + + + + Fonts + Czcionki + + + + Player: + Odtwarzacz: + + + + Playlist: + Lista odtwarzania: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Metadane + + + + Load metadata from files + ZaÅ‚aduj metadane z pliku + + + + Song Display + WyÅ›wietlanie utworu + + + + Title format: + Format tytuÅ‚u: + + + + + Preferences + Ustawienia + + + + + + Information + Informacje + + + + Appearance + WyglÄ…d + + + + + + Playlist + Lista odtwarzania + + + + Plugins + Wtyczki + + + + Advanced + Zaawansowane + + + + 16-bit output + 16-bitowe odtwarzanie + + + + Archived skin + Skompresowana skórka + + + + Unarchived skin + Niekompresowana skórka + + + + Connectivity + Sieć + + + + Visualization + Wizualizacje + + + + Effects + Efekty + + + + General + Ogólne + + + + File Dialog + Okno dialogowe + + + + + Audio + DźwiÄ™k + + + + Replay Gain + + + + + Miscellaneous + Zaawansowane + + + + Use bitmap font if available + Użyj czcionki bitmapowej jeÅ›li jest dostÄ™pna + + + + Use skin cursors + Użyj kursorów z motywu + + + + Show song numbers + WyÅ›wietl numery utworów na liÅ›cie odtwarzania + + + + Show playlists + Pokaż listy odtwarzania + + + + Show popup information + Pokaż informacjÄ™ popup + + + + Replay Gain mode: + Tryb Replay Gain: + + + + Preamp: + + + + + + dB + + + + + Default gain: + DomyÅ›lne wzmocnienie: + + + + Use peak info to prevent clipping + Użyj informacji peak by zapobiec "klipniÄ™ciom" + + + + Output: + WyjÅ›cie: + + + + Buffer size: + Rozmiar bufora: + + + + ms + ms + + + + Use software volume control + Użyj programowej regulacji gÅ‚oÅ›noÅ›ci + + + + + View + WyglÄ…d + + + + Shortcuts + Skróty klawiszowe + + + + Hide on close + Zminimalizuj przy zamykaniu + + + + Start hidden + Uruchom zminimalizowany + + + + Edit template + Edytuj szablon + + + + Show anchor + Pokaż kotwicÄ™ + + + + Align song numbers + Wyrównaj w pionie numery utworów + + + + Cover Image Retrieve + Pobieranie okÅ‚adek + + + + Use separate image files + Użyj oddzielnych obrazków + + + + Include files: + Użyj plików: + + + + Exclude files: + Wyłącz pliki: + + + + Recursive search depth: + Głębokość rekursywnego przeszukiwania: + + + + + Playback + Odtwarzanie + + + + Continue playback on startup + Wznów odtwarzanie po uruchomieniu programu + + + + Proxy + Proxy + + + + Enable proxy usage + Włącz proxy + + + + Proxy host name: + Nazwa hosta proxy: + + + + Proxy port: + Port proxy: + + + + Use authentication with proxy + Użyj autoryzacji z proxy + + + + Proxy user name: + Nazwa użytkownika: + + + + Proxy password: + HasÅ‚o: + + + + Action + Akcje + + + + Shortcut + Skrót + + + + Change shortcut... + ZmieÅ„ skrót... + + + + Convert underscores to blanks + Konwertuj podkreÅ›lenia na spacje + + + + Convert %20 to blanks + Konwertuj sekwencje %20 na spacje + + + + Select Skin Files + Wybierz skórÄ™ + + + + Skin files + Pliki skór + + + + Add... + Dodaj... + + + + Refresh + OdÅ›wież + + + + Show protocol + Pokaż protokół + + + + Transparency + Przezroczystość + + + + Main window + Okno główne + + + + + + 0 + 0 + + + + Equalizer + Korektor + + + + EqWidget + + + + preset + profil + + + + &Load/Delete + Wczytaj/&UsuÅ„ + + + + &Save Preset + Zapi&sz Profil + + + + &Save Auto-load Preset + Zapi&sz Auto-Å‚adowanie Profilu + + + + &Clear + &Wyczyść + + + + Saving Preset + Zapisywanie Profilu + + + + Preset name: + Nazwa Profilu: + + + + preset # + profil # + + + + &Import + &Importuj + + + + Equalizer + Korektor + + + + Import Preset + Importuj Profil + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + + + + + + Unqueue + Wykolejkuj + + + + + + Queue + Kolejkuj + + + + Jump To Track + Skocz do utworu + + + + Filter + Filtr + + + + Refresh + OdÅ›wież + + + + Jump To + Skocz do + + + + MainDisplay + + + Previous + Poprzedni + + + + Play + Odtwarzaj + + + + Pause + Pauza + + + + Stop + Zatrzymaj + + + + Next + NastÄ™pny + + + + Add file + Dodaj plik + + + + Equalizer + Equalizer + + + + Playlist + Lista odtwarzania + + + + Repeat playlist + Powtórz listÄ™ odtwarzania + + + + Shuffle + Losowo + + + + Volume + GÅ‚oÅ›ność + + + + Balance + Balans + + + + Volume: %1% + GÅ‚oÅ›ność: %1% + + + + Balance: %1% right + Balans: %1% prawy + + + + Balance: %1% left + Balans: %1% lewy + + + + Balance: center + Balans: Å›rodek + + + + Seek to: %1 + Przewijanie: %1 + + + + MainVisual + + + Visualization Mode + Tryb wizualizacji + + + + Analyzer + Analizator + + + + Scope + + + + + Off + Wyłączone + + + + Analyzer Mode + Tryb Analizatora + + + + Normal + Normalny + + + + Fire + OgieÅ„ + + + + Vertical Lines + Pionowe Linie + + + + Lines + Linie + + + + Bars + SÅ‚upki + + + + Peaks + Piki + + + + Refresh Rate + OdÅ›wieżanie + + + + 50 fps + + + + + 25 fps + + + + + 10 fps + + + + + 5 fps + + + + + Analyzer Falloff + PrÄ™dkość Analizatora + + + + + Slowest + Najwolniej + + + + + Slow + Wolno + + + + + Medium + Åšrednio + + + + + Fast + Szybko + + + + + Fastest + Najszybciej + + + + Peaks Falloff + Opadanie Pików + + + + Background + TÅ‚o + + + + Transparent + Przezroczystość + + + + MainWindow + + + Choose a directory + Wybierz katalog + + + + Select one or more files to open + Wybierz jeden lub wiÄ™cej plików do otwarcia + + + + &Jump To File + &Skocz do pliku + + + + J + J + + + + View + WyglÄ…d + + + + Playlist + Lista odtwarzania + + + + Open Playlist + Otwórz listÄ™ odtwarzania + + + + Save Playlist + Zapisz listÄ™ odtwarzania + + + + + Playlist Files + Pliki listy odtwarzania + + + + All Supported Bitstreams + Wszystkie wspierane formaty + + + + Tools + NarzÄ™dzia + + + + PlayList + + + &Copy Selection To + Kopiuj zazna&czenie do + + + + Sort List + Sortuj listÄ™ + + + + + By Title + WedÅ‚ug nazwy + + + + + By Album + WedÅ‚ug nazwy albumu + + + + + By Artist + WedÅ‚ug artysty + + + + + By Filename + WedÅ‚ug nazwy pliku + + + + + By Path + Filename + WedÅ‚ug Åšcieżki + Nazwy pliku + + + + + By Date + Wg Daty + + + + Sort Selection + Sortuj zaznaczone + + + + Randomize List + Tasuj listÄ™ + + + + Reverse List + Odwróć listÄ™ + + + + &New PlayList + &Nowa lista odtwarzania + + + + + By Track Number + Wg numeru utworu + + + + Playlist + Lista odtwarzania + + + + Actions + Akcje + + + + PlayListBrowser + + + Playlist Browser + Menedżer list odtwarzania + + + + New + Nowa + + + + + Delete + UsuÅ„ + + + + + ... + ... + + + + Rename + ZmieÅ„ nazwÄ™ + + + + PlayListSelector + + + &Load + ZaÅ‚aduj + + + + &Save As... + Zapi&sz jako... + + + + Rename + ZmieÅ„ nazwÄ™ + + + + &Delete + UsuÅ„ + + + + Rename Playlist + ZmieÅ„ nazwÄ™ listy + + + + Playlist name: + Nazwa listy odtwarzania: + + + + PopupSettings + + + Popup Information Settings + Ustawienia informacji Popup + + + + Show cover + Pokaż okÅ‚adkÄ™ + + + + Transparency: + Przezroczystość: + + + + Delay: + Opóźnienie: + + + + ms + + + + + Cover size: + Rozmiar okÅ‚adki: + + + + Template + Szablon + + + + Reset + Przywróć + + + + Insert + Wstaw + + + + Artist + Artysta + + + + Album + Album + + + + Title + TytuÅ‚ + + + + Track number + Numer utworu + + + + Two-digit track number + Dwuznakowy numer utworu + + + + Genre + Gatunek + + + + Comment + Komentarz + + + + Composer + Kompozytor + + + + Duration + DÅ‚ugość + + + + Disc number + Numer albumu + + + + File name + Nazwa pliku + + + + File path + Lokalizacja + + + + Year + Rok + + + + Condition + Warunek + + + + PresetEditor + + + Preset Editor + Edytor Profili + + + + Load + Åaduj + + + + Delete + UsuÅ„ + + + + Preset + Profil + + + + Auto-preset + Auto-profil + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Użycie: qmmp [opcje] [pliki] + + + + Options: + Opcje: + + + + Don't start the application + Nie uruchamiaj aplikacji + + + + Print version number and exit + WyÅ›wietla wersjÄ™ programu i wychodzi + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + PomysÅ‚y, poprawki, raporty o błędach proszÄ™ wysyÅ‚ać na forkotov02@hotmail.ru + + + + Display this text and exit + WyÅ›wietla ten tekst i wychodzi + + + + Unknown command + Nieznane polecenie + + + + QMMP version: + Wersja QMMP: + + + + Qt version: + Wersja QT: + + + + ShortcutDialog + + + Change Shortcut + Modyfikuj skrót + + + + Press the key combination you want to assign + WciÅ›nij kombinacjÄ™ klawiszy, które chcesz przypisać + + + + Clear + Wyczyść + + + + TextScroller + + + Autoscroll Songname + Automatyczne przewijanie tytuÅ‚u utworu + + + + Buffering: %1% + Buforowanie: : %1% + + + + VisualMenu + + + Visualization + Wizualizacja + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_pt_BR.ts b/src/plugins/Ui/skinned/translations/qmmp_pt_BR.ts new file mode 100644 index 000000000..548b20727 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_pt_BR.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Sobre QMMP + + + + About + Sobre + + + + License Agreement + Concordância com a Licença + + + + Authors + Autores + + + + Thanks To + Agradecimentos para + + + + :/txt/authors_en.txt + + + + + :/txt/thanks_en.txt + + + + + Qt-based Multimedia Player (Qmmp) + + + + + Version: + + + + + :txt/description_en.txt + + + + + Input plugins: + + + + + Output plugins: + + + + + Visual plugins: + + + + + Effect plugins: + + + + + General plugins: + + + + + Translators + + + + + :/txt/translators_en.txt + + + + + ActionManager + + + &Play + Tocar + + + + X + + + + + &Pause + Pausar + + + + C + + + + + &Stop + Parar + + + + V + + + + + &Previous + Anterior + + + + Z + + + + + &Next + Próximo + + + + B + + + + + &Play/Pause + + + + + Space + + + + + &Jump to File + + + + + J + + + + + &Repeat Playlist + + + + + R + + + + + &Repeat Track + + + + + Ctrl+R + + + + + &Shuffle + + + + + S + + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + &Adicionar arquivo + + + + F + + + + + &Add Directory + &Adicionar Diretorio + + + + D + + + + + &Add Url + + + + + U + + + + + &Remove Selected + &Remover selecionadas + + + + Del + + + + + &Remove All + &Remover tudo + + + + &Remove Unselected + &Remover não selecionadas + + + + Remove unavailable files + + + + + Remove duplicates + + + + + &Queue Toggle + + + + + Q + + + + + Invert Selection + Inverter Seleção + + + + &Select None + &Nenhum selecionado + + + + &Select All + &Selecionar tudo + + + + Ctrl+A + + + + + &View Track Details + &Ver detalhes da Faixa + + + + Alt+I + + + + + &New List + &Nova lista + + + + Ctrl+T + + + + + &Delete List + + + + + Ctrl+W + + + + + &Load List + &Carregar lista + + + + O + + + + + &Save List + &Salvar lista + + + + Shift+S + + + + + &Select Next Playlist + + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + + + + + Ctrl+PgUp + + + + + &Show Playlists + + + + + P + + + + + &Settings + Configurações + + + + Ctrl+P + + + + + &About + &Sobre + + + + &About Qt + + + + + &Exit + Sair + + + + Ctrl+Q + + + + + AddUrlDialog + + + Error + + + + + Enter URL to add + + + + + &Add + + + + + &Cancel + + + + + BuiltinCommandLineOption + + + Skip forward in playlist + + + + + Skip backwards in playlist + + + + + Start playing current song + + + + + Don't clear the playlist + + + + + Pause current song + + + + + Pause if playing, play otherwise + + + + + Stop current song + + + + + Display Jump to File dialog + + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + + + + + Show/hide application + + + + + Display Add File dialog + + + + + Display Add Directory dialog + + + + + ConfigDialog + + + Description + Descrição + + + + Filename + Nome do Arquivo + + + + Artist + Artista + + + + + Album + Ãlbum + + + + Track + + + + + Disabled + + + + + Transports + + + + + Decoders + + + + + Engines + + + + + Misc + + + + + Title + Título + + + + Track number + + + + + Two-digit track number + + + + + Disc number + + + + + Condition + + + + + Genre + Gênero + + + + Composer + + + + + File name + + + + + File path + + + + + Year + Ano + + + + Comment + Comentário + + + + Qmmp Settings + Configurações + + + + Skins + Temas + + + + Fonts + Fontes + + + + Player: + Player + + + + Playlist: + Lista de músicas: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + MetaData + + + + Load metadata from files + Carregar arquivo MetaData + + + + Song Display + Mostrar música + + + + Title format: + Tipo de Formato: + + + + + Preferences + Preferências + + + + + + Information + Informações + + + + Appearance + Aparência + + + + + + Playlist + Lista de músicas + + + + Plugins + Plugins + + + + Advanced + Avançado + + + + 16-bit output + + + + + Archived skin + + + + + Unarchived skin + + + + + Connectivity + + + + + Visualization + + + + + Effects + + + + + General + + + + + File Dialog + + + + + + Audio + + + + + Replay Gain + + + + + Miscellaneous + + + + + Use bitmap font if available + + + + + Use skin cursors + + + + + Show song numbers + + + + + Show playlists + + + + + Show popup information + + + + + Replay Gain mode: + + + + + Preamp: + + + + + + dB + + + + + Default gain: + + + + + Use peak info to prevent clipping + + + + + Output: + + + + + Buffer size: + + + + + ms + + + + + Use software volume control + + + + + + View + + + + + Shortcuts + + + + + Hide on close + + + + + Start hidden + + + + + Edit template + + + + + Show anchor + + + + + Align song numbers + + + + + Cover Image Retrieve + + + + + Use separate image files + + + + + Include files: + + + + + Exclude files: + + + + + Recursive search depth: + + + + + + Playback + + + + + Continue playback on startup + + + + + Proxy + + + + + Enable proxy usage + + + + + Proxy host name: + + + + + Proxy port: + + + + + Use authentication with proxy + + + + + Proxy user name: + + + + + Proxy password: + + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Convert underscores to blanks + + + + + Convert %20 to blanks + + + + + Select Skin Files + + + + + Skin files + + + + + Add... + + + + + Refresh + Recarregar + + + + Show protocol + + + + + Transparency + + + + + Main window + + + + + + + 0 + + + + + Equalizer + + + + + EqWidget + + + + preset + preset + + + + &Load/Delete + &Carregar/Deletar + + + + &Save Preset + %Salvar preset + + + + &Save Auto-load Preset + &Salvar Auto-Carregar preset + + + + &Clear + &Limpar + + + + Saving Preset + Salvando Preset + + + + Preset name: + Nome Preset: + + + + preset # + Preset # + + + + &Import + &Importar + + + + Equalizer + + + + + Import Preset + Importar Preset + + + + JumpToTrackDialog + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + Sem Faixa na Fila + + + + + + Queue + Faixa na Fila + + + + Jump To Track + Pular de faixa + + + + Filter + Filtro + + + + Refresh + Recarregar + + + + Jump To + Pular para + + + + MainDisplay + + + Previous + + + + + Play + + + + + Pause + + + + + Stop + + + + + Next + + + + + Add file + + + + + Equalizer + + + + + Playlist + Lista de músicas + + + + Repeat playlist + + + + + Shuffle + + + + + Volume + + + + + Balance + + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + + + + + Analyzer + + + + + Scope + + + + + Off + + + + + Analyzer Mode + + + + + Normal + + + + + Fire + + + + + Vertical Lines + + + + + Lines + + + + + Bars + + + + + Peaks + + + + + Refresh Rate + + + + + 50 fps + + + + + 25 fps + + + + + 10 fps + + + + + 5 fps + + + + + Analyzer Falloff + + + + + + Slowest + + + + + + Slow + + + + + + Medium + + + + + + Fast + + + + + + Fastest + + + + + Peaks Falloff + + + + + Background + + + + + Transparent + + + + + MainWindow + + + Choose a directory + Escolher o diretorio + + + + Select one or more files to open + Selecionar um ou mais arquivos + + + + &Jump To File + Pular para arquivo + + + + J + + + + + View + + + + + Playlist + Lista de músicas + + + + Open Playlist + Abrir Playlist + + + + Save Playlist + Salvar Playlist + + + + + Playlist Files + ФArquivos de lista de músicas + + + + All Supported Bitstreams + + + + + Tools + + + + + PlayList + + + &Copy Selection To + + + + + Sort List + Classificar lista + + + + + By Title + Por Título + + + + + By Album + + + + + + By Artist + + + + + + By Filename + Por Nome + + + + + By Path + Filename + Por Dirertório + Nome + + + + + By Date + Por Data + + + + Sort Selection + Classificar por Seleção + + + + Randomize List + Lista Eleatória + + + + Reverse List + Lista Revertida + + + + &New PlayList + + + + + + By Track Number + + + + + Playlist + Lista de músicas + + + + Actions + + + + + PlayListBrowser + + + Playlist Browser + + + + + New + + + + + + Delete + Remover + + + + + ... + ... + + + + Rename + + + + + PlayListSelector + + + &Load + + + + + &Save As... + + + + + Rename + + + + + &Delete + + + + + Rename Playlist + + + + + Playlist name: + + + + + PopupSettings + + + Popup Information Settings + + + + + Show cover + + + + + Transparency: + + + + + Delay: + + + + + ms + + + + + Cover size: + + + + + Template + + + + + Reset + + + + + Insert + + + + + Artist + Artista + + + + Album + Ãlbum + + + + Title + Título + + + + Track number + + + + + Two-digit track number + + + + + Genre + Gênero + + + + Comment + Comentário + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + Ano + + + + Condition + + + + + PresetEditor + + + Preset Editor + Editor de Preset + + + + Load + Carregar + + + + Delete + Remover + + + + Preset + Preset + + + + Auto-preset + Auto-preset + + + + QMMPStarter + + + Usage: qmmp [options] [files] + + + + + Options: + + + + + Don't start the application + + + + + Print version number and exit + + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + + + + + Display this text and exit + + + + + Unknown command + + + + + QMMP version: + + + + + Qt version: + + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_ru.ts b/src/plugins/Ui/skinned/translations/qmmp_ru.ts new file mode 100644 index 000000000..52b8a5b2d --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_ru.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + О Qmmp + + + + About + О программе + + + + License Agreement + Ð›Ð¸Ñ†ÐµÐ½Ð·Ð¸Ñ + + + + Authors + Ðвторы + + + + Thanks To + БлагодарноÑти + + + + :/txt/authors_en.txt + :/txt/authors_ru.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_ru.txt + + + + Qt-based Multimedia Player (Qmmp) + + + + + Version: + ВерÑиÑ: + + + + :txt/description_en.txt + :txt/description_ru.txt + + + + Input plugins: + Модули ввода: + + + + Output plugins: + Модули вывода: + + + + Visual plugins: + Модули визуализации: + + + + Effect plugins: + Модули Ñффектов: + + + + General plugins: + Общие модули: + + + + Translators + Переводчики + + + + :/txt/translators_en.txt + :/txt/translators_ru.txt + + + + ActionManager + + + &Play + &ВоÑпроизвеÑти + + + + X + + + + + &Pause + &ПриоÑтановить + + + + C + + + + + &Stop + &Стоп + + + + V + + + + + &Previous + &Предыдущий фрагмент + + + + Z + + + + + &Next + &Следующий фрагмент + + + + B + + + + + &Play/Pause + &ВоÑпр/приоÑÑ‚ + + + + Space + + + + + &Jump to File + + + + + J + + + + + &Repeat Playlist + &ПовторÑть ÑпиÑок + + + + R + + + + + &Repeat Track + &ПовторÑть трек + + + + Ctrl+R + + + + + &Shuffle + &Ð’ Ñлучайном порÑдке + + + + S + + + + + &No Playlist Advance + &Ðе продвигатьÑÑ Ð¿Ð¾ ÑпиÑку + + + + Ctrl+N + + + + + &Stop After Selected + &ОÑтановить поÑле выделенного + + + + Ctrl+S + + + + + &Clear Queue + &ОчиÑтить очередь + + + + Alt+Q + + + + + Show Playlist + Показывать ÑпиÑок + + + + Alt+E + + + + + Show Equalizer + Показывать Ñквалайзер + + + + Alt+G + + + + + Always on Top + Поверх вÑех окон + + + + Put on All Workspaces + РазмеÑтить на вÑех рабочих Ñтолах + + + + Double Size + Двойной размер + + + + Meta+D + + + + + &Add File + &Добавить файл + + + + F + + + + + &Add Directory + &Добавить директорию + + + + D + + + + + &Add Url + &Добавить URL + + + + U + + + + + &Remove Selected + &Удалить выделенное + + + + Del + + + + + &Remove All + &Удалить вÑÑ‘ + + + + &Remove Unselected + &Удалить невыделенное + + + + Remove unavailable files + Удалить недоÑтупные файлы + + + + Remove duplicates + Удалить дубликаты + + + + &Queue Toggle + &Ð’ очередь + + + + Q + + + + + Invert Selection + Инвертировать выделение + + + + &Select None + &СнÑть выделение + + + + &Select All + &Выделить вÑÑ‘ + + + + Ctrl+A + + + + + &View Track Details + &Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ + + + + Alt+I + + + + + &New List + &Ðовый ÑпиÑок + + + + Ctrl+T + + + + + &Delete List + &Удалить ÑпиÑок + + + + Ctrl+W + + + + + &Load List + &Загрузить ÑпиÑок + + + + O + + + + + &Save List + &Сохранить ÑпиÑок + + + + Shift+S + + + + + &Select Next Playlist + &Выбрать Ñледующий ÑпиÑок + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + &Выбрать предыдущий ÑпиÑок + + + + Ctrl+PgUp + + + + + &Show Playlists + &Показать ÑпиÑки + + + + P + + + + + &Settings + &ÐаÑтройки + + + + Ctrl+P + + + + + &About + &О программе + + + + &About Qt + &О библиотеке Qt + + + + &Exit + &Выход + + + + Ctrl+Q + + + + + AddUrlDialog + + + Error + Ошибка + + + + Enter URL to add + Введите Ð°Ð´Ñ€ÐµÑ Ð´Ð»Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ + + + + &Add + &Добавить + + + + &Cancel + &Отмена + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Перейти к Ñледующему фрагменту + + + + Skip backwards in playlist + Перейти к предыдущему фрагменту + + + + Start playing current song + ВоÑпроизвеÑти текущую пеÑню + + + + Don't clear the playlist + Ðе очищать лиÑÑ‚ + + + + Pause current song + ПриоÑтановить текущую пеÑню + + + + Pause if playing, play otherwise + ПриоÑтановить/воÑпроизвеÑти + + + + Stop current song + ОÑтановить текущую пеÑню + + + + Display Jump to File dialog + Показать диалог перехода к файлу + + + + Quit application + Завершить приложение + + + + Set playback volume (example: qmmp --volume 20) + УÑтановить громкоÑть (пример: qmmp --volume 20) + + + + Show/hide application + Показать/Ñкрыть приложение + + + + Display Add File dialog + Показать диалог Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² + + + + Display Add Directory dialog + Показать диалог Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ñ€Ð¸Ð¹ + + + + ConfigDialog + + + Description + ОпиÑание + + + + Filename + Ð˜Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° + + + + Artist + ИÑполнитель + + + + + Album + Ðльбом + + + + Track + Дорожка + + + + Disabled + Отключено + + + + Transports + ТранÑпорты + + + + Decoders + Декодеры + + + + Engines + Внешние проигрыватели + + + + Misc + Другие + + + + Title + Ðазвание + + + + Track number + Ðомер трека + + + + Two-digit track number + 2-x разрÑдный номер трека + + + + Disc number + Ðомер диÑка + + + + Condition + УÑловие + + + + Genre + Жанр + + + + Composer + Композитор + + + + File name + Ð˜Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° + + + + File path + Путь к файлу + + + + Year + Год + + + + Comment + Комментарий + + + + Qmmp Settings + ÐаÑтройки Qmmp + + + + Skins + Обложки + + + + Fonts + Шрифты + + + + Player: + Плеер: + + + + Playlist: + СпиÑок: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Метаданные + + + + Load metadata from files + Считывать метаданные из файлов + + + + Song Display + СпиÑок пеÑен + + + + Title format: + Формат названиÑ: + + + + + Preferences + ÐаÑтройки + + + + + + Information + Ð˜Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ + + + + Appearance + Внешний вид + + + + + + Playlist + СпиÑок + + + + Plugins + Модули + + + + Advanced + Дополнительно + + + + 16-bit output + 16-битный вывод + + + + Archived skin + Ð£Ð¿Ð°ÐºÐ¾Ð²Ð°Ð½Ð½Ð°Ñ Ñ‚ÐµÐ¼Ð° + + + + Unarchived skin + РаÑÐ¿Ð°ÐºÐ¾Ð²Ð°Ð½Ð½Ð°Ñ Ñ‚ÐµÐ¼Ð° + + + + Connectivity + Сеть + + + + Visualization + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ + + + + Effects + Эффекты + + + + General + Общие + + + + File Dialog + Файловый диалог + + + + + Audio + Ðудио + + + + Replay Gain + Выравнивание громкоÑти (Replay Gain) + + + + Miscellaneous + Разное + + + + Use bitmap font if available + ИÑпользовать раÑтровые шрифты, еÑли возможно + + + + Use skin cursors + ИÑпользовать вÑтроенные курÑоры + + + + Show song numbers + Показывать номера пеÑен + + + + Show playlists + Показывать ÑпиÑки воÑÐ¿Ñ€Ð¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ + + + + Show popup information + Показывать вÑплывающее окно Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸ÐµÐ¹ + + + + Replay Gain mode: + Режим Replay Gain: + + + + Preamp: + ПредуÑиление: + + + + + dB + дБ + + + + Default gain: + УÑиление по умолчанию: + + + + Use peak info to prevent clipping + ИÑпользовать пиковое значение Ð´Ð»Ñ Ð¿Ñ€ÐµÐ´Ð¾Ñ‚Ð²Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ ÑÑ€ÐµÐ·Ð°Ð½Ð¸Ñ + + + + Output: + Вывод: + + + + Buffer size: + Размер буфера: + + + + ms + Ð¼Ñ + + + + Use software volume control + ИÑпользовать программную регулировку громкоÑти + + + + + View + Вид + + + + Shortcuts + Ð¡Ð¾Ñ‡ÐµÑ‚Ð°Ð½Ð¸Ñ ÐºÐ»Ð°Ð²Ð¸Ñˆ + + + + Hide on close + Скрывать при закрытии + + + + Start hidden + ЗапуÑкать Ñкрытым + + + + Edit template + Редактировать шаблон + + + + Show anchor + Показывать "Ñкорь" + + + + Align song numbers + Выравнивать номера фрагментов + + + + Cover Image Retrieve + ПоиÑк обложки альбома + + + + Use separate image files + ИÑпользовать отдельные файлы Ñ Ð¸Ð·Ð¾Ð±Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñми + + + + Include files: + Включить файлы: + + + + Exclude files: + ИÑключить файлы: + + + + Recursive search depth: + Глубина рекурÑивного поиÑка: + + + + + Playback + ВоÑпроизведение + + + + Continue playback on startup + Продолжить воÑпроизведение поÑле запуÑка + + + + Proxy + ПрокÑи + + + + Enable proxy usage + ИÑпользовать прокÑи + + + + Proxy host name: + ПрокÑи Ñервер: + + + + Proxy port: + ПрокÑи порт: + + + + Use authentication with proxy + ИÑпользовать авторизацию на прокÑи + + + + Proxy user name: + Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¿Ñ€Ð¾ÐºÑи: + + + + Proxy password: + Пароль прокÑи: + + + + Action + ДейÑтвие + + + + Shortcut + Сочетание клавиш + + + + Change shortcut... + Изменить Ñочетание клавиш... + + + + Convert underscores to blanks + Преобразовывать подчёркивание в пробел + + + + Convert %20 to blanks + Преобразовывать %20 в пробел + + + + Select Skin Files + Выберите файлы обложек + + + + Skin files + Файлы обложек + + + + Add... + Добавить... + + + + Refresh + Обновить + + + + Show protocol + Показывать протокол + + + + Transparency + ПрозрачноÑть + + + + Main window + Главное окно + + + + + + 0 + 0 + + + + Equalizer + Эквалайзер + + + + EqWidget + + + + preset + предуÑтановка + + + + &Load/Delete + &Загрузить/Удалить + + + + &Save Preset + &Сохранить предуÑтановку + + + + &Save Auto-load Preset + &Сохранить авто-предуÑтановку + + + + &Clear + &ОчиÑтить + + + + Saving Preset + Сохранение предуÑтановки + + + + Preset name: + Ð˜Ð¼Ñ Ð¿Ñ€ÐµÐ´ÑƒÑтановки: + + + + preset # + предуÑтановка # + + + + &Import + &Импортировать + + + + Equalizer + Эквалайзер + + + + Import Preset + Импорт предуÑтановки + + + + JumpToTrackDialog + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + СнÑть Ñ Ð¾Ñ‡ÐµÑ€ÐµÐ´Ð¸ + + + + + + Queue + Ð’ очередь + + + + Jump To Track + Перейти к треку + + + + Filter + Фильтр + + + + Refresh + Обновить + + + + Jump To + Перейти к + + + + MainDisplay + + + Previous + Предыдущий фрагмент + + + + Play + ВоÑпроизвеÑти + + + + Pause + ПриоÑтановить + + + + Stop + Стоп + + + + Next + Следующий фрагмент + + + + Add file + Добавить файл + + + + Equalizer + Эквалайзер + + + + Playlist + СпиÑок + + + + Repeat playlist + ПовторÑть ÑпиÑок + + + + Shuffle + Ð’ Ñлучайном порÑдке + + + + Volume + ГромкоÑть + + + + Balance + Ð‘Ð°Ð»Ð°Ð½Ñ + + + + Volume: %1% + ГромкоÑть: %1% + + + + Balance: %1% right + БаланÑ: %1% вправо + + + + Balance: %1% left + БаланÑ: %1% влево + + + + Balance: center + БаланÑ: по центру + + + + Seek to: %1 + ПоиÑк: %1 + + + + MainVisual + + + Visualization Mode + Режим визуализации + + + + Analyzer + Ðнализатор + + + + Scope + ОÑциллограф + + + + Off + Выключено + + + + Analyzer Mode + Режим анализатора + + + + Normal + Обычный + + + + Fire + Огонь + + + + Vertical Lines + Вертикальные линии + + + + Lines + Линии + + + + Bars + ПолоÑки + + + + Peaks + Пики + + + + Refresh Rate + ЧаÑтота Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ + + + + 50 fps + + + + + 25 fps + + + + + 10 fps + + + + + 5 fps + + + + + Analyzer Falloff + Падение анализатора + + + + + Slowest + Самое медленное + + + + + Slow + Медленное + + + + + Medium + Среднее + + + + + Fast + БыÑтрое + + + + + Fastest + Самое быÑтрое + + + + Peaks Falloff + Падение пиков + + + + Background + Фон + + + + Transparent + ПрозрачноÑть + + + + MainWindow + + + Choose a directory + Выберите директорию + + + + Select one or more files to open + Выберите один или неÑколько файлов + + + + &Jump To File + &Перейти к файлу + + + + J + + + + + View + Вид + + + + Playlist + СпиÑок + + + + Open Playlist + Открыть ÑпиÑок + + + + Save Playlist + Сохранить ÑпиÑок + + + + + Playlist Files + Файлы ÑпиÑков + + + + All Supported Bitstreams + Ð’Ñе форматы + + + + Tools + Ð¡ÐµÑ€Ð²Ð¸Ñ + + + + PlayList + + + &Copy Selection To + &Копировать выделенное в + + + + Sort List + Сортировать + + + + + By Title + По названию + + + + + By Album + По альбому + + + + + By Artist + По иÑполнителю + + + + + By Filename + По имени файла + + + + + By Path + Filename + По пути и файлу + + + + + By Date + По дате + + + + Sort Selection + Сортировать выделенное + + + + Randomize List + Перемешать + + + + Reverse List + Перевернуть + + + + &New PlayList + &Ðовый ÑпиÑок + + + + + By Track Number + По номеру трека + + + + Playlist + СпиÑок + + + + Actions + ДейÑÑ‚Ð²Ð¸Ñ + + + + PlayListBrowser + + + Playlist Browser + Обзор ÑпиÑков воÑÐ¿Ñ€Ð¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ + + + + New + Создать + + + + + Delete + Удалить + + + + + ... + ... + + + + Rename + Переименовать + + + + PlayListSelector + + + &Load + &Загрузить + + + + &Save As... + &Сохранить как... + + + + Rename + Переименовать + + + + &Delete + &Удалить + + + + Rename Playlist + Переименовать ÑпиÑок + + + + Playlist name: + Ð˜Ð¼Ñ ÑпиÑка: + + + + PopupSettings + + + Popup Information Settings + ÐаÑтройки вÑплывающей информации + + + + Show cover + Показывать обложку + + + + Transparency: + ПрозрачноÑть: + + + + Delay: + Задержка: + + + + ms + Ð¼Ñ + + + + Cover size: + Размер обложки: + + + + Template + Шаблон + + + + Reset + Ð¡Ð±Ñ€Ð¾Ñ + + + + Insert + Ð’Ñтавить + + + + Artist + ИÑполнитель + + + + Album + Ðльбом + + + + Title + Ðазвание + + + + Track number + Ðомер трека + + + + Two-digit track number + 2-x разрÑдный номер трека + + + + Genre + Жанр + + + + Comment + Комментарий + + + + Composer + Композитор + + + + Duration + ДлительноÑть + + + + Disc number + Ðомер диÑка + + + + File name + Ð˜Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° + + + + File path + Путь к файлу + + + + Year + Год + + + + Condition + УÑловие + + + + PresetEditor + + + Preset Editor + Редактор предуÑтановок + + + + Load + Загрузить + + + + Delete + Удалить + + + + Preset + ПредуÑтановка + + + + Auto-preset + Ðвто-предуÑтановка + + + + QMMPStarter + + + Usage: qmmp [options] [files] + ИÑпользование: qmmp [options] [files] + + + + Options: + Опции: + + + + Don't start the application + Ðе запуÑкать приложение + + + + Print version number and exit + Показать верÑии и выйти + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Идеи, иÑправлениÑ, отчёты об ошибках: forkotov02@hotmail.ru + + + + Display this text and exit + Показать Ñтот текÑÑ‚ и выйти + + + + Unknown command + ÐеизвеÑÑ‚Ð½Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð° + + + + QMMP version: + ВерÑÐ¸Ñ QMMP: + + + + Qt version: + ВерÑÐ¸Ñ Qt: + + + + ShortcutDialog + + + Change Shortcut + Изменить Ñочетание клавиш + + + + Press the key combination you want to assign + Ðажмите клавиши, Ñочетание которых вы хотите иÑпользовать + + + + Clear + ОчиÑтить + + + + TextScroller + + + Autoscroll Songname + Ðвтопрокрутка Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð¿ÐµÑни + + + + Buffering: %1% + БуферизациÑ: %1% + + + + VisualMenu + + + Visualization + Ð’Ð¸Ð·ÑƒÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_sk.ts b/src/plugins/Ui/skinned/translations/qmmp_sk.ts new file mode 100644 index 000000000..9351796c9 --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_sk.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + O Qmmp + + + + About + O progarme + + + + Authors + Autori + + + + Thanks To + PoÄakovanie + + + + License Agreement + Licencia + + + + :/txt/authors_en.txt + :/txt/authors_sk.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_sk.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt-based Multimedia Player (Qmmp) + + + + Version: + Verzia: + + + + :txt/description_en.txt + :txt/description_sk.txt + + + + Input plugins: + Vstupné moduly: + + + + Output plugins: + Výstupné moduly: + + + + Visual plugins: + VizualizaÄné moduly: + + + + Effect plugins: + Moduly efektov: + + + + General plugins: + VÅ¡ebecné moduly: + + + + Translators + Prekladatelia + + + + :/txt/translators_en.txt + :/txt/translators_sk.txt + + + + ActionManager + + + &Play + &HraÅ¥ + + + + X + X + + + + &Pause + &PozastaviÅ¥ + + + + C + C + + + + &Stop + Za&staviÅ¥ + + + + V + V + + + + &Previous + &Predchádzajúca + + + + Z + Z + + + + &Next + &Nasledujúca + + + + B + B + + + + &Play/Pause + &HraÅ¥/PozastaviÅ¥ + + + + Space + Medzerník + + + + &Jump to File + P&resjoÄiÅ¥ na súbor + + + + J + J + + + + &Repeat Playlist + &OpakovaÅ¥ playlist + + + + R + R + + + + &Repeat Track + &OpakovaÅ¥ skladbu + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + &ZamieÅ¡aÅ¥ + + + + S + S + + + + &No Playlist Advance + &NepokroÄilý playlist + + + + Ctrl+N + Ctrl+N + + + + &Stop After Selected + &ZastaviÅ¥ po vybranej + + + + Ctrl+S + Ctrl+S + + + + &Clear Queue + &VyÄistiÅ¥ rad + + + + Alt+Q + Alt+Q + + + + Show Playlist + UkázaÅ¥ playlist + + + + Alt+E + Alt+E + + + + Show Equalizer + UkázaÅ¥ ekvalizér + + + + Alt+G + Alt+G + + + + Always on Top + Vždy na vrchu + + + + Put on All Workspaces + DaÅ¥ na vÅ¡etky plochy + + + + Double Size + Dvojitá veľkosÅ¥ + + + + Meta+D + Meta+D + + + + &Add File + &PridaÅ¥ súbor + + + + F + F + + + + &Add Directory + &PridaÅ¥ prieÄinok + + + + D + D + + + + &Add Url + &PridaÅ¥ URL + + + + U + U + + + + &Remove Selected + Odst&rániÅ¥ vybraté + + + + Del + Del + + + + &Remove All + Odst&rániÅ¥ vÅ¡etko + + + + &Remove Unselected + Odst&rániÅ¥ nevybraté + + + + Remove unavailable files + OdstrániÅ¥ nedostupné súbory + + + + Remove duplicates + OdstrániÅ¥ duplikáty + + + + &Queue Toggle + &ZaradiÅ¥ prepínanie + + + + Q + Q + + + + Invert Selection + InvertovaÅ¥ výber + + + + &Select None + ZruÅ¡iÅ¥ &výber + + + + &Select All + &VybraÅ¥ vÅ¡etko + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &ZobraziÅ¥ detaily o skladbe + + + + Alt+I + Alt+I + + + + &New List + &Nový zoznam + + + + Ctrl+T + Ctrl+T + + + + &Delete List + &VymazaÅ¥ zoznam + + + + Ctrl+W + Ctrl+W + + + + &Load List + &NaÄítaÅ¥ zoznam + + + + O + O + + + + &Save List + &UložiÅ¥ zoznam + + + + Shift+S + Shift+S + + + + &Select Next Playlist + &VybraÅ¥ nasledujúci playlist + + + + Ctrl+PgDown + Ctrl+Page Down + + + + &Select Previous Playlist + &VybraÅ¥ predchádzajúci playlist + + + + Ctrl+PgUp + Ctrl+Page Up + + + + &Show Playlists + &kázaÅ¥ playlisty + + + + P + P + + + + &Settings + Na&stavenia + + + + Ctrl+P + Ctrl+P + + + + &About + O progr&ame + + + + &About Qt + &O Qt + + + + &Exit + &UkonÄiÅ¥ + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Enter URL to add + PridaÅ¥ URL + + + + Error + Chyba + + + + &Add + Prid&aÅ¥ + + + + &Cancel + &ZruÅ¡iÅ¥ + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Posunúť sa v plaliste + + + + Skip backwards in playlist + VrátiÅ¥ sa v playliste + + + + Start playing current song + ZaÄaÅ¥ prehrávanie súÄasnej piesne + + + + Don't clear the playlist + NevyÄisÅ¥ovaÅ¥ playlist + + + + Pause current song + PozastaviÅ¥ súÄasnú pieseň + + + + Pause if playing, play otherwise + PozastaviÅ¥ ak hrá, inak hraÅ¥ + + + + Stop current song + ZastaviÅ¥ súÄasnú pieseň + + + + Display Jump to File dialog + ZobraziÅ¥ dialóg PreskoÄiÅ¥ na súbor + + + + Quit application + UkonÄiÅ¥ program + + + + Set playback volume (example: qmmp --volume 20) + NastaviÅ¥ hlasitosÅ¥ prehrávania (napríklad: qmmp --volume 20) + + + + Show/hide application + ZobraziÅ¥/skryÅ¥ program + + + + Display Add File dialog + ZobraziÅ¥ dialóg PridaÅ¥ súbor + + + + Display Add Directory dialog + ZobraziÅ¥ dialóg PridaÅ¥ prieÄinok + + + + ConfigDialog + + + Description + Popis + + + + Filename + Názov súboru + + + + Artist + Interprét + + + + + Album + Album + + + + Track + Skladba + + + + Disabled + Zakázané + + + + Transports + Protokoly + + + + Decoders + Dekodéry + + + + Engines + PrehrávaÄe + + + + Misc + Rôzn. + + + + Title + Názov + + + + Track number + Číslo skladby + + + + Two-digit track number + Dvojmiestne Äíslo skladby + + + + Disc number + Číslo disku + + + + Condition + Stav + + + + Composer + Skladateľ + + + + File name + Názov súboru + + + + File path + Cesta k súboru + + + + Genre + Žáner + + + + Year + Rok + + + + Comment + Poznámka + + + + Qmmp Settings + Qmmp nastavenia + + + + Appearance + Vzhľad + + + + + + Playlist + Playlist + + + + Plugins + Moduly + + + + Advanced + PokroÄilé + + + + Skins + Skiny + + + + Fonts + Písma + + + + Player: + PrehrávaÄ: + + + + Playlist: + Playlist: + + + + + ??? + ??? + + + + Replay Gain + Zisk pri prehrávaní + + + + Miscellaneous + Rôzne + + + + + + ... + ... + + + + Use bitmap font if available + PoužiÅ¥ bitmapové písmo, ak je dostupné + + + + Use skin cursors + PoužiÅ¥ kurzory zo skinu + + + + Shortcuts + Skratky + + + + Metadata + Metadáta + + + + Load metadata from files + ČítaÅ¥ metadáta zo súborov + + + + Song Display + Zobrazenie skladby + + + + Title format: + Formát titulku: + + + + Show song numbers + ZobrazovaÅ¥ Äísla piesní + + + + Show playlists + ZobrazovaÅ¥ playlisty + + + + Show popup information + ZobrazovaÅ¥ upozornenia s informáciami + + + + Show anchor + ZobrazovaÅ¥ ukotvenie + + + + Align song numbers + ZarovnaÅ¥ Äísla piesní + + + + + Preferences + Nastavenia + + + + + + Information + Informácie + + + + Cover Image Retrieve + ZískaÅ¥ obrázok obalu + + + + Use separate image files + PoužívaÅ¥ samostatné súbory obrázkov + + + + Include files: + Zahrnúť súbory: + + + + Exclude files: + VynechaÅ¥ súbory: + + + + Recursive search depth: + Hĺbka rekurzívneho hľadania: + + + + + Playback + Prehrávanie + + + + Continue playback on startup + Pri Å¡tarte pokraÄovaÅ¥ v prehrávaní + + + + Replay Gain mode: + Režim úpravy zisku pri prehrávaní: + + + + Preamp: + Predzosilnenie: + + + + + dB + dB + + + + Default gain: + Východzý zisk: + + + + Use peak info to prevent clipping + PoužiÅ¥ informáciu o vrchole k zabráneniu orezu + + + + Output: + Výstup: + + + + Buffer size: + VeľkosÅ¥ bufferu: + + + + ms + ms + + + + 16-bit output + 16bitový výstup + + + + Action + ÄŒinnosÅ¥ + + + + Shortcut + Skratka + + + + Change shortcut... + ZmeniÅ¥ skratku... + + + + Connectivity + Pripojenie k sieti + + + + + View + Zobrazenie + + + + Edit template + UpraviÅ¥ Å¡ablónu + + + + File Dialog + Súborový dialóg + + + + Proxy + Proxy + + + + Enable proxy usage + PovoliÅ¥ používanie proxy + + + + Proxy host name: + Adresa proxy: + + + + Proxy port: + Port proxy: + + + + Use authentication with proxy + PoužiÅ¥ autentifikáciu s proxy + + + + Proxy user name: + Proxy použivateľské meno: + + + + Proxy password: + Proxy heslo: + + + + Archived skin + Archivovaný skin + + + + Unarchived skin + Nearchivovaný skin + + + + Visualization + Vizualizácie + + + + Effects + Efekty + + + + General + VÅ¡eobecné + + + + + Audio + Zvuk + + + + Use software volume control + PoužívaÅ¥ softwarové ovládanie hlasitosti + + + + Hide on close + SkryÅ¥ pri zatvorení + + + + Start hidden + SpustiÅ¥ skryté + + + + Convert underscores to blanks + PreviesÅ¥ podÄiarknutia na medzery + + + + Convert %20 to blanks + PreviesÅ¥ %20 na mdezery + + + + Select Skin Files + VybraÅ¥ súbory skinov + + + + Skin files + Súbory skinov + + + + Add... + PridaÅ¥... + + + + Refresh + ObnoviÅ¥ + + + + Show protocol + ZobraziÅ¥ protokol + + + + Transparency + PriehľadnosÅ¥ + + + + Main window + Hlavné okno + + + + + + 0 + 0 + + + + Equalizer + Ekvalizér + + + + EqWidget + + + Equalizer + Ekvalizér + + + + + preset + pÅ™edvolba + + + + &Load/Delete + &NaÄíst/Odstranit + + + + &Save Preset + &Uložit pÅ™edvolbu + + + + &Save Auto-load Preset + Uložit &automatickou pÅ™edvolbu + + + + &Import + &Importovat + + + + &Clear + &Vynulovat + + + + Saving Preset + Uložení pÅ™edvolby + + + + Preset name: + Název pÅ™edvolby: + + + + preset # + pÅ™edvolba # + + + + Import Preset + Importovat pÅ™edvolbu + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + F5 + + + + + Unqueue + VyradiÅ¥ + + + + + + Queue + ZaradiÅ¥ + + + + Jump To Track + PreskoÄiÅ¥ na skladbu + + + + Filter + Filter + + + + Refresh + ObnoviÅ¥ + + + + Jump To + PreskoÄiÅ¥ na + + + + MainDisplay + + + Previous + Predchádzajúca + + + + Play + HraÅ¥ + + + + Pause + PozastaviÅ¥ + + + + Stop + ZastaviÅ¥ + + + + Next + Nasledujúca + + + + Add file + PridaÅ¥ súbor + + + + Equalizer + Ekvalizér + + + + Playlist + Playlist + + + + Repeat playlist + OpakovaÅ¥ playlist + + + + Shuffle + ZamieÅ¡aÅ¥ + + + + Volume + HlasitosÅ¥ + + + + Balance + Vyváženie + + + + Volume: %1% + HlasitosÅ¥: %1% + + + + Balance: %1% right + Vyváženie: %1% vpravo + + + + Balance: %1% left + Vyváženie: %1% vľavo + + + + Balance: center + Vyváženie: stred + + + + Seek to: %1 + PretoÄiÅ¥ na: %1 + + + + MainVisual + + + Visualization Mode + Režim vizualizácií + + + + Analyzer + Analyzér + + + + Scope + Osciloskop + + + + Off + Vypnuté + + + + Analyzer Mode + Režim analyzéra + + + + Normal + Normálny + + + + Fire + Oheň + + + + Vertical Lines + Stĺpce + + + + Lines + ÄŒiary + + + + Bars + Prúžky + + + + Peaks + Å piÄky + + + + Refresh Rate + Obnovovacia frekvencia + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Pokles analyzéra + + + + + Slowest + NajpomaljÅ¡ie + + + + + Slow + Pomaly + + + + + Medium + Stredne + + + + + Fast + Rýchlo + + + + + Fastest + NajrýchlejÅ¡ie + + + + Peaks Falloff + Pokles Å¡piÄiek + + + + Background + Pozadie + + + + Transparent + Priehľadné + + + + MainWindow + + + Choose a directory + Vyberte prieÄinok + + + + Select one or more files to open + Vyberte jeden alebo viac súborov na otvorenie + + + + &Jump To File + &PreskoÄiÅ¥ na súbor + + + + J + J + + + + View + ZobraziÅ¥ + + + + Playlist + Playlist + + + + + Playlist Files + Súbory playlistov + + + + Open Playlist + OtvoriÅ¥ playlist + + + + Save Playlist + UložiÅ¥ playlist + + + + All Supported Bitstreams + VÅ¡etky podporované formáty + + + + Tools + Nástroje + + + + PlayList + + + Sort List + TriediÅ¥ zoznam + + + + + By Title + Podľa názvu + + + + + By Album + Podľa albumu + + + + + By Artist + Podľa interpréta + + + + + By Filename + Podľa názvu súboru + + + + + By Path + Filename + Podľa cesty a názvu súboru + + + + + By Date + Podľa dátumu + + + + Sort Selection + PotriediÅ¥ výber + + + + Randomize List + ZamieÅ¡aÅ¥ zoznam + + + + Reverse List + OtoÄiÅ¥ zoznam + + + + &New PlayList + &Nový playlist + + + + &Copy Selection To + &SkopírovaÅ¥ výber do + + + + Playlist + Playlist + + + + + By Track Number + Podľa Äísla skladby + + + + Actions + ÄŒinnosti + + + + PlayListBrowser + + + Playlist Browser + PrehliadaÄ playlistu + + + + New + Nový + + + + + Delete + VymazaÅ¥ + + + + + ... + ... + + + + Rename + PremenovaÅ¥ + + + + PlayListSelector + + + &Load + &NaÄítaÅ¥ + + + + &Save As... + &UložiÅ¥ ako... + + + + Rename + PremenovaÅ¥ + + + + &Delete + &VymazaÅ¥ + + + + Rename Playlist + PremenovaÅ¥ playlist + + + + Playlist name: + Název playlistu: + + + + PopupSettings + + + Popup Information Settings + Nastavenie informácií v upozornení + + + + Show cover + ZobraziÅ¥ obal + + + + Transparency: + PriehľadnosÅ¥: + + + + Delay: + Oneskorenie: + + + + ms + ms + + + + Cover size: + VeľkosÅ¥ obalu: + + + + Template + Å ablóna + + + + Reset + ZresetovaÅ¥ + + + + Insert + VložiÅ¥ + + + + Artist + Interprét + + + + Album + Album + + + + Title + Názov + + + + Track number + Číslo skladby + + + + Two-digit track number + Dvojmiestne Äíslo skladby + + + + Genre + Žáner + + + + Comment + Poznámka + + + + Composer + Skladateľ + + + + Duration + Dĺžka + + + + Disc number + Číslo disku + + + + File name + Názov súboru + + + + File path + Cesta k súboru + + + + Year + Rok + + + + Condition + Stav + + + + PresetEditor + + + Preset Editor + Editor predvolieb + + + + Load + NaÄítaÅ¥ + + + + Delete + VymazaÅ¥ + + + + Preset + Predvoľba + + + + Auto-preset + Automatická predvoľba + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Použitie: qmmp [možnosti] [súbory] + + + + Options: + Možnosti: + + + + Don't start the application + Nezapnúť program + + + + Print version number and exit + VypísaÅ¥ Äíslo verzie a skonÄiÅ¥ + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Nápady, záplaty, hlásenie chýb posílejte na forkotov02@hotmail.ru (anglicky) + + + + Display this text and exit + ZobraziÅ¥ tento text a skonÄiÅ¥ + + + + Unknown command + Neznámý príkaz + + + + QMMP version: + Verzia QMMP: + + + + Qt version: + Verzia Qt: + + + + ShortcutDialog + + + Change Shortcut + ZmeniÅ¥ skratku + + + + Press the key combination you want to assign + StlaÄte klávesovú kombináciu ktorú chcete priradiÅ¥ + + + + Clear + VyÄistiÅ¥ + + + + TextScroller + + + Autoscroll Songname + Automaticky skrolovaÅ¥ názov piesne + + + + Buffering: %1% + Bufferuje sa:%1% + + + + VisualMenu + + + Visualization + Vizualizácie + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_tr.ts b/src/plugins/Ui/skinned/translations/qmmp_tr.ts new file mode 100644 index 000000000..95b5b6d3e --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_tr.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Qmmp Hakkında + + + + About + Hakkında + + + + License Agreement + Lisans AnlaÅŸması + + + + Authors + Yazarlar + + + + Thanks To + TeÅŸekkürler + + + + :/txt/authors_en.txt + :/txt/authors_tr.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_tr.txt + + + + Qt-based Multimedia Player (Qmmp) + Qt tabanlı Çokluortam Oynatıcısı (Qmmp) + + + + Version: + Sürüm: + + + + :txt/description_en.txt + :txt/description_tr.txt + + + + Input plugins: + Girdi eklentileri: + + + + Output plugins: + Çıktı eklentileri: + + + + Visual plugins: + Görsel eklentiler: + + + + Effect plugins: + Efekt eklentileri: + + + + General plugins: + Genel eklentiler: + + + + Translators + Çevirmenler + + + + :/txt/translators_en.txt + :/txt/translators_tr.txt + + + + ActionManager + + + &Play + &Çal + + + + X + X + + + + &Pause + &Duraklat + + + + C + C + + + + &Stop + &Durdur + + + + V + V + + + + &Previous + &Önceki + + + + Z + Z + + + + &Next + &Sonraki + + + + B + B + + + + &Play/Pause + &Oynat/Duraklat + + + + Space + BoÅŸluk + + + + &Jump to File + + + + + J + J + + + + &Repeat Playlist + &Çalma Listesini Yinele + + + + R + R + + + + &Repeat Track + &Parçayı Yinele + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + &Rastgele + + + + S + S + + + + &No Playlist Advance + + + + + Ctrl+N + + + + + &Stop After Selected + + + + + Ctrl+S + + + + + &Clear Queue + + + + + Alt+Q + + + + + Show Playlist + + + + + Alt+E + + + + + Show Equalizer + + + + + Alt+G + + + + + Always on Top + + + + + Put on All Workspaces + + + + + Double Size + + + + + Meta+D + + + + + &Add File + &Dosya Ekle + + + + F + F + + + + &Add Directory + &Dizin Ekle + + + + D + D + + + + &Add Url + &Url Ekle + + + + U + U + + + + &Remove Selected + &Seçileni Kaldır + + + + Del + Del + + + + &Remove All + &Hepsini Kaldır + + + + &Remove Unselected + &SeçilmemiÅŸleri Kaldır + + + + Remove unavailable files + + + + + Remove duplicates + + + + + &Queue Toggle + + + + + Q + Q + + + + Invert Selection + Seçimi Tersine Çevir + + + + &Select None + &Hiçbirini Seçme + + + + &Select All + &Tümünü Seç + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + &Parça Detaylarını Göster + + + + Alt+I + Alt+I + + + + &New List + &Yeni Liste + + + + Ctrl+T + + + + + &Delete List + + + + + Ctrl+W + + + + + &Load List + &Liste Yükle + + + + O + O + + + + &Save List + &Listeyi Kaydet + + + + Shift+S + Shift+S + + + + &Select Next Playlist + + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + + + + + Ctrl+PgUp + + + + + &Show Playlists + + + + + P + + + + + &Settings + &Ayarlar + + + + Ctrl+P + Ctrl+P + + + + &About + &Hakkında + + + + &About Qt + &Qt Hakkında + + + + &Exit + &Çıkış + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + Hata + + + + Enter URL to add + Eklenecek URL girin + + + + &Add + &Ekle + + + + &Cancel + &İptal + + + + BuiltinCommandLineOption + + + Skip forward in playlist + İleri atla + + + + Skip backwards in playlist + Geri atla + + + + Start playing current song + Mevcut ÅŸarkıyı çalmaya baÅŸla + + + + Don't clear the playlist + Çalma listesini temizleme + + + + Pause current song + Mevcut ÅŸarkıyı duraklat + + + + Pause if playing, play otherwise + Çalıyorsa duraklat, deÄŸilse oynat + + + + Stop current song + Mevcut ÅŸarkıyı durdur + + + + Display Jump to File dialog + Dosyaya atlama diyaloÄŸunu göster + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + + + + + Show/hide application + Uygulamayı göster/gizle + + + + Display Add File dialog + Dosya ekleme diyaloÄŸunu göster + + + + Display Add Directory dialog + Dizin ekleme diyaloÄŸunu göster + + + + ConfigDialog + + + Description + Açıklama + + + + Filename + Dosya adı + + + + Artist + Sanatçı + + + + + Album + Albüm + + + + Track + + + + + Disabled + + + + + Transports + + + + + Decoders + + + + + Engines + + + + + Misc + + + + + Title + BaÅŸlık + + + + Track number + + + + + Two-digit track number + + + + + Disc number + + + + + Condition + + + + + Genre + Tarz + + + + Composer + + + + + File name + + + + + File path + + + + + Year + Yıl + + + + Comment + Yorum + + + + Qmmp Settings + Qmmp Ayarları + + + + Skins + Kabuklar + + + + Fonts + Fontlar + + + + Player: + Oynatıcı: + + + + Playlist: + Çalma Listesi: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Veri bilgisi + + + + Load metadata from files + Veri bilgisini dosyadan yükle + + + + Song Display + Åžarkı Göstergesi + + + + Title format: + BaÅŸlık formatı: + + + + + Preferences + Tercihler + + + + + + Information + Bilgi + + + + Appearance + Görünüm + + + + + + Playlist + Çalma Listesi + + + + Plugins + Eklentiler + + + + Advanced + GeliÅŸmiÅŸ + + + + 16-bit output + + + + + Archived skin + ArÅŸivlenmiÅŸ kabuk + + + + Unarchived skin + ArÅŸivlenmemiÅŸ kabuk + + + + Connectivity + BaÄŸlanırlık + + + + Visualization + Görsellik + + + + Effects + Efektler + + + + General + Genel + + + + File Dialog + Dosya DiyaloÄŸu + + + + + Audio + Ses + + + + Replay Gain + + + + + Miscellaneous + + + + + Use bitmap font if available + + + + + Use skin cursors + + + + + Show song numbers + Åžarkı numaralarını göster + + + + Show playlists + + + + + Show popup information + + + + + Replay Gain mode: + + + + + Preamp: + + + + + + dB + + + + + Default gain: + + + + + Use peak info to prevent clipping + + + + + Output: + + + + + Buffer size: + + + + + ms + + + + + Use software volume control + Yazılımsal ses kontrolünü kullan + + + + + View + + + + + Shortcuts + + + + + Hide on close + Kapatınca saklan + + + + Start hidden + Gizli baÅŸlat + + + + Edit template + + + + + Show anchor + + + + + Align song numbers + + + + + Cover Image Retrieve + + + + + Use separate image files + + + + + Include files: + + + + + Exclude files: + + + + + Recursive search depth: + + + + + + Playback + + + + + Continue playback on startup + + + + + Proxy + Vekil sunucu + + + + Enable proxy usage + Vekil sunucu kullanımını etkinleÅŸtir + + + + Proxy host name: + Vekil sunucu adı: + + + + Proxy port: + Vekil sunucu portu: + + + + Use authentication with proxy + Vekil sunucu yetkilendirmesi kullan + + + + Proxy user name: + Vekil sunucu kullanıcı adı: + + + + Proxy password: + Vekil sunucu parolası: + + + + Action + + + + + Shortcut + + + + + Change shortcut... + + + + + Convert underscores to blanks + Alt çizgileri boÅŸluÄŸa çevir + + + + Convert %20 to blanks + %20 yi boÅŸluÄŸa çevir + + + + Select Skin Files + Kabuk Dosyası Seç + + + + Skin files + Kabuk dosyaları + + + + Add... + Ekle... + + + + Refresh + Yenile + + + + Show protocol + Protokolü göster + + + + Transparency + Transparanlık + + + + Main window + Ana pencere + + + + + + 0 + 0 + + + + Equalizer + Ekolayzır + + + + EqWidget + + + + preset + tanımlanmış ayar + + + + &Load/Delete + &Yükle/Sil + + + + &Save Preset + Tanımlanmış &Ayarları Kaydet + + + + &Save Auto-load Preset + &Otomatik Tanımlanmış Ayarları Kaydet + + + + &Clear + &Temizle + + + + Saving Preset + Tanımlanmış Ayarla Kaydediliyor + + + + Preset name: + Tanımlanmış ayar adı: + + + + preset # + tanımlanmış ayar # + + + + &Import + &İçe Aktar + + + + Equalizer + Ekolayzır + + + + Import Preset + Tanımlanmış Ayarları Al + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + + + + + + Unqueue + Kuyrukta DeÄŸil + + + + + + Queue + Kuyruk + + + + Jump To Track + Parçaya Git + + + + Filter + Filtre + + + + Refresh + Yenile + + + + Jump To + Git + + + + MainDisplay + + + Previous + Önceki + + + + Play + Oynat + + + + Pause + Duraklat + + + + Stop + Durdur + + + + Next + Sonraki + + + + Add file + Dosya ekle + + + + Equalizer + Ekolayzır + + + + Playlist + Çalma Listesi + + + + Repeat playlist + Çalma Listesini Yinele + + + + Shuffle + Rastgele + + + + Volume + Ses + + + + Balance + Denge + + + + Volume: %1% + + + + + Balance: %1% right + + + + + Balance: %1% left + + + + + Balance: center + + + + + Seek to: %1 + + + + + MainVisual + + + Visualization Mode + GörselleÅŸtirme Modu + + + + Analyzer + Çözümleyici + + + + Scope + Kapsam + + + + Off + Kapat + + + + Analyzer Mode + Çözümleyici Modu + + + + Normal + Normal + + + + Fire + AteÅŸ + + + + Vertical Lines + Dikey Satırlar + + + + Lines + Satırlar + + + + Bars + Çubuklar + + + + Peaks + Tepeler + + + + Refresh Rate + Tazeleme Oranı + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + Çözümleyici Düşüşü + + + + + Slowest + En yavaÅŸ + + + + + Slow + YavaÅŸ + + + + + Medium + Orta + + + + + Fast + Hızlı + + + + + Fastest + En hızlı + + + + Peaks Falloff + Tepe Düşüşü + + + + Background + Arkaplan + + + + Transparent + Transparan + + + + MainWindow + + + Choose a directory + Bir dizin seçin + + + + Select one or more files to open + Açmak için bir yada daha çok dosya seçin + + + + &Jump To File + &Parçaya Git + + + + J + J + + + + View + + + + + Playlist + Çalma Listesi + + + + Open Playlist + Çalma Listesini Aç + + + + Save Playlist + Çalma Listesini Kaydet + + + + + Playlist Files + Çalma Listesi Dosyaları + + + + All Supported Bitstreams + Tüm Desteklenen Bitstreamler + + + + Tools + Araçlar + + + + PlayList + + + &Copy Selection To + + + + + Sort List + Listeyi Sınıflandır + + + + + By Title + BaÅŸlığa Göre + + + + + By Album + + + + + + By Artist + + + + + + By Filename + Dosya Adına Göre + + + + + By Path + Filename + Dosya Yolu + Dosya Adına Göre + + + + + By Date + Tarihe Göre + + + + Sort Selection + Seçilenleri Sınıflandır + + + + Randomize List + Rastgele Listele + + + + Reverse List + Listeyi Ters Çevir + + + + &New PlayList + + + + + + By Track Number + Parça Numarasına Göre + + + + Playlist + Çalma Listesi + + + + Actions + Eylemler + + + + PlayListBrowser + + + Playlist Browser + + + + + New + + + + + + Delete + Sil + + + + + ... + ... + + + + Rename + + + + + PlayListSelector + + + &Load + + + + + &Save As... + + + + + Rename + + + + + &Delete + + + + + Rename Playlist + + + + + Playlist name: + + + + + PopupSettings + + + Popup Information Settings + + + + + Show cover + + + + + Transparency: + + + + + Delay: + + + + + ms + + + + + Cover size: + + + + + Template + + + + + Reset + + + + + Insert + + + + + Artist + Sanatçı + + + + Album + Albüm + + + + Title + BaÅŸlık + + + + Track number + + + + + Two-digit track number + + + + + Genre + Tarz + + + + Comment + Yorum + + + + Composer + + + + + Duration + + + + + Disc number + + + + + File name + + + + + File path + + + + + Year + Yıl + + + + Condition + + + + + PresetEditor + + + Preset Editor + Tanımlanmış Ayar Düzenleyici + + + + Load + Yükle + + + + Delete + Sil + + + + Preset + Tanımlanmış Ayar + + + + Auto-preset + Ayarları Otomatik Tanımla + + + + QMMPStarter + + + Usage: qmmp [options] [files] + Kullanım:qmmp [seçenek] [dosyalar] + + + + Options: + Seçenekler: + + + + Don't start the application + + + + + Print version number and exit + Sürüm numarasını yazdır ve çık + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Fikirleinizi, yamalarınızı, hata raporlarınızı forkotov02@hotmail.ru adresine gönderin + + + + Display this text and exit + Bu metni göster ve çık + + + + Unknown command + + + + + QMMP version: + QMMP sürümü: + + + + Qt version: + Qt sürümü: + + + + ShortcutDialog + + + Change Shortcut + + + + + Press the key combination you want to assign + + + + + Clear + + + + + TextScroller + + + Autoscroll Songname + Åžarkı Adını Otomatik Kaydır + + + + Buffering: %1% + + + + + VisualMenu + + + Visualization + Görüntüleme + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_uk_UA.ts b/src/plugins/Ui/skinned/translations/qmmp_uk_UA.ts new file mode 100644 index 000000000..dd627de1b --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_uk_UA.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + Про Qmmp + + + + About + Про програму + + + + License Agreement + Ð›Ñ–Ñ†ÐµÐ½Ð·Ñ–Ñ + + + + Authors + Ðвтори + + + + Thanks To + ПодÑки + + + + :/txt/authors_en.txt + :/txt/authors_uk_UA.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_uk_UA.txt + + + + Qt-based Multimedia Player (Qmmp) + Мультимедійний програвач на базі Qt (Qmmp) + + + + Version: + ВерÑÑ–Ñ: + + + + :txt/description_en.txt + :txt/description_uk_UA.txt + + + + Input plugins: + Модулі введеннÑ: + + + + Output plugins: + Модулі виведеннÑ: + + + + Visual plugins: + Модулі візуалізації: + + + + Effect plugins: + Модулі ефектів: + + + + General plugins: + Загальні модулі: + + + + Translators + Перекладачі + + + + :/txt/translators_en.txt + :/txt/translators_uk_UA.txt + + + + ActionManager + + + &Play + &Відтворити + + + + X + + + + + &Pause + &Пауза + + + + C + + + + + &Stop + &Стоп + + + + V + + + + + &Previous + &Ðазад + + + + Z + + + + + &Next + &Вперед + + + + B + + + + + &Play/Pause + &Грати/Пауза + + + + Space + + + + + &Jump to File + &Перейти до файлу + + + + J + + + + + &Repeat Playlist + &Повторити ÑпиÑок + + + + R + + + + + &Repeat Track + &Повторити трек + + + + Ctrl+R + + + + + &Shuffle + &Перемішати + + + + S + + + + + &No Playlist Advance + &Ðе переÑуватиÑÑ Ð¿Ð¾ ÑпиÑку + + + + Ctrl+N + + + + + &Stop After Selected + &Зупинити піÑÐ»Ñ Ð²Ð¸Ð±Ñ€Ð°Ð½Ð¾Ð³Ð¾ + + + + Ctrl+S + + + + + &Clear Queue + &ОчиÑтити чергу + + + + Alt+Q + + + + + Show Playlist + Показати ÑпиÑок + + + + Alt+E + + + + + Show Equalizer + Показати еквалайзер + + + + Alt+G + + + + + Always on Top + Завжди зверху + + + + Put on All Workspaces + РозміÑтити на уÑÑ–Ñ… робочих Ñтолах + + + + Double Size + Подвійний розмір + + + + Meta+D + + + + + &Add File + &Додати файл + + + + F + + + + + &Add Directory + &Додати теку + + + + D + + + + + &Add Url + &Додати адреÑу + + + + U + + + + + &Remove Selected + &Видалити вибране + + + + Del + + + + + &Remove All + &Видалити вÑе + + + + &Remove Unselected + &Видалити не вибране + + + + Remove unavailable files + Видалити недоÑтупні файли + + + + Remove duplicates + Видалити дублікати + + + + &Queue Toggle + &Ð’ чергу + + + + Q + + + + + Invert Selection + Інвертувати вибране + + + + &Select None + &ЗнÑти Ð²Ð¸Ð´Ñ–Ð»ÐµÐ½Ð½Ñ + + + + &Select All + &Вибрати вÑе + + + + Ctrl+A + + + + + &View Track Details + &Ð†Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ + + + + Alt+I + + + + + &New List + &Ðовий ÑпиÑок + + + + Ctrl+T + + + + + &Delete List + &Видалити ÑпиÑок + + + + Ctrl+W + + + + + &Load List + &Завантажити ÑпиÑок + + + + O + + + + + &Save List + &Зберегти ÑпиÑок + + + + Shift+S + + + + + &Select Next Playlist + Вибрати &наÑтупний ÑпиÑок + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + Вибрати &попередній ÑпиÑок + + + + Ctrl+PgUp + + + + + &Show Playlists + Показати &вÑÑ– ÑпиÑки + + + + P + + + + + &Settings + &ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + Ctrl+P + + + + + &About + &Про програму + + + + &About Qt + &Про Qt + + + + &Exit + &Вихід + + + + Ctrl+Q + + + + + AddUrlDialog + + + Error + Помилка + + + + Enter URL to add + Вкажіть адреÑу Ð´Ð»Ñ Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ + + + + &Add + &Додати + + + + &Cancel + &Відміна + + + + BuiltinCommandLineOption + + + Skip forward in playlist + Перейти до наÑтупного фрагменту + + + + Skip backwards in playlist + Перейти до попереднього фрагменту + + + + Start playing current song + Грати поточну піÑню + + + + Don't clear the playlist + Ðе очищати ÑпиÑок + + + + Pause current song + Призупитини поточну піÑню + + + + Pause if playing, play otherwise + Призупинити/відтворити + + + + Stop current song + Зупитини поточну піÑню + + + + Display Jump to File dialog + Показати діалог переходу до файла + + + + Quit application + Закрити програму + + + + Set playback volume (example: qmmp --volume 20) + Ð’Ñтановити гучніÑть (приклад: qmmp --volume 20) + + + + Show/hide application + Показати/Ñховати програму + + + + Display Add File dialog + Показати діалог Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² + + + + Display Add Directory dialog + Показати діалог Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ Ñ‚ÐµÐº + + + + ConfigDialog + + + Description + ПоÑÑÐ½ÐµÐ½Ð½Ñ + + + + Filename + Ім'Ñ Ñ„Ð°Ð¹Ð»Ñƒ + + + + Artist + Виконавець + + + + + Album + Ðльбом + + + + Track + Трек + + + + Disabled + Вимкнено + + + + Transports + ТранÑпорти + + + + Decoders + Декодери + + + + Engines + Зовнішні програвачі + + + + Misc + Інші + + + + Title + Ðазва + + + + Track number + Ðомер треку + + + + Two-digit track number + 2- розрÑдний номер трека + + + + Disc number + Ðомер диÑку + + + + Condition + Умова + + + + Genre + Жанр + + + + Composer + Композитор + + + + File name + Ім'Ñ Ñ„Ð°Ð¹Ð»Ñƒ + + + + File path + ШлÑÑ… файлу + + + + Year + Рік + + + + Comment + Коментар + + + + Qmmp Settings + ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Qmmp + + + + Skins + Шкурки + + + + Fonts + Шрифти + + + + Player: + Програвач: + + + + Playlist: + СпиÑок: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + Метадані + + + + Load metadata from files + Зчитувати метадані з файлів + + + + Song Display + СпиÑок піÑень + + + + Title format: + Формат назви: + + + + + Preferences + ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + + + Information + Ð†Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ñ–Ñ + + + + Appearance + Зовнішній виглÑд + + + + + + Playlist + СпиÑок + + + + Plugins + Модулі + + + + Advanced + Додатково + + + + 16-bit output + 16-бітний вивід + + + + Archived skin + Упакована тема + + + + Unarchived skin + Розпакована тема + + + + Connectivity + Мережа + + + + Visualization + Ð’Ñ–Ð·ÑƒÐ°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ + + + + Effects + Ефекти + + + + General + Загальне + + + + File Dialog + Файловий діалог + + + + + Audio + Звук + + + + Replay Gain + ÐÐ¾Ñ€Ð¼Ð°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ Ð³ÑƒÑ‡Ð½Ð¾Ñті + + + + Miscellaneous + Різне + + + + Use bitmap font if available + ВикориÑтовувати раÑтрові шрифти, Ñкщо доÑтупні + + + + Use skin cursors + ВикориÑтовувати курÑори Ñкіна + + + + Show song numbers + Відображати номера піÑень + + + + Show playlists + Показати ÑпиÑки + + + + Show popup information + Показувати Ñпливаюче вікно з інформацією + + + + Replay Gain mode: + Режим нормалізації гучноÑті: + + + + Preamp: + Преамплітуда: + + + + + dB + + + + + Default gain: + ÐÐ¾Ñ€Ð¼Ð°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ Ð·Ð° умовчаннÑм: + + + + Use peak info to prevent clipping + ВикориÑтовувати інформацію піків Ð´Ð»Ñ Ð·Ð°Ð¿Ð¾Ð±Ñ–Ð³Ð°Ð½Ð½Ñ Ð²Ñ–Ð´ÑÑ–ÐºÐ°Ð½Ð½Ñ + + + + Output: + ВиведеннÑ: + + + + Buffer size: + Розмір буферу: + + + + ms + Ð¼Ñ + + + + Use software volume control + ВикориÑтовувати програмний контроль гучноÑті + + + + + View + ВиглÑд + + + + Shortcuts + Комбінації клавіш + + + + Hide on close + Ховати при закритті + + + + Start hidden + ЗапуÑкати Ñхованим + + + + Edit template + Редагувати шаблон + + + + Show anchor + Показувати "Ñкір" + + + + Align song numbers + Вирівнювати номери фрагментів + + + + Cover Image Retrieve + Пошук обладинки альбома + + + + Use separate image files + ВикориÑтовувати окремі файли зображень + + + + Include files: + Включити файли: + + + + Exclude files: + Виключити файли: + + + + Recursive search depth: + Глибина рекурÑивного пошуку: + + + + + Playback + Ð’Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ + + + + Continue playback on startup + Продовжити Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¸ запуÑку + + + + Proxy + ПрокÑÑ– + + + + Enable proxy usage + ВикориÑтоÑувати прокÑÑ– + + + + Proxy host name: + Сервер прокÑÑ–: + + + + Proxy port: + Порт прокÑÑ–: + + + + Use authentication with proxy + ВикориÑтовувати авторизацію на прокÑÑ– + + + + Proxy user name: + Ім'Ñ ÐºÐ¾Ñ€Ð¸Ñтвача прокÑÑ–: + + + + Proxy password: + Пароль прокÑÑ–: + + + + Action + Ð”Ñ–Ñ + + + + Shortcut + ÐšÐ¾Ð¼Ð±Ñ–Ð½Ð°Ñ†Ñ–Ñ + + + + Change shortcut... + Змінити комбінації клавіш... + + + + Convert underscores to blanks + Конвертувати підкреÑÐ»ÑŽÐ²Ð°Ð½Ð½Ñ Ð² пробіл + + + + Convert %20 to blanks + Конвертувати %20 в пробіл + + + + Select Skin Files + Вибрати файли Ñкінів + + + + Skin files + Файли Ñкінів + + + + Add... + Додати... + + + + Refresh + Поновити + + + + Show protocol + Показати протокол + + + + Transparency + ПрозоріÑть + + + + Main window + Головне вікно + + + + + + 0 + + + + + Equalizer + Еквалайзер + + + + EqWidget + + + + preset + предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + &Load/Delete + &Завантажити/Видалити + + + + &Save Preset + &Зберегти предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + &Save Auto-load Preset + &Зберегти авто-предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + &Clear + &ОчиÑтити + + + + Saving Preset + Збережені предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + Preset name: + Ім'Ñ Ð¿Ñ€ÐµÐ´Ð²ÑтановленнÑ: + + + + preset # + предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ # + + + + &Import + &Імпортувати + + + + Equalizer + Еквалайзер + + + + Import Preset + Імпорт предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + JumpToTrackDialog + + + Q + + + + + J + + + + + F5 + + + + + + Unqueue + ЗнÑти з черги + + + + + + Queue + Ð’ чергу + + + + Jump To Track + Перейти до треку + + + + Filter + Фильтр + + + + Refresh + Поновити + + + + Jump To + Перейти до + + + + MainDisplay + + + Previous + Ðазад + + + + Play + Відтворити + + + + Pause + Пауза + + + + Stop + Стоп + + + + Next + Вперед + + + + Add file + Додати файл + + + + Equalizer + Еквалайзер + + + + Playlist + СпиÑок + + + + Repeat playlist + Повторити ÑпиÑок + + + + Shuffle + Перемішати + + + + Volume + ГучніÑть + + + + Balance + Ð‘Ð°Ð»Ð°Ð½Ñ + + + + Volume: %1% + ГучніÑть: %1% + + + + Balance: %1% right + БаланÑ: %1% вправо + + + + Balance: %1% left + БаланÑ: %1% вліво + + + + Balance: center + БаланÑ: центр + + + + Seek to: %1 + Пошук: %1 + + + + MainVisual + + + Visualization Mode + Режим візуалізації + + + + Analyzer + Ðналізатор + + + + Scope + ОÑцилограф + + + + Off + Вимкнено + + + + Analyzer Mode + Режим аналізатора + + + + Normal + Звичайний + + + + Fire + Вогонь + + + + Vertical Lines + Вертикальні лінії + + + + Lines + Лінії + + + + Bars + Смужки + + + + Peaks + Піки + + + + Refresh Rate + ЧаÑтота Ð¾Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + 50 fps + 50 Ñ„/Ñ + + + + 25 fps + 25 Ñ„/Ñ + + + + 10 fps + 10 Ñ„/Ñ + + + + 5 fps + 5 Ñ„/Ñ + + + + Analyzer Falloff + ÐŸÐ°Ð´Ñ–Ð½Ð½Ñ Ð°Ð½Ð°Ð»Ñ–Ð·Ð°Ñ‚Ð¾Ñ€Ð° + + + + + Slowest + Ðайповільніше + + + + + Slow + Повільне + + + + + Medium + Середнє + + + + + Fast + Швидке + + + + + Fastest + Ðайшвидше + + + + Peaks Falloff + ÐŸÐ°Ð´Ñ–Ð½Ð½Ñ Ð¿Ñ–ÐºÑ–Ð² + + + + Background + Тло + + + + Transparent + ПрозоріÑть + + + + MainWindow + + + Choose a directory + Виберіть теку + + + + Select one or more files to open + Виберіть один чи кілька файлів + + + + &Jump To File + &Перейти до файлу + + + + J + + + + + View + ВиглÑд + + + + Playlist + СпиÑок + + + + Open Playlist + Відкрити ÑпиÑок + + + + Save Playlist + Зберегти ÑпиÑок + + + + + Playlist Files + Файли ÑпиÑків + + + + All Supported Bitstreams + УÑÑ– формати + + + + Tools + Утиліти + + + + PlayList + + + &Copy Selection To + &Копіювати вибране в + + + + Sort List + Сортувати + + + + + By Title + За назвою + + + + + By Album + За альбомом + + + + + By Artist + За артиÑтом + + + + + By Filename + За ім'Ñм файлу + + + + + By Path + Filename + За шлÑхом та файлом + + + + + By Date + За датою + + + + Sort Selection + Сортувати вибране + + + + Randomize List + Перемішати + + + + Reverse List + Перевернути + + + + &New PlayList + &Ðовий ÑпиÑок + + + + + By Track Number + + + + + Playlist + СпиÑок + + + + Actions + Дії + + + + PlayListBrowser + + + Playlist Browser + ПереглÑдач ÑпиÑків + + + + New + Ðовий + + + + + Delete + Видалити + + + + + ... + ... + + + + Rename + Переіменувати + + + + PlayListSelector + + + &Load + &Завантажити + + + + &Save As... + &Зберегти Ñк... + + + + Rename + Переіменувати + + + + &Delete + &Видалити + + + + Rename Playlist + Переіменувати ÑпиÑок + + + + Playlist name: + Ім'Ñ ÑпиÑка: + + + + PopupSettings + + + Popup Information Settings + ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ Ñпливаючої інформації + + + + Show cover + Показати обкладинку + + + + Transparency: + ПрозоріÑть: + + + + Delay: + Затримка: + + + + ms + Ð¼Ñ + + + + Cover size: + Розмір обкладинки: + + + + Template + Шаблон + + + + Reset + Скинути + + + + Insert + Ð’Ñтавити + + + + Artist + Виконавець + + + + Album + Ðльбом + + + + Title + Ðазва + + + + Track number + Ðомер треку + + + + Two-digit track number + 2- розрÑдний номер трека + + + + Genre + Жанр + + + + Comment + Коментар + + + + Composer + Композитор + + + + Duration + ТриваліÑть + + + + Disc number + Ðомер диÑку + + + + File name + Ім'Ñ Ñ„Ð°Ð¹Ð»Ñƒ + + + + File path + ШлÑÑ… файлу + + + + Year + Рік + + + + Condition + Умова + + + + PresetEditor + + + Preset Editor + Редактор предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + Load + Завантажити + + + + Delete + Видалити + + + + Preset + ПредвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + Auto-preset + Ðвто-предвÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð½Ñ + + + + QMMPStarter + + + Usage: qmmp [options] [files] + ВикориÑтаннÑ: qmmp [options] [files] + + + + Options: + Опції: + + + + Don't start the application + Ðе запуÑкати програму + + + + Print version number and exit + Показати верÑÑ–ÑŽ та вийти + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + Ідеї, виправленнÑ, звіти про помилки: forkotov02@hotmail.ru + + + + Display this text and exit + Показати цей текÑÑ‚ та вийти + + + + Unknown command + Ðевідома команда + + + + QMMP version: + ВерÑÑ–Ñ QMMP: + + + + Qt version: + ВерÑÑ–Ñ Qt: + + + + ShortcutDialog + + + Change Shortcut + Змінити комбінації клавіш + + + + Press the key combination you want to assign + ÐатиÑніть клавіші, комбінації Ñких ви бажаєте викориÑтовувати + + + + Clear + ОчиÑтити + + + + TextScroller + + + Autoscroll Songname + Ðвтопрокрутка назви піÑні + + + + Buffering: %1% + БуферизаціÑ: %1% + + + + VisualMenu + + + Visualization + Ð’Ñ–Ð·ÑƒÐ°Ð»Ñ–Ð·Ð°Ñ†Ñ–Ñ + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_zh_CN.ts b/src/plugins/Ui/skinned/translations/qmmp_zh_CN.ts new file mode 100644 index 000000000..b8b52ed6f --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_zh_CN.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + 关于 Qmmp + + + + About + 关于 + + + + License Agreement + 许å¯åè®® + + + + Authors + 作者 + + + + Thanks To + 感谢 + + + + :/txt/authors_en.txt + :/txt/authors_zh_CN.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_zh_CN.txt + + + + Qt-based Multimedia Player (Qmmp) + 基于 Qt 的多媒体播放器 (Qmmp) + + + + Version: + 版本: + + + + :txt/description_en.txt + :txt/description_zh_CN.txt + + + + Input plugins: + 输入æ’件: + + + + Output plugins: + 输出æ’件: + + + + Visual plugins: + å¯è§†åŒ–æ’件: + + + + Effect plugins: + 特效æ’件: + + + + General plugins: + 常规æ’件: + + + + Translators + 翻译 + + + + :/txt/translators_en.txt + :/txt/translators_zh_CN.txt + + + + ActionManager + + + &Play + 播放(&P) + + + + X + X + + + + &Pause + æš‚åœ(&P) + + + + C + C + + + + &Stop + åœæ­¢(&S) + + + + V + V + + + + &Previous + 上一曲(&P) + + + + Z + Z + + + + &Next + 下一曲(&N) + + + + B + B + + + + &Play/Pause + 播放/æš‚åœ(&P) + + + + Space + 空格 + + + + &Jump to File + 跳到文件(&J) + + + + J + J + + + + &Repeat Playlist + é‡å¤åˆ—表(&R) + + + + R + R + + + + &Repeat Track + é‡å¤éŸ³è½¨(&R) + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + ä¹±åº(&S) + + + + S + S + + + + &No Playlist Advance + 无列表继续(&N) + + + + Ctrl+N + + + + + &Stop After Selected + 已选åŽåœæ­¢(&S) + + + + Ctrl+S + + + + + &Clear Queue + 清除队列(&C) + + + + Alt+Q + + + + + Show Playlist + 显示播放列表 + + + + Alt+E + + + + + Show Equalizer + 显示å‡è¡¡å™¨ + + + + Alt+G + + + + + Always on Top + 常居顶端 + + + + Put on All Workspaces + 在所有工作区 + + + + Double Size + 两å€å¤§å° + + + + Meta+D + + + + + &Add File + 添加文件(&A) + + + + F + F + + + + &Add Directory + 添加文件夹(&A) + + + + D + D + + + + &Add Url + 添加 URL (&A) + + + + U + U + + + + &Remove Selected + 删除所选(&R) + + + + Del + Del + + + + &Remove All + 删除全部(&R) + + + + &Remove Unselected + 删除未选(&R) + + + + Remove unavailable files + 删除未选的文件 + + + + Remove duplicates + 删除é‡å¤ + + + + &Queue Toggle + 队列切æ¢(&Q) + + + + Q + Q + + + + Invert Selection + å选 + + + + &Select None + 无选择(&S) + + + + &Select All + 选择全部(&S) + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + 查看音轨详情(&V) + + + + Alt+I + Alt+I + + + + &New List + 新建列表(&N) + + + + Ctrl+T + + + + + &Delete List + 删除列表(&D) + + + + Ctrl+W + + + + + &Load List + 载入列表(&L) + + + + O + O + + + + &Save List + ä¿å­˜åˆ—表(&S) + + + + Shift+S + Shift+S + + + + &Select Next Playlist + 选择下一列表(&S) + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + 选择上一列表(&S) + + + + Ctrl+PgUp + + + + + &Show Playlists + 显示列表(&S) + + + + P + + + + + &Settings + 设置(&S) + + + + Ctrl+P + Ctrl+P + + + + &About + 关于(&A) + + + + &About Qt + 关于 Qt (&A) + + + + &Exit + 退出(&E) + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + 错误 + + + + Enter URL to add + è¾“å…¥è¦æ·»åŠ çš„ URL + + + + &Add + 添加(&A) + + + + &Cancel + å–æ¶ˆ(&C) + + + + BuiltinCommandLineOption + + + Skip forward in playlist + 跳到播放列表中的下一曲 + + + + Skip backwards in playlist + 跳到播放列表中的上一曲 + + + + Start playing current song + å¼€å§‹æ’­æ”¾å½“å‰æ›²ç›® + + + + Don't clear the playlist + ä¸è¦æ¸…除这个播放列表 + + + + Pause current song + æš‚åœå½“剿›²ç›® + + + + Pause if playing, play otherwise + 正在播放则暂åœï¼Œç›¸å处于暂åœåˆ™æ’­æ”¾ + + + + Stop current song + åœæ­¢å½“剿›²ç›® + + + + Display Jump to File dialog + æ˜¾ç¤ºè·³åˆ°æ–‡ä»¶å¯¹è¯ + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + è®¾ç½®å›žæ”¾éŸ³é‡ (例如:qmmp --volume 20) + + + + Show/hide application + 显示/éšè—ç¨‹åº + + + + Display Add File dialog + æ˜¾ç¤ºæ·»åŠ æ–‡ä»¶å¯¹è¯ + + + + Display Add Directory dialog + æ˜¾ç¤ºæ·»åŠ æ–‡ä»¶å¤¹å¯¹è¯ + + + + ConfigDialog + + + Description + æè¿° + + + + Filename + 文件å + + + + Artist + 艺术家 + + + + + Album + 专辑 + + + + Track + 音轨 + + + + Disabled + ç¦æ­¢ + + + + Transports + 传输 + + + + Decoders + è§£ç å™¨ + + + + Engines + 引擎 + + + + Misc + æ‚项 + + + + Title + 标题 + + + + Track number + éŸ³è½¨ç¼–å· + + + + Two-digit track number + 䏤使•°éŸ³è½¨ç¼–å· + + + + Disc number + å…‰ç›˜ç¼–å· + + + + Condition + æ¡ä»¶ + + + + Genre + æµæ´¾ + + + + Composer + 作曲 + + + + File name + 文件å + + + + File path + 文件路径 + + + + Year + 年代 + + + + Comment + 备注 + + + + Qmmp Settings + Qmmp 设置 + + + + Skins + 皮肤 + + + + Fonts + 字体 + + + + Player: + 播放器: + + + + Playlist: + 播放列表: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + å…ƒæ•°æ® + + + + Load metadata from files + ä»Žæ–‡ä»¶è½½å…¥å…ƒæ•°æ® + + + + Song Display + 显示歌曲 + + + + Title format: + 标题格å¼ï¼š + + + + + Preferences + 傿•°è®¾ç½® + + + + + + Information + ä¿¡æ¯ + + + + Appearance + 外观 + + + + + + Playlist + 播放列表 + + + + Plugins + æ’ä»¶ + + + + Advanced + 高级 + + + + 16-bit output + 16 ä½è¾“出 + + + + Archived skin + 压缩皮肤 + + + + Unarchived skin + 未压缩皮肤 + + + + Connectivity + 连接 + + + + Visualization + å¯è§†åŒ– + + + + Effects + 特效 + + + + General + 常规 + + + + File Dialog + æ–‡ä»¶å¯¹è¯ + + + + + Audio + 音频 + + + + Replay Gain + 回放增益 + + + + Miscellaneous + æ‚项 + + + + Use bitmap font if available + 如果å¯ç”¨ä½¿ç”¨ä½å›¾å­—体 + + + + Use skin cursors + 使用皮肤光标 + + + + Show song numbers + æ˜¾ç¤ºæ›²ç›®ç¼–å· + + + + Show playlists + 显示播放列表 + + + + Show popup information + æ˜¾ç¤ºå¼¹å‡ºä¿¡æ¯ + + + + Replay Gain mode: + 回放增益模å¼ï¼š + + + + Preamp: + å‰ç½®æ”¾å¤§å™¨ï¼š + + + + + dB + + + + + Default gain: + 默认增益: + + + + Use peak info to prevent clipping + 使用峰值信æ¯ä»¥é˜²å‰Šæ³¢ + + + + Output: + 输出: + + + + Buffer size: + 缓冲大å°ï¼š + + + + ms + + + + + Use software volume control + ä½¿ç”¨è½¯è®¾å¤‡éŸ³é‡æŽ§åˆ¶ + + + + + View + 视图 + + + + Shortcuts + å¿«æ·é”® + + + + Hide on close + 关闭时éšè— + + + + Start hidden + å¯åŠ¨æ—¶éšè— + + + + Edit template + ç¼–è¾‘æ¨¡æ¿ + + + + Show anchor + 显示主æŒäºº + + + + Align song numbers + ä¸€æ ·çš„æ›²ç›®å· + + + + Cover Image Retrieve + å°é¢å›¾åƒæ£€ç´¢ + + + + Use separate image files + 使用å•ç‹¬å›¾åƒæ–‡ä»¶ + + + + Include files: + åŒ…å«æ–‡ä»¶ï¼š + + + + Exclude files: + 排除文件: + + + + Recursive search depth: + 递归æœç´¢æ·±åº¦ï¼š + + + + + Playback + 回放 + + + + Continue playback on startup + å¯åŠ¨æ—¶ç»§ç»­ä¸Šæ¬¡æ’­æ”¾ + + + + Proxy + ä»£ç† + + + + Enable proxy usage + å¯ç”¨ä»£ç† + + + + Proxy host name: + 主机å: + + + + Proxy port: + 端å£ï¼š + + + + Use authentication with proxy + 需è¦èº«ä»½éªŒè¯ + + + + Proxy user name: + 用户å: + + + + Proxy password: + 密ç ï¼š + + + + Action + 动作 + + + + Shortcut + å¿«æ·é”® + + + + Change shortcut... + 改å˜å¿«æ·é”®... + + + + Convert underscores to blanks + 转æ¢ä¸‹åˆ’线为空格 + + + + Convert %20 to blanks + è½¬æ¢ %20 为空格 + + + + Select Skin Files + 选择皮肤文件 + + + + Skin files + 皮肤文件 + + + + Add... + 添加... + + + + Refresh + 刷新 + + + + Show protocol + 显示åè®® + + + + Transparency + 逿˜Žåº¦ + + + + Main window + ä¸»çª—å£ + + + + + + 0 + 0 + + + + Equalizer + å‡è¡¡å™¨ + + + + EqWidget + + + + preset + 预设 + + + + &Load/Delete + 载入/删除(&L) + + + + &Save Preset + ä¿å­˜é¢„设(&S) + + + + &Save Auto-load Preset + ä¿å­˜è‡ªåŠ¨è½½å…¥é¢„è®¾(&S) + + + + &Clear + 清除(&C) + + + + Saving Preset + ä¿å­˜é¢„设 + + + + Preset name: + 预设å称: + + + + preset # + 预设 # + + + + &Import + 导入(&I) + + + + Equalizer + å‡è¡¡å™¨ + + + + Import Preset + 导入预设 + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + + + + + + Unqueue + 移出队列 + + + + + + Queue + 加入队列 + + + + Jump To Track + 跳到音轨 + + + + Filter + 过滤 + + + + Refresh + 刷新 + + + + Jump To + 跳到 + + + + MainDisplay + + + Previous + 上一曲 + + + + Play + 播放 + + + + Pause + æš‚åœ + + + + Stop + åœæ­¢ + + + + Next + 下一曲 + + + + Add file + 添加文件 + + + + Equalizer + å‡è¡¡å™¨ + + + + Playlist + 播放列表 + + + + Repeat playlist + é‡å¤æ’­æ”¾åˆ—表 + + + + Shuffle + ä¹±åº + + + + Volume + éŸ³é‡ + + + + Balance + 平衡 + + + + Volume: %1% + 音é‡ï¼š%1% + + + + Balance: %1% right + 平衡:%1% å³ + + + + Balance: %1% left + 平衡:%1% å·¦ + + + + Balance: center + 平衡:置中 + + + + Seek to: %1 + 移动至:%1 + + + + MainVisual + + + Visualization Mode + å¯è§†åŒ–æ¨¡å¼ + + + + Analyzer + 分æžå™¨ + + + + Scope + 示波器 + + + + Off + 关闭 + + + + Analyzer Mode + åˆ†æžæ¨¡å¼ + + + + Normal + 标准 + + + + Fire + ç«èб + + + + Vertical Lines + 垂直线 + + + + Lines + 线形 + + + + Bars + æ¡å½¢ + + + + Peaks + 峰值 + + + + Refresh Rate + 刷新率 + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + 分æžå™¨ä¸‹é™é€Ÿåº¦ + + + + + Slowest + 最慢 + + + + + Slow + æ…¢ + + + + + Medium + 中 + + + + + Fast + å¿« + + + + + Fastest + 最快 + + + + Peaks Falloff + 峰值下é™é€Ÿåº¦ + + + + Background + 背景 + + + + Transparent + 逿˜Ž + + + + MainWindow + + + Choose a directory + 选择一个文件夹 + + + + Select one or more files to open + 选择打开一个或更多文件 + + + + &Jump To File + 跳到文件(&J) + + + + J + J + + + + View + 视图 + + + + Playlist + 播放列表 + + + + Open Playlist + 打开播放列表 + + + + Save Playlist + ä¿å­˜æ’­æ”¾åˆ—表 + + + + + Playlist Files + 播放列表文件 + + + + All Supported Bitstreams + 支æŒçš„全部文件 + + + + Tools + 工具 + + + + PlayList + + + &Copy Selection To + å¤åˆ¶é€‰æ‹©åˆ°(&C) + + + + Sort List + åˆ—è¡¨æŽ’åº + + + + + By Title + 按标题 + + + + + By Album + 按专辑 + + + + + By Artist + 按艺术家 + + + + + By Filename + 按文件å + + + + + By Path + Filename + 按路径+文件å + + + + + By Date + 按日期 + + + + Sort Selection + é€‰æ‹©æŽ’åº + + + + Randomize List + éšæœºäº§ç”Ÿåˆ—表 + + + + Reverse List + 逆åºåˆ—表 + + + + &New PlayList + 新建列表(&N) + + + + + By Track Number + 按音轨 + + + + Playlist + 播放列表 + + + + Actions + 动作 + + + + PlayListBrowser + + + Playlist Browser + 播放列表æµè§ˆ + + + + New + 新建 + + + + + Delete + 删除 + + + + + ... + ... + + + + Rename + é‡å‘½å + + + + PlayListSelector + + + &Load + 载入(&L) + + + + &Save As... + å¦å­˜ä¸º(&S) + + + + Rename + é‡å‘½å + + + + &Delete + 删除(&D) + + + + Rename Playlist + é‡å‘½å播放列表 + + + + Playlist name: + 播放列表å称: + + + + PopupSettings + + + Popup Information Settings + 弹出信æ¯è®¾ç½® + + + + Show cover + 显示å°é¢ + + + + Transparency: + 逿˜Žåº¦ï¼š + + + + Delay: + 延迟: + + + + ms + + + + + Cover size: + å°é¢å¤§å°ï¼š + + + + Template + æ¨¡æ¿ + + + + Reset + é‡è®¾ + + + + Insert + æ’å…¥ + + + + Artist + 艺术家 + + + + Album + 专辑 + + + + Title + 标题 + + + + Track number + éŸ³è½¨ç¼–å· + + + + Two-digit track number + 䏤使•°éŸ³è½¨ç¼–å· + + + + Genre + æµæ´¾ + + + + Comment + 备注 + + + + Composer + 作曲 + + + + Duration + æŒç»­æ—¶é—´ + + + + Disc number + å…‰ç›˜ç¼–å· + + + + File name + 文件å + + + + File path + 文件路径 + + + + Year + 年代 + + + + Condition + æ¡ä»¶ + + + + PresetEditor + + + Preset Editor + 预设编辑器 + + + + Load + 载入 + + + + Delete + 删除 + + + + Preset + 预设 + + + + Auto-preset + 自动预设 + + + + QMMPStarter + + + Usage: qmmp [options] [files] + 使用:qmmp [设置] [文件] + + + + Options: + 设置: + + + + Don't start the application + 无法å¯åŠ¨æ­¤ç¨‹åº + + + + Print version number and exit + 显示版本并退出 + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + 建议ã€è¡¥ä¸æˆ–æäº¤ bug 请å‘é€åˆ° forkotov02@hotmail.ru + + + + Display this text and exit + 显示这些文本并退出 + + + + Unknown command + 未知指令 + + + + QMMP version: + Qmmp 版本: + + + + Qt version: + Qt 版本: + + + + ShortcutDialog + + + Change Shortcut + 改å˜è·¯å¾„ + + + + Press the key combination you want to assign + æŒ‰ä¸‹ä½ è¦æŒ‡æ´¾çš„组åˆé”® + + + + Clear + 清除 + + + + TextScroller + + + Autoscroll Songname + 自动滚动曲目å + + + + Buffering: %1% + 缓冲:%1% + + + + VisualMenu + + + Visualization + å¯è§†åŒ– + + + diff --git a/src/plugins/Ui/skinned/translations/qmmp_zh_TW.ts b/src/plugins/Ui/skinned/translations/qmmp_zh_TW.ts new file mode 100644 index 000000000..835ab58fe --- /dev/null +++ b/src/plugins/Ui/skinned/translations/qmmp_zh_TW.ts @@ -0,0 +1,1835 @@ + + + + + AboutDialog + + + About Qmmp + 關於 Qmmp + + + + About + 關於 + + + + License Agreement + 許å¯å”定 + + + + Authors + 作者 + + + + Thanks To + æ„Ÿè¬ + + + + :/txt/authors_en.txt + :/txt/authors_zh_TW.txt + + + + :/txt/thanks_en.txt + :/txt/thanks_zh_TW.txt + + + + Qt-based Multimedia Player (Qmmp) + 基於 Qt 的多媒體播放器 (Qmmp) + + + + Version: + 版本: + + + + :txt/description_en.txt + :txt/description_zh_TW.txt + + + + Input plugins: + 匯入æ’件: + + + + Output plugins: + 匯出æ’ä»¶ + + + + Visual plugins: + å¯è¦–化æ’ä»¶ + + + + Effect plugins: + 特效æ’件: + + + + General plugins: + å¸¸è¦æ’件: + + + + Translators + 翻譯 + + + + :/txt/translators_en.txt + :/txt/translators_zh_TW.txt + + + + ActionManager + + + &Play + 播放(&P) + + + + X + X + + + + &Pause + æš«åœ(&P) + + + + C + C + + + + &Stop + åœæ­¢(&S) + + + + V + V + + + + &Previous + 上一曲(&P) + + + + Z + Z + + + + &Next + 下一曲(&N) + + + + B + B + + + + &Play/Pause + 播放/æš«åœ(&P) + + + + Space + 空格 + + + + &Jump to File + 跳到文件(&J) + + + + J + J + + + + &Repeat Playlist + é‡å¾©æ’­æ”¾æ¸…å–®(&R) + + + + R + R + + + + &Repeat Track + é‡å¾©éŸ³è»Œ(&R) + + + + Ctrl+R + Ctrl+R + + + + &Shuffle + 亂åº(&S) + + + + S + S + + + + &No Playlist Advance + 無清單繼續(&N) + + + + Ctrl+N + + + + + &Stop After Selected + é¸å®šåŽåœæ­¢(&S) + + + + Ctrl+S + + + + + &Clear Queue + 清除佇列(&C) + + + + Alt+Q + + + + + Show Playlist + 顯示播放清單 + + + + Alt+E + + + + + Show Equalizer + 顯示å‡è¡¡å™¨ + + + + Alt+G + + + + + Always on Top + 常居頂端 + + + + Put on All Workspaces + æ”¾å…¨éƒ¨å·¥ä½œå€ + + + + Double Size + é›™å€å¤§å° + + + + Meta+D + + + + + &Add File + 添加文件(&A) + + + + F + F + + + + &Add Directory + 添加文件夾(&A) + + + + D + D + + + + &Add Url + 添加 URL (&A) + + + + U + U + + + + &Remove Selected + 移除所é¸(&R) + + + + Del + Del + + + + &Remove All + 移除全部(&R) + + + + &Remove Unselected + 移除未é¸(&R) + + + + Remove unavailable files + ç§»é™¤æœªé¸æ–‡ä»¶ + + + + Remove duplicates + 移除é‡å¤ + + + + &Queue Toggle + 佇列切æ›(&Q) + + + + Q + Q + + + + Invert Selection + åé¸ + + + + &Select None + ç„¡é¸å–(&S) + + + + &Select All + é¸å–全部(&S) + + + + Ctrl+A + Ctrl+A + + + + &View Track Details + 檢視音軌詳訊(&V) + + + + Alt+I + Alt+I + + + + &New List + 新建清單(&N) + + + + Ctrl+T + + + + + &Delete List + 移除清單(&D) + + + + Ctrl+W + + + + + &Load List + 載入清單(&L) + + + + O + O + + + + &Save List + 儲存清單(&S) + + + + Shift+S + Shift+S + + + + &Select Next Playlist + 鏿“‡ä¸‹ä¸€æ¸…å–®(&S) + + + + Ctrl+PgDown + + + + + &Select Previous Playlist + 鏿“‡ä¸Šä¸€æ¸…å–®(&S) + + + + Ctrl+PgUp + + + + + &Show Playlists + 顯示播放清單(&S) + + + + P + + + + + &Settings + 設定(&S) + + + + Ctrl+P + Ctrl+P + + + + &About + 關於(&A) + + + + &About Qt + 關於 Qt (&A) + + + + &Exit + çµæŸ(&E) + + + + Ctrl+Q + Ctrl+Q + + + + AddUrlDialog + + + Error + 錯誤 + + + + Enter URL to add + åŒ¯å…¥è¦æ·»åŠ çš„ URL + + + + &Add + 添加(&A) + + + + &Cancel + å–æ¶ˆ(&C) + + + + BuiltinCommandLineOption + + + Skip forward in playlist + 跳到播放清單中的下一曲 + + + + Skip backwards in playlist + 跳到播放清單中的上一曲 + + + + Start playing current song + é–‹å§‹æ’­æ”¾ç›®å‰æ›²ç›® + + + + Don't clear the playlist + ä¸è¦æ¸…除這個播放清單 + + + + Pause current song + æš«åœç›®å‰æ›²ç›® + + + + Pause if playing, play otherwise + 正在播放則暫åœï¼Œç›¸å處於暫åœå‰‡æ’­æ”¾ + + + + Stop current song + åœæ­¢ç›®å‰æ›²ç›® + + + + Display Jump to File dialog + 察看跳到文件å°è©± + + + + Quit application + + + + + Set playback volume (example: qmmp --volume 20) + è¨­ç½®å›žæ”¾éŸ³é‡ (例如:qmmp --volume 20) + + + + Show/hide application + 察看/éš±è—ç¨‹å¼ + + + + Display Add File dialog + 察看添加文件å°è©± + + + + Display Add Directory dialog + 察看添加目錄å°è©± + + + + ConfigDialog + + + Description + 說明 + + + + Filename + 文件å + + + + Artist + è—è¡“å®¶ + + + + + Album + 專輯 + + + + Track + 音軌 + + + + Disabled + ç¦æ­¢ + + + + Transports + 傳輸 + + + + Decoders + 解碼器 + + + + Engines + 引擎 + + + + Misc + 雜項 + + + + Title + 標題 + + + + Track number + 音軌編號 + + + + Two-digit track number + 兩使•¸éŸ³è»Œç·¨è™Ÿ + + + + Disc number + 光槃編號 + + + + Condition + æ¢ä»¶ + + + + Genre + æµæ´¾ + + + + Composer + 作曲 + + + + File name + 文件å + + + + File path + 文件路徑 + + + + Year + 年代 + + + + Comment + 備註 + + + + Qmmp Settings + Qmmp 設定 + + + + Skins + 皮膚 + + + + Fonts + å­—åž‹ + + + + Player: + 播放器: + + + + Playlist: + 播放清單: + + + + + ??? + ??? + + + + + + ... + ... + + + + Metadata + 元資料 + + + + Load metadata from files + 從文件載入元資料 + + + + Song Display + 察看歌曲 + + + + Title format: + 標題格å¼ï¼š + + + + + Preferences + 引數設定 + + + + + + Information + 資訊 + + + + Appearance + 外觀 + + + + + + Playlist + 播放清單 + + + + Plugins + æ’ä»¶ + + + + Advanced + 進階 + + + + 16-bit output + 16 比特輸出 + + + + Archived skin + 壓縮皮膚 + + + + Unarchived skin + 未壓縮皮膚 + + + + Connectivity + 連線 + + + + Visualization + å¯è¦–化 + + + + Effects + 特效 + + + + General + å¸¸è¦ + + + + File Dialog + 文件å°è©± + + + + + Audio + è²è¨Š + + + + Replay Gain + 回放增益 + + + + Miscellaneous + 雜項 + + + + Use bitmap font if available + 如果å¯ç”¨ä½¿ç”¨ä½åœ–å­—é«” + + + + Use skin cursors + 使用皮膚光標 + + + + Show song numbers + 顯示曲目編號 + + + + Show playlists + 顯示播放清單 + + + + Show popup information + é¡¯ç¤ºå½ˆå‡ºä¿¡æ¯ + + + + Replay Gain mode: + 回放增益模å¼ï¼š + + + + Preamp: + å‰ç½®æ”¾å¤§å™¨ï¼š + + + + + dB + + + + + Default gain: + 默èªå¢žç›Šï¼š + + + + Use peak info to prevent clipping + 使用峰值信æ¯ä»¥é˜²å‰Šæ³¢ + + + + Output: + 輸出: + + + + Buffer size: + 緩沖大å°ï¼š + + + + ms + + + + + Use software volume control + 使用軟è£ç½®éŸ³é‡æŽ§åˆ¶ + + + + + View + 視圖 + + + + Shortcuts + å¿«æ·éµ + + + + Hide on close + é—œé–‰æ™‚éš±è— + + + + Start hidden + å•Ÿå‹•æ™‚éš±è— + + + + Edit template + ç·¨è¼¯æ¨¡æ¿ + + + + Show anchor + 顯示主æŒäºº + + + + Align song numbers + 一樣的曲目號 + + + + Cover Image Retrieve + å°é¢åœ–åƒæª¢ç´¢ + + + + Use separate image files + 使用單ç¨åœ–åƒæ–‡ä»¶ + + + + Include files: + åŒ…å«æ–‡æª”: + + + + Exclude files: + 排除文檔: + + + + Recursive search depth: + éžæ­¸æœç´¢æ·±åº¦ï¼š + + + + + Playback + 回放 + + + + Continue playback on startup + 啟動時繼續上次播放 + + + + Proxy + ä»£ç† + + + + Enable proxy usage + å•Ÿç”¨ä»£ç† + + + + Proxy host name: + 主機å: + + + + Proxy port: + 通訊埠: + + + + Use authentication with proxy + 需è¦èº«ä»½é©—è­‰ + + + + Proxy user name: + 用戶å: + + + + Proxy password: + 密碼: + + + + Action + 動作 + + + + Shortcut + å¿«æ·éµ + + + + Change shortcut... + 改變快æ·éµ... + + + + Convert underscores to blanks + 轉æ›åº•線為空格 + + + + Convert %20 to blanks + è½‰æ› %20 為空格 + + + + Select Skin Files + é¸å–皮膚文件 + + + + Skin files + 皮膚文件 + + + + Add... + 添加... + + + + Refresh + 刷新 + + + + Show protocol + 顯示å”è­° + + + + Transparency + 逿˜Žåº¦ + + + + Main window + ä¸»çª—å£ + + + + + + 0 + 0 + + + + Equalizer + å‡è¡¡å™¨ + + + + EqWidget + + + + preset + é è¨­ + + + + &Load/Delete + 載入/移除(&L) + + + + &Save Preset + 儲存é è¨­(&S) + + + + &Save Auto-load Preset + 儲存自動載入é è¨­(&S) + + + + &Clear + 清除(&C) + + + + Saving Preset + 儲存é è¨­ + + + + Preset name: + é è¨­å稱: + + + + preset # + é è¨­ # + + + + &Import + å°Žå…¥(&I) + + + + Equalizer + å‡è¡¡å™¨ + + + + Import Preset + å°Žå…¥é è¨­ + + + + JumpToTrackDialog + + + Q + Q + + + + J + J + + + + F5 + + + + + + Unqueue + 移出佇列 + + + + + + Queue + 加入佇列 + + + + Jump To Track + 跳到音軌 + + + + Filter + éŽæ¿¾ + + + + Refresh + 刷新 + + + + Jump To + 跳到 + + + + MainDisplay + + + Previous + 上一曲 + + + + Play + 播放 + + + + Pause + æš«åœ + + + + Stop + åœæ­¢ + + + + Next + 下一曲 + + + + Add file + 添加文件 + + + + Equalizer + å‡è¡¡å™¨ + + + + Playlist + 播放清單 + + + + Repeat playlist + é‡å¾©æ’­æ”¾æ¸…å–® + + + + Shuffle + äº‚åº + + + + Volume + éŸ³é‡ + + + + Balance + 平衡 + + + + Volume: %1% + 音é‡ï¼š%1% + + + + Balance: %1% right + 平衡:%1% å³ + + + + Balance: %1% left + 平衡:%1% å·¦ + + + + Balance: center + 平衡:中 + + + + Seek to: %1 + 移動到:%1 + + + + MainVisual + + + Visualization Mode + å¯è¦–化型態 + + + + Analyzer + è§£æžå™¨ + + + + Scope + 示波器 + + + + Off + 關閉 + + + + Analyzer Mode + è§£æžåž‹æ…‹ + + + + Normal + 標準 + + + + Fire + ç«èб + + + + Vertical Lines + 垂直線 + + + + Lines + ç·šå½¢ + + + + Bars + æ¢å½¢ + + + + Peaks + 峰值 + + + + Refresh Rate + 刷新率 + + + + 50 fps + 50 fps + + + + 25 fps + 25 fps + + + + 10 fps + 10 fps + + + + 5 fps + 5 fps + + + + Analyzer Falloff + è§£æžå™¨ä¸‹é™é€Ÿåº¦ + + + + + Slowest + 最慢 + + + + + Slow + æ…¢ + + + + + Medium + 中 + + + + + Fast + å¿« + + + + + Fastest + 最快 + + + + Peaks Falloff + 峰值下é™é€Ÿåº¦ + + + + Background + 背景 + + + + Transparent + 逿˜Ž + + + + MainWindow + + + Choose a directory + é¸å–一個目錄 + + + + Select one or more files to open + é¸å–開啟一個或更多文件 + + + + &Jump To File + 跳到文件(&J) + + + + J + J + + + + View + 視圖 + + + + Playlist + 播放清單 + + + + Open Playlist + 開啟播放清單 + + + + Save Playlist + 儲存播放清單 + + + + + Playlist Files + 播放清單文件 + + + + All Supported Bitstreams + 支æ´çš„全部文件 + + + + Tools + 工具 + + + + PlayList + + + &Copy Selection To + å¤åˆ¶é¸å–到(&C) + + + + Sort List + æ¸…å–®æŽ’åº + + + + + By Title + 按標題 + + + + + By Album + 按專輯 + + + + + By Artist + 按è—è¡“å®¶ + + + + + By Filename + 按文件å + + + + + By Path + Filename + 按路徑+文件å + + + + + By Date + 按日期 + + + + Sort Selection + é¸å–æŽ’åº + + + + Randomize List + 隨機產生清單 + + + + Reverse List + 逆串列表 + + + + &New PlayList + 新建清單(&N) + + + + + By Track Number + 按音軌 + + + + Playlist + 播放清單 + + + + Actions + 動作 + + + + PlayListBrowser + + + Playlist Browser + 播放清單ç€è¦½ + + + + New + 新建 + + + + + Delete + 移除 + + + + + ... + ... + + + + Rename + é‡å‘½å + + + + PlayListSelector + + + &Load + 載入(&L) + + + + &Save As... + å¦å­˜ç‚º(&S)... + + + + Rename + é‡å‘½å + + + + &Delete + 移除(&D) + + + + Rename Playlist + é‡å‘½æ’­æ”¾æ¸…å–®å + + + + Playlist name: + é‡å‘½æ–‡ä»¶å: + + + + PopupSettings + + + Popup Information Settings + 彈出信æ¯è¨­ç½® + + + + Show cover + 顯示å°é¢ + + + + Transparency: + 逿˜Žåº¦ï¼š + + + + Delay: + å»¶é²ï¼š + + + + ms + + + + + Cover size: + å°é¢å¤§å°ï¼š + + + + Template + æ¨¡æ¿ + + + + Reset + é‡è¨­ + + + + Insert + æ’å…¥ + + + + Artist + è—è¡“å®¶ + + + + Album + 專輯 + + + + Title + 標題 + + + + Track number + 音軌編號 + + + + Two-digit track number + 兩使•¸éŸ³è»Œç·¨è™Ÿ + + + + Genre + æµæ´¾ + + + + Comment + 備註 + + + + Composer + 作曲 + + + + Duration + æŒçºŒæ™‚é–“ + + + + Disc number + 光槃編號 + + + + File name + 文件å + + + + File path + 文件路徑 + + + + Year + 年代 + + + + Condition + æ¢ä»¶ + + + + PresetEditor + + + Preset Editor + é è¨­ç·¨è¼¯ç¨‹å¼ + + + + Load + 載入 + + + + Delete + 移除 + + + + Preset + é è¨­ + + + + Auto-preset + 自動é è¨­ + + + + QMMPStarter + + + Usage: qmmp [options] [files] + 使用:qmmp [設定] [文件] + + + + Options: + 設定: + + + + Don't start the application + ç„¡æ³•å•Ÿå‹•æ­¤ç¨‹å¼ + + + + Print version number and exit + å¯Ÿçœ‹ç‰ˆæœ¬ä¸¦çµæŸ + + + + Ideas, patches, bugreports send to forkotov02@hotmail.ru + 建議ã€è£œä¸æˆ–æäº¤ bug 請傳é€åˆ° forkotov02@hotmail.ru + + + + Display this text and exit + å¯Ÿçœ‹é€™äº›å­—æª”ä¸¦çµæŸ + + + + Unknown command + 未知指令 + + + + QMMP version: + Qmmp 版本: + + + + Qt version: + Qt 版本: + + + + ShortcutDialog + + + Change Shortcut + 更改快æ·éµ... + + + + Press the key combination you want to assign + æŒ‰ä¸‹ä½ è¦æŒ‡å®šçš„組åˆéµ + + + + Clear + 清除 + + + + TextScroller + + + Autoscroll Songname + 自動æ²å‹•曲目å + + + + Buffering: %1% + 緩沖:%1% + + + + VisualMenu + + + Visualization + å¯è¦–化 + + + diff --git a/src/plugins/Ui/skinned/txt/authors_cs.txt b/src/plugins/Ui/skinned/txt/authors_cs.txt new file mode 100644 index 000000000..191228144 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_cs.txt @@ -0,0 +1,16 @@ +Vývojáři programu: + + Ð˜Ð»ÑŒÑ ÐšÐ¾Ñ‚Ð¾Ð² (Ilja Kotov) (nápad a základní kód) + Владимир Кузнецов (Vladimír KuznÄ›cov) (vzhled a mnoho vylepÅ¡ení) + +Vývojáři zásuvných modulů: + + Юрий Журавлёв (Jurij Žuravljov) (jack plugin) + +Grafika: + + Ðндрей Ðдреев (Andrej Adrejev) + +ÄŒeský pÅ™eklad: + + Karel Volný diff --git a/src/plugins/Ui/skinned/txt/authors_de.txt b/src/plugins/Ui/skinned/txt/authors_de.txt new file mode 100644 index 000000000..331a0c8d6 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_de.txt @@ -0,0 +1,14 @@ +Hauptentwickler: + + Ilya Kotov (Idee und Programmierung) + Vladimir Kuznetsov (Look & Feel und viele Verbesserungen) + +Plugin-Entwickler: + + Artur Guzik (KDE-4-Benachrichtigungs-Modul, Verbesserungen am Statussymbol-Modul) + Yuriy Zhuravlev (JACK- und OSS-Plugin) + +Artwork: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_en.txt b/src/plugins/Ui/skinned/txt/authors_en.txt new file mode 100644 index 000000000..87231af8c --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_en.txt @@ -0,0 +1,14 @@ +Core Developers: + + Ilya Kotov (idea and base code) + Vladimir Kuznetsov (look&feel and many improvements) + +Plugin Developers: + + Artur Guzik (kde4 notification plugin, tray icon improvements) + Yuriy Zhuravlev (jack & oss plugin) + +Artwork: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_es.txt b/src/plugins/Ui/skinned/txt/authors_es.txt new file mode 100644 index 000000000..3acfbaf71 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_es.txt @@ -0,0 +1,14 @@ +Desarrolladores principales: + + Ilya Kotov (idea y código base) + Vladimir Kuznetsov (estilo y muchas mejoras) + +Desarrolladores de módulos: + + Artur Guzik (módulo de notificación kde4, mejoras en el icono de estado) + Yuriy Zhuravlev (módulos para jack y oss) + +Material gráfico: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_it.txt b/src/plugins/Ui/skinned/txt/authors_it.txt new file mode 100644 index 000000000..2d205cb32 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_it.txt @@ -0,0 +1,13 @@ +Sviluppatori del programma base: + + Ilya Kotov (idea e codice di base) + Vladimir Kuznetsov (aspetto e molti miglioramenti) + +Sviluppatori dei moduli: + + Yuriy Zhuravlev (moduli & oss jack) + +Grafica: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_ja.txt b/src/plugins/Ui/skinned/txt/authors_ja.txt new file mode 100644 index 000000000..e5c460acf --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_ja.txt @@ -0,0 +1,14 @@ +中心的ãªé–‹ç™ºè€…: + + Ð˜Ð»ÑŒÑ ÐšÐ¾Ñ‚Ð¾Ð² (Ilya Kotov) (発案ã¨åŸºç¤Žã‚³ãƒ¼ãƒ‰) + Владимир Кузнецов (Vladimir Kuznetsov) (使ã„勿‰‹åŠã³å¤–見〠数多ãã®æ‹¡å¼µ) + +プラグイン開発者: + + Artur Guzik (KDE4通知プラグイン〠トレイアイコン拡張) + Юрий Журавлёв (Yuriy Zhuravlev) (jack & OSS プラグイン) + +美術: + + Ðндрей Ðндреев (Andrey Andreev) + diff --git a/src/plugins/Ui/skinned/txt/authors_lt.txt b/src/plugins/Ui/skinned/txt/authors_lt.txt new file mode 100644 index 000000000..b778cefc2 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_lt.txt @@ -0,0 +1,13 @@ +Programos autoriai: + + Ilya Kotov (IdÄ—ja ir pagrindinis kodas) + Vladimir Kuznetsov (IÅ¡vaizda ir daugybÄ— patobulinimų) + +Ä®skiepiai: + + Artur Guzik (kde4 praneÅ¡imų įskiepis, sistemos dÄ—klo ikonos patobulinimai) + Yuriy Zhuravlev (Ä®skiepiai jack, oss) + +Grafika: + + Andrey Adreev diff --git a/src/plugins/Ui/skinned/txt/authors_nl.txt b/src/plugins/Ui/skinned/txt/authors_nl.txt new file mode 100644 index 000000000..4fe8fac4b --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_nl.txt @@ -0,0 +1,14 @@ +Hoofdontwikkelaars: + + Ilya Kotov (idee en codebasis) + Vladimir Kuznetsov (uiterlijk&gebruik en vele verbeteringen) + +Module-ontwikkelaars: + + Artur Guzik (kde4 notificatie plugin, taak icoon verbeteringen) + Yuriy Zhuravlev (jack & oss module) + +Ontwerp: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_pl.txt b/src/plugins/Ui/skinned/txt/authors_pl.txt new file mode 100644 index 000000000..e37d88ee4 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_pl.txt @@ -0,0 +1,14 @@ +Główni programiÅ›ci: + + Ilya Kotov (pomysÅ‚ i wÅ‚aÅ›ciwy kod) + Vladimir Kuznetsov (look&feel oraz wiele usprawnieÅ„) + +Twórcy wtyczek: + + Artur Guzik (wtyczka powiadamiania KDE4, usprawnienia ikony statusu) + Yuriy Zhuravlev (wtyczki jack & oss) + +Grafika: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_ru.txt b/src/plugins/Ui/skinned/txt/authors_ru.txt new file mode 100644 index 000000000..9b6336d80 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_ru.txt @@ -0,0 +1,13 @@ +Разработчики Ñдра: + + Владимир Кузнецов (внешний вид и множеÑтво улучшений) + Ð˜Ð»ÑŒÑ ÐšÐ¾Ñ‚Ð¾Ð² (Ð¸Ð´ÐµÑ Ð¸ оÑновной код) + +Разработчики модулей: + + Artur Guzik (модуль уведомлений kde4, ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð² модуле ÑиÑтемного лотка) + Юрий Журавлёв (модули jack, oss) + +Графика: + + Ðндрей Ðндреев diff --git a/src/plugins/Ui/skinned/txt/authors_tr.txt b/src/plugins/Ui/skinned/txt/authors_tr.txt new file mode 100644 index 000000000..292b222d7 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_tr.txt @@ -0,0 +1,13 @@ +Çekirdek GeliÅŸtiriciler: + + Ilya Kotov (fikirler ve temel kod) + Vladimir Kuznetsov (görünüm ve birçok iyileÅŸtirme) + +Eklenti GeliÅŸtiricileri: + + Yuriy Zhuravlev (jack & oss eklentisi) + +Artwork: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/authors_uk_UA.txt b/src/plugins/Ui/skinned/txt/authors_uk_UA.txt new file mode 100644 index 000000000..9dd59194d --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_uk_UA.txt @@ -0,0 +1,16 @@ +Розробники Ñдра: + + Володимир Кузнєцов (зовнішній виглÑд Ñ– безліч поліпшень) + Ð†Ð»Ð»Ñ ÐšÐ¾Ñ‚Ð¾Ð² (Ñ–Ð´ÐµÑ Ñ– оÑновний код) + +Розробники модулів: + + Юрій Журавльов (модулі jack, oss) + +УкраїнÑький переклад: + + Моцьо Геннадій + +Графіка: + + Ðндрій Ðндрєєв diff --git a/src/plugins/Ui/skinned/txt/authors_zh_CN.txt b/src/plugins/Ui/skinned/txt/authors_zh_CN.txt new file mode 100644 index 000000000..f554ce7e9 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_zh_CN.txt @@ -0,0 +1,12 @@ +核心开å‘: + + Ilya Kotov (idea and base code) + Vladimir Kuznetsov (look&feel and many improvements) + +æ’ä»¶å¼€å‘: + + Yuriy Zhuravlev (jack plugin) + +美术: + + Andrey Adreev diff --git a/src/plugins/Ui/skinned/txt/authors_zh_TW.txt b/src/plugins/Ui/skinned/txt/authors_zh_TW.txt new file mode 100644 index 000000000..fa9f8482d --- /dev/null +++ b/src/plugins/Ui/skinned/txt/authors_zh_TW.txt @@ -0,0 +1,13 @@ +核心開發: + + Ilya Kotov (idea and base code) + Vladimir Kuznetsov (look&feel and many improvements) + +æ’件開發: + + Yuriy Zhuravlev (jack plugin) + +美術: + + Andrey Adreev + diff --git a/src/plugins/Ui/skinned/txt/description_cs.txt b/src/plugins/Ui/skinned/txt/description_cs.txt new file mode 100644 index 000000000..d262da180 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_cs.txt @@ -0,0 +1 @@ +Tento program je zvukový pÅ™ehrávaÄ napsaný s pomocí knihovny Qt. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_de.txt b/src/plugins/Ui/skinned/txt/description_de.txt new file mode 100644 index 000000000..d9087c5dd --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_de.txt @@ -0,0 +1 @@ +Dieses Programm ist ein Audio-Abspielprogramm, der mit Hilfe der Qt-Bibliotheken geschrieben wurde. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_en.txt b/src/plugins/Ui/skinned/txt/description_en.txt new file mode 100644 index 000000000..23f6dd619 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_en.txt @@ -0,0 +1 @@ +This program is an audio-player, written with the help of the Qt library. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_es.txt b/src/plugins/Ui/skinned/txt/description_es.txt new file mode 100644 index 000000000..6bf33e46b --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_es.txt @@ -0,0 +1 @@ +Este programa es un reproductor de audio, escrito con ayuda de la librería Qt. diff --git a/src/plugins/Ui/skinned/txt/description_it.txt b/src/plugins/Ui/skinned/txt/description_it.txt new file mode 100644 index 000000000..fc6cf7ae5 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_it.txt @@ -0,0 +1 @@ +Programma di riproduzione audio scritto con l'ausilio di librerie QT. diff --git a/src/plugins/Ui/skinned/txt/description_ja.txt b/src/plugins/Ui/skinned/txt/description_ja.txt new file mode 100644 index 000000000..3eabd97c5 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_ja.txt @@ -0,0 +1 @@ +ã“ã®ãƒ—ログラムã¯ã€ Qtライブラリã®åŠ›ã‚’å€Ÿã‚Šã¦ä½œã‚‰ã‚ŒãŸã‚ªãƒ¼ãƒ‡ã‚£ã‚ªãƒ—レイヤã§ã™ã€‚ diff --git a/src/plugins/Ui/skinned/txt/description_lt.txt b/src/plugins/Ui/skinned/txt/description_lt.txt new file mode 100644 index 000000000..f8116e9d3 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_lt.txt @@ -0,0 +1 @@ +Å i programa yra audio grotuvas, sukurtas Qt pagrindu. diff --git a/src/plugins/Ui/skinned/txt/description_nl.txt b/src/plugins/Ui/skinned/txt/description_nl.txt new file mode 100644 index 000000000..aa3e93337 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_nl.txt @@ -0,0 +1 @@ +Dit programma is een audio-speler, geschreven met de hulp van de Qt bibliotheek. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_pl.txt b/src/plugins/Ui/skinned/txt/description_pl.txt new file mode 100644 index 000000000..4481835a4 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_pl.txt @@ -0,0 +1 @@ +Qmmp to odtwarzacz muzyki napisany przy użyciu biblioteki QT. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_ru.txt b/src/plugins/Ui/skinned/txt/description_ru.txt new file mode 100644 index 000000000..18d772ab3 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_ru.txt @@ -0,0 +1 @@ +Ð”Ð°Ð½Ð½Ð°Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð° ÑвлÑетÑÑ Ð°ÑƒÐ´Ð¸Ð¾-плеером, напиÑанным Ñ Ð¸Ñпользованием библиотеки Qt. diff --git a/src/plugins/Ui/skinned/txt/description_tr.txt b/src/plugins/Ui/skinned/txt/description_tr.txt new file mode 100644 index 000000000..135d0f010 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_tr.txt @@ -0,0 +1 @@ +Bu program Qt kitaplığı kullaılarak yazılmış bir çoklu ortam oynatıcısıdır. diff --git a/src/plugins/Ui/skinned/txt/description_uk_UA.txt b/src/plugins/Ui/skinned/txt/description_uk_UA.txt new file mode 100644 index 000000000..9e5d45b60 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_uk_UA.txt @@ -0,0 +1 @@ +Ð¦Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð° Ñ” аудіопрогравачем, напиÑаним за допомогою бібліотеки Qt. \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_zh_CN.txt b/src/plugins/Ui/skinned/txt/description_zh_CN.txt new file mode 100644 index 000000000..9d672c6d1 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_zh_CN.txt @@ -0,0 +1 @@ +æ­¤ç¨‹åºæ˜¯ä¸€ä¸ªéŸ³ä¹æ’­æ”¾å™¨ï¼ŒåŸºäºŽ Qt 库开å‘。 \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/description_zh_TW.txt b/src/plugins/Ui/skinned/txt/description_zh_TW.txt new file mode 100644 index 000000000..a1da82850 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/description_zh_TW.txt @@ -0,0 +1 @@ +æ­¤ç¨‹å¼æ˜¯ä¸€å€‹éŸ³æ¨‚播放器,程å¼çš„編寫基於Qt庫。 \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/thanks_cs.txt b/src/plugins/Ui/skinned/txt/thanks_cs.txt new file mode 100644 index 000000000..9bc0388da --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_cs.txt @@ -0,0 +1,3 @@ +PodÄ›kování patří: + + Вадим Калинников (Vadim Kalinnikov) (hosting projektu) diff --git a/src/plugins/Ui/skinned/txt/thanks_de.txt b/src/plugins/Ui/skinned/txt/thanks_de.txt new file mode 100644 index 000000000..3392e9f19 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_de.txt @@ -0,0 +1,17 @@ +Dank an: + + Adria Arrufat – Fehlerberichte + Adrian Knoth – Korrekturen am JACK-Modul, Fehlerberichte + Csaba Hruska – Korrekturen am FFmpeg-Modul + Dmitry Kostin – Unterstützung für iso.wv + Gennadi Motsyo – Fehlerberichte + Vadim Kalinnikov – Projekt-Hosting + Erik Ölsar – Designte Mauszeiger, Verbesserungen an der Oberfläche + Funda Wang – Korrekturen an den CMake-Dateien + Michail Zheludkov – Korrekturen am FFmpeg-Modul + Panagiotis Papadopoulos – Korrekturen an der Oberfläche, Fehlerberichte + Pino Toscano – Verbesserungen der Portabilität + Karel Volný – Verschiedene Korrekturen + Sebastian Pipping – bs2b-Verbesserungen + Stefan Koelling – Kompilierungskorrekturen + Yaakov Selkowitz – Cygwin-Verbesserungen diff --git a/src/plugins/Ui/skinned/txt/thanks_en.txt b/src/plugins/Ui/skinned/txt/thanks_en.txt new file mode 100644 index 000000000..2e52ed482 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_en.txt @@ -0,0 +1,21 @@ +Thanks to: + + Adria Arrufat - bug reports + Adrian Knoth - jack plugin fixes, bug reports + Anton Petrusevich - random playback improvements + Avihay Baratz - auto stop feature, bug fixes + Csaba Hruska - ffmpeg plugin fixes + Dmitry Kostin - iso.wv support + Evgeny Gleyzerman - cue parsing improvements + Gennadi Motsyo - bug reports + Vadim Kalinnikov - project hosting + Erik Ölsar - skinned cursors, ui improvements + Funda Wang - cmake files fixes + Michail Zheludkov - ffmpeg plugin fixes + MichaÅ‚ Grosicki - alsa plugin fixes + Panagiotis Papadopoulos - ui fixes, bug reports + Pino Toscano - portability patches + Karel Volný - various fixes + Sebastian Pipping - bs2b patches + Stefan Koelling - some build fixes + Yaakov Selkowitz - cygwin patches diff --git a/src/plugins/Ui/skinned/txt/thanks_es.txt b/src/plugins/Ui/skinned/txt/thanks_es.txt new file mode 100644 index 000000000..dec15461f --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_es.txt @@ -0,0 +1,17 @@ +Gracias a: + + Adria Arrufat - reporte de errores + Adrian Knoth - arreglos en el módulo jack, reporte de errores + Csaba Hruska - arreglos en el módulo ffmpeg + Dmitry Kostin - soporte iso.wv + Gennadi Motsyo - reporte de errores + Vadim Kalinnikov - alojamiento del proyecto + Erik Ölsar - temas de cursores, mejoras en el interfaz + Funda Wang - arreglos en los archivos cmake + Michail Zheludkov - arreglos en el módulo ffmpeg + Panagiotis Papadopoulos - arreglos en el interfaz, reporte de errores + Pino Toscano - parches de portabilidad + Karel Volný - varios arreglos + Sebastian Pipping - parches para bs2b + Stefan Koelling - algunos arreglos en la compilación + Yaakov Selkowitz - parches para cygwin diff --git a/src/plugins/Ui/skinned/txt/thanks_it.txt b/src/plugins/Ui/skinned/txt/thanks_it.txt new file mode 100644 index 000000000..46b6987db --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_it.txt @@ -0,0 +1,3 @@ +Grazie a: + + Vadim Kalinnikov (spazio ospite del progetto) diff --git a/src/plugins/Ui/skinned/txt/thanks_ja.txt b/src/plugins/Ui/skinned/txt/thanks_ja.txt new file mode 100644 index 000000000..a7b7b820e --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_ja.txt @@ -0,0 +1,21 @@ +å”力者: + + Adria Arrufat - ãƒã‚°å ±å‘Š + Adrian Knoth - jack プラグイン改修, ãƒã‚°å ±å‘Š + Anton Petrusevich - シャッフルå†ç”Ÿã®æ”¹è‰¯ + Avihay Baratz - 自動終止機能, ãƒã‚°æ”¹ä¿® + Csaba Hruska - ffmpeg プラグイン改修 + Dmitry Kostin - iso.wv サãƒãƒ¼ãƒˆ + Evgeny Gleyzerman - cue è§£æžã®æ”¹è‰¯ + Геннадий Моцьо (Gennadi Motsyo) - ãƒã‚°å ±å‘Š + Вадим Калинников (Vadim Kalinnikov) - ホストæä¾› + Erik Ölsar - スキン化カーソル, UI改良 + Funda Wang - cmake files 改修 + Михаил Желудков (Michail Zheludkov) - ffmpeg プラグイン改修 + MichaÅ‚ Grosicki - alsa プラグイン改修 + Panagiotis Papadopoulos - UI改修, ãƒã‚°å ±å‘Š + Pino Toscano - ç§»æ¤é©ç”¨ãƒ‘ッム+ Karel Volný - å„種改修 + Sebastian Pipping - bs2b パッム+ Stefan Koelling - ビルド改修 + Yaakov Selkowitz - cygwin パッムdiff --git a/src/plugins/Ui/skinned/txt/thanks_lt.txt b/src/plugins/Ui/skinned/txt/thanks_lt.txt new file mode 100644 index 000000000..fbfa16ac0 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_lt.txt @@ -0,0 +1,17 @@ +DÄ—kojame: + + Adria Arrufat - klaidų praneÅ¡imai + Adrian Knoth - jack įskiepio pataisymai, klaidų praneÅ¡imai + Csaba Hruska - ffmpeg įskiepio pataisymai + Dmitry Kostin - iso.wv palaikymas + Gennadi Motsyo - klaidų praneÅ¡imai + Vadim Kalinnikov - svetainÄ—s talpinimas + Erik Ölsar - temų kursoriai, ui patobulinimai + Funda Wang - cmake bylų pataisymai + Michail Zheludkov - ffmpeg įskiepio pataisymai + Panagiotis Papadopoulos - ui pataisymai, klaidų praneÅ¡imai + Pino Toscano - portability patches + Karel Volný - įvairÅ«s pataisymai + Sebastian Pipping - bs2b lopai + Stefan Koelling - keletas kompiliavimo pataisymų + Yaakov Selkowitz - cygwin lopai diff --git a/src/plugins/Ui/skinned/txt/thanks_nl.txt b/src/plugins/Ui/skinned/txt/thanks_nl.txt new file mode 100644 index 000000000..145d2f4bb --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_nl.txt @@ -0,0 +1,17 @@ +Met dank aan: + + Adria Arrufat - foutrapportage + Adrian Knoth - jack module reparatie's, foutrapportage + Csaba Hruska - ffmpeg module aanpassingen + Dmitry Kostin - iso.wv ondersteuning + Gennadi Motsyo - foutrapportage + Vadim Kalinnikov - project hosting + Erik Ölsar - cursor thema's, verbeteringen van de gebruikersinterface + Funda Wang - verbeteringen in cmake bestanden + Michail Zheludkov - ffmpeg module aanpassingen + Panagiotis Papadopoulos - interface reparatie's, foutrapportage + Pino Toscano - compatibiliteit andere systemen + Karel Volný - overige reparatie's + Sebastian Pipping - bs2b contributie + Stefan Koelling - aanpassingen voor bouwsysteem + Yaakov Selkowitz - cygwin aanpassingen diff --git a/src/plugins/Ui/skinned/txt/thanks_pl.txt b/src/plugins/Ui/skinned/txt/thanks_pl.txt new file mode 100644 index 000000000..fa839dbf3 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_pl.txt @@ -0,0 +1,21 @@ +PodziÄ™kowania: + + Adria Arrufat - raporty błędów + Adrian Knoth - poprawki dla wtyczki jack, raporty błędów + Anton Petrusevich - ulepszenia losowego odtwarzania + Avihay Baratz - funkcja auto stop, poprawki błędów + Csaba Hruska - poprawki dla wtyczki ffmpeg + Dmitry Kostin - wsparcie dla iso.wv + Evgeny Gleyzerman - poprawki przetwarzania cue + Gennadi Motsyo - raporty błędów + Vadim Kalinnikov - hosting projektu + Erik Ölsar - wsparcie dla kursorów z motywu, udoskonalenia dla ui + Funda Wang - poprawki plików cmake + Michail Zheludkov - poprawki dla wtyczki ffmpeg + MichaÅ‚ Grosicki - poprawki wtyczki alsa + Panagiotis Papadopoulos - poprawki ui, raporty błędów + Pino Toscano - poprawki dotyczÄ…ce przenoÅ›noÅ›ci programu + Karel Volný - różne poprawki + Sebastian Pipping - poprawki bs2b + Stefan Koelling - poprawki błędów kompilacji + Yaakov Selkowitz - poprawki cygwin \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/thanks_ru.txt b/src/plugins/Ui/skinned/txt/thanks_ru.txt new file mode 100644 index 000000000..c6edb7110 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_ru.txt @@ -0,0 +1,21 @@ +БлагодарноÑти: + + Adria Arrufat - ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках + Adrian Knoth - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² модуле jack plugin, ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках + Anton Petrusevich - улучшение Ñлучайного воÑÐ¿Ñ€Ð¾Ð¸Ð·Ð²ÐµÐ´ÐµÐ½Ð¸Ñ + Avihay Baratz - опции авто-оÑтановки, иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¾ÑˆÐ¸Ð±Ð¾Ðº + Csaba Hruska - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² модуле ffmpeg + Dmitry Kostin - поддержка iso.wv + Evgeny Gleyzerman - улучшение поддержки cue + Геннадий Моцьо - ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках + Вадим Калинников - хоcтинг проекта + Erik Ölsar - раÑтровые курÑоры, ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð² интерфейÑе Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ + Funda Wang - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² cmake + Михаил Желудков - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² модуле ffmpeg + MichaÅ‚ Grosicki - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² модуле alsa + Panagiotis Papadopoulos - ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð² интерфейÑе пользователÑ, ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾Ð± ошибках + Pino Toscano - улучшение кроÑÑплатформенноÑти + Karel Volný - различные иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ + Sebastian Pipping - патчи bs2b + Stefan Koelling - иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñборки + Yaakov Selkowitz - поддержка cygwin diff --git a/src/plugins/Ui/skinned/txt/thanks_tr.txt b/src/plugins/Ui/skinned/txt/thanks_tr.txt new file mode 100644 index 000000000..9bdf21ef0 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_tr.txt @@ -0,0 +1,3 @@ +TeÅŸekkürler: + + Vadim Kalinnikov (proje barındırma) diff --git a/src/plugins/Ui/skinned/txt/thanks_uk_UA.txt b/src/plugins/Ui/skinned/txt/thanks_uk_UA.txt new file mode 100644 index 000000000..31803ec40 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_uk_UA.txt @@ -0,0 +1,20 @@ +ПодÑки: + + Вадиму Каліннікову - хоÑтинг проекту + Adria Arrufat - Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилки + Adrian Knoth - Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð² модулі jack plugin, Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилки + Anton Petrusevich - Ð¿Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð½Ñ Ð²Ð¸Ð¿Ð°Ð´ÐºÐ¾Ð²Ð¾Ð³Ð¾ Ð²Ñ–Ð´Ñ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ + Avihay Baratz - опції авто-зупинки, Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð¿Ð¾Ð¼Ð¸Ð»Ð¾Ðº + Csaba Hruska - Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð² модулі ffmpeg + Dmitry Kostin - підтримка iso.wv + Evgeny Gleyzerman - Ð¿Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð½Ñ Ð¿Ñ–Ð´Ñ‚Ñ€Ð¸Ð¼ÐºÐ¸ cue + Геннадій Моцьо - Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилки + Erik Ölsar - раÑтрові курÑори, Ð¿Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð½Ñ Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñу кориÑтувача + Funda Wang - Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ñ„Ð°Ð¹Ð»Ñ–Ð² cmake + Михаил Желудков - Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð² модулі ffmpeg + Panagiotis Papadopoulos - Ð¿Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð½Ñ Ñ–Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñу кориÑтувача, Ð¿Ð¾Ð²Ñ–Ð´Ð¾Ð¼Ð»ÐµÐ½Ð½Ñ Ð¿Ñ€Ð¾ помилки + Pino Toscano - Ð¿Ð¾ÐºÑ€Ð°Ñ‰ÐµÐ½Ð½Ñ ÐºÑ€Ð¾ÑÑплатформноÑті + Karel Volný - різноманітні Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ + Sebastian Pipping - патчі bs2b + Stefan Koelling - Ð²Ð¸Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð½Ñ Ð·Ð±Ñ–Ñ€ÐºÐ¸ + Yaakov Selkowitz - підтримка cygwin diff --git a/src/plugins/Ui/skinned/txt/thanks_zh_CN.txt b/src/plugins/Ui/skinned/txt/thanks_zh_CN.txt new file mode 100644 index 000000000..6f9ba0a1d --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_zh_CN.txt @@ -0,0 +1,21 @@ +感谢: + + Adria Arrufat - bug 报告 + Adrian Knoth - jack æ’件修正,bug 报告 + Anton Petrusevich - éšæœºæ’­æ”¾æ”¹è¿› + Avihay Baratz - è‡ªåŠ¨åœæ”¾åŠŸèƒ½ï¼Œbug 修正 + Csaba Hruska - ffmpeg æ’件修正 + Dmitry Kostin - iso.wv æ”¯æŒ + Evgeny Gleyzerman - cue è§£æžæ”¹è¿› + Gennadi Motsyo - bug 报告 + Vadim Kalinnikov - é¡¹ç›®ç½‘ç»œæ”¯æŒ + Erik Ölsar - 光标皮肤ã€ç”¨æˆ·ç•Œé¢æ”¹è¿› + Funda Wang - cmake 文件修正 + Michail Zheludkov - ffmpeg æ’件修正 + MichaÅ‚ Grosicki - alsa æ’件修正 + Panagiotis Papadopoulos - 用户界é¢ä¿®æ­£ï¼Œbug 报告 + Pino Toscano - å¯ç§»æ¤æ€§è¡¥ä¸ + Karel Volný - 多项修正 + Sebastian Pipping - bs2b è¡¥ä¸ + Stefan Koelling - 一些编译修正 + Yaakov Selkowitz - cygwin è¡¥ä¸ diff --git a/src/plugins/Ui/skinned/txt/thanks_zh_TW.txt b/src/plugins/Ui/skinned/txt/thanks_zh_TW.txt new file mode 100644 index 000000000..d1b898fef --- /dev/null +++ b/src/plugins/Ui/skinned/txt/thanks_zh_TW.txt @@ -0,0 +1,21 @@ +感è¬ï¼š + + Adria Arrufat <​​swiftscythe@gmail.com> - bug 報告 + Adrian Knoth - jack æ’件修正,bug 報告 + Anton Petrusevich - 隨機播放改進 + Avihay Baratz - è‡ªå‹•åœæ”¾åŠŸèƒ½ï¼Œbug 修正 + Csaba Hruska - ffmpeg æ’件修正 + Dmitry Kostin - iso.wv æ”¯æŒ + Evgeny Gleyzerman - cue è§£æžæ”¹é€² + Gennadi Motsyo - bug 報告 + Vadim Kalinnikov - é …ç›®ç¶²çµ¡æ”¯æŒ + Erik Ölsar - 光標皮膚ã€ç”¨æˆ¶ç•Œé¢æ”¹é€² + Funda Wang - cmake 文件修正 + Michail Zheludkov - ffmpeg æ’件修正 + MichaÅ‚ Grosicki - alsa æ’件修正 + Panagiotis Papadopoulos - 用戶界é¢ä¿®æ­£ï¼Œbug 報告 + Pino Toscano - å¯ç§»æ¤æ€§è£œä¸ + Karel Volný - 多項修正 + Sebastian Pipping - bs2b è£œä¸ + Stefan Koelling - 一些編譯修正 + Yaakov Selkowitz - cygwin è£œä¸ diff --git a/src/plugins/Ui/skinned/txt/translators_cs.txt b/src/plugins/Ui/skinned/txt/translators_cs.txt new file mode 100644 index 000000000..545c16425 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_cs.txt @@ -0,0 +1,24 @@ +Brazilská portugalÅ¡tina: + Klaos Lacerda + Bruno Gonçalves + +TradiÄní ÄínÅ¡tina: + lon + +ZjednoduÅ¡ená ÄínÅ¡tina: + lon + +ÄŒeÅ¡tina: + Karel Volný + +NÄ›mÄina: + Stefan Koelling + +RuÅ¡tina: + Ilya Kotov + +TureÄtina: + Mustafa GUNAY + +UkrajinÅ¡tina: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_de.txt b/src/plugins/Ui/skinned/txt/translators_de.txt new file mode 100644 index 000000000..eae2ab01b --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_de.txt @@ -0,0 +1,53 @@ +Brasilianisch Portugiesisch: + Klaos Lacerda + Bruno Gonçalves + +Chinesisch (Langzeichen): + lon + +Chinesisch (Kurzzeichen): + lon + +Deutsch: + Stefan Koelling + Panagiotis Papadopoulos + +Französisch: + Stanislas Zeller + +Italienisch: + Gian Paolo Renello + +Japanisch: + SimaMoto,RyoTa + +Kasachisch: + Baurzhan Muftakhidinov + +Litauisch: + Algirdas Butkus + +Niederländisch: + Ronald Uitermark + +Polnisch: + Grzegorz Gibas + +Russisch: + Ilya Kotov + +Spanisch: + Félix Medrano + +Tschechisch: + Karel Volný + +Türkisch: + Mustafa GUNAY + Bilgesu Güngör + +Ukrainisch: + Gennadi Motsyo + +Ungarisch: + Németh Gábor \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/translators_en.txt b/src/plugins/Ui/skinned/txt/translators_en.txt new file mode 100644 index 000000000..9d13b3ac3 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_en.txt @@ -0,0 +1,56 @@ +Brazilian Portuguese: + Klaos Lacerda + Bruno Gonçalves + +Chinese Traditional: + lon + +Chinese Simplified: + lon + +Czech: + Karel Volný + +Dutch: + Ronald Uitermark + +French: + Stanislas Zeller + +German: + Stefan Koelling + Panagiotis Papadopoulos + +Hungarian: + Németh Gábor + +Italian: + Gian Paolo Renello + +Japanese: + Ryota Shimamoto + +Kazakh: + Baurzhan Muftakhidinov + +Lithuanian: + Algirdas Butkus + +Polish: + Grzegorz Gibas + +Russian: + Ilya Kotov + +Slovak: + Ján ÄŽanovský + +Spanish: + Félix Medrano + +Turkish: + Mustafa GUNAY + Bilgesu Güngör + +Ukrainian: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_es.txt b/src/plugins/Ui/skinned/txt/translators_es.txt new file mode 100644 index 000000000..3d5570dd2 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_es.txt @@ -0,0 +1,47 @@ +Portugués de Brasil: + Klaos Lacerda + Bruno Gonçalves + +Chino tradicional: + lon + +Chino simplificado: + lon + +Checo: + Karel Volný + +Holandés: + Ronald Uitermark + +Francés: + Stanislas Zeller + +Alemán: + Stefan Koelling + Panagiotis Papadopoulos + +Húngaro: + Németh Gábor + +Italiano: + Gian Paolo Renello + +Kazajo: + Baurzhan Muftakhidinov + +Lituano: + Algirdas Butkus + +Polaco: + Grzegorz Gibas + +Ruso: + Ilya Kotov + +Turco: + Mustafa GUNAY + Bilgesu Güngör + +Ucraniano: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_it.txt b/src/plugins/Ui/skinned/txt/translators_it.txt new file mode 100644 index 000000000..8a238be38 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_it.txt @@ -0,0 +1,34 @@ +Brasiliano portoghese: + Klaos Lacerda + Bruno Gonçalves + +Cinese tradizionale: + lon + +Cinese semplificato: + lon + +Ceco: + Karel Volný + +Francese: + Stanislas Zeller + +Italiano: + Gian Paolo Renello + +Polacco: + Grzegorz Gibas + +Russo: + Ilya Kotov + +Tedesco: + Stefan Koelling + Panagiotis Papadopoulos + +Turco: + Mustafa GUNAY + +Ucraino: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_ja.txt b/src/plugins/Ui/skinned/txt/translators_ja.txt new file mode 100644 index 000000000..11c5537d7 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_ja.txt @@ -0,0 +1,53 @@ +イタリア語: + Gian Paolo Renello + +ウクライナ語: + Gennadi Motsyo + +オランダ語: + Ronald Uitermark + +カザフ語: + Baurzhan Muftakhidinov + +スペイン語: + Félix Medrano + +ãƒã‚§ã‚³èªž: + Karel Volný + +ドイツ語: + Stefan Koelling + Panagiotis Papadopoulos + +トルコ語: + Mustafa GUNAY + Bilgesu Güngör + +ãƒãƒ³ã‚¬ãƒªãƒ¼èªž: + Németh Gábor + +ブラジル ãƒãƒ«ãƒˆã‚¬ãƒ«èªž: + Klaos Lacerda + Bruno Gonçalves + +フランス語: + Stanislas Zeller + +ãƒãƒ¼ãƒ©ãƒ³ãƒ‰èªž: + Grzegorz Gibas + +リトアニア語: + Algirdas Butkus + +ロシア語: + Ð˜Ð»ÑŒÑ ÐšÐ¾Ñ‚Ð¾Ð² (Ilya Kotov) + +簡体字中国語: + æŽçº¢æ˜† (lon) + +ç¹ä½“字中国語: + æŽçº¢æ˜† (lon) + +日本語: + 島本良太 diff --git a/src/plugins/Ui/skinned/txt/translators_lt.txt b/src/plugins/Ui/skinned/txt/translators_lt.txt new file mode 100644 index 000000000..7cc6d8bbd --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_lt.txt @@ -0,0 +1,50 @@ +Brazilų, Portugalų: + Klaos Lacerda + Bruno Gonçalves + +Ispanų: + Gian Paolo Renello + +Kinų tradicinis: + lon + +Kinų supaprastintas: + lon + +Lenkų + Grzegorz Gibas + +ÄŒekų: + Karel Volný + +VokieÄių: + Stefan Koelling + Panagiotis Papadopoulos + +Rusų: + Ilya Kotov + +Turkų: + Mustafa GUNAY + +UkrainieÄių: + Gennadi Motsyo + +Lietuvių: + Algirdas Butkus + +Lenkų: + Grzegorz Gibas + +Rusų: + Ilya Kotov + +spanų: + Félix Medrano + +Turkų: + Mustafa GUNAY + Bilgesu Güngör + +UkrainieÄių: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_nl.txt b/src/plugins/Ui/skinned/txt/translators_nl.txt new file mode 100644 index 000000000..88211a6ae --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_nl.txt @@ -0,0 +1,47 @@ +Braziliaans Portugees: + Klaos Lacerda + Bruno Gonçalves + +Traditioneel Chinees: + lon + +Simpel Chinees: + lon + +Tsjechisch: + Karel Volný + +Nederlands: + Ronald Uitermark + +Frans: + Stanislas Zeller + +Duits: + Stefan Koelling + Panagiotis Papadopoulos + +Hongaars: + Németh Gábor + +Italiaans: + Gian Paolo Renello + +Kazachstaans: + Baurzhan Muftakhidinov + +Litouws: + Algirdas Butkus + +Pools: + Grzegorz Gibas + +Russisch: + Ilya Kotov + +Turks: + Mustafa GUNAY + Bilgesu Güngör + +Oekrains: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_pl.txt b/src/plugins/Ui/skinned/txt/translators_pl.txt new file mode 100644 index 000000000..a5ea9d78e --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_pl.txt @@ -0,0 +1,53 @@ +Brazylijski Portugalski: + Klaos Lacerda + Bruno Gonçalves + +ChiÅ„ski Tradycyjny: + lon + +ChiÅ„ski Uproszczony: + lon + +Czeski: + Karel Volný + +Holenderski: + Ronald Uitermark + +Francuski: + Stanislas Zeller + +Niemiecki: + Stefan Koelling + Panagiotis Papadopoulos + +WÄ™gierski: + Németh Gábor + +WÅ‚oski: + Gian Paolo Renello + +JapoÅ„ski: + Rjota Å imamoto + +Kazachski: + Baurzhan Muftakhidinov + +Litewski: + Algirdas Butkus + +Polski: + Grzegorz Gibas + +Rosyjski: + Ilya Kotov + +HiszpaÅ„ski: + Félix Medrano + +Turecki: + Mustafa GUNAY + Bilgesu Güngör + +UkraiÅ„ski: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_ru.txt b/src/plugins/Ui/skinned/txt/translators_ru.txt new file mode 100644 index 000000000..18152ee20 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_ru.txt @@ -0,0 +1,56 @@ +БразильÑкий португальÑкий: + Klaos Lacerda + Bruno Gonçalves + +ВенгерÑкий: + Németh Gábor + +ГолландÑкий: + Ronald Uitermark + +ИтальÑнÑкий: + Gian Paolo Renello + +ЯпонÑкий: + Рёта Симамото + +КазахÑкий: + Бауржан Муфтахидинов + +КитайÑкий традиционный: + lon + +КитайÑкий упрощённый: + lon + +ЛитовÑкий: + Algirdas Butkus + +ПольÑкий: + Grzegorz Gibas + +ЧешÑкий: + Karel Volný + +Ðемецкий: + Stefan Koelling + Panagiotis Papadopoulos + +РуÑÑкий: + Ð˜Ð»ÑŒÑ ÐšÐ¾Ñ‚Ð¾Ð² + +Словацкий: + Ján ÄŽanovský + +ИÑпанÑкий: + Félix Medrano + +Турецкий: + Mustafa GUNAY + Bilgesu Güngör + +УкраинÑкий: + Геннадий Моцьо + +ФранцузÑкий: + Stanislas Zeller diff --git a/src/plugins/Ui/skinned/txt/translators_tr.txt b/src/plugins/Ui/skinned/txt/translators_tr.txt new file mode 100644 index 000000000..1a8df1494 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_tr.txt @@ -0,0 +1,35 @@ +Brezilya Portekizcesi: + Klaos Lacerda + Bruno Gonçalves + +Geleneksel Çince: + lon + +BasitleÅŸtirilmiÅŸ Çince: + lon + +Çekce: + Karel Volný + +Fransızca: + Stanislas Zeller + +Almanca: + Stefan Koelling + Panagiotis Papadopoulos + +İtalyanca: + Gian Paolo Renello + +Polonyaca: + Grzegorz Gibas + +Rusça: + Ilya Kotov + +Türkçe: + Mustafa GUNAY + Bilgesu Güngör + +Ukraynaca: + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/txt/translators_uk_UA.txt b/src/plugins/Ui/skinned/txt/translators_uk_UA.txt new file mode 100644 index 000000000..120369499 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_uk_UA.txt @@ -0,0 +1,53 @@ +БразильÑька португальÑька: + Klaos Lacerda + Bruno Gonçalves + +УгорÑька: + Németh Gábor + +ГолландÑька: + Ronald Uitermark + +ІталійÑька: + Gian Paolo Renello + +ЯпонÑька: + Рета Сімамото + +КазахÑька: + Бауржан Муфтахідінов + +КитайÑька традиційна: + lon + +КитайÑька Ñпрощена: + lon + +ЛитовÑька: + Algirdas Butkus + +ПольÑька: + Grzegorz Gibas + +ЧеÑька: + Karel Volný + +Ðімецька: + Stefan Koelling + Panagiotis Papadopoulos + +РоÑійÑька: + Ð†Ð»Ð»Ñ ÐšÐ¾Ñ‚Ð¾Ð² + +ІÑпанÑька: + Félix Medrano + +Турецька: + Mustafa GUNAY + Bilgesu Güngör + +УкраїнÑька: + Геннадій Моцьо + +Французька: + Stanislas Zeller \ No newline at end of file diff --git a/src/plugins/Ui/skinned/txt/translators_zh_CN.txt b/src/plugins/Ui/skinned/txt/translators_zh_CN.txt new file mode 100644 index 000000000..e24bb5a29 --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_zh_CN.txt @@ -0,0 +1,54 @@ +巴西 è‘¡è„牙语: + Klaos Lacerda + Bruno Gonçalves + +简体中文: + æŽçº¢æ˜† (lon) + +ç¹ä½“中文: + æŽçº¢æ˜† (lon) + +æ·å…‹è¯­ï¼š + Karel Volný + +è·å…°è¯­: + Ronald Uitermark + +法语: + Stanislas Zeller + +德语: + Stefan Koelling + Panagiotis Papadopoulos + +匈牙利语: + Németh Gábor + +æ„大利语: + Gian Paolo Renello + +日语: + 岛本良太 (Ryota Shimamoto) + +哈è¨å…‹è¯­: + Baurzhan Muftakhidinov + +立陶宛语: + Algirdas Butkus + +波兰语: + Grzegorz Gibas + +俄语: + Ilya Kotov + +西ç­ç‰™è¯­: + Félix Medrano + +土耳其语: + Mustafa GUNAY + Bilgesu Güngör + +乌克兰语: + Gennadi Motsyo + diff --git a/src/plugins/Ui/skinned/txt/translators_zh_TW.txt b/src/plugins/Ui/skinned/txt/translators_zh_TW.txt new file mode 100644 index 000000000..2ed3da7ac --- /dev/null +++ b/src/plugins/Ui/skinned/txt/translators_zh_TW.txt @@ -0,0 +1,53 @@ +巴西 è‘¡è„牙語: + Klaos Lacerda + Bruno Gonçalves + +簡體中文: + æŽç´…昆 (lon) + +ç¹é«”中文: + æŽç´…昆 (lon) + +æ·å…‹èªžï¼š + Karel Volný + +è·è˜­èªž: + Ronald Uitermark + +法語: + Stanislas Zeller + +德語: + Stefan Koelling + Panagiotis Papadopoulos + +匈牙利語: + Németh Gábor + +æ„大利語: + Gian Paolo Renello + +日語: + 島本良太 (Ryota Shimamoto) + +哈薩克語: + Baurzhan Muftakhidinov + +立陶宛語: + Algirdas Butkus + +波蘭語: + Grzegorz Gibas + +俄語: + Ilya Kotov + +西ç­ç‰™èªž: + Félix Medrano + +土耳其語: + Mustafa GUNAY + Bilgesu Güngör + +çƒå…‹è˜­èªžï¼š + Gennadi Motsyo diff --git a/src/plugins/Ui/skinned/visualmenu.cpp b/src/plugins/Ui/skinned/visualmenu.cpp new file mode 100644 index 000000000..af8e936d2 --- /dev/null +++ b/src/plugins/Ui/skinned/visualmenu.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include + +#include +#include + +#include "pluginitem.h" +#include "visualmenu.h" + +VisualMenu::VisualMenu(QWidget *parent) : QMenu(tr("Visualization"), parent) +{ + VisualFactory *factory = 0; + foreach(factory, *Visual::factories()) + { + VisualAction *act = new VisualAction(factory, this); + addAction(act); + } +} + +VisualMenu::~VisualMenu() +{ +} + +void VisualMenu::updateActions() +{ + for(int i = 0; i < Visual::factories()->size(); ++i) + { + actions()[i]->setChecked(Visual::isEnabled(Visual::factories()->at(i))); + } +} + +VisualAction::VisualAction(VisualFactory *factory, QWidget *parent) : + QAction(factory->properties().name, parent) +{ + setCheckable (true); + setChecked (Visual::isEnabled(factory)); + m_factory = factory; + connect(this, SIGNAL(triggered(bool)), SLOT(select(bool))); +} + +void VisualAction::select(bool select) +{ + Visual::setEnabled(m_factory, select); +} diff --git a/src/plugins/Ui/skinned/visualmenu.h b/src/plugins/Ui/skinned/visualmenu.h new file mode 100644 index 000000000..0039c7aaf --- /dev/null +++ b/src/plugins/Ui/skinned/visualmenu.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2007-2010 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef VISUALMENU_H +#define VISUALMENU_H + +#include +#include + +class VisualFactory; + +/** + @author Ilya Kotov +*/ +class VisualMenu : public QMenu +{ + Q_OBJECT +public: + VisualMenu(QWidget *parent = 0); + + ~VisualMenu(); + +public slots: + void updateActions(); +}; + +class VisualAction : public QAction +{ + Q_OBJECT +public: + VisualAction(VisualFactory *factory, QWidget *parent = 0); + +private slots: + void select(bool); + +private: + VisualFactory *m_factory; + +}; + +#endif diff --git a/src/plugins/Ui/skinned/volumebar.cpp b/src/plugins/Ui/skinned/volumebar.cpp new file mode 100644 index 000000000..e0829e659 --- /dev/null +++ b/src/plugins/Ui/skinned/volumebar.cpp @@ -0,0 +1,127 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include "skin.h" +#include "button.h" +#include "mainwindow.h" +#include "volumebar.h" + + +VolumeBar::VolumeBar(QWidget *parent) : PixmapWidget(parent) +{ + m_skin = Skin::instance(); + connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); + setPixmap(m_skin->getVolumeBar(0)); + mw = qobject_cast(window()); + m_moving = false; + m_min = 0; + m_max = 100; + m_old = m_value = 0; + draw(false); +} + +VolumeBar::~VolumeBar() +{} + +void VolumeBar::mousePressEvent(QMouseEvent *e) +{ + m_moving = true; + press_pos = e->x(); + if(m_posx() && e->x()ratio()) + { + press_pos = e->x()-m_pos; + emit sliderPressed(); + } + else + { + m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); + press_pos = 6*m_skin->ratio(); + emit sliderPressed(); + if (m_value != m_old) + emit sliderMoved(m_value); + } + draw(); +} + +void VolumeBar::mouseMoveEvent (QMouseEvent *e) +{ + if(m_moving) + { + int po = e->x(); + po = po - press_pos; + + if(0<=po && po<=width()-18*m_skin->ratio()) + { + m_value = convert(po); + draw(); + emit sliderMoved(m_value); + } + } +} + +void VolumeBar::mouseReleaseEvent(QMouseEvent*) +{ + m_moving = false; + draw(false); + m_old = m_value; + emit sliderReleased(); +} + +void VolumeBar::setValue(int v) +{ + if (m_moving || m_max == 0) + return; + m_value = v; + draw(false); +} + +void VolumeBar::setMax(int max) +{ + m_max = max; + draw(false); +} + +void VolumeBar::updateSkin() +{ + resize(m_skin->getVolumeBar(0).size()); + draw(false); + setCursor(m_skin->getCursor(Skin::CUR_VOLBAL)); +} + +void VolumeBar::draw(bool pressed) +{ + int p=int(ceil(double(m_value-m_min)*(width()-18*m_skin->ratio())/(m_max-m_min))); + m_pixmap = m_skin->getVolumeBar(27*(m_value-m_min)/(m_max-m_min)); + QPainter paint(&m_pixmap); + if(pressed) + paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_P)); + else + paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_N)); + setPixmap(m_pixmap); + m_pos = p; +} + +int VolumeBar::convert(int p) +{ + return int(ceil(double(m_max-m_min)*(p)/(width()-18*m_skin->ratio())+m_min)); +} diff --git a/src/plugins/Ui/skinned/volumebar.h b/src/plugins/Ui/skinned/volumebar.h new file mode 100644 index 000000000..47d4dcb0d --- /dev/null +++ b/src/plugins/Ui/skinned/volumebar.h @@ -0,0 +1,76 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef VOLUMEBAR_H +#define VOLUMEBAR_H + +#include "pixmapwidget.h" + +class Skin; +class MainWindow; + +/** + @author Ilya Kotov +*/ +class VolumeBar : public PixmapWidget +{ +Q_OBJECT +public: + VolumeBar(QWidget *parent = 0); + + ~VolumeBar(); + + int value() + { + return m_value; + } + int isPressed() + { + return m_moving; + } + +public slots: + void setValue(int); + void setMax(int); + +signals: + void sliderMoved (int); + void sliderPressed(); + void sliderReleased(); + +private slots: + void updateSkin(); + +private: + Skin *m_skin; + bool m_moving; + int press_pos; + int m_max, m_min, m_pos, m_value, m_old; + QPixmap m_pixmap; + MainWindow *mw; + int convert(int); // value = convert(position); + void draw(bool pressed = true); + +protected: + void mousePressEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); +}; + +#endif diff --git a/src/plugins/Ui/skinned/windowsystem.cpp b/src/plugins/Ui/skinned/windowsystem.cpp new file mode 100644 index 000000000..4b66ae025 --- /dev/null +++ b/src/plugins/Ui/skinned/windowsystem.cpp @@ -0,0 +1,213 @@ +/*************************************************************************** + * Based on Licq * + * Copyright (C) 2006-2009 Licq developers * + * Copyright (C) 2011 Ilya Kotov * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "windowsystem.h" +#include +#ifdef Q_WS_X11 +#include +#include +#include +#include +#include +#endif + +#ifdef Q_WS_X11 +void WindowSystem::ghostWindow(WId win) +{ + Display* dsp = QX11Info::display(); + Window root = DefaultRootWindow(dsp); + + Atom win_state = XInternAtom(dsp, "_NET_WM_STATE", False); + Atom win_state_add = XInternAtom(dsp, "_NET_WM_STATE_ADD", False); + Atom win_state_settings[] = + { + XInternAtom(dsp, "_NET_WM_STATE_SKIP_TASKBAR", False), + XInternAtom(dsp, "_NET_WM_STATE_SKIP_PAGER", False) + }; + XChangeProperty(dsp, win, win_state, XA_ATOM, 32, PropModeReplace, + reinterpret_cast(&win_state_settings), 2); + + XEvent xev; + xev.type = ClientMessage; + xev.xclient.type = ClientMessage; + xev.xclient.display = dsp; + xev.xclient.window = win; + xev.xclient.message_type = win_state; + xev.xclient.format = 32; + xev.xclient.data.l[0] = win_state_add; + xev.xclient.data.l[1] = win_state_settings[0]; + xev.xclient.data.l[2] = win_state_settings[1]; + + XSendEvent(dsp, root, false, + SubstructureRedirectMask | SubstructureNotifyMask, &xev); +} + +QString WindowSystem::netWindowManagerName() +{ + Display* dsp = QX11Info::display(); + WId root = DefaultRootWindow(dsp); + + unsigned char* retValue1 = NULL; + unsigned char* retValue2 = NULL; + + retValue1 = getWindowProperty(root, "_NET_SUPPORTING_WM_CHECK"); + if (retValue1 == NULL) + return QString(); + + WId win = *(reinterpret_cast(retValue1)); + + retValue2 = getWindowProperty(win, "_NET_SUPPORTING_WM_CHECK"); + if (retValue2 == NULL) + { + XFree(retValue1); + return QString(); + } + + if (win != *(reinterpret_cast(retValue2))) + { + XFree(retValue1); + XFree(retValue2); + return QString(); + } + + XFree(retValue2); + retValue2 = NULL; + + retValue2 = getWindowProperty(win, "_NET_WM_NAME"); + XFree(retValue1); + if (retValue2 == NULL) + return QString(); + + QString name = QString((char *)retValue2); + XFree(retValue2); + return name; +} + +void WindowSystem::changeWinSticky(WId win, bool stick) +{ + qDebug("WindowSystem: setting sticky state of window 0x%lx to %s.", + static_cast(win), stick ? "true" : "false"); + Display* dsp = QX11Info::display(); + Window root = DefaultRootWindow(dsp); + + unsigned long desktop = ~(0UL); + + if (!stick) + { + unsigned char* tmp = getWindowProperty(root, "_NET_CURRENT_DESKTOP"); + + if (tmp == NULL) + qWarning("WindowSystem: error reading current desktop property."); + else + { + desktop = *(reinterpret_cast(tmp)); + XFree(tmp); + } + } + + XEvent xev; + xev.type = ClientMessage; + xev.xclient.type = ClientMessage; + xev.xclient.display = dsp; + xev.xclient.window = win; + xev.xclient.message_type = XInternAtom(dsp, "_NET_WM_DESKTOP", False); + xev.xclient.format = 32; + xev.xclient.data.l[0] = desktop; + + XSendEvent(dsp, root, False, + SubstructureRedirectMask | SubstructureNotifyMask, &xev); +} + +void WindowSystem::setWinHint(WId win, const char *res_name, const char *res_class) +{ + Display* dsp = QX11Info::display(); + XClassHint hint; + hint.res_name = strdup(res_name); + hint.res_class = strdup(res_class); + XSetClassHint(dsp, win, &hint); + free(hint.res_name); + free(hint.res_class); +} + +unsigned char* WindowSystem::getWindowProperty(WId win, const char* prop) +{ + Display* dsp = QX11Info::display(); + + // We inhibit new Atom creation since if you request for it + // then such Atom most probably exists already. + // Otherwise, no surprise we return NULL here. + Atom reqAtom = XInternAtom(dsp, prop, True); + + if (reqAtom == None) + return NULL; + + int retCheck = None; + Atom retType = None; + int retFormat = 0; + unsigned long retItems = 0UL; + unsigned long retMoreBytes = 0UL; + unsigned char* retValue = NULL; + + // Check if the property exists and calculate its length. + retCheck = XGetWindowProperty(dsp, win, + reqAtom, 0L, 0L, False, AnyPropertyType, + &retType, &retFormat, &retItems, &retMoreBytes, &retValue); + + // The value is most probably empty, since we requested to read + // only 0L length, thus, it's just useless... + if (retValue != NULL) + { + XFree(retValue); + retValue = NULL; + } + + if (retCheck != Success || + retType == None || + retMoreBytes == 0) + return NULL; + + // These are not needed for now. + retCheck = None; + retFormat = 0; + retItems = 0UL; + + // Convert the byte length into 32bit multiples. + if (retMoreBytes % 4 != 0) + retMoreBytes += 4 - retMoreBytes % 4; + retMoreBytes /= 4; + + // Now request the actual property value with correct length and type. + retCheck = XGetWindowProperty(dsp, win, + reqAtom, 0L, retMoreBytes, False, retType, + &retType, &retFormat, &retItems, &retMoreBytes, &retValue); + + if (retCheck != Success || + retMoreBytes != 0) + { + if (retValue != NULL) + XFree(retValue); + return NULL; + } + + return retValue; +} + +#endif diff --git a/src/plugins/Ui/skinned/windowsystem.h b/src/plugins/Ui/skinned/windowsystem.h new file mode 100644 index 000000000..a9d8fb001 --- /dev/null +++ b/src/plugins/Ui/skinned/windowsystem.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Based on Licq * + * Copyright (C) 2006-2009 Licq developers * + * Copyright (C) 2011 Ilya Kotov * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef WINDOWSYSTEM_H +#define WINDOWSYSTEM_H + +#include + +class WindowSystem +{ +public: +#ifdef Q_WS_X11 + static void ghostWindow(WId id); + static QString netWindowManagerName(); + static void changeWinSticky(WId win, bool stick); + static void setWinHint(WId win, const char *res_name, const char *res_class); +private: + static unsigned char* getWindowProperty(WId win, const char* prop); +#endif +}; +#endif // WINDOWSYSTEM_H diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 12a27a3fe..8128cd3db 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -2,7 +2,8 @@ SUBDIRS += Input \ Output \ General \ Visual \ - Transports + Transports \ + Ui unix:SUBDIRS += Effect \ PlaylistFormats \ diff --git a/src/qmmpui/qmmpui.pro b/src/qmmpui/qmmpui.pro index b0e6ac46f..b32bdf587 100644 --- a/src/qmmpui/qmmpui.pro +++ b/src/qmmpui/qmmpui.pro @@ -38,7 +38,9 @@ HEADERS += general.h \ tageditor_p.h \ playlistmanager.h \ metadataformatter.h \ - templateeditor.h + templateeditor.h \ + uifactory.h \ + uiloader.h SOURCES += general.cpp \ generalhandler.cpp \ playlistparser.cpp \ @@ -55,7 +57,8 @@ SOURCES += general.cpp \ tageditor.cpp \ playlistmanager.cpp \ metadataformatter.cpp \ - templateeditor.cpp + templateeditor.cpp \ + uiloader.cpp FORMS += forms/detailsdialog.ui \ forms/tageditor.ui \ forms/templateeditor.ui diff --git a/src/qmmpui/uifactory.h b/src/qmmpui/uifactory.h new file mode 100644 index 000000000..bccb632aa --- /dev/null +++ b/src/qmmpui/uifactory.h @@ -0,0 +1,78 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef UIFACTORY_H +#define UIFACTORY_H + +class QObject; +class QTranslator; +class QDialog; +class QString; +class QWidget; +class Control; +class General; + +/*! @brief Helper class to store user interface plugin properies. + */ +class UiProperties +{ +public: + /*! + * Constructor + */ + UiProperties() + { + hasAbout = false; + } + QString name; /*!< File dialog plugin full name */ + QString shortName; /*!< File dialog short name for internal usage */ + bool hasAbout; /*!< Should be \b true if plugin has about dialog, otherwise returns \b false */ +}; +/*! @brief User interface plugin interface. + * @author Ilya Kotov + */ +class UiFactory +{ +public: + /*! + * Object destructor. + */ + virtual ~UiFactory() {} + /*! + * Returns user interface plugin properties. + */ + virtual const UiProperties properties() const = 0; + /*! + * Creates user interface instance. + */ + virtual QObject *create() = 0; + /*! + * Shows about dialog. + * @param parent Parent widget. + */ + virtual void showAbout(QWidget *parent) = 0; + /*! + * Creates QTranslator object of the system locale. Should return \b 0 if translation doesn't exist. + * @param parent Parent object. + */ + virtual QTranslator *createTranslator(QObject *parent) = 0; +}; + +Q_DECLARE_INTERFACE(UiFactory, "UiFactory/1.0") +#endif diff --git a/src/qmmpui/uiloader.cpp b/src/qmmpui/uiloader.cpp new file mode 100644 index 000000000..09979d18a --- /dev/null +++ b/src/qmmpui/uiloader.cpp @@ -0,0 +1,96 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include "uiloader.h" + +QList *UiLoader::m_factories = 0; +QStringList UiLoader::m_files; + +void UiLoader::checkFactories() +{ + if (!m_factories) + { + m_files.clear(); + m_factories = new QList; + QDir pluginsDir(Qmmp::pluginsPath()); + pluginsDir.cd("Ui"); + foreach (QString fileName, pluginsDir.entryList(QDir::Files)) + { + QPluginLoader loader(pluginsDir.absoluteFilePath(fileName)); + QObject *plugin = loader.instance(); + if (loader.isLoaded()) + qDebug("UiLoader: plugin loaded - %s", qPrintable(fileName)); + else + qWarning("UiLoader: %s", qPrintable(loader.errorString())); + + UiFactory *factory = 0; + if (plugin) + factory = qobject_cast(plugin); + + if (factory) + { + m_factories->append(factory); + m_files << pluginsDir.absoluteFilePath(fileName); + qApp->installTranslator(factory->createTranslator(qApp)); + } + } + } +} + +QList *UiLoader::factories() +{ + checkFactories(); + return m_factories; +} + +QStringList UiLoader::files() +{ + checkFactories(); + return m_files; +} + +void UiLoader::setCurrentUiFactory(UiFactory* factory) +{ + checkFactories(); + if (!m_factories->contains(factory)) + return; + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + settings.setValue ("Ui/current_plugin", factory->properties().shortName); +} + +UiFactory *UiLoader::currentUiFactory() +{ + checkFactories(); + QSettings settings (Qmmp::configFile(), QSettings::IniFormat); + QString name = settings.value("Ui/current_plugin", "skinned").toString(); + foreach(UiFactory *factory, *m_factories) + { + if (factory->properties().shortName == name) + return factory; + } + if (!m_factories->isEmpty()) + return m_factories->at(0); + return 0; +} diff --git a/src/qmmpui/uiloader.h b/src/qmmpui/uiloader.h new file mode 100644 index 000000000..0852ca901 --- /dev/null +++ b/src/qmmpui/uiloader.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * Copyright (C) 2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef UI_H +#define UI_H + +#include +#include +#include "uifactory.h" + +/*! @brief The UiLoader provides user interface plugins access + * @author Ilya Kotov + */ +class UiLoader +{ +public: + /*! + * Returns a list of the loaded ui plugin factories. + */ + static QList *factories(); + /*! + * Returns a list of the loaded ui plugin files. + */ + static QStringList files(); + /*! + * Selects active user interface factory. + * @param factory Ui plugin factory. + */ + static void setCurrentUiFactory(UiFactory* factory); + /*! + * Returns \b true if general plugin is enabled, otherwise returns \b false + * @param factory General plugin factory. + */ + static UiFactory *currentUiFactory(); + +private: + static QList *m_factories; + static QStringList m_files; + static void checkFactories(); +}; + +#endif //UI_H diff --git a/src/ui/aboutdialog.cpp b/src/ui/aboutdialog.cpp deleted file mode 100644 index 5728697b9..000000000 --- a/src/ui/aboutdialog.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2006 by Ilya Kotov * -* forkotov02@hotmail.ru * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ - - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "aboutdialog.h" - -static QString getstringFromResource(const QString& res_file) -{ - QString ret_string; - QFile file(res_file); - if (file.open(QIODevice::ReadOnly)) - { - QTextStream ts(&file); - ts.setCodec("UTF-8"); - ret_string = ts.readAll(); - file.close(); - } - return ret_string; -} - -AboutDialog::AboutDialog(QWidget* parent, Qt::WFlags fl) - : QDialog( parent, fl ) -{ - setupUi(this); - setAttribute(Qt::WA_QuitOnClose, false); - licenseTextEdit->setPlainText(getstringFromResource(":COPYING")); - aboutTextEdit->setHtml(loadAbout()); - authorsTextEdit->setPlainText(getstringFromResource(tr(":/txt/authors_en.txt"))); - thanksToTextEdit->setPlainText(getstringFromResource(tr(":/txt/thanks_en.txt"))); - translatorsTextEdit->setPlainText(getstringFromResource(tr(":/txt/translators_en.txt"))); -} - -AboutDialog::~AboutDialog() -{} - -/*$SPECIALIZATION$*/ -void AboutDialog::accept() -{ - QDialog::accept(); -} - -QString AboutDialog::loadAbout() -{ - QString text; - text.append(""); - text.append(""); - text.append(""); - text.append("

"+tr("Qt-based Multimedia Player (Qmmp)")+"

"); - text.append("

"+tr("Version:")+" "+ Qmmp::strVersion() + "

"); - text.append("

"+getstringFromResource(tr(":txt/description_en.txt"))+"

"); - text.append("
"+tr("Input plugins:")+"
"); - text.append("
    "); - foreach(DecoderFactory *fact, *Decoder::factories()) - { - text.append("
  • "); - text.append(fact->properties().name); - text.append("
  • "); - } - text.append("
"); - text.append("
"+tr("Output plugins:")+"
"); - text.append("
    "); - foreach(OutputFactory *fact, *Output::factories()) - { - text.append("
  • "); - text.append(fact->properties().name); - text.append("
  • "); - } - text.append("
"); - text.append("
"+tr("Visual plugins:")+"
"); - text.append("
    "); - foreach(VisualFactory *fact, *Visual::factories()) - { - text.append("
  • "); - text.append(fact->properties().name); - text.append("
  • "); - } - text.append("
"); - text.append("
"+tr("Effect plugins:")+"
"); - text.append("
    "); - foreach(EffectFactory *fact, *Effect::factories()) - { - text.append("
  • "); - text.append(fact->properties().name); - text.append("
  • "); - } - text.append("
"); - text.append("
"+tr("General plugins:")+"
"); - text.append("
    "); - foreach(GeneralFactory *fact, *General::factories()) - { - text.append("
  • "); - text.append(fact->properties().name); - text.append("
  • "); - } - text.append("
"); - - return text; -} diff --git a/src/ui/aboutdialog.h b/src/ui/aboutdialog.h deleted file mode 100644 index 2d8384ea4..000000000 --- a/src/ui/aboutdialog.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2006 by Ilya Kotov * -* forkotov02@hotmail.ru * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ - -#ifndef ABOUTDIALOG_H -#define ABOUTDIALOG_H - -#include -#include "ui_aboutdialog.h" - -/** - @author Vladimir Kuznetsov - */ - -class AboutDialog : public QDialog, private Ui::AboutDialog -{ - Q_OBJECT -public: - AboutDialog(QWidget* parent = 0, Qt::WFlags fl = 0 ); - ~AboutDialog(); - -protected slots: - virtual void accept(); - -private: - QString loadAbout(); - -}; - -#endif - diff --git a/src/ui/actionmanager.cpp b/src/ui/actionmanager.cpp deleted file mode 100644 index f4689ecd0..000000000 --- a/src/ui/actionmanager.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include "actionmanager.h" - -ActionManager *ActionManager::m_instance = 0; - -ActionManager::ActionManager(QObject *parent) : - QObject(parent) -{ - m_instance = this; - m_settings = new QSettings(Qmmp::configFile(), QSettings::IniFormat); - m_settings->beginGroup("Shortcuts"); - //playback - m_actions[PLAY] = createAction(tr("&Play"), "play", tr("X"), "media-playback-start"); - m_actions[PAUSE] = createAction(tr("&Pause"), "pause", tr("C"), "media-playback-pause"); - m_actions[STOP] = createAction(tr("&Stop"), "stop", tr("V"), "media-playback-stop"); - m_actions[PREVIOUS] = createAction(tr("&Previous"), "previous", tr("Z"), "media-skip-backward"); - m_actions[NEXT] = createAction(tr("&Next"), "next", tr("B"), "media-skip-forward"); - m_actions[PLAY_PAUSE] = createAction(tr("&Play/Pause"), "play_pause", tr("Space")); - m_actions[JUMP] = createAction(tr("&Jump to File"), "jump", tr("J"), "go-up"); - m_actions[REPEAT_ALL] = createAction2(tr("&Repeat Playlist"), "repeate_playlist", tr("R")); - m_actions[REPEAT_TRACK] = createAction2(tr("&Repeat Track"), "repeate_track", tr("Ctrl+R")); - m_actions[SHUFFLE] = createAction2(tr("&Shuffle"), "shuffle", tr("S")); - m_actions[NO_PL_ADVANCE] = createAction2(tr("&No Playlist Advance"), "no_playlist_advance", - tr("Ctrl+N")); - m_actions[STOP_AFTER_SELECTED] = createAction(tr("&Stop After Selected"), "stop_after_selected", - tr("Ctrl+S")); - m_actions[CLEAR_QUEUE] = createAction(tr("&Clear Queue"), "clear_queue", tr("Alt+Q")); - //view - m_actions[SHOW_PLAYLIST] = createAction2(tr("Show Playlist"), "show_playlist", tr("Alt+E")); - m_actions[SHOW_EQUALIZER] = createAction2(tr("Show Equalizer"), "show_equalizer", tr("Alt+G")); - m_actions[WM_ALLWAYS_ON_TOP] = createAction2(tr("Always on Top"), "always_on_top", ""); - m_actions[WM_STICKY] = createAction2(tr("Put on All Workspaces"), "General/always_on_top", ""); - m_actions[WM_DOUBLE_SIZE] = createAction2(tr("Double Size"), "double_size", tr("Meta+D")); - //playlist - m_actions[PL_ADD_FILE] = createAction(tr("&Add File"), "add_file", tr("F"), "audio-x-generic"); - m_actions[PL_ADD_DIRECTORY] = createAction(tr("&Add Directory"), "add_dir", tr("D"), "folder"); - m_actions[PL_ADD_URL] = createAction(tr("&Add Url"), "add_url", tr("U"), "network-server"); - m_actions[PL_REMOVE_SELECTED] = createAction(tr("&Remove Selected"), "remove_selected", - tr("Del"), "edit-delete"); - m_actions[PL_REMOVE_ALL] = createAction(tr("&Remove All"), "remove_all", "", "edit-clear"); - m_actions[PL_REMOVE_UNSELECTED] = createAction(tr("&Remove Unselected"), "remove_unselected", - "", "edit-delete"); - m_actions[PL_REMOVE_INVALID] = createAction(tr("Remove unavailable files"), "remove_invalid", - "", "dialog-error"); - m_actions[PL_REMOVE_DUPLICATES] = createAction(tr("Remove duplicates"), "remove_duplicates", ""); - m_actions[PL_ENQUEUE] = createAction(tr("&Queue Toggle"), "enqueue", tr("Q")); - m_actions[PL_INVERT_SELECTION] = createAction(tr("Invert Selection"), "invert_selection", ""); - m_actions[PL_CLEAR_SELECTION] = createAction(tr("&Select None"), "clear_selection", ""); - m_actions[PL_SELECT_ALL] = createAction(tr("&Select All"), "select_all", - tr("Ctrl+A"), "edit-select-all"); - m_actions[PL_SHOW_INFO] = createAction(tr("&View Track Details"), "show_info", tr("Alt+I"), - "dialog-information"); - m_actions[PL_NEW] = createAction(tr("&New List"), "new_pl", tr("Ctrl+T"), "document-new"); - m_actions[PL_CLOSE] = createAction(tr("&Delete List"), "close_pl", tr("Ctrl+W"), "window-close"); - m_actions[PL_LOAD] = createAction(tr("&Load List"), "load_pl", tr("O"), "document-open"); - m_actions[PL_SAVE] = createAction(tr("&Save List"), "save_pl", tr("Shift+S"), "document-save-as"); - m_actions[PL_SELECT_NEXT] = createAction(tr("&Select Next Playlist"), "next_pl", - tr("Ctrl+PgDown"), "go-next"); - m_actions[PL_SELECT_PREVIOUS] = createAction(tr("&Select Previous Playlist"), "prev_pl", - tr("Ctrl+PgUp"), "go-previous"); - m_actions[PL_SHOW_MANAGER] = createAction(tr("&Show Playlists"), "show_playlists", - tr("P"), "view-list-details"); - //other - m_actions[SETTINGS] = createAction(tr("&Settings"), "show_settings", tr("Ctrl+P"), "configure"); - m_actions[ABOUT] = createAction(tr("&About"), "about", "", ":/32x32/qmmp.png"); - m_actions[ABOUT_QT] = createAction(tr("&About Qt"), "about_qt", ""); - m_actions[QUIT] = createAction(tr("&Exit"), "exit", tr("Ctrl+Q"), "application-exit"); - m_settings->endGroup(); - delete m_settings; - m_settings = 0; -} - -ActionManager::~ActionManager() -{ - m_instance = 0; -} - -QAction *ActionManager::action(int type) -{ - return m_actions[type]; -} - -QAction *ActionManager::use(int type, const QObject *receiver, const char *member) -{ - QAction *act = m_actions[type]; - connect(act,SIGNAL(triggered(bool)), receiver, member); - return act; -} - -ActionManager* ActionManager::instance() -{ - return m_instance; -} - -QAction *ActionManager::createAction(QString name, QString confKey, QString key, QString iconName) -{ - QAction *action = new QAction(name, this); - action->setShortcut(m_settings->value(confKey, key).toString()); - action->setObjectName(confKey); - if(iconName.isEmpty()) - return action; - if(QFile::exists(iconName)) - action->setIcon(QIcon(iconName)); - else - action->setIcon(QIcon::fromTheme(iconName)); - return action; -} - -QAction *ActionManager::createAction2(QString name, QString confKey, QString key) -{ - QAction *action = createAction(name, confKey, key); - action->setCheckable(true); - return action; -} - -void ActionManager::saveActions() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - foreach(QAction *action, m_actions.values()) - { - settings.setValue(QString("Shortcuts/")+action->objectName(), action->shortcut()); - } -} diff --git a/src/ui/actionmanager.h b/src/ui/actionmanager.h deleted file mode 100644 index 33e6302fb..000000000 --- a/src/ui/actionmanager.h +++ /dev/null @@ -1,111 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ACTIONMANAGER_H -#define ACTIONMANAGER_H - -#include -#include -#include - -class QAction; -class QSettings; - -#define SET_ACTION(type, receiver, member) ActionManager::instance()->use(type, receiver, member) -#define ACTION(type) ActionManager::instance()->action(type) - -/** - @author Ilya Kotov -*/ -class ActionManager : public QObject -{ - Q_OBJECT -public: - explicit ActionManager(QObject *parent = 0); - ~ActionManager(); - - enum Type - { - PLAY = 0, - PAUSE, - STOP, - PREVIOUS, - NEXT, - PLAY_PAUSE, - JUMP, - - REPEAT_ALL, - REPEAT_TRACK, - SHUFFLE, - NO_PL_ADVANCE, - STOP_AFTER_SELECTED, - CLEAR_QUEUE, - - SHOW_PLAYLIST, - SHOW_EQUALIZER, - - WM_ALLWAYS_ON_TOP, - WM_STICKY, - WM_DOUBLE_SIZE, - - PL_ADD_FILE, - PL_ADD_DIRECTORY, - PL_ADD_URL, - PL_REMOVE_SELECTED, - PL_REMOVE_ALL, - PL_REMOVE_UNSELECTED, - PL_REMOVE_INVALID, - PL_REMOVE_DUPLICATES, - PL_ENQUEUE, - PL_INVERT_SELECTION, - PL_CLEAR_SELECTION, - PL_SELECT_ALL, - PL_SHOW_INFO, - PL_NEW, - PL_CLOSE, - PL_LOAD, - PL_SAVE, - PL_SELECT_NEXT, - PL_SELECT_PREVIOUS, - PL_SHOW_MANAGER, - - SETTINGS, - ABOUT, - ABOUT_QT, - QUIT, - }; - - QAction *action(int type); - QAction *use(int type, const QObject *receiver, const char *member); - QList actions(); - void saveActions(); - static ActionManager* instance(); - -private: - QAction *createAction(QString name, QString confKey, QString key, QString iconName = QString()); - QAction *createAction2(QString name, QString confKey, QString key); - - QSettings *m_settings; - QHash m_actions; - static ActionManager *m_instance; - -}; - -#endif // ACTIONMANAGER_H diff --git a/src/ui/addurldialog.cpp b/src/ui/addurldialog.cpp deleted file mode 100644 index 5b65337db..000000000 --- a/src/ui/addurldialog.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "addurldialog.h" - -#define HISTORY_SIZE 10 - -AddUrlDialog::AddUrlDialog( QWidget * parent, Qt::WindowFlags f) : QDialog(parent,f) -{ - setupUi(this); - setAttribute(Qt::WA_DeleteOnClose); - setAttribute(Qt::WA_QuitOnClose, false); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_history = settings.value("URLDialog/history").toStringList(); - urlComboBox->addItems(m_history); - m_http = new QNetworkAccessManager(this); - //load global proxy settings - QmmpSettings *gs = QmmpSettings::instance(); - if (gs->isProxyEnabled()) - { - QNetworkProxy proxy(QNetworkProxy::HttpProxy, gs->proxy().host(), gs->proxy().port()); - if(gs->useProxyAuth()) - { - proxy.setUser(gs->proxy().userName()); - proxy.setPassword(gs->proxy().password()); - } - m_http->setProxy(proxy); - } -} - -AddUrlDialog::~AddUrlDialog() -{ - if ( m_history.size() > HISTORY_SIZE) - m_history.removeLast(); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.setValue("URLDialog/history", m_history); -} - -QPointer AddUrlDialog::instance = 0; - -void AddUrlDialog::popup(QWidget* parent,PlayListModel* model ) -{ - if (!instance) - { - instance = new AddUrlDialog(parent); - instance->setModel(model); - } - instance->show(); - instance->raise(); -} - -void AddUrlDialog::accept( ) -{ - if (!urlComboBox->currentText().isEmpty()) - { - QString s = urlComboBox->currentText(); - if (!s.startsWith("http://") && !s.contains("://")) - s.prepend("http://"); - m_history.removeAll(s); - m_history.prepend(s); - - if (s.startsWith("http://")) - { - //try to download playlist - PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); - if (prs) - { - connect(m_http, SIGNAL(finished (QNetworkReply *)), SLOT(readResponse(QNetworkReply *))); - QNetworkRequest request; - request.setUrl(QUrl(s)); - request.setRawHeader("User-Agent", QString("qmmp/%1").arg(Qmmp::strVersion()).toAscii()); - addButton->setEnabled(false); - m_http->get(request); - return; - } - } - m_model->add(s); - } - QDialog::accept(); -} - -void AddUrlDialog::readResponse(QNetworkReply *reply) -{ - addButton->setEnabled(true); - disconnect(m_http, SIGNAL(finished (QNetworkReply *)), 0, 0); - if (reply->error() != QNetworkReply::NoError) - QMessageBox::critical (this, tr("Error"), reply->errorString ()); - else if (!urlComboBox->currentText().isEmpty()) - { - QString s = urlComboBox->currentText(); - PlaylistFormat* prs = PlaylistParser::instance()->findByPath(s); - if (prs) - { - m_model->add(prs->decode(reply->readAll())); - QDialog::accept(); - } - } - reply->deleteLater(); -} - -void AddUrlDialog::setModel( PlayListModel *m ) -{ - m_model = m; -} diff --git a/src/ui/addurldialog.h b/src/ui/addurldialog.h deleted file mode 100644 index 49858ce11..000000000 --- a/src/ui/addurldialog.h +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef ADDURLDIALOG_H -#define ADDURLDIALOG_H - -#include "ui_addurldialog.h" -#include -#include - -class QNetworkAccessManager; -class QNetworkReply; -class PlayListModel; - -/** - @author Vladimir Kuznetsov - */ - -class AddUrlDialog : public QDialog , private Ui::AddUrlDialog -{ - Q_OBJECT -public: - static void popup(QWidget* parent ,PlayListModel*); - -protected: - AddUrlDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 ); - ~AddUrlDialog(); - -protected slots: - virtual void accept(); - -private slots: - void readResponse(QNetworkReply *reply); - -private: - void setModel(PlayListModel*); - static QPointer instance; - PlayListModel* m_model; - QStringList m_history; - QNetworkAccessManager *m_http; - -}; -#endif //ADDURLDIALOG_H diff --git a/src/ui/balancebar.cpp b/src/ui/balancebar.cpp deleted file mode 100644 index 07a56ce7a..000000000 --- a/src/ui/balancebar.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include "skin.h" -#include "button.h" -#include "mainwindow.h" -#include "balancebar.h" - -BalanceBar::BalanceBar(QWidget *parent) - : PixmapWidget(parent) -{ - m_skin = Skin::instance(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setPixmap(m_skin->getBalanceBar(0)); - m_moving = false; - m_min = -100; - m_max = 100; - m_old = m_value = 0; - draw(false); -} - - -BalanceBar::~BalanceBar() -{} - -void BalanceBar::mousePressEvent(QMouseEvent *e) -{ - m_moving = true; - press_pos = e->x(); - if(e->button() == Qt::MidButton) - { - m_value = 0; - emit sliderPressed(); - emit sliderMoved(m_value); - } - else if(m_posx() && e->x()ratio()) - { - press_pos = e->x()-m_pos; - emit sliderPressed(); - } - else - { - m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); - press_pos = 6*m_skin->ratio(); - emit sliderPressed(); - if (m_value != m_old) - { - emit sliderMoved(m_value); - } - } - draw(); -} - -void BalanceBar::mouseMoveEvent (QMouseEvent *e) -{ - if(m_moving) - { - int po = e->x(); - po = po - press_pos; - - if(0 <= po && po <= width()-13*m_skin->ratio()) - { - m_value = convert(po); - draw(); - emit sliderMoved(m_value); - } - } -} - -void BalanceBar::mouseReleaseEvent(QMouseEvent*) -{ - m_moving = false; - draw(false); - m_old = m_value; - emit sliderReleased(); -} - -void BalanceBar::setValue(int v) -{ - if (m_moving || m_max == 0) - return; - m_value = v; - draw(false); -} - -void BalanceBar::setMax(int max) -{ - m_max = max; - draw(false); -} - -void BalanceBar::updateSkin() -{ - resize(m_skin->getBalanceBar(0).size()); - draw(false); -} - -void BalanceBar::draw(bool pressed) -{ - if(abs(m_value)<6) - m_value = 0; - int p=int(ceil(double(m_value-m_min)*(width()-13*m_skin->ratio())/(m_max-m_min))); - m_pixmap = m_skin->getBalanceBar(abs(27*m_value/m_max)); - QPainter paint(&m_pixmap); - if(pressed) - paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_P)); - else - paint.drawPixmap(p,m_skin->ratio(),m_skin->getButton(Skin::BT_BAL_N)); - setPixmap(m_pixmap); - m_pos = p; -} - -int BalanceBar::convert(int p) -{ - return int(ceil(double(m_max-m_min)*(p)/(width()-13*m_skin->ratio())+m_min)); -} - diff --git a/src/ui/balancebar.h b/src/ui/balancebar.h deleted file mode 100644 index 68e967568..000000000 --- a/src/ui/balancebar.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef BALANCEBAR_H -#define BALANCEBAR_H - -#include "pixmapwidget.h" - -class Skin; - -/** - @author Ilya Kotov -*/ -class BalanceBar : public PixmapWidget -{ -Q_OBJECT -public: - BalanceBar(QWidget *parent = 0); - - ~BalanceBar(); - - int value() {return m_value; } - -public slots: - void setValue(int); - void setMax(int); - -signals: - void sliderMoved (int); - void sliderPressed(); - void sliderReleased(); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - bool m_moving; - int press_pos; - int m_max, m_min, m_pos, m_value, m_old; - QPixmap m_pixmap; - int convert(int); // value = convert(position); - void draw(bool pressed = true); - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); -}; - -#endif diff --git a/src/ui/builtincommandlineoption.cpp b/src/ui/builtincommandlineoption.cpp index 5f71beeaa..29c2a50f5 100644 --- a/src/ui/builtincommandlineoption.cpp +++ b/src/ui/builtincommandlineoption.cpp @@ -20,7 +20,7 @@ #include #include -#include "mainwindow.h" +#include #include "builtincommandlineoption.h" BuiltinCommandLineOption::BuiltinCommandLineOption(QObject *parent) : QObject(parent) @@ -69,10 +69,14 @@ const QString BuiltinCommandLineOption::helpString() const void BuiltinCommandLineOption::executeCommand(const QString &option_string, const QStringList &args, - const QString &cwd, - MainWindow *mw) + const QString &cwd/*, + MainWindow *mw*/) { - if(option_string == "--enqueue" || option_string == "-e" || option_string.isEmpty()) + SoundCore *core = SoundCore::instance(); + MediaPlayer *player = MediaPlayer::instance(); + if(!core || !player) + return; + /*if(option_string == "--enqueue" || option_string == "-e" || option_string.isEmpty()) { //QStringList args = commands.value(key); if(args.isEmpty()) @@ -86,62 +90,63 @@ void BuiltinCommandLineOption::executeCommand(const QString &option_string, full_path_list << cwd + "/" + s; } //clear playlist if option is empty - mw->setFileList(full_path_list, option_string.isEmpty()); + //mw->setFileList(full_path_list, option_string.isEmpty()); } - else if (option_string == "--play" || option_string == "-p") + else*/ if (option_string == "--play" || option_string == "-p") { - mw->play(); + player->play(); } else if (option_string == "--stop" || option_string == "-s") { - mw->stop(); + core->stop(); } else if (option_string == "--pause" || option_string == "-u") { - mw->pause(); + core->pause(); } else if (option_string == "--next") { - mw->next(); - if (mw->soundCore()->state() == Qmmp::Stopped) - mw->play(); + player->next(); + if (core->state() == Qmmp::Stopped) + player->play(); } else if (option_string == "--previous") { - mw->previous(); - if (mw->soundCore()->state() == Qmmp::Stopped) - mw->play(); + player->previous(); + if (core->state() == Qmmp::Stopped) + player->play(); } else if (option_string == "--play-pause" || option_string == "-t") { - mw->playPause(); + //mw->playPause(); } else if (option_string == "--jump-to-file" || option_string == "-j") { - mw->jumpToFile(); + //mw->jumpToFile(); } else if (option_string == "--quit" || option_string == "-q") { - mw->close(); + //mw->close(); + qApp->closeAllWindows(); } else if (option_string == "--toggle-visibility") { - mw->toggleVisibility(); + //mw->toggleVisibility(); } else if (option_string == "--add-file") { - mw->addFile(); + //mw->addFile(); } else if (option_string == "--add-dir") { - mw->addDir(); + //mw->addDir(); } else if (option_string == "--volume" && !args.isEmpty()) { bool ok = false; int volume = args.at(0).toInt(&ok); if (ok) - mw->soundCore()->setVolume(volume,volume); + core->setVolume(volume,volume); } } diff --git a/src/ui/builtincommandlineoption.h b/src/ui/builtincommandlineoption.h index fe9ca31bf..08d8e2df3 100644 --- a/src/ui/builtincommandlineoption.h +++ b/src/ui/builtincommandlineoption.h @@ -24,8 +24,6 @@ #include #include -class MainWindow; - /** @author Vladimir Kuznetsov */ @@ -44,7 +42,7 @@ public: bool identify(const QString& str)const; const QString helpString()const; void executeCommand(const QString& option, const QStringList &args, - const QString &cwd, MainWindow *mw); + const QString &cwd/*, MainWindow *mw*/); QHash splitArgs(const QStringList &args) const; private: diff --git a/src/ui/button.cpp b/src/ui/button.cpp deleted file mode 100644 index f07088b0b..000000000 --- a/src/ui/button.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * Based on Promoe, an XMMS2 Client * - * Copyright (C) 2005-2006 by XMMS2 Team * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "button.h" -#include "skin.h" -#include - -Button::Button (QWidget *parent, uint normal, uint pressed, uint cursor) - : PixmapWidget (parent) -{ - name_normal = normal; - name_pressed = pressed; - name_cursor = cursor; - m_pressed = false; - skin = Skin::instance(); - setON (false); - setCursor (skin->getCursor (name_cursor)); - connect (skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); -} - - -Button::~Button() -{} - -void Button::updateSkin() -{ - setPixmap (skin->getButton (name_normal)); - setCursor (skin->getCursor (name_cursor)); -} - -void Button::setON (bool on) -{ - if (on) - setPixmap (skin->getButton (name_pressed)); - else - setPixmap (skin->getButton (name_normal)); -} -void Button::mousePressEvent (QMouseEvent *e) -{ - if(e->button() != Qt::LeftButton) - return; - setON (true); - m_pressed = true; - QWidget::mousePressEvent(e); -} - -void Button::mouseReleaseEvent (QMouseEvent *e) -{ - if (!m_pressed) - return; - m_pressed = false; - if(rect().contains(e->pos())) - { - setON (false); - emit clicked(); - } -} - -void Button::mouseMoveEvent (QMouseEvent *e) -{ - setON (m_pressed && rect().contains(e->pos())); -} diff --git a/src/ui/button.h b/src/ui/button.h deleted file mode 100644 index e00bd7dc7..000000000 --- a/src/ui/button.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef BUTTON_H -#define BUTTON_H - -#include "pixmapwidget.h" - -class Skin; - -/** - @author Ilya Kotov -*/ -class Button : public PixmapWidget -{ -Q_OBJECT -public: - Button(QWidget *parent, uint normal, uint pressed, uint cursor); - - ~Button(); - -signals: - void clicked(); - -private slots: - void updateSkin(); - -private: - Skin *skin; - //bool m_cursorin; - bool m_pressed; - void setON(bool); - uint name_normal, name_pressed; - uint name_cursor; - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); -}; - -#endif diff --git a/src/ui/configdialog.cpp b/src/ui/configdialog.cpp deleted file mode 100644 index 26a71e38d..000000000 --- a/src/ui/configdialog.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#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 -#include -#include -#include -#include "shortcutdialog.h" -#include "actionmanager.h" -#include "shortcutitem.h" -#include "popupsettings.h" -#include "skin.h" -#include "pluginitem.h" -#include "configdialog.h" -#include "skinreader.h" - -ConfigDialog::ConfigDialog (QWidget *parent) - : QDialog (parent) -{ - ui.setupUi (this); - setAttribute(Qt::WA_QuitOnClose, false); - setAttribute(Qt::WA_DeleteOnClose, false); - ui.preferencesButton->setEnabled(false); - ui.informationButton->setEnabled(false); - connect (ui.mainFontButton, SIGNAL (clicked()), SLOT (setMainFont())); - connect (ui.plFontButton, SIGNAL (clicked()), SLOT (setPlFont())); - connect (this, SIGNAL(rejected()),SLOT(saveSettings())); - connect (ui.fileDialogComboBox, SIGNAL (currentIndexChanged (int)), SLOT(updateDialogButton(int))); - connect (ui.skinInstallButton, SIGNAL (clicked()), SLOT(installSkin())); - connect (ui.skinReloadButton, SIGNAL (clicked()), SLOT(loadSkins())); - connect (ui.listWidget, SIGNAL (itemClicked (QListWidgetItem *)), this, SLOT (changeSkin())); - ui.listWidget->setIconSize (QSize (105,34)); - m_skin = Skin::instance(); - ui.replayGainModeComboBox->addItem (tr("Track"), QmmpSettings::REPLAYGAIN_TRACK); - ui.replayGainModeComboBox->addItem (tr("Album"), QmmpSettings::REPLAYGAIN_ALBUM); - ui.replayGainModeComboBox->addItem (tr("Disabled"), QmmpSettings::REPLAYGAIN_DISABLED); - readSettings(); - m_reader = new SkinReader(this); - loadSkins(); - loadPluginsInfo(); - loadShortcuts(); - loadFonts(); - createMenus(); - //setup icons - ui.skinInstallButton->setIcon(QIcon::fromTheme("list-add")); - ui.skinReloadButton->setIcon(QIcon::fromTheme("view-refresh")); - ui.popupTemplateButton->setIcon(QIcon::fromTheme("configure")); - ui.preferencesButton->setIcon(QIcon::fromTheme("configure")); - ui.informationButton->setIcon(QIcon::fromTheme("dialog-information")); - ui.fdInformationButton->setIcon(QIcon::fromTheme("dialog-information")); - ui.outputInformationButton->setIcon(QIcon::fromTheme("dialog-information")); - ui.outputPreferencesButton->setIcon(QIcon::fromTheme("configure")); -} - -ConfigDialog::~ConfigDialog() -{} - -void ConfigDialog::readSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - if (MediaPlayer *player = MediaPlayer::instance()) - { - ui.formatLineEdit->setText(player->playListManager()->format()); - ui.metadataCheckBox->setChecked(player->playListManager()->useMetadata()); - ui.underscoresCheckBox->setChecked(player->playListManager()->convertUnderscore()); - ui.per20CheckBox->setChecked(player->playListManager()->convertTwenty()); - } - ui.protocolCheckBox->setChecked(settings.value ("PlayList/show_protocol", false).toBool()); - ui.numbersCheckBox->setChecked(settings.value ("PlayList/show_numbers", true).toBool()); - ui.alignCheckBox->setChecked(settings.value ("PlayList/align_numbers", false).toBool()); - ui.anchorCheckBox->setChecked(settings.value("PlayList/show_anchor", false).toBool()); - ui.playlistsCheckBox->setChecked(settings.value("PlayList/show_plalists", false).toBool()); - ui.popupCheckBox->setChecked(settings.value("PlayList/show_popup", false).toBool()); - QmmpSettings *gs = QmmpSettings::instance(); - //proxy settings - ui.enableProxyCheckBox->setChecked(gs->isProxyEnabled()); - ui.authProxyCheckBox->setChecked(gs->useProxyAuth()); - ui.hostLineEdit->setText(gs->proxy().host()); - if (gs->proxy().port(0)) - ui.portLineEdit->setText(QString::number(gs->proxy().port(0))); - ui.proxyUserLineEdit->setText(gs->proxy().userName()); - ui.proxyPasswLineEdit->setText(gs->proxy().password()); - - ui.hostLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); - ui.portLineEdit->setEnabled(ui.enableProxyCheckBox->isChecked()); - ui.proxyUserLineEdit->setEnabled(ui.authProxyCheckBox->isChecked()); - ui.proxyPasswLineEdit->setEnabled(ui.authProxyCheckBox->isChecked()); - //transparency - ui.mwTransparencySlider->setValue(100 - settings.value("MainWindow/opacity", 1.0).toDouble()*100); - ui.eqTransparencySlider->setValue(100 - settings.value("Equalizer/opacity", 1.0).toDouble()*100); - ui.plTransparencySlider->setValue(100 - settings.value("PlayList/opacity", 1.0).toDouble()*100); - //view - ui.skinCursorsCheckBox->setChecked(settings.value("General/skin_cursors", false).toBool()); - m_currentSkinName = settings.value("General/skin_name", "default").toString(); - ui.hiddenCheckBox->setChecked(settings.value("MainWindow/start_hidden", false).toBool()); - ui.hideOnCloseCheckBox->setChecked(settings.value("MainWindow/hide_on_close", false).toBool()); - //resume playback - ui.continuePlaybackCheckBox->setChecked(settings.value("General/resume_on_startup", false).toBool()); - //cover options - ui.coverIncludeLineEdit->setText(gs->coverNameFilters(true).join(",")); - ui.coverExcludeLineEdit->setText(gs->coverNameFilters(false).join(",")); - ui.coverDepthSpinBox->setValue(gs->coverSearchDepth()); - ui.useCoverFilesCheckBox->setChecked(gs->useCoverFiles()); - //replay gain - ui.clippingCheckBox->setChecked(gs->replayGainPreventClipping()); - ui.replayGainModeComboBox->setCurrentIndex(ui.replayGainModeComboBox->findData(gs->replayGainMode())); - ui.preampDoubleSpinBox->setValue(gs->replayGainPreamp()); - ui.defaultGainDoubleSpinBox->setValue(gs->replayGainDefaultGain()); - //audio - ui.softVolumeCheckBox->setChecked(gs->useSoftVolume()); - ui.use16BitCheckBox->setChecked(gs->use16BitOutput()); - ui.bufferSizeSpinBox->setValue(gs->bufferSize()); -} - -void ConfigDialog::on_contentsWidget_currentItemChanged (QListWidgetItem *current, - QListWidgetItem *previous) -{ - if (!current) - current = previous; - ui.stackedWidget->setCurrentIndex (ui.contentsWidget->row (current)); - ui.hiddenCheckBox->setEnabled(GeneralHandler::instance()->visibilityControl()); - ui.hideOnCloseCheckBox->setEnabled(GeneralHandler::instance()->visibilityControl()); -} - -void ConfigDialog::changeSkin() -{ - int row = ui.listWidget->currentRow(); - QString path; - if (m_skinList.at (row).isDir()) - { - path = m_skinList.at (row).canonicalFilePath(); - m_skin->setSkin (path); - } - else if (m_skinList.at (row).isFile()) - { - m_reader->unpackSkin(m_skinList.at (row).canonicalFilePath()); - m_skin->setSkin(QDir::homePath() +"/.qmmp/cache/skin"); - } - if(ui.listWidget->currentItem()) - m_currentSkinName = ui.listWidget->currentItem()->text(); - else - m_currentSkinName.clear(); -} - -void ConfigDialog::loadSkins() -{ - m_reader->generateThumbs(); - m_skinList.clear(); - ui.listWidget->clear(); - QFileInfo fileInfo (":/default"); - QPixmap preview = Skin::getPixmap ("main", QDir (fileInfo.filePath())); - QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); - item->setIcon (preview); - ui.listWidget->addItem (item); - m_skinList << fileInfo; - if(item->text() == m_currentSkinName) - ui.listWidget->setCurrentItem(item); - - findSkins(QDir::homePath() +"/.qmmp/skins"); -#ifdef Q_OS_WIN32 - findSkins(qApp->applicationDirPath()+"/skins"); -#else - findSkins(qApp->applicationDirPath()+"/../share/qmmp/skins"); -#endif - foreach(QString path, m_reader->skins()) - { - QListWidgetItem *item = new QListWidgetItem (path.section('/', -1)); - item->setIcon (m_reader->getPreview(path)); - item->setToolTip(tr("Archived skin") + " " + path); - ui.listWidget->addItem (item); - m_skinList << QFileInfo(path); - if(item->text() == m_currentSkinName) - ui.listWidget->setCurrentItem(item); - } -} - -void ConfigDialog::findSkins(const QString &path) -{ - QDir dir(path); - dir.setFilter (QDir::Dirs | QDir::NoDotAndDotDot); - QList fileList = dir.entryInfoList(); - if (fileList.count() == 0) - return; - foreach (QFileInfo fileInfo, fileList) - { - QPixmap preview = Skin::getPixmap ("main", QDir(fileInfo.filePath ())); - if (!preview.isNull()) - { - QListWidgetItem *item = new QListWidgetItem (fileInfo.fileName ()); - item->setIcon (preview); - item->setToolTip(tr("Unarchived skin") + " " + fileInfo.filePath ()); - ui.listWidget->addItem (item); - m_skinList << fileInfo; - } - } -} - -void ConfigDialog::loadPluginsInfo() -{ - ui.treeWidget->blockSignals(true); - /* - load transport plugin information - */ - QTreeWidgetItem *item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Transports")); - QList *transports = InputSource::factories(); - QStringList files = InputSource::files(); - for (int i = 0; i < transports->count (); ++i) - new PluginItem (item, transports->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - - /* - load input plugins information - */ - item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Decoders")); - QList *decoders = Decoder::factories(); - files = Decoder::files(); - for (int i = 0; i < decoders->count (); ++i) - new PluginItem (item, decoders->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - /* - load audio engines information - */ - item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Engines")); - QList *engines = AbstractEngine::factories(); - files = AbstractEngine::files(); - for (int i = 0; i < engines->count (); ++i) - new PluginItem (item, engines->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - /* - load effect plugin information - */ - item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Effects")); - QList *effects = Effect::factories(); - files = Effect::files(); - for (int i = 0; i < effects->count (); ++i) - new PluginItem (item, effects->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - /* - load visual plugin information - */ - item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("Visualization")); - QList *visuals = Visual::factories(); - files = Visual::files(); - for (int i = 0; i < visuals->count (); ++i) - new PluginItem (item, visuals->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - /* - load general plugin information - */ - item = new QTreeWidgetItem (ui.treeWidget, QStringList() << tr("General")); - QList *generals = General::factories(); - files = General::files(); - for (int i = 0; i < generals->count (); ++i) - new PluginItem (item, generals->at(i), files.at (i)); - ui.treeWidget->addTopLevelItem(item); - item->setExpanded(true); - - ui.treeWidget->blockSignals(false); - ui.treeWidget->resizeColumnToContents(0); - ui.treeWidget->resizeColumnToContents(1); - /* - load output plugins information - */ - ui.outputInformationButton->setEnabled(false); - ui.outputPreferencesButton->setEnabled(false); - QList *outputs = Output::factories(); - for (int i = 0; i < outputs->count (); ++i) - { - ui.outputComboBox->addItem(outputs->at(i)->properties().name); - if(Output::currentFactory() == outputs->at(i)) - { - ui.outputComboBox->setCurrentIndex(i); - on_outputComboBox_activated (i); - } - } - /* - load file dialog information - */ - foreach(FileDialogFactory *factory, FileDialog::registeredFactories()) - { - ui.fileDialogComboBox->addItem(factory->properties().name); - if (FileDialog::isEnabled(factory)) - ui.fileDialogComboBox->setCurrentIndex(ui.fileDialogComboBox->count()-1); - } -} - -void ConfigDialog::loadFonts() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - QString fontname = settings.value ("PlayList/Font").toString(); - QFont font = QApplication::font(); - if(!fontname.isEmpty()) - font.fromString(fontname); - ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); - ui.plFontLabel->setFont(font); - - font = QApplication::font (); - fontname = settings.value ("MainWindow/Font").toString(); - if(!fontname.isEmpty()) - font.fromString(fontname); - ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); - ui.mainFontLabel->setFont(font); - ui.useBitmapCheckBox->setChecked(settings.value("MainWindow/bitmap_font", false).toBool()); -} - -void ConfigDialog::loadShortcuts() -{ - //playback - QTreeWidgetItem *item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Playback")); - for(int i = ActionManager::PLAY; i <= ActionManager::CLEAR_QUEUE; ++i) - new ShortcutItem(item, i); - item->setExpanded(true); - ui.shortcutTreeWidget->addTopLevelItem(item); - //view - item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("View")); - for(int i = ActionManager::SHOW_PLAYLIST; i <= ActionManager::WM_DOUBLE_SIZE; ++i) - new ShortcutItem(item, i); - item->setExpanded(true); - ui.shortcutTreeWidget->addTopLevelItem(item); - //playlist - item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Playlist")); - for(int i = ActionManager::PL_ADD_FILE; i <= ActionManager::PL_SHOW_MANAGER; ++i) - new ShortcutItem(item, i); - item->setExpanded(true); - ui.shortcutTreeWidget->addTopLevelItem(item); - //misc - item = new QTreeWidgetItem (ui.shortcutTreeWidget, QStringList() << tr("Misc")); - for(int i = ActionManager::SETTINGS; i <= ActionManager::QUIT; ++i) - new ShortcutItem(item, i); - item->setExpanded(true); - ui.shortcutTreeWidget->addTopLevelItem(item); - - ui.shortcutTreeWidget->resizeColumnToContents(0); - ui.shortcutTreeWidget->resizeColumnToContents(1); -} - -void ConfigDialog::setPlFont() -{ - bool ok; - QFont font = ui.plFontLabel->font(); - font = QFontDialog::getFont (&ok, font, this); - if (ok) - { - ui.plFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); - ui.plFontLabel->setFont(font); - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.setValue ("PlayList/Font", font.toString()); - } -} - -void ConfigDialog::setMainFont() -{ - bool ok; - QFont font = ui.mainFontLabel->font(); - font = QFontDialog::getFont (&ok, font, this); - if (ok) - { - ui.mainFontLabel->setText (font.family () + " " + QString::number(font.pointSize ())); - ui.mainFontLabel->setFont(font); - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.setValue ("MainWindow/Font", font.toString()); - } -} - -void ConfigDialog::on_preferencesButton_clicked() -{ - QTreeWidgetItem *item = ui.treeWidget->currentItem(); - if(item && item->type() >= PluginItem::TRANSPORT) - dynamic_cast(item)->showSettings(this); - -} - -void ConfigDialog::on_informationButton_clicked() -{ - QTreeWidgetItem *item = ui.treeWidget->currentItem(); - if(item && item->type() >= PluginItem::TRANSPORT) - dynamic_cast(item)->showAbout(this); -} - -void ConfigDialog::createMenus() -{ - QMenu *menu = new QMenu(this); - - menu->addAction(tr("Artist"))->setData("%p"); - menu->addAction(tr("Album"))->setData("%a"); - menu->addAction(tr("Title"))->setData("%t"); - menu->addAction(tr("Track number"))->setData("%n"); - menu->addAction(tr("Two-digit track number"))->setData("%NN"); - menu->addAction(tr("Genre"))->setData("%g"); - menu->addAction(tr("Comment"))->setData("%c"); - menu->addAction(tr("Composer"))->setData("%C"); - menu->addAction(tr("Disc number"))->setData("%D"); - menu->addAction(tr("File name"))->setData("%f"); - menu->addAction(tr("File path"))->setData("%F"); - menu->addAction(tr("Year"))->setData("%y"); - menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); - - ui.titleButton->setMenu(menu); - ui.titleButton->setPopupMode(QToolButton::InstantPopup); - connect(menu, SIGNAL(triggered (QAction *)), SLOT(addTitleString(QAction *))); -} - -void ConfigDialog::addTitleString(QAction * a) -{ - if (ui.formatLineEdit->cursorPosition () < 1) - ui.formatLineEdit->insert(a->data().toString()); - else - ui.formatLineEdit->insert(" - "+a->data().toString()); -} - -void ConfigDialog::saveSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - if (MediaPlayer *player = MediaPlayer::instance()) - { - player->playListManager()->setFormat(ui.formatLineEdit->text().trimmed()); - player->playListManager()->setUseMetadata(ui.metadataCheckBox->isChecked()); - player->playListManager()->setConvertUnderscore(ui.underscoresCheckBox->isChecked()); - player->playListManager()->setConvertTwenty(ui.per20CheckBox->isChecked()); - } - settings.setValue ("PlayList/show_protocol", ui.protocolCheckBox->isChecked()); - settings.setValue ("PlayList/show_numbers", ui.numbersCheckBox->isChecked()); - settings.setValue ("PlayList/align_numbers", ui.alignCheckBox->isChecked()); - settings.setValue ("PlayList/show_anchor", ui.anchorCheckBox->isChecked()); - settings.setValue ("PlayList/show_plalists", ui.playlistsCheckBox->isChecked()); - settings.setValue ("PlayList/show_popup", ui.popupCheckBox->isChecked()); - FileDialog::setEnabled(FileDialog::registeredFactories().at(ui.fileDialogComboBox->currentIndex())); - QmmpSettings *gs = QmmpSettings::instance(); - //proxy - QUrl proxyUrl; - proxyUrl.setHost(ui.hostLineEdit->text()); - proxyUrl.setPort(ui.portLineEdit->text().toUInt()); - proxyUrl.setUserName(ui.proxyUserLineEdit->text()); - proxyUrl.setPassword(ui.proxyPasswLineEdit->text()); - gs->setNetworkSettings(ui.enableProxyCheckBox->isChecked(), - ui.authProxyCheckBox->isChecked(), - proxyUrl); - - - settings.setValue ("MainWindow/opacity", 1.0 - (double)ui.mwTransparencySlider->value()/100); - settings.setValue ("Equalizer/opacity", 1.0 - (double)ui.eqTransparencySlider->value()/100); - settings.setValue ("PlayList/opacity", 1.0 - (double)ui.plTransparencySlider->value()/100); - settings.setValue ("General/resume_on_startup", ui.continuePlaybackCheckBox->isChecked()); - settings.setValue ("MainWindow/bitmap_font", ui.useBitmapCheckBox->isChecked()); - settings.setValue ("General/skin_cursors", ui.skinCursorsCheckBox->isChecked()); - settings.setValue ("General/skin_name", m_currentSkinName); - settings.setValue ("MainWindow/start_hidden", ui.hiddenCheckBox->isChecked()); - settings.setValue ("MainWindow/hide_on_close", ui.hideOnCloseCheckBox->isChecked()); - gs->setCoverSettings(ui.coverIncludeLineEdit->text().split(","), - ui.coverExcludeLineEdit->text().split(","), - ui.coverDepthSpinBox->value(), - ui.useCoverFilesCheckBox->isChecked()); - int i = ui.replayGainModeComboBox->currentIndex(); - gs->setReplayGainSettings((QmmpSettings::ReplayGainMode) - ui.replayGainModeComboBox->itemData(i).toInt(), - ui.preampDoubleSpinBox->value(), - ui.defaultGainDoubleSpinBox->value(), - ui.clippingCheckBox->isChecked()); - gs->setAudioSettings(ui.softVolumeCheckBox->isChecked(), ui.use16BitCheckBox->isChecked()); - gs->setBufferSize(ui.bufferSizeSpinBox->value()); - QList *outputs = Output::factories(); - if(ui.outputComboBox->currentIndex() >= 0 && outputs->count()) - Output::setCurrentFactory(outputs->at(ui.outputComboBox->currentIndex())); -} - -void ConfigDialog::updateDialogButton(int index) -{ - ui.fdInformationButton->setEnabled(FileDialog::registeredFactories()[index]->properties().hasAbout); -} - -void ConfigDialog::on_fdInformationButton_clicked() -{ - int index = ui.fileDialogComboBox->currentIndex (); - FileDialog::registeredFactories()[index]->showAbout(this); -} - -void ConfigDialog::installSkin() -{ - QStringList files = FileDialog::getOpenFileNames(this,tr("Select Skin Files"), QDir::homePath(), - tr("Skin files") + " (*.tar.gz *.tgz *.tar.bz2 *.zip *.wsz)"); - foreach(QString path, files) - { - QFile file(path); - file.copy(QDir::homePath() +"/.qmmp/skins/" + QFileInfo(path).fileName()); - } - loadSkins(); -} - -void ConfigDialog::on_popupTemplateButton_clicked() -{ - PopupSettings *p = new PopupSettings(this); - p->exec(); - p->deleteLater(); -} - -void ConfigDialog::on_treeWidget_itemChanged (QTreeWidgetItem *item, int column) -{ - if(column == 0 && item->type() >= PluginItem::TRANSPORT) - dynamic_cast(item)->setEnabled(item->checkState(0) == Qt::Checked); -} - -void ConfigDialog::on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *) -{ - if(current->type() >= PluginItem::TRANSPORT) - { - ui.preferencesButton->setEnabled(dynamic_cast(current)->hasSettings()); - ui.informationButton->setEnabled(dynamic_cast(current)->hasAbout()); - } - else - { - ui.preferencesButton->setEnabled(false); - ui.informationButton->setEnabled(false); - } -} - -void ConfigDialog::on_outputComboBox_activated (int index) -{ - OutputFactory *factory = Output::factories()->at(index); - ui.outputInformationButton->setEnabled(factory->properties().hasAbout); - ui.outputPreferencesButton->setEnabled(factory->properties().hasSettings); -} - -void ConfigDialog::on_outputPreferencesButton_clicked() -{ - int index = ui.outputComboBox->currentIndex(); - Output::factories()->at(index)->showSettings(this); -} - -void ConfigDialog::on_outputInformationButton_clicked() -{ - int index = ui.outputComboBox->currentIndex(); - Output::factories()->at(index)->showAbout(this); -} - -void ConfigDialog::on_changeShortcutButton_clicked() -{ - ShortcutItem *item = dynamic_cast (ui.shortcutTreeWidget->currentItem()); - if(!item) - return; - ShortcutDialog editor(item->action()->shortcut().toString(), this); - if(editor.exec() == QDialog::Accepted) - { - item->action()->setShortcut(editor.key()); - item->setText(1, item->action()->shortcut().toString()); - } -} diff --git a/src/ui/configdialog.h b/src/ui/configdialog.h deleted file mode 100644 index ad8d62ae5..000000000 --- a/src/ui/configdialog.h +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef CONFIGDIALOG_H -#define CONFIGDIALOG_H - -#include -#include - -#include "ui_configdialog.h" - - -/** - @author Ilya Kotov -*/ -class QFileInfo; - -class Skin; -class SkinReader; - -class ConfigDialog : public QDialog -{ - Q_OBJECT -public: - ConfigDialog(QWidget *parent = 0); - - ~ConfigDialog(); - -private slots: - void on_contentsWidget_currentItemChanged (QListWidgetItem *current, QListWidgetItem *previous); - void changeSkin(); - void setPlFont(); - void setMainFont(); - void on_preferencesButton_clicked(); - void on_informationButton_clicked(); - void addTitleString(QAction *); - void saveSettings(); - void updateDialogButton(int); - void on_fdInformationButton_clicked(); - void installSkin(); - void loadSkins(); - void on_popupTemplateButton_clicked(); - void on_treeWidget_itemChanged (QTreeWidgetItem *item, int column); - void on_treeWidget_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *); - void on_outputComboBox_activated (int index); - void on_outputPreferencesButton_clicked(); - void on_outputInformationButton_clicked(); - void on_changeShortcutButton_clicked(); - -private: - void readSettings(); - void findSkins(const QString &path); - void loadPluginsInfo(); - void loadFonts(); - void loadShortcuts(); - void createMenus(); - - - QList m_skinList; - Ui::ConfigDialog ui; - QString m_currentSkinName; - Skin *m_skin; - QPixmap pixmap; - SkinReader *m_reader; -}; - -#endif diff --git a/src/ui/cursorimage.cpp b/src/ui/cursorimage.cpp deleted file mode 100644 index 30fcf0173..000000000 --- a/src/ui/cursorimage.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Erik Ölsar * - * erlk.ozlr@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "cursorimage.h" - -QCursor createCursor(QString path) -{ - if (path.isEmpty()) - return QCursor(); - - // read file headers - QFile curFile(path); - curFile.open(QIODevice::ReadOnly); - QDataStream curStream(&curFile); - curStream.setByteOrder(QDataStream::LittleEndian); - - struct { - quint16 zero; - quint16 type; - quint16 icons; - } header2; - curStream >> header2.zero >> header2.type >> header2.icons; - - struct { - quint8 width; - quint8 height; - quint8 ncolours; - quint8 zero; - quint16 xhot; - quint16 yhot; - quint32 bytes; - quint32 dibOffset; - } directory2; - curStream >> directory2.width >> directory2.height >> directory2.ncolours >> directory2.zero >> directory2.xhot >> directory2.yhot >> directory2.bytes >> directory2.dibOffset; - - curFile.seek(directory2.dibOffset); - - // prepare a .bmp for delegating decoding to qt - struct { - unsigned char magic[2]; - quint32 size; - quint32 zero; - quint32 rdataOffset; - } bmpHeader; - int bmpHeaderSize = (2+4+4+4); - struct { - quint32 hdrSize; - quint32 width; - quint32 height; - quint16 planes; - quint16 bpp; - quint32 compression; - quint32 dataSize; - quint32 unused1; - quint32 unused2; - quint32 unused3; - quint32 unused4; - } dibHeader; - int dibHeaderSize = (4+4+4+2+2+4+4+4+4+4+4); - - bmpHeader.magic[0] = 'B'; bmpHeader.magic[1] = 'M'; - bmpHeader.zero = 0; - bmpHeader.size = bmpHeaderSize + directory2.bytes; - bmpHeader.rdataOffset = bmpHeaderSize + dibHeaderSize + directory2.ncolours * 4; - - curStream >> dibHeader.hdrSize >> dibHeader.width >> dibHeader.height >> dibHeader.planes >> dibHeader.bpp >> dibHeader.compression >> dibHeader.dataSize >> dibHeader.unused1 >> dibHeader.unused2 >> dibHeader.unused3 >> dibHeader.unused4; - dibHeader.height >>= 1; - - // the bmp bytes are in 'bmpData' - QByteArray bmpData; - QDataStream bmpStream(&bmpData, QIODevice::WriteOnly); - bmpStream.setByteOrder(QDataStream::LittleEndian); - bmpStream.writeRawData((char*) bmpHeader.magic, 2); - bmpStream << bmpHeader.size << bmpHeader.zero << bmpHeader.rdataOffset; - bmpStream << dibHeader.hdrSize << dibHeader.width << dibHeader.height << dibHeader.planes << dibHeader.bpp << dibHeader.compression << dibHeader.dataSize << dibHeader.unused1 << dibHeader.unused2 << dibHeader.unused3 << dibHeader.unused4; - bmpData.append(curFile.read(directory2.bytes - dibHeaderSize)); - - // decode the image into 'pix' - int width = directory2.width; - int height = directory2.height; - QImage image; - image.loadFromData(bmpData); - //qDebug() << image.rect() << path; - QPixmap pix = QPixmap::fromImage(image); - - // now we need the mask (transparency) - QByteArray maskData = bmpData.right((width * height) / 8); - QImage maskImage = QBitmap::fromData(QSize(width, height), (const uchar*) maskData.constData(), QImage::Format_Mono).toImage().mirrored(false, true); - maskImage.invertPixels(); - pix.setMask(QBitmap::fromImage(maskImage)); - - return QCursor(pix, directory2.xhot, directory2.yhot); -} diff --git a/src/ui/cursorimage.h b/src/ui/cursorimage.h deleted file mode 100644 index cde27d62d..000000000 --- a/src/ui/cursorimage.h +++ /dev/null @@ -1,26 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Erik Ölsar * - * erlk.ozlr@gmail.com * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef CURSORIMAGE_H -#define CURSORIMAGE_H - -QCursor createCursor(QString path); - -#endif diff --git a/src/ui/default/balance.png b/src/ui/default/balance.png deleted file mode 100644 index 1c2467f49..000000000 Binary files a/src/ui/default/balance.png and /dev/null differ diff --git a/src/ui/default/cbuttons.png b/src/ui/default/cbuttons.png deleted file mode 100644 index 15666b838..000000000 Binary files a/src/ui/default/cbuttons.png and /dev/null differ diff --git a/src/ui/default/eq_ex.png b/src/ui/default/eq_ex.png deleted file mode 100644 index 172a57c83..000000000 Binary files a/src/ui/default/eq_ex.png and /dev/null differ diff --git a/src/ui/default/eqmain.png b/src/ui/default/eqmain.png deleted file mode 100644 index 8e332d178..000000000 Binary files a/src/ui/default/eqmain.png and /dev/null differ diff --git a/src/ui/default/main.png b/src/ui/default/main.png deleted file mode 100644 index 3980c579d..000000000 Binary files a/src/ui/default/main.png and /dev/null differ diff --git a/src/ui/default/monoster.png b/src/ui/default/monoster.png deleted file mode 100644 index fe941fc44..000000000 Binary files a/src/ui/default/monoster.png and /dev/null differ diff --git a/src/ui/default/numbers.png b/src/ui/default/numbers.png deleted file mode 100644 index 009d0228c..000000000 Binary files a/src/ui/default/numbers.png and /dev/null differ diff --git a/src/ui/default/playpaus.png b/src/ui/default/playpaus.png deleted file mode 100644 index 268e2a43a..000000000 Binary files a/src/ui/default/playpaus.png and /dev/null differ diff --git a/src/ui/default/pledit.png b/src/ui/default/pledit.png deleted file mode 100644 index 7e8c7bc1a..000000000 Binary files a/src/ui/default/pledit.png and /dev/null differ diff --git a/src/ui/default/pledit.txt b/src/ui/default/pledit.txt deleted file mode 100644 index 8550b2286..000000000 --- a/src/ui/default/pledit.txt +++ /dev/null @@ -1,8 +0,0 @@ -[Text] -Normal=#A8AEAE -Current=#ffffff -NormalBG=#000000 -SelectedBG=#525555 -Font=Sans -mbBG=#000000 -mbFG=#ffffff \ No newline at end of file diff --git a/src/ui/default/posbar.png b/src/ui/default/posbar.png deleted file mode 100644 index 1f1608c8b..000000000 Binary files a/src/ui/default/posbar.png and /dev/null differ diff --git a/src/ui/default/readme.txt b/src/ui/default/readme.txt deleted file mode 100644 index 323706573..000000000 --- a/src/ui/default/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -Ergo created for QMMP project by Andrey Andreev -andreev00@gmail.com \ No newline at end of file diff --git a/src/ui/default/shufrep.png b/src/ui/default/shufrep.png deleted file mode 100644 index aa063c810..000000000 Binary files a/src/ui/default/shufrep.png and /dev/null differ diff --git a/src/ui/default/text.png b/src/ui/default/text.png deleted file mode 100644 index dcf1559e5..000000000 Binary files a/src/ui/default/text.png and /dev/null differ diff --git a/src/ui/default/titlebar.png b/src/ui/default/titlebar.png deleted file mode 100644 index 9ff2e1f22..000000000 Binary files a/src/ui/default/titlebar.png and /dev/null differ diff --git a/src/ui/default/viscolor.txt b/src/ui/default/viscolor.txt deleted file mode 100644 index 86a1131a3..000000000 --- a/src/ui/default/viscolor.txt +++ /dev/null @@ -1,24 +0,0 @@ -152,152,152, // Bg -152,152,152, // Dots -255,128,0, // Analyzer -240,128,16, // Analyzer -225,128,32, // Analyzer -210,128,48, // Analyzer -195,128,64, // Analyzer -180,128,80, // Analyzer -165,128,96, // Analyzer -150,128,112, // Analyzer -128,128,128, // Analyzer -110,110,110, // Analyzer -92,92,92, // Analyzer -74,74,74, // Analyzer -56,56,56, // Analyzer -38,38,38, // Analyzer -20,20,20, // Analyzer -2,2,2, // Analyzer -2,2,2, // Osc -20,20,20, // Osc -20,20,20, // Osc -38,38,38, // Osc -38,38,38, // Osc -255,255,255, // Peak \ No newline at end of file diff --git a/src/ui/default/volume.png b/src/ui/default/volume.png deleted file mode 100644 index cd33da4cf..000000000 Binary files a/src/ui/default/volume.png and /dev/null differ diff --git a/src/ui/display.cpp b/src/ui/display.cpp deleted file mode 100644 index 9b54306d2..000000000 --- a/src/ui/display.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "skin.h" -#include "mainvisual.h" -#include "button.h" -#include "titlebar.h" -#include "positionbar.h" -#include "number.h" -#include "togglebutton.h" -#include "symboldisplay.h" -#include "textscroller.h" -#include "monostereo.h" -#include "playstatus.h" -#include "volumebar.h" -#include "balancebar.h" -#include "mainwindow.h" -#include "timeindicator.h" -#include "actionmanager.h" -#include "display.h" - -MainDisplay::MainDisplay (QWidget *parent) - : PixmapWidget (parent) -{ - m_shaded = false; - m_skin = Skin::instance(); - setPixmap (m_skin->getMain()); - setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); - m_mw = qobject_cast(parent); - m_titlebar = new TitleBar(this); - m_titlebar->move(0,0); - m_titlebar->setActive(true); - m_previous = new Button (this, Skin::BT_PREVIOUS_N, Skin::BT_PREVIOUS_P, Skin::CUR_NORMAL); - m_previous->setToolTip(tr("Previous")); - connect (m_previous, SIGNAL (clicked()), parent, SLOT (previous())); - - m_play = new Button (this, Skin::BT_PLAY_N, Skin::BT_PLAY_P, Skin::CUR_NORMAL); - m_play->setToolTip(tr("Play")); - connect (m_play, SIGNAL (clicked()),parent,SLOT (play())); - m_pause = new Button (this, Skin::BT_PAUSE_N,Skin::BT_PAUSE_P, Skin::CUR_NORMAL); - m_pause->setToolTip(tr("Pause")); - connect (m_pause,SIGNAL (clicked()),parent,SLOT (pause())); - m_stop = new Button (this, Skin::BT_STOP_N,Skin::BT_STOP_P, Skin::CUR_NORMAL); - m_stop->setToolTip(tr("Stop")); - connect (m_stop,SIGNAL (clicked()),parent,SLOT (stop())); - m_next = new Button (this, Skin::BT_NEXT_N,Skin::BT_NEXT_P, Skin::CUR_NORMAL); - m_next->setToolTip(tr("Next")); - connect (m_next,SIGNAL (clicked()),parent,SLOT (next())); - m_eject = new Button (this, Skin::BT_EJECT_N,Skin::BT_EJECT_P, Skin::CUR_NORMAL); - m_eject->setToolTip(tr("Add file")); - connect (m_eject,SIGNAL (clicked()),parent,SLOT (addFile())); - connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); - m_vis = new MainVisual (this); - - m_eqButton = new ToggleButton (this,Skin::BT_EQ_ON_N,Skin::BT_EQ_ON_P, - Skin::BT_EQ_OFF_N,Skin::BT_EQ_OFF_P); - m_eqButton->setToolTip(tr("Equalizer")); - m_plButton = new ToggleButton (this,Skin::BT_PL_ON_N,Skin::BT_PL_ON_P, - Skin::BT_PL_OFF_N,Skin::BT_PL_OFF_P); - m_plButton->setToolTip(tr("Playlist")); - - m_repeatButton = new ToggleButton (this,Skin::REPEAT_ON_N,Skin::REPEAT_ON_P, - Skin::REPEAT_OFF_N,Skin::REPEAT_OFF_P); - connect(m_repeatButton,SIGNAL(clicked(bool)),this,SIGNAL(repeatableToggled(bool))); - m_repeatButton->setToolTip(tr("Repeat playlist")); - m_shuffleButton = new ToggleButton (this,Skin::SHUFFLE_ON_N,Skin::SHUFFLE_ON_P, - Skin::SHUFFLE_OFF_N,Skin::SHUFFLE_OFF_P); - m_shuffleButton->setToolTip(tr("Shuffle")); - connect(m_shuffleButton,SIGNAL(clicked(bool)),this,SIGNAL(shuffleToggled(bool))); - - m_kbps = new SymbolDisplay(this,3); - m_freq = new SymbolDisplay(this,2); - m_text = new TextScroller (this); - m_monoster = new MonoStereo (this); - m_playstatus = new PlayStatus(this); - - m_volumeBar = new VolumeBar(this); - m_volumeBar->setToolTip(tr("Volume")); - connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); - connect(m_volumeBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); - connect(m_volumeBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); - - m_balanceBar = new BalanceBar(this); - m_balanceBar->setToolTip(tr("Balance")); - connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); - connect(m_balanceBar, SIGNAL(sliderPressed()),SLOT(updateVolume())); - connect(m_balanceBar, SIGNAL(sliderReleased()),m_text,SLOT(clear())); - - m_posbar = new PositionBar(this); - connect(m_posbar, SIGNAL(sliderPressed()),SLOT(showPosition())); - connect(m_posbar, SIGNAL(sliderMoved(qint64)),SLOT(showPosition())); - connect(m_posbar, SIGNAL(sliderReleased()),SLOT(updatePosition())); - - m_timeIndicator = new TimeIndicator(this); - m_aboutWidget = new QWidget(this); - m_core = SoundCore::instance(); - connect(m_core, SIGNAL(elapsedChanged(qint64)), SLOT(setTime(qint64))); - connect(m_core, SIGNAL(bitrateChanged(int)), m_kbps, SLOT(display(int))); - connect(m_core, SIGNAL(frequencyChanged(quint32)), SLOT(setSampleRate(quint32))); - connect(m_core, SIGNAL(channelsChanged(int)), m_monoster, SLOT(setChannels(int))); - connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(setState(Qmmp::State))); - connect(m_core, SIGNAL(volumeChanged(int,int)), SLOT(setVolume(int, int))); - connect(m_core, SIGNAL(elapsedChanged(qint64)),m_titlebar, SLOT(setTime(qint64))); - PlayListManager *pl_manager = MediaPlayer::instance()->playListManager(); - connect(pl_manager, SIGNAL(repeatableListChanged(bool)), m_repeatButton, SLOT(setON(bool))); - connect(pl_manager, SIGNAL(shuffleChanged(bool)), m_shuffleButton, SLOT(setON(bool))); - updatePositions(); - updateMask(); -} - -MainDisplay::~MainDisplay() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.setValue ("Playlist/visible",m_plButton->isChecked()); - settings.setValue ("Equalizer/visible",m_eqButton->isChecked()); -} - -void MainDisplay::updatePositions() -{ - int r = m_skin->ratio(); - m_previous->move (r*16, r*88); - m_play->move (r*39, r*88); - m_pause->move (r*62, r*88); - m_vis->move(r*24, r*43); - m_stop->move (r*85, r*88); - m_next->move (r*108, r*88); - m_eject->move (r*136, r*89); - m_posbar->move (r*16, r*72); - m_eqButton->move (r*219, r*58); - m_plButton->move (r*241, r*58); - m_repeatButton->move (r*210, r*89); - m_shuffleButton->move (r*164, r*89); - m_kbps->move (r*111, r*43); - m_freq->move (r*156, r*43); - m_text->resize (r*154, r*15); - m_text->move (r*109, r*23); - m_monoster->move (r*212, r*41); - m_playstatus->move(r*24, r*28); - m_volumeBar->move(r*107, r*57); - m_balanceBar->move(r*177, r*57); - m_timeIndicator->move(r*34, r*26); - m_aboutWidget->setGeometry(r*247,r*83,r*20,r*25); -} - -void MainDisplay::setTime (qint64 t) -{ - m_posbar->setValue (t); - m_timeIndicator->setTime(t/1000); -} -void MainDisplay::setDuration(qint64 t) -{ - m_posbar->setMaximum (t); - m_timeIndicator->setSongDuration(t/1000); -} - -void MainDisplay::setState(Qmmp::State state) -{ - switch ((int) state) - { - case Qmmp::Playing: - m_playstatus->setStatus(PlayStatus::PLAY); - m_timeIndicator->setNeedToShowTime(true); - setDuration(m_core->totalTime()); - break; - case Qmmp::Paused: - m_playstatus->setStatus(PlayStatus::PAUSE); - break; - case Qmmp::Stopped: - m_playstatus->setStatus(PlayStatus::STOP); - m_monoster->setChannels (0); - m_timeIndicator->setNeedToShowTime(false); - m_posbar->setValue (0); - m_posbar->setMaximum (0); - m_titlebar->setTime(-1); - } -} - -void MainDisplay::setVolume(int left, int right) -{ - int maxVol = qMax(left, right); - m_volumeBar->setValue(maxVol); - if (maxVol && !m_volumeBar->isPressed()) - m_balanceBar->setValue((right - left) * 100/maxVol); -} - -void MainDisplay::updateSkin() -{ - setPixmap (m_skin->getMain()); - m_mw->resize(size()); - setCursor(m_skin->getCursor(Skin::CUR_NORMAL)); - setMinimalMode(m_shaded); - updatePositions(); -} - -void MainDisplay::updateMask() -{ - m_mw->clearMask(); - m_mw->setMask(QRegion(0,0,m_mw->width(),m_mw->height())); - QRegion region = m_skin->getRegion(m_shaded? Skin::WINDOW_SHADE : Skin::NORMAL); - if (!region.isEmpty()) - m_mw->setMask(region); -} - -void MainDisplay::setMinimalMode(bool b) -{ - m_shaded = b; - int r = m_skin->ratio(); - - if(m_shaded) - m_mw->resize(r*275,r*14); - else - m_mw->resize(r*275,r*116); - updateMask(); -} - -void MainDisplay::setActive(bool b) -{ - m_titlebar->setActive(b); -} - -void MainDisplay::setSampleRate(quint32 rate) -{ - m_freq->display((int) rate/1000); -} -//TODO optimize this connections -void MainDisplay::setEQ (QWidget* w) -{ - m_equlizer = w; - m_eqButton->setON (m_equlizer->isVisible()); - ACTION(ActionManager::SHOW_EQUALIZER)->setChecked(m_equlizer->isVisible()); - - connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), - m_equlizer, SLOT (setVisible (bool))); - connect (ACTION(ActionManager::SHOW_EQUALIZER), SIGNAL(triggered(bool)), - m_eqButton, SLOT (setON (bool))); - - connect (m_eqButton, SIGNAL(clicked(bool)), - ACTION(ActionManager::SHOW_EQUALIZER), SLOT(setChecked (bool))); - connect (m_eqButton, SIGNAL(clicked(bool)), m_equlizer, SLOT (setVisible (bool))); - connect (m_equlizer, SIGNAL(closed ()), m_eqButton, SLOT (click())); -} - -void MainDisplay::setPL (QWidget* w) -{ - m_playlist = w; - m_plButton->setON (m_playlist->isVisible()); - ACTION(ActionManager::SHOW_PLAYLIST)->setChecked(m_playlist->isVisible()); - - connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), - m_playlist, SLOT (setVisible (bool))); - connect (ACTION(ActionManager::SHOW_PLAYLIST), SIGNAL(triggered(bool)), - m_plButton, SLOT (setON (bool))); - - connect (m_plButton, SIGNAL(clicked(bool)), - ACTION(ActionManager::SHOW_PLAYLIST), SLOT(setChecked (bool))); - connect (m_plButton, SIGNAL (clicked (bool)), m_playlist, SLOT (setVisible (bool))); - connect (m_playlist, SIGNAL (closed ()), m_plButton, SLOT (click())); -} - -bool MainDisplay::isPlaylistVisible() const -{ - return m_plButton->isChecked(); -} - -bool MainDisplay::isEqualizerVisible() const -{ - return m_eqButton->isChecked(); -} - -void MainDisplay::updateVolume() -{ - if(sender() == m_volumeBar) - m_text->setText(tr("Volume: %1%").arg(m_volumeBar->value())); - if(sender() == m_balanceBar) - { - if(m_balanceBar->value() > 0) - m_text->setText(tr("Balance: %1% right").arg(m_balanceBar->value())); - else if(m_balanceBar->value() < 0) - m_text->setText(tr("Balance: %1% left").arg(-m_balanceBar->value())); - else - m_text->setText(tr("Balance: center")); - } - m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); -} - -void MainDisplay::showPosition() -{ - int sec = m_posbar->value() / 1000; - if(sec > 3600) - sec /= 60; - QString time = QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); - m_text->setText(tr("Seek to: %1").arg(time)); -} - -void MainDisplay::updatePosition() -{ - m_text->clear(); - m_core->seek(m_posbar->value()); -} - -void MainDisplay::wheelEvent (QWheelEvent *e) -{ - m_mw->setVolume(m_volumeBar->value()+e->delta()/10, m_balanceBar->value()); -} - -bool MainDisplay::isRepeatable() const -{ - return m_repeatButton->isChecked(); -} - -bool MainDisplay::isShuffle() const -{ - return m_shuffleButton->isChecked(); -} - -void MainDisplay::setIsRepeatable(bool yes) -{ - m_repeatButton->setON(yes); -} - -void MainDisplay::setIsShuffle(bool yes) -{ - m_shuffleButton->setON(yes); -} - -void MainDisplay::mousePressEvent(QMouseEvent *e) -{ - if (e->button() == Qt::RightButton) - m_mw->menu()->exec(e->globalPos()); - else if(e->button() == Qt::LeftButton && m_aboutWidget->underMouse()) - m_mw->about(); - PixmapWidget::mousePressEvent(e); -} - diff --git a/src/ui/display.h b/src/ui/display.h deleted file mode 100644 index 1a7a05b82..000000000 --- a/src/ui/display.h +++ /dev/null @@ -1,122 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef DISPLAY_H -#define DISPLAY_H - -#include -#include -#include "pixmapwidget.h" - -class TimeIndicator; -class PositionBar; -class Skin; -class ToggleButton; -class TitleBar; -class NumberDisplay; -class SymbolDisplay; -class MonoStereo; -class PlayStatus; -class VolumeBar; -class BalanceBar; -class MainWindow; -class SoundCore; -class Button; -class TextScroller; -class MainVisual; -class TitleBar; - -/** - @author Ilya Kotov -*/ -class MainDisplay : public PixmapWidget -{ - Q_OBJECT -public: - MainDisplay(QWidget *parent = 0); - - ~MainDisplay(); - - void setEQ(QWidget*); - void setPL(QWidget*); - bool isEqualizerVisible()const; - bool isPlaylistVisible()const; - bool isRepeatable()const; - bool isShuffle()const; - void setIsRepeatable(bool); - void setIsShuffle(bool); - void setMinimalMode(bool b = true); - void setActive(bool b); - -public slots: - void setDuration(qint64); - -signals: - void repeatableToggled(bool); - void shuffleToggled(bool); - -protected: - void wheelEvent(QWheelEvent *); - void mousePressEvent(QMouseEvent*); - -private slots: - void updateSkin(); - void updateVolume(); - void showPosition(); - void updatePosition(); - void setSampleRate(quint32 rate); - void setTime(qint64); - void setState(Qmmp::State state); - void setVolume(int left, int right); - - -private: - void updatePositions(); - void updateMask(); - QWidget* m_equlizer; - QWidget* m_playlist; - bool m_shaded; - Skin *m_skin; - PositionBar *m_posbar; - Button *m_previous; - Button *m_play; - Button *m_pause; - Button *m_stop; - Button *m_next; - Button *m_eject; - TextScroller *m_text; - ToggleButton *m_eqButton; - ToggleButton *m_plButton; - ToggleButton *m_shuffleButton; - ToggleButton *m_repeatButton; - SymbolDisplay* m_kbps; - SymbolDisplay* m_freq; - MonoStereo* m_monoster; - PlayStatus* m_playstatus; - VolumeBar* m_volumeBar; - BalanceBar* m_balanceBar; - MainWindow* m_mw; - MainVisual* m_vis; - TimeIndicator* m_timeIndicator; - TitleBar *m_titlebar; - SoundCore *m_core; - QWidget *m_aboutWidget; -}; - -#endif diff --git a/src/ui/dock.cpp b/src/ui/dock.cpp deleted file mode 100644 index a4e5d52d2..000000000 --- a/src/ui/dock.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include - -#include "dock.h" - - -Dock *Dock::m_instance = 0; - -Dock *Dock::instance() -{ - if (!m_instance) - m_instance = new Dock(); - return m_instance; -} - -Dock::Dock (QObject *parent) - : QObject (parent) -{ - m_instance = this; - m_mainWidget = 0; -} - -Dock::~Dock() -{ - m_instance = 0; -} - -void Dock::setMainWidget (QWidget *widget) -{ - m_mainWidget = widget; - m_widgetList.prepend (widget); - m_dockedList.prepend (false); -} - - -QPoint Dock::snap (QPoint npos, QWidget* mv, QWidget* st) -{ - int nx = npos.x() - st->x(); - int ny = abs (npos.y() - st->y() + mv->height()); - - if (abs (nx) < 13 && ny < 13) //above - npos.rx() = st->x(); - if (ny < 13 && nx > -mv->width() && nx < st->width()) - npos.ry() = st->y() - mv->height(); - nx = abs (npos.x() + mv->width() - st->x() - st->width()); - if (nx < 13 && ny < 13) - npos.rx() = st->x() + st->width() - mv->width(); - - /***********/ - nx = npos.x() - st->x(); - ny = abs (npos.y() - st->y() - st->height()); - - if (abs (nx) < 13 && ny < 13) //near - npos.rx() = st->x(); - if (ny < 13 && nx > -mv->width() && nx < st->width()) - npos.ry() = st->y() + st->height(); - nx = abs (npos.x() + mv->width() - st->x() - st->width()); - if (nx < 13 && ny < 13) - npos.rx() = st->x() + st->width() - mv->width(); - /**************/ - nx = abs (npos.x() - st->x() + mv->width()); - ny = npos.y() - st->y(); - - if (nx < 13 && abs (ny) < 13) //left - npos.ry() = st->y(); - if (nx < 13 && ny > -mv->height() && ny < st->height()) - npos.rx() = st->x() - mv->width(); - - ny = abs (npos.y() + mv->height() - st->y() - st->height()); - if (nx < 13 && ny < 13) - npos.ry() = st->y() + st->height() - mv->height(); - /*****************/ - nx = abs (npos.x() - st->x() - st->width()); - ny = npos.y() - st->y(); - - if (nx < 13 && abs (ny) < 13) //right - npos.ry() = st->y(); - if (nx < 13 && ny > -mv->height() && ny < st->height()) - npos.rx() = st->x() + st->width(); - - ny = abs (npos.y() + mv->height() - st->y() - st->height()); - if (nx < 13 && ny < 13) - npos.ry() = st->y() + st->height() - mv->height(); - - return (npos); -} - -void Dock::addWidget (QWidget *widget) -{ - m_widgetList.append (widget); - m_dockedList.append (false); - widget->addActions(m_actions); - -} - -void Dock::move (QWidget* mv, QPoint npos) -{ - QRect DesktopRect = QApplication::desktop()->availableGeometry(m_mainWidget); - if(npos.y() < DesktopRect.y()) - npos.setY(DesktopRect.y()); - if(npos.x() < DesktopRect.x()) - npos.setX(DesktopRect.x()); - if (mv == m_mainWidget) - { - - for (int i = 1; iisVisible()) - npos = snap (npos, mv, m_widgetList.at (i)); - - } - else - { - QPoint pos = QPoint (npos.x() + x_list.at (i), - npos.y() + y_list.at (i)); - for (int j = 1; jisVisible()) - { - pos = snap (pos, m_widgetList.at (i), m_widgetList.at (j)); - npos = QPoint (pos.x() - x_list.at (i), - pos.y() - y_list.at (i)); - } - } - } - } - mv->move (npos); - for (int i = 1; imove(npos.x() + x_list.at (i), - npos.y() + y_list.at (i)); - } - } - else - { - for (int i = 0; iisVisible()) - { - npos = snap (npos, mv, m_widgetList.at (i)); - } - } - mv->move (npos); - } -} - -void Dock::calculateDistances() -{ - x_list.clear(); - y_list.clear(); - foreach (QWidget *w, m_widgetList) - { - if (w!=m_mainWidget) - { - x_list.append (- m_mainWidget->x() + w->x()); - y_list.append (- m_mainWidget->y() + w->y()); - } - else - { - x_list.prepend (0); - y_list.prepend (0); - } - } -} - -void Dock::updateDock() -{ - QWidget *mv = m_widgetList.at (0); - for (int j = 1; jx() - st->x(); - int ny = abs (mv->y() - st->y() + mv->height()); - if (ny < 2 && nx > -mv->width() && nx < st->width()) //above - return true; - - /***********/ - nx = mv->x() - st->x(); - ny = abs (mv->y() - st->y() - st->height()); - if (ny < 2 && nx > -mv->width() && nx < st->width()) //near - return true; - - /**************/ - nx = abs (mv->x() - st->x() + mv->width()); - ny = mv->y() - st->y(); - if (nx < 2 && ny > -mv->height() && ny < st->height()) //left - return true; - - /*****************/ - nx = abs (mv->x() - st->x() - st->width()); - ny = mv->y() - st->y(); - if (nx < 2 && ny > -mv->height() && ny < st->height()) //right - return true; - return false; -} - -void Dock::addActions (QList actions) -{ - m_actions << actions; - for (int i = 0; iaddActions (actions); -} - -bool Dock::isUnder(QWidget* upper, QWidget* nether, int dy) -{ - int nx = upper->x() - nether->x(); - return abs (upper->y() + upper->height() -dy - nether->y()) < 2 && - nx > -upper->width() && nx < nether->width(); -} - -void Dock::align(QWidget* w, int dy) -{ - for (int i = 0; imove(m_widgetList.at(i)->x(), m_widgetList.at(i)->y()+dy); - align(m_widgetList.at(i), dy); - } - } -} diff --git a/src/ui/dock.h b/src/ui/dock.h deleted file mode 100644 index e843ed142..000000000 --- a/src/ui/dock.h +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef DOCK_H -#define DOCK_H - -#include -#include -#include - -class QAction; -/** - @author Ilya Kotov -*/ -class Dock : public QObject -{ - Q_OBJECT -public: - Dock(QObject *parent = 0); - - ~Dock(); - - static Dock *instance(); - void setMainWidget(QWidget*); - void addWidget(QWidget *); - void move(QWidget*, QPoint); - void calculateDistances(); - void updateDock(); - QPoint snap(QPoint, QWidget*, QWidget*); - void addActions(QList actions); - void align(QWidget*, int dy); - -private: - bool isDocked(QWidget*, QWidget*); - bool isUnder(QWidget*, QWidget*, int); - static Dock *m_instance; - QWidget *m_mainWidget; - QList m_widgetList; - QList m_dockedList; - QList x_list; - QList y_list; - QList m_actions; -}; - -#endif diff --git a/src/ui/eqgraph.cpp b/src/ui/eqgraph.cpp deleted file mode 100644 index 1d7d070f7..000000000 --- a/src/ui/eqgraph.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include - -#include "skin.h" -#include "eqgraph.h" - -EQGraph::EQGraph (QWidget *parent) - : PixmapWidget (parent) -{ - m_skin = Skin::instance(); - setPixmap (m_skin->getEqPart (Skin::EQ_GRAPH)); - clear(); - m_ratio = m_skin->ratio(); - draw(); - connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); - setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); -} - -EQGraph::~EQGraph() -{} - -void EQGraph::addValue (int value) -{ - if (m_values.size() >= 10) - return; - m_values.append (value); - if (m_values.size() == 10) - { - draw(); - } -} - -void EQGraph::clear () -{ - m_values.clear(); - update(); -} - -void EQGraph::init_spline (double * x, double * y, int n, double * y2) -{ - int i, k; - double p, qn, sig, un, *u; - - u = new double[n]; - - y2[0] = u[0] = 0.0; - - for (i = 1; i < n - 1; i++) - { - sig = ((double) x[i] - x[i - 1]) / ((double) x[i + 1] - x[i - 1]); - p = sig * y2[i - 1] + 2.0; - y2[i] = (sig - 1.0) / p; - u[i] = - (((double) y[i + 1] - y[i]) / (x[i + 1] - x[i])) - - (((double) y[i] - y[i - 1]) / (x[i] - x[i - 1])); - u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p; - } - qn = un = 0.0; - - y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0); - for (k = n - 2; k >= 0; k--) - y2[k] = y2[k] * y2[k + 1] + u[k]; - delete[] u; -} - -double EQGraph::eval_spline (double xa[], double ya[], double y2a[], int n, double x) -{ - int klo, khi, k; - double h, b, a; - - klo = 0; - khi = n - 1; - while (khi - klo > 1) - { - k = (khi + klo) >> 1; - if (xa[k] > x) - khi = k; - else - klo = k; - } - h = xa[khi] - xa[klo]; - a = (xa[khi] - x) / h; - b = (x - xa[klo]) / h; - return (a * ya[klo] + b * ya[khi] + - ((a * a * a - a) * y2a[klo] + - (b * b * b - b) * y2a[khi]) * (h * h) / 6.0); -} - -void EQGraph::draw() -{ - QPixmap pixmap = m_skin->getEqPart (Skin::EQ_GRAPH); - if (pixmap.isNull()) - pixmap = QPixmap(113*m_ratio,19*m_ratio); - - if (m_values.size()!=10) - { - setPixmap (pixmap); - return; - } - - int i, y, ymin, ymax, py = 0; - double x[] = { 0, 11, 23, 35, 47, 59, 71, 83, 97, 109 }, yf[10]; - double *bands = new double[10]; - - for (int i = 0; i < 10; ++i) - { - bands[i] = m_values.at (i); - } - - init_spline (x, bands, 10, yf); - for (i = 0; i < 113; i++) - { - y = 9 - (int) ((eval_spline (x, bands, yf, 10, i) * 9.0) / 20.0); - if (y < 0) - y = 0; - if (y > 18) - y = 18; - if (!i) - py = y; - if (y < py) - { - ymin = y; - ymax = py; - } - else - { - ymin = py; - ymax = y; - } - py = y; - - QPainter paint (&pixmap); - paint.drawPixmap (i*m_ratio, y*m_ratio, m_skin->getEqSpline (y)); - } - setPixmap (pixmap); - delete [] bands; -} - -void EQGraph::updateSkin() -{ - m_ratio = m_skin->ratio(); - draw(); - setVisible(!m_skin->getEqPart (Skin::EQ_GRAPH).isNull()); -} - diff --git a/src/ui/eqgraph.h b/src/ui/eqgraph.h deleted file mode 100644 index 96e5db521..000000000 --- a/src/ui/eqgraph.h +++ /dev/null @@ -1,53 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef EQGRAPH_H -#define EQGRAPH_H - -#include "pixmapwidget.h" - -class Skin; -/** - @author Ilya Kotov -*/ -class EQGraph : public PixmapWidget -{ - Q_OBJECT -public: - EQGraph (QWidget *parent = 0); - - ~EQGraph(); - - void addValue (int); - void clear(); - -private slots: - void updateSkin(); - -private: - QList m_values; - Skin *m_skin; - void init_spline (double * x, double * y, int n, double * y2); - double eval_spline (double xa[], double ya[], double y2a[], int n, double x); - void draw(); - int m_ratio; - -}; - -#endif diff --git a/src/ui/eqpreset.cpp b/src/ui/eqpreset.cpp deleted file mode 100644 index 533dd4f67..000000000 --- a/src/ui/eqpreset.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "eqpreset.h" - -EQPreset::EQPreset() - : QListWidgetItem() -{ - m_preamp = 0; - for(int i = 0; i < 10; ++i) - m_bands[i] = 0; -} - - -EQPreset::~EQPreset() -{} - -void EQPreset::setGain(int n, double value) -{ - if(n > 9 || n < 0) - return; - m_bands[n] = value; -} - -void EQPreset::setPreamp(double preamp) -{ - m_preamp = preamp; -} - -double EQPreset::gain(int n) -{ - if(n > 9 || n < 0) - return 0; - return m_bands[n]; -} - -double EQPreset::preamp() -{ - return m_preamp; -} diff --git a/src/ui/eqpreset.h b/src/ui/eqpreset.h deleted file mode 100644 index fd99e6826..000000000 --- a/src/ui/eqpreset.h +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef EQPRESET_H -#define EQPRESET_H - -#include - -/** - @author Ilya Kotov -*/ -class EQPreset : public QListWidgetItem -{ -public: - EQPreset(); - - ~EQPreset(); - - void setGain(int n, double value); - void setPreamp(double); - - double gain(int n); - double preamp(); - -private: - double m_bands[10]; - double m_preamp; - -}; - -#endif diff --git a/src/ui/eqslider.cpp b/src/ui/eqslider.cpp deleted file mode 100644 index 5c1925a4f..000000000 --- a/src/ui/eqslider.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include - -#include "skin.h" - -#include "eqslider.h" - - -EqSlider::EqSlider(QWidget *parent): PixmapWidget(parent) -{ - m_skin = Skin::instance(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setPixmap(m_skin->getEqSlider(0)); - m_moving = false; - m_min = -20; - m_max = 20; - m_old = m_value = 0; - draw(false); - setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); -} - -EqSlider::~EqSlider() -{} - -void EqSlider::mousePressEvent(QMouseEvent *e) -{ - m_moving = true; - press_pos = e->y(); - if (e->button() == Qt::MidButton) - { - m_value = 0; - emit sliderMoved(m_value); - m_old = m_value; - } - else if (m_posy() && e->y()ratio()) - { - press_pos = e->y()-m_pos; - } - else - { - m_value = convert(qMax(qMin(height()-12*m_skin->ratio(),e->y()-6*m_skin->ratio()),0)); - press_pos = 6*m_skin->ratio(); - if (m_value!=m_old) - { - emit sliderMoved(m_value); - m_old = m_value; - } - } - draw(); -} - -void EqSlider::mouseReleaseEvent(QMouseEvent*) -{ - m_moving = false; - draw(false); -} - -void EqSlider::mouseMoveEvent(QMouseEvent* e) -{ - if (m_moving) - { - int po = e->y(); - po = po - press_pos; - - if (0<=po && po<=height()-12*m_skin->ratio()) - { - m_value = convert(po); - draw(); - if (m_value!=m_old) - { - - m_old = m_value; - //qDebug ("%d",-m_value); - emit sliderMoved(-m_value); - } - } - } -} - -double EqSlider::value() -{ - return - m_value; -} - -void EqSlider::setValue(double p) -{ - if (m_moving) - return; - m_value = -p; - draw(false); -} - -void EqSlider::setMax(double m) -{ - m_max = m; - draw(false); -} - -void EqSlider::updateSkin() -{ - resize(m_skin->getEqSlider(0).size()); - draw(false); - setCursor(m_skin->getCursor(Skin::CUR_EQSLID)); -} - -void EqSlider::draw(bool pressed) -{ - int p=int(ceil(double(m_value-m_min)*(height()-12*m_skin->ratio())/(m_max-m_min))); - m_pixmap = m_skin->getEqSlider(27-27*(m_value-m_min)/(m_max-m_min)); - QPainter paint(&m_pixmap); - if (pressed) - paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_P)); - else - paint.drawPixmap(1,p,m_skin->getButton(Skin::EQ_BT_BAR_N)); - setPixmap(m_pixmap); - m_pos = p; -} - -double EqSlider::convert(int p) -{ - return (m_max - m_min)*(p)/(height() - 12*m_skin->ratio()) + m_min; -} - -void EqSlider::wheelEvent(QWheelEvent *e) -{ - m_value -= e->delta()/60; - m_value = m_value > m_max ? m_max : m_value; - m_value = m_value < m_min ? m_min : m_value; - draw(false); - emit sliderMoved(m_value); -} - diff --git a/src/ui/eqslider.h b/src/ui/eqslider.h deleted file mode 100644 index 0a36a16ee..000000000 --- a/src/ui/eqslider.h +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef EQSLIDER_H -#define EQSLIDER_H - -#include "pixmapwidget.h" - -class QMouseEvent; -class QWheelEvent; -class Skin; - -/** - @author Ilya Kotov -*/ -class EqSlider : public PixmapWidget -{ -Q_OBJECT -public: - EqSlider(QWidget *parent = 0); - - ~EqSlider(); - - double value(); - -public slots: - void setValue(double); - void setMax(double); - -signals: - void sliderMoved (double); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - bool m_moving; - int press_pos; - double m_max, m_min, m_pos, m_value, m_old; - QPixmap m_pixmap; - double convert(int); // value = convert(position); - void draw(bool pressed = true); - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void wheelEvent(QWheelEvent *); - - -}; - -#endif diff --git a/src/ui/eqtitlebar.cpp b/src/ui/eqtitlebar.cpp deleted file mode 100644 index e26a35e89..000000000 --- a/src/ui/eqtitlebar.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include "eqwidget.h" -#include "skin.h" -#include "shadedbar.h" -#include "dock.h" -#include "mainwindow.h" -#include "button.h" -#include "eqtitlebar.h" - -EqTitleBar::EqTitleBar(QWidget *parent) - : PixmapWidget(parent) -{ - m_volumeBar = 0; - m_balanceBar = 0; - m_shade2 = 0; - m_left = 0; - m_right = 0; - m_shaded = false; - m_align = false; - m_skin = Skin::instance(); - m_eq = parentWidget(); - m_mw = qobject_cast(m_eq->parent()); - m_close = new Button(this, Skin::EQ_BT_CLOSE_N, Skin::EQ_BT_CLOSE_P, Skin::CUR_EQCLOSE); - connect(m_close, SIGNAL(clicked()),m_eq, SIGNAL(closed())); - m_shade = new Button(this, Skin::EQ_BT_SHADE1_N, Skin::EQ_BT_SHADE1_P, Skin::CUR_EQNORMAL); - connect(m_shade, SIGNAL(clicked()), SLOT(shade())); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - if (settings.value("Equalizer/shaded", false).toBool()) - shade(); - m_align = true; - setActive(false); - setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); - connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); - updatePositions(); -} - - -EqTitleBar::~EqTitleBar() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.setValue("Equalizer/shaded", m_shaded); -} - -void EqTitleBar::updatePositions() -{ - int r = m_skin->ratio(); - m_close->move(r*264,r*3); - m_shade->move(r*254,r*3); - if(m_volumeBar) - m_volumeBar->move(r*61,r*4); - if(m_balanceBar) - m_balanceBar->move(r*164,r*4); - if(m_shade2) - m_shade2->move(r*254,r*3); -} - -void EqTitleBar::setActive(bool active) -{ - if (active) - { - if (m_shaded) - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); - else - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); - } - else - { - if (m_shaded) - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_I)); - else - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_I)); - } -} - -void EqTitleBar::setVolume(int left, int right) -{ - m_left = left; - m_right = right; - if (m_volumeBar && m_balanceBar) - { - int maxVol = qMax(left, right); - m_volumeBar->setValue(maxVol); - if (maxVol && !m_volumeBar->isPressed()) - m_balanceBar->setValue((right - left)*100/maxVol); - } -} - -void EqTitleBar::mousePressEvent(QMouseEvent* event) -{ - switch ((int) event->button ()) - { - case Qt::LeftButton: - m_pos = event->pos(); - break; - case Qt::RightButton: - m_mw->menu()->exec(event->globalPos()); - } -} - -void EqTitleBar::mouseMoveEvent(QMouseEvent* event) -{ - if (m_pos.x() < width() - 30 * m_skin->ratio()) - { - QPoint npos = (event->globalPos()-m_pos); - Dock::instance()->move(m_eq, npos); - } -} - -void EqTitleBar::mouseReleaseEvent(QMouseEvent*) -{ - Dock::instance()->updateDock(); -} - -void EqTitleBar::mouseDoubleClickEvent (QMouseEvent *) -{ - EqTitleBar::shade(); -} - -void EqTitleBar::shade() -{ - m_shaded = !m_shaded; - int r = m_skin->ratio(); - - if (m_shaded) - { - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_SHADED_A)); - m_shade->hide(); - m_shade2 = new Button(this, Skin::EQ_BT_SHADE2_N, Skin::EQ_BT_SHADE2_P, Skin::CUR_EQNORMAL); - m_shade2->move(r*254,r*3); - connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); - m_shade2->show(); - m_volumeBar = new ShadedBar(this, Skin::EQ_VOLUME1, Skin::EQ_VOLUME2, Skin::EQ_VOLUME3); - m_volumeBar->move(r*61,r*4); - m_volumeBar->show(); - connect(m_volumeBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); - m_balanceBar = new ShadedBar(this, Skin::EQ_BALANCE1, Skin::EQ_BALANCE2, Skin::EQ_BALANCE3); - m_balanceBar->move(r*164,r*4); - m_balanceBar->setRange(-100, 100); - m_balanceBar->show(); - connect(m_balanceBar, SIGNAL(sliderMoved(int)),SLOT(updateVolume())); - setVolume(m_left, m_right); //show current volume and balance - } - else - { - setPixmap(m_skin->getEqPart(Skin::EQ_TITLEBAR_A)); - m_shade2->deleteLater(); - m_volumeBar->deleteLater(); - m_balanceBar->deleteLater(); - m_volumeBar = 0; - m_balanceBar = 0; - m_shade2 = 0; - m_shade->show(); - } - qobject_cast(m_eq)->setMimimalMode(m_shaded); - if (m_align) - Dock::instance()->align(m_eq, m_shaded? -102*r: 102*r); -} - -void EqTitleBar::updateVolume() -{ - m_mw->setVolume(m_volumeBar->value(), m_balanceBar->value()); -} - -void EqTitleBar::updateSkin() -{ - setCursor(m_skin->getCursor(Skin::CUR_EQTITLE)); - updatePositions(); -} diff --git a/src/ui/eqtitlebar.h b/src/ui/eqtitlebar.h deleted file mode 100644 index d2ea09c6a..000000000 --- a/src/ui/eqtitlebar.h +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef EQTITLEBAR_H -#define EQTITLEBAR_H - -#include "pixmapwidget.h" - -class QMouseEvent; -class Skin; -class MainWindow; -class Button; -class ShadedBar; - -/** - @author Ilya Kotov -*/ -class EqTitleBar : public PixmapWidget -{ -Q_OBJECT -public: - EqTitleBar(QWidget *parent = 0); - - ~EqTitleBar(); - - void setActive(bool); - -public slots: - void setVolume(int left, int right); - -private slots: - void shade(); - void updateVolume(); - void updateSkin(); - -private: - void updatePositions(); - Skin* m_skin; - bool m_active; - int m_left; - int m_right; - QPoint m_pos; - QWidget* m_eq; - MainWindow* m_mw; - Button* m_close; - Button* m_shade; - Button* m_shade2; - bool m_shaded, m_align; - ShadedBar* m_volumeBar; - ShadedBar* m_balanceBar; - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void mouseDoubleClickEvent (QMouseEvent *); -}; - -#endif diff --git a/src/ui/eqwidget.cpp b/src/ui/eqwidget.cpp deleted file mode 100644 index 1327b1bd9..000000000 --- a/src/ui/eqwidget.cpp +++ /dev/null @@ -1,446 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include "skin.h" -#include "eqslider.h" -#include "eqtitlebar.h" -#include "togglebutton.h" -#include "eqgraph.h" -#include "button.h" -#include "eqpreset.h" -#include "preseteditor.h" -#include "mainwindow.h" -#include "playlist.h" -#include "windowsystem.h" -#include "eqwidget.h" - -EqWidget::EqWidget (QWidget *parent) - : PixmapWidget (parent) -{ - setWindowTitle(tr("Equalizer")); - m_shaded = false; - m_skin = Skin::instance(); - setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); - setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); - m_titleBar = new EqTitleBar (this); - m_titleBar->move (0,0); - connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); - - m_preamp = new EqSlider (this); - connect (m_preamp,SIGNAL (sliderMoved (double)),SLOT (writeEq())); - - m_on = new ToggleButton (this,Skin::EQ_BT_ON_N,Skin::EQ_BT_ON_P, Skin::EQ_BT_OFF_N,Skin::EQ_BT_OFF_P); - connect (m_on, SIGNAL (clicked(bool)), SLOT(writeEq())); - - m_autoButton = new ToggleButton(this, Skin::EQ_BT_AUTO_1_N, Skin::EQ_BT_AUTO_1_P, - Skin::EQ_BT_AUTO_0_N, Skin::EQ_BT_AUTO_0_P); - m_eqg = new EQGraph(this); - m_presetsMenu = new QMenu(this); - m_presetButton = new Button (this, Skin::EQ_BT_PRESETS_N, Skin::EQ_BT_PRESETS_P, Skin::CUR_EQNORMAL); - connect(m_presetButton, SIGNAL(clicked()), SLOT(showPresetsMenu())); - connect(SoundCore::instance(), SIGNAL(eqSettingsChanged()), SLOT(readEq())); - - for (int i = 0; i<10; ++i) - { - m_sliders << new EqSlider (this); - connect (m_sliders.at (i), SIGNAL (sliderMoved (double)),SLOT (writeEq())); - } - readSettings(); - createActions(); - updatePositions(); - updateMask(); - connect(SoundCore::instance(), SIGNAL(volumeChanged(int, int)), m_titleBar, SLOT(setVolume(int, int))); -#ifdef Q_WS_X11 - QString wm_name = WindowSystem::netWindowManagerName(); - if(wm_name.contains("metacity", Qt::CaseInsensitive) || - wm_name.contains("openbox", Qt::CaseInsensitive)) - setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); - else -#endif - setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); -} - -EqWidget::~EqWidget() -{ - while (!m_presets.isEmpty()) - delete m_presets.takeFirst(); - while (!m_autoPresets.isEmpty()) - delete m_autoPresets.takeFirst(); -} - -void EqWidget::updatePositions() -{ - int r = m_skin->ratio(); - m_preamp->move (21*r,38*r); - m_on->move (14*r,18*r); - m_autoButton->move(39*r,18*r); - m_eqg->move(87*r,17*r); - m_presetButton->move(217*r,18*r); - for (int i = 0; i < 10; ++i) - m_sliders.at (i)->move ((78+i*18)*r,38*r); -} - -void EqWidget::changeEvent (QEvent * event) -{ - if (event->type() == QEvent::ActivationChange) - { - m_titleBar->setActive(isActiveWindow()); - } -} - -void EqWidget::closeEvent (QCloseEvent* e) -{ - if (e->spontaneous ()) - emit closed(); - writeSettings(); -} - -void EqWidget::updateSkin() -{ - m_titleBar->setActive (false); - setPixmap (m_skin->getEqPart (Skin::EQ_MAIN)); - setCursor (m_skin->getCursor (Skin::CUR_EQNORMAL)); - setMimimalMode(m_shaded); - updatePositions(); -} - -void EqWidget::setMimimalMode(bool b) -{ - m_shaded = b; - int r = m_skin->ratio(); - - if(m_shaded) - resize(r*275,r*14); - else - resize(r*275,r*116); - updateMask(); -} - -void EqWidget::readSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - move (settings.value ("Equalizer/pos", QPoint (100, 216)).toPoint()); //geometry - readEq(); - //equalizer presets - QSettings eq_preset (QDir::homePath() +"/.qmmp/eq.preset", QSettings::IniFormat); - for (int i = 1; true; ++i) - { - if (eq_preset.contains("Presets/Preset"+QString("%1").arg(i))) - { - QString name = eq_preset.value("Presets/Preset"+QString("%1").arg(i), - tr("preset")).toString(); - EQPreset *preset = new EQPreset(); - preset->setText(name); - eq_preset.beginGroup(name); - for (int j = 0; j < 10; ++j) - { - preset->setGain(j,eq_preset.value("Band"+QString("%1").arg(j), - 0).toDouble()); - } - preset->setPreamp(eq_preset.value("Preamp",0).toDouble()); - m_presets.append(preset); - eq_preset.endGroup(); - } - else - break; - } - //equalizer auto-load presets - QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", QSettings::IniFormat); - for (int i = 1; true; ++i) - { - if (eq_auto.contains("Presets/Preset"+QString("%1").arg(i))) - { - QString name = eq_auto.value("Presets/Preset"+QString("%1").arg(i), - tr("preset")).toString(); - EQPreset *preset = new EQPreset(); - preset->setText(name); - eq_auto.beginGroup(name); - for (int j = 0; j < 10; ++j) - { - preset->setGain(j,eq_auto.value("Band"+QString("%1").arg(j), - 0).toDouble()); - } - preset->setPreamp(eq_auto.value("Preamp",0).toDouble()); - m_autoPresets.append(preset); - eq_auto.endGroup(); - } - else - break; - } -} - -void EqWidget::writeSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.setValue ("Equalizer/pos", this->pos()); //geometry - //equalizer presets - QSettings eq_preset (QDir::homePath() +"/.qmmp/eq.preset", QSettings::IniFormat); - eq_preset.clear (); - for (int i = 0; i < m_presets.size(); ++i) - { - eq_preset.setValue("Presets/Preset"+QString("%1").arg(i+1), - m_presets.at(i)->text()); - eq_preset.beginGroup(m_presets.at(i)->text()); - for (int j = 0; j < 10; ++j) - { - eq_preset.setValue("Band"+QString("%1").arg(j),m_presets.at(i)->gain(j)); - } - eq_preset.setValue("Preamp",m_presets.at(i)->preamp()); - eq_preset.endGroup(); - } - //equalizer auto-load presets - QSettings eq_auto (QDir::homePath() +"/.qmmp/eq.auto_preset", - QSettings::IniFormat); - eq_auto.clear(); - for (int i = 0; i < m_autoPresets.size(); ++i) - { - eq_auto.setValue("Presets/Preset"+QString("%1").arg(i+1), - m_autoPresets.at(i)->text()); - eq_auto.beginGroup(m_autoPresets.at(i)->text()); - for (int j = 0; j < 10; ++j) - { - eq_auto.setValue("Band"+QString("%1").arg(j),m_autoPresets.at(i)->gain(j)); - } - eq_auto.setValue("Preamp",m_autoPresets.at(i)->preamp()); - eq_auto.endGroup(); - } -} - -void EqWidget::readEq() -{ - m_eqg->clear(); - EqSettings eqSettings = SoundCore::instance()->eqSettings(); - m_preamp->setValue(eqSettings.preamp()); - for (int i=0; i<10; ++i) - { - m_sliders.at(i)->setValue(eqSettings.gain(i)); - m_eqg->addValue(m_sliders.at(i)->value()); - } - m_on->setON(eqSettings.isEnabled()); -} - -void EqWidget::writeEq() -{ - m_eqg->clear(); - EqSettings eqSettings; - eqSettings.setPreamp(m_preamp->value()); - for (int i=0; i<10; ++i) - { - eqSettings.setGain(i,m_sliders.at(i)->value()); - m_eqg->addValue(m_sliders.at(i)->value()); - } - eqSettings.setEnabled(m_on->isChecked()); - SoundCore::instance()->setEqSettings(eqSettings); -} - -void EqWidget::createActions() -{ - m_presetsMenu->addAction(tr("&Load/Delete"),this, SLOT(showEditor())); - m_presetsMenu->addSeparator(); - m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Preset"), - this, SLOT(savePreset())); - m_presetsMenu->addAction(QIcon::fromTheme("document-save"), tr("&Save Auto-load Preset"), - this, SLOT(saveAutoPreset())); - m_presetsMenu->addAction(QIcon::fromTheme("document-open"), tr("&Import"), - this, SLOT(importWinampEQF())); - m_presetsMenu->addSeparator(); - m_presetsMenu->addAction(QIcon::fromTheme("edit-clear"), tr("&Clear"), this, SLOT(reset())); -} - -void EqWidget::showPresetsMenu() -{ - m_presetsMenu->exec(m_presetButton->mapToGlobal(QPoint(0, 0))); -} - -void EqWidget::reset() -{ - for (int i = 0; i < m_sliders.size(); ++i) - m_sliders.at(i)->setValue(0); - m_preamp->setValue(0); - writeEq(); -} - -void EqWidget::showEditor() -{ - PresetEditor *editor = new PresetEditor(this); - editor->addPresets(m_presets); - editor->addAutoPresets(m_autoPresets); - connect (editor, SIGNAL(presetLoaded(EQPreset*)), SLOT(setPreset(EQPreset*))); - connect (editor, SIGNAL(presetDeleted(EQPreset*)), SLOT(deletePreset(EQPreset*))); - editor->show(); -} - -void EqWidget::savePreset() -{ - bool ok; - QString text = QInputDialog::getText(this, tr("Saving Preset"), - tr("Preset name:"), QLineEdit::Normal, - tr("preset #")+QString("%1").arg(m_presets.size()+1), &ok); - if (ok) - { - EQPreset* preset = new EQPreset; - preset->setText(text); - preset->setPreamp(m_preamp->value()); - for (int i = 0; i<10; ++i) - preset->setGain(i, m_sliders.at (i)->value()); - foreach(EQPreset *p, m_presets) //remove preset with same name - { - if (p->text() == text) - { - m_presets.removeAll(p); - delete p; - } - } - m_presets.append(preset); - } -} - -void EqWidget::saveAutoPreset() -{ - PlayList* playlist = qobject_cast(parent())->playlist(); - if (!playlist->currentItem()) - return; - //delete preset if it already exists - EQPreset* preset = findPreset(playlist->currentItem()->url().section("/",-1)); - if (preset) - deletePreset(preset); - //create new preset - preset = new EQPreset(); - preset->setText(playlist->currentItem()->url().section("/",-1)); - preset->setPreamp(m_preamp->value()); - for (int i = 0; i<10; ++i) - { - preset->setGain(i, m_sliders.at (i)->value()); - } - m_autoPresets.append(preset); -} - -void EqWidget::setPreset(EQPreset* preset) -{ - for (int i = 0; i<10; ++i) - m_sliders.at(i)->setValue(preset->gain(i)); - m_preamp->setValue(preset->preamp()); - writeEq(); -} - -void EqWidget::deletePreset(EQPreset* preset) -{ - int p = m_presets.indexOf(preset); - if (p != -1) - { - delete m_presets.takeAt(p); - return; - } - p = m_autoPresets.indexOf(preset); - if (p != -1) - { - delete m_autoPresets.takeAt(p); - return; - } -} - -void EqWidget::loadPreset(const QString &name) -{ - if (m_autoButton->isChecked()) - { - EQPreset *preset = findPreset(name); - if (preset) - setPreset(preset); - else - reset(); - } -} - -EQPreset *EqWidget::findPreset(const QString &name) -{ - foreach(EQPreset *preset, m_autoPresets) - { - if (preset->text() == name) - return preset; - } - return 0; -} - -void EqWidget::importWinampEQF() -{ - char header[31]; - char name[257]; - char bands[11]; - QString path = FileDialog::getOpenFileName(this, tr("Import Preset"), - "/home", - QString("Winamp EQF (*.q1)")); - - QFile file(path); - file.open(QIODevice::ReadOnly); - file.read (header, 31); - if (QString::fromAscii(header).contains("Winamp EQ library file v1.1")) - { - while (file.read (name, 257)) - { - EQPreset* preset = new EQPreset; - preset->setText(QString::fromAscii(name)); - - file.read(bands,11); - - for (int i = 0; i<10; ++i) - { - preset->setGain(i, 20 - bands[i]*40/64); - } - preset->setPreamp(20 - bands[10]*40/64); - m_presets.append(preset); - } - } - file.close(); - -} - -void EqWidget::keyPressEvent (QKeyEvent *ke) -{ - QKeyEvent event = QKeyEvent(ke->type(), ke->key(), - ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); - QApplication::sendEvent(qobject_cast(parent())->playlist(), &event); -} - -#ifdef Q_WS_X11 -bool EqWidget::event (QEvent *event) -{ - if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) - { - WindowSystem::ghostWindow(winId()); - WindowSystem::setWinHint(winId(), "equalizer", "Qmmp"); - } - return QWidget::event(event); -} -#endif - -void EqWidget::updateMask() -{ - clearMask(); - setMask(QRegion(0,0,width(),height())); - QRegion region = m_skin->getRegion(m_shaded? Skin::EQUALIZER_WS : Skin::EQUALIZER); - if (!region.isEmpty()) - setMask(region); -} diff --git a/src/ui/eqwidget.h b/src/ui/eqwidget.h deleted file mode 100644 index 7d0fb6086..000000000 --- a/src/ui/eqwidget.h +++ /dev/null @@ -1,102 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef EQWIDGET_H -#define EQWIDGET_H - -#include "pixmapwidget.h" -#include - -/** - @author Ilya Kotov -*/ - -class QMenu; -class Skin; -class EqTitleBar; -class EqSlider; -class ToggleButton; -class EQGraph; -class Button; -class EQPreset; -class PlayListItem; -class SoundCore; - -class EqWidget : public PixmapWidget -{ - Q_OBJECT -public: - EqWidget(QWidget *parent = 0); - - ~EqWidget(); - - /*! - * necessary for auto-load presets - */ - void loadPreset(const QString &name); - void setMimimalMode(bool b = true); - -signals: - void closed(); - -private slots: - void updateSkin(); - void readEq(); - void writeEq(); - void showPresetsMenu(); - void reset(); - void showEditor(); - void savePreset(); - void saveAutoPreset(); - void setPreset(EQPreset*); - void deletePreset(EQPreset*); - void importWinampEQF(); - -private: - void updatePositions(); - void readSettings(); - void writeSettings(); - void createActions(); - void updateMask(); - EQPreset *findPreset(const QString &name); - //events - virtual void keyPressEvent (QKeyEvent *); - virtual void changeEvent(QEvent*); - virtual void closeEvent(QCloseEvent*); -#ifdef Q_WS_X11 - virtual bool event (QEvent *event); -#endif - - Skin *m_skin; - EqTitleBar *m_titleBar; - EqSlider *m_preamp; - Button *m_presetButton; - QList m_sliders; - QPoint m_pos; - ToggleButton *m_on; - ToggleButton *m_autoButton; - EQGraph *m_eqg; - QMenu *m_presetsMenu; - QList m_presets; - QList m_autoPresets; - QString m_autoName; - bool m_shaded; -}; - -#endif diff --git a/src/ui/fft.c b/src/ui/fft.c deleted file mode 100644 index 7ca1978a5..000000000 --- a/src/ui/fft.c +++ /dev/null @@ -1,296 +0,0 @@ -/* fft.c: Iterative implementation of a FFT - * Copyright (C) 1999 Richard Boulton - * Convolution stuff by Ralph Loader - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * TODO - * Remove compiling in of FFT_BUFFER_SIZE? (Might slow things down, but would - * be nice to be able to change size at runtime.) - * Finish making / checking thread-safety. - * More optimisations. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "fft.h" - -//#include -#include -#include -#ifndef PI -#ifdef M_PI -#define PI M_PI -#else -#define PI 3.14159265358979323846 /* pi */ -#endif -#endif - -/* ########### */ -/* # Structs # */ -/* ########### */ - -struct _struct_fft_state { - /* Temporary data stores to perform FFT in. */ - float real[FFT_BUFFER_SIZE]; - float imag[FFT_BUFFER_SIZE]; -}; - -/* ############################# */ -/* # Local function prototypes # */ -/* ############################# */ - -static void fft_prepare(const sound_sample * input, float *re, float *im); -static void fft_calculate(float *re, float *im); -static void fft_output(const float *re, const float *im, float *output); -static int reverseBits(unsigned int initial); - -/* #################### */ -/* # Global variables # */ -/* #################### */ - -/* Table to speed up bit reverse copy */ -static unsigned int bitReverse[FFT_BUFFER_SIZE]; - -/* The next two tables could be made to use less space in memory, since they - * overlap hugely, but hey. */ -static float sintable[FFT_BUFFER_SIZE / 2]; -static float costable[FFT_BUFFER_SIZE / 2]; - -/* ############################## */ -/* # Externally called routines # */ -/* ############################## */ - -/* --------- */ -/* FFT stuff */ -/* --------- */ - -/* - * Initialisation routine - sets up tables and space to work in. - * Returns a pointer to internal state, to be used when performing calls. - * On error, returns NULL. - * The pointer should be freed when it is finished with, by fft_close(). - */ -fft_state * -fft_init(void) -{ - fft_state *state; - unsigned int i; - - state = (fft_state *) malloc(sizeof(fft_state)); - if (!state) - return NULL; - - for (i = 0; i < FFT_BUFFER_SIZE; i++) { - bitReverse[i] = reverseBits(i); - } - for (i = 0; i < FFT_BUFFER_SIZE / 2; i++) { - float j = 2 * PI * i / FFT_BUFFER_SIZE; - costable[i] = cos(j); - sintable[i] = sin(j); - } - - return state; -} - -/* - * Do all the steps of the FFT, taking as input sound data (as described in - * sound.h) and returning the intensities of each frequency as floats in the - * range 0 to ((FFT_BUFFER_SIZE / 2) * 32768) ^ 2 - * - * FIXME - the above range assumes no frequencies present have an amplitude - * larger than that of the sample variation. But this is false: we could have - * a wave such that its maximums are always between samples, and it's just - * inside the representable range at the places samples get taken. - * Question: what _is_ the maximum value possible. Twice that value? Root - * two times that value? Hmmm. Think it depends on the frequency, too. - * - * The input array is assumed to have FFT_BUFFER_SIZE elements, - * and the output array is assumed to have (FFT_BUFFER_SIZE / 2 + 1) elements. - * state is a (non-NULL) pointer returned by fft_init. - */ -void -fft_perform(const sound_sample * input, float *output, fft_state * state) -{ - /* Convert data from sound format to be ready for FFT */ - fft_prepare(input, state->real, state->imag); - - /* Do the actual FFT */ - fft_calculate(state->real, state->imag); - - /* Convert the FFT output into intensities */ - fft_output(state->real, state->imag, output); -} - -/* - * Free the state. - */ -void -fft_close(fft_state * state) -{ - if (state) - free(state); -} - -/* ########################### */ -/* # Locally called routines # */ -/* ########################### */ - -/* - * Prepare data to perform an FFT on - */ -static void -fft_prepare(const sound_sample * input, float *re, float *im) -{ - unsigned int i; - float *realptr = re; - float *imagptr = im; - - /* Get input, in reverse bit order */ - for (i = 0; i < FFT_BUFFER_SIZE; i++) { - *realptr++ = input[bitReverse[i]]; - *imagptr++ = 0; - } -} - -/* - * Take result of an FFT and calculate the intensities of each frequency - * Note: only produces half as many data points as the input had. - * This is roughly a consequence of the Nyquist sampling theorm thingy. - * (FIXME - make this comment better, and helpful.) - * - * The two divisions by 4 are also a consequence of this: the contributions - * returned for each frequency are split into two parts, one at i in the - * table, and the other at FFT_BUFFER_SIZE - i, except for i = 0 and - * FFT_BUFFER_SIZE which would otherwise get float (and then 4* when squared) - * the contributions. - */ -static void -fft_output(const float *re, const float *im, float *output) -{ - float *outputptr = output; - const float *realptr = re; - const float *imagptr = im; - float *endptr = output + FFT_BUFFER_SIZE / 2; - -#ifdef DEBUG - unsigned int i, j; -#endif - - while (outputptr <= endptr) { - *outputptr = (*realptr * *realptr) + (*imagptr * *imagptr); - outputptr++; - realptr++; - imagptr++; - } - /* Do divisions to keep the constant and highest frequency terms in scale - * with the other terms. */ - *output /= 4; - *endptr /= 4; - -#ifdef DEBUG - printf("Recalculated input:\n"); - for (i = 0; i < FFT_BUFFER_SIZE; i++) { - float val_real = 0; - float val_imag = 0; - for (j = 0; j < FFT_BUFFER_SIZE; j++) { - float fact_real = cos(-2 * j * i * PI / FFT_BUFFER_SIZE); - float fact_imag = sin(-2 * j * i * PI / FFT_BUFFER_SIZE); - val_real += fact_real * re[j] - fact_imag * im[j]; - val_imag += fact_real * im[j] + fact_imag * re[j]; - } - printf("%5d = %8f + i * %8f\n", i, - val_real / FFT_BUFFER_SIZE, val_imag / FFT_BUFFER_SIZE); - } - printf("\n"); -#endif -} - -/* - * Actually perform the FFT - */ -static void -fft_calculate(float *re, float *im) -{ - unsigned int i, j, k; - unsigned int exchanges; - float fact_real, fact_imag; - float tmp_real, tmp_imag; - unsigned int factfact; - - /* Set up some variables to reduce calculation in the loops */ - exchanges = 1; - factfact = FFT_BUFFER_SIZE / 2; - - /* Loop through the divide and conquer steps */ - for (i = FFT_BUFFER_SIZE_LOG; i != 0; i--) { - /* In this step, we have 2 ^ (i - 1) exchange groups, each with - * 2 ^ (FFT_BUFFER_SIZE_LOG - i) exchanges - */ - /* Loop through the exchanges in a group */ - for (j = 0; j != exchanges; j++) { - /* Work out factor for this exchange - * factor ^ (exchanges) = -1 - * So, real = cos(j * PI / exchanges), - * imag = sin(j * PI / exchanges) - */ - fact_real = costable[j * factfact]; - fact_imag = sintable[j * factfact]; - - /* Loop through all the exchange groups */ - for (k = j; k < FFT_BUFFER_SIZE; k += exchanges << 1) { - int k1 = k + exchanges; - /* newval[k] := val[k] + factor * val[k1] - * newval[k1] := val[k] - factor * val[k1] - **/ -#ifdef DEBUG - printf("%d %d %d\n", i, j, k); - printf("Exchange %d with %d\n", k, k1); - printf("Factor %9f + i * %8f\n", fact_real, fact_imag); -#endif - /* FIXME - potential scope for more optimization here? */ - tmp_real = fact_real * re[k1] - fact_imag * im[k1]; - tmp_imag = fact_real * im[k1] + fact_imag * re[k1]; - re[k1] = re[k] - tmp_real; - im[k1] = im[k] - tmp_imag; - re[k] += tmp_real; - im[k] += tmp_imag; -#ifdef DEBUG - for (k1 = 0; k1 < FFT_BUFFER_SIZE; k1++) { - printf("%5d = %8f + i * %8f\n", k1, real[k1], imag[k1]); - } -#endif - } - } - exchanges <<= 1; - factfact >>= 1; - } -} - -static int -reverseBits(unsigned int initial) -{ - unsigned int reversed = 0, loop; - for (loop = 0; loop < FFT_BUFFER_SIZE_LOG; loop++) { - reversed <<= 1; - reversed += (initial & 1); - initial >>= 1; - } - return reversed; -} diff --git a/src/ui/fft.h b/src/ui/fft.h deleted file mode 100644 index 431afa365..000000000 --- a/src/ui/fft.h +++ /dev/null @@ -1,45 +0,0 @@ -/* fft.h: Header for iterative implementation of a FFT - * Copyright (C) 1999 Richard Boulton - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _FFT_H_ -#define _FFT_H_ - -#define FFT_BUFFER_SIZE_LOG 9 - -#define FFT_BUFFER_SIZE (1 << FFT_BUFFER_SIZE_LOG) - -/* sound sample - should be an signed 16 bit value */ -typedef short int sound_sample; - -#ifdef __cplusplus -extern "C" { -#endif - -/* FFT library */ - typedef struct _struct_fft_state fft_state; - fft_state *fft_init(void); - void fft_perform(const sound_sample * input, float *output, - fft_state * state); - void fft_close(fft_state * state); - - - -#ifdef __cplusplus -} -#endif -#endif /* _FFT_H_ */ diff --git a/src/ui/forms/aboutdialog.ui b/src/ui/forms/aboutdialog.ui deleted file mode 100644 index f9ea40fca..000000000 --- a/src/ui/forms/aboutdialog.ui +++ /dev/null @@ -1,162 +0,0 @@ - - - AboutDialog - - - - 0 - 0 - 523 - 511 - - - - About Qmmp - - - - 9 - - - - - - - - :/logo-qmmp.png - - - Qt::AlignCenter - - - - - - - 0 - - - - About - - - - - - true - - - - - - - - Authors - - - - - - true - - - - - - - - Translators - - - - - - true - - - - - - - - Thanks To - - - - - - true - - - - - - - - License Agreement - - - - - - true - - - true - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - AboutDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - AboutDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/ui/forms/addurldialog.ui b/src/ui/forms/addurldialog.ui deleted file mode 100644 index 64ac928fc..000000000 --- a/src/ui/forms/addurldialog.ui +++ /dev/null @@ -1,99 +0,0 @@ - - AddUrlDialog - - - - 0 - 0 - 394 - 77 - - - - Enter URL to add - - - - 5 - - - 5 - - - 5 - - - 5 - - - - - true - - - - - - - Qt::Horizontal - - - - 181 - 20 - - - - - - - - &Add - - - - - - - &Cancel - - - - - - - - - addButton - clicked() - AddUrlDialog - accept() - - - 248 - 51 - - - 184 - 72 - - - - - cancelButton - clicked() - AddUrlDialog - reject() - - - 343 - 62 - - - 392 - 60 - - - - - diff --git a/src/ui/forms/configdialog.ui b/src/ui/forms/configdialog.ui deleted file mode 100644 index d6a6f7a47..000000000 --- a/src/ui/forms/configdialog.ui +++ /dev/null @@ -1,1576 +0,0 @@ - - - ConfigDialog - - - - 0 - 0 - 659 - 466 - - - - Qmmp Settings - - - - 6 - - - 6 - - - 9 - - - 6 - - - 6 - - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 170 - 0 - - - - - 180 - 16777215 - - - - - 38 - 38 - - - - QListView::Static - - - QListView::TopToBottom - - - false - - - QListView::Adjust - - - 2 - - - QListView::ListMode - - - false - - - 100 - - - false - - - 0 - - - - Appearance - - - - :/interface.png:/interface.png - - - - - Playlist - - - - :/playlist.png:/playlist.png - - - - - Plugins - - - - :/plugins.png:/plugins.png - - - - - Advanced - - - - :/advanced.png:/advanced.png - - - - - Connectivity - - - - :/network.png:/network.png - - - - - Audio - - - - :/replaygain.png:/replaygain.png - - - - - Shortcuts - - - - :/shortcuts.png:/shortcuts.png - - - - - - - - - 0 - 0 - - - - QFrame::Raised - - - 0 - - - - - - - 0 - - - - Skins - - - - - - true - - - QListView::Static - - - QListView::TopToBottom - - - QListView::ListMode - - - 0 - - - - - - - - 0 - 0 - - - - Add... - - - - - - - - 0 - 0 - - - - Refresh - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - Miscellaneous - - - - - - View - - - - - - Hide on close - - - - - - - Start hidden - - - - - - - Use skin cursors - - - - - - - - - - - 0 - 0 - - - - Fonts - - - - - - - 0 - 0 - - - - - 80 - 16777215 - - - - Player: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - ??? - - - - - - - ... - - - - - - - - 0 - 0 - - - - - 80 - 16777215 - - - - Playlist: - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - ??? - - - - - - - ... - - - - - - - Use bitmap font if available - - - - - - - - - - Transparency - - - - - - Main window - - - - - - - 90 - - - Qt::Horizontal - - - - - - - - 25 - 0 - - - - 0 - - - - - - - Equalizer - - - - - - - 90 - - - Qt::Horizontal - - - - - - - 0 - - - - - - - Playlist - - - - - - - 90 - - - Qt::Horizontal - - - - - - - 0 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - Metadata - - - - 9 - - - 6 - - - - - Load metadata from files - - - - - - - - - - Song Display - - - - - - Title format: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - ... - - - - - - - Convert underscores to blanks - - - - - - - Convert %20 to blanks - - - - - - - Show protocol - - - - - - - Show song numbers - - - - - - - Show playlists - - - - - - - - - Show popup information - - - - - - - false - - - Edit template - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Show anchor - - - - - - - false - - - Align song numbers - - - - - - - - - - Qt::Vertical - - - - 20 - 54 - - - - - - - - - - 9 - - - 5 - - - 0 - - - 0 - - - 6 - - - - - - 0 - 0 - - - - Preferences - - - - - - - - 0 - 0 - - - - Information - - - - - - - Qt::Horizontal - - - - 101 - 20 - - - - - - - - true - - - QAbstractItemView::SelectRows - - - true - - - false - - - 2 - - - - Description - - - - - Filename - - - - - - - - - - - - File Dialog - - - - - - - - - Information - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Cover Image Retrieve - - - - - - Use separate image files - - - true - - - - - - - Include files: - - - - - - - - - - Exclude files: - - - - - - - - - - - - Recursive search depth: - - - - - - - 6 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Playback - - - - - - Continue playback on startup - - - - - - - - - - - - 9 - - - 5 - - - 0 - - - 0 - - - - - Proxy - - - false - - - false - - - - - - Enable proxy usage - - - - - - - Proxy host name: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Proxy port: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Use authentication with proxy - - - - - - - Proxy user name: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Proxy password: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - QLineEdit::Password - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Replay Gain - - - - - - Replay Gain mode: - - - - - - - - 0 - 0 - - - - - - - - Preamp: - - - - - - - - 0 - 0 - - - - -15.000000000000000 - - - 15.000000000000000 - - - 0.010000000000000 - - - - - - - - 0 - 0 - - - - dB - - - - - - - - 0 - 0 - - - - Default gain: - - - - - - - - 0 - 0 - - - - -15.000000000000000 - - - 15.000000000000000 - - - 0.010000000000000 - - - - - - - - 0 - 0 - - - - dB - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Use peak info to prevent clipping - - - - - - - - - - Audio - - - - - - Output: - - - - - - - - - - - 0 - 0 - - - - Preferences - - - - - - - - 0 - 0 - - - - Information - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Buffer size: - - - - - - - - 0 - 0 - - - - ms - - - 500 - - - 6000 - - - 50 - - - - - - - Qt::Horizontal - - - - 266 - 20 - - - - - - - - Use software volume control - - - - - - - 16-bit output - - - - - - - - - - Qt::Vertical - - - - 20 - 132 - - - - - - - - - - - - true - - - true - - - - Action - - - - - Shortcut - - - - - - - - Change shortcut... - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - Qt::Horizontal - - - - - - - 6 - - - 0 - - - - - Qt::Horizontal - - - - 341 - 20 - - - - - - - - QDialogButtonBox::Close - - - - - - - - - - - - - enableProxyCheckBox - toggled(bool) - hostLineEdit - setEnabled(bool) - - - 286 - 39 - - - 286 - 39 - - - - - enableProxyCheckBox - toggled(bool) - portLineEdit - setEnabled(bool) - - - 286 - 39 - - - 272 - 39 - - - - - authProxyCheckBox - toggled(bool) - proxyUserLineEdit - setEnabled(bool) - - - 272 - 38 - - - 272 - 38 - - - - - authProxyCheckBox - toggled(bool) - proxyPasswLineEdit - setEnabled(bool) - - - 272 - 38 - - - 272 - 37 - - - - - popupCheckBox - toggled(bool) - popupTemplateButton - setEnabled(bool) - - - 362 - 310 - - - 455 - 315 - - - - - mwTransparencySlider - valueChanged(int) - mwTransparencyLabel - setNum(int) - - - 252 - 90 - - - 283 - 90 - - - - - eqTransparencySlider - valueChanged(int) - eqTransparencyLabel - setNum(int) - - - 252 - 84 - - - 274 - 84 - - - - - plTransparencySlider - valueChanged(int) - plTransparencyLabel - setNum(int) - - - 252 - 78 - - - 274 - 78 - - - - - useCoverFilesCheckBox - toggled(bool) - coverIncludeLineEdit - setEnabled(bool) - - - 286 - 39 - - - 286 - 39 - - - - - useCoverFilesCheckBox - toggled(bool) - coverExcludeLineEdit - setEnabled(bool) - - - 286 - 39 - - - 286 - 39 - - - - - useCoverFilesCheckBox - toggled(bool) - coverDepthSpinBox - setEnabled(bool) - - - 286 - 39 - - - 286 - 39 - - - - - buttonBox - rejected() - ConfigDialog - reject() - - - 651 - 458 - - - 225 - 421 - - - - - buttonBox - accepted() - ConfigDialog - accept() - - - 651 - 458 - - - 141 - 414 - - - - - numbersCheckBox - toggled(bool) - alignCheckBox - setEnabled(bool) - - - 278 - 208 - - - 271 - 236 - - - - - diff --git a/src/ui/forms/jumptotrackdialog.ui b/src/ui/forms/jumptotrackdialog.ui deleted file mode 100644 index 7f94a2845..000000000 --- a/src/ui/forms/jumptotrackdialog.ui +++ /dev/null @@ -1,152 +0,0 @@ - - - JumpToTrackDialog - - - - 0 - 0 - 487 - 315 - - - - Jump To Track - - - - 6 - - - 6 - - - 6 - - - - - 6 - - - 0 - - - - - Filter - - - - - - - - - - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SelectRows - - - - - - - - - - 0 - 0 - - - - Queue - - - - - - - - 0 - 0 - - - - Refresh - - - - - - - - 0 - 0 - - - - Jump To - - - - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - QDialogButtonBox::Close - - - - - - - - - - - buttonBox - rejected() - JumpToTrackDialog - hide() - - - 457 - 294 - - - 481 - 279 - - - - - diff --git a/src/ui/forms/playlistbrowser.ui b/src/ui/forms/playlistbrowser.ui deleted file mode 100644 index 0f9280905..000000000 --- a/src/ui/forms/playlistbrowser.ui +++ /dev/null @@ -1,126 +0,0 @@ - - - PlayListBrowser - - - - 0 - 0 - 402 - 298 - - - - Playlist Browser - - - - 6 - - - 9 - - - 6 - - - 6 - - - 6 - - - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectRows - - - - - - - New - - - - - - - Delete - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Close - - - - - - - ... - - - true - - - - - - - ... - - - Qt::ToolButtonIconOnly - - - true - - - - - - - - - buttonBox - accepted() - PlayListBrowser - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - PlayListBrowser - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/ui/forms/popupsettings.ui b/src/ui/forms/popupsettings.ui deleted file mode 100644 index c59db2b72..000000000 --- a/src/ui/forms/popupsettings.ui +++ /dev/null @@ -1,251 +0,0 @@ - - - PopupSettings - - - - 0 - 0 - 277 - 335 - - - - Popup Information Settings - - - - 6 - - - 6 - - - 6 - - - - - Template - - - - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - - 138 - 20 - - - - - - - - Reset - - - - - - - Insert - - - - - - - - - - Show cover - - - - - - - 0 - - - - - - - Cover size: - - - - - - - 32 - - - 128 - - - 1 - - - 16 - - - Qt::Horizontal - - - - - - - Transparency: - - - - - - - 90 - - - Qt::Horizontal - - - - - - - - 18 - 0 - - - - 0 - - - - - - - Delay: - - - - - - - 20 - - - 7000 - - - 500 - - - - - - - - 0 - 0 - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - ms - - - - - - - - - buttonBox - accepted() - PopupSettings - accept() - - - 281 - 286 - - - 62 - 299 - - - - - buttonBox - rejected() - PopupSettings - reject() - - - 281 - 286 - - - 95 - 299 - - - - - transparencySlider - valueChanged(int) - trasparencyLabel - setNum(int) - - - 258 - 251 - - - 282 - 251 - - - - - coverSizeSlider - valueChanged(int) - coverSizeLabel - setNum(int) - - - 258 - 223 - - - 282 - 223 - - - - - diff --git a/src/ui/forms/preseteditor.ui b/src/ui/forms/preseteditor.ui deleted file mode 100644 index 224a41ed3..000000000 --- a/src/ui/forms/preseteditor.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - PresetEditor - - - - 0 - 0 - 330 - 275 - - - - Preset Editor - - - false - - - - 6 - - - 6 - - - 6 - - - - - 0 - - - - Preset - - - - 6 - - - 9 - - - - - - - - - Auto-preset - - - - 6 - - - 9 - - - - - QAbstractItemView::NoEditTriggers - - - - - - - - - - - - - Load - - - - - - - Delete - - - - - - - QDialogButtonBox::Close - - - - - - - - - qPixmapFromMimeSource - - - - buttonBox - clicked(QAbstractButton*) - PresetEditor - accept() - - - 269 - 235 - - - 298 - 192 - - - - - diff --git a/src/ui/forms/shortcutdialog.ui b/src/ui/forms/shortcutdialog.ui deleted file mode 100644 index db1cf466e..000000000 --- a/src/ui/forms/shortcutdialog.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - ShortcutDialog - - - - 0 - 0 - 310 - 89 - - - - Change Shortcut - - - - 6 - - - 6 - - - 6 - - - - - Press the key combination you want to assign - - - - - - - true - - - - - - - Clear - - - - - - - Qt::Horizontal - - - - 106 - 20 - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - HotkeyDialog - accept() - - - 212 - 70 - - - 192 - 269 - - - - - buttonBox - rejected() - HotkeyDialog - reject() - - - 212 - 70 - - - 246 - 214 - - - - - clearButton - clicked() - keyLineEdit - clear() - - - 195 - 22 - - - 113 - 25 - - - - - diff --git a/src/ui/inlines.h b/src/ui/inlines.h deleted file mode 100644 index 39b81bd57..000000000 --- a/src/ui/inlines.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) 2000-2001 Brad Hughes -// -// Use, modification and distribution is allowed without limitation, -// warranty, or liability of any kind. -// - -#ifndef INLINES_H -#define INLINES_H - -#include "fft.h" - -// *fast* convenience functions -static inline void calc_freq(short* dest, short *src) -{ - static fft_state *state = NULL; - float tmp_out[257]; - int i; - - if (!state) - state = fft_init(); - - fft_perform(src, tmp_out, state); - - for (i = 0; i < 256; i++) - dest[i] = ((int) sqrt(tmp_out[i + 1])) >> 8; -} - -static inline void stereo16_from_multichannel(register short *l, - register short *r, - register short *s, - long cnt, int chan) -{ - while (cnt > 0) - { - l[0] = s[0]; - r[0] = s[1]; - s += chan; - l++; - r++; - cnt--; - } -} - -static inline void mono16_from_multichannel(register short *l, - register short *s, - long cnt, int chan) -{ - while (cnt > 0) - { - l[0] = s[0]; - s += chan; - l++; - cnt--; - } -} - -#endif // INLINES_H diff --git a/src/ui/jumptotrackdialog.cpp b/src/ui/jumptotrackdialog.cpp deleted file mode 100644 index d9df0bb75..000000000 --- a/src/ui/jumptotrackdialog.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "jumptotrackdialog.h" -#include -#include -#include -#include -#include -#include - -JumpToTrackDialog::JumpToTrackDialog(PlayListManager *manager, QWidget* parent) - : QDialog (parent) -{ - setupUi(this); - setAttribute(Qt::WA_QuitOnClose, false); - m_pl_manager = manager; - m_listModel = new QStringListModel(this); - - m_proxyModel = new QSortFilterProxyModel; - m_proxyModel->setDynamicSortFilter(true); - m_proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); - m_proxyModel->setSourceModel(m_listModel); - songsListView->setModel(m_proxyModel); - - connect(songsListView,SIGNAL(doubleClicked(const QModelIndex &)), - this,SLOT(jumpTo(const QModelIndex&))); - connect(songsListView,SIGNAL(activated(const QModelIndex &)), - this,SLOT(jumpTo(const QModelIndex&))); - connect(songsListView,SIGNAL(activated(const QModelIndex &)), - this,SLOT(accept())); - connect(songsListView->selectionModel(), - SIGNAL(currentRowChanged(const QModelIndex&,const QModelIndex&)), - this,SLOT(queueUnqueue(const QModelIndex&,const QModelIndex&))); - - new QShortcut(tr("Q"),this,SLOT(on_queuePushButton_clicked())); - new QShortcut(tr("J"),this,SLOT(on_jumpToPushButton_clicked())); - new QShortcut(tr("F5"),this,SLOT(on_refreshPushButton_clicked())); - - QAction *selectSongViewAction = new QAction(filterLineEdit); - selectSongViewAction->setShortcut(Qt::Key_Down); - selectSongViewAction->setShortcutContext(Qt::WidgetShortcut); - filterLineEdit->addAction(selectSongViewAction); - connect(selectSongViewAction, SIGNAL(triggered()),songsListView, SLOT(setFocus())); - //setup icons - refreshPushButton->setIcon(QIcon::fromTheme("view-refresh")); - jumpToPushButton->setIcon(QIcon::fromTheme("go-top")); -} - -JumpToTrackDialog::~JumpToTrackDialog() -{ -} - -void JumpToTrackDialog::on_refreshPushButton_clicked() -{ - refresh(); -} - -void JumpToTrackDialog::on_queuePushButton_clicked() -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - int selected = (m_proxyModel->mapToSource(mi_list.at(0))).row(); - m_pl_manager->selectedPlayList()->setQueued(m_pl_manager->selectedPlayList()->item(selected)); - if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(selected))) - queuePushButton->setText(tr("Unqueue")); - else - queuePushButton->setText(tr("Queue")); - } -} - -void JumpToTrackDialog::on_jumpToPushButton_clicked() -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - jumpTo(mi_list.at(0)); - } -} - -void JumpToTrackDialog::refresh() -{ - filterLineEdit->clear(); - QStringList titles = m_pl_manager->selectedPlayList()->getTitles(0, m_pl_manager->selectedPlayList()->count()); - m_listModel->setStringList(titles); - filterLineEdit->setFocus(); -} - -void JumpToTrackDialog::on_filterLineEdit_textChanged(const QString &str) -{ - m_proxyModel->setFilterFixedString(str); - if (m_proxyModel->hasIndex(0,0)) - songsListView->setCurrentIndex (m_proxyModel->index (0,0)); -} - -void JumpToTrackDialog::on_filterLineEdit_returnPressed () -{ - QModelIndexList mi_list = songsListView->selectionModel()->selectedRows(); - if (!mi_list.isEmpty()) - { - jumpTo(mi_list.at(0)); - accept(); - } -} - -void JumpToTrackDialog::jumpTo(const QModelIndex & index) -{ - int selected = (m_proxyModel->mapToSource(index)).row(); - m_pl_manager->selectedPlayList()->setCurrent(selected); - emit playRequest(); -} - -void JumpToTrackDialog::queueUnqueue(const QModelIndex& curr,const QModelIndex&) -{ - int row = m_proxyModel->mapToSource(curr).row(); - if (m_pl_manager->selectedPlayList()->isQueued(m_pl_manager->selectedPlayList()->item(row))) - queuePushButton->setText(tr("Unqueue")); - else - queuePushButton->setText(tr("Queue")); -} diff --git a/src/ui/jumptotrackdialog.h b/src/ui/jumptotrackdialog.h deleted file mode 100644 index 36186d72c..000000000 --- a/src/ui/jumptotrackdialog.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef JUMPTOTRACKDIALOG_H -#define JUMPTOTRACKDIALOG_H - -#include -#include "ui_jumptotrackdialog.h" - -class QStringListModel; -class QSortFilterProxyModel; -class PlayListManager; - -/** - @author Vladimir Kuznetsov - */ -class JumpToTrackDialog : public QDialog, private Ui::JumpToTrackDialog -{ - Q_OBJECT - -public: - JumpToTrackDialog(PlayListManager *manager, QWidget* parent = 0); - ~JumpToTrackDialog(); - void refresh(); - -protected slots: - void on_refreshPushButton_clicked(); - void on_queuePushButton_clicked(); - void on_jumpToPushButton_clicked(); - void on_filterLineEdit_textChanged(const QString&); - void on_filterLineEdit_returnPressed (); - void jumpTo(const QModelIndex&); - void queueUnqueue(const QModelIndex&,const QModelIndex&); - -signals: - void playRequest(); - -private: - QStringListModel* m_listModel; - QSortFilterProxyModel* m_proxyModel; - PlayListManager *m_pl_manager; -}; - -#endif - diff --git a/src/ui/keyboardmanager.cpp b/src/ui/keyboardmanager.cpp deleted file mode 100644 index cbdc70c33..000000000 --- a/src/ui/keyboardmanager.cpp +++ /dev/null @@ -1,280 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#include -#include -#include "playlist.h" -#include "listwidget.h" -#include "keyboardmanager.h" -#include "mainwindow.h" - - -KeyboardManager::KeyboardManager (PlayList* pl) -{ - m_playlist = pl; -} - -bool KeyboardManager::handleKeyPress (QKeyEvent* ke) -{ - bool handled = true; - switch (ke->key()) - { - case Qt::Key_Up: - keyUp (ke); - break; - case Qt::Key_Down: - keyDown (ke); - break; - case Qt::Key_PageUp: - keyPgUp (ke); - break; - case Qt::Key_PageDown: - keyPgDown (ke); - break; - case Qt::Key_Enter: - case Qt::Key_Return: - keyEnter (ke); - break; - case Qt::Key_Home: - keyHome(ke); - break; - case Qt::Key_End: - keyEnd(ke); - break; - default: - handled = false; - } - return handled; -} - -bool KeyboardManager::handleKeyRelease (QKeyEvent*) -{ - return false; -} - -void KeyboardManager::keyUp (QKeyEvent * ke) -{ - QList rows = m_playlist->listWidget()->model()->getSelectedRows(); - ListWidget* list_widget = m_playlist->listWidget(); - - if (rows.count() > 0) - { - if(rows[0] == 0 && rows.count() == 1) - return; - - if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) - { - m_playlist->listWidget()->model()->clearSelection(); - list_widget->setAnchorRow(-1); - } - - bool select_top = false; - int first_visible = list_widget->firstVisibleRow(); - int last_visible = list_widget->visibleRows() + first_visible - 1; - foreach (int i, rows) - { - if (i > last_visible || i < first_visible) - { - select_top = true; - break; - } - } - - if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) - { - if (ke->modifiers() == Qt::AltModifier) - { - m_playlist->listWidget()->model()->moveItems (rows[0],rows[0] - 1); - list_widget->setAnchorRow (list_widget->getAnchorRow() - 1); - } - else - { - if (rows.last() > list_widget->getAnchorRow() && ke->modifiers() & Qt::ShiftModifier) - { - m_playlist->listWidget()->model()->setSelected (rows.last(),false); - } - else if (rows[0] > 0) - { - m_playlist->listWidget()->model()->setSelected (rows[0] - 1,true); - } - else - { - m_playlist->listWidget()->model()->setSelected (rows[0],true); - if(list_widget->getAnchorRow() == -1) - list_widget->setAnchorRow(rows[0]); - } - - if (! (ke->modifiers() & Qt::ShiftModifier) && rows[0] > 0) - list_widget->setAnchorRow (rows[0] - 1); - } - } - else - { - m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); - list_widget->setAnchorRow(list_widget->firstVisibleRow()); - } - - rows = m_playlist->listWidget()->model()->getSelectedRows(); - - if (rows[0] < list_widget->firstVisibleRow() && list_widget->firstVisibleRow() > 0) - { - int r = rows.last() > list_widget->getAnchorRow() ? rows.last(): rows.first(); - if(ke->modifiers() & Qt::ShiftModifier && (r >= list_widget->firstVisibleRow())) - ; - else - list_widget->scroll (list_widget->firstVisibleRow() - 1); - } - } - else - { - //if(list_widget->getAnchorRow() == -1) - list_widget->setAnchorRow(list_widget->firstVisibleRow()); - m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); - } -} - -void KeyboardManager::keyDown (QKeyEvent * ke) -{ - QList rows = m_playlist->listWidget()->model()->getSelectedRows(); - ListWidget* list_widget = m_playlist->listWidget(); - //qWarning("count: %d",rows.count()); - if (rows.count() > 0) - { - if (! (ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier)) - { - m_playlist->listWidget()->model()->clearSelection(); - list_widget->setAnchorRow(-1); - } - - bool select_top = false; - int first_visible = list_widget->firstVisibleRow(); - int last_visible = list_widget->visibleRows() + first_visible - 1; - foreach (int i, rows) - { - if (i > last_visible || i < first_visible) - { - select_top = true; - break; - } - } - - if (!select_top || ke->modifiers() & Qt::ShiftModifier || ke->modifiers() & Qt::AltModifier) - { - if (ke->modifiers() == Qt::AltModifier) - { - m_playlist->listWidget()->model()->moveItems (rows.last(),rows.last() + 1); - list_widget->setAnchorRow (list_widget->getAnchorRow() + 1); - } - else - { - //qWarning("list_widget %d",list_widget->getAnchorRow()); - //qWarning("model count: %d rows.last(): %d",m_playlist->listWidget()->model()->count(),rows.last()); - if (rows[0] < list_widget->getAnchorRow() && ke->modifiers() & Qt::ShiftModifier) - m_playlist->listWidget()->model()->setSelected (rows[0],false); - else if (rows.last() < m_playlist->listWidget()->model()->count() - 1) - { - m_playlist->listWidget()->model()->setSelected (rows.last() + 1,true); - } - else - { - m_playlist->listWidget()->model()->setSelected (rows.last(),true); - if(list_widget->getAnchorRow() == -1) - list_widget->setAnchorRow(rows.last()); - } - - if (! (ke->modifiers() & Qt::ShiftModifier) && rows.last() < m_playlist->listWidget()->model()->count() - 1) - list_widget->setAnchorRow (rows.last() + 1); - } - } - else - { - m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); - list_widget->setAnchorRow(list_widget->firstVisibleRow()); - } - - rows = m_playlist->listWidget()->model()->getSelectedRows(); - - if (!rows.isEmpty() && rows.last() >= list_widget->visibleRows() + list_widget->firstVisibleRow()) - { - int r = rows.first() < list_widget->getAnchorRow() ? rows.first(): rows.last(); - if(ke->modifiers() & Qt::ShiftModifier && - (r < list_widget->firstVisibleRow() + list_widget->visibleRows())) - ; - else - list_widget->scroll (list_widget->firstVisibleRow() + 1); - } - } - else - { - m_playlist->listWidget()->model()->setSelected (list_widget->firstVisibleRow(),true); - //if(list_widget->getAnchorRow() == -1) - list_widget->setAnchorRow(list_widget->firstVisibleRow()); - } -} - -void KeyboardManager::keyPgUp (QKeyEvent *) -{ - ListWidget* list_widget = m_playlist->listWidget(); - int page_size = list_widget->visibleRows(); - int offset= (list_widget->firstVisibleRow()-page_size >= 0) ?list_widget->firstVisibleRow()-page_size:0; - list_widget->scroll (offset); -} - -void KeyboardManager::keyPgDown (QKeyEvent *) -{ - ListWidget* list_widget = m_playlist->listWidget(); - int page_size = list_widget->visibleRows(); - int offset = (list_widget->firstVisibleRow() +page_size < m_playlist->listWidget()->model()->count()) ? - list_widget->firstVisibleRow() +page_size:m_playlist->listWidget()->model()->count() - 1; - list_widget->scroll (offset); -} - -void KeyboardManager::keyEnter (QKeyEvent *) -{ - QList rows = m_playlist->listWidget()->model()->getSelectedRows(); - MainWindow* mw = qobject_cast (m_playlist->parentWidget()); - if (mw && rows.count() > 0) - { - m_playlist->listWidget()->model()->setCurrent (rows[0]); - mw->replay(); - } -} - -void KeyboardManager::keyHome(QKeyEvent *ke) -{ - ListWidget* list_widget = m_playlist->listWidget(); - m_playlist->listWidget()->scroll (0); - if(ke->modifiers() & Qt::ShiftModifier) - for(int i = 0; i <= list_widget->getAnchorRow(); ++i) - m_playlist->listWidget()->model()->setSelected (i,true); -} - -void KeyboardManager::keyEnd(QKeyEvent *ke) -{ - ListWidget* list_widget = m_playlist->listWidget(); - int page_size = list_widget->visibleRows(); - int scroll_to = m_playlist->listWidget()->model()->count() - page_size; - if(scroll_to >= 0) - list_widget->scroll(scroll_to); - if(ke->modifiers() & Qt::ShiftModifier) - for(int i = list_widget->getAnchorRow(); i < m_playlist->listWidget()->model()->count(); ++i) - m_playlist->listWidget()->model()->setSelected (i,true); -} diff --git a/src/ui/keyboardmanager.h b/src/ui/keyboardmanager.h deleted file mode 100644 index 120dbe9dc..000000000 --- a/src/ui/keyboardmanager.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#ifndef _KEYBOARDMANAGER_H -#define _KEYBOARDMANAGER_H - -class PlayList; -class QKeyEvent; - - -/*! - * Class \b KeyboardManager represents key handler object that processes - * all key events passed to the \b PlayList - * @author Vladimir Kuznetsov - */ -class KeyboardManager -{ - public: - /*! - * Constructor. Takes \b PlayList object as an argument. - */ - KeyboardManager (PlayList*); - - /*! - * Handles key press events from \b PlayList object. Returns \b true - * if the key was handled, otherwise \b false. - */ - bool handleKeyPress (QKeyEvent*); - - /*! - * Handles key release events from \b PlayList object. Returns \b true - * if the key was handled, otherwise \b false. - */ - bool handleKeyRelease (QKeyEvent*); - - protected: - void keyUp (QKeyEvent* ke); - void keyDown (QKeyEvent* ke); - void keyPgUp (QKeyEvent* ke); - void keyPgDown (QKeyEvent* ke); - void keyEnter (QKeyEvent* ke); - void keyHome(QKeyEvent* ke); - void keyEnd(QKeyEvent* ke); - private: - PlayList* m_playlist; -}; - -#endif - diff --git a/src/ui/listwidget.cpp b/src/ui/listwidget.cpp deleted file mode 100644 index fe261c24a..000000000 --- a/src/ui/listwidget.cpp +++ /dev/null @@ -1,569 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "listwidget.h" -#include "skin.h" -#include "popupwidget.h" -#include "playlist.h" - -#define INVALID_ROW -1 - -ListWidget::ListWidget(QWidget *parent) - : QWidget(parent) -{ - m_update = false; - m_skin = Skin::instance(); - m_popupWidget = 0; - m_metrics = 0; - m_extra_metrics = 0; - loadColors(); - m_menu = new QMenu(this); - m_scroll_direction = NONE; - m_prev_y = 0; - m_anchor_row = INVALID_ROW; - m_player = MediaPlayer::instance(); - connect (m_player, SIGNAL(repeatableChanged(bool)), SLOT(updateList())); - m_first = 0; - m_rows = 0; - m_scroll = false; - m_select_on_release = false; - readSettings(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setAcceptDrops(true); - setMouseTracking(true); - m_timer = new QTimer(this); - m_timer->setInterval(50); - connect(m_timer, SIGNAL(timeout()), SLOT(autoscroll())); -} - - -ListWidget::~ListWidget() -{ - if(m_metrics) - delete m_metrics; - if(m_extra_metrics) - delete m_extra_metrics; -} - -void ListWidget::readSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); - m_extra_font = m_font; - m_extra_font.setPointSize(m_font.pointSize() - 1); - m_show_protocol = settings.value ("PlayList/show_protocol", false).toBool(); - m_show_number = settings.value ("PlayList/show_numbers", true).toBool(); - m_align_numbres = settings.value ("PlayList/align_numbers", false).toBool(); - m_show_anchor = settings.value("PlayList/show_anchor", false).toBool(); - bool show_popup = settings.value("PlayList/show_popup", false).toBool(); - - if (m_update) - { - delete m_metrics; - delete m_extra_metrics; - m_metrics = new QFontMetrics(m_font); - m_extra_metrics = new QFontMetrics(m_extra_font); - m_rows = height() / (m_metrics->lineSpacing() + 2); - updateList(); - if(m_popupWidget) - { - m_popupWidget->deleteLater(); - m_popupWidget = 0; - } - } - else - { - m_update = true; - m_metrics = new QFontMetrics(m_font); - m_extra_metrics = new QFontMetrics(m_extra_font); - } - if(show_popup) - m_popupWidget = new PlayListPopup::PopupWidget(this); -} - -void ListWidget::loadColors() -{ - m_normal.setNamedColor(m_skin->getPLValue("normal")); - m_current.setNamedColor(m_skin->getPLValue("current")); - m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); - m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); -} - -void ListWidget::paintEvent(QPaintEvent *) -{ - QPainter m_painter(this); - m_painter.setFont(m_font); - m_painter.setBrush(QBrush(m_normal_bg)); - m_painter.drawRect(-1,-1,width()+1,height()+1); - int font_y = 0; - - for (int i = 0; i < m_titles.size(); ++i ) - { - if (m_show_anchor && i == m_anchor_row - m_first) - { - m_painter.setBrush(m_model->isSelected(i + m_first) ? m_selected_bg : m_normal_bg); - m_painter.setPen(m_normal); - m_painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), - width() - 10, m_metrics->lineSpacing() + 1); - } - else - { - if (m_model->isSelected(i + m_first)) - { - m_painter.setBrush(QBrush(m_selected_bg)); - m_painter.setPen(m_selected_bg); - m_painter.drawRect (6, i * (m_metrics->lineSpacing() + 2), - width() - 10, m_metrics->lineSpacing() + 1); - } - } - - if (m_model->currentRow() == i + m_first) - m_painter.setPen(m_current); - else - m_painter.setPen(m_normal); //243,58 - - font_y = (i + 1) * (2 + m_metrics->lineSpacing()) - 2 - m_metrics->descent(); - - - - if(m_number_width) - { - QString number = QString("%1").arg(m_first+i+1); - m_painter.drawText(10 + m_number_width - m_extra_metrics->width(number), - font_y, number); - m_painter.drawText(10 + m_number_width + m_metrics->width("9"), font_y, m_titles.at(i)); - } - else - m_painter.drawText(10, font_y, m_titles.at(i)); - - - QString extra_string = getExtraString(m_first + i); - if(!extra_string.isEmpty()) - { - m_painter.setFont(m_extra_font); - - if(m_times.at(i).isEmpty()) - m_painter.drawText(width() - 7 - m_extra_metrics->width(extra_string), - font_y, extra_string); - else - m_painter.drawText(width() - 10 - m_extra_metrics->width(extra_string) - - m_metrics->width(m_times.at(i)), font_y, extra_string); - m_painter.setFont(m_font); - } - m_painter.drawText(width() - 7 - m_metrics->width(m_times.at(i)), font_y, m_times.at(i)); - } - //draw line - if(m_number_width) - { - m_painter.setPen(m_normal); - m_painter.drawLine(10 + m_number_width + m_metrics->width("9") / 2, 2, - 10 + m_number_width + m_metrics->width("9") / 2, font_y); - } -} - -void ListWidget::mouseDoubleClickEvent (QMouseEvent *e) -{ - int y = e->y(); - int row = rowAt(y); - if (INVALID_ROW != row) - { - m_model->setCurrent(row); - emit selectionChanged(); - update(); - } -} - - -void ListWidget::mousePressEvent(QMouseEvent *e) -{ - if(m_popupWidget) - m_popupWidget->hide(); - m_scroll = true; - int y = e->y(); - int row = rowAt(y); - - if (INVALID_ROW != row && m_model->count() > row) - { - m_pressed_row = row; - if(e->button() == Qt::RightButton && !m_model->isSelected(row)) - { - m_model->clearSelection(); - m_model->setSelected(row, true); - m_anchor_row = m_pressed_row; - QWidget::mousePressEvent(e); - return; - } - - if (m_model->isSelected(row) && (e->modifiers() == Qt::NoModifier)) - { - m_select_on_release = true; - QWidget::mousePressEvent(e); - return; - } - - if ((Qt::ShiftModifier & e->modifiers())) - { - bool select = true; - if (m_pressed_row > m_anchor_row) - { - for (int j = m_anchor_row;j <= m_pressed_row;j++) - { - m_model->setSelected(j, select); - } - } - else - { - for (int j = m_anchor_row;j >= m_pressed_row;j--) - { - m_model->setSelected(j, select); - } - } - m_anchor_row = m_pressed_row; - } - else //ShiftModifier released - { - if ((Qt::ControlModifier & e->modifiers())) - { - m_model->setSelected(row, !m_model->isSelected(row)); - } - else //ControlModifier released - { - m_model->clearSelection(); - m_model->setSelected(row, true); - } - m_anchor_row = m_pressed_row; - } - update(); - } - QWidget::mousePressEvent(e); -} - -void ListWidget::resizeEvent(QResizeEvent *e) -{ - m_rows = e->size().height() / (m_metrics->lineSpacing() + 2); - m_scroll = true; - updateList(); - QWidget::resizeEvent(e); -} - -void ListWidget::wheelEvent (QWheelEvent *e) -{ - if (m_model->count() <= m_rows) - return; - if ((m_first == 0 && e->delta() > 0) || - ((m_first == m_model->count() - m_rows) && e->delta() < 0)) - return; - m_first -= e->delta()/40; //40*3 TODO: add step to config - if (m_first < 0) - m_first = 0; - - if (m_first > m_model->count() - m_rows) - m_first = m_model->count() - m_rows; - - m_scroll = false; - updateList(); -} - -bool ListWidget::event (QEvent *e) -{ - if(m_popupWidget) - { - if(e->type() == QEvent::ToolTip) - { - QHelpEvent *helpEvent = (QHelpEvent *) e; - int row = rowAt(helpEvent->y()); - if(row < 0) - { - m_popupWidget->deactivate(); - return QWidget::event(e); - } - e->accept(); - m_popupWidget->prepare(m_model->item(row), helpEvent->globalPos()); - return true; - } - else if(e->type() == QEvent::Leave) - m_popupWidget->deactivate(); - } - return QWidget::event(e); -} - -void ListWidget::updateList() -{ - if (m_model->count() < (m_rows+m_first+1) && m_rows< m_model->count()) - { - m_first = m_model->count() - m_rows; - } - if (m_model->count() < m_rows + 1) - { - m_first = 0; - emit positionChanged(0,0); - } - else - emit positionChanged(m_first, m_model->count() - m_rows); - if (m_model->count() <= m_first) - { - m_first = 0; - emit positionChanged(0, qMax(0, m_model->count() - m_rows)); - } - - m_titles = m_model->getTitles(m_first, m_rows); - m_times = m_model->getTimes(m_first, m_rows); - m_scroll = false; - //add numbers - for (int i = 0; i < m_titles.size() && m_show_number && !m_align_numbres; ++i) - { - QString title = m_titles.at(i); - m_titles.replace(i, title.prepend(QString("%1").arg(m_first+i+1)+". ")); - - } - //song numbers width - if(m_show_number && m_align_numbres && m_model->count()) - { - m_number_width = m_metrics->width("9") * QString::number(m_model->count()).size(); - } - else - m_number_width = 0; - - //elide title - QString extra_string; - for (int i=0; iwidth(extra_string); - if(m_number_width) - extra_string_space += m_number_width + m_metrics->width("9"); - m_titles.replace(i, m_metrics->elidedText (m_titles.at(i), Qt::ElideRight, - width() - m_metrics->width(m_times.at(i)) - 22 - extra_string_space)); - } - - update(); -} - -void ListWidget::autoscroll() -{ - SimpleSelection sel = m_model->getSelection(m_pressed_row); - if ((sel.m_top == 0 && m_scroll_direction == TOP && sel.count() > 1) || - (sel.m_bottom == m_model->count() - 1 && m_scroll_direction == DOWN && sel.count() > 1)) - return; - - if(m_scroll_direction == DOWN) - { - int row = m_first + m_rows; - (m_first + m_rows < m_model->count()) ? m_first ++ : m_first; - m_model->moveItems(m_pressed_row,row); - m_pressed_row = row; - } - else if(m_scroll_direction == TOP && m_first > 0) - { - m_first --; - m_model->moveItems(m_pressed_row, m_first); - m_pressed_row = m_first; - } -} - -void ListWidget::setModel(PlayListModel *selected, PlayListModel *previous) -{ - if(previous) - disconnect(previous, 0, this, 0); //disconnect previous model - qApp->processEvents(); - m_model = selected; - m_first = 0; - m_scroll = false; - recenterCurrent(); - updateList(); - connect (m_model, SIGNAL(currentChanged()), SLOT(recenterCurrent())); - connect (m_model, SIGNAL(listChanged()), SLOT(updateList())); -} - -void ListWidget::scroll(int sc) -{ - if (m_model->count() <= m_rows) - return; - m_first = sc; //*(m_model->count() - m_rows)/99; - m_scroll = true; - updateList(); -} - -void ListWidget::updateSkin() -{ - loadColors(); - update(); -} - -void ListWidget::dragEnterEvent(QDragEnterEvent *event) -{ - if (event->mimeData()->hasFormat("text/uri-list")) - event->acceptProposedAction(); -} - - -void ListWidget::dropEvent(QDropEvent *event) -{ - if (event->mimeData()->hasUrls()) - { - QList list_urls = event->mimeData()->urls(); - event->acceptProposedAction(); - QApplication::restoreOverrideCursor(); - - foreach(QUrl u,list_urls) - { - QString add_string = u.toString(QUrl::RemoveScheme); - if (!add_string.isEmpty()) - processFileInfo(QFileInfo(add_string)); - } - } -} - -void ListWidget::processFileInfo(const QFileInfo& info) -{ - m_model->add(info.absoluteFilePath()); -} - -const QString ListWidget::getExtraString(int i) -{ - QString extra_string; - - if (m_show_protocol && m_model->item(i)->url().contains("://")) - extra_string = "[" + m_model->item(i)->url().split("://").at(0) + "]"; - - if (m_model->isQueued(m_model->item(i))) - { - int index = m_model->queuedIndex(m_model->item(i)); - extra_string += "|"+QString::number(index + 1)+"|"; - } - - if(m_model->currentRow() == i && m_player->isRepeatable()) - extra_string += "|R|"; - else if(m_model->isStopAfter(m_model->item(i))) - extra_string += "|S|"; - - extra_string = extra_string.trimmed(); //remove white space - if(!extra_string.isEmpty()) - extra_string.prepend(" "); - return extra_string; -} - -void ListWidget::mouseMoveEvent(QMouseEvent *e) -{ - if(e->buttons() == Qt::LeftButton) - { - m_scroll = true; - if (m_prev_y > e->y()) - m_scroll_direction = TOP; - else if (m_prev_y < e->y()) - m_scroll_direction = DOWN; - else - m_scroll_direction = NONE; - - if(e->y() < 0 || e->y() > height()) - { - if(!m_timer->isActive()) - m_timer->start(); - return; - } - m_timer->stop(); - - int row = rowAt(e->y()); - - if (INVALID_ROW != row) - { - SimpleSelection sel = m_model->getSelection(m_pressed_row); - if(sel.count() > 1 && m_scroll_direction == TOP) - { - if(sel.m_top == 0 || sel.m_top == m_first) - return; - } - else if(sel.count() > 1 && m_scroll_direction == DOWN) - { - if(sel.m_bottom == m_model->count() - 1 || sel.m_bottom == m_first + m_rows) - return; - } - m_model->moveItems(m_pressed_row,row); - - m_prev_y = e->y(); - m_scroll = false; - m_pressed_row = row; - m_anchor_row = row; - } - } - else if(m_popupWidget) - { - int row = rowAt(e->y()); - if(row < 0 || m_popupWidget->item() != m_model->item(row)) - m_popupWidget->deactivate(); - } -} - -void ListWidget::mouseReleaseEvent(QMouseEvent *e) -{ - if (m_select_on_release) - { - m_model->clearSelection(); - m_model->setSelected(m_pressed_row,true); - m_anchor_row = m_pressed_row; - m_select_on_release = false; - } - m_pressed_row = INVALID_ROW; - m_scroll_direction = NONE; - m_timer->stop(); - m_scroll = false; - QWidget::mouseReleaseEvent(e); -} - -int ListWidget::rowAt(int y) const -{ - for (int i = 0; i < qMin(m_rows, m_model->count() - m_first); ++i) - { - if ((y >= i * (m_metrics->lineSpacing() + 2)) && (y <= (i+1) * (m_metrics->lineSpacing() + 2))) - return m_first + i; - } - return INVALID_ROW; -} - -void ListWidget::contextMenuEvent(QContextMenuEvent * event) -{ - if (menu()) - menu()->exec(event->globalPos()); -} - -void ListWidget::recenterCurrent() -{ - if (!m_scroll && m_rows) - { - if (m_first + m_rows < m_model->currentRow() + 1) - m_first = qMin(m_model->count() - m_rows, - m_model->currentRow() - m_rows/2); - else if (m_first > m_model->currentRow()) - m_first = qMax (m_model->currentRow() - m_rows/2, 0); - } -} diff --git a/src/ui/listwidget.h b/src/ui/listwidget.h deleted file mode 100644 index 7e901d34f..000000000 --- a/src/ui/listwidget.h +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef LISTWIDGET_H -#define LISTWIDGET_H - -#include -#include -#include -#include - -class QFont; -class QFontMetrics; -class QMenu; -class QAction; -class QTimer; -class PlayList; -class PlayListModel; -class Skin; -class PlayListItem; -class MediaPlayer; -namespace PlayListPopup{ -class PopupWidget; -} - -/** - @author Ilya Kotov -*/ -class ListWidget : public QWidget -{ - Q_OBJECT -public: - ListWidget(QWidget *parent = 0); - - ~ListWidget(); - - void readSettings(); - /*! - * Returns count of currently visible rows. - */ - int visibleRows()const - { - return m_rows; - } - - /*! - * Returns number of first visible row. - */ - int firstVisibleRow()const - { - return m_first; - } - - int getAnchorRow()const - { - return m_anchor_row; - } - - void setAnchorRow(int r) - { - m_anchor_row = r; - } - - QMenu *menu() - { - return m_menu; - } - - PlayListModel *model() - { - Q_ASSERT(!m_model); - return m_model; - } - - -public slots: - void updateList(); - void scroll(int); //0-99 - void recenterCurrent(); - void setModel(PlayListModel *selected, PlayListModel *previous = 0); - - -signals: - void selectionChanged(); - void positionChanged(int, int); //current position, maximum value - -protected: - void paintEvent(QPaintEvent *); - void mouseDoubleClickEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void resizeEvent(QResizeEvent *); - void wheelEvent(QWheelEvent *); - int rowAt(int)const; - void dragEnterEvent(QDragEnterEvent *event); - void dropEvent(QDropEvent *event); - void contextMenuEvent (QContextMenuEvent * event); - bool event (QEvent *e); - -private slots: - void updateSkin(); - void autoscroll(); - -private: - void loadColors(); - void processFileInfo(const QFileInfo&); - bool m_update; - bool m_scroll; - int m_pressed_row; - QMenu *m_menu; - PlayListModel *m_model; - /*! - * Returns string with queue number or(and) repeate flag for the item number \b i. - */ - const QString getExtraString(int i); - int m_rows, m_first; - QList m_titles; - QList m_times; - PlayList *m_pl; - QFont m_font, m_extra_font; - QFontMetrics *m_metrics; - QFontMetrics *m_extra_metrics; - Skin *m_skin; - QColor m_normal, m_current, m_normal_bg, m_selected_bg; - int m_anchor_row; - - enum ScrollDirection - { - NONE = 0,TOP,DOWN - }; - - /*! - * Scroll direction that is preforming in current moment. - */ - ScrollDirection m_scroll_direction; - int m_prev_y; - bool m_select_on_release; - bool m_show_protocol; - bool m_show_number; - bool m_show_anchor; - bool m_align_numbres; - int m_number_width; - MediaPlayer *m_player; - PlayListPopup::PopupWidget *m_popupWidget; - QTimer *m_timer; -}; - -#endif diff --git a/src/ui/main.cpp b/src/ui/main.cpp new file mode 100644 index 000000000..86df24ee8 --- /dev/null +++ b/src/ui/main.cpp @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "lxdesupport.h" +#include "qmmpstarter.h" + +int main(int argc, char *argv[]) +{ + QApplication a (argc, argv ); + a.setApplicationName("qmmp"); + + LXDESupport::load(); //load lxde icons + + QTranslator translator; + QString locale = Qmmp::systemLanguageID(); + translator.load(QString(":/qmmp_") + locale); + a.installTranslator(&translator); + + QTranslator qt_translator; + qt_translator.load(QLibraryInfo::location (QLibraryInfo::TranslationsPath) + "/qt_" + locale); + a.installTranslator(&qt_translator); + + QMMPStarter starter(argc,argv); + Q_UNUSED(starter) + + return a.exec(); +} diff --git a/src/ui/mainvisual.cpp b/src/ui/mainvisual.cpp deleted file mode 100644 index 222878e36..000000000 --- a/src/ui/mainvisual.cpp +++ /dev/null @@ -1,613 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "skin.h" -#include "fft.h" -#include "inlines.h" -#include "mainvisual.h" - -#define VISUAL_NODE_SIZE 512 //samples -#define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) - - -MainVisual *MainVisual::m_instance = 0; - -MainVisual *MainVisual::instance() -{ - if (!m_instance) - qFatal ("MainVisual: this object is not created!"); - return m_instance; -} - -MainVisual::MainVisual (QWidget *parent) - : Visual (parent), m_vis (0), m_playing (false) -{ - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSettings())); - m_timer = new QTimer (this); - connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); - createMenu(); - readSettings(); - m_left_buffer = new short[VISUAL_BUFFER_SIZE]; - m_buffer_at = 0; - m_instance = this; -} - -MainVisual::~MainVisual() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - if (m_vis) - { - settings.setValue("Visualization/type",m_vis->name()); - delete m_vis; - m_vis = 0; - } - else - settings.setValue("Visualization/type", "None"); - settings.setValue("Visualization/rate", 1000/m_timer->interval()); - delete [] m_left_buffer; - m_instance = 0; -} - -void MainVisual::setVisual (VisualBase *newvis) -{ - m_timer->stop(); - if (m_vis) - delete m_vis; - m_vis = newvis; - if (m_vis) - m_timer->start(); - else - { - m_pixmap.fill (Qt::transparent); - update(); - } -} - -void MainVisual::clear() -{ - m_buffer_at = 0; - if (m_vis) - m_vis->clear(); - m_pixmap = m_bg; - update(); -} - -void MainVisual::add (unsigned char *data, qint64 size, int chan) -{ - if (!m_timer->isActive () || !m_vis) - return; - - if(VISUAL_BUFFER_SIZE == m_buffer_at) - { - m_buffer_at -= VISUAL_NODE_SIZE; - memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - return; - } - - int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); - - if (chan >= 2) - { - mono16_from_multichannel(m_left_buffer + m_buffer_at, (short *) data, frames, chan); - } - else - { - memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); - } - - m_buffer_at += frames; -} - -void MainVisual::timeout() -{ - mutex()->lock (); - - if(m_buffer_at < VISUAL_NODE_SIZE) - { - mutex()->unlock (); - return; - } - - if (m_vis) - { - m_vis->process (m_left_buffer); - m_buffer_at -= VISUAL_NODE_SIZE; - memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - m_pixmap = m_bg; - QPainter p(&m_pixmap); - m_vis->draw (&p); - } - mutex()->unlock (); - update(); -} - -void MainVisual::paintEvent (QPaintEvent *) -{ - QPainter painter (this); - painter.drawPixmap (0,0, m_pixmap); -} - -void MainVisual::hideEvent (QHideEvent *) -{ - m_timer->stop(); -} - -void MainVisual::showEvent (QShowEvent *) -{ - if (m_vis) - m_timer->start(); -} - -void MainVisual::mousePressEvent (QMouseEvent *e) -{ - if (e->button() == Qt::RightButton) - m_menu->exec(e->globalPos()); - else - { - m_pixmap = m_bg; - if (!m_vis) - setVisual(new mainvisual::Analyzer); - else if (m_vis->name() == "Analyzer") - setVisual(new mainvisual::Scope); - else if (m_vis->name() == "Scope") - setVisual(0); - - QString str = "Off"; - if (m_vis) - str = m_vis->name(); - foreach(QAction *act, m_visModeGroup->actions ()) - if (str == act->data().toString()) - { - act->setChecked(true); - break; - } - } -} - -void MainVisual::drawBackGround() -{ - m_bg = QPixmap (76 * m_ratio, 16 * m_ratio); - if (m_transparentAction->isChecked()) - { - m_bg.fill (Qt::transparent); - return; - } - QPainter painter(&m_bg); - for (int x = 0; x < 76 * m_ratio; x += 2) - { - painter.setPen(m_skin->getVisColor(0)); - painter.drawLine(x + 1, 0, x + 1, 16 *m_ratio); - for (int y = 0; y < 16 *m_ratio; y += 2) - { - painter.setPen(m_skin->getVisColor(0)); - painter.drawPoint(x,y); - painter.setPen(m_skin->getVisColor(1)); - painter.drawPoint(x,y + 1); - } - } -} - -void MainVisual::updateSettings() -{ - m_ratio = m_skin->ratio(); - resize(76 * m_ratio, 16 * m_ratio); - m_pixmap = QPixmap (76 * m_ratio, 16 * m_ratio); - drawBackGround(); - m_pixmap = m_bg; - update(); - QAction *act = m_fpsGroup->checkedAction (); - if (act) - m_timer->setInterval (1000/act->data().toInt()); - else - m_timer->setInterval (40); - - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - act = m_peaksFalloffGroup->checkedAction (); - if (act) - settings.setValue("Visualization/peaks_falloff", act->data().toInt()); - else - settings.setValue("Visualization/peaks_falloff", 3); - - act = m_analyzerFalloffGroup->checkedAction (); - if (act) - settings.setValue("Visualization/analyzer_falloff", act->data().toInt()); - else - settings.setValue("Visualization/analyzer_falloff", 3); - - settings.setValue("Visualization/show_peaks", m_peaksAction->isChecked()); - - act = m_analyzerModeGroup->checkedAction(); - if (act) - settings.setValue("Visualization/analyzer_mode", act->data().toInt()); - else - settings.setValue("Visualization/analyzer_mode", 0); - - act = m_analyzerTypeGroup->checkedAction(); - if (act) - settings.setValue("Visualization/analyzer_type", act->data().toInt()); - else - settings.setValue("Visualization/analyzer_type", 1); - - settings.setValue("Visualization/transparent_bg", m_transparentAction->isChecked()); - - act = m_visModeGroup->checkedAction (); - QString visName; - if (act) - visName = act->data().toString(); - else - visName == "Off"; - - if (visName == "Analyzer") - setVisual(new mainvisual::Analyzer); - else if (visName == "Scope") - setVisual(new mainvisual::Scope); - else - setVisual(0); - -} - -void MainVisual::createMenu() -{ - m_menu = new QMenu (this); - connect(m_menu, SIGNAL(triggered (QAction *)),SLOT(updateSettings())); - QMenu *visMode = m_menu->addMenu(tr("Visualization Mode")); - m_visModeGroup = new QActionGroup(this); - m_visModeGroup->setExclusive(true); - m_visModeGroup->addAction(tr("Analyzer"))->setData("Analyzer"); - m_visModeGroup->addAction(tr("Scope"))->setData("Scope"); - m_visModeGroup->addAction(tr("Off"))->setData("None"); - foreach(QAction *act, m_visModeGroup->actions ()) - { - act->setCheckable(true); - visMode->addAction(act); - } - - QMenu *analyzerMode = m_menu->addMenu(tr("Analyzer Mode")); - m_analyzerModeGroup = new QActionGroup(this); - m_analyzerTypeGroup = new QActionGroup(this); - m_analyzerModeGroup->addAction(tr("Normal"))->setData(0); - m_analyzerModeGroup->addAction(tr("Fire"))->setData(1); - m_analyzerModeGroup->addAction(tr("Vertical Lines"))->setData(2); - m_analyzerTypeGroup->addAction(tr("Lines"))->setData(0); - m_analyzerTypeGroup->addAction(tr("Bars"))->setData(1); - foreach(QAction *act, m_analyzerModeGroup->actions ()) - { - act->setCheckable(true); - analyzerMode->addAction(act); - } - analyzerMode->addSeparator (); - foreach(QAction *act, m_analyzerTypeGroup->actions ()) - { - act->setCheckable(true); - analyzerMode->addAction(act); - } - analyzerMode->addSeparator (); - m_peaksAction = analyzerMode->addAction(tr("Peaks")); - m_peaksAction->setCheckable(true); - - - QMenu *refreshRate = m_menu->addMenu(tr("Refresh Rate")); - m_fpsGroup = new QActionGroup(this); - m_fpsGroup->setExclusive(true); - m_fpsGroup->addAction(tr("50 fps"))->setData(50); - m_fpsGroup->addAction(tr("25 fps"))->setData(25); - m_fpsGroup->addAction(tr("10 fps"))->setData(10); - m_fpsGroup->addAction(tr("5 fps"))->setData(5); - foreach(QAction *act, m_fpsGroup->actions ()) - { - act->setCheckable(true); - refreshRate->addAction(act); - } - - QMenu *analyzerFalloff = m_menu->addMenu(tr("Analyzer Falloff")); - m_analyzerFalloffGroup = new QActionGroup(this); - m_analyzerFalloffGroup->setExclusive(true); - m_analyzerFalloffGroup->addAction(tr("Slowest"))->setData(1); - m_analyzerFalloffGroup->addAction(tr("Slow"))->setData(2); - m_analyzerFalloffGroup->addAction(tr("Medium"))->setData(3); - m_analyzerFalloffGroup->addAction(tr("Fast"))->setData(4); - m_analyzerFalloffGroup->addAction(tr("Fastest"))->setData(5); - foreach(QAction *act, m_analyzerFalloffGroup->actions ()) - { - act->setCheckable(true); - analyzerFalloff->addAction(act); - } - - QMenu *peaksFalloff = m_menu->addMenu(tr("Peaks Falloff")); - m_peaksFalloffGroup = new QActionGroup(this); - m_peaksFalloffGroup->setExclusive(true); - m_peaksFalloffGroup->addAction(tr("Slowest"))->setData(1); - m_peaksFalloffGroup->addAction(tr("Slow"))->setData(2); - m_peaksFalloffGroup->addAction(tr("Medium"))->setData(3); - m_peaksFalloffGroup->addAction(tr("Fast"))->setData(4); - m_peaksFalloffGroup->addAction(tr("Fastest"))->setData(5); - foreach(QAction *act, m_peaksFalloffGroup->actions ()) - { - act->setCheckable(true); - peaksFalloff->addAction(act); - } - QMenu *background = m_menu->addMenu(tr("Background")); - m_transparentAction = background->addAction(tr("Transparent")); - m_transparentAction->setCheckable(true); - update(); -} - - -void MainVisual::readSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - - QString name = settings.value("Visualization/type","Analyzer").toString(); - m_visModeGroup->actions ()[0]->setChecked(true); - foreach(QAction *act, m_visModeGroup->actions ()) - if (name == act->data().toString()) - act->setChecked(true); - - m_peaksAction->setChecked( - settings.value("Visualization/show_peaks", true).toBool()); - - int fps = settings.value("Visualization/rate", 25).toInt(); - m_fpsGroup->actions ()[1]->setChecked(true); - foreach(QAction *act, m_fpsGroup->actions ()) - if (fps == act->data().toInt()) - act->setChecked(true); - - int mode = settings.value("Visualization/analyzer_mode", 0).toInt(); - m_analyzerModeGroup->actions ()[0]->setChecked(true); - foreach(QAction *act, m_analyzerModeGroup->actions ()) - if (mode == act->data().toInt()) - act->setChecked(true); - - int type = settings.value("Visualization/analyzer_type", 1).toInt(); - m_analyzerTypeGroup->actions ()[1]->setChecked(true); - foreach(QAction *act, m_analyzerTypeGroup->actions ()) - if (type == act->data().toInt()) - act->setChecked(true); - - int speed = settings.value("Visualization/peaks_falloff", 3).toInt(); - m_peaksFalloffGroup->actions ()[2]->setChecked(true); - foreach(QAction *act, m_peaksFalloffGroup->actions ()) - if (speed == act->data().toInt()) - act->setChecked(true); - - speed = settings.value("Visualization/analyzer_falloff", 3).toInt(); - m_analyzerFalloffGroup->actions ()[2]->setChecked(true); - foreach(QAction *act, m_analyzerFalloffGroup->actions ()) - if (speed == act->data().toInt()) - act->setChecked(true); - - m_transparentAction->setChecked( - settings.value("Visualization/transparent_bg", false).toBool()); - - updateSettings(); -} - -using namespace mainvisual; - -Analyzer::Analyzer() - : m_analyzerBarWidth (4), m_fps (20) -{ - clear(); - m_skin = Skin::instance(); - m_size = QSize(76*m_skin->ratio(), 16*m_skin->ratio()); - - double peaks_speed[] = { 0.05, 0.1, 0.2, 0.4, 0.8 }; - double analyzer_speed[] = { 1.2, 1.8, 2.2, 2.8, 2.4 }; - - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_peaks_falloff = - peaks_speed[settings.value("Visualization/peaks_falloff", 3).toInt()-1]; - m_analyzer_falloff = - analyzer_speed[settings.value("Visualization/analyzer_falloff", 3).toInt()-1]; - m_show_peaks = settings.value("Visualization/show_peaks", true).toBool(); - - m_lines = settings.value("Visualization/analyzer_type", 1).toInt() == 0; - m_mode = settings.value("Visualization/analyzer_mode", 0).toInt(); -} - -Analyzer::~Analyzer() -{} - -void Analyzer::clear() -{ - for (int i = 0; i< 75; ++i) - { - m_intern_vis_data[i] = 0; - m_peaks[i] = 0; - } -} - -bool Analyzer::process (short *l) -{ - static fft_state *state = 0; - if (!state) - state = fft_init(); - short dest[256]; - - static const int xscale_long[] = - { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 61, 66, 71, 76, 81, 87, 93, 100, 107, - 114, 122, 131, 140, 150, 161, 172, 184, 255 - }; - - static const int xscale_short[] = - { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 15, 20, 27, - 36, 47, 62, 82, 107, 141, 184, 255 - }; - - calc_freq (dest, l); - - const double y_scale = 3.60673760222; /* 20.0 / log(256) */ - int max = m_lines ? 75 : 19, y, j; - - for (int i = 0; i < max; i++) - { - if (m_lines) - for (j = xscale_long[i], y = 0; j < xscale_long[i + 1]; j++) - { - if (dest[j] > y) - y = dest[j]; - } - else - for (j = xscale_short[i], y = 0; j < xscale_short[i + 1]; j++) - { - if (dest[j] > y) - y = dest[j]; - } - y >>= 7; - int magnitude = 0; - if (y != 0) - { - magnitude = int(log (y) * y_scale); - if (magnitude > 15) - magnitude = 15; - if (magnitude < 0) - magnitude = 0; - } - - m_intern_vis_data[i] -= m_analyzer_falloff; - m_intern_vis_data[i] = magnitude > m_intern_vis_data[i] - ? magnitude : m_intern_vis_data[i]; - if (m_show_peaks) - { - m_peaks[i] -= m_peaks_falloff; - m_peaks[i] = magnitude > m_peaks[i] - ? magnitude : m_peaks[i]; - } - } - return true; -} - -void Analyzer::draw (QPainter *p) -{ - int r = m_skin->ratio(); - if (m_lines) - for (int j = 0; j < 75; ++j) - { - for (int i = 0; i <= m_intern_vis_data[j]; ++i) - { - if (m_mode == 0) - p->setPen (m_skin->getVisColor (18-i)); - else if (m_mode == 1) - p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); - else - p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); - p->drawPoint (j*r, m_size.height() - r*i); - if(r == 2) - p->drawPoint (j*r+1, m_size.height() - r*i); - } - p->setPen (m_skin->getVisColor (23)); - if (m_show_peaks) - { - p->drawPoint (j*r, m_size.height() - r*m_peaks[j]); - if(r == 2) - p->drawPoint (j*r+1, m_size.height() - r*m_peaks[j]); - } - } - else - for (int j = 0; j < 19; ++j) - { - for (int i = 0; i <= m_intern_vis_data[j]; ++i) - { - if (m_mode == 0) - p->setPen (m_skin->getVisColor (18-i)); - else if (m_mode == 1) - p->setPen (m_skin->getVisColor (3+(int(m_intern_vis_data[j])-i))); - else - p->setPen (m_skin->getVisColor (18-int(m_intern_vis_data[j]))); - - p->drawLine (j*4*r,m_size.height()-r*i, (j*4+2)*r,m_size.height()-r*i); - if(r == 2) - p->drawLine (j*4*r, m_size.height()-r*i +1, (j*4+2)*r,m_size.height()-r*i+1); - } - p->setPen (m_skin->getVisColor (23)); - if (m_show_peaks) - { - p->drawLine (j*4*r,m_size.height()-r*m_peaks[j], - (j*4+2)*r,m_size.height()-r*m_peaks[j]); - if(r == 2) - p->drawLine (j*4*r,m_size.height()-r*m_peaks[j]+1, - (j*4+2)*r,m_size.height()-r*m_peaks[j]+1); - } - } -} - -Scope::Scope() -{ - clear(); - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); -} - -void Scope::clear() -{ - for (int i = 0; i< 76; ++i) - m_intern_vis_data[i] = 5; -} - -Scope::~Scope() -{} - -bool Scope::process(short *l) -{ - int step = (VISUAL_NODE_SIZE << 8)/76; - int pos = 0; - - for (int i = 0; i < 76; ++i) - { - pos += step; - m_intern_vis_data[i] = (l[pos >> 8] >> 12); - - if (m_intern_vis_data[i] > 4) - m_intern_vis_data[i] = 4; - else if (m_intern_vis_data[i] < -4) - m_intern_vis_data[i] = -4; - } - return true; -} - -void Scope::draw(QPainter *p) -{ - for (int i = 0; i<75; ++i) - { - int h1 = 8 - m_intern_vis_data[i]; - int h2 = 8 - m_intern_vis_data[i+1]; - if (h1 > h2) - qSwap(h1, h2); - p->setPen (m_skin->getVisColor(18 + qAbs(8 - h2))); - p->drawLine(i*m_ratio, h1*m_ratio, (i+1)*m_ratio, h2*m_ratio); - } - for (int i = 0; i< 76; ++i) - m_intern_vis_data[i] = 0; -} diff --git a/src/ui/mainvisual.h b/src/ui/mainvisual.h deleted file mode 100644 index 9807483d7..000000000 --- a/src/ui/mainvisual.h +++ /dev/null @@ -1,145 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef MAINVISUAL_H -#define MAINVISUAL_H - -#include -#include -#include - -class QTimer; -class QMenu; -class QActionGroup; - -class VisualBase -{ -public: - virtual ~VisualBase(){} - virtual void clear() = 0; - virtual bool process(short *l) = 0; - virtual void draw(QPainter *) = 0; - virtual const QString name() = 0; -}; - -class Skin; - -class MainVisual : public Visual -{ - Q_OBJECT - -public: - MainVisual( QWidget *parent = 0); - virtual ~MainVisual(); - - static MainVisual *instance(); - void setVisual(VisualBase *newvis); - void add(unsigned char *data, qint64 size, int chan); - void clear(); - void paintEvent(QPaintEvent *); - -protected: - virtual void hideEvent (QHideEvent *); - virtual void showEvent (QShowEvent *); - virtual void mousePressEvent (QMouseEvent *); - -public slots: - void timeout(); - -private slots: - void updateSettings(); - -private: - void drawBackGround(); - void createMenu(); - void readSettings(); - static MainVisual *m_instance; - VisualBase *m_vis; - QPixmap m_pixmap; - QPixmap m_bg; - QTimer *m_timer; - bool m_playing; - Skin *m_skin; - //menu and actions - QMenu *m_menu; - //action groups - QActionGroup *m_visModeGroup; - QActionGroup *m_fpsGroup; - QActionGroup *m_peaksFalloffGroup; - QActionGroup *m_analyzerFalloffGroup; - QActionGroup *m_analyzerModeGroup; - QActionGroup *m_analyzerTypeGroup; - QAction *m_peaksAction; - QAction *m_transparentAction; - int m_ratio; - short *m_left_buffer; - short *m_right_buffer; - int m_buffer_at; -}; - -namespace mainvisual -{ -class Analyzer : public VisualBase -{ -public: - Analyzer(); - virtual ~Analyzer(); - - void clear(); - bool process(short *l); - void draw(QPainter *p); - const QString name() - { - return "Analyzer"; - } - -private: - QSize m_size; - int m_analyzerBarWidth, m_fps; - double m_intern_vis_data[75]; - double m_peaks[75]; - double m_peaks_falloff; - double m_analyzer_falloff; - bool m_show_peaks; - bool m_lines; - int m_mode; - Skin *m_skin; -}; - -class Scope : public VisualBase -{ -public: - Scope(); - virtual ~Scope(); - void clear(); - bool process(short *l); - void draw(QPainter *p); - const QString name() - { - return "Scope"; - } - -private: - int m_intern_vis_data[76]; - Skin *m_skin; - int m_ratio; -}; -} - -#endif diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp deleted file mode 100644 index 445133216..000000000 --- a/src/ui/mainwindow.cpp +++ /dev/null @@ -1,616 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mainwindow.h" -#include "skin.h" -#include "playlist.h" -#include "configdialog.h" -#include "dock.h" -#include "eqwidget.h" -#include "mainvisual.h" -#include "jumptotrackdialog.h" -#include "aboutdialog.h" -#include "addurldialog.h" -#include "listwidget.h" -#include "visualmenu.h" -#include "windowsystem.h" -#include "actionmanager.h" -#include "builtincommandlineoption.h" - -#define KEY_OFFSET 10000 - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) -{ -#ifdef Q_WS_X11 - qDebug("MainWindow: detected wm: %s", qPrintable(WindowSystem::netWindowManagerName())); -#endif - m_vis = 0; - m_update = false; - setWindowIcon(QIcon(":/32x32/qmmp.png")); - setWindowFlags(Qt::Window | Qt::FramelessWindowHint | - Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint); - setWindowTitle("Qmmp"); - - new ActionManager(); - - //prepare libqmmp and libqmmpui libraries for playing - m_player = new MediaPlayer(this); - m_core = SoundCore::instance(); - m_pl_manager = PlayListManager::instance(); - //additional featuries - new PlaylistParser(this); - m_generalHandler = new GeneralHandler(this); - - //user interface - m_skin = new Skin(this); - resize(275 * m_skin->ratio(),116 * m_skin->ratio()); - Dock *dock = new Dock(this); - dock->setMainWidget(this); - m_display = new MainDisplay(this); - setCentralWidget(m_display); - m_display->setFocus (); - - m_playlist = new PlayList(m_pl_manager, this); - dock->addWidget(m_playlist); - - m_equalizer = new EqWidget(this); - dock->addWidget(m_equalizer); - - m_jumpDialog = new JumpToTrackDialog(m_pl_manager, this); - m_jumpDialog->hide(); - - createActions(); - //prepare visualization - Visual::initialize(this, m_visMenu, SLOT(updateActions())); - m_vis = MainVisual::instance(); - Visual::add(m_vis); - //connections - connect (m_playlist,SIGNAL(next()),SLOT(next())); - connect (m_playlist,SIGNAL(prev()),SLOT(previous())); - connect (m_playlist,SIGNAL(play()),SLOT(play())); - connect (m_playlist,SIGNAL(pause()), m_core ,SLOT(pause())); - connect (m_playlist,SIGNAL(stop()),SLOT(stop())); - connect (m_playlist,SIGNAL(eject()),SLOT(addFile())); - connect (m_playlist,SIGNAL(loadPlaylist()),SLOT(loadPlaylist())); - connect (m_playlist,SIGNAL(savePlaylist()),SLOT(savePlaylist())); - - connect(m_display,SIGNAL(shuffleToggled(bool)),m_pl_manager,SLOT(setShuffle(bool))); - connect(m_display,SIGNAL(repeatableToggled(bool)),m_pl_manager,SLOT(setRepeatableList(bool))); - - connect(m_jumpDialog,SIGNAL(playRequest()), SLOT(replay())); - - connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(showState(Qmmp::State))); - connect(m_core, SIGNAL(elapsedChanged(qint64)),m_playlist, SLOT(setTime(qint64))); - connect(m_core, SIGNAL(metaDataChanged()),SLOT(showMetaData())); - connect(m_generalHandler, SIGNAL(toggleVisibilityCalled()), SLOT(toggleVisibility())); - connect(m_generalHandler, SIGNAL(exitCalled()), SLOT(close())); - - readSettings(); - m_display->setEQ(m_equalizer); - m_display->setPL(m_playlist); - dock->updateDock(); - m_pl_manager->currentPlayList()->doCurrentVisibleRequest(); - if (m_startHidden && m_generalHandler->visibilityControl()) - toggleVisibility(); -} - -MainWindow::~MainWindow() -{} - -void MainWindow::play() -{ - m_player->play(); -} - -void MainWindow::replay() -{ - stop(); - m_pl_manager->activatePlayList(m_pl_manager->selectedPlayList()); - play(); -} - -void MainWindow::forward() -{ - m_core->seek(m_core->elapsed() + KEY_OFFSET); -} - -void MainWindow::backward() -{ - m_core->seek(qMax(qint64(0), m_core->elapsed() - KEY_OFFSET)); -} - -void MainWindow::setVolume(int volume, int balance) -{ - m_core->setVolume(volume-qMax(balance,0)*volume/100, - volume+qMin(balance,0)*volume/100); -} - -void MainWindow::pause(void) -{ - m_core->pause(); -} - -void MainWindow::stop() -{ - m_player->stop(); -} - -void MainWindow::next() -{ - m_player->next(); -} - -void MainWindow::previous() -{ - m_player->previous(); -} - -void MainWindow::showState(Qmmp::State state) -{ - disconnectPl(); - switch ((int) state) - { - case Qmmp::Playing: - if (m_pl_manager->currentPlayList()->currentItem()) - m_equalizer->loadPreset(m_pl_manager->currentPlayList()->currentItem()->url().section("/",-1)); - break; - case Qmmp::Paused: - break; - case Qmmp::Stopped: - m_playlist->setTime(-1); - if (m_playlist->currentItem()) - setWindowTitle(m_playlist->currentItem()->text()); - else - setWindowTitle("Qmmp"); - break; - } -} - -void MainWindow::showMetaData() -{ - if (m_playlist->currentItem() && - m_playlist->currentItem()->url() == m_core->metaData().value(Qmmp::URL)) - { - setWindowTitle(m_playlist->currentItem()->text()); - } -} - -void MainWindow::closeEvent (QCloseEvent *) -{ - writeSettings(); - m_playlist->close(); - m_equalizer->close(); - QApplication::quit (); -} - -void MainWindow::addDir() -{ - FileDialog::popup(this, FileDialog::AddDirs, &m_lastDir, - m_pl_manager->selectedPlayList(), SLOT(add(const QStringList&)), - tr("Choose a directory")); -} - -void MainWindow::addFile() -{ - QStringList filters; - filters << tr("All Supported Bitstreams")+" (" + - MetaDataManager::instance()->nameFilters().join (" ") +")"; - filters << MetaDataManager::instance()->filters(); - FileDialog::popup(this, FileDialog::AddDirsFiles, &m_lastDir, - m_pl_manager->selectedPlayList(), SLOT(add(const QStringList&)), - tr("Select one or more files to open"), filters.join(";;")); -} - -void MainWindow::changeEvent (QEvent * event) -{ - if (event->type() == QEvent::ActivationChange) - { - m_display->setActive(isActiveWindow()); - } -} - -void MainWindow::readSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - if (!m_update) - { - settings.beginGroup("MainWindow"); - - move(settings.value("pos", QPoint(100, 100)).toPoint()); //geometry - - m_lastDir = settings.value("last_dir","/").toString(); //last directory - m_startHidden = settings.value("start_hidden", false).toBool(); - settings.endGroup(); - - if(settings.value("General/always_on_top", false).toBool()) - { - ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->setChecked(true); - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - } - ACTION(ActionManager::WM_STICKY)->setChecked(settings.value("General/show_on_all_desktops", - false).toBool()); - show(); - qApp->processEvents(); - //visibility - m_playlist->setVisible(settings.value("Playlist/visible",true).toBool()); - qApp->processEvents(); - m_equalizer->setVisible(settings.value("Equalizer/visible",true).toBool()); - qApp->processEvents(); - bool val = settings.value("Playlist/repeatable",false).toBool(); - - // Repeat/Shuffle - m_pl_manager->setRepeatableList(val); - m_display->setIsRepeatable(val); - val = settings.value("Playlist/shuffle",false).toBool(); - m_display->setIsShuffle(val); - m_pl_manager->setShuffle(val); - - m_update = true; - } - else - { - if(ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()) - { - setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); - m_playlist->setWindowFlags(m_playlist->windowFlags() | Qt::WindowStaysOnTopHint); - m_equalizer->setWindowFlags(m_equalizer->windowFlags() | Qt::WindowStaysOnTopHint); - } - else - { - setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); - m_playlist->setWindowFlags(m_playlist->windowFlags() & ~Qt::WindowStaysOnTopHint); - m_equalizer->setWindowFlags(m_equalizer->windowFlags() & ~Qt::WindowStaysOnTopHint); - } - show(); - qApp->processEvents(); - m_playlist->setVisible(m_display->isPlaylistVisible()); - m_equalizer->setVisible(m_display->isEqualizerVisible()); - } -#ifdef Q_WS_X11 - WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); - WindowSystem::setWinHint(winId(), "player", "Qmmp"); -#endif - //Call setWindowOpacity only if needed - double opacity = settings.value("MainWindow/opacity", 1.0).toDouble(); - if(opacity != windowOpacity ()) - setWindowOpacity(opacity); - - opacity = settings.value("Equalizer/opacity", 1.0).toDouble(); - if(opacity != m_equalizer->windowOpacity ()) - m_equalizer->setWindowOpacity(opacity); - - opacity = settings.value("PlayList/opacity", 1.0).toDouble(); - if(opacity != m_playlist->windowOpacity ()) - m_playlist->setWindowOpacity(opacity); - - m_hideOnClose = settings.value("MainWindow/hide_on_close", false).toBool(); -} - -void MainWindow::writeSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("MainWindow"); - //geometry - settings.setValue("pos", this->pos()); - //last directory - settings.setValue("last_dir",m_lastDir); - settings.endGroup(); - // Repeat/Shuffle - settings.beginGroup("Playlist"); - settings.setValue("repeatable",m_display->isRepeatable()); - settings.setValue("shuffle",m_display->isShuffle()); - settings.endGroup(); - // playback state - settings.beginGroup("General"); - settings.setValue("resume_playback", m_core->state() == Qmmp::Playing && - settings.value("resume_on_startup", false).toBool()); - settings.setValue("resume_playback_time", m_core->totalTime() > 0 ? m_core->elapsed() : 0); - settings.setValue("double_size", ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked()); - settings.setValue("always_on_top", ACTION(ActionManager::WM_ALLWAYS_ON_TOP)->isChecked()); - settings.setValue("show_on_all_desktops", ACTION(ActionManager::WM_STICKY)->isChecked()); - settings.endGroup(); -} - -void MainWindow::showSettings() -{ - ConfigDialog *confDialog = new ConfigDialog(this); - confDialog->exec(); - updateSettings(); - confDialog->deleteLater(); - ActionManager::instance()->saveActions(); -} - -void MainWindow::toggleVisibility() -{ - if (isHidden()) - { - show(); - raise(); - activateWindow(); - m_playlist->setVisible(m_display->isPlaylistVisible()); - m_equalizer->setVisible(m_display->isEqualizerVisible()); -#ifdef Q_WS_X11 - if(WindowSystem::netWindowManagerName() == "Metacity") - { - m_playlist->activateWindow(); - m_equalizer->activateWindow(); - } -#endif - qApp->processEvents(); - setFocus (); - if (isMinimized()) - { - if (isMaximized()) - showMaximized(); - else - showNormal(); - } -#ifdef Q_WS_X11 - WindowSystem::changeWinSticky(winId(), ACTION(ActionManager::WM_STICKY)->isChecked()); - WindowSystem::setWinHint(winId(), "player", "Qmmp"); - raise(); -#endif - } - else - { - if (m_playlist->isVisible()) - m_playlist->hide(); - if (m_equalizer->isVisible()) - m_equalizer->hide(); - hide(); - } - qApp->processEvents(); -} - -void MainWindow::createActions() -{ - m_mainMenu = new QMenu(this); - m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY, this, SLOT(play()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::PAUSE, this, SLOT(pause()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::STOP, this, SLOT(stop()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::PREVIOUS, this, SLOT(previous()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::NEXT, this, SLOT(next()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::PLAY_PAUSE, this, SLOT(playPause()))); - m_mainMenu->addSeparator(); - m_mainMenu->addAction(QIcon::fromTheme("go-up"), tr("&Jump To File"), - this, SLOT(jumpToFile()), tr("J")); - m_mainMenu->addSeparator(); - QMenu *viewMenu = m_mainMenu->addMenu(tr("View")); - viewMenu->addAction(ACTION(ActionManager::SHOW_PLAYLIST)); - viewMenu->addAction(ACTION(ActionManager::SHOW_EQUALIZER)); - viewMenu->addSeparator(); - viewMenu->addAction(SET_ACTION(ActionManager::WM_ALLWAYS_ON_TOP, this, SLOT(updateSettings()))); - viewMenu->addAction(SET_ACTION(ActionManager::WM_STICKY, this, SLOT(updateSettings()))); - viewMenu->addAction(SET_ACTION(ActionManager::WM_DOUBLE_SIZE, this, SLOT(updateSettings()))); - - QMenu *plMenu = m_mainMenu->addMenu(tr("Playlist")); - plMenu->addAction(SET_ACTION(ActionManager::REPEAT_ALL, m_pl_manager, SLOT(setRepeatableList(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::REPEAT_TRACK, m_player, SLOT(setRepeatable(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::SHUFFLE, m_pl_manager, SLOT(setShuffle(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::NO_PL_ADVANCE, m_player, - SLOT(setNoPlaylistAdvance(bool)))); - plMenu->addAction(SET_ACTION(ActionManager::STOP_AFTER_SELECTED, m_pl_manager, - SLOT(stopAfterSelected()))); - plMenu->addAction(SET_ACTION(ActionManager::CLEAR_QUEUE, m_pl_manager, SLOT(clearQueue()))); - connect(m_pl_manager, SIGNAL(repeatableListChanged(bool)), - ACTION(ActionManager::REPEAT_ALL), SLOT(setChecked(bool))); - connect(m_player, SIGNAL (repeatableChanged(bool)), - ACTION(ActionManager::REPEAT_TRACK), SLOT(setChecked(bool))); - connect(m_player, SIGNAL (noPlaylistAdvanceChanged(bool)), - ACTION(ActionManager::NO_PL_ADVANCE), SLOT(setChecked(bool))); - connect(m_pl_manager, SIGNAL(shuffleChanged(bool)), - ACTION(ActionManager::SHUFFLE), SLOT(setChecked(bool))); - - m_visMenu = new VisualMenu(this); - m_mainMenu->addMenu(m_visMenu); - m_mainMenu->addMenu(m_generalHandler->createMenu(GeneralHandler::TOOLS_MENU, tr("Tools"), this)); - m_mainMenu->addSeparator(); - m_mainMenu->addAction(SET_ACTION(ActionManager::SETTINGS, this, SLOT(showSettings()))); - m_mainMenu->addSeparator(); - m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT, this, SLOT(about()))); - m_mainMenu->addAction(SET_ACTION(ActionManager::ABOUT_QT, qApp, SLOT(aboutQt()))); - m_mainMenu->addSeparator(); - m_mainMenu->addAction(SET_ACTION(ActionManager::QUIT, this, SLOT(close()))); - - QAction* forward = new QAction(this); - forward->setShortcut(QKeySequence(Qt::Key_Right)); - connect(forward,SIGNAL(triggered(bool)),this,SLOT(forward())); - QAction* backward = new QAction(this); - backward->setShortcut(QKeySequence(Qt::Key_Left)); - connect(backward,SIGNAL(triggered(bool)),this,SLOT(backward())); - - Dock::instance()->addActions(QList() << forward << backward); - Dock::instance()->addActions(m_mainMenu->actions()); -} - - -void MainWindow::about() -{ - AboutDialog dlg(this); - dlg.exec(); -} - -void MainWindow::updateSettings() -{ - readSettings(); - m_playlist->readSettings(); - m_visMenu->updateActions(); - m_skin->reloadSkin(); - Dock::instance()->updateDock(); -} - -QMenu* MainWindow::menu() -{ - return m_mainMenu; -} - -void MainWindow::loadPlaylist() -{ - QStringList l; - QList p_list = PlaylistParser::instance()->formats(); - if (!p_list.isEmpty()) - { - foreach(PlaylistFormat* fmt,p_list) - l << fmt->getExtensions(); - - QString mask = tr("Playlist Files")+" (" + l.join(" *.").prepend("*.") + ")"; - //TODO use nonmodal dialog and multiplier playlists - QString f_name = FileDialog::getOpenFileName(this,tr("Open Playlist"),m_lastDir,mask); - if (!f_name.isEmpty()) - { - m_pl_manager->selectedPlayList()->clear(); - m_pl_manager->selectedPlayList()->loadPlaylist(f_name); - m_pl_manager->selectedPlayList()->setName(QFileInfo(f_name).baseName()); - m_lastDir = QFileInfo(f_name).absoluteDir().path(); - } - } - else - { - qWarning("Error: There is no registered playlist parsers"); - } -} - -void MainWindow::savePlaylist() -{ - QStringList l; - QList p_list = PlaylistParser::instance()->formats(); - if (!p_list.isEmpty()) - { - foreach(PlaylistFormat* fmt,p_list) - l << fmt->getExtensions(); - - QString mask = tr("Playlist Files")+" (" + l.join(" *.").prepend("*.") + ")"; - QString f_name = FileDialog::getSaveFileName(this, tr("Save Playlist"),m_lastDir + "/" + - m_pl_manager->selectedPlayList()->name() + "." + l[0],mask); - - if (!f_name.isEmpty()) - { - m_pl_manager->selectedPlayList()->savePlaylist(f_name); - m_lastDir = QFileInfo(f_name).absoluteDir().path(); - } - } - else - qWarning("Error: There is no registered playlist parsers"); -} - -void MainWindow::setFileList(const QStringList &l, bool clear) -{ - m_pl_manager->activatePlayList(m_pl_manager->selectedPlayList()); - if(!clear) - { - m_pl_manager->selectedPlayList()->add(l); - return; - } - if (m_core->state() != Qmmp::Stopped) - { - stop(); - qApp->processEvents(); //receive stop signal - } - m_model = m_pl_manager->selectedPlayList(); - m_model->clear(); - connect(m_model, SIGNAL(itemAdded(PlayListItem*)), SLOT(play())); - connect(m_model, SIGNAL(loaderFinished()), SLOT(disconnectPl())); - m_model->add(l); -} - -void MainWindow::playPause() -{ - if (m_core->state() == Qmmp::Playing) - m_core->pause(); - else - play(); -} - -void MainWindow::jumpToFile() -{ - if (m_jumpDialog->isHidden()) - { - m_jumpDialog->show(); - m_jumpDialog->refresh(); - } -} - -void MainWindow::handleCloseRequest() -{ - if (m_hideOnClose && m_generalHandler->visibilityControl()) - toggleVisibility(); - else - QApplication::closeAllWindows(); -} - -void MainWindow::disconnectPl() -{ - if(m_model) - { - disconnect(m_model, SIGNAL(itemAdded(PlayListItem*)), this, SLOT(play())); - disconnect(m_model, SIGNAL(loaderFinished()), this, SLOT(disconnectPl())); - m_model = 0; - } -} - -void MainWindow::addUrl() -{ - AddUrlDialog::popup(this, m_pl_manager->selectedPlayList()); -} - -SoundCore * MainWindow::soundCore() const -{ - return m_core; -} - -MainDisplay * MainWindow::mainDisplay() const -{ - return m_display; -} - -void MainWindow::keyPressEvent(QKeyEvent *ke) -{ - QKeyEvent event = QKeyEvent(ke->type(), ke->key(), - ke->modifiers(), ke->text(),ke->isAutoRepeat(), ke->count()); - QApplication::sendEvent(m_playlist,&event); -} - -void MainWindow::resume() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("General"); - if(settings.value("resume_playback", false).toBool()) - { - qint64 pos = settings.value("resume_playback_time").toLongLong(); - m_player->play(pos); - } -} diff --git a/src/ui/mainwindow.h b/src/ui/mainwindow.h deleted file mode 100644 index a3cfa8b99..000000000 --- a/src/ui/mainwindow.h +++ /dev/null @@ -1,123 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include "display.h" -#include "titlebar.h" - -class PlayList; -class PlayListManager; -class EqWidget; -class MainVisual; -class Skin; -class SoundCore; -class JumpToTrackDialog; -class VisualMenu; -class GeneralHandler; -class MediaPlayer; -class QMenu; -class QKeyEvent; - -/** - @author Ilya Kotov -*/ -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - MainWindow(QWidget *parent = 0); - - ~MainWindow(); - - PlayList *playlist(){return m_playlist;} - - QMenu* menu(); - void setVolume(int volume, int balance); - SoundCore* soundCore()const; - MainDisplay* mainDisplay()const; - void resume(); - -public slots: - void previous(); - void play(); - void pause(); - void playPause(); - void stop(); - void next(); - void replay(); - void jumpToFile(); - void toggleVisibility(); - - void addDir(); - void addFile(); - void addUrl(); - - void loadPlaylist(); - void savePlaylist(); - void setFileList(const QStringList&, bool clear = true); - void about(); - - void updateSettings(); - -protected: - virtual void closeEvent (QCloseEvent *); - virtual void changeEvent (QEvent *event); - virtual void keyPressEvent (QKeyEvent* ); - -private slots: - void showState(Qmmp::State state); - void showMetaData(); - void showSettings(); - void forward(); - void backward(); - void handleCloseRequest(); - void disconnectPl(); - -private: - void readSettings(); - void writeSettings(); - void createActions(); - SoundCore *m_core; - QMenu *m_mainMenu; - MainDisplay *m_display; - PlayList *m_playlist; - PlayListManager *m_pl_manager; - QPointer m_model; - int m_preamp; - EqWidget *m_equalizer; - MainVisual *m_vis; - QString m_lastDir; - bool m_update; - Skin *m_skin; - JumpToTrackDialog* m_jumpDialog; - bool m_hideOnClose, m_startHidden; - VisualMenu *m_visMenu; - GeneralHandler *m_generalHandler; - MediaPlayer *m_player; -}; - -#endif diff --git a/src/ui/monostereo.cpp b/src/ui/monostereo.cpp deleted file mode 100644 index 89f3621e5..000000000 --- a/src/ui/monostereo.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include - -#include "skin.h" -#include "monostereo.h" - -MonoStereo::MonoStereo (QWidget *parent) - : PixmapWidget (parent) -{ - m_skin = Skin::instance(); - m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); - setChannels (0); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); -} - - -MonoStereo::~MonoStereo() -{} - -void MonoStereo::setChannels (int c) -{ - m_channels = c; - QPainter paint (&m_pixmap); - switch ((int) c) - { - case 0: - { - paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); - paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); - break; - } - case 1: - { - paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_A)); - paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_I)); - break; - } - } - if (c > 1) - { - paint.drawPixmap (0,0,m_skin->getMSPart (Skin::MONO_I)); - paint.drawPixmap (27*m_skin->ratio(),0,m_skin->getMSPart (Skin::STEREO_A)); - } - setPixmap (m_pixmap); -} - -void MonoStereo::updateSkin() -{ - m_pixmap = QPixmap (54*m_skin->ratio(), 12*m_skin->ratio()); - setChannels (m_channels); -} diff --git a/src/ui/monostereo.h b/src/ui/monostereo.h deleted file mode 100644 index 547a545da..000000000 --- a/src/ui/monostereo.h +++ /dev/null @@ -1,51 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef MONOSTEREO_H -#define MONOSTEREO_H - -#include "pixmapwidget.h" - -class Skin; - -/** - @author Ilya Kotov -*/ -class MonoStereo : public PixmapWidget -{ -Q_OBJECT -public: - MonoStereo(QWidget *parent = 0); - - ~MonoStereo(); - -public slots: - void setChannels(int); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - QPixmap m_pixmap; - int m_channels; - -}; - -#endif diff --git a/src/ui/mp3player.cpp b/src/ui/mp3player.cpp deleted file mode 100644 index b42b52632..000000000 --- a/src/ui/mp3player.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include "lxdesupport.h" -#include "mainwindow.h" -#include "playlist.h" -#include "qmmpstarter.h" - -int main(int argc, char *argv[]) -{ - QApplication a (argc, argv ); - a.setApplicationName("qmmp"); - - LXDESupport::load(); //load lxde icons - - QTranslator translator; - QString locale = Qmmp::systemLanguageID(); - translator.load(QString(":/qmmp_") + locale); - a.installTranslator(&translator); - - QTranslator qt_translator; - qt_translator.load(QLibraryInfo::location (QLibraryInfo::TranslationsPath) + "/qt_" + locale); - a.installTranslator(&qt_translator); - - QMMPStarter starter(argc,argv); - Q_UNUSED(starter) - - return a.exec(); -} diff --git a/src/ui/number.cpp b/src/ui/number.cpp deleted file mode 100644 index d818da72f..000000000 --- a/src/ui/number.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "number.h" -#include "skin.h" - -Number::Number(QWidget *parent) - : PixmapWidget(parent) -{ - m_skin = Skin::instance(); - //TODO default value?? - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); -} - - -Number::~Number() -{ -} - -void Number::setValue(int n) -{ - setPixmap(m_skin->getNumber(n)); - m_value = n; -} - -void Number::updateSkin(void) -{ - setValue(m_value); -} diff --git a/src/ui/number.h b/src/ui/number.h deleted file mode 100644 index 1c89f71d4..000000000 --- a/src/ui/number.h +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef NUMBER_H -#define NUMBER_H - -#include "pixmapwidget.h" - -/** - @author Ilya Kotov -*/ -class Skin; - -class Number : public PixmapWidget -{ -Q_OBJECT -public: - Number(QWidget *parent = 0); - - ~Number(); - - void setValue(int); - -private slots: - void updateSkin(void); - -private: - Skin *m_skin; - int m_value; - -}; - -#endif diff --git a/src/ui/pixmapwidget.cpp b/src/ui/pixmapwidget.cpp deleted file mode 100644 index 081298df5..000000000 --- a/src/ui/pixmapwidget.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include "pixmapwidget.h" - -PixmapWidget::PixmapWidget(QWidget *parent) - : QWidget(parent) -{} - - -PixmapWidget::~PixmapWidget() -{} - -void PixmapWidget::setPixmap(const QPixmap pixmap) -{ - m_pixmap = pixmap; - resize(m_pixmap.size()); - update(); -} - -void PixmapWidget::paintEvent (QPaintEvent *e) -{ - Q_UNUSED(e); - QPainter paint(this); - style()->drawItemPixmap(&paint, rect(), Qt::AlignCenter, m_pixmap); -} - diff --git a/src/ui/pixmapwidget.h b/src/ui/pixmapwidget.h deleted file mode 100644 index 24d34260e..000000000 --- a/src/ui/pixmapwidget.h +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PIXMAPWIDGET_H -#define PIXMAPWIDGET_H - -#include - -/** - @author Ilya Kotov -*/ -class QPixmap; - -class PixmapWidget : public QWidget -{ -Q_OBJECT -public: - PixmapWidget(QWidget *parent = 0); - - ~PixmapWidget(); - - virtual void setPixmap(const QPixmap); - -protected: - void paintEvent ( QPaintEvent * event ); - -private: - QPixmap m_pixmap; - - - -}; - -#endif diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp deleted file mode 100644 index 75a6110ea..000000000 --- a/src/ui/playlist.cpp +++ /dev/null @@ -1,616 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "dock.h" -#include "skin.h" -#include "listwidget.h" -#include "button.h" -#include "playlisttitlebar.h" -#include "playlistslider.h" -#include "pixmapwidget.h" -#include "symboldisplay.h" -#include "playlistcontrol.h" -#include "keyboardmanager.h" -#include "playlistbrowser.h" -#include "playlistselector.h" -#include "windowsystem.h" -#include "actionmanager.h" -#include "playlist.h" - -PlayList::PlayList (PlayListManager *manager, QWidget *parent) - : QWidget (parent) -{ - setAttribute(Qt::WA_AlwaysShowToolTips,true); - setWindowTitle(tr("Playlist")); - m_pl_manager = manager; - m_update = false; - m_resize = false; - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - m_shaded = false; - m_pl_browser = 0; - m_pl_selector = 0; - - resize (275*m_ratio, 116*m_ratio); - setSizeIncrement (25*m_ratio, 29*m_ratio); - setMinimumSize(275*m_ratio, 116*m_ratio); - - m_listWidget = new ListWidget (this); - m_plslider = new PlayListSlider (this); - m_buttonAdd = new Button (this,Skin::PL_BT_ADD,Skin::PL_BT_ADD, Skin::CUR_PNORMAL); - m_buttonSub = new Button (this,Skin::PL_BT_SUB,Skin::PL_BT_SUB, Skin::CUR_PNORMAL); - m_selectButton = new Button (this,Skin::PL_BT_SEL,Skin::PL_BT_SEL, Skin::CUR_PNORMAL); - m_sortButton= new Button (this,Skin::PL_BT_SORT,Skin::PL_BT_SORT, Skin::CUR_PNORMAL); - m_playlistButton = new Button (this,Skin::PL_BT_LST,Skin::PL_BT_LST, Skin::CUR_PNORMAL); - m_resizeWidget = new QWidget(this); - m_resizeWidget->resize(25,25); - m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); - m_pl_control = new PlaylistControl (this); - - m_length_totalLength = new SymbolDisplay (this,14); - m_length_totalLength->setAlignment (Qt::AlignLeft); - - m_current_time = new SymbolDisplay (this,6); - m_keyboardManager = new KeyboardManager (this); - - connect (m_listWidget, SIGNAL (selectionChanged()), parent, SLOT (replay())); - - connect (m_plslider, SIGNAL (sliderMoved (int)), m_listWidget, SLOT (scroll (int))); - connect (m_listWidget, SIGNAL (positionChanged (int, int)), m_plslider, - SLOT (setPos (int, int))); - connect (m_skin, SIGNAL (skinChanged()), this, SLOT (updateSkin())); - connect (m_buttonAdd, SIGNAL (clicked()), SLOT (showAddMenu())); - connect (m_buttonSub, SIGNAL (clicked()), SLOT (showSubMenu())); - connect (m_selectButton, SIGNAL (clicked()), SLOT (showSelectMenu())); - connect (m_sortButton, SIGNAL (clicked()), SLOT (showSortMenu())); - connect (m_playlistButton, SIGNAL (clicked()), SLOT (showPlaylistMenu())); - - connect (m_pl_control, SIGNAL (nextClicked()), SIGNAL (next())); - connect (m_pl_control, SIGNAL (previousClicked()), SIGNAL (prev())); - connect (m_pl_control, SIGNAL (playClicked()), SIGNAL (play())); - connect (m_pl_control, SIGNAL (pauseClicked()), SIGNAL (pause())); - connect (m_pl_control, SIGNAL (stopClicked()), SIGNAL (stop())); - connect (m_pl_control, SIGNAL (ejectClicked()), SIGNAL (eject())); - - connect (m_pl_manager, SIGNAL (selectedPlayListChanged(PlayListModel *, PlayListModel *)), - m_listWidget, SLOT(setModel(PlayListModel*))); - m_listWidget->setModel(m_pl_manager->selectedPlayList()); - - m_titleBar = new PlayListTitleBar (this); - m_titleBar->move (0,0); - connect (m_pl_manager, SIGNAL (currentPlayListChanged(PlayListModel *, PlayListModel *)), - m_titleBar, SLOT(setModel(PlayListModel*))); - m_titleBar->setModel(m_pl_manager->currentPlayList()); - - createMenus(); - createActions(); - - readSettings(); - setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); - updatePositions(); -#ifdef Q_WS_X11 - QString wm_name = WindowSystem::netWindowManagerName(); - if(wm_name.contains("metacity", Qt::CaseInsensitive) || - wm_name.contains("openbox", Qt::CaseInsensitive)) - setWindowFlags (Qt::Tool | Qt::FramelessWindowHint); - else -#endif - setWindowFlags (Qt::Dialog | Qt::FramelessWindowHint); -} - -PlayList::~PlayList() -{ - delete m_keyboardManager; -} - -void PlayList::updatePositions() -{ - int sx = (width()-275*m_ratio)/25; - int sy = (height()-116*m_ratio)/29; - if (sx < 0 || sy < 0 || m_shaded) //skip shaded mode - return; - - m_titleBar->resize (275*m_ratio+25*sx, 20*m_ratio); - m_plslider->resize (20*m_ratio, 58*m_ratio+sy*29); - - if(m_pl_selector) - { - m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy - m_pl_selector->height()); - m_pl_selector->resize(243*m_ratio+25*sx, m_pl_selector->height()); - m_pl_selector->move(12*m_ratio, 20*m_ratio + 58*m_ratio+29*sy - m_pl_selector->height()); - } - else - m_listWidget->resize (243*m_ratio+25*sx, 58*m_ratio+29*sy); - m_listWidget->move (12*m_ratio,20*m_ratio); - - m_buttonAdd->move (11*m_ratio, 86*m_ratio+29*sy); - m_buttonSub->move (40*m_ratio, 86*m_ratio+29*sy); - m_selectButton->move (70*m_ratio, 86*m_ratio+29*sy); - m_sortButton->move (99*m_ratio, 86*m_ratio+29*sy); - - m_pl_control->move (128*m_ratio+sx*25, 100*m_ratio+29*sy); - m_playlistButton->move (228*m_ratio+sx*25,86*m_ratio+29*sy); - - m_length_totalLength -> move (131*m_ratio+sx*25,88*m_ratio+29*sy); - m_current_time->move (190*m_ratio+sx*25,101*m_ratio+29*sy); - - m_plslider->move (255*m_ratio+sx*25,20*m_ratio); - m_resizeWidget->move(width() - 25, height() - 29); -} - -void PlayList::createMenus() -{ - m_addMenu = new QMenu (this); - m_subMenu = new QMenu (this); - m_selectMenu = new QMenu (this); - m_sortMenu = new QMenu (this); - m_playlistMenu = new QMenu (this); - m_copySelectedMenu = new QMenu (tr("&Copy Selection To"), m_listWidget->menu()); - m_copySelectedMenu->setIcon(QIcon::fromTheme("edit-copy")); - connect (m_copySelectedMenu, SIGNAL (aboutToShow () ), this, SLOT (generateCopySelectedMenu ())); - connect (m_copySelectedMenu, SIGNAL (triggered ( QAction *) ), this, SLOT (copySelectedMenuActionTriggered( QAction *))); -} - -void PlayList::createActions() -{ - //add menu - m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_FILE, parent(), SLOT(addFile()))); - m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_DIRECTORY, parent(), SLOT(addDir()))); - m_addMenu->addAction(SET_ACTION(ActionManager::PL_ADD_URL, parent(), SLOT(addUrl()))); - //sub menu - m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_SELECTED, m_pl_manager, SLOT(removeSelected()))); - m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_ALL, m_pl_manager, SLOT(clear()))); - m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_UNSELECTED, m_pl_manager, - SLOT(removeUnselected()))); - m_subMenu->addSeparator(); - m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_INVALID, m_pl_manager, - SLOT(removeInvalidItems()))); - m_subMenu->addAction(SET_ACTION(ActionManager::PL_REMOVE_DUPLICATES, m_pl_manager, - SLOT(removeDuplicates()))); - //sort menu - m_sortMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_INFO, m_pl_manager, SLOT (showDetails ()))); - m_sortMenu->addAction (ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); - m_sortMenu->addSeparator(); - - QMenu* sort_mode_menu = new QMenu (tr("Sort List"), m_sortMenu); - sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); - QSignalMapper* signalMapper = new QSignalMapper (this); - QAction* titleAct = sort_mode_menu->addAction (tr ("By Title")); - connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (titleAct, PlayListModel::TITLE); - - QAction* albumAct = sort_mode_menu->addAction (tr ("By Album")); - connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (albumAct, PlayListModel::ALBUM); - - QAction* artistAct = sort_mode_menu->addAction (tr ("By Artist")); - connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (artistAct, PlayListModel::ARTIST); - - QAction* nameAct = sort_mode_menu->addAction (tr ("By Filename")); - connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (nameAct, PlayListModel::FILENAME); - - QAction* pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); - connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); - - QAction* dateAct = sort_mode_menu->addAction (tr ("By Date")); - connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (dateAct, PlayListModel::DATE); - - QAction* trackAct = sort_mode_menu->addAction (tr("By Track Number")); - connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (trackAct, PlayListModel::TRACK); - - connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sort (int))); - - m_sortMenu->addMenu (sort_mode_menu); - - sort_mode_menu = new QMenu (tr("Sort Selection"), m_sortMenu); - sort_mode_menu->setIcon(QIcon::fromTheme("view-sort-ascending")); - signalMapper = new QSignalMapper (this); - titleAct = sort_mode_menu->addAction (tr ("By Title")); - connect (titleAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (titleAct, PlayListModel::TITLE); - - albumAct = sort_mode_menu->addAction (tr ("By Album")); - connect (albumAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (albumAct, PlayListModel::ALBUM); - - artistAct = sort_mode_menu->addAction (tr ("By Artist")); - connect (artistAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (artistAct, PlayListModel::ARTIST); - - nameAct = sort_mode_menu->addAction (tr ("By Filename")); - connect (nameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (nameAct, PlayListModel::FILENAME); - - pathnameAct = sort_mode_menu->addAction (tr ("By Path + Filename")); - connect (pathnameAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (pathnameAct, PlayListModel::PATH_AND_FILENAME); - - dateAct = sort_mode_menu->addAction (tr ("By Date")); - connect (dateAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (dateAct, PlayListModel::DATE); - - trackAct = sort_mode_menu->addAction (tr ("By Track Number")); - connect (trackAct, SIGNAL (triggered (bool)), signalMapper, SLOT (map())); - signalMapper->setMapping (trackAct, PlayListModel::TRACK); - - connect (signalMapper, SIGNAL (mapped (int)), m_pl_manager, SLOT (sortSelection (int))); - - m_sortMenu->addMenu (sort_mode_menu); - m_sortMenu->addSeparator(); - m_sortMenu->addAction (QIcon::fromTheme("media-playlist-shuffle"), tr("Randomize List"), - m_pl_manager, SLOT(randomizeList())); - m_sortMenu->addAction (QIcon::fromTheme("view-sort-descending"), tr("Reverse List"), - m_pl_manager, SLOT(reverseList())); - //playlist context menu - m_listWidget->menu()->addAction(ActionManager::instance()->action(ActionManager::PL_SHOW_INFO)); - m_listWidget->menu()->addSeparator(); - m_listWidget->menu()->addActions (m_subMenu->actions().mid(0,3)); //use 3 first actions - m_listWidget->menu()->addMenu(GeneralHandler::instance()->createMenu(GeneralHandler::PLAYLIST_MENU, - tr("Actions"), this)); - m_listWidget->menu()->addSeparator(); - m_listWidget->menu()->addAction(SET_ACTION(ActionManager::PL_ENQUEUE, m_pl_manager, SLOT(addToQueue()))); - //select menu - m_selectMenu->addAction(SET_ACTION(ActionManager::PL_INVERT_SELECTION, m_pl_manager, - SLOT(invertSelection ()))); - m_selectMenu->addSeparator(); - m_selectMenu->addAction(SET_ACTION(ActionManager::PL_CLEAR_SELECTION, m_pl_manager, - SLOT(clearSelection ()))); - m_selectMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_ALL, m_pl_manager, SLOT(selectAll()))); - //Playlist Menu - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_NEW, m_pl_manager, SLOT(createPlayList()))); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_CLOSE, this, SLOT(deletePlaylist()))); - m_playlistMenu->addSeparator(); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_LOAD, this, SIGNAL(loadPlaylist()))); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SAVE, this, SIGNAL(savePlaylist()))); - m_playlistMenu->addSeparator(); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_NEXT, m_pl_manager, - SLOT(selectNextPlayList()))); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SELECT_PREVIOUS, m_pl_manager, - SLOT(selectPreviousPlayList()))); - m_playlistMenu->addAction(SET_ACTION(ActionManager::PL_SHOW_MANAGER, this, SLOT(showPlayLists()))); - Dock::instance()->addActions (m_addMenu->actions()); - Dock::instance()->addActions (m_subMenu->actions()); - Dock::instance()->addActions (m_sortMenu->actions()); - Dock::instance()->addActions (m_listWidget->menu()->actions()); - Dock::instance()->addActions (m_selectMenu->actions()); - Dock::instance()->addActions (m_playlistMenu->actions()); -} - -void PlayList::closeEvent (QCloseEvent *e) -{ - if (e->spontaneous ()) - emit closed(); - writeSettings(); -} - -void PlayList::paintEvent (QPaintEvent *) -{ - int sx = (width()-275*m_ratio) /25; - int sy = (height()-116*m_ratio) /29; - - QPainter paint(this); - drawPixmap (&paint, 0, 20*m_ratio, m_skin->getPlPart (Skin::PL_LFILL)); - for (int i = 1; igetPlPart (Skin::PL_LFILL)); - } - drawPixmap (&paint, 0, 78*m_ratio+29*sy, m_skin->getPlPart (Skin::PL_LSBAR)); - - for (int i = 0; igetPlPart (Skin::PL_SFILL1)); - } - drawPixmap (&paint,125*m_ratio+sx*25,78*m_ratio+sy*29,m_skin->getPlPart (Skin::PL_RSBAR)); - -} - -void PlayList::drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix) -{ - style()->drawItemPixmap(painter, QRect(x, y, pix.width(), pix.height()), Qt::AlignCenter, pix); -} - -void PlayList::resizeEvent (QResizeEvent *) -{ - updatePositions(); -} - -void PlayList::mousePressEvent (QMouseEvent *e) -{ - m_pos = e->pos (); - if (m_resizeWidget->underMouse()) - { - m_resize = true; - setCursor (m_skin->getCursor (Skin::CUR_PSIZE)); - } - else - m_resize = false; -} - -void PlayList::mouseMoveEvent (QMouseEvent *e) -{ - if (m_resize) - { -#ifdef Q_OS_WIN32 - int sx = (width()-275) /25; - int sy = (height()-116) /29; - if(width() < e->x() - 14) - sx++; - else if(width() > e->x() + 14) - sx--; - if(height() < e->y() - 14) - sy++; - else if(height() > e->y() + 14) - sy--; - resize (275+25*sx,116+29*sy); -#else - resize (e->x() +25, e->y() +25); -#endif - } -} - -void PlayList::mouseReleaseEvent (QMouseEvent *) -{ - setCursor (m_skin->getCursor (Skin::CUR_PNORMAL)); - /*if (m_resize) - m_listWidget->updateList();*/ - m_resize = false; - Dock::instance()->updateDock(); -} - -void PlayList::changeEvent (QEvent * event) -{ - if (event->type() == QEvent::ActivationChange) - { - m_titleBar->setActive (isActiveWindow()); - } -} - -void PlayList::readSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - if (settings.value("PlayList/show_plalists", false).toBool()) - { - if(!m_pl_selector) - m_pl_selector = new PlayListSelector(m_pl_manager, this); - m_pl_selector->show(); - m_listWidget->menu()->insertMenu(m_listWidget->menu()->actions().at(2),m_copySelectedMenu); - } - else - { - if(m_pl_selector) - { - m_pl_selector->deleteLater(); - m_listWidget->menu()->removeAction(m_copySelectedMenu->menuAction()); - } - m_pl_selector = 0; - } - if (m_update) - { - m_listWidget->readSettings(); - m_titleBar->readSettings(); - if(m_pl_selector) - m_pl_selector->readSettings(); - updatePositions(); - } - else - { - move (settings.value ("PlayList/pos", QPoint (100, 332)).toPoint()); //position - m_update = true; - } -} - -#ifdef Q_WS_X11 -bool PlayList::event (QEvent *event) -{ - if(event->type() == QEvent::WinIdChange || event->type() == QEvent::Show) - { - WindowSystem::ghostWindow(winId()); - WindowSystem::setWinHint(winId(), "playlist", "Qmmp"); - } - return QWidget::event(event); -} -#endif - -void PlayList::writeSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup ("PlayList"); - //position - settings.setValue ("pos", this->pos()); - settings.endGroup(); -} - -void PlayList::showAddMenu() -{ - m_addMenu->exec (m_buttonAdd->mapToGlobal (QPoint (0,0))); -} - -void PlayList::showSubMenu() -{ - m_subMenu->exec (m_buttonSub->mapToGlobal (QPoint (0,0))); -} - -void PlayList::showSelectMenu() -{ - m_selectMenu->exec (m_selectButton->mapToGlobal (QPoint (0,0))); -} - -void PlayList::showSortMenu() -{ - m_sortMenu->exec (m_sortButton->mapToGlobal (QPoint (0,0))); -} - -QString PlayList::formatTime (int sec) -{ - if(sec > 3600) - sec /= 60; - return QString("%1:%2").arg(sec/60, 2, 10, QChar('0')).arg(sec%60, 2, 10, QChar('0')); -} - -void PlayList::setTime(qint64 time) -{ - if (time < 0) - m_current_time->display ("--:--"); - else - m_current_time->display (formatTime (time/1000)); - m_current_time->update(); - - if (SoundCore::instance()) - { - QString str_length = formatTime (m_pl_manager->currentPlayList()->totalLength()) + - "/" + formatTime (SoundCore::instance()->totalTime()/1000); - m_length_totalLength->display (str_length); - m_length_totalLength->update(); - } -} - -void PlayList::updateList() -{ - m_listWidget->updateList(); - m_titleBar->showCurrent(); -} - -PlayListItem *PlayList::currentItem() -{ - return m_pl_manager->currentPlayList()->currentItem(); -} - -void PlayList::showPlaylistMenu() -{ - m_playlistMenu->exec (m_playlistButton->mapToGlobal (QPoint (0,0))); -} - -void PlayList::keyPressEvent (QKeyEvent *ke) -{ - if (m_keyboardManager->handleKeyPress (ke)) - update(); -} - -void PlayList::updateSkin() -{ - setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); // TODO shaded - m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE)); - m_ratio = m_skin->ratio(); - setMinimalMode(m_shaded); -} - -void PlayList::deletePlaylist() -{ - m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); -} - -void PlayList::showPlayLists() -{ - if(!m_pl_browser) - { - m_pl_browser = new PlayListBrowser(m_pl_manager, this); - m_pl_browser->show(); - } - else - m_pl_browser->show(); -} - -void PlayList::generateCopySelectedMenu() -{ - m_copySelectedMenu->clear(); - QAction* action = m_copySelectedMenu->addAction (tr ("&New PlayList")); - action->setIcon(QIcon::fromTheme("document-new")); - m_copySelectedMenu->addSeparator(); - - foreach(QString name, m_pl_manager->playListNames()) - { - action = m_copySelectedMenu->addAction("&"+name.replace("&", "&&")); - } -} - -void PlayList::copySelectedMenuActionTriggered( QAction * action) -{ - PlayListModel *targetPlayList = 0; - QString actionText=action->text(); - if(action == m_copySelectedMenu->actions().at(0))//actionText == tr ("&New PlayList")) - { - targetPlayList = m_pl_manager->createPlayList(m_pl_manager->selectedPlayList()->name()); - } - else - { - actionText.remove(0,1).replace("&&", "&"); - foreach(PlayListModel *model, m_pl_manager->playLists()) - { - //if("&" + model->name().replace("&", "&&") == actionText) - if(model->name() == actionText) - { - targetPlayList=model; - break; - } - } - } - if(!targetPlayList) - { - qWarning("Error: Cannot find target playlist '%s'",qPrintable(actionText)); - return; - } - QList theCopy; - foreach(PlayListItem *item, m_pl_manager->selectedPlayList()->getSelectedItems()) - { - PlayListItem *newItem = new PlayListItem(*item); - theCopy << newItem; - } - targetPlayList->add(theCopy); -} - -void PlayList::setMinimalMode(bool b) -{ - if(!m_shaded) - m_height = height(); - m_shaded = b; - if(m_shaded) - { - m_height = height(); - setSizeIncrement (25*m_ratio, 1); - setMinimumSize (275*m_ratio, 14*m_ratio); - resize(width(), 14*m_ratio); - } - else - { - setMinimumSize(275*m_ratio, 116*m_ratio); - resize (width(), m_height); - setSizeIncrement (25*m_ratio, 29*m_ratio); - - } - updatePositions(); - update(); -} diff --git a/src/ui/playlist.h b/src/ui/playlist.h deleted file mode 100644 index ae4d5cda8..000000000 --- a/src/ui/playlist.h +++ /dev/null @@ -1,140 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PLAYLIST_H -#define PLAYLIST_H - -#include -#include - -class QMenu;; -class Skin; -class ListWidget; -class PlayListItem; -class Button; -class PlayListModel; -class PlayListTitleBar; -class PlayListSlider; -class MainWindow; -class SymbolDisplay; -class OutputState; -class PixmapWidget; -class PlaylistControl; -class KeyboardManager; -class PlayListManager; -class PlayListBrowser; -class PlayListSelector; - -/** - @author Ilya Kotov -*/ -class PlayList : public QWidget -{ - Q_OBJECT - public: - PlayList (PlayListManager *manager, QWidget *parent = 0); - - ~PlayList(); - void load (PlayListItem *); - void readSettings(); - PlayListItem *currentItem(); - ListWidget* listWidget() const - { - return m_listWidget; - } - void setMinimalMode(bool b = true); - - signals: - void play(); - void next(); - void prev(); - void pause(); - void stop(); - void eject(); - void loadPlaylist(); - void savePlaylist(); - void closed(); - - public slots: - void setTime(qint64 time); - void updateList(); - - private slots: - void showAddMenu(); - void showSubMenu(); - void showSelectMenu(); - void showSortMenu(); - void showPlaylistMenu(); - void updateSkin(); - void deletePlaylist(); - void showPlayLists(); - void generateCopySelectedMenu(); - void copySelectedMenuActionTriggered( QAction * action); - - private: - void updatePositions(); - QString formatTime (int sec); - void drawPixmap (QPainter *painter, int x, int y, const QPixmap &pix); - void writeSettings(); - void createMenus(); - void createActions(); - //events - virtual void paintEvent (QPaintEvent *); - virtual void resizeEvent (QResizeEvent *); - virtual void mouseMoveEvent (QMouseEvent *); - virtual void mousePressEvent (QMouseEvent *); - virtual void mouseReleaseEvent (QMouseEvent *); - virtual void changeEvent (QEvent*); - virtual void closeEvent (QCloseEvent*); - virtual void keyPressEvent (QKeyEvent*); -#ifdef Q_WS_X11 - virtual bool event (QEvent *event); -#endif - QMenu *m_addMenu; - QMenu *m_subMenu; - QMenu *m_selectMenu; - QMenu *m_sortMenu; - QMenu *m_playlistMenu; - QMenu *m_copySelectedMenu; - QWidget *m_resizeWidget; - Button *m_buttonAdd; - Button *m_buttonSub; - Button *m_selectButton; - Button *m_sortButton; - Button* m_playlistButton; - PlaylistControl* m_pl_control; - SymbolDisplay* m_length_totalLength; - SymbolDisplay* m_current_time; - Skin *m_skin; - ListWidget *m_listWidget; - PlayListTitleBar *m_titleBar; - PlayListSlider *m_plslider; - QPoint m_pos; - bool m_resize; - bool m_update; - int m_ratio; - int m_height; - bool m_shaded; - PlayListManager *m_pl_manager; - KeyboardManager* m_keyboardManager; - QPointer m_pl_browser; - PlayListSelector *m_pl_selector; -}; - -#endif diff --git a/src/ui/playlistbrowser.cpp b/src/ui/playlistbrowser.cpp deleted file mode 100644 index d7e630c43..000000000 --- a/src/ui/playlistbrowser.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include "playlistbrowser.h" - -PlayListBrowser::PlayListBrowser(PlayListManager *manager, QWidget *parent) : QDialog(parent) -{ - setAttribute(Qt::WA_DeleteOnClose, true); - setAttribute(Qt::WA_QuitOnClose, false); - setWindowModality(Qt::NonModal); - ui.setupUi(this); - m_pl_manager = manager; - connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateList())); - connect(ui.newButton, SIGNAL(clicked()), m_pl_manager, SLOT(createPlayList())); - updateList(); - //actions - QAction *renameAct = new QAction(tr("Rename"), this); - QAction *removeAct = new QAction(tr("Delete"), this); - connect(renameAct,SIGNAL(triggered()), SLOT(rename())); - connect(removeAct,SIGNAL(triggered()), SLOT(on_deleteButton_clicked())); - ui.listWidget->setContextMenuPolicy(Qt::ActionsContextMenu); - ui.listWidget->addAction(renameAct); - ui.listWidget->addAction(removeAct); - ui.downButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowDown)); - ui.upButton->setIcon(QApplication::style()->standardIcon(QStyle::SP_ArrowUp)); - ui.newButton->setIcon(QIcon::fromTheme("document-new")); - ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); -} - -PlayListBrowser::~PlayListBrowser() -{} - -void PlayListBrowser::updateList() -{ - ui.listWidget->clear(); - foreach(PlayListModel *model, m_pl_manager->playLists()) - ui.listWidget->addItem(model->name()); - ui.listWidget->setCurrentRow (m_pl_manager->selectedPlayListIndex()); - //mark current playlist - int current = m_pl_manager->currentPlayListIndex(); - QListWidgetItem *item = ui.listWidget->item(current); - if(item) - { - QFont font = item->font(); - font.setBold(true); - item->setFont(font); - } -} - -void PlayListBrowser::on_listWidget_itemDoubleClicked(QListWidgetItem *item) -{ - m_pl_manager->activatePlayList(ui.listWidget->row(item)); -} - -void PlayListBrowser::on_listWidget_itemChanged(QListWidgetItem *item) -{ - m_pl_manager->playListAt(ui.listWidget->row(item))->setName(item->text()); -} - -void PlayListBrowser::on_listWidget_itemPressed (QListWidgetItem *item) -{ - m_pl_manager->selectPlayList(ui.listWidget->row(item)); -} - -void PlayListBrowser::rename() -{ - QListWidgetItem *item = ui.listWidget->currentItem(); - if(item) - { - item->setFlags(Qt::ItemIsEditable | item->flags()); - ui.listWidget->editItem(item); - } -} - -void PlayListBrowser::on_deleteButton_clicked() -{ - QList models; - foreach(QListWidgetItem *item, ui.listWidget->selectedItems()) - models.append(m_pl_manager->playListAt(ui.listWidget->row (item))); - foreach(PlayListModel *model, models) - m_pl_manager->removePlayList(model); -} - -void PlayListBrowser::on_downButton_clicked() -{ - int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); - if(pos < m_pl_manager->count() - 1) - m_pl_manager->move(pos, pos + 1); -} - -void PlayListBrowser::on_upButton_clicked() -{ - int pos = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); - if(pos > 0) - m_pl_manager->move(pos, pos - 1); -} diff --git a/src/ui/playlistbrowser.h b/src/ui/playlistbrowser.h deleted file mode 100644 index 563b527a5..000000000 --- a/src/ui/playlistbrowser.h +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef PLAYLISTBROWSER_H -#define PLAYLISTBROWSER_H - -#include -#include "ui_playlistbrowser.h" - -class PlayListManager; - -/** - @author Ilya Kotov -*/ -class PlayListBrowser : public QDialog -{ -Q_OBJECT -public: - PlayListBrowser(PlayListManager *manager, QWidget *parent = 0); - ~PlayListBrowser(); - -private slots: - void updateList(); - void on_listWidget_itemDoubleClicked(QListWidgetItem *item); - void on_listWidget_itemChanged(QListWidgetItem *item); - void on_listWidget_itemPressed (QListWidgetItem *item); - void rename(); - void on_deleteButton_clicked(); - void on_downButton_clicked(); - void on_upButton_clicked(); - -private: - Ui::PlayListBrowser ui; - PlayListManager *m_pl_manager; -}; - -#endif // PLAYLISTBROWSER_H diff --git a/src/ui/playlistcontrol.cpp b/src/ui/playlistcontrol.cpp deleted file mode 100644 index 9f6f1cb60..000000000 --- a/src/ui/playlistcontrol.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include - -#include "playlistcontrol.h" -#include "skin.h" - -PlaylistControl::PlaylistControl(QWidget* parent) : PixmapWidget(parent) -{ - m_skin = Skin::instance(); - setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); - m_ratio = m_skin->ratio(); - connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); -} - -void PlaylistControl::mouseReleaseEvent(QMouseEvent *me) -{ - QPoint pt = me->pos(); - if(QRect(4*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit previousClicked(); - else if(QRect(12*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit playClicked(); - else if(QRect(21*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit pauseClicked(); - else if(QRect(31*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit stopClicked(); - else if(QRect(40*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit nextClicked(); - else if(QRect(49*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) - emit ejectClicked(); -} - -void PlaylistControl::updateSkin() -{ - setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); - setPixmap(m_skin->getPlPart(Skin::PL_CONTROL)); - m_ratio = m_skin->ratio(); -} diff --git a/src/ui/playlistcontrol.h b/src/ui/playlistcontrol.h deleted file mode 100644 index 6c0ed0eaf..000000000 --- a/src/ui/playlistcontrol.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef _PALYLISTCONTROL_H -#define _PALYLISTCONTROL_H - -#include "pixmapwidget.h" - -class QMouseEvent; -class PaintEvent; -class Skin; - - /** - @author Vladimir Kuznetsov - */ -class PlaylistControl : public PixmapWidget -{ -Q_OBJECT -public: - PlaylistControl(QWidget* parent = 0); - - -signals: - void previousClicked(); - void nextClicked(); - void pauseClicked(); - void playClicked(); - void stopClicked(); - void ejectClicked(); - -private slots: - void updateSkin(); - -private: - void mouseReleaseEvent(QMouseEvent*); - int m_ratio; - Skin* m_skin; -}; - -#endif diff --git a/src/ui/playlistselector.cpp b/src/ui/playlistselector.cpp deleted file mode 100644 index 132c708ea..000000000 --- a/src/ui/playlistselector.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "skin.h" -#include "playlistselector.h" - -PlayListSelector::PlayListSelector(PlayListManager *manager, QWidget *parent) : QWidget(parent) -{ - m_update = false; - m_scrollable = false; - m_left_pressed = false; - m_right_pressed = false; - m_offset = 0; - m_offset_max = 0; - m_skin = Skin::instance(); - m_pl_manager = manager; - connect(m_pl_manager, SIGNAL(playListsChanged()), SLOT(updateTabs())); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - loadColors(); - readSettings(); - updateTabs(); - m_menu = new QMenu(this); - m_menu->addAction(tr("&Load"), parent, SIGNAL (loadPlaylist())); - m_menu->addAction(tr("&Save As..."), parent, SIGNAL (savePlaylist())); - m_menu->addSeparator(); - m_menu->addAction(tr("Rename"),this, SLOT (renamePlaylist())); - m_menu->addAction(tr("&Delete"),parent, SLOT (deletePlaylist())); -} - -PlayListSelector::~PlayListSelector() -{} - -void PlayListSelector::readSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); - if (m_update) - { - delete m_metrics; - m_metrics = new QFontMetrics(m_font); - updateTabs(); - } - else - { - m_update = true; - } - m_metrics = new QFontMetrics(m_font); - - resize(width(), m_metrics->height () +1); - drawButtons(); -} - -void PlayListSelector::updateTabs() -{ - m_rects.clear(); - QRect rect; - foreach(QString text, m_pl_manager->playListNames()) - { - if(m_rects.isEmpty()) - rect.setX(9); - else - rect.setX(m_rects.last().right() + m_metrics->width(" | ")); - rect.setY(0); - rect.setWidth(m_metrics->width(text)); - rect.setHeight(m_metrics->ascent ()); - m_rects.append(rect); - } - updateScrollers(); - update(); -} - -void PlayListSelector::updateSkin() -{ - loadColors(); - drawButtons(); - updateTabs(); -} - -void PlayListSelector::renamePlaylist() -{ - bool ok = false; - QString name = QInputDialog::getText (this, - tr("Rename Playlist"), tr("Playlist name:"), - QLineEdit::Normal, - m_pl_manager->selectedPlayList()->name(), &ok); - if(ok) - m_pl_manager->selectedPlayList()->setName(name); -} - -void PlayListSelector::paintEvent(QPaintEvent *) -{ - QPainter painter(this); - painter.setFont(m_font); - painter.setBrush(QBrush(m_normal_bg)); - painter.drawRect(-1,-1,width()+1,height()+1); - QStringList names = m_pl_manager->playListNames(); - int current = m_pl_manager->indexOf(m_pl_manager->currentPlayList()); - int selected = m_pl_manager->indexOf(m_pl_manager->selectedPlayList()); - painter.setBrush(QBrush(m_selected_bg)); - painter.setPen(m_selected_bg); - painter.drawRect(m_rects.at(selected).x()- 3 - m_offset, 0, - m_rects.at(selected).width()+4, height()-1); - - for (int i = 0; i < m_rects.size(); ++i) - { - if(i == current) - painter.setPen(m_current); - else - painter.setPen(m_normal); - painter.drawText(m_rects[i].x() - m_offset, m_metrics->ascent(), names.at(i)); - if(i < m_rects.size() - 1) - { - painter.setPen(m_normal); - painter.drawText(m_rects[i].x() + m_rects[i].width() - m_offset, m_metrics->ascent(), " | "); - } - } - if(m_scrollable) - { - painter.drawPixmap(width()-40, 0, m_pixmap); - painter.setBrush(QBrush(m_normal_bg)); - painter.setPen(m_normal_bg); - painter.drawRect(0,0,6,height()); - } -} - -void PlayListSelector::mousePressEvent (QMouseEvent *e) -{ - if(m_scrollable && e->x() > width() - 20) - { - m_offset += m_rects.at(lastVisible()).right() - m_offset - width() + 42; - m_offset = qMin(m_offset, m_offset_max); - m_right_pressed = true; - drawButtons(); - update(); - return; - } - if(m_scrollable && (width() - 40 < e->x()) && (e->x() <= width() - 20)) - { - m_offset -= 11 - m_rects.at(firstVisible()).x() + m_offset; - m_offset = qMax(0, m_offset); - m_left_pressed = true; - drawButtons(); - update(); - return; - } - - QPoint pp = e->pos(); - pp.rx() += m_offset; - bool selected = false; - for(int i = 0; i < m_rects.count(); ++i) - { - if(m_rects.at(i).contains(pp)) - { - selected = true; - m_pl_manager->selectPlayList(i); - break; - } - } - update(); - if(e->button() == Qt::RightButton) - m_menu->exec(e->globalPos()); - else if(e->button() == Qt::MidButton && selected) - m_pl_manager->removePlayList(m_pl_manager->selectedPlayList()); - else - QWidget::mousePressEvent(e); -} - -void PlayListSelector::mouseReleaseEvent (QMouseEvent *e) -{ - m_left_pressed = false; - m_right_pressed = false; - drawButtons(); - update(); - QWidget::mouseReleaseEvent(e); -} - -void PlayListSelector::mouseDoubleClickEvent (QMouseEvent *e) -{ - if(e->button() == Qt::LeftButton && !(m_scrollable && (e->x() > width() - 40))) - renamePlaylist(); - else - QWidget::mouseDoubleClickEvent(e); -} - -void PlayListSelector::mouseMoveEvent(QMouseEvent *e) -{ - QPoint mp = e->pos(); - mp.rx() += m_offset; - int dest = -1; - for(int i = 0; i < m_rects.count(); ++i) - { - if(mp.x() >= m_rects.at(i).x() && mp.x() <= m_rects.at(i).x() + m_rects.at(i).width()) - { - dest = i; - break; - } - } - if(dest == -1 || dest == m_pl_manager->selectedPlayListIndex()) - { - QWidget::mouseMoveEvent(e); - return; - } - m_pl_manager->move(m_pl_manager->selectedPlayListIndex(), dest); -} - -void PlayListSelector::resizeEvent (QResizeEvent *) -{ - updateScrollers(); -} - -void PlayListSelector::loadColors() -{ - m_normal.setNamedColor(m_skin->getPLValue("normal")); - m_current.setNamedColor(m_skin->getPLValue("current")); - m_normal_bg.setNamedColor(m_skin->getPLValue("normalbg")); - m_selected_bg.setNamedColor(m_skin->getPLValue("selectedbg")); -} - -void PlayListSelector::drawButtons() -{ - m_pixmap = QPixmap(40, height()); - m_pixmap.fill(m_normal_bg); - QPainter painter(&m_pixmap); - painter.setPen(m_left_pressed ? m_current : m_normal); - painter.setBrush(QBrush(m_left_pressed ? m_current : m_normal)); - QPoint points[3] = { - QPoint(m_pixmap.width() - 25, height()/2 - 5), - QPoint(m_pixmap.width() - 35, height()/2-1), - QPoint(m_pixmap.width() - 25, height()/2 + 3), - }; - painter.drawPolygon(points, 3); - painter.setPen(m_right_pressed ? m_current : m_normal); - painter.setBrush(QBrush(m_right_pressed ? m_current : m_normal)); - QPoint points2[3] = { - QPoint(m_pixmap.width() - 20, height()/2 - 5), - QPoint(m_pixmap.width() - 10, height()/2-1), - QPoint(m_pixmap.width() - 20, height()/2 + 3), - }; - painter.drawPolygon(points2, 3); -} - -void PlayListSelector::updateScrollers() -{ - m_scrollable = m_rects.last().right() > width(); - if(m_scrollable) - { - m_offset_max = m_rects.last().right() - width() + 42; - m_offset = qMin(m_offset, m_offset_max); - } - else - { - m_offset = 0; - m_offset_max = 0; - } -} - -int PlayListSelector::firstVisible() -{ - for(int i = 0; i < m_rects.size(); ++i) - { - if(m_rects.at(i).right() - m_offset + m_metrics->width(" - ") + 2 >= 9) - return i; - } - return 0; -} - -int PlayListSelector::lastVisible() -{ - for(int i = m_rects.size() - 1; i >= 0; --i) - { - if(m_rects.at(i).x() - m_offset - m_metrics->width(" - ") - 2 <= width() - 40) - return i; - } - return m_rects.count() - 1; -} diff --git a/src/ui/playlistselector.h b/src/ui/playlistselector.h deleted file mode 100644 index 67e281f75..000000000 --- a/src/ui/playlistselector.h +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef PLAYLISTSELECTOR_H -#define PLAYLISTSELECTOR_H - -#include -#include -#include - -class QFontMetrics; -class QFont; -class QMouseEvent; -class QMenu; -class PlayListManager; -class Skin; - -/** - @author Ilya Kotov -*/ -class PlayListSelector : public QWidget -{ -Q_OBJECT -public: - PlayListSelector(PlayListManager *manager, QWidget *parent = 0); - ~PlayListSelector(); - void readSettings(); - -private slots: - void updateTabs(); - void updateSkin(); - void renamePlaylist(); - -private: - void paintEvent(QPaintEvent *); - void mousePressEvent (QMouseEvent *e); - void mouseReleaseEvent (QMouseEvent *e); - void mouseDoubleClickEvent (QMouseEvent *e); - void mouseMoveEvent(QMouseEvent *e); - void resizeEvent (QResizeEvent *); - void updateOffsets(); - void loadColors(); - void drawButtons(); - void updateScrollers(); - int firstVisible(); - int lastVisible(); - PlayListManager *m_pl_manager; - QFontMetrics *m_metrics; - QFont m_font; - QMenu *m_menu; - bool m_update; - bool m_scrollable; - QList m_rects; - Skin *m_skin; - QColor m_normal, m_current, m_normal_bg, m_selected_bg; - QPixmap m_pixmap; - bool m_showButtons; - int m_offset, m_offset_max; - bool m_left_pressed, m_right_pressed; -}; - -#endif // PLAYLISTSELECTOR_H diff --git a/src/ui/playlistslider.cpp b/src/ui/playlistslider.cpp deleted file mode 100644 index df958fa6b..000000000 --- a/src/ui/playlistslider.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include - -#include "skin.h" -#include "playlistslider.h" -#include "pixmapwidget.h" - -PlayListSlider::PlayListSlider(QWidget *parent) - : QWidget(parent) -{ - m_skin = Skin::instance(); - m_moving = false; - m_pressed = false; - m_min = 0; - m_max = 0; - m_value = 0; - pos = 0; - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); -} - - -PlayListSlider::~PlayListSlider() -{} - -void PlayListSlider::paintEvent(QPaintEvent *) -{ - int sy = (height()-58)/29; - int p=int(ceil(double(m_value-m_min)*(height()-18)/(m_max-m_min))); - QPainter paint(this); - paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_RFILL)); - paint.drawPixmap(0,29,m_skin->getPlPart(Skin::PL_RFILL)); - - for (int i = 0; igetPlPart(Skin::PL_RFILL)); - } - if (m_pressed) - paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_P)); - else - paint.drawPixmap(5*m_skin->ratio(),p,m_skin->getButton(Skin::PL_BT_SCROLL_N)); - m_pos = p; -} - -void PlayListSlider::mousePressEvent(QMouseEvent *e) -{ - m_moving = true; - m_pressed = true; - press_pos = e->y(); - if (m_posy() && e->y()ratio()) - { - press_pos = e->y()-m_pos; - } - else - { - m_value = convert(qMax(qMin(height()-18*m_skin->ratio(),e->y()-9*m_skin->ratio()),0)); - press_pos = 9*m_skin->ratio(); - if (m_value!=m_old) - { - emit sliderMoved(m_value); - m_old = m_value; - //qDebug ("%d",m_value); - } - } - update(); -} - -void PlayListSlider::mouseReleaseEvent(QMouseEvent*) -{ - m_moving = false; - m_pressed = false; - update(); -} - -void PlayListSlider::mouseMoveEvent(QMouseEvent* e) -{ - if (m_moving) - { - int po = e->y(); - po = po - press_pos; - - if (0<=po && po<=height()-18*m_skin->ratio()) - { - m_value = convert(po); - update(); - if (m_value!=m_old) - { - - m_old = m_value; - emit sliderMoved(m_value); - } - } - } -} - -void PlayListSlider::setPos(int p, int max) -{ - m_max = max; - m_value = p; - if(m_moving) - return; - update(); -} - -void PlayListSlider::updateSkin() -{ - update(); - setCursor(m_skin->getCursor(Skin::CUR_PVSCROLL)); -} - -int PlayListSlider::convert(int p) -{ - return int(floor(double(m_max-m_min)*(p)/(height()-18*m_skin->ratio())+m_min)); -} - diff --git a/src/ui/playlistslider.h b/src/ui/playlistslider.h deleted file mode 100644 index cd42a6c3a..000000000 --- a/src/ui/playlistslider.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PLAYLISTSLIDER_H -#define PLAYLISTSLIDER_H - -#include - -class Skin; -class PixmapWidget; -/** - @author Ilya Kotov -*/ -class PlayListSlider : public QWidget -{ -Q_OBJECT -public: - PlayListSlider(QWidget *parent = 0); - - ~PlayListSlider(); - -public slots: - void setPos(int pos, int max); - -signals: - void sliderMoved (int); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - PixmapWidget *m_scroll; - int m_old; - bool m_moving, m_pressed; - int press_pos; - int m_min, m_max, m_value, pos, m_pos; - int convert(int); // value = convert(position); - -protected: - void paintEvent(QPaintEvent*); - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); -}; - -#endif diff --git a/src/ui/playlisttitlebar.cpp b/src/ui/playlisttitlebar.cpp deleted file mode 100644 index ddcc2b244..000000000 --- a/src/ui/playlisttitlebar.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include "dock.h" -#include "button.h" -#include "playlisttitlebar.h" -#include "skin.h" - -// TODO {shademode, updateskin} -> do we have the shaded cursor -PlayListTitleBar::PlayListTitleBar(QWidget *parent) - : PixmapWidget(parent) -{ - m_active = false; - m_resize = false; - m_shade2 = 0; - m_model = 0; - m_shaded = false; - m_align = false; - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - m_pl = qobject_cast(parent); - m_mw = qobject_cast(m_pl->parent()); - - m_close = new Button(this,Skin::PL_BT_CLOSE_N, Skin::PL_BT_CLOSE_P, Skin::CUR_PCLOSE); - connect (m_close, SIGNAL(clicked()), m_pl, SIGNAL(closed())); - - m_shade = new Button(this, Skin::PL_BT_SHADE1_N, Skin::PL_BT_SHADE1_P, Skin::CUR_PWINBUT); - connect(m_shade, SIGNAL(clicked()), SLOT(shade())); - - resize(275*m_ratio,20*m_ratio); - setMinimumWidth(275*m_ratio); - - readSettings(); - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - m_pl->resize (settings.value ("PlayList/size", QSize (m_ratio*275, m_ratio*116)).toSize()); - if (settings.value ("PlayList/shaded", false).toBool()) - shade(); - resize(m_pl->width(),height()); - m_align = true; - setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); - updatePositions(); -} - - -PlayListTitleBar::~PlayListTitleBar() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - settings.setValue ("PlayList/size", QSize (m_pl->width(), m_shaded ? m_height:m_pl->height())); - settings.setValue ("PlayList/shaded", m_shaded); -} - -void PlayListTitleBar::updatePositions() -{ - int sx = (width()-275*m_ratio)/25; - m_ratio = m_skin->ratio(); - m_close->move(m_ratio*264+sx*25,m_ratio*3); - m_shade->move(m_ratio*255+sx*25,m_ratio*3); - if (m_shade2) - m_shade2->move(m_ratio*255+sx*25,m_ratio*3); -} - -void PlayListTitleBar::updatePixmap() -{ - int sx = ((m_shaded ? m_pl->width() : width())-275*m_ratio)/25; - QPixmap pixmap(275*m_ratio+sx*25,20*m_ratio); - QPainter paint; - paint.begin(&pixmap); - if (m_shaded) - { - paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED2)); - for (int i = 1; igetPlPart(Skin::PL_TFILL_SHADED)); - } - } - - if (m_active) - { - if (m_shaded) - paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_A)); - else - { - paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_A)); - for (int i = 1; igetPlPart(Skin::PL_TFILL1_A)); - } - paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_A)); - paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_A)); - } - } - else - { - if (m_shaded) - paint.drawPixmap(225*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_TITLEBAR_SHADED1_I)); - else - { - paint.drawPixmap(0,0,m_skin->getPlPart(Skin::PL_CORNER_UL_I)); - for (int i = 1; igetPlPart(Skin::PL_TFILL1_I)); - } - paint.drawPixmap((100-12)*m_ratio+12*sx,0,m_skin->getPlPart(Skin::PL_TITLEBAR_I)); - paint.drawPixmap(250*m_ratio+sx*25,0,m_skin->getPlPart(Skin::PL_CORNER_UR_I)); - } - } - if (m_shaded) - { - QColor col; - col.setNamedColor(QString(m_skin->getPLValue("mbbg"))); - paint.setBrush(QBrush(col)); - paint.setPen(col); - paint.drawRect(8*m_ratio, m_ratio, 235*m_ratio + sx*25, 11*m_ratio); - //draw text - paint.setFont(m_font); - paint.setPen(QString(m_skin->getPLValue("mbfg"))); - paint.drawText(9*m_ratio, 11*m_ratio, m_truncatedText); - } - paint.end(); - setPixmap(pixmap); -} - -void PlayListTitleBar::resizeEvent(QResizeEvent *) -{ - QFontMetrics metrics(m_font); - m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); - updatePixmap(); - updatePositions(); -} - -void PlayListTitleBar::mousePressEvent(QMouseEvent* event) -{ - switch ((int) event->button ()) - { - case Qt::LeftButton: - pos = event->pos(); - if (m_shaded && (width() - 30*m_ratio) < pos.x() && pos.x() < (width() - 22*m_ratio)) - { - m_resize = true; - setCursor (Qt::SizeHorCursor); - } - break; - case Qt::RightButton: - m_mw->menu()->exec(event->globalPos()); - } -} - -void PlayListTitleBar::mouseReleaseEvent(QMouseEvent*) -{ - Dock::instance()->updateDock(); - m_resize = false; - setCursor (Qt::ArrowCursor); -} - -void PlayListTitleBar::mouseMoveEvent(QMouseEvent* event) -{ - QPoint npos = (event->globalPos()-pos); - QPoint oldpos = npos; - if (m_shaded && m_resize) - { - resize((event->x() + 25*m_ratio), height()); - m_pl->resize((event->x() + 25*m_ratio), m_pl->height()); - } - else if (pos.x() < width() - 30*m_ratio) - Dock::instance()->move(m_pl, npos); -} - -void PlayListTitleBar::setActive(bool a) -{ - m_active = a; - updatePixmap(); -} - - -void PlayListTitleBar::setModel(PlayListModel *selected, PlayListModel *previous) -{ - if(previous) - disconnect(previous, 0, this, 0); //disconnect previous model - m_model = selected; - connect (m_model, SIGNAL(listChanged()), SLOT(showCurrent())); - showCurrent(); -} - -void PlayListTitleBar::readSettings() -{ - QSettings settings (Qmmp::configFile(), QSettings::IniFormat); - m_font.fromString(settings.value("PlayList/Font", QApplication::font().toString()).toString()); - m_font.setPointSize(8); -} - -void PlayListTitleBar::updateSkin() -{ - setCursor(m_skin->getCursor(Skin::CUR_PTBAR)); - if(m_ratio != m_skin->ratio()) - { - m_ratio = m_skin->ratio(); - setMinimumWidth(275*m_ratio); - updatePositions(); - } - updatePixmap(); -} - -void PlayListTitleBar::shade() -{ - m_shaded = !m_shaded; - if (m_shaded) - { - m_height = m_pl->height(); - m_shade->hide(); - m_shade2 = new Button(this, Skin::PL_BT_SHADE2_N, Skin::PL_BT_SHADE2_P, Skin::CUR_PWSNORM); - m_shade2->move(254,3); - connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); - m_shade2->show(); - } - else - { - m_shade2->deleteLater(); - m_shade2 = 0; - m_shade->show(); - } - m_pl->setMinimalMode(m_shaded); - showCurrent(); - update(); - if (m_align) - Dock::instance()->align(m_pl, m_shaded? -m_height+14*m_ratio: m_height-14*m_ratio); - updatePositions(); -} - -void PlayListTitleBar::mouseDoubleClickEvent (QMouseEvent *) -{ - PlayListTitleBar::shade(); -} - -void PlayListTitleBar::showCurrent() -{ - if (m_model) - { - PlayListItem* info = m_model->currentItem(); - if (info) - { - m_text = QString("%1. ").arg(m_model->currentRow()+1); - m_text.append(info->text()); - m_text.append(QString(" (%1:%2)").arg(info->length()/60) - .arg(info->length()%60, 2, 10, QChar('0'))); - } - else - m_text.clear(); - } - QFontMetrics metrics(m_font); - m_truncatedText = metrics.elidedText (m_text, Qt::ElideRight, width() - 35*m_ratio); - updatePixmap(); -} diff --git a/src/ui/playlisttitlebar.h b/src/ui/playlisttitlebar.h deleted file mode 100644 index 01163f987..000000000 --- a/src/ui/playlisttitlebar.h +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PLAYLISTTITLEBAR_H -#define PLAYLISTTITLEBAR_H - -#include "playlist.h" -#include "pixmapwidget.h" -#include "mainwindow.h" - -/** - @author Ilya Kotov -*/ -class Skin; -class MainWindow; -class Button; -class PlayListModel; - -class PlayListTitleBar : public PixmapWidget -{ -Q_OBJECT -public: - PlayListTitleBar(QWidget *parent = 0); - ~PlayListTitleBar(); - void setActive(bool); - void readSettings(); - -public slots: - void showCurrent(); - void setModel(PlayListModel *selected, PlayListModel *previous = 0); - -private slots: - void updateSkin(); - void shade(); - -private: - void updatePositions(); - void updatePixmap(); - Skin *m_skin; - QPoint pos; - bool m_active; - PlayList* m_pl; - MainWindow* m_mw; - Button* m_close; - Button* m_shade; - Button* m_shade2; - bool m_shaded; - bool m_align, m_resize; - int m_ratio; - int m_height; - PlayListModel* m_model; - QString m_text; - QString m_truncatedText; - QFont m_font; - -protected: - void resizeEvent(QResizeEvent*); - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void mouseDoubleClickEvent(QMouseEvent*); -}; - -#endif diff --git a/src/ui/playstatus.cpp b/src/ui/playstatus.cpp deleted file mode 100644 index f12efb258..000000000 --- a/src/ui/playstatus.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "skin.h" -#include "playstatus.h" - -PlayStatus::PlayStatus ( QWidget *parent ) - : PixmapWidget ( parent ) -{ - m_skin = Skin::instance(); - setStatus ( STOP ); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); -} - - -PlayStatus::~PlayStatus() -{} - -void PlayStatus::setStatus ( Type st ) -{ - m_status = st; - switch ( ( uint ) st ) - { - case PLAY: - { - setPixmap ( m_skin->getItem ( Skin::PLAY )); - break; - } - case STOP: - { - setPixmap ( m_skin->getItem ( Skin::STOP )); - break; - } - case PAUSE: - { - setPixmap ( m_skin->getItem ( Skin::PAUSE )); - break; - } - } -} - -void PlayStatus::updateSkin() -{ - setStatus ( m_status ); -} - - diff --git a/src/ui/playstatus.h b/src/ui/playstatus.h deleted file mode 100644 index 1ddf9748c..000000000 --- a/src/ui/playstatus.h +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PLAYSTATUS_H -#define PLAYSTATUS_H - -#include "pixmapwidget.h" - -/** - @author Ilya Kotov -*/ -class Skin; - -class PlayStatus : public PixmapWidget -{ -Q_OBJECT -public: - PlayStatus(QWidget *parent = 0); - - ~PlayStatus(); - - enum Type - { - PLAY, - STOP, - PAUSE, - }; - -void setStatus(Type); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - Type m_status; -}; - -#endif diff --git a/src/ui/pluginitem.cpp b/src/ui/pluginitem.cpp deleted file mode 100644 index 0f0fa1f58..000000000 --- a/src/ui/pluginitem.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "pluginitem.h" - - -PluginItem::PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), TRANSPORT) -{ - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - - -PluginItem::PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), DECODER) -{ - setCheckState(0, Decoder::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - -PluginItem::PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), ENGINE) -{ - setCheckState(0, AbstractEngine::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - -PluginItem::PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), EFFECT) -{ - setCheckState(0, Effect::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - -PluginItem::PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), VISUAL) -{ - setCheckState(0, Visual::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - -PluginItem::PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path) - : QTreeWidgetItem(parent, QStringList() << factory->properties().name << path.section('/',-1), GENERAL) -{ - setCheckState(0, General::isEnabled(factory) ? Qt::Checked : Qt::Unchecked); - m_has_about = factory->properties().hasAbout; - m_has_config = factory->properties().hasSettings; - m_factory = factory; -} - -PluginItem::~PluginItem() -{ - -} - -bool PluginItem::hasAbout() const -{ - return m_has_about; -} -bool PluginItem::hasSettings() const -{ - return m_has_config; -} - -void PluginItem::showAbout(QWidget *parent) -{ - switch(type()) - { - case PluginItem::TRANSPORT: - static_cast(m_factory)->showAbout(parent); - break; - case PluginItem::DECODER: - static_cast(m_factory)->showAbout(parent); - break; - case PluginItem::ENGINE: - static_cast(m_factory)->showAbout(parent); - break; - case PluginItem::EFFECT: - static_cast(m_factory)->showAbout(parent); - break; - case PluginItem::VISUAL: - static_cast(m_factory)->showAbout(parent); - break; - case PluginItem::GENERAL: - static_cast(m_factory)->showAbout(parent); - break; - default: - ; - } - -} - -void PluginItem::showSettings(QWidget *parent) -{ - switch(type()) - { - case PluginItem::TRANSPORT: - static_cast(m_factory)->showSettings(parent); - break; - case PluginItem::DECODER: - static_cast(m_factory)->showSettings (parent); - break; - case PluginItem::ENGINE: - static_cast(m_factory)->showSettings (parent); - break; - case PluginItem::EFFECT: - static_cast(m_factory)->showSettings (parent); - break; - case PluginItem::VISUAL: - Visual::showSettings(static_cast(m_factory), parent); - break; - case PluginItem::GENERAL: - GeneralHandler::instance()->showSettings(static_cast(m_factory), parent); - break; - default: - ; - } -} - -void PluginItem::setEnabled(bool enabled) -{ - switch(type()) - { - case PluginItem::TRANSPORT: - //dynamic_cast(m_factory) - break; - case PluginItem::DECODER: - Decoder::setEnabled(static_cast(m_factory), enabled); - break; - case PluginItem::ENGINE: - AbstractEngine::setEnabled(static_cast(m_factory), enabled); - break; - case PluginItem::EFFECT: - Effect::setEnabled(static_cast(m_factory), enabled); - break; - case PluginItem::VISUAL: - Visual::setEnabled(static_cast(m_factory), enabled); - break; - case PluginItem::GENERAL: - GeneralHandler::instance()->setEnabled(static_cast(m_factory), enabled); - break; - default: - ; - } -} diff --git a/src/ui/pluginitem.h b/src/ui/pluginitem.h deleted file mode 100644 index da1ba4909..000000000 --- a/src/ui/pluginitem.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PLUGINITEM_H -#define PLUGINITEM_H - -#include - -/** - @author Ilya Kotov -*/ - -class QWidget; -class InputSourceFactory; -class DecoderFactory; -class EngineFactory; -class OutputFactory; -class VisualFactory; -class EffectFactory; -class GeneralFactory; - -class PluginItem : public QTreeWidgetItem -{ -public: - - PluginItem(QTreeWidgetItem *parent, InputSourceFactory *factory, const QString &path); - PluginItem(QTreeWidgetItem *parent, DecoderFactory *factory, const QString &path); - PluginItem(QTreeWidgetItem *parent, EngineFactory *factory, const QString &path); - PluginItem(QTreeWidgetItem *parent, EffectFactory *factory, const QString &path); - PluginItem(QTreeWidgetItem *parent, VisualFactory *factory, const QString &path); - PluginItem(QTreeWidgetItem *parent, GeneralFactory *factory, const QString &path); - ~PluginItem(); - - enum PluginType - { - TRANSPORT = QTreeWidgetItem::UserType, - DECODER, - ENGINE, - EFFECT, - VISUAL, - GENERAL - }; - - bool hasAbout() const; - bool hasSettings() const; - void showAbout(QWidget *parent); - void showSettings(QWidget *parent); - void setEnabled(bool enabled); - - -private: - bool m_has_about; - bool m_has_config; - void *m_factory; -}; - -#endif diff --git a/src/ui/popupsettings.cpp b/src/ui/popupsettings.cpp deleted file mode 100644 index 837afbf3c..000000000 --- a/src/ui/popupsettings.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include "popupwidget.h" -#include "popupsettings.h" - -PopupSettings::PopupSettings(QWidget *parent) - : QDialog(parent) -{ - ui.setupUi(this); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("PlayList"); - ui.transparencySlider->setValue(100 - settings.value("popup_opacity", 1.0).toDouble()*100); - ui.coverSizeSlider->setValue(settings.value ("popup_cover_size", 48).toInt()); - ui.textEdit->setPlainText(settings.value ("popup_template", DEFAULT_TEMPLATE).toString()); - ui.delaySpinBox->setValue(settings.value("popup_delay", 2500).toInt()); - ui.coverCheckBox->setChecked(settings.value("popup_show_cover",true).toBool()); - settings.endGroup(); - createMenu(); -} - - -PopupSettings::~PopupSettings() -{} - -void PopupSettings::accept() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("PlayList"); - settings.setValue("popup_opacity", 1.0 - (double)ui.transparencySlider->value()/100); - settings.setValue("popup_cover_size", ui.coverSizeSlider->value()); - settings.setValue("popup_template", ui.textEdit->toPlainText()); - settings.setValue("popup_delay", ui.delaySpinBox->value()); - settings.setValue("popup_show_cover", ui.coverCheckBox->isChecked()); - settings.endGroup(); - QDialog::accept(); -} - -void PopupSettings::createMenu() -{ - QMenu *menu = new QMenu(this); - menu->addAction(tr("Artist"))->setData("%p"); - menu->addAction(tr("Album"))->setData("%a"); - menu->addAction(tr("Title"))->setData("%t"); - menu->addAction(tr("Track number"))->setData("%n"); - menu->addAction(tr("Two-digit track number"))->setData("%NN"); - menu->addAction(tr("Genre"))->setData("%g"); - menu->addAction(tr("Comment"))->setData("%c"); - menu->addAction(tr("Composer"))->setData("%C"); - menu->addAction(tr("Duration"))->setData("%l"); - menu->addAction(tr("Disc number"))->setData("%D"); - menu->addAction(tr("File name"))->setData("%f"); - menu->addAction(tr("File path"))->setData("%F"); - menu->addAction(tr("Year"))->setData("%y"); - menu->addAction(tr("Condition"))->setData("%if(%p&%t,%p - %t,%f)"); - ui.insertButton->setMenu(menu); - connect(menu, SIGNAL(triggered (QAction *)), SLOT(insertExpression(QAction *))); -} - -void PopupSettings::insertExpression(QAction *a) -{ - ui.textEdit->insertPlainText(a->data().toString()); -} - -void PopupSettings::on_resetButton_clicked() -{ - ui.textEdit->setPlainText(DEFAULT_TEMPLATE); -} diff --git a/src/ui/popupsettings.h b/src/ui/popupsettings.h deleted file mode 100644 index ed7dde6c4..000000000 --- a/src/ui/popupsettings.h +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SETTINGSDIALOG_H -#define SETTINGSDIALOG_H - -#include -#include "ui_popupsettings.h" - -class Action; - -/** - @author Ilya Kotov -*/ -class PopupSettings : public QDialog -{ -Q_OBJECT -public: - PopupSettings(QWidget *parent = 0); - ~PopupSettings(); - - -public slots: - virtual void accept(); - -private slots: - void insertExpression(QAction *); - void on_resetButton_clicked(); - -private: - void createMenu(); - Ui::PopupSettings ui; - QMap m_buttons; -}; - -#endif diff --git a/src/ui/popupwidget.cpp b/src/ui/popupwidget.cpp deleted file mode 100644 index 08768b5f9..000000000 --- a/src/ui/popupwidget.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "popupwidget.h" - -using namespace PlayListPopup; - -PopupWidget::PopupWidget(QWidget *parent) - : QWidget(parent) -{ - setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::Dialog | Qt::FramelessWindowHint); - //setFrameStyle(QFrame::Box | QFrame::Plain); - setAttribute(Qt::WA_QuitOnClose, false); - m_item = 0; - QHBoxLayout *hlayout = new QHBoxLayout(this); //layout - m_pixlabel = new QLabel(this); - hlayout->addWidget(m_pixlabel); - - m_label1 = new QLabel(this); - hlayout->addWidget (m_label1); - - //settings - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("PlayList"); - setWindowOpacity(settings.value("popup_opacity", 1.0).toDouble()); - m_coverSize = settings.value("popup_cover_size", 48).toInt(); - m_template = settings.value("popup_template",DEFAULT_TEMPLATE).toString(); - int delay = settings.value("popup_delay", 2500).toInt(); - bool show_cover = settings.value("popup_show_cover",true).toBool(); - settings.endGroup(); - //timer - m_timer = new QTimer(this); - m_timer->setInterval(delay); - m_timer->setSingleShot (true); - connect(m_timer, SIGNAL(timeout ()), SLOT(show())); - if(show_cover) - connect(m_timer, SIGNAL(timeout ()), SLOT(loadCover())); - else - m_pixlabel->hide(); - setMouseTracking(true); -} - -PopupWidget::~PopupWidget() -{} - -void PopupWidget::mousePressEvent (QMouseEvent *) -{ - hide(); -} - -void PopupWidget::mouseMoveEvent (QMouseEvent *) -{ - hide(); -} - -void PopupWidget::prepare(PlayListItem *item, QPoint pos) -{ - pos += QPoint(15,10); - - m_item = item; - hide(); - if(!item) - { - m_timer->stop(); - return; - } - - QString title = m_template; - MetaDataFormatter f(title); - title = f.parse(item); - m_label1->setText(title); - qApp->processEvents(); - updateGeometry (); - resize(sizeHint()); - qApp->processEvents(); - m_timer->start(); - QRect rect = QApplication::desktop()->availableGeometry(this); - if(pos.x() + width() > rect.x() + rect.width()) - pos.rx() -= width(); - move(pos); -} - -void PopupWidget::deactivate() -{ - m_timer->stop(); - hide(); -} - -PlayListItem *PopupWidget::item() -{ - return m_item; -} - -void PopupWidget::loadCover() -{ - if(!m_item) - return; - QPixmap pix = MetaDataManager::instance()->getCover(m_item->url()); - if(pix.isNull()) - pix = QPixmap(":/ui_no_cover.png"); - m_pixlabel->setFixedSize(m_coverSize,m_coverSize); - m_pixlabel->setPixmap(pix.scaled(m_coverSize,m_coverSize)); - qApp->processEvents(); - updateGeometry (); - resize(sizeHint()); - qApp->processEvents(); -} diff --git a/src/ui/popupwidget.h b/src/ui/popupwidget.h deleted file mode 100644 index 5e630313e..000000000 --- a/src/ui/popupwidget.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef POPUPWIDGET_H -#define POPUPWIDGET_H - -#include - -#define DEFAULT_TEMPLATE "%if(%t,%t,%f)\n%if(%p,
%p,)\n%if(%a,
%a,)" - -class QTimer; -class QLabel; -class PlayListItem; - -namespace PlayListPopup { -/** - @author Ilya Kotov -*/ -class PopupWidget : public QWidget -{ - Q_OBJECT -public: - PopupWidget(QWidget *parent = 0); - - ~PopupWidget(); - - void prepare(PlayListItem *item, QPoint pos); - void deactivate(); - PlayListItem *item(); - -protected: - virtual void mousePressEvent (QMouseEvent *); - virtual void mouseMoveEvent (QMouseEvent *); - -private slots: - void loadCover(); - -private: - QTimer *m_timer; - QLabel *m_label1; - QLabel *m_pixlabel; - QString m_template; - uint m_pos; - int m_coverSize; - PlayListItem *m_item; - -}; -} - -#endif diff --git a/src/ui/positionbar.cpp b/src/ui/positionbar.cpp deleted file mode 100644 index 7b27f68e9..000000000 --- a/src/ui/positionbar.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include "skin.h" -#include "button.h" -#include "positionbar.h" - -PositionBar::PositionBar(QWidget *parent) : PixmapWidget(parent) -{ - m_skin = Skin::instance(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setPixmap(m_skin->getPosBar()); - m_moving = false; - m_min = 0; - m_max = 0; - m_old = m_value = 0; - draw(false); - setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); -} - - -PositionBar::~PositionBar() -{} - -void PositionBar::mousePressEvent(QMouseEvent *e) -{ - if(m_max <= 0) - return; - m_moving = true; - press_pos = e->x(); - if (m_posx() && e->x()ratio()) - { - press_pos = e->x()-m_pos; - emit sliderPressed(); - } - else - { - m_value = convert(qMax(qMin(width()-30*m_skin->ratio(),e->x()-15*m_skin->ratio()),0)); - press_pos = 15*m_skin->ratio(); - emit sliderPressed(); - if (m_value!=m_old) - { - emit sliderMoved(m_value); - - } - } - draw(); -} - -void PositionBar::mouseMoveEvent (QMouseEvent *e) -{ - if (m_moving) - { - qint64 po = e->x(); - po = po - press_pos; - - if (0<=po && po<=width()-30*m_skin->ratio()) - { - m_value = convert(po); - draw(); - emit sliderMoved(m_value); - } - } -} - -void PositionBar::mouseReleaseEvent(QMouseEvent*) -{ - draw(false); - if (m_value != m_old && m_max > 0) - m_old = m_value; - m_moving = false; - if(m_max > 0) - emit sliderReleased(); -} - -void PositionBar::setValue(qint64 v) -{ - if (m_moving || m_max == 0) - return; - m_value = v; - draw(false); -} - -void PositionBar::setMaximum(qint64 max) -{ - m_max = max; - draw(false); -} - -void PositionBar::updateSkin() -{ - resize(m_skin->getPosBar().size()); - draw(false); - setCursor(m_skin->getCursor(Skin::CUR_POSBAR)); -} - -void PositionBar::draw(bool pressed) -{ - qint64 p=qint64(ceil(double(m_value-m_min)*(width()-30*m_skin->ratio())/(m_max-m_min))); - m_pixmap = m_skin->getPosBar(); - if (m_max > 0) - { - QPainter paint(&m_pixmap); - if (pressed) - paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_P)); - else - paint.drawPixmap(p,0,m_skin->getButton(Skin::BT_POSBAR_N)); - } - setPixmap(m_pixmap); - m_pos = p; -} - -qint64 PositionBar::convert(qint64 p) -{ - return qint64(ceil(double(m_max-m_min)*(p)/(width()-30*m_skin->ratio())+m_min)); -} diff --git a/src/ui/positionbar.h b/src/ui/positionbar.h deleted file mode 100644 index 8fb768664..000000000 --- a/src/ui/positionbar.h +++ /dev/null @@ -1,65 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef POSITIONBAR_H -#define POSITIONBAR_H - -#include "pixmapwidget.h" - -class QMouseEvent; -class Skin; - -/** - @author Ilya Kotov -*/ -class PositionBar : public PixmapWidget -{ - Q_OBJECT -public: - PositionBar(QWidget *parent = 0); - virtual ~PositionBar(); - -public slots: - void setValue(qint64); - qint64 value()const{return m_value;} - void setMaximum(qint64); - qint64 maximum() const {return m_max;} - -signals: - void sliderMoved (qint64); - void sliderPressed(); - void sliderReleased(); - -private slots: - void updateSkin(); - -private: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - Skin *m_skin; - bool m_moving; - qint64 press_pos; - qint64 m_max, m_min, m_pos, m_value, m_old; - QPixmap m_pixmap; - qint64 convert(qint64); // value = convert(position); - void draw(bool pressed = true); -}; - -#endif diff --git a/src/ui/preseteditor.cpp b/src/ui/preseteditor.cpp deleted file mode 100644 index 8e5249c0c..000000000 --- a/src/ui/preseteditor.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include "eqpreset.h" -#include "preseteditor.h" - -PresetEditor::PresetEditor(QWidget *parent) - : QDialog(parent) -{ - ui.setupUi(this); - setAttribute(Qt::WA_DeleteOnClose); - connect(ui.loadButton,SIGNAL(clicked()),SLOT(loadPreset())); - connect(ui.deleteButton,SIGNAL(clicked()),SLOT(deletePreset())); - ui.loadButton->setIcon(QIcon::fromTheme("document-open")); - ui.deleteButton->setIcon(QIcon::fromTheme("edit-delete")); -} - - -PresetEditor::~PresetEditor() -{ - while (ui.presetListWidget->count () !=0) - ui.presetListWidget->takeItem (0); - - while (ui.autoPresetListWidget->count () !=0) - ui.autoPresetListWidget->takeItem (0); -} - -void PresetEditor::addPresets(const QList &presets) -{ - foreach(QListWidgetItem *item, presets) - { - ui.presetListWidget->addItem(item); - } -} - -void PresetEditor::addAutoPresets(const QList &presets) -{ - foreach(QListWidgetItem *item, presets) - { - ui.autoPresetListWidget->addItem(item); - } -} - -void PresetEditor::loadPreset() -{ - EQPreset* preset = 0; - if (ui.tabWidget->currentIndex () == 0) - preset = (EQPreset *) ui.presetListWidget->currentItem (); - if (ui.tabWidget->currentIndex () == 1) - preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); - if (preset) - emit presetLoaded(preset); -} - -void PresetEditor::deletePreset() -{ - EQPreset* preset = 0; - if (ui.tabWidget->currentIndex () == 0) - preset = (EQPreset *) ui.presetListWidget->currentItem (); - if (ui.tabWidget->currentIndex () == 1) - preset = (EQPreset *) ui.autoPresetListWidget->currentItem (); - if (preset) - emit presetDeleted(preset); -} diff --git a/src/ui/preseteditor.h b/src/ui/preseteditor.h deleted file mode 100644 index 35302b185..000000000 --- a/src/ui/preseteditor.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef PRESETEDITOR_H -#define PRESETEDITOR_H - -#include - -#include "ui_preseteditor.h" - -/** - @author Ilya Kotov -*/ - -class EQPreset; - -class PresetEditor : public QDialog -{ -Q_OBJECT -public: - PresetEditor(QWidget *parent = 0); - - ~PresetEditor(); - - void addPresets(const QList&); - void addAutoPresets(const QList&); - -signals: - void presetLoaded(EQPreset*); - void presetDeleted(EQPreset*); - -private slots: - void loadPreset(); - void deletePreset(); - -private: - Ui::PresetEditor ui; - -}; - -#endif diff --git a/src/ui/qmmpstarter.cpp b/src/ui/qmmpstarter.cpp index 71bef91f6..c24bd5789 100644 --- a/src/ui/qmmpstarter.cpp +++ b/src/ui/qmmpstarter.cpp @@ -27,8 +27,12 @@ #include #include #include +#include #include -#include "mainwindow.h" +#include +#include +#include +#include #include "qmmpstarter.h" #include "builtincommandlineoption.h" @@ -40,7 +44,7 @@ using namespace std; -QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent), mw(NULL) +QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent) { m_option_manager = new BuiltinCommandLineOption(this); QStringList tmp; @@ -114,18 +118,35 @@ QMMPStarter::QMMPStarter(int argc,char **argv, QObject* parent) : QObject(parent QMMPStarter::~QMMPStarter() { - if (mw) - delete mw; + /*if (mw) + delete mw;*/ } void QMMPStarter::startMainWindow() { connect(m_server, SIGNAL(newConnection()), SLOT(readCommand())); QStringList args = argString.split("\n", QString::SkipEmptyParts); - mw = new MainWindow(); + + //prepare libqmmp and libqmmpui libraries for playing + /*m_player = */new MediaPlayer(this); + //m_core = */SoundCore::instance(); + /*m_pl_manager = */PlayListManager::instance(); + //additional featuries + new PlaylistParser(this); + /*m_generalHandler = */new GeneralHandler(this); + + UiFactory *factory = UiLoader::currentUiFactory(); + if(factory) + { + QObject *ui = factory->create(); + //ui->setParent(this); + } + + + /*mw = new MainWindow(); processCommandArgs(args, QDir::currentPath()); if(args.isEmpty()) - mw->resume(); + mw->resume();*/ } void QMMPStarter::writeCommand() @@ -187,7 +208,7 @@ QString QMMPStarter::processCommandArgs(const QStringList &slist, const QString& } if(!paths.isEmpty()) { - m_option_manager->executeCommand(QString(), paths, cwd, mw); //add paths only + m_option_manager->executeCommand(QString(), paths, cwd/*, mw*/); //add paths only return QString(); } QHash commands = m_option_manager->splitArgs(slist); @@ -200,7 +221,7 @@ QString QMMPStarter::processCommandArgs(const QStringList &slist, const QString& if (CommandLineManager::hasOption(key)) return CommandLineManager::executeCommand(key, commands.value(key)); else if (m_option_manager->identify(key)) - m_option_manager->executeCommand(key, commands.value(key), cwd, mw); + m_option_manager->executeCommand(key, commands.value(key), cwd); else return QString(); } diff --git a/src/ui/qmmpstarter.h b/src/ui/qmmpstarter.h index 314716084..95596ea49 100644 --- a/src/ui/qmmpstarter.h +++ b/src/ui/qmmpstarter.h @@ -66,7 +66,7 @@ private: void startMainWindow(); private: - MainWindow* mw; + //MainWindow* mw; QString argString; BuiltinCommandLineOption* m_option_manager; QLocalServer *m_server; diff --git a/src/ui/shadedbar.cpp b/src/ui/shadedbar.cpp deleted file mode 100644 index bdabbe516..000000000 --- a/src/ui/shadedbar.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include "skin.h" -#include "shadedbar.h" - -ShadedBar::ShadedBar(QWidget *parent, uint slider1, uint slider2, uint slider3) - : QWidget(parent) -{ - m_slider1 = slider1; - m_slider2 = slider2; - m_slider3 = slider3; - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - if(slider1 == Skin::EQ_VOLUME1) - resize(m_ratio*97,m_ratio*7); - else - resize(m_ratio*42,m_ratio*7); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - m_moving = false; - m_min = 0; - m_max = 100; - m_old = m_value = 0; - draw(); -} - - -ShadedBar::~ShadedBar() -{ -} - -void ShadedBar::mousePressEvent(QMouseEvent *e) -{ - m_moving = true; - press_pos = e->x(); - if(m_posx() && e->x()x()-m_pos; - } - else - { - m_value = convert(qMax(qMin(width()-3,e->x()-1),0)); - press_pos = 1; - if (m_value!=m_old) - { - emit sliderMoved(m_value); - } - } - draw(); -} - -void ShadedBar::mouseMoveEvent (QMouseEvent *e) -{ - if(m_moving) - { - int po = e->x(); - po = po - press_pos; - - if(0<=po && po<=width()-3) - { - m_value = convert(po); - draw(); - emit sliderMoved(m_value); - } - } -} - -void ShadedBar::mouseReleaseEvent(QMouseEvent*) -{ - m_moving = false; - draw(); - m_old = m_value; -} - -void ShadedBar::setValue(int v) -{ - if (m_moving || m_max == 0) - return; - m_value = v; - draw(); -} - -void ShadedBar::setRange(int min, int max) -{ - m_max = max; - m_min = min; - draw(); -} - -void ShadedBar::updateSkin() -{ - m_ratio = m_skin->ratio(); - if(m_slider1 == Skin::EQ_VOLUME1) - resize(m_ratio*97,m_ratio*7); - else - resize(m_ratio*42,m_ratio*7); - draw(); -} - -void ShadedBar::draw() -{ - if (m_value <= m_min + (m_max - m_min)/3) - m_pixmap = m_skin->getEqPart(m_slider1); - else if(m_min + (m_max - m_min)/3 < m_value && m_value <= m_min + 2*(m_max - m_min)/3) - m_pixmap = m_skin->getEqPart(m_slider2); - else - m_pixmap = m_skin->getEqPart(m_slider3); - m_pos = int(ceil(double(m_value-m_min)*(width()-3*m_ratio)/(m_max-m_min))); - update(); -} - -int ShadedBar::convert(int p) -{ - return int(ceil(double(m_max-m_min)*(p)/(width()-3)+m_min)); -} - -void ShadedBar::paintEvent(QPaintEvent*) -{ - QPainter paint(this); - paint.drawPixmap(m_pos,0,m_pixmap); -} - diff --git a/src/ui/shadedbar.h b/src/ui/shadedbar.h deleted file mode 100644 index 09272e9e1..000000000 --- a/src/ui/shadedbar.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SHADEDBAR_H -#define SHADEDBAR_H - -#include - -class QMouseEvent; -class QPaintEvent; -class Skin; - -/** - @author Ilya Kotov -*/ -class ShadedBar : public QWidget -{ - Q_OBJECT -public: - ShadedBar(QWidget *parent = 0, uint slider1 = 0, uint slider2 = 0, uint slider3 = 0); - - ~ShadedBar(); - int value() - { - return m_value; - } - int isPressed() - { - return m_moving; - } - void setRange(int min, int max); - -public slots: - void setValue(int); - -signals: - void sliderMoved (int); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - bool m_moving; - int press_pos; - int m_max, m_min, m_pos, m_value, m_old, m_x; - QPixmap m_pixmap; - int convert(int); // value = convert(position); - void draw(); - uint m_slider1, m_slider2, m_slider3; - int m_ratio; - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void paintEvent(QPaintEvent*); -}; - -#endif diff --git a/src/ui/shadedvisual.cpp b/src/ui/shadedvisual.cpp deleted file mode 100644 index e249752ca..000000000 --- a/src/ui/shadedvisual.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include "skin.h" -#include "mainvisual.h" -#include "inlines.h" -#include "shadedvisual.h" - -#define VISUAL_NODE_SIZE 512 //samples -#define VISUAL_BUFFER_SIZE (5*VISUAL_NODE_SIZE) - -ShadedVisual::ShadedVisual(QWidget *parent) : Visual(parent) -{ - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - resize(m_ratio*38,m_ratio*5); - m_pixmap = QPixmap (m_ratio*38,m_ratio*5); - m_timer = new QTimer(this); - connect(m_timer, SIGNAL (timeout()), this, SLOT (timeout())); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - m_left_buffer = new short[VISUAL_BUFFER_SIZE]; - m_right_buffer = new short[VISUAL_BUFFER_SIZE]; - m_buffer_at = 0; - m_timer->setInterval(50); - m_timer->start(); - clear(); -} - -ShadedVisual::~ShadedVisual() -{ - delete [] m_left_buffer; - delete [] m_right_buffer; -} - -void ShadedVisual::add(unsigned char *data, qint64 size, int chan) -{ - if (!m_timer->isActive ()) - return; - - if(VISUAL_BUFFER_SIZE == m_buffer_at) - { - m_buffer_at -= VISUAL_NODE_SIZE; - memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - return; - } - - int frames = qMin((int)size/chan >> 1, VISUAL_BUFFER_SIZE - m_buffer_at); - - if (chan >= 2) - { - stereo16_from_multichannel(m_left_buffer + m_buffer_at, - m_right_buffer + m_buffer_at,(short *) data, frames, chan); - } - else - { - memcpy(m_left_buffer + m_buffer_at, (short *) data, frames << 1); - memcpy(m_right_buffer + m_buffer_at, (short *) data, frames << 1); - } - - m_buffer_at += frames; -} - -void ShadedVisual::clear() -{ - m_buffer_at = 0; - m_l = 0; - m_r = 0; - m_pixmap.fill(m_skin->getVisColor(0)); - update(); -} - -void ShadedVisual::timeout() -{ - m_pixmap.fill(m_skin->getVisColor(0)); - - mutex()->lock (); - if(m_buffer_at < VISUAL_NODE_SIZE) - { - mutex()->unlock (); - return; - } - - process (m_left_buffer, m_right_buffer); - m_buffer_at -= VISUAL_NODE_SIZE; - memmove(m_left_buffer, m_left_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - memmove(m_right_buffer, m_right_buffer + VISUAL_NODE_SIZE, m_buffer_at << 1); - QPainter p(&m_pixmap); - draw (&p); - mutex()->unlock (); - update(); -} - -void ShadedVisual::process (short *left, short *right) -{ - int step = (VISUAL_NODE_SIZE << 8)/74; - int pos = 0; - int l = 0; - int r = 0; - int j_l = 0, j_r = 0; - - for (int i = 0; i < 75; ++i) - { - pos += step; - - if (left) - { - j_l = abs((left[pos >> 8] >> 12)); - - if (j_l > 15) - j_l = 15; - l = qMax(l, j_l); - } - if (right) - { - j_r = abs((right[pos >> 8] >> 12)); - if (j_r > 15) - j_r = 15; - r = qMax(r, j_r); - } - } - m_l -= 0.5; - m_l = m_l > l ? m_l : l; - m_r -= 0.5; - m_r = m_r > r ? m_r : r; -} - -void ShadedVisual::draw (QPainter *p) -{ - for (int i = 0; i < m_l; ++i) - { - p->fillRect (i*3*m_ratio, 0, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); - } - for (int i = 0; i < m_r; ++i) - { - p->fillRect (i*3*m_ratio, 3*m_ratio, 3*m_ratio, 2*m_ratio, QBrush(m_skin->getVisColor (17-i))); - } -} - -void ShadedVisual::paintEvent (QPaintEvent *) -{ - QPainter painter (this); - painter.drawPixmap (0,0,m_pixmap); -} - -void ShadedVisual::hideEvent (QHideEvent *) -{ - m_timer->stop(); -} - -void ShadedVisual::showEvent (QShowEvent *) -{ - m_timer->start(); -} - -void ShadedVisual::updateSkin() -{ - m_ratio = m_skin->ratio(); - resize(m_ratio*38,m_ratio*5); - m_pixmap = QPixmap (m_ratio*38,m_ratio*5); - clear(); -} diff --git a/src/ui/shadedvisual.h b/src/ui/shadedvisual.h deleted file mode 100644 index 0592ec78f..000000000 --- a/src/ui/shadedvisual.h +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SHADEDVISUAL_H -#define SHADEDVISUAL_H - -#include -#include -#include - -class QTimer; -class QPixmap; -class Skin; -//class VisualNode; - -/** - @author Ilya Kotov -*/ -class ShadedVisual : public Visual -{ - Q_OBJECT -public: - ShadedVisual(QWidget *parent = 0); - - ~ShadedVisual(); - - void add(unsigned char *data, qint64 size, int chan); - void clear(); - - void paintEvent (QPaintEvent *); - void hideEvent (QHideEvent *); - void showEvent (QShowEvent *); - -public slots: - void timeout(); - -private slots: - void updateSkin(); - -private: - void process (short *l, short *r); - void draw (QPainter *); - Skin *m_skin; - QTimer *m_timer; - QPixmap m_pixmap; - short *m_left_buffer; - short *m_right_buffer; - int m_buffer_at; - double m_l, m_r; - int m_ratio; - -}; - -#endif diff --git a/src/ui/shortcutdialog.cpp b/src/ui/shortcutdialog.cpp deleted file mode 100644 index 421c08169..000000000 --- a/src/ui/shortcutdialog.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include "shortcutdialog.h" - -ShortcutDialog::ShortcutDialog(const QString &key, QWidget *parent) - : QDialog(parent) -{ - ui.setupUi(this); - ui.keyLineEdit->setText(key); -} - -ShortcutDialog::~ShortcutDialog() -{ -} - -void ShortcutDialog::keyPressEvent (QKeyEvent *event) -{ - int key = event->key(); - switch (key) - { - case Qt::Key_Shift: - case Qt::Key_Control: - case Qt::Key_Meta: - case Qt::Key_Alt: - case Qt::Key_AltGr: - case Qt::Key_Super_L: - case Qt::Key_Super_R: - case Qt::Key_Menu: - case 0: - case Qt::Key_unknown: - key = 0; - ui.keyLineEdit->clear(); - QWidget::keyPressEvent(event); - return; - } - QKeySequence seq(event->modifiers() + event->key()); - ui.keyLineEdit->setText(seq.toString()); - QWidget::keyPressEvent(event); -} - -const QString ShortcutDialog::key() -{ - return ui.keyLineEdit->text(); -} diff --git a/src/ui/shortcutdialog.h b/src/ui/shortcutdialog.h deleted file mode 100644 index 62aedd5a5..000000000 --- a/src/ui/shortcutdialog.h +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SHORTCUTDIALOG_H -#define SHORTCUTDIALOG_H - -#include -#include "ui_shortcutdialog.h" - -class QKeyEvent; - -/** - @author Ilya Kotov -*/ -class ShortcutDialog : public QDialog -{ - Q_OBJECT -public: - ShortcutDialog(const QString &key, QWidget *parent = 0); - - ~ShortcutDialog(); - - const QString key(); - -protected: - virtual void keyPressEvent (QKeyEvent *event); - -private: - Ui::ShortcutDialog ui; - -}; - -#endif diff --git a/src/ui/shortcutitem.cpp b/src/ui/shortcutitem.cpp deleted file mode 100644 index eb8baf164..000000000 --- a/src/ui/shortcutitem.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include "actionmanager.h" -#include "shortcutitem.h" - -ShortcutItem::ShortcutItem(QTreeWidgetItem *parent, int type) : QTreeWidgetItem(parent, QStringList() - << ActionManager::instance()->action(type)->text().remove("&") - << ActionManager::instance()->action(type)->shortcut()) -{ - m_action = ActionManager::instance()->action(type); - setIcon(0, m_action->icon()); -} - -ShortcutItem::~ShortcutItem() -{} - -QAction *ShortcutItem::action() -{ - return m_action; -} diff --git a/src/ui/shortcutitem.h b/src/ui/shortcutitem.h deleted file mode 100644 index a8cbd9f7c..000000000 --- a/src/ui/shortcutitem.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SHORTCUTITEM_H -#define SHORTCUTITEM_H - -#include - -class QWidget; -class QAction; - -/** - @author Ilya Kotov -*/ - -class ShortcutItem : public QTreeWidgetItem -{ -public: - - ShortcutItem(QTreeWidgetItem *parent, int type); - ~ShortcutItem(); - QAction *action(); - -private: - QAction *m_action; - -}; - -#endif //SHORTCUTITEM_H diff --git a/src/ui/skin.cpp b/src/ui/skin.cpp deleted file mode 100644 index c17471d2f..000000000 --- a/src/ui/skin.cpp +++ /dev/null @@ -1,852 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * Based on Promoe, an XMMS2 Client * - * Copyright (C) 2005-2006 by XMMS2 Team * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "actionmanager.h" -#include "skin.h" -#include "cursorimage.h" - -Skin *Skin::m_instance = 0; - -Skin *Skin::instance() -{ - if (!m_instance) - m_instance = new Skin(); - return m_instance; -} - -QPixmap Skin::getPixmap (const QString& name, QDir dir) -{ - dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = dir.entryInfoList(); - for (int j = 0; j < f.size(); ++j) - { - QFileInfo fileInfo = f.at (j); - QString fn = fileInfo.fileName().toLower(); - if (fn.section (".",0,0) == name) - { - return QPixmap (fileInfo.filePath()); - } - } - return QPixmap(); -} - -Skin::Skin (QObject *parent) : QObject (parent) -{ - m_instance = this; - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - QString path = settings.value("General/skin_path").toString(); - if (path.isEmpty() || !QDir(path).exists ()) - path = ":/default"; - m_double_size = settings.value("General/double_size", false).toBool(); - ACTION(ActionManager::WM_DOUBLE_SIZE)->setChecked(m_double_size); - setSkin (QDir::cleanPath(path)); - /* skin directory */ - QDir skinDir(QDir::homePath()+"/.qmmp"); - skinDir.mkdir ("skins"); -} - -Skin::~Skin() -{} - -void Skin::setSkin (const QString& path) -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_use_cursors = settings.value("General/skin_cursors", false).toBool(); - m_double_size = ACTION(ActionManager::WM_DOUBLE_SIZE)->isChecked(); - settings.setValue("General/skin_path",path); - qDebug ("Skin: using %s",qPrintable(path)); - m_skin_dir = QDir (path); - //clear old values - m_pledit_txt.clear(); - buttons.clear(); - titlebar.clear(); - m_numbers.clear(); - m_pl_parts.clear(); - m_eq_parts.clear(); - m_eq_bar.clear(); - m_eq_spline.clear(); - m_vis_colors.clear(); - cursors.clear(); - //load skin parts - loadPLEdit(); - loadMain(); - loadButtons(); - loadShufRep(); - loadTitleBar(); - loadPosBar(); - loadNumbers(); - loadPlayList(); - loadEq_ex(); - loadEqMain(); - loadVisColor(); - loadLetters(); - loadMonoSter(); - loadVolume(); - loadBalance(); - loadRegion(); - loadCursors(); - if(m_double_size) - { - uint key; - foreach(key, buttons.keys()) - buttons[key] = scalePixmap(buttons[key]); - foreach(key, titlebar.keys()) - titlebar[key] = scalePixmap(titlebar[key]); - foreach(key, m_pl_parts.keys()) - m_pl_parts[key] = scalePixmap(m_pl_parts[key]); - foreach(key, m_eq_parts.keys()) - m_eq_parts[key] = scalePixmap(m_eq_parts[key]); - foreach(key, m_ms_parts.keys()) - m_ms_parts[key] = scalePixmap(m_ms_parts[key]); - foreach(key, m_parts.keys()) - m_parts[key] = scalePixmap(m_parts[key]); - foreach(QChar c, m_letters.keys()) - m_letters[c] = scalePixmap(m_letters[c]); - m_main = scalePixmap(m_main); - posbar = scalePixmap(posbar); - int i; - for(i = 0; i < m_numbers.size(); ++i) - m_numbers[i] = scalePixmap(m_numbers[i]); - - for(i = 0; i < m_eq_bar.size(); ++i) - m_eq_bar[i] = scalePixmap(m_eq_bar[i]); - - for(i = 0; i < m_eq_spline.size(); ++i) - m_eq_spline[i] = scalePixmap(m_eq_spline[i]); - - for(i = 0; i < m_volume.size(); ++i) - m_volume[i] = scalePixmap(m_volume[i]); - for(i = 0; i < m_balance.size(); ++i) - m_balance[i] = scalePixmap(m_balance[i]); - } - emit skinChanged(); -} - -void Skin::reloadSkin() -{ - setSkin (m_skin_dir.absolutePath ()); -} - -void Skin::loadMain() -{ - QPixmap *pixmap = getPixmap ("main"); - if (!pixmap) - pixmap = getDummyPixmap("main"); - - m_main = pixmap->copy (0,0,275,116); - delete pixmap; -} - -void Skin::loadCursors() -{ - if(!m_use_cursors) - { - for(int i = CUR_NORMAL; i <= CUR_WSWINBUT; ++i) - cursors[i] = QCursor(Qt::ArrowCursor); - cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); - return; - } - cursors[CUR_NORMAL] = createCursor(getPath("normal")); - cursors[CUR_CLOSE] = createCursor(getPath("close")); - cursors[CUR_MAINMENU] = createCursor(getPath("mainmenu")); - cursors[CUR_MIN] = createCursor(getPath("min")); - cursors[CUR_POSBAR] = createCursor(getPath("posbar.cur")); - cursors[CUR_SONGNAME] = createCursor(getPath("songname")); - cursors[CUR_TITLEBAR] = createCursor(getPath("titlebar.cur")); - cursors[CUR_VOLBAL] = createCursor(getPath("volbal")); - cursors[CUR_WINBUT] = createCursor(getPath("winbut")); - - cursors[CUR_WSNORMAL] = createCursor(getPath("wsnormal")); - cursors[CUR_WSPOSBAR] = createCursor(getPath("wsposbar")); - - cursors[CUR_EQCLOSE] = createCursor(getPath("eqclose")); - cursors[CUR_EQNORMAL] = createCursor(getPath("eqnormal")); - cursors[CUR_EQSLID] = createCursor(getPath("eqslid")); - cursors[CUR_EQTITLE] = createCursor(getPath("eqtitle")); - - cursors[CUR_PCLOSE] = createCursor(getPath("pclose")); - cursors[CUR_PNORMAL] = createCursor(getPath("pnormal")); - cursors[CUR_PSIZE] = createCursor(getPath("psize")); - if(cursors[CUR_PSIZE].shape() == Qt::ArrowCursor) - cursors[CUR_PSIZE] = QCursor(Qt::SizeFDiagCursor); - cursors[CUR_PTBAR] = createCursor(getPath("ptbar")); - cursors[CUR_PVSCROLL] = createCursor(getPath("pvscroll")); - cursors[CUR_PWINBUT] = createCursor(getPath("pwinbut")); - - cursors[CUR_PWSNORM] = createCursor(getPath("pwsnorm")); - cursors[CUR_PWSSIZE] = createCursor(getPath("pwssize")); - - cursors[CUR_VOLBAR] = createCursor(getPath("volbar")); - cursors[CUR_WSCLOSE] = createCursor(getPath("wsclose")); - cursors[CUR_WSMIN] = createCursor(getPath("wsmin")); - cursors[CUR_WSWINBUT] = createCursor(getPath("wswinbut")); -} - -void Skin::loadButtons() -{ - - QPixmap *pixmap = getPixmap ("cbuttons"); - - if (!pixmap) - pixmap = getDummyPixmap("cbuttons"); - - buttons[BT_PREVIOUS_N] = pixmap->copy (0, 0,23,18); - buttons[BT_PREVIOUS_P] = pixmap->copy (0,18,23,18); - - buttons[BT_PLAY_N] = pixmap->copy (23, 0,23,18); - buttons[BT_PLAY_P] = pixmap->copy (23,18,23,18); - - buttons[BT_PAUSE_N] = pixmap->copy (46, 0,23,18); - buttons[BT_PAUSE_P] = pixmap->copy (46,18,23,18); - - buttons[BT_STOP_N] = pixmap->copy (69, 0,23,18); - buttons[BT_STOP_P] = pixmap->copy (69,18,23,18); - - buttons[BT_NEXT_N] = pixmap->copy (92, 0,22,18); - buttons[BT_NEXT_P] = pixmap->copy (92,18,22,18); - - buttons[BT_EJECT_N] = pixmap->copy (114, 0,22,16); - buttons[BT_EJECT_P] = pixmap->copy (114,16,22,16); - delete pixmap; -} - -void Skin::loadTitleBar() -{ - QPixmap *pixmap = getPixmap ("titlebar"); - - if (!pixmap) - pixmap = getDummyPixmap("titlebar"); - - buttons[BT_MENU_N] = pixmap->copy (0,0,9,9); - buttons[BT_MENU_P] = pixmap->copy (0,9,9,9); - buttons[BT_MINIMIZE_N] = pixmap->copy (9,0,9,9); - buttons[BT_MINIMIZE_P] = pixmap->copy (9,9,9,9); - buttons[BT_CLOSE_N] = pixmap->copy (18,0,9,9); - buttons[BT_CLOSE_P] = pixmap->copy (18,9,9,9); - buttons[BT_SHADE1_N] = pixmap->copy (0,18,9,9); - buttons[BT_SHADE1_P] = pixmap->copy (9,18,9,9); - buttons[BT_SHADE2_N] = pixmap->copy (0,27,9,9); - buttons[BT_SHADE2_P] = pixmap->copy (9,27,9,9); - titlebar[TITLEBAR_A] = pixmap->copy (27, 0,275,14); - titlebar[TITLEBAR_I] = pixmap->copy (27,15,275,14); - titlebar[TITLEBAR_SHADED_A] = pixmap->copy (27,29,275,14); - titlebar[TITLEBAR_SHADED_I] = pixmap->copy (27,42,275,14); - delete pixmap; -} - -void Skin::loadPosBar() -{ - QPixmap *pixmap = getPixmap ("posbar"); - - if (!pixmap) - pixmap = getDummyPixmap("posbar"); - - if (pixmap->width() > 249) - { - buttons[BT_POSBAR_N] = pixmap->copy (248,0,29, pixmap->height()); - buttons[BT_POSBAR_P] = pixmap->copy (278,0,29, pixmap->height()); - } - else - { - QPixmap dummy(29, pixmap->height()); - dummy.fill(Qt::transparent); - buttons[BT_POSBAR_N] = dummy; - buttons[BT_POSBAR_P] = dummy; - } - posbar = pixmap->copy (0,0,248,pixmap->height()); - delete pixmap; -} - -void Skin::loadNumbers() -{ - QPixmap *pixmap = getPixmap ("nums_ex"); - if (!pixmap) - pixmap = getPixmap ("numbers"); - if (!pixmap) - pixmap = getDummyPixmap("numbers"); - - for (uint i = 0; i < 10; i++) - m_numbers << pixmap->copy (i*9, 0, 9, pixmap->height()); - - if (pixmap->width() > 107) - m_numbers << pixmap->copy(99, 0, 9, pixmap->height()); - else - { - // We didn't find "-" symbol. So we have to extract it from "2". - // Winamp uses this method too. - QPixmap pix; - if(pixmap->width() > 98) - pix = pixmap->copy(90,0,9,pixmap->height()); - else - { - pix = QPixmap(9, pixmap->height()); - pix.fill(Qt::transparent); - } - QPixmap minus = pixmap->copy(18,pixmap->height()/2,9,1); - QPainter paint(&pix); - paint.drawPixmap(0,pixmap->height()/2, minus); - m_numbers << pix; - } - delete pixmap; -} - -void Skin::loadPlayList() -{ - QPixmap *pixmap = getPixmap ("pledit"); - - if (!pixmap) - pixmap = getDummyPixmap("pledit"); - - m_pl_parts[PL_CORNER_UL_A] = pixmap->copy (0,0,25,20); - m_pl_parts[PL_CORNER_UL_I] = pixmap->copy (0,21,25,20); - - m_pl_parts[PL_CORNER_UR_A] = pixmap->copy (153,0,25,20); - m_pl_parts[PL_CORNER_UR_I] = pixmap->copy (153,21,25,20); - - m_pl_parts[PL_TITLEBAR_A] = pixmap->copy (26,0,100,20); - m_pl_parts[PL_TITLEBAR_I] = pixmap->copy (26,21,100,20); - - m_pl_parts[PL_TFILL1_A] = pixmap->copy (127,0,25,20); - m_pl_parts[PL_TFILL1_I] = pixmap->copy (127,21,25,20); - - //m_pl_parts[PL_TFILL2_A] = pixmap->copy();//FIXME: ����� - //m_pl_parts[PL_TFILL2_I] = pixmap->copy(); - - m_pl_parts[PL_LFILL] = pixmap->copy (0,42,12,29); - m_pl_parts[PL_RFILL] = pixmap->copy (31,42,20,29); //??? - - m_pl_parts[PL_LSBAR] = pixmap->copy (0,72,125,38); - m_pl_parts[PL_RSBAR] = pixmap->copy (126,72,150,38); - m_pl_parts[PL_SFILL1] = pixmap->copy (179,0,25,38); - m_pl_parts[PL_SFILL2] = pixmap->copy (250,21,75,38); - m_pl_parts[PL_TITLEBAR_SHADED1_A] = pixmap->copy (99,42,50,14); - m_pl_parts[PL_TITLEBAR_SHADED1_I] = pixmap->copy (99,57,50,14); - m_pl_parts[PL_TITLEBAR_SHADED2] = pixmap->copy (72,42,25,14); - m_pl_parts[PL_TFILL_SHADED] = pixmap->copy (72,57,25,14); - - m_pl_parts[PL_CONTROL] = pixmap->copy(129,94,60,8); - - buttons[PL_BT_ADD] = pixmap->copy (11,80,25,18); - buttons[PL_BT_SUB] = pixmap->copy (40,80,25,18); - buttons[PL_BT_SEL] = pixmap->copy (70,80,25,18); - buttons[PL_BT_SORT] = pixmap->copy (99,80,25,18); - buttons[PL_BT_LST] = pixmap->copy(229, 80, 25, 18); - buttons[PL_BT_SCROLL_N] = pixmap->copy (52,53,8,18); - buttons[PL_BT_SCROLL_P] = pixmap->copy (61,53,8,18); - - buttons[PL_BT_CLOSE_N] = pixmap->copy (167,3,9,9); - buttons[PL_BT_CLOSE_P] = pixmap->copy (52,42,9,9); - buttons[PL_BT_SHADE1_N] = pixmap->copy (158,3,9,9); - buttons[PL_BT_SHADE1_P] = pixmap->copy (62,42,9,9); - buttons[PL_BT_SHADE2_N] = pixmap->copy (129,45,9,9); - buttons[PL_BT_SHADE2_P] = pixmap->copy (150,42,9,9); - -} - -QPixmap *Skin::getPixmap (const QString& name) -{ - m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = m_skin_dir.entryInfoList(); - for (int j = 0; j < f.size(); ++j) - { - QFileInfo fileInfo = f.at (j); - QString fn = fileInfo.fileName().toLower(); - if (fn.section (".",0,0) == name) - { - return new QPixmap (fileInfo.filePath()); - } - } - return 0; -} - -QString Skin::getPath (const QString& name) -{ - m_skin_dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = m_skin_dir.entryInfoList(); - bool nameHasExt = name.contains('.'); - for (int j = 0; j < f.size(); ++j) - { - QFileInfo fileInfo = f.at (j); - QString fn = fileInfo.fileName().toLower(); - if (!nameHasExt && fn.section (".",0,0) == name) - { - return fileInfo.filePath(); - } else if (nameHasExt && fn == name) - { - return fileInfo.filePath(); - } - } - return QString(); -} - - -void Skin::loadPLEdit() -{ - QString path = findFile("pledit.txt", m_skin_dir); - if (path.isEmpty()) - path = findFile("pledit.txt", ":/default"); - if (path.isEmpty()) - qFatal("Skin: invalid default skin"); - - QFile file(path); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) - qFatal("Skin: unable to open %s", qPrintable(path)); - - while (!file.atEnd ()) - { - QByteArray line = file.readLine (); - QList l = line.split ('='); - if (l.count () == 2) - { - m_pledit_txt[l[0].toLower () ] = l[1].trimmed(); - } - else if (line.length() == 0) - { - break; - } - } - if (!m_pledit_txt.keys().contains("mbbg")) - m_pledit_txt["mbbg"] = m_pledit_txt["normalbg"]; - if (!m_pledit_txt.keys().contains("mbfg")) - m_pledit_txt["mbfg"] = m_pledit_txt["normal"]; -} - -void Skin::loadEqMain() -{ - QPixmap *pixmap = getPixmap ("eqmain"); - - if (!pixmap) - pixmap = getDummyPixmap("eqmain"); - - m_eq_parts[ EQ_MAIN ] = pixmap->copy (0,0,275,116); - m_eq_parts[ EQ_TITLEBAR_A ] = pixmap->copy (0,134,275,14); - m_eq_parts[ EQ_TITLEBAR_I ] = pixmap->copy (0,149,275,14); - - if (pixmap->height() > 295) - m_eq_parts[ EQ_GRAPH ] = pixmap->copy (0,294,113,19); - else - m_eq_parts[ EQ_GRAPH ] = QPixmap(); - - for (int i = 0; i < 14; ++i) - { - m_eq_bar << pixmap->copy (13 + i*15,164,14,63); - } - for (int i = 0; i < 14; ++i) - { - m_eq_bar << pixmap->copy (13 + i*15,229,14,63); - } - buttons[ EQ_BT_BAR_N ] = pixmap->copy (0,164,11,11); - buttons[ EQ_BT_BAR_P ] = pixmap->copy (0,164+12,11,11); - - buttons[ EQ_BT_ON_N ] = pixmap->copy (69,119,28,12); - buttons[ EQ_BT_ON_P ] = pixmap->copy (128,119,28,12); - buttons[ EQ_BT_OFF_N ] = pixmap->copy (10, 119,28,12); - buttons[ EQ_BT_OFF_P ] = pixmap->copy (187,119,28,12); - - buttons[ EQ_BT_PRESETS_N ] = pixmap->copy (224,164,44,12); - buttons[ EQ_BT_PRESETS_P ] = pixmap->copy (224,176,44,12); - - buttons[ EQ_BT_AUTO_1_N ] = pixmap->copy (94,119,33,12); - buttons[ EQ_BT_AUTO_1_P ] = pixmap->copy (153,119,33,12); - buttons[ EQ_BT_AUTO_0_N ] = pixmap->copy (35, 119,33,12); - buttons[ EQ_BT_AUTO_0_P ] = pixmap->copy (212,119,33,12); - - buttons[ EQ_BT_CLOSE_N ] = pixmap->copy (0,116,9,9); - buttons[ EQ_BT_CLOSE_P ] = pixmap->copy (0,125,9,9); - buttons[ EQ_BT_SHADE1_N ] = pixmap->copy (254,137,9,9); - - for (int i = 0; i < 19; ++i) - { - m_eq_spline << pixmap->copy (115, 294+i, 1, 1); - } - delete pixmap; -} - -void Skin::loadEq_ex() -{ - QPixmap *pixmap = getPixmap ("eq_ex"); - - if (!pixmap) - pixmap = getDummyPixmap("eq_ex"); - - buttons[ EQ_BT_SHADE1_P ] = pixmap->copy (1,38,9,9); - buttons[ EQ_BT_SHADE2_N ] = pixmap->copy (254,3,9,9); - buttons[ EQ_BT_SHADE2_P ] = pixmap->copy (1,47,9,9); - m_eq_parts[ EQ_TITLEBAR_SHADED_A ] = pixmap->copy(0,0,275,14); - m_eq_parts[ EQ_TITLEBAR_SHADED_I ] = pixmap->copy(0,15,275,14); - m_eq_parts[ EQ_VOLUME1 ] = pixmap->copy(1,30,3,8); - m_eq_parts[ EQ_VOLUME2 ] = pixmap->copy(4,30,3,8); - m_eq_parts[ EQ_VOLUME3 ] = pixmap->copy(7,30,3,8); - m_eq_parts[ EQ_BALANCE1 ] = pixmap->copy(11,30,3,8); - m_eq_parts[ EQ_BALANCE2 ] = pixmap->copy(14,30,3,8); - m_eq_parts[ EQ_BALANCE3 ] = pixmap->copy(17,30,3,8); - - delete pixmap; -} - -void Skin::loadVisColor() -{ - QString path = findFile("viscolor.txt", m_skin_dir); - if (path.isEmpty()) - path = findFile("viscolor.txt", ":/default"); - if (path.isEmpty()) - qFatal("Skin: invalid default skin"); - - QFile file(path); - if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) - qFatal("Skin: unable to open %s", qPrintable(path)); - - int j = 0; - while (!file.atEnd () && j<24) - { - j++; - QByteArray line = file.readLine (); - QString tmp = QString::fromAscii (line); - tmp = tmp.trimmed (); - int i = tmp.indexOf ("//"); - if (i>0) - tmp.truncate (tmp.indexOf ("//")); - QStringList list = tmp.split (","); - if (list.count () >= 3) - { - //colors - int r = list.at (0).toInt(); - int g = list.at (1).toInt(); - int b = list.at (2).toInt(); - m_vis_colors << QColor (r,g,b); - } - else if (line.length() == 0) - { - break; - } - } - if (m_vis_colors.size() < 24) - { - qWarning ("Skin: cannot parse viscolor.txt"); - while (m_vis_colors.size() < 24) - m_vis_colors << QColor (0,0,0); - } -} - -void Skin::loadShufRep() -{ - QPixmap *pixmap = getPixmap ("shufrep"); - - if (!pixmap) - pixmap = getDummyPixmap("shufrep"); - - buttons[ BT_EQ_ON_N ] = pixmap->copy (0,73,23,12); - buttons[ BT_EQ_ON_P ] = pixmap->copy (46,73,23,12); - buttons[ BT_EQ_OFF_N ] = pixmap->copy (0,61,23,12); - buttons[ BT_EQ_OFF_P ] = pixmap->copy (46,61,23,12); - - buttons[ BT_PL_ON_N ] = pixmap->copy (23,73,23,12); - buttons[ BT_PL_ON_P ] = pixmap->copy (69,73,23,12); - buttons[ BT_PL_OFF_N ] = pixmap->copy (23,61,23,12); - buttons[ BT_PL_OFF_P ] = pixmap->copy (69,61,23,12); - - //buttons[ BT_PL_CLOSE_N ] = pixmap->copy (); - //buttons[ BT_PL_CLOSE_P ] = pixmap->copy (); - - buttons[REPEAT_ON_N] = pixmap->copy (0,30, 28, 15); - buttons[REPEAT_ON_P] = pixmap->copy (0,45, 28, 15); - - buttons[REPEAT_OFF_N] = pixmap->copy (0, 0,28,15); - buttons[REPEAT_OFF_P] = pixmap->copy (0,15,28,15); - - buttons[SHUFFLE_ON_N] = pixmap->copy (28,30,46,15); - buttons[SHUFFLE_ON_P] = pixmap->copy (28,45,46,15); - - buttons[SHUFFLE_OFF_N] = pixmap->copy (28, 0,46,15); - buttons[SHUFFLE_OFF_P] = pixmap->copy (28,15,46,15); - - delete pixmap; -} - -void Skin::loadLetters(void) -{ - QPixmap *img = getPixmap("text"); - - if (!img) - img = getDummyPixmap("text"); - - QList > (letters); - for (int i = 0; i < 3; i++) - { - QList (l); - for (int j = 0; j < 31; j++) - { - l.append (img->copy (j*5, i*6, 5, 6)); - } - letters.append (l); - } - - delete img; - - - /* alphabet */ - for (uint i = 97; i < 123; i++) - { - m_letters.insert(i, letters[0][i-97]); - } - - /* digits */ - for (uint i = 0; i <= 9; i++) - { - m_letters.insert (i+48, letters[1][i]); - } - - /* special characters */ - m_letters.insert('"', letters[0][27]); - m_letters.insert('@', letters[0][28]); - m_letters.insert(':', letters[1][12]); - m_letters.insert('(', letters[1][13]); - m_letters.insert(')', letters[1][14]); - m_letters.insert('-', letters[1][15]); - m_letters.insert('\'', letters[1][16]); - m_letters.insert('`', letters[1][16]); - m_letters.insert('!', letters[1][17]); - m_letters.insert('_', letters[1][18]); - m_letters.insert('+', letters[1][19]); - m_letters.insert('\\', letters[1][20]); - m_letters.insert('/', letters[1][21]); - m_letters.insert('[', letters[1][22]); - m_letters.insert(']', letters[1][23]); - m_letters.insert('^', letters[1][24]); - m_letters.insert('&', letters[1][25]); - m_letters.insert('%', letters[1][26]); - m_letters.insert('.', letters[1][27]); - m_letters.insert(',', letters[1][27]); - m_letters.insert('=', letters[1][28]); - m_letters.insert('$', letters[1][29]); - m_letters.insert('#', letters[1][30]); - - m_letters.insert(229, letters[2][0]); - m_letters.insert(246, letters[2][1]); - m_letters.insert(228, letters[2][2]); - m_letters.insert('?', letters[2][3]); - m_letters.insert('*', letters[2][4]); - m_letters.insert(' ', letters[2][5]); - - /* text background */ - //m_items->insert (TEXTBG, letters[2][6]); -} - -void Skin::loadMonoSter() -{ - QPixmap *pixmap = getPixmap("monoster"); - - if (!pixmap) - pixmap = getDummyPixmap("monoster"); - - m_ms_parts.clear(); - m_ms_parts[ MONO_A ] = pixmap->copy (29,0,27,12); - m_ms_parts[ MONO_I ] = pixmap->copy (29,12,27,12); - m_ms_parts[ STEREO_A ] = pixmap->copy (0,0,27,12); - m_ms_parts[ STEREO_I ] = pixmap->copy (0,12,27,12); - - delete pixmap; - - m_parts.clear(); - QPainter paint; - pixmap = getPixmap("playpaus"); - - if (!pixmap) - pixmap = getDummyPixmap("playpaus"); - - QPixmap part(11, 9); - paint.begin(&part); - paint.drawPixmap (0, 0, 3, 9, *pixmap, 36, 0, 3, 9); - paint.drawPixmap (3, 0, 8, 9, *pixmap, 1, 0, 8, 9); - paint.end(); - m_parts [PLAY] = part.copy(); - - part = QPixmap(11, 9); - paint.begin(&part); - paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); - paint.drawPixmap (2, 0, 9, 9, *pixmap, 9, 0, 9, 9); - paint.end(); - m_parts [PAUSE] = part.copy(); - - part = QPixmap(11, 9); - paint.begin(&part); - paint.drawPixmap (0, 0, 2, 9, *pixmap, 27, 0, 2, 9); - paint.drawPixmap (2, 0, 9, 9, *pixmap, 18, 0, 9, 9); - paint.end(); - m_parts [STOP] = part.copy(); - - delete pixmap; -} - -void Skin::loadVolume() -{ - QPixmap *pixmap = getPixmap("volume"); - - if (!pixmap) - pixmap = getDummyPixmap("volume"); - - m_volume.clear(); - for (int i = 0; i < 28; ++i) - m_volume.append(pixmap->copy (0,i*15, pixmap->width(),13)); - if (pixmap->height() > 425) - { - buttons [BT_VOL_N] = pixmap->copy (15,422,14, pixmap->height() - 422); - buttons [BT_VOL_P] = pixmap->copy (0, 422,14, pixmap->height() - 422); - } - else - { - buttons [BT_VOL_N] = QPixmap(); - buttons [BT_VOL_P] = QPixmap(); - } - delete pixmap; -} - -void Skin::loadBalance() -{ - QPixmap *pixmap = getPixmap ("balance"); - if (!pixmap) - pixmap = getPixmap ("volume"); - - if (!pixmap) - pixmap = getDummyPixmap("balance"); - - m_balance.clear(); - for (int i = 0; i < 28; ++i) - m_balance.append(pixmap->copy (9,i*15,38,13)); - if (pixmap->height() > 427) - { - buttons [BT_BAL_N] = pixmap->copy (15, 422,14,pixmap->height()-422); - buttons [BT_BAL_P] = pixmap->copy (0,422,14,pixmap->height()-422); - } - else - { - buttons [BT_BAL_N] = QPixmap(); - buttons [BT_BAL_P] = QPixmap(); - } - delete pixmap; -} - -void Skin::loadRegion() -{ - m_regions.clear(); - QString path = findFile("region.txt", m_skin_dir); - - if (path.isNull ()) - { - qDebug ("Skin: cannot find region.txt. Transparency disabled"); - return; - } - m_regions[NORMAL] = createRegion(path, "Normal"); - m_regions[EQUALIZER] = createRegion(path, "Equalizer"); - m_regions[WINDOW_SHADE] = createRegion(path, "WindowShade"); - m_regions[EQUALIZER_WS] = createRegion(path, "EqualizerWS"); -} - -QRegion Skin::createRegion(const QString &path, const QString &key) -{ - QRegion region; - QSettings settings(path, QSettings::IniFormat); - QStringList numPoints = settings.value(key+"/NumPoints").toStringList(); - QStringList value = settings.value(key+"/PointList").toStringList(); - QStringList numbers; - foreach(QString str, value) - numbers << str.split(" ", QString::SkipEmptyParts); - - QList regions; - - QList::iterator n; - n = numbers.begin(); - int r = m_double_size ? 2 : 1; - for (int i = 0; i < numPoints.size(); ++i) - { - QList lp; - for (int j = 0; j < numPoints.at(i).toInt()*2; j++) - { - lp << n->toInt(); - n ++; - } - QVector points; - - for (int l = 0; l < lp.size(); l+=2) - { - points << QPoint(lp.at(l)*r, lp.at(l+1)*r); - } - region = region.united(QRegion(QPolygon(points))); - } - return region; -} - -QPixmap * Skin::getDummyPixmap(const QString& name) -{ - QDir dir (":/default"); - dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = dir.entryInfoList(); - for (int j = 0; j < f.size(); ++j) - { - QFileInfo fileInfo = f.at (j); - QString fn = fileInfo.fileName().toLower(); - if (fn.section (".",0,0) == name) - { - return new QPixmap (fileInfo.filePath()); - } - } - qFatal("Skin: default skin is corrupted"); - return 0; -} - -QPixmap Skin::scalePixmap(const QPixmap &pix, int ratio) -{ - return pix.scaled(pix.width() * ratio, pix.height() * ratio, - Qt::KeepAspectRatio); -} - -const QString Skin::findFile(const QString &name, QDir dir) -{ - dir.setFilter (QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QString path; - QFileInfoList list = dir.entryInfoList(); - for (int i = 0; i < list.size(); ++i) - { - QFileInfo fileInfo = list.at (i); - if (fileInfo.fileName().toLower() == name) - { - path = fileInfo.filePath (); - break; - } - } - return path; -} - -const QString Skin::findFile(const QString &name, const QString &dir) -{ - return findFile(name, QDir(dir)); -} diff --git a/src/ui/skin.h b/src/ui/skin.h deleted file mode 100644 index adb4b6c20..000000000 --- a/src/ui/skin.h +++ /dev/null @@ -1,390 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * Based on Promoe, an XMMS2 Client * - * Copyright (C) 2005-2006 by XMMS2 Team * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef SKIN_H -#define SKIN_H - -#include -#include -#include -#include -#include -#include - -class Skin : public QObject -{ - Q_OBJECT -public: - Skin(QObject *parent = 0); - - ~Skin(); - - static Skin *instance(); - static QPixmap getPixmap(const QString&, QDir); - int ratio() - { - return m_double_size ? 2 : 1; - } - const QPixmap getMain() const - { - return m_main; - } - const QPixmap getButton(uint bt) const - { - return buttons[bt]; - } - const QCursor getCursor(uint cu) const - { - return cursors[cu]; - } - const QPixmap getTitleBar(uint tb) const - { - return titlebar[tb]; - } - const QPixmap getPosBar() const - { - return posbar; - } - const QPixmap getNumber(uint n) const - { - return m_numbers[n]; - } - /*! - * Returns count of numbers in number list. - * We need this to check if we have "-" in pixmaps. - * if no we should draw it manually. - */ - uint getNumCount(void) const - { - return m_numbers.count(); - } - const QPixmap getPlPart(uint p) const - { - return m_pl_parts[p]; - } - const QPixmap getEqPart(uint p) const - { - return m_eq_parts[p]; - } - const QPixmap getEqSlider(uint n) const - { - return m_eq_bar[n]; - } - const QPixmap getEqSpline(uint n) const - { - return m_eq_spline[n]; - } - const QPixmap getMSPart(uint n) const - { - return m_ms_parts[n]; - } - const QPixmap getLetter(const QChar& ch) const - { - return m_letters[ch]; - } - const QPixmap getItem(uint n) const - { - return m_parts[n]; - } - const QPixmap getVolumeBar(int n) const - { - return m_volume[n]; - } - const QPixmap getBalanceBar(int n) const - { - return m_balance[n]; - } - const QByteArray getPLValue (QByteArray c) const - { - return m_pledit_txt[c]; - } - const QColor getVisColor(int n) const - { - return m_vis_colors[n]; - } - const QRegion getRegion(uint r) const - { - return m_regions[r]; - } - - enum Buttons - { - BT_PREVIOUS_N = 0, - BT_PREVIOUS_P, - BT_PLAY_N, - BT_PLAY_P, - BT_PAUSE_N, - BT_PAUSE_P, - BT_STOP_N, - BT_STOP_P, - BT_NEXT_N, - BT_NEXT_P, - BT_EJECT_N, - BT_EJECT_P, - /*titlebar.* */ - BT_MENU_N, - BT_MENU_P, - BT_MINIMIZE_N, - BT_MINIMIZE_P, - BT_CLOSE_N, - BT_CLOSE_P, - BT_SHADE1_N, - BT_SHADE1_P, - BT_SHADE2_N, - BT_SHADE2_P, - BT_CLOSE_SHADED_N, - BT_CLOSE_SHADED_P, - - /* posbar.* */ - BT_POSBAR_N, - BT_POSBAR_P, - /* pledit.* */ - PL_BT_ADD, - PL_BT_SUB, - PL_BT_SEL, - PL_BT_SORT, - PL_BT_LST, - PL_BT_SCROLL_N, - PL_BT_SCROLL_P, - PL_BT_CLOSE_N, - PL_BT_CLOSE_P, - PL_BT_SHADE1_N, - PL_BT_SHADE1_P, - PL_BT_SHADE2_N, - PL_BT_SHADE2_P, - - /* eqmain.* */ - EQ_BT_BAR_N, - EQ_BT_BAR_P, - EQ_BT_ON_N, - EQ_BT_ON_P, - EQ_BT_OFF_N, - EQ_BT_OFF_P, - EQ_BT_PRESETS_N, - EQ_BT_PRESETS_P, - EQ_BT_AUTO_1_N, - EQ_BT_AUTO_1_P, - EQ_BT_AUTO_0_N, - EQ_BT_AUTO_0_P, - EQ_BT_CLOSE_N, - EQ_BT_CLOSE_P, - EQ_BT_SHADE1_N, - - /* eq_ex.* */ - EQ_BT_SHADE1_P, - EQ_BT_SHADE2_N, - EQ_BT_SHADE2_P, - - /* shufrep.* */ - BT_EQ_ON_N, - BT_EQ_ON_P, - BT_EQ_OFF_N, - BT_EQ_OFF_P, - BT_PL_ON_N, - BT_PL_ON_P, - BT_PL_OFF_N, - BT_PL_OFF_P, - BT_PL_CLOSE_N, - BT_PL_CLOSE_P, - REPEAT_ON_N, - REPEAT_ON_P, - REPEAT_OFF_N, - REPEAT_OFF_P, - SHUFFLE_ON_N, - SHUFFLE_ON_P, - SHUFFLE_OFF_N, - SHUFFLE_OFF_P, - /* volume.* */ - BT_VOL_N, - BT_VOL_P, - /* balance.* */ - BT_BAL_N, - BT_BAL_P, - }; - enum TitleBar - { - TITLEBAR_A = 0, - TITLEBAR_I, - TITLEBAR_SHADED_A, - TITLEBAR_SHADED_I, - }; - enum PlayList - { - PL_CORNER_UL_A = 0, - PL_CORNER_UL_I, - PL_CORNER_UR_A, - PL_CORNER_UR_I, - PL_TITLEBAR_A, - PL_TITLEBAR_I, - PL_TFILL1_A, - PL_TFILL1_I, - PL_TFILL2_A, - PL_TFILL2_I, - PL_LFILL, - PL_RFILL, - PL_LSBAR, - PL_RSBAR, - PL_SFILL1, - PL_SFILL2, - PL_CONTROL, - PL_TITLEBAR_SHADED1_A, - PL_TITLEBAR_SHADED1_I, - PL_TITLEBAR_SHADED2, - PL_TFILL_SHADED, - }; - enum Equalizer - { - EQ_MAIN = 0, - EQ_TITLEBAR_A, - EQ_TITLEBAR_I, - EQ_GRAPH, - EQ_TITLEBAR_SHADED_A, - EQ_TITLEBAR_SHADED_I, - EQ_VOLUME1, - EQ_VOLUME2, - EQ_VOLUME3, - EQ_BALANCE1, - EQ_BALANCE2, - EQ_BALANCE3, - }; - enum MonoSter - { - MONO_A = 0, - MONO_I, - STEREO_A, - STEREO_I, - }; - enum OtherParts - { - PLAY = 0, - PAUSE, - STOP, - }; - enum Regions - { - NORMAL = 0, - EQUALIZER, - WINDOW_SHADE, - EQUALIZER_WS, - }; - enum Cursors - { - CUR_NORMAL = 0, - CUR_CLOSE, - CUR_MAINMENU, - CUR_MIN, - CUR_POSBAR, - CUR_SONGNAME, - CUR_TITLEBAR, - CUR_VOLBAL, - CUR_WINBUT, - - CUR_WSNORMAL, - CUR_WSPOSBAR, - - CUR_EQCLOSE, - CUR_EQNORMAL, - CUR_EQSLID, - CUR_EQTITLE, - - CUR_PCLOSE, - CUR_PNORMAL, - CUR_PSIZE, - CUR_PTBAR, - CUR_PVSCROLL, - CUR_PWINBUT, - - CUR_PWSNORM, - CUR_PWSSIZE, - - CUR_VOLBAR, - CUR_WSCLOSE, - CUR_WSMIN, - CUR_WSWINBUT, - }; - -public slots: - void setSkin(const QString& path); - void reloadSkin(); - -signals: - void skinChanged(); - -private: - QPixmap *getPixmap(const QString&); - QString getPath(const QString&); - const QString findFile(const QString&, QDir); - const QString findFile(const QString&, const QString&); - - /*! - * As far as there is no standard in skin making we cannot be sure - * that all needful images we can find in skin :( This will cause - * segfaults and asserts. So to prevent this we need such method - * to load pixmap from default skin. - */ - QPixmap *getDummyPixmap(const QString&); - QPixmap scalePixmap(const QPixmap &pix, int ratio = 2); - static Skin *m_instance; - QDir m_skin_dir; - QMap buttons; - QMap cursors; - QMap titlebar; - QMap m_pl_parts; - QMap m_eq_parts; - QMap m_ms_parts; - QMap m_parts; - QMap m_letters; - QMap m_pledit_txt; - QMap m_regions; - QPixmap m_main; - QPixmap posbar; - QList m_numbers; - QList m_eq_bar; - QList m_eq_spline; - QList m_volume; - QList m_balance; - QList m_vis_colors; - bool m_use_cursors; - bool m_double_size; - - void loadMain(); - void loadButtons(); - void loadCursors(); - void loadTitleBar(); - void loadPosBar(); - void loadNumbers(); - void loadPlayList(); - void loadPLEdit(); - void loadEqMain(); - void loadEq_ex(); - void loadVisColor(); - void loadShufRep(); - void loadLetters(); - void loadMonoSter(); - void loadVolume(); - void loadBalance(); - void loadRegion(); - QRegion createRegion(const QString &path, const QString &key); -}; - -#endif diff --git a/src/ui/skinreader.cpp b/src/ui/skinreader.cpp deleted file mode 100644 index 390ac4b8b..000000000 --- a/src/ui/skinreader.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include "skinreader.h" - -SkinReader::SkinReader(QObject *parent) - : QObject(parent) -{ - m_process = new QProcess(this); - //create cache dir - QDir dir(QDir::homePath() +"/.qmmp/"); - dir.mkdir("cache"); - dir.cd("cache"); - dir.mkdir("thumbs"); - dir.mkdir("skin"); -} - - -SkinReader::~SkinReader() -{} - -void SkinReader::generateThumbs() -{ - m_previewMap.clear(); - QDir dir(QDir::homePath() +"/.qmmp/skins"); - dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = dir.entryInfoList(); - dir.setPath(qApp->applicationDirPath()+"/../share/qmmp/skins"); - dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); - f << dir.entryInfoList(); - QDir cache_dir(QDir::homePath() +"/.qmmp/cache/thumbs"); - cache_dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList d = cache_dir.entryInfoList(); - //clear removed skins from cache - foreach(QFileInfo thumbFile, d) - { - bool del = true; - foreach(QFileInfo fileInfo, f) - { - if (fileInfo.baseName () == thumbFile.baseName ()) - { - del = false; - break; - } - } - if (del) - { - qDebug("SkinReader: deleting %s from cache", - qPrintable(thumbFile.fileName ())); - - cache_dir.remove(thumbFile.fileName ()); - } - } - //add new skins to cache - foreach(QFileInfo fileInfo, f) - { - bool create = true; - foreach(QFileInfo thumbInfo, d) - { - if (fileInfo.baseName () == thumbInfo.baseName ()) - { - create = false; - break; - } - } - if (create) - { - qDebug("SkinReader: adding %s to cache", - qPrintable(fileInfo.fileName ())); - QString name = fileInfo.fileName ().toLower(); - - if (name.endsWith(".tgz") || name.endsWith(".tar.gz") || name.endsWith(".tar.bz2")) - untar(fileInfo.filePath (), cache_dir.absolutePath (), true); - if (name.endsWith(".zip") || name.endsWith(".wsz")) - unzip(fileInfo.filePath (), cache_dir.absolutePath (), true); - } - } - //add thumbs to map - cache_dir.refresh(); - d = cache_dir.entryInfoList(); - foreach(QFileInfo fileInfo, f) - { - foreach(QFileInfo thumbInfo, d) - { - if (fileInfo.baseName () == thumbInfo.baseName ()) - { - m_previewMap.insert(fileInfo.absoluteFilePath (), - thumbInfo.absoluteFilePath ()); - break; - } - } - } -} - -void SkinReader::unpackSkin(const QString &path) -{ - //remove old skin - QDir dir(QDir::homePath() +"/.qmmp/cache/skin"); - dir.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList f = dir.entryInfoList(); - foreach(QFileInfo file, f) - dir.remove(file.fileName()); - //unpack - if (path.endsWith(".tgz") || path.endsWith(".tar.gz") || path.endsWith(".tar.bz2")) - untar(path, QDir::homePath() +"/.qmmp/cache/skin", false); - if (path.endsWith(".zip") || path.endsWith(".wsz")) - unzip(path, QDir::homePath() +"/.qmmp/cache/skin", false); -} - -const QStringList SkinReader::skins() -{ - return m_previewMap.keys(); -} - -const QPixmap SkinReader::getPreview(const QString &skinPath) -{ - return QPixmap(m_previewMap.value(skinPath)); -} - -void SkinReader::untar(const QString &from, const QString &to, bool preview) -{ - QByteArray array; - QStringList args; - //list archive - args << "tf" <start("tar", args); - m_process->waitForFinished(); - array = m_process->readAllStandardOutput (); - QString str = QString(array); - QStringList outputList = str.split("\n", QString::SkipEmptyParts); - foreach(QString str, outputList) - { - str = str.trimmed(); - args.clear(); - if (!preview || (str.contains("/main.", Qt::CaseInsensitive) - || str.startsWith("main.", Qt::CaseInsensitive))) - { - args << "xvfk" << from << "-O" << str; - m_process->start("tar", args); - m_process->waitForStarted(); - m_process->waitForFinished(); - array = m_process->readAllStandardOutput (); - - QString name; - if (preview) - name = from.section('/',-1) + (".") + str.section('.', -1); - else - name = str.contains('/') ? str.section('/',-1).toLower() : str.toLower(); - - QFile file(to+"/"+name); - file.open(QIODevice::WriteOnly); - file.write(array); - file.close(); - } - } -} - -void SkinReader::unzip(const QString &from, const QString &to, bool preview) -{ - QStringList args; - if (preview) - { - args << "-C" << "-j" << "-o" << "-qq" << "-d" << to << from << "main.*" << "*/main.*"; - QProcess::execute("unzip", args); - QDir dir(to); - dir.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks); - QFileInfoList fileList = dir.entryInfoList(); - foreach(QFileInfo thumbInfo, fileList) - { - if (thumbInfo.fileName().startsWith("main.", Qt::CaseInsensitive)) - { - dir.rename(thumbInfo.fileName(), from.section('/', -1) + - "." + thumbInfo.suffix ()); - } - } - } - else - { - args << "-j" << "-o" << "-qq" << "-d" << to << from; - QProcess::execute("unzip", args); - } -} diff --git a/src/ui/skinreader.h b/src/ui/skinreader.h deleted file mode 100644 index e12e604a1..000000000 --- a/src/ui/skinreader.h +++ /dev/null @@ -1,52 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SKINREADER_H -#define SKINREADER_H - -#include -#include -#include - -/** - @author Ilya Kotov -*/ -class QProcess; - -class SkinReader : public QObject -{ - Q_OBJECT -public: - SkinReader(QObject *parent = 0); - - ~SkinReader(); - - void generateThumbs(); - void unpackSkin(const QString &path); - const QStringList skins(); - const QPixmap getPreview(const QString &skinPath); - -private: - QProcess *m_process; - void untar(const QString &from, const QString &to, bool preview); - void unzip(const QString &from, const QString &to, bool preview); - QMap m_previewMap; -}; - -#endif diff --git a/src/ui/stuff.qrc b/src/ui/stuff.qrc deleted file mode 100644 index cc1d83984..000000000 --- a/src/ui/stuff.qrc +++ /dev/null @@ -1,88 +0,0 @@ - - - - ../../COPYING - - txt/description_en.txt - txt/authors_en.txt - txt/thanks_en.txt - txt/translators_en.txt - - txt/authors_uk_UA.txt - txt/thanks_uk_UA.txt - txt/translators_uk_UA.txt - txt/description_uk_UA.txt - - txt/authors_zh_TW.txt - txt/thanks_zh_TW.txt - txt/translators_zh_TW.txt - txt/description_zh_TW.txt - - txt/description_cs.txt - txt/authors_cs.txt - txt/thanks_cs.txt - txt/translators_cs.txt - - txt/authors_ru.txt - txt/thanks_ru.txt - txt/translators_ru.txt - txt/description_ru.txt - - txt/authors_zh_CN.txt - txt/thanks_zh_CN.txt - txt/translators_zh_CN.txt - txt/description_zh_CN.txt - - txt/authors_de.txt - txt/thanks_de.txt - txt/translators_de.txt - txt/description_de.txt - - txt/authors_it.txt - txt/thanks_it.txt - txt/translators_it.txt - txt/description_it.txt - - txt/authors_tr.txt - txt/thanks_tr.txt - txt/translators_tr.txt - txt/description_tr.txt - - txt/authors_lt.txt - txt/thanks_lt.txt - txt/translators_lt.txt - txt/description_lt.txt - - txt/authors_nl.txt - txt/thanks_nl.txt - txt/translators_nl.txt - txt/description_nl.txt - - txt/authors_ja.txt - txt/thanks_ja.txt - txt/translators_ja.txt - txt/description_ja.txt - - txt/authors_es.txt - txt/thanks_es.txt - txt/translators_es.txt - txt/description_es.txt - - default/balance.png - default/eqmain.png - default/numbers.png - default/pledit.txt - default/text.png - default/volume.png - default/cbuttons.png - default/main.png - default/playpaus.png - default/posbar.png - default/titlebar.png - default/eq_ex.png - default/monoster.png - default/pledit.png - default/shufrep.png - default/viscolor.txt - - diff --git a/src/ui/symboldisplay.cpp b/src/ui/symboldisplay.cpp deleted file mode 100644 index e33533f08..000000000 --- a/src/ui/symboldisplay.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include - -#include "skin.h" - -#include "symboldisplay.h" - -SymbolDisplay::SymbolDisplay ( QWidget *parent, int digits ) - : PixmapWidget ( parent ), m_digits ( digits ), m_text(), m_max(0) -{ - m_alignment = Qt::AlignRight; - m_skin = Skin::instance(); - connect ( m_skin, SIGNAL ( skinChanged() ), this, SLOT (draw())); - draw(); - for (int i=0; igetLetter ( ' ' ); - int w = bg.size().width(); - int h = bg.size().height(); - QPixmap tmp ( m_digits*w,h ); - QPainter paint ( &tmp ); - int j; - for ( int i = 0; i < m_digits; ++i ) - { - if (m_alignment == Qt::AlignRight) // TODO: add align Center - { - j = str.size() -1 - i; - if ( j >= 0 ) - paint.drawPixmap ( ( m_digits-1-i ) *w,0,m_skin->getLetter ( str.at ( j ) ) ); - else - paint.drawPixmap ( ( m_digits-1-i ) *w,0,m_skin->getLetter ( ' ' ) ); - } - else - { - if (i < str.size()) - paint.drawPixmap ( i * w,0,m_skin->getLetter ( str.at ( i ) ) ); - else - paint.drawPixmap ( i * w,0,m_skin->getLetter ( ' ' ) ); - ; - } - } - setPixmap(tmp); -} - -void SymbolDisplay::display(int val) -{ - if (val < m_max) - display(QString::number(val)); - else - display(QString("%1h").arg(val/100)); -} - diff --git a/src/ui/symboldisplay.h b/src/ui/symboldisplay.h deleted file mode 100644 index 720bad315..000000000 --- a/src/ui/symboldisplay.h +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef SYMBOLDISPLAY_H -#define SYMBOLDISPLAY_H - -#include - -#include "pixmapwidget.h" - -/** - @author Vladimir Kuznetsov - */ - -class Skin; - -class SymbolDisplay : public PixmapWidget -{ - Q_OBJECT -public: - SymbolDisplay(QWidget *parent = 0, int digits = 3); - - ~SymbolDisplay(); - - void setAlignment(Qt::Alignment a) - { - m_alignment = a; - } - Qt::Alignment alignment()const - { - return m_alignment; - } - -public slots: - void display(const QString&); - void display(int); - -private slots: - void draw(); - -private: - Skin* m_skin; - QPixmap m_pixmap; - int m_digits; - QString m_text; - Qt::Alignment m_alignment; - int m_max; - -}; - -#endif diff --git a/src/ui/textscroller.cpp b/src/ui/textscroller.cpp deleted file mode 100644 index 1fac2a753..000000000 --- a/src/ui/textscroller.cpp +++ /dev/null @@ -1,314 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "skin.h" -#include "textscroller.h" - -#define SCROLL_SEP " *** " -#define TITLE_FORMAT "%if(%p&%t,%p - %t,%p%t)%if(%p&%t,,%f)%if(%l, - %l,)" - -TextScroller::TextScroller (QWidget *parent) - : QWidget (parent) -{ - m_pressed = false; - m_press_pos = 0; - m_metrics = 0; - m_defautText = QString("Qmmp ") + Qmmp::strVersion(); - m_core = SoundCore::instance(); - m_skin = Skin::instance(); - m_ratio = m_skin->ratio(); - - m_timer = new QTimer (this); - m_timer->setInterval(50); - m_timer->start(); - - m_menu = new QMenu(this); - m_scrollAction = m_menu->addAction(tr("Autoscroll Songname")); - m_scrollAction->setCheckable(true); - connect(m_scrollAction, SIGNAL(toggled(bool)), SLOT(updateText())); - connect(m_timer, SIGNAL (timeout()), SLOT (addOffset())); - connect(m_skin, SIGNAL(skinChanged()), SLOT(updateSkin())); - connect(m_core, SIGNAL(stateChanged(Qmmp::State)), SLOT(processState(Qmmp::State))); - connect(m_core, SIGNAL(metaDataChanged()), SLOT(processMetaData())); - //readSettings(); - updateSkin(); -} - -TextScroller::~TextScroller() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.setValue("TextScroller/autoscroll", m_scrollAction->isChecked()); - if(m_metrics) - delete m_metrics; -} - -void TextScroller::setText(const QString &text) -{ - m_sliderText = text; - updateText(); -} - -void TextScroller::clear() -{ - setText(QString()); -} - -void TextScroller::addOffset() -{ - if(!m_scroll) - { - m_timer->stop(); - return; - } - m_x1--; - m_x2--; - if(m_x1 < - m_pixmap.width()) - m_x1 = m_pixmap.width(); - if(m_x2 < - m_pixmap.width()) - m_x2 = m_pixmap.width(); - update(); -} - -void TextScroller::updateSkin() -{ - m_color.setNamedColor(m_skin->getPLValue("mbfg")); - setCursor(m_skin->getCursor(Skin::CUR_SONGNAME)); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - m_bitmap = settings.value("MainWindow/bitmap_font", false).toBool(); - m_ratio = m_skin->ratio(); - QString fontname = settings.value("MainWindow/Font").toString(); - m_font.fromString(fontname); - if (m_metrics) - delete m_metrics; - else - m_scrollAction->setChecked(settings.value("TextScroller/autoscroll", true).toBool()); - m_metrics = new QFontMetrics(m_font); - updateText(); -} - -void TextScroller::setProgress(int progress) -{ - m_bufferText = tr("Buffering: %1%").arg(progress); - updateText(); -} - -void TextScroller::hideEvent (QHideEvent *) -{ - m_timer->stop(); -} - -void TextScroller::showEvent (QShowEvent *) -{ - if (m_scroll) - m_timer->start(); -} - -inline void drawBitmapText(int x, int y, const QString &text, QPainter *paint, Skin *skin) -{ - QString lowertext = text.toLower(); - int chwidth, ypix; - { - QPixmap samplechar = skin->getLetter('a'); - chwidth = samplechar.width(); - ypix = y - samplechar.height(); - } - for (int i = 0; i < lowertext.size(); i++) - { - QPixmap pixchar = skin->getLetter(lowertext[i]); - paint->drawPixmap(x, ypix, pixchar); - x += chwidth; - } -} - -void TextScroller::paintEvent (QPaintEvent *) -{ - QPainter paint(this); - if(m_scroll) - { - paint.drawPixmap(m_x1,0, m_pixmap); - paint.drawPixmap(m_x2,0, m_pixmap); - } - else - paint.drawPixmap(4,0, m_pixmap); -} - -void TextScroller::mousePressEvent (QMouseEvent *e) -{ - if (e->button() == Qt::RightButton) - m_menu->exec(e->globalPos()); - else if (e->button() == Qt::LeftButton && m_scroll) - { - m_timer->stop(); - m_press_pos = e->x() - m_x1; - m_pressed = true; - } - else - QWidget::mousePressEvent(e); -} - -void TextScroller::mouseReleaseEvent (QMouseEvent *e) -{ - if(e->button() == Qt::RightButton) - m_menu->exec(e->globalPos()); - else if (e->button() == Qt::LeftButton && m_scroll) - m_timer->start(); - else - QWidget::mouseReleaseEvent(e); - m_pressed = false; -} - -void TextScroller::mouseMoveEvent (QMouseEvent *e) -{ - if (m_pressed) - { - int bound = m_pixmap.width(); - m_x1 = (e->x() - m_press_pos) % bound; - if (m_x1 > 0) - m_x1 -= bound; - m_x2 = m_x1 + m_pixmap.width(); - update(); - } - else - QWidget::mouseMoveEvent(e); -} - -void TextScroller::processState(Qmmp::State state) -{ - switch(state) - { - case Qmmp::Buffering: - { - connect(m_core, SIGNAL(bufferingProgress(int)), SLOT(setProgress(int))); - break; - } - case Qmmp::Playing: - { - disconnect(m_core, SIGNAL(bufferingProgress(int)), this, 0); - m_bufferText.clear(); - updateText(); - break; - } - case Qmmp::Paused: - { - break; - } - case Qmmp::Stopped: - { - m_bufferText.clear(); - m_titleText.clear(); - updateText(); - break; - } - default: - break; - } -} - -void TextScroller::processMetaData() -{ - MetaDataFormatter formater(TITLE_FORMAT); - if(m_core->state() == Qmmp::Playing) - { - m_titleText = formater.parse(m_core->metaData(), m_core->totalTime()/1000); - updateText(); - } -} - -void TextScroller::preparePixmap(const QString &text, bool scrollable) -{ - m_scroll = scrollable; - bool bitmap = m_bitmap && (text.toLatin1() == text.toLocal8Bit()); //use bitmap font if possible - if(scrollable) - { - int textWidth = m_bitmap ? QString(text + SCROLL_SEP).size() * 5 - : m_metrics->width(text + SCROLL_SEP); - int count = 150*m_ratio / textWidth + 1; - int width = count * textWidth; - QString fullText; - for(int i = 0; i < count; ++i) - { - fullText.append(text + SCROLL_SEP); - } - m_pixmap = QPixmap(width,15*m_ratio); - m_pixmap.fill(Qt::transparent); - QPainter painter(&m_pixmap); - painter.setPen(m_color); - painter.setFont(m_font); - if(m_bitmap) - drawBitmapText (0,12, fullText, &painter, m_skin); - else - painter.drawText (0,12, fullText); - m_x1 = 0; - m_x2 = m_pixmap.width(); - } - else - { - m_pixmap = QPixmap(150*m_ratio,15*m_ratio); - m_pixmap.fill(Qt::transparent); - QPainter painter(&m_pixmap); - painter.setPen(m_color); - painter.setFont(m_font); - if(bitmap) - drawBitmapText (0,12, text, &painter, m_skin); - else - painter.drawText (0,12, text); - } -} - -void TextScroller::updateText() //draw text according priority -{ - if(!m_sliderText.isEmpty()) - { - preparePixmap(m_sliderText); - m_timer->stop(); - } - else if(!m_bufferText.isEmpty()) - { - preparePixmap(m_bufferText); - m_timer->stop(); - } - else if (!m_titleText.isEmpty()) - { - preparePixmap(m_titleText, m_scrollAction->isChecked()); - m_timer->start(); - } - else if(!m_defautText.isEmpty()) - { - preparePixmap(m_defautText); - m_timer->stop(); - } - else - { - m_timer->stop(); - m_pixmap = QPixmap (150*m_ratio,15*m_ratio); - m_pixmap.fill(Qt::transparent); - m_scroll = false; - } - update(); -} diff --git a/src/ui/textscroller.h b/src/ui/textscroller.h deleted file mode 100644 index 3fe50bf7e..000000000 --- a/src/ui/textscroller.h +++ /dev/null @@ -1,81 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef TEXTSCROLLER_H -#define TEXTSCROLLER_H - -#include -#include - -class QTimer; -class QMenu; -class QAction; -class Skin; -class SoundCore; - -/** - @author Ilya Kotov -*/ -class TextScroller : public QWidget -{ -Q_OBJECT -public: - TextScroller(QWidget *parent = 0); - virtual ~TextScroller(); - - void setText(const QString &text); - -public slots: - void clear(); - -private slots: - void setProgress(int); - void addOffset(); - void updateSkin(); - void processState(Qmmp::State state); - void processMetaData(); - void updateText(); - -private: - void hideEvent(QHideEvent *); - void showEvent(QShowEvent *); - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void preparePixmap(const QString &text, bool scrollable = false); - QString m_defautText; - QString m_bufferText; - QString m_sliderText; - QString m_titleText; - QPixmap m_pixmap; - int m_x1, m_x2, m_ratio; - bool m_scroll, m_bitmap, m_pressed; - int m_press_pos; - QFont m_font; - QFontMetrics *m_metrics; - Skin *m_skin; - QColor m_color; - QTimer *m_timer; - QMenu *m_menu; - QAction *m_scrollAction; - SoundCore *m_core; -}; - -#endif diff --git a/src/ui/timeindicator.cpp b/src/ui/timeindicator.cpp deleted file mode 100644 index 02c185b36..000000000 --- a/src/ui/timeindicator.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include - -#include "skin.h" -#include "timeindicator.h" - -TimeIndicator::TimeIndicator (QWidget *parent) - : PixmapWidget (parent) -{ - m_skin = Skin::instance(); - m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); - m_elapsed = true; - m_time = m_songDuration = 0; - readSettings(); - m_needToShowTime = false; - updateSkin(); - reset(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - m_timer = new QTimer(this); - m_timer->setInterval(125); - m_timer->setSingleShot (true); - connect(m_timer, SIGNAL(timeout()),SLOT(reset())); -} - -void TimeIndicator::setTime (int t) -{ - m_time = t; - m_pixmap.fill (Qt::transparent); - int r = m_skin->ratio(); - QPainter paint (&m_pixmap); - - if (!m_elapsed) - { - t = m_songDuration - t; - paint.drawPixmap(r*2,0,m_skin->getNumber(10)); - } - if (t < 0) - t = 0; - - if(t > 3600) - t /= 60; - - paint.drawPixmap(r*13,0,m_skin->getNumber(t/600%10)); - paint.drawPixmap(r*26,0,m_skin->getNumber(t/60%10)); - paint.drawPixmap(r*43,0,m_skin->getNumber(t%60/10)); - paint.drawPixmap(r*56,0,m_skin->getNumber(t%60%10)); - - setPixmap (m_pixmap); - -} - -void TimeIndicator::reset() -{ - m_pixmap.fill (Qt::transparent); - QPainter paint (&m_pixmap); - setPixmap (m_pixmap ); -} - -void TimeIndicator::mousePressEvent(QMouseEvent* e) -{ - if (m_needToShowTime && e->button() & Qt::LeftButton) - { - m_elapsed = m_elapsed ? false : true; - setTime(m_time); - } - PixmapWidget::mousePressEvent(e); -} - -void TimeIndicator::setSongDuration(int d) -{ - m_songDuration = d; -} - -TimeIndicator::~TimeIndicator() -{ - writeSettings(); -} - - -void TimeIndicator::updateSkin() -{ - m_pixmap = QPixmap (65 * m_skin->ratio(),13 * m_skin->ratio()); - if (m_needToShowTime) - setTime(m_time); -} - -void TimeIndicator::readSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("Display"); - m_elapsed = settings.value("Elapsed",true).toBool(); - settings.endGroup(); -} - -void TimeIndicator::writeSettings() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.beginGroup("Display"); - settings.setValue("Elapsed",m_elapsed); - settings.endGroup(); -} - -void TimeIndicator::setNeedToShowTime(bool need) -{ - m_needToShowTime = need; - if (!need) - m_timer->start(); - else - m_timer->stop(); -} - -void TimeIndicator::mouseMoveEvent(QMouseEvent *) -{} - -void TimeIndicator::mouseReleaseEvent(QMouseEvent *) -{} - diff --git a/src/ui/timeindicator.h b/src/ui/timeindicator.h deleted file mode 100644 index 55e74c43f..000000000 --- a/src/ui/timeindicator.h +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef TIMEINDICATOR_H -#define TIMEINDICATOR_H - -#include "pixmapwidget.h" - -class QMouseEvent; -class QTimer; - -class Skin; - - -/** Class TimeIndicator - * @author Vladimir Kuznetsov - * - * Represents time indicator in the main display. Can show elapsed - * and rest time of song (mouse press on indicator changes mode) - */ -class TimeIndicator : public PixmapWidget -{ - Q_OBJECT -public: - TimeIndicator(QWidget *parent = 0); - ~TimeIndicator(); - void setTime ( int t ); - void setSongDuration(int); - void setNeedToShowTime(bool); - -protected: - virtual void mousePressEvent(QMouseEvent*); - virtual void mouseMoveEvent(QMouseEvent*); - virtual void mouseReleaseEvent(QMouseEvent*); - void writeSettings(); - void readSettings(); - -private slots: - void updateSkin(); - void reset(); - -private: - QPixmap m_pixmap; - Skin *m_skin; - int m_time; - int m_songDuration; - bool m_elapsed; - bool m_needToShowTime; - QTimer *m_timer; -}; - -#endif diff --git a/src/ui/titlebar.cpp b/src/ui/titlebar.cpp deleted file mode 100644 index 52ba97d32..000000000 --- a/src/ui/titlebar.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include - -#include "symboldisplay.h" -#include "skin.h" -#include "button.h" -#include "dock.h" -#include "titlebarcontrol.h" -#include "shadedvisual.h" -#include "display.h" -#include "titlebar.h" - -// TODO skin cursor with shade mode -TitleBar::TitleBar(QWidget *parent) - : PixmapWidget(parent) -{ - m_align = false; - m_skin = Skin::instance(); - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); - m_mw = qobject_cast(parent->parent()); - m_shaded = false; - m_shade2 = 0; - m_currentTime = 0; - m_control = 0; - m_visual = 0; - //buttons - m_menu = new Button(this,Skin::BT_MENU_N,Skin::BT_MENU_P, Skin::CUR_MAINMENU); - connect(m_menu,SIGNAL(clicked()),this,SLOT(showMainMenu())); - m_menu->move(6,3); - m_minimize = new Button(this,Skin::BT_MINIMIZE_N,Skin::BT_MINIMIZE_P, Skin::CUR_MIN); - connect(m_minimize, SIGNAL(clicked()), m_mw, SLOT(showMinimized())); - m_shade = new Button(this,Skin::BT_SHADE1_N,Skin::BT_SHADE1_P, Skin::CUR_WINBUT); - connect(m_shade, SIGNAL(clicked()), SLOT(shade())); - m_close = new Button(this,Skin::BT_CLOSE_N,Skin::BT_CLOSE_P, Skin::CUR_CLOSE); - connect(m_close, SIGNAL(clicked()), m_mw, SLOT(handleCloseRequest())); - setActive(false); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - if (settings.value("Display/shaded", false).toBool()) - shade(); - m_align = true; - setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); - updatePositions(); -} - -TitleBar::~TitleBar() -{ - QSettings settings(Qmmp::configFile(), QSettings::IniFormat); - settings.setValue("Display/shaded", m_shaded); -} - -void TitleBar::updatePositions() -{ - int r = m_skin->ratio(); - m_menu->move(r*6, r*3); - m_minimize->move(r*244, r*3); - m_shade->move(r*254, r*3); - m_close->move(r*264, r*3); - if(m_shade2) - m_shade2->move(r*254, r*3); - if(m_currentTime) - m_currentTime->move(r*127, r*4); - if(m_control) - m_control->move(r*168, r*2); - if(m_visual) - m_visual->move(r*79,r*5); -} - -void TitleBar::mousePressEvent(QMouseEvent* event) -{ - switch ((int) event->button ()) - { - case Qt::LeftButton: - m_pos = event->pos(); - Dock::instance()->calculateDistances(); - Dock::instance()->updateDock(); - break; - case Qt::RightButton: - m_mw->menu()->exec(event->globalPos()); - } -} - -void TitleBar::mouseReleaseEvent(QMouseEvent*) -{ - Dock::instance()->updateDock(); -} -void TitleBar::mouseMoveEvent(QMouseEvent* event) -{ - if (m_pos.x() < width() - m_skin->ratio() * 37) - { - QPoint npos = (event->globalPos()-m_pos); - Dock::instance()->move(m_mw, npos); - } -} - -void TitleBar::setActive(bool a) -{ - if (a) - { - if (m_shaded) - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); - else - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); - } - else - { - if (m_shaded) - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_I)); - else - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_I)); - } -} - -void TitleBar::updateSkin() -{ - setActive(false); - setCursor(m_skin->getCursor(Skin::CUR_TITLEBAR)); - updatePositions(); -} - -void TitleBar::showMainMenu() -{ - m_mw->menu()->exec(m_menu->mapToGlobal(m_menu->pos())); -} - -void TitleBar::shade() -{ - m_shaded = !m_shaded; - int r = m_skin->ratio(); - if (m_shaded) - { - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_SHADED_A)); - m_shade->hide(); - m_shade2 = new Button(this,Skin::BT_SHADE2_N, Skin::BT_SHADE2_P, Skin::CUR_WSNORMAL); - connect(m_shade2, SIGNAL(clicked()), SLOT(shade())); - m_shade2->show(); - m_currentTime = new SymbolDisplay(this, 6); - m_currentTime->show(); - m_currentTime->display("--:--"); - m_control = new TitleBarControl(this); - m_control->show(); - connect (m_control, SIGNAL (nextClicked()), m_mw, SLOT (next())); - connect (m_control, SIGNAL (previousClicked()), m_mw, SLOT (previous())); - connect (m_control, SIGNAL (playClicked()), m_mw, SLOT (play())); - connect (m_control, SIGNAL (pauseClicked()), m_mw, SLOT (pause())); - connect (m_control, SIGNAL (stopClicked()), m_mw, SLOT (stop())); - connect (m_control, SIGNAL (ejectClicked()), m_mw, SLOT (addFile())); - m_visual = new ShadedVisual(this); - Visual::add(m_visual); - m_visual->show(); - } - else - { - setPixmap(m_skin->getTitleBar(Skin::TITLEBAR_A)); - m_shade2->deleteLater(); - m_currentTime->deleteLater(); - m_control->deleteLater(); - Visual::remove(m_visual); - m_visual->deleteLater(); - m_shade2 = 0; - m_currentTime = 0; - m_control = 0; - m_visual = 0; - m_shade->show(); - } - qobject_cast (parent())->setMinimalMode(m_shaded); - if (m_align) - Dock::instance()->align(m_mw, m_shaded? -r*102: r*102); - updatePositions(); -} - -void TitleBar::mouseDoubleClickEvent (QMouseEvent *) -{ - TitleBar::shade(); -} - -QString TitleBar::formatTime (int sec) -{ - int minutes = sec / 60; - int seconds = sec % 60; - - QString str_minutes = QString::number (minutes); - QString str_seconds = QString::number (seconds); - - if (minutes < 10) str_minutes.prepend ("0"); - if (seconds < 10) str_seconds.prepend ("0"); - - return str_minutes + ":" + str_seconds; -} - -void TitleBar::setTime(qint64 time) -{ - if (!m_currentTime) - return; - if (time < 0) - m_currentTime->display("--:--"); - else - m_currentTime->display(formatTime(time/1000)); -} - diff --git a/src/ui/titlebar.h b/src/ui/titlebar.h deleted file mode 100644 index 55f59f7cc..000000000 --- a/src/ui/titlebar.h +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef TITLEBAR_H -#define TITLEBAR_H - -#include -#include - -#include "pixmapwidget.h" -#include "playlist.h" -#include "mainwindow.h" - -class MainWindow; -class QMouseEvent; -class Skin; -class Button; -class SymbolDisplay; -class TitleBarControl; -class ShadedVisual; - -/** - @author Ilya Kotov -*/ -class TitleBar : public PixmapWidget -{ -Q_OBJECT -public: - TitleBar(QWidget *parent = 0); - - ~TitleBar(); - - void setActive(bool); - -public slots: - void setTime(qint64 time); - -private slots: - void updateSkin(); - void showMainMenu(); - void shade(); - -private: - Skin *m_skin; - QPoint m_pos; - MainWindow *m_mw; - Button *m_menu; - Button *m_minimize; - Button *m_shade; - Button *m_shade2; - Button *m_close; - SymbolDisplay *m_currentTime; - QString formatTime (int); - bool m_shaded; - bool m_align; - TitleBarControl *m_control; - ShadedVisual *m_visual; - void updatePositions(); - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - void mouseDoubleClickEvent(QMouseEvent*); -}; - - - -#endif diff --git a/src/ui/titlebarcontrol.cpp b/src/ui/titlebarcontrol.cpp deleted file mode 100644 index d4f064c75..000000000 --- a/src/ui/titlebarcontrol.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include "skin.h" -#include "titlebarcontrol.h" - -TitleBarControl::TitleBarControl(QWidget *parent) : QWidget(parent) -{ - //setAutoFillBackground(true); - m_ratio = Skin::instance()->ratio(); - resize(m_ratio*57, m_ratio*10); - connect(Skin::instance(), SIGNAL(skinChanged()),SLOT(updateSkin())); -} - - -TitleBarControl::~TitleBarControl() -{ -} - -void TitleBarControl::mousePressEvent (QMouseEvent *) -{} - -void TitleBarControl::mouseReleaseEvent (QMouseEvent * event) -{ - QPoint pt = event->pos(); - if(QRect(0,0,m_ratio*8,m_ratio*10).contains(pt)) - emit previousClicked(); - else if(QRect(m_ratio*8,0,m_ratio*11,m_ratio*10).contains(pt)) - emit playClicked(); - else if(QRect(m_ratio*19,0,m_ratio*10,m_ratio*10).contains(pt)) - emit pauseClicked(); - else if(QRect(m_ratio*29,0,m_ratio*8,m_ratio*10).contains(pt)) - emit stopClicked(); - else if(QRect(m_ratio*37,0,m_ratio*10,m_ratio*10).contains(pt)) - emit nextClicked(); - else if(QRect(m_ratio*47,0,m_ratio*10,m_ratio*10).contains(pt)) - emit ejectClicked(); -} - -void TitleBarControl::mouseMoveEvent(QMouseEvent*) -{} - -void TitleBarControl::updateSkin() -{ - m_ratio = Skin::instance()->ratio(); - resize(m_ratio*57, m_ratio*10); -} diff --git a/src/ui/titlebarcontrol.h b/src/ui/titlebarcontrol.h deleted file mode 100644 index 3631cce1d..000000000 --- a/src/ui/titlebarcontrol.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2009 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef TITLEBARCONTROL_H -#define TITLEBARCONTROL_H - -#include - -class QMouseEvent; - -/** - @author Ilya Kotov -*/ -class TitleBarControl : public QWidget -{ -Q_OBJECT -public: - TitleBarControl(QWidget *parent = 0); - ~TitleBarControl(); - -signals: - void previousClicked(); - void nextClicked(); - void pauseClicked(); - void playClicked(); - void stopClicked(); - void ejectClicked(); - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); - -private slots: - void updateSkin(); - -private: - int m_ratio; - -}; - -#endif diff --git a/src/ui/togglebutton.cpp b/src/ui/togglebutton.cpp deleted file mode 100644 index 994ac9f20..000000000 --- a/src/ui/togglebutton.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2008 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * Based on Promoe, an XMMS2 Client * - * Copyright (C) 2005-2006 by XMMS2 Team * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "skin.h" -#include "togglebutton.h" -#include - -ToggleButton::ToggleButton ( QWidget *parent,uint on_n,uint on_p,uint off_n,uint off_p ) - : PixmapWidget ( parent ) -{ - m_on_n = on_n; - m_on_p = on_p; - m_off_n = off_n; - m_off_p = off_p; - m_on = false; - skin = Skin::instance(); - setON ( false ); - connect ( skin, SIGNAL ( skinChanged() ), this, SLOT ( updateSkin() ) ); -} - - -ToggleButton::~ToggleButton() -{} - -bool ToggleButton::isChecked() -{ - return m_on; -} - -void ToggleButton::updateSkin() -{ - //setPixmap ( skin->getButton ( name_normal ) ); - setON ( m_on ); -} - -void ToggleButton::click() -{ - m_on = !m_on; - setON (m_on); - emit clicked(m_on); -} - -void ToggleButton::setON ( bool on ) -{ - m_on = on; - if ( on ) - setPixmap ( skin->getButton ( m_on_n ) ); - else - setPixmap ( skin->getButton ( m_off_n ) ); -} -void ToggleButton::mousePressEvent ( QMouseEvent* ) -{ - m_cursorin = true; - m_old_on = m_on; - if ( m_on ) - setPixmap ( skin->getButton ( m_off_p ) ); - else - setPixmap ( skin->getButton ( m_on_p ) ); -} - -void ToggleButton::mouseReleaseEvent ( QMouseEvent* ) -{ - if ( m_cursorin ) { - m_on = !m_old_on; - setON ( m_on ); - emit clicked( m_on ); - } else { - m_on = m_old_on; - setON ( m_on ); - } -} - -void ToggleButton::mouseMoveEvent (QMouseEvent *e) -{ - if ( !m_cursorin && rect().contains(e->pos()) ) { - m_cursorin = true; - if ( m_old_on ) - setPixmap ( skin->getButton ( m_off_p ) ); - else - setPixmap ( skin->getButton ( m_on_p ) ); - } else if ( m_cursorin && !rect().contains(e->pos()) ) { - m_cursorin = false; - if ( m_old_on ) - setPixmap ( skin->getButton ( m_on_n ) ); - else - setPixmap ( skin->getButton ( m_off_n ) ); - } -} diff --git a/src/ui/togglebutton.h b/src/ui/togglebutton.h deleted file mode 100644 index 220d427cc..000000000 --- a/src/ui/togglebutton.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef TOGGLEBUTTON_H -#define TOGGLEBUTTON_H - -#include "pixmapwidget.h" - -/** - @author Ilya Kotov -*/ -class Skin; - -class ToggleButton : public PixmapWidget -{ -Q_OBJECT -public: - ToggleButton( QWidget *parent, uint on_n, uint on_p, uint off_n, uint off_p ); - - ~ToggleButton(); - - bool isChecked(); - -signals: - void clicked(bool); - -public slots: - void setON(bool); - void click(); - -private slots: - void updateSkin(); - -private: - Skin *skin; - bool m_cursorin, m_old_on; - uint m_on_n, m_on_p, m_off_n, m_off_p; - bool m_on; - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); -}; - - -#endif diff --git a/src/ui/ui.pro b/src/ui/ui.pro index 04478d48a..1f5b8f619 100644 --- a/src/ui/ui.pro +++ b/src/ui/ui.pro @@ -1,125 +1,16 @@ include(../../qmmp.pri) -FORMS += forms/configdialog.ui \ - forms/preseteditor.ui \ - forms/jumptotrackdialog.ui \ - forms/aboutdialog.ui \ - forms/addurldialog.ui \ - forms/playlistbrowser.ui \ - forms/popupsettings.ui \ - forms/shortcutdialog.ui -HEADERS += mainwindow.h \ - button.h \ - display.h \ - skin.h \ - titlebar.h \ - positionbar.h \ - number.h \ - playlist.h \ - listwidget.h \ - pixmapwidget.h \ - playlisttitlebar.h \ - configdialog.h \ - playlistslider.h \ - dock.h \ - eqwidget.h \ - eqtitlebar.h \ - eqslider.h \ - togglebutton.h \ - eqgraph.h \ - mainvisual.h \ - inlines.h \ - fft.h \ - textscroller.h \ - monostereo.h \ - playstatus.h \ - pluginitem.h \ - volumebar.h \ - balancebar.h \ - symboldisplay.h \ - playlistcontrol.h \ - qmmpstarter.h \ - eqpreset.h \ - preseteditor.h \ - jumptotrackdialog.h \ - aboutdialog.h \ - timeindicator.h \ - keyboardmanager.h \ - addurldialog.h \ - skinreader.h \ - visualmenu.h \ - titlebarcontrol.h \ - shadedvisual.h \ - shadedbar.h \ - builtincommandlineoption.h \ - cursorimage.h \ - playlistbrowser.h \ - playlistselector.h \ - popupwidget.h \ - popupsettings.h \ - windowsystem.h \ - lxdesupport.h \ - actionmanager.h \ - shortcutitem.h \ - shortcutdialog.h -SOURCES += mainwindow.cpp \ - mp3player.cpp \ - button.cpp \ - display.cpp \ - skin.cpp \ - titlebar.cpp \ - positionbar.cpp \ - number.cpp \ - playlist.cpp \ - listwidget.cpp \ - pixmapwidget.cpp \ - playlisttitlebar.cpp \ - configdialog.cpp \ - playlistslider.cpp \ - dock.cpp \ - eqwidget.cpp \ - eqtitlebar.cpp \ - eqslider.cpp \ - togglebutton.cpp \ - eqgraph.cpp \ - mainvisual.cpp \ - fft.c \ - textscroller.cpp \ - monostereo.cpp \ - playstatus.cpp \ - pluginitem.cpp \ - volumebar.cpp \ - balancebar.cpp \ - symboldisplay.cpp \ - playlistcontrol.cpp \ - qmmpstarter.cpp \ - eqpreset.cpp \ - preseteditor.cpp \ - jumptotrackdialog.cpp \ - aboutdialog.cpp \ - timeindicator.cpp \ - keyboardmanager.cpp \ - addurldialog.cpp \ - skinreader.cpp \ - visualmenu.cpp \ - titlebarcontrol.cpp \ - shadedvisual.cpp \ - shadedbar.cpp \ - builtincommandlineoption.cpp \ - cursorimage.cpp \ - playlistbrowser.cpp \ - playlistselector.cpp \ - popupwidget.cpp \ - popupsettings.cpp \ - windowsystem.cpp \ + +HEADERS += qmmpstarter.h \ + builtincommandlineoption.h \ + lxdesupport.h + +SOURCES += \ + qmmpstarter.cpp \ + builtincommandlineoption.cpp \ lxdesupport.cpp \ - actionmanager.cpp \ - shortcutitem.cpp \ - shortcutdialog.cpp -win32:HEADERS += ../qmmp/visual.h -unix { - HEADERS += - SOURCES += -} + main.cpp + + # Some conf to redirect intermediate stuff in separate dirs UI_DIR = ./.build/ui/ @@ -141,8 +32,7 @@ win32:LIBS += -L../../bin \ -lqmmp0 \ -lqmmpui0 INCLUDEPATH += ../ -RESOURCES = images/images.qrc \ - stuff.qrc +RESOURCES = images/images.qrc TEMPLATE = app unix { target.path = /bin @@ -182,7 +72,3 @@ TRANSLATIONS = translations/qmmp_ru.ts \ translations/qmmp_ja.ts \ translations/qmmp_es.ts \ translations/qmmp_sk.ts -x11 { - CONFIG += link_pkgconfig - PKGCONFIG += x11 -} diff --git a/src/ui/visualmenu.cpp b/src/ui/visualmenu.cpp deleted file mode 100644 index af8e936d2..000000000 --- a/src/ui/visualmenu.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include - -#include -#include - -#include "pluginitem.h" -#include "visualmenu.h" - -VisualMenu::VisualMenu(QWidget *parent) : QMenu(tr("Visualization"), parent) -{ - VisualFactory *factory = 0; - foreach(factory, *Visual::factories()) - { - VisualAction *act = new VisualAction(factory, this); - addAction(act); - } -} - -VisualMenu::~VisualMenu() -{ -} - -void VisualMenu::updateActions() -{ - for(int i = 0; i < Visual::factories()->size(); ++i) - { - actions()[i]->setChecked(Visual::isEnabled(Visual::factories()->at(i))); - } -} - -VisualAction::VisualAction(VisualFactory *factory, QWidget *parent) : - QAction(factory->properties().name, parent) -{ - setCheckable (true); - setChecked (Visual::isEnabled(factory)); - m_factory = factory; - connect(this, SIGNAL(triggered(bool)), SLOT(select(bool))); -} - -void VisualAction::select(bool select) -{ - Visual::setEnabled(m_factory, select); -} diff --git a/src/ui/visualmenu.h b/src/ui/visualmenu.h deleted file mode 100644 index 0039c7aaf..000000000 --- a/src/ui/visualmenu.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-2010 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef VISUALMENU_H -#define VISUALMENU_H - -#include -#include - -class VisualFactory; - -/** - @author Ilya Kotov -*/ -class VisualMenu : public QMenu -{ - Q_OBJECT -public: - VisualMenu(QWidget *parent = 0); - - ~VisualMenu(); - -public slots: - void updateActions(); -}; - -class VisualAction : public QAction -{ - Q_OBJECT -public: - VisualAction(VisualFactory *factory, QWidget *parent = 0); - -private slots: - void select(bool); - -private: - VisualFactory *m_factory; - -}; - -#endif diff --git a/src/ui/volumebar.cpp b/src/ui/volumebar.cpp deleted file mode 100644 index e0829e659..000000000 --- a/src/ui/volumebar.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include "skin.h" -#include "button.h" -#include "mainwindow.h" -#include "volumebar.h" - - -VolumeBar::VolumeBar(QWidget *parent) : PixmapWidget(parent) -{ - m_skin = Skin::instance(); - connect(m_skin, SIGNAL(skinChanged()), this, SLOT(updateSkin())); - setPixmap(m_skin->getVolumeBar(0)); - mw = qobject_cast(window()); - m_moving = false; - m_min = 0; - m_max = 100; - m_old = m_value = 0; - draw(false); -} - -VolumeBar::~VolumeBar() -{} - -void VolumeBar::mousePressEvent(QMouseEvent *e) -{ - m_moving = true; - press_pos = e->x(); - if(m_posx() && e->x()ratio()) - { - press_pos = e->x()-m_pos; - emit sliderPressed(); - } - else - { - m_value = convert(qMax(qMin(width()-18*m_skin->ratio(),e->x()-6*m_skin->ratio()),0)); - press_pos = 6*m_skin->ratio(); - emit sliderPressed(); - if (m_value != m_old) - emit sliderMoved(m_value); - } - draw(); -} - -void VolumeBar::mouseMoveEvent (QMouseEvent *e) -{ - if(m_moving) - { - int po = e->x(); - po = po - press_pos; - - if(0<=po && po<=width()-18*m_skin->ratio()) - { - m_value = convert(po); - draw(); - emit sliderMoved(m_value); - } - } -} - -void VolumeBar::mouseReleaseEvent(QMouseEvent*) -{ - m_moving = false; - draw(false); - m_old = m_value; - emit sliderReleased(); -} - -void VolumeBar::setValue(int v) -{ - if (m_moving || m_max == 0) - return; - m_value = v; - draw(false); -} - -void VolumeBar::setMax(int max) -{ - m_max = max; - draw(false); -} - -void VolumeBar::updateSkin() -{ - resize(m_skin->getVolumeBar(0).size()); - draw(false); - setCursor(m_skin->getCursor(Skin::CUR_VOLBAL)); -} - -void VolumeBar::draw(bool pressed) -{ - int p=int(ceil(double(m_value-m_min)*(width()-18*m_skin->ratio())/(m_max-m_min))); - m_pixmap = m_skin->getVolumeBar(27*(m_value-m_min)/(m_max-m_min)); - QPainter paint(&m_pixmap); - if(pressed) - paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_P)); - else - paint.drawPixmap(p,1,m_skin->getButton(Skin::BT_VOL_N)); - setPixmap(m_pixmap); - m_pos = p; -} - -int VolumeBar::convert(int p) -{ - return int(ceil(double(m_max-m_min)*(p)/(width()-18*m_skin->ratio())+m_min)); -} diff --git a/src/ui/volumebar.h b/src/ui/volumebar.h deleted file mode 100644 index 47d4dcb0d..000000000 --- a/src/ui/volumebar.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 by Ilya Kotov * - * forkotov02@hotmail.ru * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef VOLUMEBAR_H -#define VOLUMEBAR_H - -#include "pixmapwidget.h" - -class Skin; -class MainWindow; - -/** - @author Ilya Kotov -*/ -class VolumeBar : public PixmapWidget -{ -Q_OBJECT -public: - VolumeBar(QWidget *parent = 0); - - ~VolumeBar(); - - int value() - { - return m_value; - } - int isPressed() - { - return m_moving; - } - -public slots: - void setValue(int); - void setMax(int); - -signals: - void sliderMoved (int); - void sliderPressed(); - void sliderReleased(); - -private slots: - void updateSkin(); - -private: - Skin *m_skin; - bool m_moving; - int press_pos; - int m_max, m_min, m_pos, m_value, m_old; - QPixmap m_pixmap; - MainWindow *mw; - int convert(int); // value = convert(position); - void draw(bool pressed = true); - -protected: - void mousePressEvent(QMouseEvent*); - void mouseReleaseEvent(QMouseEvent*); - void mouseMoveEvent(QMouseEvent*); -}; - -#endif diff --git a/src/ui/windowsystem.cpp b/src/ui/windowsystem.cpp deleted file mode 100644 index 4b66ae025..000000000 --- a/src/ui/windowsystem.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*************************************************************************** - * Based on Licq * - * Copyright (C) 2006-2009 Licq developers * - * Copyright (C) 2011 Ilya Kotov * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "windowsystem.h" -#include -#ifdef Q_WS_X11 -#include -#include -#include -#include -#include -#endif - -#ifdef Q_WS_X11 -void WindowSystem::ghostWindow(WId win) -{ - Display* dsp = QX11Info::display(); - Window root = DefaultRootWindow(dsp); - - Atom win_state = XInternAtom(dsp, "_NET_WM_STATE", False); - Atom win_state_add = XInternAtom(dsp, "_NET_WM_STATE_ADD", False); - Atom win_state_settings[] = - { - XInternAtom(dsp, "_NET_WM_STATE_SKIP_TASKBAR", False), - XInternAtom(dsp, "_NET_WM_STATE_SKIP_PAGER", False) - }; - XChangeProperty(dsp, win, win_state, XA_ATOM, 32, PropModeReplace, - reinterpret_cast(&win_state_settings), 2); - - XEvent xev; - xev.type = ClientMessage; - xev.xclient.type = ClientMessage; - xev.xclient.display = dsp; - xev.xclient.window = win; - xev.xclient.message_type = win_state; - xev.xclient.format = 32; - xev.xclient.data.l[0] = win_state_add; - xev.xclient.data.l[1] = win_state_settings[0]; - xev.xclient.data.l[2] = win_state_settings[1]; - - XSendEvent(dsp, root, false, - SubstructureRedirectMask | SubstructureNotifyMask, &xev); -} - -QString WindowSystem::netWindowManagerName() -{ - Display* dsp = QX11Info::display(); - WId root = DefaultRootWindow(dsp); - - unsigned char* retValue1 = NULL; - unsigned char* retValue2 = NULL; - - retValue1 = getWindowProperty(root, "_NET_SUPPORTING_WM_CHECK"); - if (retValue1 == NULL) - return QString(); - - WId win = *(reinterpret_cast(retValue1)); - - retValue2 = getWindowProperty(win, "_NET_SUPPORTING_WM_CHECK"); - if (retValue2 == NULL) - { - XFree(retValue1); - return QString(); - } - - if (win != *(reinterpret_cast(retValue2))) - { - XFree(retValue1); - XFree(retValue2); - return QString(); - } - - XFree(retValue2); - retValue2 = NULL; - - retValue2 = getWindowProperty(win, "_NET_WM_NAME"); - XFree(retValue1); - if (retValue2 == NULL) - return QString(); - - QString name = QString((char *)retValue2); - XFree(retValue2); - return name; -} - -void WindowSystem::changeWinSticky(WId win, bool stick) -{ - qDebug("WindowSystem: setting sticky state of window 0x%lx to %s.", - static_cast(win), stick ? "true" : "false"); - Display* dsp = QX11Info::display(); - Window root = DefaultRootWindow(dsp); - - unsigned long desktop = ~(0UL); - - if (!stick) - { - unsigned char* tmp = getWindowProperty(root, "_NET_CURRENT_DESKTOP"); - - if (tmp == NULL) - qWarning("WindowSystem: error reading current desktop property."); - else - { - desktop = *(reinterpret_cast(tmp)); - XFree(tmp); - } - } - - XEvent xev; - xev.type = ClientMessage; - xev.xclient.type = ClientMessage; - xev.xclient.display = dsp; - xev.xclient.window = win; - xev.xclient.message_type = XInternAtom(dsp, "_NET_WM_DESKTOP", False); - xev.xclient.format = 32; - xev.xclient.data.l[0] = desktop; - - XSendEvent(dsp, root, False, - SubstructureRedirectMask | SubstructureNotifyMask, &xev); -} - -void WindowSystem::setWinHint(WId win, const char *res_name, const char *res_class) -{ - Display* dsp = QX11Info::display(); - XClassHint hint; - hint.res_name = strdup(res_name); - hint.res_class = strdup(res_class); - XSetClassHint(dsp, win, &hint); - free(hint.res_name); - free(hint.res_class); -} - -unsigned char* WindowSystem::getWindowProperty(WId win, const char* prop) -{ - Display* dsp = QX11Info::display(); - - // We inhibit new Atom creation since if you request for it - // then such Atom most probably exists already. - // Otherwise, no surprise we return NULL here. - Atom reqAtom = XInternAtom(dsp, prop, True); - - if (reqAtom == None) - return NULL; - - int retCheck = None; - Atom retType = None; - int retFormat = 0; - unsigned long retItems = 0UL; - unsigned long retMoreBytes = 0UL; - unsigned char* retValue = NULL; - - // Check if the property exists and calculate its length. - retCheck = XGetWindowProperty(dsp, win, - reqAtom, 0L, 0L, False, AnyPropertyType, - &retType, &retFormat, &retItems, &retMoreBytes, &retValue); - - // The value is most probably empty, since we requested to read - // only 0L length, thus, it's just useless... - if (retValue != NULL) - { - XFree(retValue); - retValue = NULL; - } - - if (retCheck != Success || - retType == None || - retMoreBytes == 0) - return NULL; - - // These are not needed for now. - retCheck = None; - retFormat = 0; - retItems = 0UL; - - // Convert the byte length into 32bit multiples. - if (retMoreBytes % 4 != 0) - retMoreBytes += 4 - retMoreBytes % 4; - retMoreBytes /= 4; - - // Now request the actual property value with correct length and type. - retCheck = XGetWindowProperty(dsp, win, - reqAtom, 0L, retMoreBytes, False, retType, - &retType, &retFormat, &retItems, &retMoreBytes, &retValue); - - if (retCheck != Success || - retMoreBytes != 0) - { - if (retValue != NULL) - XFree(retValue); - return NULL; - } - - return retValue; -} - -#endif diff --git a/src/ui/windowsystem.h b/src/ui/windowsystem.h deleted file mode 100644 index a9d8fb001..000000000 --- a/src/ui/windowsystem.h +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * Based on Licq * - * Copyright (C) 2006-2009 Licq developers * - * Copyright (C) 2011 Ilya Kotov * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef WINDOWSYSTEM_H -#define WINDOWSYSTEM_H - -#include - -class WindowSystem -{ -public: -#ifdef Q_WS_X11 - static void ghostWindow(WId id); - static QString netWindowManagerName(); - static void changeWinSticky(WId win, bool stick); - static void setWinHint(WId win, const char *res_name, const char *res_class); -private: - static unsigned char* getWindowProperty(WId win, const char* prop); -#endif -}; -#endif // WINDOWSYSTEM_H -- cgit v1.2.3-13-gbd6f