Hi,
Michaels configuration options for the mouse wheel inspired me to modify the
jog-slider a bit, so that it's now also configurable... :-)
The problem what I had with the old one was that it had a quite large zero
region and the range for +-1 frame was rather small, but the one for +-2
frames was again larger.
Now the ranges are always continously decreasing with a quiet small (but
configurable) zero range!
Also I added a configurable maximum scale of the jog-slider and tick marks
(for jog- AND lin-slider).
The parameters to put into ~/.qt/dvbcut.sf.netrc are:
jog_interval=1
jog_maximum=180000
jog_offset=40
jog_threshold=50
lin_interval=3600
These default settings mimic the old behavoir with 2h range and 1 interval
(lin-slider intervals are given in seconds!) but with the new jogslider
function (zero region is a bit smaller and that for +-1 frame larger).
The offset is given in 1/100 frames... 100 means the scale is shifted by 1
frame, i.e. the range for 1 frame is now used for 0 frames and so on...
The Threshold gives the number of frames when only I-frames are located
(same meaning as the wheel_threshold)!
So if you want to have tics at approx. 10, 100, 1000, 10000 and 100000 frames
with no zero region at all (only in the middle) you have to put into the
config file:
jog_interval=6
jog_maximum=1000000
jog_offset=0
That's acctually what I use now... together with:
jog_threshold=100
lin_interval=900
ciao
Ralph
PS: To apply the patch you have to call within your dvbcut directory (Rev. 9
from the SVN repository!):
patch -p1 <jogslider.diff
But, maybe Michael (or Sven?) can commit the changes to the respository...
--- svn/src/dvbcut.cpp 2006-09-23 23:08:54.000000000 +0200
+++ mydvbcut/src/dvbcut.cpp 2006-09-24 15:19:54.000000000 +0200
@@ -149,6 +149,19 @@
// Note: delta is a multiple of 120 (see Qt documentation)
wheel_delta =
settings.readNumEntry(DVBCUT_QSETTINGS_PATH "wheel_delta", 120);
+ jog_maximum =
+ settings.readNumEntry(DVBCUT_QSETTINGS_PATH "jog_maximum", 180000);
+ jog_threshold =
+ settings.readNumEntry(DVBCUT_QSETTINGS_PATH "jog_threshold", 50);
+ // that's in 1/100 frames! (readDoubleNumEntry does not exist?)
+ // to increase the "zero frames"-region of the jog-slider
+ jog_offset =
+ settings.readNumEntry(DVBCUT_QSETTINGS_PATH "jog_offset", 40)/100.;
+ // sub-intervals of jog_maximum
+ jog_interval =
+ settings.readNumEntry(DVBCUT_QSETTINGS_PATH "jog_interval", 1);
+ lin_interval =
+ settings.readNumEntry(DVBCUT_QSETTINGS_PATH "lin_interval", 3600);
}
// install event handler
@@ -711,10 +724,26 @@
int relpic=0;
- if (v>=4000)
- relpic=int(exp(alpha*(v-4000))+.5);
- else if (v<=-4000)
- relpic=-int(exp(alpha*(-v-4000))+.5);
+ /*
+ if (v>jog_offset)
+ relpic=int(exp(alpha*(v-jog_offset))+.5);
+ else if (v<-jog_offset)
+ relpic=-int(exp(alpha*(-v-jog_offset))+.5);
+ */
+ /*
+ alternative function
+ (fits better to external tick interval setting, because jog_offset
+ only affects scale at small numbers AND range of 1 frame is NOT smaller
+ than range of 0 and 2 frames as in old function!)
+ */
+ if (v>0) {
+ relpic=int(exp(alpha*v)-jog_offset);
+ if(relpic<0) relpic=0;
+ }
+ else if (v<0) {
+ relpic=-int(exp(-alpha*v)-jog_offset);
+ if(relpic>0) relpic=0;
+ }
int newpic=jogmiddlepic+relpic;
if (newpic<0)
@@ -722,10 +751,10 @@
else if (newpic>=pictures)
newpic=pictures-1;
- if (relpic>50) {
+ if (relpic>jog_threshold) {
newpic=mpg->nextiframe(newpic);
fine=false;
- } else if (relpic<-50) {
+ } else if (relpic<-jog_threshold) {
fine=false;
} else
fine=true;
@@ -1209,9 +1238,13 @@
linslider->setMaxValue(pictures-1);
linslider->setLineStep(int(300*fps));
linslider->setPageStep(int(900*fps));
- linslider->setTickInterval(int(3600*fps));
+ linslider->setTickInterval(int(lin_interval*fps));
- alpha=log(180000)/96000.;
+ //alpha=log(jog_maximum)/double(100000-jog_offset);
+ // with alternative function
+ alpha=log(jog_maximum)/100000.;
+ if(jog_interval>0)
+ jogslider->setTickInterval(int(100000/jog_interval));
imagedisplay->setBackgroundMode(Qt::NoBackground);
curpic=~0;
--- svn/src/dvbcut.h 2006-09-23 23:08:54.000000000 +0200
+++ mydvbcut/src/dvbcut.h 2006-09-24 14:40:46.000000000 +0200
@@ -63,6 +63,11 @@
int wheel_increments[WHEEL_INCR_num];
int wheel_threshold;
int wheel_delta;
+ int jog_maximum;
+ int jog_threshold;
+ int jog_offset;
+ int jog_interval;
+ int lin_interval;
protected:
// QPixmap getpixmap(int picture, bool allgop=false);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
DVBCUT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dvbcut-user