Merge lp:~nam85/repeat-one-song/repeat-one-song into lp:repeat-one-song/precise

Proposed by nam
Status: Merged
Approved by: Eduardo Mucelli Rezende Oliveira
Approved revision: 2
Merged at revision: 2
Proposed branch: lp:~nam85/repeat-one-song/repeat-one-song
Merge into: lp:repeat-one-song/precise
Diff against target: 553 lines (+526/-0)
5 files modified
ChangeLog (+10/-0)
README (+23/-0)
icon.svg (+346/-0)
repeat-one-song.plugin (+9/-0)
repeat-one-song.py (+138/-0)
To merge this branch: bzr merge lp:~nam85/repeat-one-song/repeat-one-song
Reviewer Review Type Date Requested Status
Eduardo Mucelli Rezende Oliveira Approve
Review via email: mp+104403@code.launchpad.net

Description of the change

updated repeat-one-song plugin to work with rhythmbox 2.96

To post a comment you must log in.
Revision history for this message
Eduardo Mucelli Rezende Oliveira (eduardo-mucelli) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'ChangeLog'
2--- ChangeLog 1970-01-01 00:00:00 +0000
3+++ ChangeLog 2012-05-02 15:36:19 +0000
4@@ -0,0 +1,10 @@
5+0.1 (November/6/2010): The first stable version with only the basic function.
6+0.0.6.1 (November/6/2010): Fixing the problem that last song in the queue was not being repeated. Thanks to B Clausius.
7+0.0.6 (October/28/2010): No more watching the play time in order to repeat the song. It also fixes the Crossfader problem. Thanks to B Clausius.
8+0.0.5.2 (October/27/2010): Fixing the play count. Thanks to B Clausius.
9+0.0.5.1 (September/12/2010): Small bug fix, Launchpad bug #636228.
10+0.0.5 (August/13/2010): It is possible to define, through Preferences dialog, the current song's number of repetitions, or keep it infitine as usual.
11+0.0.4 (June/2/2010): Internationalization support; Brazilian portuguese, Spanish and French languages are supported. Some code refactoring.
12+0.0.3 (May/28/2010): New icon based on gnome-media-playlist-repeat.svg
13+0.0.2 (May/28/2010): Some small things such code commentary, changing the Website in repeat-one-song.rb-plugin, and some insignificant things I forgot.
14+0.0.1 (May/27/2010): The Repeat One Song bornt here, basic usage with Toolbar, and Control menu buttons.
15
16=== added file 'README'
17--- README 1970-01-01 00:00:00 +0000
18+++ README 2012-05-02 15:36:19 +0000
19@@ -0,0 +1,23 @@
20+# The history
21+
22+I left Songbird and begin using Rhythmbox but the repeat one song feature was not present. I cried ... a lot, but from scratch I did learn some Python and Rhythmbox plugins idea and poof! the plugin is here.
23+
24+# Installation
25+
26+Copy the "repeat-one-song" folder and paste it in ~/.gnome2/rhythmbox/plugins/ -- If "plugins" directory does not exist, just create it. If the "rhythmbox" directory does not exist, paste the "repeat-one-song" folder in /usr/lib/rhythmbox/plugins directory.
27+
28+# Usage
29+
30+Open Rhythmbox and load the plugin by "Edit (menu) -> Plug-ins", select the "Repeat One Song" in the list. Activate the plugin by "Control (menu) -> Repeat one", or click in the Toolbar button that shows the Repeat one icon, or you can use the marvelous shortcut Ctrl+E. In version 0.0.5 you can define the number of repetitions for the current song in the Preferences dialog: "Edit (menu) -> Plug-ins", select "Repeat One Song" and "Configure" button will be available in the right panel.
31+
32+# Contact me
33+
34+Any doubt, suggestion or anything else, except asking for some money, I would be pleased to received a message from you. :¬)
35+
36+Author: Eduardo Mucelli Rezende Oliveira
37+E-mail: edumucelli@gmail.com or eduardom@dcc.ufmg.br
38+
39+# Thanks to
40+
41+* Emanuel Vianna: for having tested several versions of this plugin on his cutting edge distributions.
42+* B Clausius: for changing using the end of stream instead of play time watching.
43
44=== added file 'icon.svg'
45--- icon.svg 1970-01-01 00:00:00 +0000
46+++ icon.svg 2012-05-02 15:36:19 +0000
47@@ -0,0 +1,346 @@
48+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
49+<!-- Created with Inkscape (http://www.inkscape.org/) -->
50+<svg
51+ xmlns:dc="http://purl.org/dc/elements/1.1/"
52+ xmlns:cc="http://creativecommons.org/ns#"
53+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
54+ xmlns:svg="http://www.w3.org/2000/svg"
55+ xmlns="http://www.w3.org/2000/svg"
56+ xmlns:xlink="http://www.w3.org/1999/xlink"
57+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
58+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
59+ width="48"
60+ height="48"
61+ id="svg7854"
62+ sodipodi:version="0.32"
63+ inkscape:version="0.46"
64+ version="1.0"
65+ sodipodi:docbase="/home/dobey/Projects/gnome-icon-theme/scalable/status"
66+ sodipodi:docname="icon.svg"
67+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
68+ inkscape:export-filename="/home/lapo/Icone/gnome-icon-theme/32x32/status/media-playlist-repeat.png"
69+ inkscape:export-xdpi="90"
70+ inkscape:export-ydpi="90">
71+ <defs
72+ id="defs7856">
73+ <inkscape:perspective
74+ sodipodi:type="inkscape:persp3d"
75+ inkscape:vp_x="0 : 24 : 1"
76+ inkscape:vp_y="0 : 1000 : 0"
77+ inkscape:vp_z="48 : 24 : 1"
78+ inkscape:persp3d-origin="24 : 16 : 1"
79+ id="perspective48" />
80+ <linearGradient
81+ id="linearGradient7277">
82+ <stop
83+ style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
84+ offset="0"
85+ id="stop7279" />
86+ <stop
87+ id="stop7285"
88+ offset="0.52083331"
89+ style="stop-color: rgb(0, 0, 0); stop-opacity: 0.235294;" />
90+ <stop
91+ style="stop-color: rgb(0, 0, 0); stop-opacity: 0.235294;"
92+ offset="0.80034721"
93+ id="stop7287" />
94+ <stop
95+ style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
96+ offset="1"
97+ id="stop7281" />
98+ </linearGradient>
99+ <linearGradient
100+ inkscape:collect="always"
101+ id="linearGradient7271">
102+ <stop
103+ style="stop-color: rgb(0, 0, 0); stop-opacity: 0.235294;"
104+ offset="0"
105+ id="stop7273" />
106+ <stop
107+ style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"
108+ offset="1"
109+ id="stop7275" />
110+ </linearGradient>
111+ <linearGradient
112+ id="linearGradient7344"
113+ inkscape:collect="always">
114+ <stop
115+ id="stop7346"
116+ offset="0"
117+ style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" />
118+ <stop
119+ id="stop7348"
120+ offset="1"
121+ style="stop-color: rgb(146, 148, 143); stop-opacity: 1;" />
122+ </linearGradient>
123+ <linearGradient
124+ id="linearGradient7305">
125+ <stop
126+ id="stop7307"
127+ offset="0"
128+ style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" />
129+ <stop
130+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
131+ offset="0.20971029"
132+ id="stop7313" />
133+ <stop
134+ id="stop7329"
135+ offset="0.34936365"
136+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.810651;" />
137+ <stop
138+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
139+ offset="0.42850056"
140+ id="stop7321" />
141+ <stop
142+ id="stop7323"
143+ offset="0.52134049"
144+ style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" />
145+ <stop
146+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
147+ offset="0.55746967"
148+ id="stop7317" />
149+ <stop
150+ id="stop7319"
151+ offset="0.71001518"
152+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0.568047;" />
153+ <stop
154+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;"
155+ offset="0.74394959"
156+ id="stop7416" />
157+ <stop
158+ id="stop7309"
159+ offset="1"
160+ style="stop-color: rgb(255, 255, 255); stop-opacity: 0;" />
161+ </linearGradient>
162+ <linearGradient
163+ inkscape:collect="always"
164+ xlink:href="#linearGradient7271"
165+ id="linearGradient7760"
166+ gradientUnits="userSpaceOnUse"
167+ x1="19.474762"
168+ y1="14.031158"
169+ x2="19.474762"
170+ y2="31.518414" />
171+ <linearGradient
172+ inkscape:collect="always"
173+ xlink:href="#linearGradient7277"
174+ id="linearGradient7762"
175+ gradientUnits="userSpaceOnUse"
176+ x1="20.75"
177+ y1="21.343321"
178+ x2="20.75"
179+ y2="31.5" />
180+ <radialGradient
181+ inkscape:collect="always"
182+ xlink:href="#linearGradient7344"
183+ id="radialGradient7764"
184+ gradientUnits="userSpaceOnUse"
185+ gradientTransform="matrix(3.75013, 0, 0, 1.75746, -142.583, -77.7129)"
186+ cx="32.631359"
187+ cy="33.584618"
188+ fx="32.631359"
189+ fy="33.584618"
190+ r="16" />
191+ <linearGradient
192+ inkscape:collect="always"
193+ xlink:href="#linearGradient7305"
194+ id="linearGradient7766"
195+ gradientUnits="userSpaceOnUse"
196+ x1="-5.6568542"
197+ y1="41.63604"
198+ x2="64.346718"
199+ y2="3.0987194" />
200+ </defs>
201+ <sodipodi:namedview
202+ id="base"
203+ pagecolor="#ffffff"
204+ bordercolor="#afafaf"
205+ borderopacity="1"
206+ gridtolerance="15.1"
207+ guidetolerance="10"
208+ objecttolerance="10"
209+ inkscape:pageopacity="0"
210+ inkscape:pageshadow="2"
211+ inkscape:zoom="11.916667"
212+ inkscape:cx="25.804414"
213+ inkscape:cy="28.643357"
214+ inkscape:document-units="px"
215+ inkscape:current-layer="layer3"
216+ width="48px"
217+ height="48px"
218+ inkscape:showpageshadow="false"
219+ inkscape:window-width="872"
220+ inkscape:window-height="773"
221+ inkscape:window-x="0"
222+ inkscape:window-y="1"
223+ showgrid="false"
224+ inkscape:grid-points="false"
225+ showborder="true"
226+ showguides="false"
227+ inkscape:guide-bbox="false"
228+ inkscape:grid-bbox="true"
229+ inkscape:object-paths="false">
230+ <sodipodi:guide
231+ orientation="horizontal"
232+ position="8.6620581"
233+ id="guide7377" />
234+ <sodipodi:guide
235+ orientation="horizontal"
236+ position="6"
237+ id="guide7379" />
238+ <sodipodi:guide
239+ orientation="horizontal"
240+ position="36.062446"
241+ id="guide7492" />
242+ <sodipodi:guide
243+ orientation="horizontal"
244+ position="51"
245+ id="guide7046" />
246+ <sodipodi:guide
247+ orientation="horizontal"
248+ position="-17.5"
249+ id="guide7233" />
250+ <sodipodi:guide
251+ orientation="horizontal"
252+ position="-29"
253+ id="guide7235" />
254+ <sodipodi:guide
255+ orientation="horizontal"
256+ position="44.547727"
257+ id="guide6795" />
258+ <sodipodi:guide
259+ orientation="horizontal"
260+ position="16.970563"
261+ id="guide6797" />
262+ <sodipodi:guide
263+ orientation="horizontal"
264+ position="23.511301"
265+ id="guide6914" />
266+ <inkscape:grid
267+ id="GridFromPre046Settings"
268+ type="xygrid"
269+ originx="0px"
270+ originy="0px"
271+ spacingx="0.5px"
272+ spacingy="0.5px"
273+ color="#0000ff"
274+ empcolor="#0000ff"
275+ opacity="0.2"
276+ empopacity="0.4"
277+ empspacing="2" />
278+ </sodipodi:namedview>
279+ <metadata
280+ id="metadata7859">
281+ <rdf:RDF>
282+ <cc:Work
283+ rdf:about="">
284+ <dc:format>image/svg+xml</dc:format>
285+ <dc:type
286+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
287+ <dc:creator>
288+ <cc:Agent>
289+ <dc:title>Lapo Calamandrei</dc:title>
290+ </cc:Agent>
291+ </dc:creator>
292+ <dc:source />
293+ <cc:license
294+ rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
295+ <dc:title>Media statusses</dc:title>
296+ <dc:subject>
297+ <rdf:Bag />
298+ </dc:subject>
299+ </cc:Work>
300+ <cc:License
301+ rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
302+ <cc:permits
303+ rdf:resource="http://web.resource.org/cc/Reproduction" />
304+ <cc:permits
305+ rdf:resource="http://web.resource.org/cc/Distribution" />
306+ <cc:requires
307+ rdf:resource="http://web.resource.org/cc/Notice" />
308+ <cc:permits
309+ rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
310+ <cc:requires
311+ rdf:resource="http://web.resource.org/cc/ShareAlike" />
312+ <cc:requires
313+ rdf:resource="http://web.resource.org/cc/SourceCode" />
314+ </cc:License>
315+ </rdf:RDF>
316+ </metadata>
317+ <g
318+ inkscape:label="Layer 1"
319+ inkscape:groupmode="layer"
320+ id="layer1">
321+ <g
322+ id="g7423"
323+ transform="translate(50, 50)">
324+ <g
325+ transform="translate(-50, -50)"
326+ style="opacity: 0.4;"
327+ id="g7289">
328+ <path
329+ style="opacity: 1; fill: url(#linearGradient7760) rgb(0, 0, 0); fill-opacity: 1; stroke: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0.7; stroke-opacity: 1;"
330+ d="M 13.5,13 C 9.935113,13 7,15.935113 7,19.5 L 7,28.5625 C 7,32.127387 9.935113,35.0625 13.5,35.0625 L 18.5,35.0625 C 19.327799,35.060985 19.998485,34.390299 20,33.5625 L 20,31.5 L 11,31.5 L 11,17 L 37,17 L 37,31.5 L 21,31.5 C 21,31.982841 21.23341,32.436274 21.625,32.71875 L 28.625,37.71875 C 29.082441,38.044816 29.687707,38.100223 30.1875,37.84375 C 30.687293,37.587277 30.998151,37.061754 31,36.5 L 31,35.0625 L 34.5,35.0625 C 38.064887,35.0625 40.999997,32.127386 41,28.5625 L 41,19.5 C 41,15.935113 38.064888,13 34.5,13 L 13.5,13 z "
331+ id="path7261" />
332+ <path
333+ style="opacity: 1; fill: url(#linearGradient7762) rgb(0, 0, 0); fill-opacity: 1; stroke: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0.7; stroke-opacity: 1;"
334+ d="M 11,17 L 11,31.5 L 20,31.5 L 20,29.5625 C 19.998485,28.734701 19.327799,28.064015 18.5,28.0625 L 14,28.0625 L 14,20 L 34,20 L 34,28.0625 L 31,28.0625 L 31,26.5 C 30.998151,25.938246 30.687293,25.412723 30.1875,25.15625 C 29.687707,24.899776 29.082441,24.955184 28.625,25.28125 L 21.625,30.28125 C 21.23341,30.563726 21,31.017159 21,31.5 L 37,31.5 L 37,17 L 11,17 z "
335+ id="path7255" />
336+ </g>
337+ <path
338+ sodipodi:nodetypes="cccccccccccccccccccccccc"
339+ id="rect7213"
340+ d="M -36.5,-35.5 C -39.235898,-35.5 -41.5,-33.235898 -41.5,-30.5 L -41.5,-21.4375 C -41.5,-18.701602 -39.235898,-16.4375 -36.5,-16.4375 L -31.5,-16.4375 L -31.5,-20.4375 L -36.5,-20.4375 C -37.089087,-20.4375 -37.5,-20.848413 -37.5,-21.4375 L -37.5,-30.5 C -37.5,-31.089086 -37.089087,-31.5 -36.5,-31.5 L -15.5,-31.5 C -14.910909,-31.5 -14.5,-31.089087 -14.5,-30.5 L -14.5,-21.4375 C -14.5,-20.848414 -14.910913,-20.4375 -15.5,-20.4375 L -20.5,-20.4375 L -20.5,-23.5 L -27.5,-18.5 L -20.5,-13.5 L -20.5,-16.4375 L -15.5,-16.4375 C -12.764102,-16.4375 -10.500002,-18.701602 -10.5,-21.4375 L -10.5,-30.5 C -10.5,-33.235898 -12.764101,-35.5 -15.5,-35.5 L -36.5,-35.5 z "
341+ style="opacity: 1; fill: url(#radialGradient7764) rgb(0, 0, 0); fill-opacity: 1; stroke: rgb(85, 87, 83); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0.7; stroke-opacity: 1;" />
342+ <path
343+ transform="translate(-50, -50)"
344+ d="M 13.5,15.40625 C 11.264082,15.40625 9.40625,17.264082 9.40625,19.5 L 9.40625,28.5625 C 9.40625,30.798418 11.264082,32.65625 13.5,32.65625 L 17.59375,32.65625 L 17.59375,30.46875 L 13.5,30.46875 C 12.489481,30.46875 11.59375,29.573019 11.59375,28.5625 L 11.59375,19.5 C 11.59375,18.489482 12.48948,17.59375 13.5,17.59375 L 34.5,17.59375 C 35.51052,17.59375 36.40625,18.489485 36.40625,19.5 L 36.40625,28.5625 C 36.40625,29.573018 35.51052,30.46875 34.5,30.46875 L 29.5,30.46875 C 28.999513,30.4687 28.5938,30.062987 28.59375,29.5625 L 28.59375,28.28125 L 24.09375,31.5 L 28.59375,34.71875 L 28.59375,33.5625 C 28.5938,33.062013 28.999513,32.6563 29.5,32.65625 L 34.5,32.65625 C 36.735918,32.65625 38.593748,30.798419 38.59375,28.5625 L 38.59375,19.5 C 38.59375,17.264082 36.735919,15.40625 34.5,15.40625 L 13.5,15.40625 z "
345+ id="path7239"
346+ style="opacity: 1; fill: none; fill-opacity: 1; stroke: rgb(255, 255, 255); stroke-width: 0.8; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0.7; stroke-opacity: 1;"
347+ inkscape:original="M 13.5 14.5 C 10.764102 14.5 8.5 16.764102 8.5 19.5 L 8.5 28.5625 C 8.5 31.298398 10.764102 33.5625 13.5 33.5625 L 18.5 33.5625 L 18.5 29.5625 L 13.5 29.5625 C 12.910913 29.5625 12.5 29.151587 12.5 28.5625 L 12.5 19.5 C 12.5 18.910914 12.910913 18.5 13.5 18.5 L 34.5 18.5 C 35.089091 18.5 35.5 18.910913 35.5 19.5 L 35.5 28.5625 C 35.5 29.151586 35.089087 29.5625 34.5 29.5625 L 29.5 29.5625 L 29.5 26.5 L 22.5 31.5 L 29.5 36.5 L 29.5 33.5625 L 34.5 33.5625 C 37.235898 33.5625 39.499998 31.298398 39.5 28.5625 L 39.5 19.5 C 39.5 16.764102 37.235899 14.5 34.5 14.5 L 13.5 14.5 z "
348+ inkscape:radius="-0.90625"
349+ sodipodi:type="inkscape:offset" />
350+ <path
351+ transform="translate(-50, -50)"
352+ d="M 13.5,15 C 11.039953,15 9,17.039953 9,19.5 L 9,28.5625 C 9,31.022547 11.039953,33.0625 13.5,33.0625 L 18,33.0625 L 18,30.0625 L 13.5,30.0625 C 12.678399,30.0625 12,29.384101 12,28.5625 L 12,19.5 C 12,18.6784 12.678398,18 13.5,18 L 34.5,18 C 35.321603,18 36,18.678401 36,19.5 L 36,28.5625 C 36,29.3841 35.321602,30.0625 34.5,30.0625 L 29.5,30.0625 C 29.223869,30.062472 29.000028,29.838631 29,29.5625 L 29,27.46875 L 23.34375,31.5 L 29,35.53125 L 29,33.5625 C 29.000028,33.286369 29.223869,33.062528 29.5,33.0625 L 34.5,33.0625 C 36.960047,33.0625 38.999998,31.022547 39,28.5625 L 39,19.5 C 39,17.039953 36.960048,15 34.5,15 L 13.5,15 z "
353+ id="path7247"
354+ style="opacity: 0.4; fill: url(#linearGradient7766) rgb(0, 0, 0); fill-opacity: 1; stroke: none; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0.7; stroke-opacity: 1;"
355+ inkscape:original="M 13.5 14.5 C 10.764102 14.5 8.5 16.764102 8.5 19.5 L 8.5 28.5625 C 8.5 31.298398 10.764102 33.5625 13.5 33.5625 L 18.5 33.5625 L 18.5 29.5625 L 13.5 29.5625 C 12.910913 29.5625 12.5 29.151587 12.5 28.5625 L 12.5 19.5 C 12.5 18.910914 12.910913 18.5 13.5 18.5 L 34.5 18.5 C 35.089091 18.5 35.5 18.910913 35.5 19.5 L 35.5 28.5625 C 35.5 29.151586 35.089087 29.5625 34.5 29.5625 L 29.5 29.5625 L 29.5 26.5 L 22.5 31.5 L 29.5 36.5 L 29.5 33.5625 L 34.5 33.5625 C 37.235898 33.5625 39.499998 31.298398 39.5 28.5625 L 39.5 19.5 C 39.5 16.764102 37.235899 14.5 34.5 14.5 L 13.5 14.5 z "
356+ inkscape:radius="-0.5"
357+ sodipodi:type="inkscape:offset" />
358+ </g>
359+ </g>
360+ <g
361+ inkscape:groupmode="layer"
362+ id="layer2"
363+ inkscape:label="numberOne"
364+ style="opacity:1">
365+ <path
366+ sodipodi:type="arc"
367+ style="fill:#d3d4d1;fill-opacity:1;stroke:#555753;stroke-width:1.43055355;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
368+ id="path4632"
369+ sodipodi:cx="4.5314684"
370+ sodipodi:cy="8.0559444"
371+ sodipodi:rx="7.8041959"
372+ sodipodi:ry="7.216783"
373+ d="M 12.335664,8.0559444 A 7.8041959,7.216783 0 1 1 -3.2727275,8.0559444 A 7.8041959,7.216783 0 1 1 12.335664,8.0559444 z"
374+ transform="matrix(0.9131951,0,0,0.9436791,6.6451021,8.6774938)" />
375+ </g>
376+ <g
377+ inkscape:groupmode="layer"
378+ id="layer3"
379+ inkscape:label="1">
380+ <text
381+ xml:space="preserve"
382+ style="font-size:11.22687626px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
383+ x="6.1237507"
384+ y="21.52676"
385+ id="text4701"
386+ sodipodi:linespacing="100%"
387+ transform="scale(1.0688637,0.935573)"><tspan
388+ sodipodi:role="line"
389+ id="tspan4703"
390+ x="6.1237507"
391+ y="21.52676">1</tspan></text>
392+ </g>
393+</svg>
394
395=== added file 'repeat-one-song.plugin'
396--- repeat-one-song.plugin 1970-01-01 00:00:00 +0000
397+++ repeat-one-song.plugin 2012-05-02 15:36:19 +0000
398@@ -0,0 +1,9 @@
399+[Plugin]
400+Loader=python
401+Module=repeat-one-song
402+IAge=1
403+Name=Repeat One Song
404+Description="Repeat One Song" will repeat the song that is being currently played
405+Authors=Eduardo Mucelli Rezende Oliveira <edumucelli@gmail.com>
406+Copyright=Copyright © 2010 Eduardo Mucelli Rezende Oliveira
407+Website=https://launchpad.net/repeat-one-song
408
409=== added file 'repeat-one-song.py'
410--- repeat-one-song.py 1970-01-01 00:00:00 +0000
411+++ repeat-one-song.py 2012-05-02 15:36:19 +0000
412@@ -0,0 +1,138 @@
413+# This is a part of the external Repeat One Song plugin for Rhythmbox
414+#
415+# Author: Eduardo Mucelli Rezende Oliveira
416+# E-mail: edumucelli@gmail.com or eduardom@dcc.ufmg.br
417+# Version: 0.1 (Stable)
418+#
419+# This program is free software: you can redistribute it and/or modify
420+# it under the terms of the GNU General Public License as published by
421+# the Free Software Foundation, either version 3 of the License, or
422+# (at your option) any later version.
423+
424+# This program is distributed in the hope that it will be useful,
425+# but WITHOUT ANY WARRANTY; without even the implied warranty of
426+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
427+# GNU General Public License for more details.
428+
429+# This plugin provides the "repeat one song" feature to Rhythmbox
430+# Active it by clicking on the Repeat one button in the Toolbar,
431+# by menu Control -> Repeat one, or using Ctrl + E shortcut
432+
433+from gi.repository import GObject, RB, Peas, Gtk
434+import os.path, gettext
435+import rb
436+
437+# o XML que define os botoes da barra de menus, do menu Controle, e a acao que sera mapeada para eles
438+ui_str = \
439+ """
440+ <ui>
441+ <menubar name="MenuBar">
442+ <menu name="ControlMenu" action="Control">
443+ <menuitem name="control_menu_repeat_one" action="RepeatOne"/>
444+ </menu>
445+ </menubar>
446+ <toolbar name="ToolBar">
447+ <placeholder name="ToolBarPluginPlaceholder">
448+ <toolitem name="repeat_one" action="RepeatOne"/>
449+ </placeholder>
450+ </toolbar>
451+ </ui>
452+ """
453+
454+class RepeatOneSong (GObject.Object, Peas.Activatable):
455+ __gtype_name__ = 'RepeatOneSong'
456+ object = GObject.property(type=GObject.Object)
457+
458+ def __init__(self):
459+ super(RepeatOneSong, self).__init__()
460+
461+
462+
463+ def switch_repeat_status(self, control):
464+ # como existe apenas uma acao, a mesma poderia ter sido tratada como self.action em todo o codigo,
465+ # mas a boa pratica eh colocar as acoes em um grupo e busca-la com o get_action
466+ action = self.action_group.get_action('RepeatOne') # seleciona a acao de repetir a musica atual
467+ self.repeat = action.get_active() # indica se o botao esta marcado, ou desmarcado
468+ player = self.shell.props.shell_player
469+ if self.repeat:
470+ ret, shuffle, self.repeat_all = player.get_playback_state()
471+ player.set_playback_state(shuffle, 1)
472+ else:
473+ ret, shuffle, repeat_all = player.get_playback_state()
474+ player.set_playback_state(shuffle, self.repeat_all)
475+
476+ def switch_repeat_all_status(self, action):
477+ if not action.get_active() and self.repeat:
478+ self.repeat = False
479+ self.repeat_all = 0
480+ action_repeat_one = self.action_group.get_action('RepeatOne')
481+ action_repeat_one.set_active(False)
482+
483+ def load_icon(self):
484+ """Trata a adicao do icone na barra de ferramentas. O icone eh nomeado 'repeat-one-song' e
485+ posteriormente sera usado como o ultimo parametro do 'gtk.ToggleAction' no metodo generate_ui"""
486+ icon_file_name = rb.find_plugin_file(self, "icon.svg")
487+ iconsource = Gtk.IconSource()
488+ iconsource.set_filename(icon_file_name)
489+ iconset = Gtk.IconSet()
490+ iconset.add_source(iconsource)
491+ iconfactory = Gtk.IconFactory()
492+ iconfactory.add("repeat-one-song", iconset)
493+ iconfactory.add_default()
494+
495+ def generate_ui(self):
496+ """Define as a acao (ligada ao metodo switch_repeat_status), os rotulos traduzives, icone do botao que fica na barra de tarefas.
497+ Ao final, eh necessario ainda mesclar a string do xml para adicionar tais funcionalidades na ui do Rhythmbox"""
498+ self.action_group = Gtk.ActionGroup('RepeatOneActionGroup') # cria agrupador de acoes
499+ # cria uma acao toggle (on/off)
500+ # RepeatOne (the named action), translatable string of Control menu), translatable string of Toolbar, icon defined above (see load_icon())
501+ action = Gtk.ToggleAction("RepeatOne", _("Repeat one"), _("Repeat the current song when it's finished"), "repeat-one-song");
502+ self.action_group.add_action_with_accel(action, "<Control>E") # adiciona esta acao no grupo + atalho
503+ action.connect("activate", self.switch_repeat_status) # quando o botao for acionado
504+
505+ manager = self.shell.props.ui_manager
506+ manager.insert_action_group(self.action_group, 0)
507+ self.uid = manager.add_ui_from_string(ui_str) # mescla xml definido com o do RB
508+ manager.ensure_update()
509+
510+ action = manager.get_action('/ToolBar/Repeat')
511+ action.connect("activate", self.switch_repeat_all_status)
512+
513+ def do_activate(self): # when loading the applet
514+ self.shell = self.object
515+ self.db = self.shell.props.db
516+ self.repeat = False
517+
518+ self.one_song_state_normal, self.one_song_state_eos = range(2)
519+ self.one_song_state = self.one_song_state_normal
520+
521+ self.load_icon() # necessary load icon first ...
522+ self.generate_ui() # ... because it is used here
523+
524+ player = self.shell.props.shell_player
525+ player.connect('playing-song-changed', self.on_song_change) # mudou a musica. o player.do_next() invoca o on_elapsed_changed
526+ player.props.player.connect('eos', self.on_gst_player_eos) # eos -> on_song_change
527+
528+ def do_deactivate(self): # when unloading applet
529+ if self.repeat:
530+ player = self.shell.props.shell_player
531+ ret, shuffle, repeat_all = player.get_playback_state()
532+ player.set_playback_state(shuffle, self.repeat_all)
533+
534+ for attr in (self.db, self.shell, self.repeat, # delete global attributes if possible
535+ self.one_song_state_normal, self.one_song_state_eos):
536+ if attr:
537+ del attr
538+ manager = self.shell.props.ui_manager
539+ manager.remove_ui(self.uid)
540+ manager.remove_action_group(self.action_group)
541+ manager.ensure_update()
542+
543+ def on_gst_player_eos(self, gst_player, stream_data, early=0):
544+ if self.repeat:
545+ self.one_song_state = self.one_song_state_eos
546+
547+ def on_song_change(self, player, time): # quando mudar a musica ...
548+ if self.one_song_state == self.one_song_state_eos:
549+ self.one_song_state = self.one_song_state_normal
550+ player.do_previous()
551
552=== added file 'repeat-one-song_0.1_stable.tar.gz'
553Binary files repeat-one-song_0.1_stable.tar.gz 1970-01-01 00:00:00 +0000 and repeat-one-song_0.1_stable.tar.gz 2012-05-02 15:36:19 +0000 differ

Subscribers

People subscribed via source and target branches