gmusicbrowser Forum

Main board => Questions => Topic started by: rizlaw on December 31, 2011, 23:22:15

Title: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on December 31, 2011, 23:22:15
Gmusicbrowser 1.1.8 RC. Ubuntu 11.10 64 bit (Gnome Shell & Unity)

Question 1: when changing the default text font size, the entire widget gets proportionately larger or smaller (including the cover art), but the number of characters in the Title, Artist & Album fields does not increase or decrease. The number of characters remains constant regardless of the font size chosen. For example, I would expect that reducing the font size from say Sans 13 to Sans 10 would result in more characters fitting on each line, but that's not the case. Is there a reason for the behavior?

Question 2: Is there a way to keep the cover size from changing when altering the default text font size?

Question 3: What is the purpose of the "Minimum Size" option which is set at 1 x 1. It seems to increment in steps of 10: 1,11, 21, 31, 41, but nothing changes in the desktop widget?

Thanks. Happy New Year.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: Quentin Sculo on January 03, 2012, 19:36:56
Question 3 : Yes it's not very clear :(   In fact it's very simple, desktop widgets are just like other widgets, but you can't mode or resize them like other layouts, so the plugin settings allow you to choose it's position and size.
The minimum size is just a way to resize the layout, but like other windows, you can't resize the window pas a minimal size : the size requested by its widgets. So the actual size of the desktop widget is the maximum of the size that it requests (depends on the content of the desktop widget) and the "minimum size" that the user choose.

Question 1: The Title, Artist & Album widgets (btw don't confuse "desktop widgets" that is just a layout type, and regular gmb widgets are the component of layouts) have a default minimal size of 20 characters, that can be changed by editing the layout and using the option minsize (that can be put in pixel like minsize=200p that way it would not depend on the font)
But really, that minimum size is meant as a minimum that should most of the time be bigger, what you should do is simply resize the desktop widget so that it has more room, see Question 3.

Question 2 : If you give the desktop widget more room the cover size won't depend on the size of the text widgets. Otherwise you'll have to edit the layout, you can give the Cover widget a minimum and maximum size in its options, you can also change the packing of the widgets so that the Cover widget size is not linked to the size of the text widgets. Let me know if you need help editing the layout.

Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 11, 2012, 01:34:18
Quentin,

After reading your answers, my brain exploded. :'(
I feel like the old man in the film "Moonstruck" when he says "I'm confused". Great film if you haven't seen it.

I think the attached screenshot of the "nowplaying" screenlet in the "Screenlets" package of widgets best illustrates the text size I am hoping for in the GMB widget, in contrast to the snapshot of GMB's widget. In the Screenlet's widge the text appears to be half the size, I'm guessing the first line of text is about 10pt bold and the remaining 2 lines are 8 point italic and bold. All the lines automatically scroll to show everything on each line - something a snapshot can't show. But, that's irrelevant to my point about the size of text in GB being too large. It's too bad the Screenlets developers don't include GMB in their list of supported music players.

As for your suggestion to make your widget larger to get more text, I can't do that because the overall size of your widget is constrained by the overall size (width) of my Conky data column, which is about 240 pixels wide. I need them to line up along the right side of my screen.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: Quentin Sculo on January 11, 2012, 19:54:17
Sorry, I wasn't very clear, and I've made typos (mode=>move, pas=>past) :(
Just change the "minimal size" setting to something like 240x1, and set the default font to ~8, and you will get more characters.
In this desktop widget, the size of the cover depends on the size of the whole layout, which depends on the width the Title element requests, which is 20 characters (and use size big, so a bit bigger than the default size you choose). By setting the minimum width to 240, the layout will be at least 240 pixels wide, even if you select a small font size.

as a bonus, here is a very quick desktop widget inspired by the nowplaying screenlet
Code: [Select]
[nowplaying_screenlet]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= _Cover(forceratio=1) Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 11, 2012, 21:34:04
Quentin,

Thanks for the code. I wasn't expecting that. It's very good. Since you're on a roll here. I thought I should point out that the "Screenlets" NowPlaying widget is more functional than the snapshot I included in my prior post: it contains a hidden set of control buttons that only appear when you mouse over the cover art area. Unfortunately, those transport control buttons only include back, play/pause, forward. There is no stop button and for me that is critical, so that when using ALSA, hw:0.1, I can stop playback and answer a Skype call. I believe "stop" temporarily disconnects "exclusive" audio control from the media player. In "pause" mode exclusive control of the audio is retained by the media player and I can't answer the call with Skype audio functioning properly. This is one of many reasons I prefer GMB and your widget to all other Linux based music players. ;D

So now the question becomes, is it possible for you to modify the code above so that your modified NowPlaying widget has the last track, stop, pause, next track buttons either invisible until you mouse over the cover art, or visible on top of the cover art and the track title, artist, album and play time beneath the cover art. One last suggestion, instead of showing the time in numbers, how about a thin (2 pixel?) bright green line between the bottom edge of the cover art and the track title which slowly progresses across the width of the cover art to depict the playing time. I think that would look more elegant than numbers and still provide good time feedback.

On a down note, I'm still occasionally seeing an ALSA playback error where the program stops playing between tracks saying its lost ALSA sink. Clicking play usually starts playback. I have no idea why this is happening. Screenshot of error attached, if it helps. I'm using the GMB RC.

Lou Rizzo

Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: Quentin Sculo on January 12, 2012, 02:04:48
Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)

[nowplaying_screenlet2_popup]
Window = transparent=1
HBmain= Prev Stop Play Next

[nowplaying_screenlet3]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

nowplaying_screenlet2 pops-up a layout (nowplaying_screenlet2_popup) with prev/stop/play/next buttons when the mouse is over the cover, unfortunately currently there is no way to configure where the popup appear, it is positioned below the cover (or above/next to it, if there is no place below) Maybe I'll add options to change this.

nowplaying_screenlet3 always shows the buttons
nowplaying_screenlet4 is the same as nowplaying_screenlet3 but with centered buttons.

About the playing bar, these simply shows a progress bar with the minimal height, that may depends on your gtk theme. It is possible to skin the time bar, but currently only when using a handle, so it won't help for what you want.

Quote
On a down note, I'm still occasionally seeing an ALSA playback error where the program stops playing between tracks saying its lost ALSA sink. Clicking play usually starts playback. I have no idea why this is happening. Screenshot of error attached, if it helps. I'm using the GMB RC.
With gstreamer, selecting the gap-less mode option might help (though it's possible it doesn't make any difference when using a random mode)
Other than that I don't know. Nowadays you really should be able to play multiple streams at the same time, why do you use "ALSA, hw:0.1" exactly ?
For me, using alsa without pulseaudio, with a simple audio chip from a ~5 years old motherboard, I can still play multiple streams. For some reason, since I disabled pulseaudio, pulseaudio doesn't want to detect my audio chip anymore, only the audio from my graphic card which I don't use. I haven't really looked into it, but I'm just thinking maybe your pulseaudio configuration could be improved.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 03:19:29
squentin -

I took that code and made a couple of tweaks to the nowplaying_screenlet2... I put the Title/Album/Artist up top and then added menu items..

Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) TimeBar

[nowplaying_screenlet2_popup]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")

[nowplaying_screenlet3]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

Thanks for posting this as it gave me a bunch of new ideas..

Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 12, 2012, 04:15:23

nowplaying_screenlet2 pops-up a layout (nowplaying_screenlet2_popup) with prev/stop/play/next buttons when the mouse is over the cover, unfortunately currently there is no way to configure where the popup appear, it is positioned below the cover (or above/next to it, if there is no place below) Maybe I'll add options to change this.

O.K., I'm impressed. ;D  My personal preference is for "nowplaying_screenlet2 popup". I've attached another screenshot of all 3 variations you just coded. You can't see the popup transport controls in the first image; they appear over the area where the Title, Artist, Album text is located. They are a little hard to see until you mouse over each button and then the white outline box that appears helps visualize the selected button. Perhaps the outline color could be changed from "white" to match the color of the scrolling time bar which, in my case, is Ubuntu orange? 

Quote
About the playing bar, these simply shows a progress bar with the minimal height, that may depends on your gtk theme. It is possible to skin the time bar, but currently only when using a handle, so it won't help for what you want.

The time playing bar is fine, but I just had a thought - could you include the numeric time "time remaining/total time"  within the time playing bar in small, but visible type? "Time remaining" on far left of bar and "Total time" on far right.

Quote
With gstreamer, selecting the gap-less mode option might help (though it's possible it doesn't make any difference when using a random mode)

I tried gapless mode, it's only a little better. The downside to GMB gapless, is that it seems to clip off the end of too many tracks I play.

Quote
Nowadays you really should be able to play multiple streams at the same time, why do you use "ALSA, hw:0.1" exactly ?

Pulse audio (which I'm not alone in disliking) down samples ALL hi-res audio to 16/44.1 or 48. It either doesn't have the ability to switch audio bitrate and depth on the fly or none of the distros (Ubuntu, Red Hat, Debian, etc., care enough to code this into their distributions. Removing Pulse Audio, as you've noted, seems to screw up everything and make things worse.

I have invested in quite a few hi-rez 24/96 and 24/192 albums purchased from HDTracks. The only way to play these hi-rez tracks at their correct resolution, intermixed in playlists with standard CD res tracks, is to set GMB to ALSA and advanced settings to hw:0,1 .  This way I bypass Pulse Audio and the software mixer and I get bit perfect output from my Asus Xonar STX digital output to my external DAC digital input. Everything plays the way it should (minus the intermittent GMB alsa sink crash). My other alternative, is to use Quod Libet as a player set up for ALSA hw:0,1 just like GMB. It works flawlessly. Unfortunately, Quod Libet while very good, isn't GMB in terms of features I need and want from a music player.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 04:31:28
Here is he code with a Time Slider and the time how you want it...  I think this looks better
Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet2_popup]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings 7VolumeIcon
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon

[nowplaying_screenlet3]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

Here is he code with a TimeBar and the time the way you want it...  It has the total time on the left and remaining on the right that is click able to show how much time is remaining or elapsed (This is on both of these)

Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeBar(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet2_popup]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings 7VolumeIcon
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon

[nowplaying_screenlet3]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

I have also moved the Title/Album/Artist to the Top

Edit - I also added a VolumeIcon and made it scrollable to adjust the volume
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 12, 2012, 05:12:14
VastOne,

Sorry but I couldn't get your version of the code to work. The text layout file I put the code in "nowplaying2b_popup.layout" is not seen by GMB in the list of available widgets to add. Not sure why.

Code: [Select]
[nowplaying_screenlet2b_popup]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 05:20:30
rizlaw

Can you post the file?  and the name of the file?  It is most likely due to the 2 files (your original from squentin) and mine having the same names in them and I will check them out

Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 05:39:48
With Time Slider

Name it

vastone-timeslider.layout

Code: [Select]
[nowplaying_screenlet2_vastone]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet2_popup_vastone]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings 7VolumeIcon
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon

[nowplaying_screenlet3_vastone]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4_vastone]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

With TimeBar

Name it

vastone-timebar.layout

Code: [Select]
[nowplaying_screenlet_vastone2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeBar(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet2_popup_vastone2]
Window = transparent=1
HBmain= 7Prev 7Play 7Next 7BMSettings 7VolumeIcon
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon

[nowplaying_screenlet3_vastone2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4_vastone2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

These should work for you

Copy the content of these and save them to the file names and you should be good to go
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 12, 2012, 05:47:18
VastOne,

I did slightly rename the popup version of the file so as not to be confused with Quentin's popup work. BTW, I'm only interested in the code for the hidden popup transport buttons version.  Adding all the versions together is a bit confusing. :) I'll try again with your naming convenion and see what happens.

Edit: O.K., since what I said above, I've tried it again with the same results. I've attached both files with your recommended filenames.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 05:55:14
I would just use the top two sections of those files then
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 12, 2012, 06:16:35
VastOne,

O.K. finally got the top versions to work. Here's a screen shot of both:
(top shot) nowplaying_screenlet2_vastone
(bottom)  nowplaying_screenlet_vastone2

I think the top is better, however, as you will notice, the remaining time on the far right is obscured by the white triangle in the right lower corner. Otherwise, nice work. :) As a matter of personal preference I do prefer the text info on the bottom along with the time info the way Quentin did it. But I do prefer your time slider visually, particularly because the transport button are easier to visualize without them being superimposed over the text. I guess, for now, it's a trade-off with the popup buttons: text on top makes the buttons easier to see on the bottom and text and slider on the bottom makes the buttons a little harder to see.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 06:35:20
Thanks...  You should have enough info between squentins and mine to see the differences and create your own or edit it to your liking...

Good Luck
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 12, 2012, 09:58:58
That white triangle is from a Gnome 3 issue that I recall from using Gnome Shell on Fedora 15..  There is a fix for it ...  Has to do with a corner move settings hat you can tweak.  I think I may have even discussed it with squentin on these forums somewhere
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 00:57:16
Quentin & VastOne,

Again, many thanks for your help on the widget.

After spending considerable time reading the layout wiki (I won't divulge how long  :-X :-[) and experimenting with code splicing of your respective versions, I've gotten this far:

Code: [Select]
[nowplaying_timeslider_rizlaw]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBtime Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBtime= Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

I've attached a snapshot of what it looks like (minus the popup buttons which appear over the bottom text area when the cover art is moused over).

I still can't figure out how to get the timeslider above the text and below the cover art.

Also, VastOne, you mentioned:

Quote
That white triangle is from a Gnome 3 issue that I recall from using Gnome Shell on Fedora 15..  There is a fix for it ...  Has to do with a corner move settings hat you can tweak.  I think I may have even discussed it with squentin on these forums somewhere

I did a search but couldn't find any post in the forum about it. I'm using Ubuntu 11.10 Unity and Gnome Shell. Is it possible for you to be more specific on how to fix the white triangle issue?
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 01:04:16
This edit puts the timeslider on top

Code: [Select]
[nowplaying_timeslider_rizlaw]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBtime _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup)  Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBtime= Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

As far as the triangle, I cannot be more specific with the fix since I quit using it... I do not recall if I ever did fix it, although I do recall reading about a fix, either on the Ubuntu Forums or The Fedora Forums

I apologize, I cannot be any more specific than that
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 01:14:49
VastOne,

That simple a change. :-[
No need to apologize, thanks again.
Will go surfing Ubuntu Forums to see if I can find an answer.

edit: made the change. Actually, it works out better this way. Now the timeslider is above the cover art with no nasty white triangle obscuring the time played.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 01:26:13
Just wanted to show you my final tweaks on this..  I found this way allows the popup buttons to be on their own at the bottom without ever floating over anything - Of course you do not see them in this image

(http://www.zimagez.com/miniature/screenshot-01122012-022746pm.php) (http://www.zimagez.com/zimage/screenshot-01122012-022746pm.php)

Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) HBTime _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup)
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet_vastone2]
Type=D
DefaultFont=8
Window        = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime        = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeBar(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 01:37:23
I will try it out, although I do prefer the text at the bottom.

Am I correct in assuming that because of this piece of Quentin's code in the nowplaying_screenlet2 layout:
Code: [Select]
hover_layout=nowplaying_screenlet2_popup
that, both my version of the layout and Quentin' need to be in the GMB layout folder simultaneously for the popup buttons to work?

Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 01:41:22
Yes ... that code needs to be there... But you can combine them all into one file, which is what I did here

This does not have squentins in it but it does have yours and mine...

file name is screenslets.layout and it is in /home/myusername/.config/gmusicbrowser/layouts

Code: [Select]
[nowplaying_screenlet2]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) HBTime _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup)
HBTime = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)

[nowplaying_screenlet_vastone2]
Type=D
DefaultFont=8
Window        = size=240x240,transparent=1
VBmain= Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5) _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup) -HBTime
HBTime        = Length(markup="$length",initsize="XX:XX",xalign=0) _TimeBar(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)


[nowplaying_screenlet2_popup]
Window = transparent=1
HBmain= 12Prev 12Play 12Next 12BMSettings 12VolumeIcon
 BMSettings = (icon=gtk-preferences,size=menu) MainMenuItem PSortItem SMLibrary LayoutItem QueueItem PFilterItem SeparatorMenuItem01 MenuItem14(command=OpenPref,label=_"Settings",icon="gtk-preferences") MenuItem05(command=Quit,label=_"Quit",icon="gtk-quit")
SMLibrary = (label=_"Library") MenuItem00(command="RunPerlCode(::ChooseAddPath(0,1))",label=_"Add Music",icon="gtk-add") MenuItem32(command="RunPerlCode(::IdleScan)",label=_"Rescan Collection",icon="gtk-refresh")
VolumeScroll = VolumeIcon

[nowplaying_screenlet3]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBbuttons = Prev Stop Play Next

[nowplaying_screenlet4]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= ABbuttons _Cover(forceratio=1) TimeBar Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
ABbuttons= (xalign=.5,xscale=0) HBbuttons
HBbuttons = Prev Stop Play -Next

[nowplaying_timeslider_rizlaw]
Type=D
DefaultFont=8
Window = size=240x240,transparent=1
VBmain= HBtime _Cover(forceratio=1,hover_delay=1,hover_layout=nowplaying_screenlet2_popup)  Title(xalign=.5) Artist(xalign=.5) Album(xalign=.5)
HBtime= Length(markup="$length",initsize="XX:XX",xalign=0) _TimeSlider(direct_mode=1) PlayingTime(markup="%s",initsize="XX:XX",xalign=1)
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 01:49:57
I really like what you did. A big improvement, particularly the popup buttons. It will become my default.

So if I understand correctly, the "combined" layout code in the above post means that this is the only layout file that needs to be in the layout config folder.
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 01:51:56
Yes, this is all I have in my layouts folder...  And if you or squentin were to add additional layouts or changes, I would just add them to this file

Thanks BTW, I am glad you like it
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: Quentin Sculo on January 13, 2012, 02:10:14
About the resize triangle, it comes from ubuntu specific changes to gtk, it's deactivable globally by editing your gtkrc or something like that : http://forum.gmusicbrowser.org/index.php?topic=428.msg1987#msg1987 (in french but there is a link to an english page)

About the 44100/48000 pulseaudio problem, I remembered reading something about it, that might interest you :
http://arunraghavan.net/2011/10/alternate-sample-rates/

About alsa playing multiple streams, it uses dmix it seems, which will resample everything to one given rate :
http://alsa.opensrc.org/Dmix#Does_dmix_affect_sound_quality.3F

I guess one possibility is using 2 different inputs if your sound card has more than 1, or 2 sound cards/chip, one would be reserved for a single music stream, the other for skype/other. But I don't know much about soundcards.

Quote
The time playing bar is fine, but I just had a thought - could you include the numeric time "time remaining/total time"  within the time playing bar in small, but visible type? "Time remaining" on far left of bar and "Total time" on far right.
The TimeBar widget can include text, like this : TimeBar(text="$current/$left")
But you can't control the text position. available variables are $percent $current $left $total, in addition to the usual variables like $tiltle and %t

Finally, about the popup layout, I started implementing an option that lets you choose where the popup should be positioned above its widget. I just have to make my mind up on the syntax of the option
Title: Re: Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 02:22:43
Thanks for all the info and help Quentin.

Have you looked at the latest code VastOne has submitted which is combined with your code. For now, IMO, it looks like the best visual solution.

By the way, I used Nautilus to delete all the layout files I added to my layout config folder during our experimentation in creating the nowplaying widget, however the deleted layout filenames are still present within GMB's Desktop Widgets control panel list. I've restarted GMB several times and even rebooted, but the old layout filenames won't go away. How do I get rid of them since they are no longer active or needed?
Title: Re : Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 02:27:35
Did you remove them from within the GMB Desktop Widget too?
Title: Re : Questions about: Desktop Widget - Button, Songs & Cover
Post by: Quentin Sculo on January 13, 2012, 02:28:21
Quote
I've restarted GMB several times and even rebooted, but the old layout filenames won't go away. How do I get rid of them since they are no longer active or needed?
That's a bug, I'll fix it so that the button to remove the selected widget is shown even if the layout is unknown
Title: Re : Questions about: Desktop Widget - Button, Songs & Cover
Post by: VastOne on January 13, 2012, 02:30:13
Quentin..  Thanks for all the explanations and code!!!!
Title: Re : Re : Questions about: Desktop Widget - Button, Songs & Cover
Post by: rizlaw on January 13, 2012, 02:30:48
Did you remove them from within the GMB Desktop Widget too?

Some, not all. But, the ones I didn't remove from within the widget control program were not active when I deleted them using Nautilus.