pMusic 6.0.0
Version 4.0.0
See main post
Changelog
- Bump dependencies to gtkdialog-svn_512
- Sourcelist.
. . . .- Right-click menu for Favorites/Music/File/Dir management.
. . . .- Multiple selection.
. . . .- Expand/collapse playlists by doubleclick.
. . . .- Icons for playlist and track (with rating indication).
. . . .- 'Repair playlist' is moved here from main menu.
- Favorites - New module.
. . . .- Replaces Bookmarks, Multiple playlists and Overview.
. . . .- Cooperates with the rating module.
. . . .- New internal playlist file-format (pmd) that contains info from db.
. . . .- Possible to group favorite playlists.
. . . .- Default favorite marks is $HOME and Jamendo Top100
- Moved from single-click to double-click for main actions.
- MyMusic DB
. . . .- Include DB-editor
. . . .- Remove menuitems tracks/collections from Music_sources menu
. . . .- Do not include files from /incomplete/ dir (streamripper).
. . . .- Use album column for pmu-albums (pmusic generated).
. . . .- Improve file locking to avoid db corruption.
. . . .- Save backup of db when doing a full indexing.
- Repair playlist / rebuild album.
. . . .- Moved from main menu to right-click menu in sourcelist
. . . .- Auto-repair when adding tracks from playlists. Searching db for similar info.
. . . .- New dialog to manually set missing source. Right-click in sourcelist or trackinfo - albumtab.
- Radio-Hits
. . . .- Right-click menu to browse and add to favorites.
. . . .- Remove sub-menu in main gui.
. . . .- Add radiohits dir to favorites when preset is saved.
- Browsing.
. . . .- Show icons.
. . . .- Do only search symlinks for directories.
. . . .- Expand/collapse playlists.
. . . .- Bugfix: Add a track from a dir NOT in db should update db with all tracks in dir.
- Search.
. . . .- Separate collections into My Playlists and pMusic albums.
. . . .- Tooltip-markup for search-field
. . . .- Default info-text (instead of $HOME) in search-field.
. . . .- If no 'collections' is found, skip heading(s).
- Playque.
. . . .- Right-click menu: Deactivate also icons for deactivated items.
. . . .- If source isn't found, search alternative source in db.
- Rating.
. . . .- Also provide icon to tracks rating.
- Smartadd.
. . . .- Rating filter.
. . . .- Set source.
- Dialog 'Db mismatch...'
. . . .- Bugfix: Move entire directory failed.
. . . .- Bugfix: Move entire directory could lead to double entries in db.
. . . .- Bugfix: Fix links in trackinfo album-tab.
. . . .- Bugfix: Lock db while updating.
- Webmusic
. . . .- Allow https streams.
. . . .- Bugfix: Jamendo has moved URL and ffmpeg doesn't support the new https location. We pipe it through wget.
- Trackinfo.
. . . .- Bugfix: Album: Update track-list is same artist but different album.
- Playmode has got its own menu.
- All builtin grapichs are now svg.
- Improved CD-audio detection.
- Updated FAQ.
. . . .- Explained rating model.
. . . .- Mostly removed not relevant stuff.
- Updated NAD theme.
- Updated Manager frontend with more accurate placement of volume slider.
- Removed function file box_progress --> not in use.
- Removed frame around now-playing svg in main gui.
- Updated info in about dialog.
- Top Hits plugin.
. . . .- Don't close window after building list.
. . . .- Include in pMusic pet.
. . . .- Option to add new list to favorites.
. . . .- Default date is set today.
- Bugfix: Add playlist externally: show filename default in save-dialog.
- Bugfix: Open pmu from Rox --> play/pause icon fails.
- Bugfix: import m3u list: Use current path if path is invalid
- Bugfix: Add m3u that contains link to non-existing file.
- Bugfix: Statusbar too narrow in Puppy Raring. (thanks to don570)
- Bugfix: Build DB with meta-tags if no mymusic db file doesn't already exist.
- Bugfix: Quick update of DB when adding tracks via a playlist file.
- Bugfix: missing gettext info in pmusic_cd. (thanks to robwoj44)
- Bugfix: open pMusic with all tracks in dir with command 'pmusic /dir' doesn't work (thanks to PaulR)
- Bugfix: About: Link to gtkdialog kept graphical theme of pMusic.
See main post
Changelog
- Bump dependencies to gtkdialog-svn_512
- Sourcelist.
. . . .- Right-click menu for Favorites/Music/File/Dir management.
. . . .- Multiple selection.
. . . .- Expand/collapse playlists by doubleclick.
. . . .- Icons for playlist and track (with rating indication).
. . . .- 'Repair playlist' is moved here from main menu.
- Favorites - New module.
. . . .- Replaces Bookmarks, Multiple playlists and Overview.
. . . .- Cooperates with the rating module.
. . . .- New internal playlist file-format (pmd) that contains info from db.
. . . .- Possible to group favorite playlists.
. . . .- Default favorite marks is $HOME and Jamendo Top100
- Moved from single-click to double-click for main actions.
- MyMusic DB
. . . .- Include DB-editor
. . . .- Remove menuitems tracks/collections from Music_sources menu
. . . .- Do not include files from /incomplete/ dir (streamripper).
. . . .- Use album column for pmu-albums (pmusic generated).
. . . .- Improve file locking to avoid db corruption.
. . . .- Save backup of db when doing a full indexing.
- Repair playlist / rebuild album.
. . . .- Moved from main menu to right-click menu in sourcelist
. . . .- Auto-repair when adding tracks from playlists. Searching db for similar info.
. . . .- New dialog to manually set missing source. Right-click in sourcelist or trackinfo - albumtab.
- Radio-Hits
. . . .- Right-click menu to browse and add to favorites.
. . . .- Remove sub-menu in main gui.
. . . .- Add radiohits dir to favorites when preset is saved.
- Browsing.
. . . .- Show icons.
. . . .- Do only search symlinks for directories.
. . . .- Expand/collapse playlists.
. . . .- Bugfix: Add a track from a dir NOT in db should update db with all tracks in dir.
- Search.
. . . .- Separate collections into My Playlists and pMusic albums.
. . . .- Tooltip-markup for search-field
. . . .- Default info-text (instead of $HOME) in search-field.
. . . .- If no 'collections' is found, skip heading(s).
- Playque.
. . . .- Right-click menu: Deactivate also icons for deactivated items.
. . . .- If source isn't found, search alternative source in db.
- Rating.
. . . .- Also provide icon to tracks rating.
- Smartadd.
. . . .- Rating filter.
. . . .- Set source.
- Dialog 'Db mismatch...'
. . . .- Bugfix: Move entire directory failed.
. . . .- Bugfix: Move entire directory could lead to double entries in db.
. . . .- Bugfix: Fix links in trackinfo album-tab.
. . . .- Bugfix: Lock db while updating.
- Webmusic
. . . .- Allow https streams.
. . . .- Bugfix: Jamendo has moved URL and ffmpeg doesn't support the new https location. We pipe it through wget.
- Trackinfo.
. . . .- Bugfix: Album: Update track-list is same artist but different album.
- Playmode has got its own menu.
- All builtin grapichs are now svg.
- Improved CD-audio detection.
- Updated FAQ.
. . . .- Explained rating model.
. . . .- Mostly removed not relevant stuff.
- Updated NAD theme.
- Updated Manager frontend with more accurate placement of volume slider.
- Removed function file box_progress --> not in use.
- Removed frame around now-playing svg in main gui.
- Updated info in about dialog.
- Top Hits plugin.
. . . .- Don't close window after building list.
. . . .- Include in pMusic pet.
. . . .- Option to add new list to favorites.
. . . .- Default date is set today.
- Bugfix: Add playlist externally: show filename default in save-dialog.
- Bugfix: Open pmu from Rox --> play/pause icon fails.
- Bugfix: import m3u list: Use current path if path is invalid
- Bugfix: Add m3u that contains link to non-existing file.
- Bugfix: Statusbar too narrow in Puppy Raring. (thanks to don570)
- Bugfix: Build DB with meta-tags if no mymusic db file doesn't already exist.
- Bugfix: Quick update of DB when adding tracks via a playlist file.
- Bugfix: missing gettext info in pmusic_cd. (thanks to robwoj44)
- Bugfix: open pMusic with all tracks in dir with command 'pmusic /dir' doesn't work (thanks to PaulR)
- Bugfix: About: Link to gtkdialog kept graphical theme of pMusic.
This post will be used to post extra stuff/info about the 4. generation of pMusic
Main post in this thread is linked here - Release notes.
4.0.x Highlights
4.0.x Notes
Sigmund
Main post in this thread is linked here - Release notes.
4.0.x Highlights
- The new Favorites-module replaces bookmarks, multiple playlists and overview.
- Right-click menus has given a simplified workflow/gui with enhanced features (like playlist/file management).
- Sourcelist now supports multiple selection. In combination with right-click options this makes management much more powerful.
- The handling of the dynamic DB is now so good that searching is preferred over browsing.
- Tighter integration of RadioHits Grabber and TopHits plugin.
- All graphics/themes are now svg.
- The rating module is extended to also use graphics, but still lighting fast.
- Complete changelog here.
4.0.x Notes
- Version upgrade from version 3.x.x is ok, but not from 2.x.x. For a fresh install, please remove /root/.pmusic/
- pMusic 4 does NOT use UTF-8 when internally working with the db (grep). If anyone meets issues regarding this, I really want to hear. There is a global variable to change this in line 15 in /usr/local/pmusic/pmusic.
- Some features didn't make it into this release, but things are not stopping here...
- This release require an updated gtkdialog - attached.
- Note to Precise/Racy/Lucid users; You might think that the builtin ffmpeg-0.8 is too old since pMusic 3/4 requires 0.11. BUT, most will work ok with ffmpeg-0.8. pMusic take advantage of new features in 0.11 (ie. embedding of albumart into audio-files), but core functions are untouched.
Sigmund
- Attachments
-
- gtkdialog-racy_lucid-0.8.4r514.pet
- (89.85 KiB) Downloaded 669 times
-
- gtkdialog-precise-0.8.4r514.pet
- (96.33 KiB) Downloaded 867 times
-
- gtkdialog-slacko-0.8.4r514.pet
- (97.11 KiB) Downloaded 673 times
Last edited by zigbert on Thu 18 Jul 2013, 21:19, edited 9 times in total.
- OscarTalks
- Posts: 2196
- Joined: Mon 06 Feb 2012, 00:58
- Location: London, England
Hello Sigmund,
Been doing a bit of quick testing of pMusic 4.0.0
Looks good in Slacko (except for missing tray app icon - see below).
In Precise (and other Puppies with earlier JWM) the menu icon is missing because of not supporting .svg icons I think. Maybe you need to include a .png icon somewhere to cover this. Files and streams are playing with the libav-0.8.x (ffmpeg substitute).
Not sure if you are intending to support Wary/Racy with pMusic 4.0.0 but I compiled gtkdialog r514 in Racy and installed pMusic. The Hoovers music plays but there is no GUI. Console shows a segmentation fault
By the way, sorry if this has been covered before, but what are we supposed to do with the 2 symlinks named gtkdialog and the files gtkdialog3 and gtkdialog4 in /usr/sbin and /usr/bin? Is the arrangement in Slacko with everything in /usr/sbin the best way?
Edit:- In Slacko the tray app is missing the icon for Pause / Play
Been doing a bit of quick testing of pMusic 4.0.0
Looks good in Slacko (except for missing tray app icon - see below).
In Precise (and other Puppies with earlier JWM) the menu icon is missing because of not supporting .svg icons I think. Maybe you need to include a .png icon somewhere to cover this. Files and streams are playing with the libav-0.8.x (ffmpeg substitute).
Not sure if you are intending to support Wary/Racy with pMusic 4.0.0 but I compiled gtkdialog r514 in Racy and installed pMusic. The Hoovers music plays but there is no GUI. Console shows a segmentation fault
Code: Select all
# pmusic
grep: /root/.pmusic/pmusicrc: No such file or directory
/usr/local/pmusic/pmusic: line 46: [: : integer expression expected
cat: /root/.pmusic/index_mymusic: No such file or directory
gtk-update-icon-cache: Cache file created successfully.
cat: /root/.pmusic/tmp/sourcelist: No such file or directory
/usr/local/pmusic/pmusic: line 465: 28528 Segmentation fault $GTKDIALOG -f $WORKDIR/xml_pmusic${XML_SUFFIX} -G +"$X"+"$Y" 2>$STDERR
#
Edit:- In Slacko the tray app is missing the icon for Pause / Play
- Attachments
-
- pmusic-tray.png
- Missing icon in tray app
- (8.38 KiB) Downloaded 1651 times
Oscar in England
I have added a link in the main post to the 4.0.0 notes
4.0.0 Highlights
4.0.0 Highlights
- The new Favorites-module replaces bookmarks, multiple playlists and overview.
- Right-click menus has given a simplified workflow/gui with enhanced features (like playlist/file management).
- Sourcelist now supports multiple selection. In combination with right-click options this makes management much more powerful.
- The handling of the dynamic DB is now so good that searching is preferred over browsing.
- Tighter integration of RadioHits Grabber and TopHits plugin.
- All graphics/themes are now svg.
- The rating module is extended to also use graphics, but still lighting fast.
- Complete changelog here.
4.0.0 Release Notes
OscarTalks
Thank you for looking at pMusic!
Missing icon in Precise
Yeah, the version of JWM in Precise is rather old, and does not support svg. Hmmm, what am I gonna do about it? Do we actually support pMusic 4 on Precise, Wary, Lucid and Racy? Hmm... I let it go for now - it is no showstopper.
Sigmund
OscarTalks
Thank you for looking at pMusic!
Missing icon in Precise
Yeah, the version of JWM in Precise is rather old, and does not support svg. Hmmm, what am I gonna do about it? Do we actually support pMusic 4 on Precise, Wary, Lucid and Racy? Hmm... I let it go for now - it is no showstopper.
Sigmund
4.0.0 Release Notes
In my gtkdialog pet for Presice I replace /usr/bin/gtkdialog. pMusic 4 ONLY searches for 'gtkdialog' - not gtkdialog3 or gtkdialog4. I see no reason for keeping 3 versions of gtkdialog in one iso as gtkdialog is nearly 100% backwards compatible. There were some issues a year ago, but I have not seen any problems lately.
Sigmund
I have to admit, I became a bit surprised when I look into Precise and saw 2 executables of gtkdialog. Only 1 of them will work - and that is /usr/bin/gtkdialog. Simply because /usr/bin is set before /usr/sbin in the $PATH environmental variable.OscarTalks wrote:By the way, sorry if this has been covered before, but what are we supposed to do with the 2 symlinks named gtkdialog and the files gtkdialog3 and gtkdialog4 in /usr/sbin and /usr/bin? Is the arrangement in Slacko with everything in /usr/sbin the best way?
In my gtkdialog pet for Presice I replace /usr/bin/gtkdialog. pMusic 4 ONLY searches for 'gtkdialog' - not gtkdialog3 or gtkdialog4. I see no reason for keeping 3 versions of gtkdialog in one iso as gtkdialog is nearly 100% backwards compatible. There were some issues a year ago, but I have not seen any problems lately.
Sigmund
4.0.0 Release Notes
Missing icon in trayapp is noted. I wonder if the trayapp supports svg? (Does it Mick?) Maybe we need a png anyway...
For those wondering , - The trayapp is NOT a part of pMusic 4. It is an external plugin, and can be installed via the 'File' menu.
Sigmund
Missing icon in trayapp is noted. I wonder if the trayapp supports svg? (Does it Mick?) Maybe we need a png anyway...
For those wondering , - The trayapp is NOT a part of pMusic 4. It is an external plugin, and can be installed via the 'File' menu.
Sigmund
4.0.0 Release Notes
Sigmund
My PC won't run Wary/Racy, so I am not able to test this. But I suppose that Wary has an old ffmpeg and not streamripper. so more deps must be in place to get the best out of pMusic 4. Maybe it is time to focus on Precise instead? ... later ... Actually, it seems ok to use ffmpeg 0.8 as requirement because trying to add a embedded albumart just fails - no harm. On the bad side, there is no way to test if the installed ffmpeg supports embedded albumart as there is no specific attribute to do so. A version check could be done. But to be honest, there is a versioning-hell with version-numbers, nightly-builds and also unique libav numbering.OscarTalks wrote:Not sure if you are intending to support Wary/Racy with pMusic 4.0.0 but I compiled gtkdialog r514 in Racy and installed pMusic. The Hoovers music plays but there is no GUI. Console shows a segmentation fault
Sigmund
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
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
Dear Zigbert,
You can either first scale the svg (with a text editor) like this (very quick and dirty):
or modify the tray code like this (also quick and dirty):
I would still de-reference the pixbufs above, but that is minor.
With kind regards,
vovchik
You can either first scale the svg (with a text editor) like this (very quick and dirty):
Code: Select all
<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>
Code: Select all
// 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;
}
With kind regards,
vovchik
Hello vovchik and Sigmund
I came up with a different solution, but it could be better.
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.
I came up with a different solution, but it could be better.
Code: Select all
--- 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);
Patch and source attached.
- Attachments
-
- pmusic_tray.c.gz
- 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 - (1.67 KiB) Downloaded 420 times
-
- tray_app-3c.diff.gz
- 4c against 3c
- (854 Bytes) Downloaded 412 times
Puppy Linux Blog - contact me for access
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
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
- Attachments
-
- image-2.jpg
- pMusic 4.0.0 running in LazY Puppy 3 e17 from SFS !!!
- (52.08 KiB) Downloaded 502 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]
The new LazY Puppy Information Centre[/url][/b]
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
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
Last edited by zigbert on Mon 10 Jun 2013, 18:55, edited 1 time in total.