void GMNotifyDaemon::notify_track_change(const GMTrack & track){ FXString body = FXString::value(fxtrformat("%s\n%s (%d)"),track.artist.text(),track.album.text(),track.year); /// Dirty Hack. According to the spec, we shouldn't have to do this, /// but try finding a notification notifydaemon that actually implements it... /// http://www.galago-project.org/specs/notification/0.9/index.html body.substitute("&","&"); FXImagePtr image; image = GMCover::copyToImage(GMPlayerManager::instance()->getCoverManager()->getCover(),64); notify(track.title.text(),body.text(),-1,image); }
long GMStreamSource::onCmdDeleteStation(FXObject*,FXSelector,void*){ const FXString title=fxtr("Remove Internet Radio Station(s)?"); const FXString subtitle=fxtr("Remove Internet Radio Station(s) from library?"); FXDialogBox dialog(GMPlayerManager::instance()->getMainWindow(),title,DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE|DECOR_CLOSE,0,0,0,0,0,0,0,0,0,0); GMPlayerManager::instance()->getMainWindow()->create_dialog_header(&dialog,title,subtitle,nullptr); FXHorizontalFrame *closebox=new FXHorizontalFrame(&dialog,LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X|PACK_UNIFORM_WIDTH,0,0,0,0); new GMButton(closebox,fxtr("&Remove"),nullptr,&dialog,FXDialogBox::ID_ACCEPT,BUTTON_INITIAL|BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK,0,0,0,0, 15,15); new GMButton(closebox,fxtr("&Cancel"),nullptr,&dialog,FXDialogBox::ID_CANCEL,BUTTON_DEFAULT|LAYOUT_RIGHT|FRAME_RAISED|FRAME_THICK,0,0,0,0, 15,15); // new FXSeparator(&dialog,SEPARATOR_GROOVE|LAYOUT_FILL_X|LAYOUT_SIDE_BOTTOM); if (dialog.execute()){ FXIntList tracks; GMPlayerManager::instance()->getTrackView()->getSelectedTracks(tracks); // db->beginDelete(); for (int i=0;i<tracks.no();i++){ if (!db->removeStream(tracks[i])){ FXMessageBox::error(GMPlayerManager::instance()->getMainWindow(),MBOX_OK,fxtr("Library Error"),fxtrformat("Unable to remove station from the library.")); } } // db->endDelete(); GMPlayerManager::instance()->getTrackView()->refresh(); } return 1; }