From cf3aef6b80b71f870aa872d5d1bc906254d9b8e6 Mon Sep 17 00:00:00 2001 From: Nikolay Tischenko Date: Mon, 27 Dec 2010 02:32:01 +0600 Subject: [PATCH] Ability to sort cur.playlist by long tap on it Manual sorting and autosorting: alphabet (asc/desc), artists/album, shuffle --- resources/black/arrow_bottom.png | Bin 0 -> 5743 bytes resources/black/arrow_top.png | Bin 0 -> 5720 bytes resources/black/sort_alpha_asc.png | Bin 0 -> 3431 bytes resources/black/sort_alpha_desc.png | Bin 0 -> 815 bytes resources/resources.qrc | 8 + resources/someplayer_ru.ts | 52 ++-- resources/white/arrow_bottom.png | Bin 0 -> 5745 bytes resources/white/arrow_top.png | Bin 0 -> 5711 bytes resources/white/sort_alpha_asc.png | Bin 0 -> 3367 bytes resources/white/sort_alpha_desc.png | Bin 0 -> 736 bytes someplayer.pro | 9 +- src/playerform.cpp | 31 ++- src/playerform.h | 5 + src/playlistsortform.cpp | 355 ++++++++++++++++++++++++ src/playlistsortform.h | 79 ++++++ src/track.cpp | 10 +- src/track.h | 4 +- src/trackrenderer.cpp | 7 +- src/ui/playerform.ui | 12 - src/ui/playlistsortform.ui | 523 +++++++++++++++++++++++++++++++++++ 20 files changed, 1051 insertions(+), 44 deletions(-) create mode 100644 resources/black/arrow_bottom.png create mode 100644 resources/black/arrow_top.png create mode 100644 resources/black/sort_alpha_asc.png create mode 100644 resources/black/sort_alpha_desc.png create mode 100644 resources/white/arrow_bottom.png create mode 100644 resources/white/arrow_top.png create mode 100644 resources/white/sort_alpha_asc.png create mode 100644 resources/white/sort_alpha_desc.png create mode 100644 src/playlistsortform.cpp create mode 100644 src/playlistsortform.h create mode 100644 src/ui/playlistsortform.ui diff --git a/resources/black/arrow_bottom.png b/resources/black/arrow_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..751d0131ed40600894c09904f8d76140c540b89e GIT binary patch literal 5743 zcmcIo2{@Er+kZrMp)8g3A48Iu)jExJ#+IECqB3S4V=yz!jI|O;luAuz3+8>uG!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Ig7grjDre;#gnp~)sh^$(3p^^C8O!#)k)6LY#(;{Na9 z>Qr^)R-5e6Y`Yw)JDBuI{oNjo|$=f?N~Hx{QCIE zo~7NfoK=%8&D9+dt42y|+-kObuo|}Rz;`D-wA?t=_2gaGA6x4p^2ge`?8n6ucC=2V zeN0ur|CV|vwK-8P@lBqog_+q4OU~rbw?cd?rFCVV^3<`Z<}&4_$k@*h-#l(<%W6BC zIhvV%m9ed0@^#&tWoJ5@>YG+vxfN-E-uz+x#PGFt)#(qjjBS_ zMdHLY2=U2p2R~oheC9~8i1>Z?^jl&oLQLZyB6)+8 zsurD6os~z!`5p96>mpNBYGDVWyRgiV3P4&y%o8y#wXmD1y~$WmO?Jf z0Ii4k*8`8jYnB&oJ|j^elF?jH{#S=9uiF2fyl?4xY`xP?T6VtN+0AFd5;OZA4DqbY z0xCL!6^;xOs=LKO{&4ulpvaWq3me>36cb5Gz1qh*==Gg^on6JU$g3%K$3?0{s=LcZ zAxM=(5v1q~(=xBfl;?*VO4LouRhPn7TtFIvKE1i7lJT{QFL*uM6BOTeyt6D*Z#Og_ zd=>w-;Mw^0ZOZKG?#LGO*Daa^V1XhZ5Q70Cl2-G6^4E!M(e7FGCI)!;`tb)X_sf0I PUILD`u7on1fcSp^q|W{j literal 0 HcmV?d00001 diff --git a/resources/black/sort_alpha_asc.png b/resources/black/sort_alpha_asc.png new file mode 100644 index 0000000000000000000000000000000000000000..1e5c9712acbab1ef21a79f3a6863cb9f5bf9fdc9 GIT binary patch literal 3431 zcmV-t4VdzYP)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4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r4z}+@}b9^3I!< zQ7Yo>g`NJTzA6&kZkH!6MJ$KF!x4TbV45aHR7h?Z1~2&~g8=~ZegCg%njE13?)$#` zL;%zG8-}sHUav}*bJH}r!c!!VizLH3u%S>rADCm|`+ja~A%tL^PKP3FpZ3rM0BE<{ zR0vU7@*)abGMV2+;iY^V*w!KE)d3}qy#A=wYSADF-bH~2LGYx21|bCV-pRu-bc^mj z3`10hnm9z#gx@;QAcSE4tl+o8p;54u)=AlGuV14^jT$vx;y;>08|SSbJ^}y$002ov JPDHLkV1h?ZUrPW0 literal 0 HcmV?d00001 diff --git a/resources/black/sort_alpha_desc.png b/resources/black/sort_alpha_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..03aae09d94ab871351a5db7694fbf5d9c82f565a GIT binary patch literal 815 zcmV+~1JL}5P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igo8 z5H%w1QtvSU00OT`L_t(&-tAf4s;WR3{oLE2A25sPhsq={tCyI0l=CP($~kW`zC_(B zNf88*H(n%qZrmID(fM&Y`&_tSput+YX4abdoB%3Rs8Hc2q5Q88wqCCh0N}Jsw%e^E zO~7ik%90m>>~=dxkbjdE005g;Tq-a5a=AoFl57|SYyf~;K$0Z*f&Z)j#PuOUo;F}< zys&K>2%!7<>JZUf8e#KBL} zme=RYKzj2cZ$6Hg$Sja_-}w5BDc9KrFocUHfC|@jovgswY<9=xd7dM*kr{?TTiVD& z%e9eV7)aEzc~E7H{(irA005@bDJf~AI{_^CkP%*v@8Zd1f@ID>p@8vtOtnuoPyj%+ z5$nz@MF2zLMttA@wuJBd4n+X7HDn0@j?rhf(P%V6Zx=8e4ypDz91gDnDaA&m1+dip zuW&pbS!{#{g8_P*fPTNv8(wZ3(Pp8P0G9BcPN%}Mplp~+ZDb591@85FxfkO&W~x$q zy&gHA&rX?*>`6ek+eL94V?|L|O5`#q+?j<1l&Jfqf^in_Gob4_?>lel_XJ(nk+clF z`<<7^M$(G8e<7mXZX?kjf6suXX^3HmB#NStcb_x}g_x!8R}^J)ybY5NI1mJW)sD6jDK)Re6kVOGRjgq6xBW~$LuTxUZc@K zyfg4wuh$U(&`!jDhhg|f^yzQ6o2RO(Ny&i;0B#gT4gf%{Rs#TV(}5#V6nRA t;H2!i4)s1^7&;>VEmWvbp+W^N`~^djP7AxCO~wEK002ovPDHLkV1h@8XQu!F literal 0 HcmV?d00001 diff --git a/resources/resources.qrc b/resources/resources.qrc index 2b1e138..9150bda 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -77,6 +77,14 @@ white/fav.png black/tags.png white/tags.png + black/sort_alpha_asc.png + white/sort_alpha_asc.png + black/sort_alpha_desc.png + white/sort_alpha_desc.png + black/arrow_bottom.png + black/arrow_top.png + white/arrow_top.png + white/arrow_bottom.png defaultcover.png diff --git a/resources/someplayer_ru.ts b/resources/someplayer_ru.ts index 577727e..fd01b5a 100644 --- a/resources/someplayer_ru.ts +++ b/resources/someplayer_ru.ts @@ -501,72 +501,72 @@ By Nikolay Tischenko (somebody)</p><p align="center"><b Выключение: 00:00:00 - + 0/0 0/0 - + <h3>Title</h3> <h3>Название</h3> - - + + 00:00 00:00 - + <b>Artist</b><br/>album <b>Исполнитель</b><br/>альбом - - + + Clear playlist Очистить плейлист - - + + Delete Удалить - - - - + + + + Add to favorites В избранное - - + + Enqueue В очередь - - + + Add to playlists Добавить в плейлисты - - + + Edit tags Редактировать теги - - + + Remove from favorites Удалить из избранного - + Delete track? Удалить трек? @@ -580,6 +580,14 @@ By Nikolay Tischenko (somebody)</p><p align="center"><b + PlaylistSortForm + + + Sorting + Сортировка + + + QObject diff --git a/resources/white/arrow_bottom.png b/resources/white/arrow_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..a37a8065342a064b2a1e0161b69cea94e5421d7d GIT binary patch literal 5745 zcmcIo2{@GP`hP|CEs;w4#*h%R*iB=dv2S5yX&p1KF`3QG$QB>TmcAsFEz%-ot0*ND z5|t3XHcKib_2G*|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G6} zp`7D6kx_`xJ-fTlR74DsTKo3MFvo7na$j{=&m|9SuHM|bef$P@ysUe0rPmFwtV@_( z^mp8M*x9sB*QTnIRavE#+XE{{!)vZZ_)iThLpF|hU87O_t;Je$HlhI zrcS2F;FhOkrZmS(#lO!rHZw7KZO)z<{#Jl%Be$vND$bsnZ7x+@g^Zeh{QhZcdq(@| z^zrnx+w^_;Gw*8OuesFSSl_t**8NaD^v;i4zmC*}^n@sno$Zrx9oPr^U1Kib^OZ@D zM+INg)}*D)2?=IQd?V@UbVL0njAZBT3;^L903bRR06xz_-@^b94E-PS-EIKDWB`C7 z^XRU-HUJ<{Vvn~Zgm(RvSx2w8khPvGcDG<#mH`6G8qoI3sWH+SavGYWupG5@D`2sb zR^uB8wQu~+iRyePtw~m<&i1~!{c7&oph}5BsWqO}{(0Z5(BI2KA~o}O?m*o5M%D%XxEnh5Vt zuhee7C4e>j`;o~t-;#oQ(Z_4VkjjsI+XSkO9*y;AS>X@#e=zR!H4@&RXngR@bk|sm zoUNO@;LG^wp&psyxtL_>ggeD=jDxCr4>Kn__n2Sq8+*V1rAxuex!_uFq;ZFSjge4D zRqu_r2e@62&QZhD{Z^*7SBupS+n?+^_CBM!GwnuzZAJHp)!n3snw@`*zwivdf4!Fx ziDTXFL!PXDsskQXy9EnHt@gg#_%+MG{;0!Ub$H;!aYvf_Z2!9O@tuye4*&9?KUT^l z;3yN8hLegVPXo7!uK&X(U;Q_E0N7gOxk4zVslVfjm^3Q}rI4Mdl_}%ym&Q)JogBFg wRkFt{Aj#Pmk=_QJ2h7yd?!y}tkDP*<@^`CuYn4lVfHoPhw|2poTJ7Hd4;0}CQ2+n{ literal 0 HcmV?d00001 diff --git a/resources/white/arrow_top.png b/resources/white/arrow_top.png new file mode 100644 index 0000000000000000000000000000000000000000..8a66151792fd0577d80afcaf1d2710e8d403e022 GIT binary patch literal 5711 zcmcIo2{@E%`+r6DEm@Lu#*idtvt=6F%-FJpkHou~aq_L7}mIKtvcb5Sj-7o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W~MjYDr|Zc7&6E^zPaRF}2r){NGA>NDjvyc-!-AY?lie>D7Oo@+B@y&0Hz* zaEW5KN~+SYojN^X!)o#D2Y1qYPF~9|Y^b2M`nLOyzUtG@-XVLsAoW$MEKBBj*EN~` zZP&&=ezNXHrZ($zR~{@URGhzqyIBS1-fwB%Y(cs}`at?ZG9GX5y-s;H#cCT@+gJ6; z@XsgRJE|sU%fk?#X9`EjR<@-jcE&Y4t*za!1^9I_j=Z=hQuG-wP^ZiZU`_k^=m7X^}GcIHI zFyHXr;AT@gT$(D+RA!V^?DVe~kEp)B&v$ZEE!(7}_d|8~U&?b&pJbbw^;S-lwWO=!+UTaWFeXzan( z+2oH&a)jkc=}8acWa8dtZ!$MEeQCj&8U30|Xr;AkXRFMfn|)ZKqKu53dh+&JOIupo z+0^%`DR-FrFV4KFd8>N4yRoiu?d|(v2I$=%woQ-KhW3Q2zdPSA=Q6Y(_N&gE-{-3z z-5=*pr>Lf+%!vr6O?;&q=yyZ+O&HbA%?SV^)&W4&K>+wX2YrtMKrr+>=fzXo|wSHCk~j7xUA7kaXYv3D7sT;!?1MCnwk^nPmIy5JHMRlwiym@nZTunHZvs@ z$-Bg9UX5jXDRLP%cEg<9voGa;JspWaD z%*mI!tc7b``J3dKR{E~6bpzA4{fIAk*z~%MiII1ZJQ3`z_1h1LMco}caNWUwS<_&f z_I`@O!CK2ryUx}RypY^&FC9-9AbQ{FuZ;6lINxSRR_YuJX^rtz82pP&mIxC52XN(P zmcR1Lv5;;N$kR$*yjZC#z}TsNV_-3WojczKgm`k?iiO z-I2?*ESD+zY}Zi8k#|pE#M(vS9W}Itpizh9%!twnx01Cp;92}-$JSX@U@ueL>a9t; Q1+;~Ly|pv31n(X5Puk7%_5c6? literal 0 HcmV?d00001 diff --git a/resources/white/sort_alpha_asc.png b/resources/white/sort_alpha_asc.png new file mode 100644 index 0000000000000000000000000000000000000000..6ccdc5e48aacf3d348798b40a7a14e98ffeadef4 GIT binary patch literal 3367 zcmV+?4c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2kdPSxH1e zRA}DqSk11oFchqWg-a6D7`4Egw2$U}v-U|)5k-w55{>TqZMc3YKRuMFqXD+ zW=?xrgbWM}3=BG8pz_h<@gN8x3h2s)!y(r&N9{Ov+kx-*I}t)GfdrNaAteGr2%3N2 zIF7A2FzwqKLI_YlOJ(2|joxlIqDr9Hv=F#nuS5tz+YrbV>y3c@jrQrqLRprzjs8=G zEX&9@SV%Scy{cxR&p=59Z3Hfti_AVOZ`zVsYZ3#Jmlf>tT}hm#sWkdI0jUaUnv#zv z@vr<%1RTfVj^l8hHquEz+FJCb=ku9-j6gn_%=@h2ckf%O)zv<(>prVQ*L7t!0w<>y z1tbfpj5fqZr_+h_P9UG8(LSTmhy!fZtBtG<_Nn}CJRU=AM32WK=}m#d;Q-zHRd+7w zmfDE`BzY&3Nz+x4bxr18?gK?1CrQ$^44_Gpu<3NlyW~KLz<$3cfD=|9{E|TtLKI{C6GagNIDlb{d6fc?Ti0^2 zShU*q@>Dy&v3;(1=33e5Aok^`(T3?b2HzV9m^`M&RiY}BAaZ2)ax4bL=e xm#pT1D$NrF0T08lnD{IR0*(v}3=9l(;~!6(4Sm26#lZjo002ovPDHLkV1n-mMt1-J literal 0 HcmV?d00001 diff --git a/resources/white/sort_alpha_desc.png b/resources/white/sort_alpha_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..449280c42dfd2a3316153367174a227d4f2cc47b GIT binary patch literal 736 zcmV<60w4W}P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igo8 z5H%Db=z6FC00Ll1L_t(&-tAeo`rF9s!u?)q); z1`+5?sroHA3CSgTPdPJlrc-3BLx&C>eu>`y`e2X80~ljGzZHYQATTDNMBaqjg%SLI zQ2=Aiuj1-c$?x|&NGW}!0G}~N79geMCI09A8<(X+o?i@eQITaC)bR5x%fN&H%EfQD z8yE@@&oiShAWc)CM89s)7W_O-Q_%K6MQs`dg8$76=nN!DLXG}k)RH6tgZwXiloHa7 zKKB23scnj4J1*S6@LB9TKxLukfvfIm9=KkwpfF=GI;h&M;qae-m)Gm{dM}@o1R%_% z5}?FzI1GvcFPF;;*Jv~fv^KIhj#cJ*rdLQQMU(mBI0iyTLT!i^Ci*G?wrvNtZ3ij= zls&GA!3-?%uEL(FEgpp6IK1nhP@Kg@Ayr@>mz4)VZd+2_d3dT7K=ro^V>p)4jnplAmJYZJ!kaP S(Vrdw0000setItem(i, 1, new QStandardItem(t)); + _model->setItem(i, 0, new QStandardItem("##arrow_r.png")); } } @@ -111,9 +112,12 @@ PlayerForm::PlayerForm(Library* lib, QWidget *parent) : _cover->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); _cover->setPixmap(QPixmap::fromImage(_coverfinder->defaultCover())); + _pls_sort_form = new PlaylistSortForm(parent); + _pls_sort_form->hide(); + connect(ui->libraryButton, SIGNAL(clicked()), this, SLOT(_library())); connect(ui->viewButton, SIGNAL(clicked()), this, SLOT(_toggle_view())); - connect(ui->playlistView, SIGNAL(activated(QModelIndex)), this, SLOT(_process_click(QModelIndex))); + connect(ui->playlistView, SIGNAL(clicked(QModelIndex)), this, SLOT(_process_click(QModelIndex))); connect(ui->playpauseButton, SIGNAL(clicked()), _player, SLOT(toggle())); connect(ui->nextButton, SIGNAL(clicked()), _player, SLOT(next())); connect(ui->stopButton, SIGNAL(clicked()), _player, SLOT(stop())); @@ -123,7 +127,7 @@ PlayerForm::PlayerForm(Library* lib, QWidget *parent) : connect(ui->randomButton, SIGNAL(clicked()), this, SLOT(_toggle_random())); connect(ui->repeatButton, SIGNAL(clicked()), this, SLOT(_toggle_repeat())); connect(ui->seekSlider, SIGNAL(sliderMoved(int)), _player, SLOT(seek(int))); - connect(ui->playlistView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(_custom_context_menu_requested(QPoint))); + connect(ui->playlistView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(_sort_playlist())); connect(__clear_playlist, SIGNAL(triggered()), this, SIGNAL(clearPlaylist())); connect(__delete_action, SIGNAL(triggered()), this, SLOT(_delete_track())); connect(__enqueue_action, SIGNAL(triggered()), this, SLOT(_enqueue_track())); @@ -150,6 +154,7 @@ PlayerForm::PlayerForm(Library* lib, QWidget *parent) : connect(_cover, SIGNAL(clicked()), this, SLOT(_toggle_extra_buttons())); connect(_player, SIGNAL(startPlaylist()), this, SLOT(_start_playlist())); connect(_player, SIGNAL(saveLastPlayed(LastPlayed)), _lib, SLOT(saveLastPlayedForCurPlaylist(LastPlayed))); + connect(_pls_sort_form, SIGNAL(playlistChanged()), this, SLOT(_playlist_sorted())); ui->viewButton->setIcon(QIcon(":/icons/"+_icons_theme+"/playback.png")); _top_gradient = ui->topWidget->styleSheet(); _bottom_gradient = ui->bottomWidget->styleSheet(); @@ -209,6 +214,9 @@ void PlayerForm::_toggle_view() { } void PlayerForm::_process_click(QModelIndex index) { + if (_pls_sort_form->isVisible()) { + return; + } if (index.column() == 1) { int id = index.row(); _player->setTrackId(id); @@ -503,6 +511,7 @@ void PlayerForm::landscapeMode() { } else { ui->moreButton->setIcon(QIcon(":/icons/"+_icons_theme+"/more.png")); } + _pls_sort_form->landscapeMode(); } void PlayerForm::portraitMode() { @@ -578,6 +587,7 @@ void PlayerForm::portraitMode() { } else { ui->moreButton->setIcon(QIcon(":/icons/"+_icons_theme+"/more.png")); } + _pls_sort_form->portraitMode(); } void PlayerForm::_tools_widget_toggle() { @@ -646,6 +656,7 @@ void PlayerForm::updateIcons() { } else { ui->randomButton->setIcon(QIcon(":/icons/"+_icons_theme+"/random_off.png")); } + _pls_sort_form->updateIcons(); } void PlayerForm::checkGradient() { @@ -657,6 +668,7 @@ void PlayerForm::checkGradient() { ui->topWidget->setStyleSheet(""); ui->bottomWidget->setStyleSheet(""); } + _pls_sort_form->updateGradiend(); } void PlayerForm::play(Track track) { @@ -753,6 +765,7 @@ void PlayerForm::updateTranslations() { __enqueue_action->setText(tr("Enqueue")); __add_to_playlists->setText(tr("Add to playlists")); __edit_tags->setText(tr("Edit tags")); + _pls_sort_form->updateTranslations(); } void PlayerForm::updateTrackColor() { @@ -786,3 +799,17 @@ void PlayerForm::_start_playlist() { _player->setTrackId(lp.trackId); _player->setAwaitingSeek(lp.position); } + +void PlayerForm::_sort_playlist() { + _pls_sort_form->setPlaylist(_current_playlist); + _pls_sort_form->show(); +} + +void PlayerForm::_playlist_sorted() { + _current_playlist = _pls_sort_form->getPlaylist(); + _lib->saveCurrentPlaylist(_current_playlist); + _player->setPlaylist(_current_playlist); + __fill_list(_model, _current_playlist); + ui->playlistView->setColumnWidth(0, 50); + _track_renderer->setActiveRow(_current_playlist.tracks().indexOf(_player->current())); +} diff --git a/src/playerform.h b/src/playerform.h index a5fa890..9606b77 100644 --- a/src/playerform.h +++ b/src/playerform.h @@ -35,6 +35,7 @@ #include "toolswidget.h" #include "coverfinder.h" #include "clickablelabel.h" +#include "playlistsortform.h" namespace Ui { class PlayerForm; @@ -116,6 +117,8 @@ private slots: void _display_cover(QImage); void _toggle_extra_buttons(); void _start_playlist(); + void _sort_playlist(); + void _playlist_sorted(); private: Ui::PlayerForm *ui; @@ -150,6 +153,8 @@ private: int _search_current_id; DBusAdaptop *_dbusadaptor; + + PlaylistSortForm *_pls_sort_form; }; #endif // PLAYERFORM_H diff --git a/src/playlistsortform.cpp b/src/playlistsortform.cpp new file mode 100644 index 0000000..e39a455 --- /dev/null +++ b/src/playlistsortform.cpp @@ -0,0 +1,355 @@ +/* + * SomePlayer - An alternate music player for Maemo 5 + * Copyright (C) 2010 Nikolay (somebody) Tischenko + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "playlistsortform.h" +#include "ui_playlistsortform.h" +#include +#include "track.h" +#include +#include "config.h" + +using namespace SomePlayer::DataObjects; +using namespace SomePlayer::Storage; + +inline void __fill_model(QStandardItemModel *_model, Playlist playlist) { + _model->clear(); + QList tracks = playlist.tracks(); + int count = tracks.count(); + _model->setRowCount(count); + _model->setColumnCount(2); + QTime time; + for (int i = 0; i < count; i++) { + TrackMetadata meta = tracks.at(i).metadata(); + time.setHMS(0, meta.length()/60, meta.length() % 60); + QString t = meta.title()+"#_#"+meta.artist()+"#_#"+meta.album()+"#_#"+time.toString("mm:ss"); + _model->setItem(i, 1, new QStandardItem(t)); + _model->setItem(i, 0, new QStandardItem("##deselect_all.png")); + } +} + +PlaylistSortForm::PlaylistSortForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::PlaylistSortForm) +{ + ui->setupUi(this); + setAttribute(Qt::WA_Maemo5StackedWindow); + setWindowFlags(Qt::Window | windowFlags()); + _track_renderer = new TrackRenderer(this); + _track_renderer->setActiveRow(-1); + _track_renderer->setSearchRow(-1); + ui->playlistView->setItemDelegateForColumn(0, _track_renderer); + ui->playlistView->setItemDelegateForColumn(1, _track_renderer); + _model = new QStandardItemModel(this); + ui->playlistView->setModel(_model); + _top_gradient = ui->topWidget->styleSheet(); + _bottom_gradient = ui->bottomWidget->styleSheet(); + + connect(ui->doneButton, SIGNAL(clicked()), this, SLOT(done())); + connect(ui->playlistView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + this, SLOT(_process_selection(QItemSelection,QItemSelection))); + connect(ui->moveDownButton, SIGNAL(clicked()), this, SLOT(moveDown())); + connect(ui->moveTopButton, SIGNAL(clicked()), this, SLOT(moveUp())); + connect(ui->sortAlphAscButton, SIGNAL(clicked()), this, SLOT(sortAlphAsc())); + connect(ui->sortAlphDescButton, SIGNAL(clicked()), this, SLOT(sortAlphDesc())); + connect(ui->shuffleButton, SIGNAL(clicked()), this, SLOT(shuffle())); + connect(ui->artistsButton, SIGNAL(clicked()), this, SLOT(sortArtist())); +} + +PlaylistSortForm::~PlaylistSortForm() +{ + delete ui; +} + +void PlaylistSortForm::done() { + emit playlistChanged(); + hide(); +} + +void PlaylistSortForm::setPlaylist(Playlist playlist) { + _playlist = playlist; + updateView(); +} + +Playlist PlaylistSortForm::getPlaylist() { + return _playlist; +} + +void PlaylistSortForm::updateView() { + __fill_model(_model, _playlist); + ui->playlistView->setColumnWidth(0, 50); +} + +void PlaylistSortForm::_process_selection(QItemSelection selected, QItemSelection deselected) { + foreach (QModelIndex id, selected.indexes()) { + if (id.column() == 0) { + _model->item(id.row(), 0)->setText("##select_all.png"); + } + ui->playlistView->selectionModel()->select(id, QItemSelectionModel::Select); + } + foreach (QModelIndex id, deselected.indexes()) { + if (id.column() == 0) { + _model->item(id.row(), 0)->setText("##deselect_all.png"); + } + ui->playlistView->selectionModel()->select(id, QItemSelectionModel::Deselect); + } +} + +void PlaylistSortForm::moveDown() { + QModelIndexList idx = ui->playlistView->selectionModel()->selectedIndexes(); + if (idx.isEmpty()) { + return; + } + QList rows; + foreach (QModelIndex id, idx) { + if (id.column() == 1) { + rows << id.row(); + } + } + _move(rows, 1); +} + +void PlaylistSortForm::moveUp() { + QModelIndexList idx = ui->playlistView->selectionModel()->selectedIndexes(); + if (idx.isEmpty()) { + return; + } + QList rows; + foreach (QModelIndex id, idx) { + if (id.column() == 1) { + rows << id.row(); + } + } + _move(rows, -1); +} + +void PlaylistSortForm::sortAlphAsc() { + QList tracks = _playlist.tracks(); + qSort(tracks); + _playlist.setTracks(tracks); + updateView(); +} + +void PlaylistSortForm::sortAlphDesc() { + QList tracks = _playlist.tracks(); + qSort(tracks); + for(int i = 0; i < (tracks.size()/2); i++) { + tracks.swap(i,tracks.size()-(1+i)); + } + _playlist.setTracks(tracks); + updateView(); +} + +void PlaylistSortForm::sortArtist() { + QList tracks = _playlist.tracks(); + QList ntracks; + // first step: artists + QMap > artists_tracks; + foreach (Track t, tracks) { + artists_tracks[t.metadata().artist()].append(t);; + } + // second step: albums; + QMap > album_tracks; + QList artists = artists_tracks.keys(); + qSort(artists); + foreach (QString artist, artists) { + album_tracks.clear(); + foreach (Track t, artists_tracks[artist]) { + album_tracks[t.metadata().album()].append(t); + } + QList albums = album_tracks.keys(); + qSort(albums); + foreach (QString album, albums) { + qWarning() << album; + foreach (Track t, album_tracks[album]) { + ntracks << t; + } + } + } + _playlist.setTracks(ntracks); + updateView(); +} + +void PlaylistSortForm::shuffle() { + qsrand(QTime::currentTime().msec()); + QList tracks = _playlist.tracks(); + QList ntracks; + int size = tracks.size(); + int pos = 0; + for (int i = 0; i < size; i++) { + pos = qrand() % tracks.count(); + ntracks << tracks.at(pos); + tracks.removeAt(pos); + } + _playlist.setTracks(ntracks); + updateView(); +} + +void PlaylistSortForm::_move(QList rows, int diff) { + qSort(rows); + QList tracks = _playlist.tracks(); + if ((diff > 0 && (rows.last() == tracks.count()-diff)) || + (diff < 0 && (rows.first() == -diff - 1))) { + return; + } + if (diff > 0) { + for (int i = rows.count()-1; i>=0; i--) { + tracks.swap(rows[i], rows[i]+diff); + rows[i] += diff; + } + } else { + for (int i = 0; i < rows.count(); i++) { + tracks.swap(rows[i], rows[i]+diff); + rows[i] += diff; + } + } + _playlist.setTracks(tracks); + updateView(); + foreach (int i, rows) { + ui->playlistView->selectRow(i); + } + ui->playlistView->scrollTo(_model->index(rows[rows.count()/2], 0), QAbstractItemView::PositionAtCenter); +} + +void PlaylistSortForm::landscapeMode() { + ui->topWidget->hide(); + ui->bottomWidget->hide(); + ui->bhorWidget->hide(); + + ui->topWidget->layout()->removeItem(ui->thorizontalSpacer_0); + ui->topWidget->layout()->removeItem(ui->thorizontalSpacer_1); + ui->topWidget->layout()->removeWidget(ui->sortAlphAscButton); + ui->topWidget->layout()->removeWidget(ui->sortAlphDescButton); + ui->topWidget->layout()->removeWidget(ui->artistsButton); + + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_0); + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_1); + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_2); + ui->bottomWidget->layout()->removeWidget(ui->doneButton); + ui->bottomWidget->layout()->removeWidget(ui->moveDownButton); + ui->bottomWidget->layout()->removeWidget(ui->moveTopButton); + ui->bottomWidget->layout()->removeWidget(ui->shuffleButton); + + ui->bhorWidget->layout()->removeWidget(ui->doneButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_0); + ui->bhorWidget->layout()->removeWidget(ui->moveTopButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_1); + ui->bhorWidget->layout()->removeWidget(ui->sortAlphAscButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_2); + ui->bhorWidget->layout()->removeWidget(ui->artistsButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_3); + ui->bhorWidget->layout()->removeWidget(ui->sortAlphDescButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_4); + ui->bhorWidget->layout()->removeWidget(ui->moveDownButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_5); + ui->bhorWidget->layout()->removeWidget(ui->shuffleButton); + + ui->bhorWidget->layout()->addWidget(ui->doneButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_0); + ui->bhorWidget->layout()->addWidget(ui->sortAlphAscButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_1); + ui->bhorWidget->layout()->addWidget(ui->moveTopButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_2); + ui->bhorWidget->layout()->addWidget(ui->artistsButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_3); + ui->bhorWidget->layout()->addWidget(ui->moveDownButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_4); + ui->bhorWidget->layout()->addWidget(ui->sortAlphDescButton); + ui->bhorWidget->layout()->addItem(ui->chorizontalSpacer_5); + ui->bhorWidget->layout()->addWidget(ui->shuffleButton); + + ui->bhorWidget->show(); +} + +void PlaylistSortForm::portraitMode() { + ui->topWidget->hide(); + ui->bottomWidget->hide(); + ui->bhorWidget->hide(); + + ui->bhorWidget->layout()->removeWidget(ui->doneButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_0); + ui->bhorWidget->layout()->removeWidget(ui->moveTopButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_1); + ui->bhorWidget->layout()->removeWidget(ui->sortAlphAscButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_2); + ui->bhorWidget->layout()->removeWidget(ui->artistsButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_3); + ui->bhorWidget->layout()->removeWidget(ui->sortAlphDescButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_4); + ui->bhorWidget->layout()->removeWidget(ui->moveDownButton); + ui->bhorWidget->layout()->removeItem(ui->chorizontalSpacer_5); + ui->bhorWidget->layout()->removeWidget(ui->shuffleButton); + + ui->topWidget->layout()->removeItem(ui->thorizontalSpacer_0); + ui->topWidget->layout()->removeItem(ui->thorizontalSpacer_1); + ui->topWidget->layout()->removeWidget(ui->sortAlphAscButton); + ui->topWidget->layout()->removeWidget(ui->sortAlphDescButton); + ui->topWidget->layout()->removeWidget(ui->artistsButton); + + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_0); + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_1); + ui->bottomWidget->layout()->removeItem(ui->bhorizontalSpacer_2); + ui->bottomWidget->layout()->removeWidget(ui->doneButton); + ui->bottomWidget->layout()->removeWidget(ui->moveDownButton); + ui->bottomWidget->layout()->removeWidget(ui->moveTopButton); + ui->bottomWidget->layout()->removeWidget(ui->shuffleButton); + + ui->topWidget->layout()->addWidget(ui->sortAlphAscButton); + ui->topWidget->layout()->addItem(ui->thorizontalSpacer_0); + ui->topWidget->layout()->addWidget(ui->artistsButton); + ui->topWidget->layout()->addItem(ui->thorizontalSpacer_1); + ui->topWidget->layout()->addWidget(ui->sortAlphDescButton); + + ui->bottomWidget->layout()->addWidget(ui->doneButton); + ui->bottomWidget->layout()->addItem(ui->bhorizontalSpacer_0); + ui->bottomWidget->layout()->addWidget(ui->moveDownButton); + ui->bottomWidget->layout()->addItem(ui->bhorizontalSpacer_1); + ui->bottomWidget->layout()->addWidget(ui->moveTopButton); + ui->bottomWidget->layout()->addItem(ui->bhorizontalSpacer_2); + ui->bottomWidget->layout()->addWidget(ui->shuffleButton); + + ui->topWidget->show(); + ui->bottomWidget->show(); +} + +void PlaylistSortForm::updateTranslations() { + ui->retranslateUi(this); +} + +void PlaylistSortForm::updateGradiend() { + Config config; + if (config.getValue("ui/gradient").toString() == "yes") { + ui->bottomWidget->setStyleSheet(_bottom_gradient); + ui->topWidget->setStyleSheet(_top_gradient); + } else { + ui->topWidget->setStyleSheet(""); + ui->bottomWidget->setStyleSheet(""); + } +} + +void PlaylistSortForm::updateIcons() { + Config config; + QString icons_theme = config.getValue("ui/iconstheme").toString(); + ui->doneButton->setIcon(QIcon(":/icons/"+icons_theme+"/use.png")); + ui->moveDownButton->setIcon(QIcon(":/icons/"+icons_theme+"/arrow_bottom.png")); + ui->moveTopButton->setIcon(QIcon(":/icons/"+icons_theme+"/arrow_top.png")); + ui->shuffleButton->setIcon(QIcon(":/icons/"+icons_theme+"/random_on.png")); + ui->sortAlphAscButton->setIcon(QIcon(":/icons/"+icons_theme+"/sort_alpha_asc.png")); + ui->sortAlphDescButton->setIcon(QIcon(":/icons/"+icons_theme+"/sort_alpha_desc.png")); + ui->artistsButton->setIcon(QIcon(":/icons/"+icons_theme+"/artists.png")); +} diff --git a/src/playlistsortform.h b/src/playlistsortform.h new file mode 100644 index 0000000..ee2727a --- /dev/null +++ b/src/playlistsortform.h @@ -0,0 +1,79 @@ +/* + * SomePlayer - An alternate music player for Maemo 5 + * Copyright (C) 2010 Nikolay (somebody) Tischenko + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef PLAYLISTSORTFORM_H +#define PLAYLISTSORTFORM_H + +#include +#include +#include +#include +#include +#include "someplayer.h" +#include "playlist.h" +#include "trackrenderer.h" + +using SomePlayer::DataObjects::Playlist; + +namespace Ui { + class PlaylistSortForm; +} + +class PlaylistSortForm : public QWidget +{ + Q_OBJECT + +public: + explicit PlaylistSortForm(QWidget *parent = 0); + ~PlaylistSortForm(); + void setPlaylist(Playlist playlist); + Playlist getPlaylist(); + +private slots: + void done(); + void updateView(); + void _process_selection(QItemSelection,QItemSelection); + void moveUp(); + void moveDown(); + void sortAlphAsc(); + void sortAlphDesc(); + void sortArtist(); + void shuffle(); + +public slots: + void landscapeMode(); + void portraitMode(); + void updateTranslations(); + void updateGradiend(); + void updateIcons(); + +signals: + void playlistChanged(); + +private: + Ui::PlaylistSortForm *ui; + Playlist _playlist; + TrackRenderer *_track_renderer; + QStandardItemModel *_model; + void _move(QList rows, int diff); + QString _bottom_gradient; + QString _top_gradient; +}; + +#endif // PLAYLISTSORTFORM_H diff --git a/src/track.cpp b/src/track.cpp index 50f5315..0f36353 100644 --- a/src/track.cpp +++ b/src/track.cpp @@ -91,6 +91,14 @@ Track &Track::operator =(const Track &track) { Track::~Track() {} -bool Track::operator ==(const Track &track) { +bool Track::operator ==(const Track &track) const { return _source == track._source; } + +bool Track::operator >= (const Track &track) const { + return (metadata().title().compare(track.metadata().title()) >= 0); +} + +bool Track::operator < (const Track &track) const { + return (metadata().title().compare(track.metadata().title()) < 0); +} diff --git a/src/track.h b/src/track.h index cd9c307..54810dc 100644 --- a/src/track.h +++ b/src/track.h @@ -46,7 +46,9 @@ namespace SomePlayer { void setSource (QString source); int count() const; //count of plays void setCount(int count); //for restoring from database and counting from player - bool operator == (const Track &track); + bool operator == (const Track &track) const; + bool operator >= (const Track &track) const; // comparing only title + bool operator < (const Track &track) const; // comparing only title private: TrackMetadata _metadata; diff --git a/src/trackrenderer.cpp b/src/trackrenderer.cpp index 3a72ef8..a09fee0 100644 --- a/src/trackrenderer.cpp +++ b/src/trackrenderer.cpp @@ -44,15 +44,16 @@ void TrackRenderer::updateIcons() { } void TrackRenderer::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (index.column() == 0) { + QString value = index.data().toString(); + if (value.startsWith("##")) { + value.remove("##"); int x1, y1, x2, y2; option.rect.getCoords(&x1, &y1, &x2, &y2); - QImage image(":/icons/"+_icons_theme+"/arrow_r.png"); + QImage image(":/icons/"+_icons_theme+"/"+value); x1 += (x2 - x1 - image.width())/2; y1 += (y2 - y1 - image.width())/2; painter->drawImage(x1, y1, image); } else { - QString value = index.data().toString(); QStringList meta = value.split("#_#"); QFont f = painter->font(); diff --git a/src/ui/playerform.ui b/src/ui/playerform.ui index fe140ca..cac7122 100644 --- a/src/ui/playerform.ui +++ b/src/ui/playerform.ui @@ -148,18 +148,6 @@ QAbstractItemView::NoEditTriggers - - false - - - false - - - false - - - QAbstractItemView::NoDragDrop - QAbstractItemView::SingleSelection diff --git a/src/ui/playlistsortform.ui b/src/ui/playlistsortform.ui new file mode 100644 index 0000000..aa0b5a1 --- /dev/null +++ b/src/ui/playlistsortform.ui @@ -0,0 +1,523 @@ + + + PlaylistSortForm + + + + 0 + 0 + 800 + 480 + + + + Sorting + + + + 0 + + + 0 + + + + + background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(38, 38, 38, 255), stop:1 rgba(92, 92, 92, 255)) + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/sort_alpha_asc.png:/icons/white/sort_alpha_asc.png + + + + 48 + 58 + + + + false + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/artists.png:/icons/white/artists.png + + + false + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/sort_alpha_desc.png:/icons/white/sort_alpha_desc.png + + + + 48 + 48 + + + + false + + + true + + + + + + + + + + Qt::CustomContextMenu + + + QFrame::Sunken + + + Qt::ScrollBarAlwaysOff + + + false + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::MultiSelection + + + QAbstractItemView::SelectRows + + + + 50 + 50 + + + + false + + + false + + + false + + + true + + + false + + + 70 + + + 70 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 78 + 0 + + + + background:qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(38, 38, 38, 255), stop:1 rgba(92, 92, 92, 255)) + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/use.png:/icons/white/use.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/arrow_top.png:/icons/white/arrow_top.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/arrow_bottom.png:/icons/white/arrow_bottom.png + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 70 + 70 + + + + + 70 + 70 + + + + + + + + :/icons/white/random_on.png:/icons/white/random_on.png + + + true + + + + + + + + + + + + + -- 1.7.9.5