Rob H
June 17th, 2004, 03:24 PM
How many people here use LDJ?
I'm asking because I've been working on the LUA script over the last week or so and have made lots of changes. Here's the history list taken straight from the comments I've added to the start of the file (sorry it's so long)
Now uses IRFanView to do image conversion as it does a better job with images, although it may be a little slower.
Using iterators over collections rather than using getn as this is supposed to be faster. And indeed this seems to be the case
Extracted various methods to simplify others
The image sizes are now defined by variables - the default size is now 100x150 (it was 50x75) - but see later.
Changed the variables FiltersPerPage, CoversPerPage, TitlesPerPage and DVDTitleMaxLen to better suit my CCF size (1024x768) you can reset these to Gavin's original values by setting Private.StandardConstants to 1
On slow machines the image conversion is still excruciatingly slow so the batch file is now only executed if the scan was requested by NetRemote, ie
it isn't executed on startup. The batch file is still written to the cache_dir and can be run from there if required.
Added LDJ_DVD_Filter_Up and LDJ_DVD_Filter_Down to allow for the filter scrolling buttons to be enabled and disabled.
Added LDJ_DVD_Filter_visible_<loopindex> to hide unused filter slots.
Added LDJ_DVD_Title_Check_<loopindex> to hide unused title slots add a frame called STATE:LDJ_DVD_Title_Check_<LoopIndex>:1:1 as the parent of the looped DVD slot in the CCF. If you are using this then ensure that Private.SupportHidingThumbnails is set to 1 as this should speed up hiding unused slots.
Now updates the titles that correspond to the displayed cover images at the same time as the images. Any further titles are updated later - this helps with slower machines.
Added a function update_slider_pos which is now also called from the refresh_titles function, so that it doesn't get left in the same place after a filter has been applied.
Some minor optimisations such as caching expressions in local variables to both simplify the code and to provide a speed boost
SelectNext and SelectPrev weren't checking that %Private.SelectedDVD was initialised
Collected together all the messages sent to NetRemote in one place to save hunting through the source for them all
Added filter inversion
If the 'ALL' filter is selected then short circuit the filtering since all the candidates must match by definition
Added immediate filtering option such that changing a filter criterion will cause an immediate refiltering. Can be changed by calling LDJ.ToggleImmediateFiltering(). The status is reflected to NR using LDJ_Filter_Immediate
Added and/or filtering on selected Genres - see Private.AndFiltering to turn this on or off. The original code from LDJ 0.24 used OR filtering i.e. if you selected two filter options then it would show all DVDs that matched either of them. If you switch to AND filtering then it will only show those DVDs that match all of them e.g. Animation and Comedy
Swapped round the order of the inner loops in the filter function so that it only cycles through the values for each dvd once for each selected filter key.
Replaced the inner loop of filter with the functions apply_filter_to_dvd, match_any_keys and match_all_key. Simplified the code enormously.
Is there any interest in my uploading it? Or are there any other features that people want before I do so?
Before I upload it I'll need to add a few more comments and also tweak the sample CCF to illustrate the new features. I could also do with a couple of beta testers - I don't want to disrupt anyone's setups in case I've screwed up in some part of the code that I haven't tested. I hope Gavin doesn't mind my doing this.
I'm asking because I've been working on the LUA script over the last week or so and have made lots of changes. Here's the history list taken straight from the comments I've added to the start of the file (sorry it's so long)
Now uses IRFanView to do image conversion as it does a better job with images, although it may be a little slower.
Using iterators over collections rather than using getn as this is supposed to be faster. And indeed this seems to be the case
Extracted various methods to simplify others
The image sizes are now defined by variables - the default size is now 100x150 (it was 50x75) - but see later.
Changed the variables FiltersPerPage, CoversPerPage, TitlesPerPage and DVDTitleMaxLen to better suit my CCF size (1024x768) you can reset these to Gavin's original values by setting Private.StandardConstants to 1
On slow machines the image conversion is still excruciatingly slow so the batch file is now only executed if the scan was requested by NetRemote, ie
it isn't executed on startup. The batch file is still written to the cache_dir and can be run from there if required.
Added LDJ_DVD_Filter_Up and LDJ_DVD_Filter_Down to allow for the filter scrolling buttons to be enabled and disabled.
Added LDJ_DVD_Filter_visible_<loopindex> to hide unused filter slots.
Added LDJ_DVD_Title_Check_<loopindex> to hide unused title slots add a frame called STATE:LDJ_DVD_Title_Check_<LoopIndex>:1:1 as the parent of the looped DVD slot in the CCF. If you are using this then ensure that Private.SupportHidingThumbnails is set to 1 as this should speed up hiding unused slots.
Now updates the titles that correspond to the displayed cover images at the same time as the images. Any further titles are updated later - this helps with slower machines.
Added a function update_slider_pos which is now also called from the refresh_titles function, so that it doesn't get left in the same place after a filter has been applied.
Some minor optimisations such as caching expressions in local variables to both simplify the code and to provide a speed boost
SelectNext and SelectPrev weren't checking that %Private.SelectedDVD was initialised
Collected together all the messages sent to NetRemote in one place to save hunting through the source for them all
Added filter inversion
If the 'ALL' filter is selected then short circuit the filtering since all the candidates must match by definition
Added immediate filtering option such that changing a filter criterion will cause an immediate refiltering. Can be changed by calling LDJ.ToggleImmediateFiltering(). The status is reflected to NR using LDJ_Filter_Immediate
Added and/or filtering on selected Genres - see Private.AndFiltering to turn this on or off. The original code from LDJ 0.24 used OR filtering i.e. if you selected two filter options then it would show all DVDs that matched either of them. If you switch to AND filtering then it will only show those DVDs that match all of them e.g. Animation and Comedy
Swapped round the order of the inner loops in the filter function so that it only cycles through the values for each dvd once for each selected filter key.
Replaced the inner loop of filter with the functions apply_filter_to_dvd, match_any_keys and match_all_key. Simplified the code enormously.
Is there any interest in my uploading it? Or are there any other features that people want before I do so?
Before I upload it I'll need to add a few more comments and also tweak the sample CCF to illustrate the new features. I could also do with a couple of beta testers - I don't want to disrupt anyone's setups in case I've screwed up in some part of the code that I haven't tested. I hope Gavin doesn't mind my doing this.