"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "f.albums.cc" between
fotoxx-22.30.tar.gz and fotoxx-22.35.tar.gz

About: fotoxx is a program for photo editing and collection management.

f.albums.cc  (fotoxx-22.30):f.albums.cc  (fotoxx-22.35)
skipping to change at line 57 skipping to change at line 57
******************************************************************************** */ ******************************************************************************** */
#define EX extern // disable extern declarations #define EX extern // disable extern declarations
#include "fotoxx.h" // (variables in fotoxx.h are refs) #include "fotoxx.h" // (variables in fotoxx.h are refs)
/******************************************************************************* */ /******************************************************************************* */
// Manage Albums - create, view, edit named albums of image files // Manage Albums - create, view, edit named albums of image files
#define ANCC 100
// max. album name
#define AFCC 300
// max. album file name (path)
#define maxalbums 100
// max. total albums
#define maxalbumfiles maxgallery
// max. files in one album
#define Balbumtoobig "max. album size exceeded: %d"
// albums created by search and report functions - omit from album update funct ions // albums created by search and report functions - omit from album update funct ions
int NXalbums = 5; int NXalbums = 6;
cchar *Xalbums[5] = { "/selected_files", "/search_results", "/places_dates", cchar *Xalbums[6] = { "/selected_files", "/search_results", "/screen_results"
"/timeline", "/duplicate_images" }; ,
"/places_dates", "/timeline", "/duplicate_images" };
/******************************************************************************* */ /******************************************************************************* */
// menu function // menu function
void m_manage_albums(GtkWidget *, cchar *) void m_manage_albums(GtkWidget *, cchar *)
{ {
int manage_albums_dialog_event(zdialog *zd, cchar *event); // manage albumd dialog event func int manage_albums_dialog_event(zdialog *zd, cchar *event); // manage albumd dialog event func
cchar *helptext1 = "Right-click album thumbnail for edits: \n" cchar *helptext1 = "Right-click album thumbnail for edits: \n"
skipping to change at line 354 skipping to change at line 348
int Nth; int Nth;
FILE *fid; FILE *fid;
FTYPE ftype; FTYPE ftype;
if (navi::Gimages == 0) { if (navi::Gimages == 0) {
zmessageACK(Mwin,"gallery is empty"); zmessageACK(Mwin,"gallery is empty");
return 1; return 1;
} }
if (navi::Gfiles > maxalbumfiles) { if (navi::Gfiles > maxalbumfiles) {
zmessageACK(Mwin,Balbumtoobig,maxalbumfiles); zmessageACK(Mwin,"max. album size exceeded: %d",maxalbumfiles);
return 1; return 1;
} }
fid = fopen(newalbumfile,"w"); // open/write album file fid = fopen(newalbumfile,"w"); // open/write album file
if (! fid) { if (! fid) {
zmessageACK(Mwin,strerror(errno)); zmessageACK(Mwin,strerror(errno));
return 1; return 1;
} }
for (Nth = 0; Nth < navi::Gfiles; Nth++) // add gallery images to album file for (Nth = 0; Nth < navi::Gfiles; Nth++) // add gallery images to album file
skipping to change at line 396 skipping to change at line 390
{ {
cchar *renalbum = "Rename an album"; cchar *renalbum = "Rename an album";
char *cfile, *dfile, *cpp, *dpp; char *cfile, *dfile, *cpp, *dpp;
int err; int err;
cfile = zgetfile(renalbum,MWIN,"file",albums_folder); // choose album file cfile = zgetfile(renalbum,MWIN,"file",albums_folder); // choose album file
if (! cfile) return; if (! cfile) return;
cpp = strrchr(cfile,'/'); cpp = strrchr(cfile,'/');
if (! cpp) { // should not happen if (! cpp) { // should not happen
Plog(1,"invalid file: %s \n",cfile); Plog(0,"invalid file: %s \n",cfile);
zfree(cfile); zfree(cfile);
return; return;
} }
dpp = zdialog_text(Mwin,"enter new album name",cpp+1); dpp = zdialog_text(Mwin,"enter new album name",cpp+1);
if (! dpp) { if (! dpp) {
zfree(cfile); zfree(cfile);
return; return;
} }
skipping to change at line 504 skipping to change at line 498
if (! albumfile && ! curr_album) return; if (! albumfile && ! curr_album) return;
if (! albumfile) albumfile = curr_album; if (! albumfile) albumfile = curr_album;
zstrcopy(curr_album,albumfile,"albums"); zstrcopy(curr_album,albumfile,"albums");
ZLfiles = zlist_from_file(albumfile); // get image files in album ZLfiles = zlist_from_file(albumfile); // get image files in album
if (! ZLfiles) return; if (! ZLfiles) return;
Nf = zlist_count(ZLfiles); Nf = zlist_count(ZLfiles);
if (Nf > maxalbumfiles) { if (Nf > maxalbumfiles) {
zmessageACK(Mwin,Balbumtoobig,maxalbumfiles); zmessageACK(Mwin,"max. album size exceeded: %d",maxalbumfiles);
Nf = maxalbumfiles; Nf = maxalbumfiles;
} }
for (ii = 0; ii < Nf; ii++) // loop files in album for (ii = 0; ii < Nf; ii++) // loop files in album
{ {
afile = zlist_get(ZLfiles,ii); // album file >> zlist afile = zlist_get(ZLfiles,ii); // album file >> zlist
if (! regfile(afile)) { // test file exists if (! regfile(afile)) { // test file exists
Plog(1,"missing file removed: %s \n",afile); Plog(0,"missing file removed: %s \n",afile);
zlist_put(ZLfiles,0,ii); // not found, replace with null zlist_put(ZLfiles,0,ii); // not found, replace with null
} }
} }
zlist_to_file(ZLfiles,albumfile); // zlist >> album file zlist_to_file(ZLfiles,albumfile); // zlist >> album file
zlist_delete(ZLfiles); zlist_delete(ZLfiles);
navi::gallerytype = ALBUM; navi::gallerytype = ALBUM;
gallery(albumfile,"initF",0); // gallery = album gallery(albumfile,"initF",0); // gallery = album
gallery(0,"sort",-2); // recall sort and position gallery(0,"sort",-2); // recall sort and position
skipping to change at line 1408 skipping to change at line 1402
return; return;
} }
} }
ii = 0; // input oldfiles index ii = 0; // input oldfiles index
kk = 0; // output newfiles index kk = 0; // output newfiles index
while (ii < Nold) // loop old files in name/version groups while (ii < Nold) // loop old files in name/version groups
{ {
if (kk > maxalbumfiles-100) { if (kk > maxalbumfiles-100) {
zmessageACK(Mwin,Balbumtoobig,maxalbumfiles); // stop with sufficient margin zmessageACK(Mwin,"max. album size exceeded: %d",maxalbumfiles); // stop with sufficient margin
break; break;
} }
rootname = file_rootname(zlist_get(ZLoldfs,ii)); // get root name for group /.../filename rootname = file_rootname(zlist_get(ZLoldfs,ii)); // get root name for group /.../filename
if (! rootname) continue; // no files found for group if (! rootname) continue; // no files found for group
basename = file_basename(zlist_get(ZLoldfs,ii)); // get base name for group /.../filename.ext basename = file_basename(zlist_get(ZLoldfs,ii)); // get base name for group /.../filename.ext
// (null if only versions are in group) // (null if only versions are in group)
ii1 = ii; ii1 = ii;
for (ii2 = ii+1; ii2 < Nold; ii2++) // range of oldfiles group, ii1 to ii2 for (ii2 = ii+1; ii2 < Nold; ii2++) // range of oldfiles group, ii1 to ii2
if (! strmatch(rootname,file_rootname(zlist_get(ZLoldfs,ii2)))) if (! strmatch(rootname,file_rootname(zlist_get(ZLoldfs,ii2))))
skipping to change at line 1614 skipping to change at line 1608
zlist_t *ZLfiles = 0; zlist_t *ZLfiles = 0;
int ii, err, Nfiles, secs, nextF; int ii, err, Nfiles, secs, nextF;
char *pp, *container, **imagefiles, **wprecs; char *pp, *container, **imagefiles, **wprecs;
char albumfile[500], wpfile[500]; char albumfile[500], wpfile[500];
FILE *fid; FILE *fid;
Plog(1,"m_cycle_wallpaper \n"); Plog(1,"m_cycle_wallpaper \n");
Plog(1,"cycle wallpaper: secs: %s container: %s \n",argv[2],argv[3]); Plog(1,"cycle wallpaper: secs: %s container: %s \n",argv[2],argv[3]);
if (argc < 4) { if (argc < 4) {
Plog(1,"missing command parameters \n"); Plog(0,"missing command parameters \n");
zexit("cycle wallpaper exit"); zexit("cycle wallpaper exit");
} }
secs = atoi(argv[2]); secs = atoi(argv[2]);
container = argv[3]; container = argv[3];
if (! *container) { if (! *container) {
Plog(1,"no image container specified \n"); Plog(0,"no image container specified \n");
zexit("cycle wallpaper exit"); zexit("cycle wallpaper exit");
} }
if (*container == '/') // container is folder path name if (*container == '/') // container is folder path name
{ {
if (! dirfile(container)) { if (! dirfile(container)) {
Plog(1,"image container not a valid folder \n"); Plog(0,"image container not a valid folder \n");
zexit("cycle wallpaper exit"); zexit("cycle wallpaper exit");
} }
err = find_imagefiles(container,1,imagefiles,Nfiles); // get list of image files err = find_imagefiles(container,1,imagefiles,Nfiles); // get list of image files
if (err || Nfiles == 0) { if (err || Nfiles == 0) {
Plog(1,"image container is empty \n"); Plog(0,"image container is empty \n");
zexit("cycle wallpaper exit"); zexit("cycle wallpaper exit");
} }
if (Nfiles > 1) HeapSort(imagefiles,Nfiles); // sort alphabetically if (Nfiles > 1) HeapSort(imagefiles,Nfiles); // sort alphabetically
} }
else // container is a fotoxx album name else // container is a fotoxx album name
{ {
snprintf(albumfile,500,"%s/%s",albums_folder,container); // album file name snprintf(albumfile,500,"%s/%s",albums_folder,container); // album file name
skipping to change at line 1757 skipping to change at line 1751
void ss_zoomin(); void ss_zoomin();
void ss_zoomout(); void ss_zoomout();
char *ss_albumfile = 0; // slide show album file char *ss_albumfile = 0; // slide show album file
char *ss_albumname = 0; // album name (ss_albumfile tail) char *ss_albumname = 0; // album name (ss_albumfile tail)
int ss_Nfiles = 0; // album file count int ss_Nfiles = 0; // album file count
int ss_imagetime = 0; // image display default time int ss_imagetime = 0; // image display default time
int ss_texttime = 0; // show text time int ss_texttime = 0; // show text time
int ss_cliplimit = 10; // image clipping limit from user int ss_cliplimit = 10; // image clipping limit from user
char ss_musicfile[500] = "none"; // /folder.../musicfile.ogg char ss_musicfile[500] = "none"; // /folder.../musicfile.ogg
int ss_vlcnotify = 0;
// flag, missing VLC notified
int ss_playmusic = 0;
// flag, play given music file
int ss_randomimage = 0; // use random image order int ss_randomimage = 0; // use random image order
int ss_randomtrans = 0; // use random transition order int ss_randomtrans = 0; // use random transition order
int ss_fullscreen = 0; // flag, full screen mode int ss_fullscreen = 0; // flag, full screen mode
int ss_replay = 0; // flag, start over when done int ss_replay = 0; // flag, start over when done
float ss_trantime = 2.0; // transition time, seconds float ss_trantime = 2.0; // transition time, seconds
float ss_zoomsize = 1.0; // zoom size, 1-3.0 = 3x float ss_zoomsize = 1.0; // zoom size, 1-3.0 = 3x
int ss_zoomtype = 0; // 0/1/2 = none/zoomin/zoomout int ss_zoomtype = 0; // 0/1/2 = none/zoomin/zoomout
int ss_zoomtime = 2; // zoom time, seconds int ss_zoomtime = 2; // zoom time, seconds
int ss_zoomlocx, ss_zoomlocy; // zoom target (50/50 = image midpoint) int ss_zoomlocx, ss_zoomlocy; // zoom target (50/50 = image midpoint)
int ss_setzloc; // 1-shot flag for image prefs dialog int ss_setzloc; // 1-shot flag for image prefs dialog
skipping to change at line 1888 skipping to change at line 1884
/*** /***
________________________________________________________ ________________________________________________________
| Slide Show | | Slide Show |
| | | |
| [Select Album] album-name 123 images | | [Select Album] album-name 123 images |
| text time [___] Image Time [___] Clip Limit % [___] | | text time [___] Image Time [___] Clip Limit % [___] |
| Music File: [_______________________________] [Browse] | | Music File: [_______________________________] [Browse] |
| [x] Full Screen [x] Auto-replay [x] Random Image | | [x] Full Screen [x] Auto-replay [x] Random Image |
| Customize: [transitions] [image files] [KB controls] | // KB functions | Customize: [transitions] [image files] [KB controls] | // KB functions
| | | |
| [Proceed] [Cancel] | | [Start] [Resume] [Cancel] |
|________________________________________________________| |________________________________________________________|
***/ ***/
zd = zdialog_new("Slide Show",Mwin,"Proceed","Cancel",null); // user dialog zd = zdialog_new("Slide Show",Mwin,"Start","Resume","Cancel",null); // user dialog 22.31
zdialog_add_widget(zd,"hbox","hbss","dialog",0,"space=3"); zdialog_add_widget(zd,"hbox","hbss","dialog",0,"space=3");
zdialog_add_widget(zd,"button","selectalbum","hbss","Select Album","space=5") ; zdialog_add_widget(zd,"button","selectalbum","hbss","Select Album","space=5") ;
zdialog_add_widget(zd,"label","albumname","hbss","no slection","space=5"); zdialog_add_widget(zd,"label","albumname","hbss","no slection","space=5");
zdialog_add_widget(zd,"label","nfiles","hbss","no images","space=5"); zdialog_add_widget(zd,"label","nfiles","hbss","no images","space=5");
zdialog_add_widget(zd,"hbox","hbprefs","dialog",0,"space=2"); zdialog_add_widget(zd,"hbox","hbprefs","dialog",0,"space=2");
zdialog_add_widget(zd,"label","labtexttime","hbprefs","text time","space=5"); zdialog_add_widget(zd,"label","labtexttime","hbprefs","text time","space=5");
zdialog_add_widget(zd,"zspin","texttime","hbprefs","0|9999|1|0"); zdialog_add_widget(zd,"zspin","texttime","hbprefs","0|9999|1|0");
zdialog_add_widget(zd,"label","space","hbprefs",0,"space=5"); zdialog_add_widget(zd,"label","space","hbprefs",0,"space=5");
skipping to change at line 1926 skipping to change at line 1922
zdialog_add_widget(zd,"check","fullscreen","hbscreen","Full Screen","space=3" ); zdialog_add_widget(zd,"check","fullscreen","hbscreen","Full Screen","space=3" );
zdialog_add_widget(zd,"check","replay","hbscreen","Auto-replay","space=5"); zdialog_add_widget(zd,"check","replay","hbscreen","Auto-replay","space=5");
zdialog_add_widget(zd,"check","randomimage","hbscreen","Random Image","space= 5"); zdialog_add_widget(zd,"check","randomimage","hbscreen","Random Image","space= 5");
zdialog_add_widget(zd,"hbox","hbcust","dialog",0,"space=5"); zdialog_add_widget(zd,"hbox","hbcust","dialog",0,"space=5");
zdialog_add_widget(zd,"label","labprefs","hbcust","Customize:","space=5"); zdialog_add_widget(zd,"label","labprefs","hbcust","Customize:","space=5");
zdialog_add_widget(zd,"button","transprefs","hbcust","transitions","space=5") ; zdialog_add_widget(zd,"button","transprefs","hbcust","transitions","space=5") ;
zdialog_add_widget(zd,"button","imageprefs","hbcust","image files","space=5") ; zdialog_add_widget(zd,"button","imageprefs","hbcust","image files","space=5") ;
zdialog_add_widget(zd,"button","KBprefs","hbcust","KB controls","space=5"); zdialog_add_widget(zd,"button","KBprefs","hbcust","KB controls","space=5");
zdialog_add_ttip(zd,"Start","start from first image in album");
// 22.31
zdialog_add_ttip(zd,"Resume","resume from current image");
zdialog_run(zd,ss_dialog_event,"save"); // run dialog zdialog_run(zd,ss_dialog_event,"save"); // run dialog
zdialog_send_event(zd,"initz_album"); // initial album zdialog_send_event(zd,"initz_album"); // initial album
retry:
zstat = zdialog_wait(zd); // wait for completion zstat = zdialog_wait(zd); // wait for completion
if (zstat != 1) { // cancel if (zstat != 1 && zstat != 2) { // cancel
zdialog_free(zd); zdialog_free(zd);
return; return;
} }
zdialog_fetch(zd,"imagetime",ss_imagetime);
// image show time seconds
if (ss_Nused == 0) ss_imagetime = 9999;
// if only arrow-keys used, huge interval
zdialog_fetch(zd,"texttime",ss_texttime);
// show text time
zdialog_fetch(zd,"cliplim",ss_cliplimit);
// image clipping limit
zdialog_fetch(zd,"musicfile",ss_musicfile,500);
// music file
zdialog_fetch(zd,"fullscreen",ss_fullscreen);
// full screen option
zdialog_fetch(zd,"replay",ss_replay);
// replay (last image --> first)
zdialog_fetch(zd,"randomimage",ss_randomimage);
// use random image order
if (! ss_Nfiles) { // no selection if (! ss_Nfiles) { // no selection
zmessageACK(Mwin,"invalid album"); zmessageACK(Mwin,"invalid album");
zdialog_free(zd); zd->zstat = 0;
goto retry;
return; return;
} }
ss_playmusic = 0;
if (*ss_musicfile > ' ' && ! strmatch(ss_musicfile,"none"))
// music file was entered 22.31
{
if (! Fvlc && ! ss_vlcnotify) {
zmessageACK(Mwin,"vlc is required to play music");
ss_vlcnotify = 1;
}
if (Fvlc && ! regfile(ss_musicfile)) {
zmessageACK(Mwin,"music file not found");
zd->zstat = 0;
goto retry;
}
if (Fvlc) ss_playmusic = 1;
}
if (Fblock("slideshow","block edits")) { // check pending, block if (Fblock("slideshow","block edits")) { // check pending, block
zdialog_free(zd); // cannot, quit zdialog_free(zd); // cannot, quit
return; return;
} }
zdialog_fetch(zd,"imagetime",ss_imagetime);
// image show time seconds
if (ss_Nused == 0) ss_imagetime = 9999;
// if only arrow-keys used, huge interval
zdialog_fetch(zd,"texttime",ss_texttime);
// show text time
zdialog_fetch(zd,"cliplim",ss_cliplimit);
// image clipping limit
zdialog_fetch(zd,"musicfile",ss_musicfile,500);
// music file
zdialog_fetch(zd,"fullscreen",ss_fullscreen);
// full screen option
zdialog_fetch(zd,"replay",ss_replay);
// replay (last image --> first)
zdialog_fetch(zd,"randomimage",ss_randomimage);
// use random image order
zdialog_free(zd); // kill dialog zdialog_free(zd); // kill dialog
ss_saveprefs(); // save preference changes ss_saveprefs(); // save preference changes
if (curr_file) { if (zstat == 1)
// start at curr. file // [start] selected 22.31
for (ii = 0; ii < ss_Nfiles; ii++) ii = 0;
// if member of file list // start from first file
if (strmatch(curr_file,ss_imagetab[ii].imagefile)) break;
if (ii == ss_Nfiles) ii = 0; else if (zstat == 2)
// [resume] selected 22.31
{
if (curr_file) {
// start from curr. file
for (ii = 0; ii < ss_Nfiles; ii++)
// if member of file list
if (strmatch(curr_file,ss_imagetab[ii].imagefile)) break;
if (ii == ss_Nfiles) ii = 0;
}
else ii = 0;
} }
else ii = 0;
// else first image ss_Fcurrent = ii;
ss_Fcurrent = ii;
// next file in list to show
f_open(ss_imagetab[ii].imagefile); f_open(ss_imagetab[ii].imagefile);
m_viewmode(0,"F"); // insure tab F m_viewmode(0,"F"); // insure tab F
Fslideshow = 1; // slideshow active for KB events Fslideshow = 1; // slideshow active for KB events
ss_isblank = 0; // not blank window ss_isblank = 0; // not blank window
ss_event = "first"; ss_event = "first";
Fzoom = 0; // fit window Fzoom = 0; // fit window
if (*ss_musicfile == '/') { if (ss_playmusic) {
pp = zescape_quotes(ss_musicfile); // play music file 22.31
// play music file pp = zescape_quotes(ss_musicfile);
zshell("ack","paplay \"%s\" &",pp); zshell("log ack","cvlc -L -q \"%s\" &",pp);
// use cvlc command
zfree(pp); zfree(pp);
} }
ss_newfile = 0; // no new image ss_newfile = 0; // no new image
ss_pxbnew = 0; ss_pxbnew = 0;
ss_oldfile = 0; // no old (prior) image ss_oldfile = 0; // no old (prior) image
ss_pxbold = 0; ss_pxbold = 0;
ss_escape = 0; // kill switch off ss_escape = 0; // kill switch off
if (ss_fullscreen) win_fullscreen(1); // full screen, hide menu and panel if (ss_fullscreen) win_fullscreen(1); // full screen, hide menu and panel
skipping to change at line 2223 skipping to change at line 2249
/******************************************************************************* */ /******************************************************************************* */
// Show next slide when time is up or user navigates with arrow keys. // Show next slide when time is up or user navigates with arrow keys.
// Cycles every 0.1 seconds when slide show is active. // Cycles every 0.1 seconds when slide show is active.
int ss_timerfunc(void *) int ss_timerfunc(void *)
{ {
int ss_timerfunc_sleep(int sleepsecs); int ss_timerfunc_sleep(int sleepsecs);
int img, jj; int img, jj;
int filesecs, titlesecs, descsecs, sleepsecs; int filesecs, titlesecs, descsecs, sleepsecs;
cchar *keynames[2] = { iptc_title_key, iptc_description_key }; cchar *keynames[2] = { iptc_title_key, iptc_description_key };
char *keyvals[2], *pp; char *keyvals[2], *pp;
char tonefile[200];
if (zd_magnify) return 1; // exit magnify before event processing if (zd_magnify) return 1; // exit magnify before event processing
if (ss_escape) ss_event = "escape"; // KB event from main() if (ss_escape) ss_event = "escape"; // KB event from main()
if (Fkillfunc) ss_event = "escape"; // window kill button [x] 22.30 if (Fkillfunc) ss_event = "escape"; // window kill button [x] 22.30
if (! Fslideshow) ss_event = "escape"; // from m_quit() if (! Fslideshow) ss_event = "escape"; // from m_quit()
if (FGWM != 'F') ss_event = "escape"; // must be F-view mode if (FGWM != 'F') ss_event = "escape"; // must be F-view mode
if (strmatch(ss_event,"")) return 1; // no event, loop and wait if (strmatch(ss_event,"")) return 1; // no event, loop and wait
if (strmatch(ss_event,"escape")) goto escape; if (strmatch(ss_event,"escape")) goto escape;
if (strmatch(ss_event,"blank")) goto blank; if (strmatch(ss_event,"blank")) goto blank;
skipping to change at line 2261 skipping to change at line 2288
EOL: // last image reached EOL: // last image reached
img = ss_Nfiles - 1; img = ss_Nfiles - 1;
f_open(ss_imagetab[img].imagefile); // last file --> current file f_open(ss_imagetab[img].imagefile); // last file --> current file
zmessage_post_bold(Mwin,"20/20",5,"SLIDESHOW END"); zmessage_post_bold(Mwin,"20/20",5,"SLIDESHOW END");
ss_timerfunc_sleep(5); ss_timerfunc_sleep(5);
escape: // terminate slide show escape: // terminate slide show
if (ss_pxbold) PXB_free(ss_pxbold); // free memory if (ss_pxbold) PXB_free(ss_pxbold); // free memory
if (ss_pxbnew) PXB_free(ss_pxbnew); if (ss_pxbnew) PXB_free(ss_pxbnew);
ss_pxbold = ss_pxbnew = 0; ss_pxbold = ss_pxbnew = 0;
if (*ss_musicfile == '/') zshell(0,"pulseaudio --kill"); // kill music if any if (*ss_musicfile == '/') zshell(0,"pkill vlc"); // kill music if any 22.31
if (ss_fullscreen) win_unfullscreen(); // restore old window size, menu etc. if (ss_fullscreen) win_unfullscreen(); // restore old window size, menu etc.
ss_fullscreen = 0; ss_fullscreen = 0;
img = ss_Fcurrent; img = ss_Fcurrent;
f_open(ss_imagetab[img].imagefile); // open last image shown f_open(ss_imagetab[img].imagefile); // open last image shown
ss_escape = 0; ss_escape = 0;
Fblock("slideshow",0); Fblock("slideshow",0);
if (Fslideshow) { // not killed if (Fslideshow) { // not killed
Fslideshow = 0; Fslideshow = 0;
m_slideshow(0,0); // restart slide show m_slideshow(0,0); // restart slide show
} }
skipping to change at line 2359 skipping to change at line 2386
} }
else ss_instant(); // show new image immediately else ss_instant(); // show new image immediately
if (! ss_fullscreen) // if not full screen mode, if (! ss_fullscreen) // if not full screen mode,
gtk_window_set_title(MWIN,ss_newfile); // put filename in title bar gtk_window_set_title(MWIN,ss_newfile); // put filename in title bar
// process image events: // process image events:
// play tone, wait before text, show text, // play tone, wait before text, show text,
// wait before zoom, zoom, wait after zoom // wait before zoom, zoom, wait after zoom
if (ss_imagetab[img].tone) if (ss_imagetab[img].tone) {
zshell(0,"paplay %s/slideshow-tone.oga &",get_zhomedir()); snprintf(tonefile,200,"%s/slideshow-tone.oga",get_zhomedir());
// play tone if specified // play tone, quit 22.31
zshell(0,"cvlc --play-and-exit \"%s\" &",tonefile);
}
sleepsecs = ss_imagetab[img].wait0; // show image specified time sleepsecs = ss_imagetab[img].wait0; // show image specified time
jj = ss_timerfunc_sleep(sleepsecs); // before filename/titles/description jj = ss_timerfunc_sleep(sleepsecs); // before filename/titles/description
if (jj) return 1; if (jj) return 1;
filesecs = ss_imagetab[img].filesecs; // time to show file name filesecs = ss_imagetab[img].filesecs; // time to show file name
titlesecs = ss_imagetab[img].titlesecs; // time to show title titlesecs = ss_imagetab[img].titlesecs; // time to show title
descsecs = ss_imagetab[img].descsecs; // time to show description descsecs = ss_imagetab[img].descsecs; // time to show description
if (filesecs + titlesecs + descsecs == 0) // if not specified, use default if (filesecs + titlesecs + descsecs == 0) // if not specified, use default
filesecs = titlesecs = descsecs = ss_texttime; filesecs = titlesecs = descsecs = ss_texttime;
skipping to change at line 2394 skipping to change at line 2423
descsecs -= 1; if (descsecs < 0) descsecs = 0; descsecs -= 1; if (descsecs < 0) descsecs = 0;
} }
ss_showtext(0,0,0); // remove all ss_showtext(0,0,0); // remove all
if (image_file_type(ss_newfile) == VIDEO) { // if VIDEO file, play now if (image_file_type(ss_newfile) == VIDEO) { // if VIDEO file, play now
jj = ss_timerfunc_sleep(1.0); // show image one second jj = ss_timerfunc_sleep(1.0); // show image one second
if (jj) return 1; // new event if (jj) return 1; // new event
f_open(ss_newfile); // reset current image f_open(ss_newfile); // reset current image
pp = zescape_quotes(ss_newfile); pp = zescape_quotes(ss_newfile);
zshell("ack","ffplay -loglevel -8 -autoexit \"%s\" ",pp); // play video, wait for user quit zshell("ack","ffplay -loglevel -8 -autoexit \"%s\" ",pp); // play video
zfree(pp); zfree(pp);
jj = ss_timerfunc_sleep(1.0); // wait one second after play jj = ss_timerfunc_sleep(1.0); // wait one second after play
if (jj) return 1; // new event if (jj) return 1; // new event
if (ss_paused) ss_event = ""; if (ss_paused) ss_event = "";
else ss_event = "tran next"; else ss_event = "tran next";
return 1; return 1;
} }
sleepsecs = ss_imagetab[img].wait1; // show image specified time sleepsecs = ss_imagetab[img].wait1; // show image specified time
jj = ss_timerfunc_sleep(sleepsecs); // before zoom jj = ss_timerfunc_sleep(sleepsecs); // before zoom
skipping to change at line 2969 skipping to change at line 2998
nn = sscanf(buff,"randomtrans %d ",&ss_randomtrans); nn = sscanf(buff,"randomtrans %d ",&ss_randomtrans);
if (nn != 1) goto format_error; if (nn != 1) goto format_error;
while (true) while (true)
{ {
pp = fgets_trim(buff,XFCC,fid,1); pp = fgets_trim(buff,XFCC,fid,1);
if (! pp) break; if (! pp) break;
nn = sscanf(buff,"%s %d %f %d ",tranname,&n1,&ff,&n2); // tranname N N.N NN nn = sscanf(buff,"%s %d %f %d ",tranname,&n1,&ff,&n2); // tranname N N.N NN
if (nn != 4) { // (enabled 0-1 duration N.N pref. 0-99) if (nn != 4) { // (enabled 0-1 duration N.N pref. 0-99)
Plog(1,"bad record: %s \n",buff); Plog(0,"bad record: %s \n",buff);
continue; continue;
} }
for (ii = 0; ii < SSNT; ii++) for (ii = 0; ii < SSNT; ii++)
if (strmatch(tranname,ss_trantab[ii].tranname)) break; if (strmatch(tranname,ss_trantab[ii].tranname)) break;
if (ii == SSNT) { if (ii == SSNT) {
Plog(1,"bad record: %s \n",buff); Plog(0,"bad record: %s \n",buff);
continue; continue;
} }
ss_trantab[ii].enabled = n1; ss_trantab[ii].enabled = n1;
ss_trantab[ii].trantime = ff; ss_trantab[ii].trantime = ff;
ss_trantab[ii].preference = n2; ss_trantab[ii].preference = n2;
} }
for (ii = jj = 0; ii < SSNT; ii++) { // initialize list of enabled for (ii = jj = 0; ii < SSNT; ii++) { // initialize list of enabled
if (ss_trantab[ii].enabled) { // transition types if (ss_trantab[ii].enabled) { // transition types
ss_Tused[jj] = ii; ss_Tused[jj] = ii;
skipping to change at line 3533 skipping to change at line 3562
if (strmatchN(pp,"replay: ",8)) { // replay: N 0/1 = no / replay after end if (strmatchN(pp,"replay: ",8)) { // replay: N 0/1 = no / replay after end
ss_replay = atoi(pp+8); ss_replay = atoi(pp+8);
continue; continue;
} }
} }
if (format == 2) // transition preferences if (format == 2) // transition preferences
{ {
nn = sscanf(buff,"%s %d %f %d ",tranname,&n1,&ff,&n2); // tranname N N.N NN nn = sscanf(buff,"%s %d %f %d ",tranname,&n1,&ff,&n2); // tranname N N.N NN
if (nn != 4) { // (enabled 0-1 duration N.N pref. 0-99) if (nn != 4) { // (enabled 0-1 duration N.N pref. 0-99)
Plog(1,"bad record: %s \n",buff); Plog(0,"bad record: %s \n",buff);
continue; continue;
} }
for (ii = 0; ii < SSNT; ii++) for (ii = 0; ii < SSNT; ii++)
if (strmatch(tranname,ss_trantab[ii].tranname)) break; if (strmatch(tranname,ss_trantab[ii].tranname)) break;
if (ii == SSNT) { if (ii == SSNT) {
Plog(1,"unknown transition: %s \n",tranname); // ignore and continue Plog(0,"unknown transition: %s \n",tranname); // ignore and continue
continue; continue;
} }
ss_trantab[ii].enabled = n1; ss_trantab[ii].enabled = n1;
ss_trantab[ii].trantime = ff; ss_trantab[ii].trantime = ff;
ss_trantab[ii].preference = n2; ss_trantab[ii].preference = n2;
} }
if (format == 3) // image file preferences if (format == 3) // image file preferences
{ {
if (strmatchN(pp,"imagefile: ",11)) { // set image file for subsequent recs if (strmatchN(pp,"imagefile: ",11)) { // set image file for subsequent recs
pp += 11; pp += 11;
if (*pp != '/') { if (*pp != '/') {
Plog(1,"bad image file: %s \n",buff); Plog(0,"bad image file: %s \n",buff);
continue; continue;
} }
for (ii = 0; ii < ss_Nfiles; ii++) // search album for matching image for (ii = 0; ii < ss_Nfiles; ii++) // search album for matching image
if (strmatch(pp,ss_imagetab[ii].imagefile)) break; if (strmatch(pp,ss_imagetab[ii].imagefile)) break;
if (ii == ss_Nfiles) ii = -1; // if not found, set no curr. image if (ii == ss_Nfiles) ii = -1; // if not found, set no curr. image
continue; continue;
} }
if (ii < 0) continue; // ignore recs following invalid image if (ii < 0) continue; // ignore recs following invalid image
skipping to change at line 3922 skipping to change at line 3951
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// new image stretches over prior image from left to right // new image stretches over prior image from left to right
// width expands as right edge moves from left to right side // width expands as right edge moves from left to right side (jitters)
void ss_stretch() void ss_stretch()
{ {
PXB *pxb_new; PXB *pxb_new;
int ww; int ww;
double T0, Te, Tz; double T0, Te, Tz;
cairo_t *cr = draw_context_create(gdkwin,draw_context); cairo_t *cr = draw_context_create(gdkwin,draw_context);
T0 = get_seconds(); // transition start time T0 = get_seconds(); // transition start time
skipping to change at line 5342 skipping to change at line 5371
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// French door: old image swings away left and right to reveal new image. // French door: old image swings away left and right to reveal new image. (jitters)
namespace ss_frenchdoor_names namespace ss_frenchdoor_names
{ {
PXB *pxbmix; PXB *pxbmix;
PIXBUF *pixbuf; // output image PIXBUF *pixbuf;
float R, ww2; float R, ww2;
uint8 *pixels1, *pixels3; uint8 *pixels1, *pixels3;
int ww3, ww4, sww; int ww3, ww4, sww;
} }
void ss_frenchdoor() void ss_frenchdoor()
{ {
using namespace ss_frenchdoor_names; using namespace ss_frenchdoor_names;
#define GPNFD(pix,ww,hh) \ #define GPNFD(pix,ww,hh) \
skipping to change at line 5397 skipping to change at line 5426
gdk_cairo_set_source_pixbuf(cr,pixbuf,0,0); gdk_cairo_set_source_pixbuf(cr,pixbuf,0,0);
cairo_paint(cr); cairo_paint(cr);
g_object_unref(pixbuf); g_object_unref(pixbuf);
ww4 = (1 + R) * ww2 - sww; // right side ww4 = (1 + R) * ww2 - sww; // right side
pixbuf = GPNFD(pixels3+ww4*3,ww3+sww,ss_hh); pixbuf = GPNFD(pixels3+ww4*3,ww3+sww,ss_hh);
gdk_cairo_set_source_pixbuf(cr,pixbuf,ww4,0); gdk_cairo_set_source_pixbuf(cr,pixbuf,ww4,0);
cairo_paint(cr); cairo_paint(cr);
g_object_unref(pixbuf); g_object_unref(pixbuf);
PXB_free(pxbmix);
zmainloop(); zmainloop();
PXB_free(pxbmix);
if (ss_escape) break; if (ss_escape) break;
} }
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
skipping to change at line 5460 skipping to change at line 5489
memcpy(pix3,pix1,3); memcpy(pix3,pix1,3);
memcpy(pix3 + ss_rs, pix1 + ss_rs, 3); memcpy(pix3 + ss_rs, pix1 + ss_rs, 3);
} }
} }
return 0; return 0;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// new image expands from the left to squish old image to the right // new image expands from the left to squish old image to the right (jitters)
void ss_squishright() void ss_squishright()
{ {
PXB *pxbnew, *pxbold, *pxbmix; PXB *pxbnew, *pxbold, *pxbmix;
float To, Te, Tz; // start, elapsed, goal times float To, Te, Tz; // start, elapsed, goal times
float F; float F;
int wwnew, wwold; int wwnew, wwold;
pxbmix = PXB_copy(ss_pxbold); pxbmix = PXB_copy(ss_pxbold);
skipping to change at line 5512 skipping to change at line 5541
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
PXB_free(pxbmix); PXB_free(pxbmix);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// new image expands from the top to squish old image to the bottom // new image expands from the top to squish old image to the bottom (jitters)
void ss_squishdown() void ss_squishdown()
{ {
PXB *pxbnew, *pxbold, *pxbmix; PXB *pxbnew, *pxbold, *pxbmix;
float To, Te, Tz; // start, elapsed, goal times float To, Te, Tz; // start, elapsed, goal times
float F; float F;
int hhold, hhnew; int hhold, hhnew;
pxbmix = PXB_copy(ss_pxbold); pxbmix = PXB_copy(ss_pxbold);
skipping to change at line 5718 skipping to change at line 5747
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// Old image twists 0 >> 360 deg. as new image untwists -360 >> 0 deg. // Old image twists 0 >> 360 deg. as new image untwists -360 >> 0 deg. (jitters)
// The old image fades-out as the new image fades-in. // The old image fades-out as the new image fades-in.
namespace twist2_names namespace ss_twist_names
{ {
PXB *PXBmix; PXB *PXBmix;
int cx, cy; int cx, cy;
float Told, Tnew; float Told, Tnew;
float F1, F2; float F1, F2;
float *D, *Tp; float *D, *Tp;
float Dmax; float Dmax;
} }
void ss_twist() void ss_twist()
{ {
using namespace twist2_names; using namespace ss_twist_names;
void * ss_twist_thread(void *arg); void * ss_twist_thread(void *arg);
int ii, px, py, Dx, Dy; int ii, px, py, Dx, Dy;
double T0, Te, Tz; double T0, Te, Tz;
cx = ss_ww / 2; // image center cx = ss_ww / 2; // image center
cy = ss_hh / 2; cy = ss_hh / 2;
Dmax = sqrtf(cx * cx + cy * cy); // distance to corner Dmax = sqrtf(cx * cx + cy * cy); // distance to corner
skipping to change at line 5808 skipping to change at line 5837
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
void * ss_twist_thread(void *arg) void * ss_twist_thread(void *arg)
{ {
using namespace twist2_names; using namespace ss_twist_names;
int index = *((int *) arg); int index = *((int *) arg);
int ii, px, py, qx, qy; int ii, px, py, qx, qy;
float DN, Tq, T; float DN, Tq, T;
uint8 *pixmix, *vpix, pix1[3], pix2[3], pix3[3]; uint8 *pixmix, *vpix, pix1[3], pix2[3], pix3[3];
set_cpu_affinity(index); // stay on same cpu if possible set_cpu_affinity(index); // stay on same cpu if possible
for (py = 2 * index; py < ss_hh-1; py += 2 * ss_nwt) // loop all pixels for (py = 2 * index; py < ss_hh-1; py += 2 * ss_nwt) // loop all pixels
for (px = 0; px < ss_ww-1; px += 2) for (px = 0; px < ss_ww-1; px += 2)
skipping to change at line 5975 skipping to change at line 6004
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// new image presses out from center and squishes old image to the edges // new image presses out from center and squishes old image to the edges (jitters)
void ss_squishout() void ss_squishout()
{ {
PXB *pxbout; PXB *pxbout;
uint8 *pixold, *pixnew, *pixout; uint8 *pixold, *pixnew, *pixout;
uint8 *pix1, *pix2; uint8 *pix1, *pix2;
int ww, hh, rs, cx, cy, cmin; int ww, hh, rs, cx, cy, cmin;
int cc, ii, Q; int cc, ii, Q;
int px, py, qx, qy, vx, vy, ex, ey; int px, py, qx, qy, vx, vy, ex, ey;
float R, Rmax; float R, Rmax;
skipping to change at line 6217 skipping to change at line 6246
gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image gdk_cairo_set_source_pixbuf(cr,ss_pxbnew->pixbuf,0,0); // final image
cairo_paint(cr); cairo_paint(cr);
draw_context_destroy(draw_context); draw_context_destroy(draw_context);
return; return;
} }
// ----------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- -
// new image moves in as bars from the left and right, interleaved // new image moves in as bars from the left and right, interleaved (jitters)
/*** /***
________________________ ________________________
|______| --> ______| |______| --> ______|
|______ <-- |______| new image bars move in from left and righ t |______ <-- |______| new image bars move in from left and righ t
|______| --> ______| to cover the old image |______| --> ______| to cover the old image
| <-- |______| | <-- |______|
| etc... | | etc... |
|________________________| |________________________|
 End of changes. 46 change blocks. 
84 lines changed or deleted 116 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)