The time now is Sat 27 Feb 2021, 05:06
All times are UTC - 4 |
Page 112 of 156 [2339 Posts] |
Goto page: Previous 1, 2, 3, ..., 110, 111, 112, 113, 114, ..., 154, 155, 156 Next |
Author |
Message |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Sun 09 Jun 2013, 14:57 Post subject:
|
|
4.0.0 Release Notes
I looked at the missing icon in the trayapp (C-code which I don't know). Using the svg icon is supported, but HOW TO SIZE IT ?
Source code is here
Thanks for any help
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
vovchik

Joined: 23 Oct 2006 Posts: 1538 Location: Ukraine
|
Posted: Sun 09 Jun 2013, 16:57 Post subject:
|
|
Dear Zigbert,
You can either first scale the svg (with a text editor) like this (very quick and dirty):
Code: | <svg width="25" height="25" viewBox="0 0 25 25" transform="scale(0.1)">
<g transform="matrix(1,0,0,1,-252,-282)">
<path style="fill:#595959;fill-opacity:0.7;stroke:#222222" d="m 501,410 a 121,121 0 0 1 -242,0 121,121 0 1 1 242,0 z"/>
<path style="fill:#222222;fill-opacity:0.7;stroke:none" d="m 472,409 a 92,92 0 0 1 -184,0 92,92 0 1 1 184,0 z"/>
<path style="fill:#5e9650;fill-opacity:1;stroke:none" d="m 438,408 c 0,6 -4,8 -4,8 l -76,44 c 0,0 -6,5 -12,2 -6,-3 -4,-7 -4,-7 l 0,-93 c 0,0 -1,-4 3,-7 4,-3 8,0 8,0 5,3 76,43 78,44 0,0 7,3 7,9 z"/>
</g>
</svg> |
or modify the tray code like this (also quick and dirty):
Code: | // http://www.meownplanet.net/zigbert/pmusic_PLUGIN_trayapp-0.3.c
/*Simple Pmusic tray icon by Iguleder
* Based on the tray icon skeleton by Barry Kauler*/
/* gcc `pkg-config --cflags --libs gtk+-2.0` -o pmusic_tray pmusic_tray.c */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gstdio.h>
GdkPixbuf *pmusic_pixbuf, *pm_pixbuf;
GError *gerror;
//1 if Pmusic GUI is running, otherwise 0
int running=1;
// cd playing?
FILE *fp;
char cdplaying[21]="/tmp/cdplaying";
void play_next (GtkWidget *tray_icon, gpointer userdata)
{
system("pmusic -s next &");
}
void play_previous (GtkWidget *tray_icon, gpointer userdata)
{
system("pmusic -s prev &");
}
void quit_pmusic (GtkWidget *tray_icon, gpointer userdata)
{
system("pmusic -s quit");
}
void pause_song (GtkWidget *tray_icon, gpointer userdata)
{
system("pmusic -s pause");
}
void view_popup_menu (GtkWidget *tray_icon, GdkEventButton *event, gpointer userdata)
{
//add menu icons
GtkWidget *menu, *menuitem1, *menuitem2, *menuitem3, *menuitem4, *icon1, *icon2, *icon3, *icon4 ;
menu = gtk_menu_new();
menuitem1 = gtk_image_menu_item_new_with_label("Quit Pmusic");
icon1 = gtk_image_new_from_stock(GTK_STOCK_QUIT, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem1), icon1);
menuitem2 = gtk_image_menu_item_new_with_label("Next track");
icon2 = gtk_image_new_from_stock(GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem2), icon2);
menuitem3 = gtk_image_menu_item_new_with_label("Previous track");
icon3 = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PREVIOUS, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem3), icon3);
menuitem4 = gtk_image_menu_item_new_with_label("Pause / Play");
icon4 = gtk_image_new_from_file("/tmp/icon_playpause.png");
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem4), icon4);
g_signal_connect(menuitem1, "activate", (GCallback) quit_pmusic, tray_icon);
g_signal_connect(menuitem2, "activate", (GCallback) play_next, tray_icon);
g_signal_connect(menuitem3, "activate", (GCallback) play_previous, tray_icon);
g_signal_connect(menuitem4, "activate", (GCallback) pause_song, tray_icon);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem1);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem2);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem3);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem4);
gtk_widget_show_all(menu);
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, (event != NULL) ? event->button : 0, gdk_event_get_time((GdkEvent*)event));
}
gboolean view_onPopupMenu (GtkWidget *tray_icon, gpointer userdata)
{
view_popup_menu(tray_icon, NULL, userdata);
return TRUE; /* we handled this */
}
void tray_icon_on_click(GtkStatusIcon *tray_icon, gpointer user_data)
{
// test if a CD is playing and resume appropriate GUI
system("ps -A|grep -q 'cdda2wav';echo $? >/tmp/cdplaying");
if (running == 0)
{
fp = fopen(cdplaying,"r");
int cdval;
if(fp == NULL)
{
printf("can't open file\n");
return;
}
while(!feof(fp))
{
fscanf(fp,"%d",&cdval);
}
fclose(fp);
{
if (cdval == 0)
{
system("pmusic -j -p '.CD' &");
}
else
{
system("pmusic &");
}
}
printf("%d", cdval);
running=1;
gtk_status_icon_set_tooltip(tray_icon, "Click to hide Pmusic");
}
else
{
system("pmusic -b &");
running=0;
gtk_status_icon_set_tooltip(tray_icon, "Click to show Pmusic");
}
}
static GtkStatusIcon *create_tray_icon()
{
GtkStatusIcon *tray_icon;
tray_icon = gtk_status_icon_new();
g_signal_connect(G_OBJECT(tray_icon), "activate", G_CALLBACK(tray_icon_on_click), NULL);
g_signal_connect(G_OBJECT(tray_icon), "popup-menu", (GCallback) view_onPopupMenu, NULL);
pmusic_pixbuf=gdk_pixbuf_new_from_file("/usr/share/icons/hicolor/scalable/apps/pmusic.svg",&gerror);
pm_pixbuf=gdk_pixbuf_scale_simple(pmusic_pixbuf,24,24,3);
gtk_status_icon_set_from_pixbuf(tray_icon,pm_pixbuf);
gtk_status_icon_set_tooltip(tray_icon, "Click to hide Pmusic");
gtk_status_icon_set_visible(tray_icon, TRUE);
return tray_icon;
}
int main(int argc, char **argv)
{
system("ln -sf $HOME/.pmusic/tmp/icon_playpause.png /tmp");
GtkStatusIcon *tray_icon;
gtk_init(&argc, &argv);
tray_icon = create_tray_icon();
gtk_main();
return 0;
}
|
I would still de-reference the pixbufs above, but that is minor.
With kind regards,
vovchik
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Sun 09 Jun 2013, 18:49 Post subject:
|
|
Hello vovchik and Sigmund
I came up with a different solution, but it could be better.
Code: | --- pmusic_tray.c.orig 2013-06-10 06:35:17.992698106 +1000
+++ pmusic_tray.c 2013-06-10 08:41:12.069738302 +1000
@@ -20,6 +20,8 @@
// cd playing?
FILE *fp;
char cdplaying[21]="/tmp/cdplaying";
+FILE *fq;
+char pmstop[21]="/tmp/pmusic_stop";
void play_next (GtkWidget *tray_icon, gpointer userdata)
{
@@ -58,9 +60,38 @@
menuitem3 = gtk_image_menu_item_new_with_label("Previous track");
icon3 = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PREVIOUS, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem3), icon3);
- menuitem4 = gtk_image_menu_item_new_with_label("Pause / Play");
- icon4 = gtk_image_new_from_file("/tmp/icon_playpause.png");
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem4), icon4);
+
+ //test if we are paused or playing
+ system("wc -l ~/.pmusic/tmp/icon_playpause.svg|grep -q 3;echo $? > /tmp/pmusic_stop");
+ {
+ fq = fopen(pmstop,"r");
+ int stopval;
+ if(fq == NULL)
+ {
+ printf("can't open file\n");
+ return;
+ }
+ while(!feof(fq))
+ {
+ fscanf(fq,"%d",&stopval);
+
+ }
+ fclose(fq);
+ {
+ if (stopval == 0)
+ {
+ menuitem4 = gtk_image_menu_item_new_with_label("Play");
+ icon4 = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem4), icon4);
+ }
+ else
+ {
+ menuitem4 = gtk_image_menu_item_new_with_label("Pause");
+ icon4 = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuitem4), icon4);
+ }
+ }
+ }
g_signal_connect(menuitem1, "activate", (GCallback) quit_pmusic, tray_icon);
g_signal_connect(menuitem2, "activate", (GCallback) play_next, tray_icon);
@@ -155,9 +186,8 @@
int main(int argc, char **argv)
{
- system("ln -sf $HOME/.pmusic/tmp/icon_playpause.png /tmp");
+ //system("ln -sf $HOME/.pmusic/tmp/icon_playpause.png /tmp");
-
GtkStatusIcon *tray_icon;
gtk_init(&argc, &argv);
|
What it does is checks the difference in line numbers of the ~/.pmusic/tmp/icon_playpause.svg and acts accordingly. It now uses a stock gtk icon for play or pause.The advantage is that we can have now the correct label and not "Play / Pause" in the popup. The disadvantage is that the svg code may change in the future (or not). Sigmund, if you could add a temp file indicating the status of "pause" (say ~/.pmusic/tmp/pause) containing 0 for true or 1 for false it could reduce code and potentially be faster, although mininally, but it certainly would be more robust.
Patch and source attached.
Description |
new 4c? compile with: gcc `pkg-config --cflags --libs gtk+-2.0` -o pmusic_trayapp pmusic_tray.c then drop it into /usr/local/pmusic/plugins
|

Download |
Filename |
pmusic_tray.c.gz |
Filesize |
1.67 KB |
Downloaded |
448 Time(s) |
Description |
4c against 3c
|

Download |
Filename |
tray_app-3c.diff.gz |
Filesize |
854 Bytes |
Downloaded |
443 Time(s) |
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: Sun 09 Jun 2013, 21:54 Post subject:
|
|
Hi.
Sorry to say, but the early versions of pMusic did not fit to my needs and did also not feel really comfortable to me - but, that's just me. Nothing bad about pMusic in general. Even though I did not use it and removed it from LazY Puppy, I've followed the thread from time to time.
By now, having version 4.0.0 it seems to became a smart application and so, I gave it a go tonight. I extracted the pet, added the Nad5 Theme to the pet, modified the files for the use of gtkdialog 0.8.4 by naming it gtkdialog5 and included the gtkdialog5 binary (grabbed from LxPup 13.01) to the extracted pMusic Package. Edited the .desktop files to have German menu entries and also a nicer Icon for pMusic CD player. Repackaged it and converted it to LazY Puppy SFS (SFS P.L.U.S.) format. Created a RunScript and here it is:
Executed by SFS P.L.U.S. RunScript, running from SFS and currently playing Frank Zappa's Joe's Garage.
Even though I did not really like the early versions, I must say: this version could conquer my heart!
But there is something, a small (but big for me) issue when playing concept and/or live albums. There is a interrupt between the tracks. This might not be noticed when playing albums containing usual chart stuff, but when playing concept or live albums it is really ugly.
Is there any solution/option to listen to live albums just as it would be played from LP or CD?
Thanks.
So far, well done!
RSH
 |
Description |
pMusic 4.0.0 running in LazY Puppy 3 e17 from SFS !!! |
Filesize |
52.08 KB |
Viewed |
519 Time(s) |

|
_________________ LazY Puppy Home
The new LazY Puppy Information Centre
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Mon 10 Jun 2013, 12:52 Post subject:
|
|
4.0.0 Release Notes
vovchik and Mick
Thank you very much for your coding skills. I really appreciate your input. We have a solution, but we have to decide which one is the best. Vovchik's solution is the most robust cause it's not depending on the content in the svg. Mick's solution takes it all one step further and uses only stock icons and also changes label. The check wc -l ~/.pmusic/tmp/icon_playpause.svg|grep -q 3 is weak cause it relies on that the play.svg contains 3 lines while the pause don't. In another theme, this could be something else. The check could be strengthen by comparing the size of the files $HOME/.pmusic/icon_playpause.svg and /usr/local/pmusic/$THEME/icon_play.svg. The variable $THEME is set in $HOME/.pmusic/pmusicrc
Sigmund
_________________ Stardust resources
Last edited by zigbert on Mon 10 Jun 2013, 14:55; edited 1 time in total
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Mon 10 Jun 2013, 13:55 Post subject:
|
|
4.0.0 Release Notes
R-S-H
I am glad you like it (a bit)
You can minimize the gap between tracks in the preferences, but I ahve not found a way to get gapless playback with the very simple play-engine based on ffmpeg | aplay
Looking at your screenshot, I see 2 issues that worries ME.
- There is a missing icon for the button to choose playmode.
- There is no albumart and info about playing track. (made a brief test, and there is an issue with updating track info if file has no meta-tags. I will look into that.)
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Mon 10 Jun 2013, 15:41 Post subject:
|
|
zigbert wrote: | 4.0.0 Release Notes
vovchik and Mick
Thank you very much for your coding skills. I really appreciate your input. We have a solution, but we have to decide which one is the best. Vovchik's solution is the most robust cause it's not depending on the content in the svg. Mick's solution takes it all one step further and uses only stock icons and also changes label. The check wc -l ~/.pmusic/tmp/icon_playpause.svg|grep -q 3 is weak cause it relies on that the play.svg contains 3 lines while the pause don't. In another theme, this could be something else. The check could be strengthen by comparing the size of the files $HOME/.pmusic/icon_playpause.svg and /usr/local/pmusic/$THEME/icon_play.svg. The variable $THEME is set in $HOME/.pmusic/pmusicrc
Sigmund |
Yes, I knew my "solution" wasn't quite right. I think I know what to do.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Mon 10 Jun 2013, 16:56 Post subject:
|
|
4.0.0 Release Notes
R-S-H
I have fixed the missing track info update for files without meta-tags. This is important because it guides the user to extended info like albumart, lyrics, album, discography...
...But I still wonder why you are missing icon(s). Did you include the dir $HOME/.pmusic in your SFS? If so, that is not recommended. The default rc file is /usr/local/pmusic/pmusicrc. pMusic initialize if $HOME/dir is missing (or if version is old), and then set up some default settings like the playmode (with corresponding button-icon)
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: Mon 10 Jun 2013, 17:38 Post subject:
|
|
Quote: | Did you include the dir $HOME/.pmusic in your SFS? |
Yes, I did, because I wanted to have the Nad5 theme already at first start. I've tried installed version first and remembering the icons were there.
I assume to change this in /usr/local/pmusic/pmusicrc ?
EDIT:
Thanks for the "gap between tracks" info. Did not see this...
_________________ LazY Puppy Home
The new LazY Puppy Information Centre
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 5524 Location: Ontario
|
Posted: Mon 10 Jun 2013, 18:32 Post subject:
|
|
The icons are too dark in Precise NOP
____________________________________-
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Mon 10 Jun 2013, 20:32 Post subject:
|
|
Tray icon
OK, not testing the state of the icon at all now, just the state of aplay, this *should* be reliable and works ok for me if I delete ~/.pmusic or not. Also changed some variable names to make more sense.
EDIT: code removed
I have tested this a bit, even in old pmusic-3.2.3 and 3.3.0 and it seems quite stable, the icon works as expected, even with CD's.
I have now gettex'd the source and it is attached with a compile script, pot file and 32 bit binary.
--------------------------------------------------------------------------
Bug report
Now, in 4.0 there is a problem I experience with CD playing, or should I say the lack of CD playing, they don't play with the "source not detected" error, same CD's play fine in older versions mentioned.
Here is commandline output: Code: | # defaultcdplayer
# /usr/local/pmusic/func_cd: line 9: 20312 Killed cdda2wav dev=$CD_DEVICE -info-only -no-infofile > $WORKDIR/cd-cddb 2>&1
aplay: playback:2510: read error
EXIT="Ready"
rm: cannot remove ‘/root/.pmusic/tmp/splashtext2’: No such file or directory
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
aplay: playback:2510: read error
|
Stock slacko-5.5
It happens every time.
Thanks!
EDIT2: ok, found the bug;
Line 197
Code: | echo "LANG=C cdda2wav dev=$CD_DEVICE --offset=$(($SS*75)) -t $CDDA_TRACK -Owav - | ffmpeg -i pipe:0 -f au - 2>> $WORKDIR/ffmpeg_output | aplay $APLAY_DEVICE 2> $WORKDIR/aplay_error" >> $WORKDIR/exec |
Trouble is that $CDDA_TRACK don't exist because echo "$PLAYLIST" | cut -d: -f2 > $WORKDIR/CDDA_TRACK no longer exists.. I can fix it for me but it's ugly! I don't want to pollute your more elegant structure with my rubbish . There is obviously some reason you changed it but overlooked the $WORKDIR/CDDA_TRACK it appears.
Mick
Description |
source and 32 bit bin, plus pot file and compile script
|

Download |
Filename |
pmusic-tray-4.tar.gz |
Filesize |
6.12 KB |
Downloaded |
367 Time(s) |
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Tue 11 Jun 2013, 15:21 Post subject:
|
|
4.0.0 Release Notes
R-S-H wrote: | I assume to change this in /usr/local/pmusic/pmusicrc ? | Yes.
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
R-S-H
Joined: 18 Feb 2013 Posts: 490
|
Posted: Tue 11 Jun 2013, 17:38 Post subject:
|
|
Hi.
I did it in /usr/local/pmusic/pmusicrc but it starts with the Gtk theme. Is this config file appearing in /root/.pmusic created by pmusic? It isn't a copy of /usr/local/pmusic/pmusicrc ?
Where to find the code in pmusic ?
RSH
P.S.
I did decide to upload pmusic in SFS form for the LazY Puppy users, when latest noticed bug is fixed!
_________________ LazY Puppy Home
The new LazY Puppy Information Centre
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Tue 11 Jun 2013, 17:52 Post subject:
|
|
Hopefully someone will put together more themes in the future. I made NAD as an example.
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6629 Location: Valåmoen, Norway
|
Posted: Tue 11 Jun 2013, 17:55 Post subject:
|
|
4.0.0 Release Notes
R-S-H
The rc file in /usr/local/pmusic is copied to $HOME/.pmusic if $HOME/.pmusic doesn't exist.
Quote: | I did decide to upload pmusic in SFS form for the LazY Puppy users, when latest noticed bug is fixed! | Great - some bugs are expected, and I will release 4.0.1 soon.
Sigmund
_________________ Stardust resources
Last edited by zigbert on Tue 11 Jun 2013, 17:59; edited 1 time in total
|
Back to top
|
|
 |
|
Page 112 of 156 [2339 Posts] |
Goto page: Previous 1, 2, 3, ..., 110, 111, 112, 113, 114, ..., 154, 155, 156 Next |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|