#include <klocalizedstring.h>
// TODO(fleury): this should probably be a user configuration parameter (at least the max speed).
-const double SPEEDS[] = {0.0, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0};
+//const double SPEEDS[] = {0.0, 0.5, 1.0, 2.0, 4.0, 8.0, 16.0, 32.0};
+const double SPEEDS[] = {0.0, 1.0, 2.0, 4.0, 5.0, 8.0, 16.0, 60.0};
const size_t SPEEDS_SIZE = sizeof(SPEEDS) / sizeof(double);
JogShuttleAction::JogShuttleAction (const JogShuttle* jogShuttle, const QStringList& actionMap, QObject * parent)
stop_me = false;
m_isWorking = false;
shuttlevalue = 0xffff;
- shuttlechange = false;
+ shuttlecounter = 0;
jogvalue = 0xffff;
}
//gettimeofday( &last_shuttle, 0 );
//need_synthetic_shuttle = value != 0;
- if (value == shuttlevalue)
+ if (value == shuttlevalue) {
+ shuttlecounter = 1;
return;
+ }
if (value > MAX_SHUTTLE_RANGE || value < -MAX_SHUTTLE_RANGE) {
fprintf(stderr, "Jog Shuttle returned value of %d (should be between -%d ad +%d)", value, MAX_SHUTTLE_RANGE, MAX_SHUTTLE_RANGE);
return;
}
shuttlevalue = value;
- shuttlechange = true;
+ shuttlecounter = 1;
QApplication::postEvent(m_parent, new QEvent((QEvent::Type) (JOG_STOP + value)));
}
QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_BACK1));
else if ((forward && !wrap) || (rewind && wrap))
QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_FWD1));
- else if (!forward && !rewind && !shuttlechange)
+ else if (!forward && !rewind && shuttlecounter > 2) {
// An event without changing the jog value is sent after each shuttle change.
// As the shuttle rest position does not get a shuttle event, only a non-position-changing jog event.
// Hence we stop on this when we see 2 non-position-changing jog events in a row.
+ shuttlecounter = 0;
QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_STOP));
+ }
}
jogvalue = value;
- shuttlechange = false;
+ if (shuttlecounter > 0) shuttlecounter++;
}
void init(QObject *parent, QString device);
QObject *m_parent;
int shuttlevalue;
- bool shuttlechange;
+ int shuttlecounter;
unsigned short jogvalue;
bool isWorking();
bool stop_me;
int fd;
for (int i = 0; i < 30; i++) {
QString filename = baseName + QString::number(i);
- kDebug() << "/// CHECKING OFR: " << filename;
+ kDebug() << "/// CHECKING device: " << filename;
char name[256] = "unknown";
fd = KDE_open((char *) filename.toUtf8().data(), O_RDONLY);
return;
// if (speed == 0.0) m_mltProducer->set("out", m_mltProducer->get_length() - 1);
m_mltProducer->set_speed(speed);
+ if (speed != 0) m_mltConsumer->set("refresh", 1);
}
void Render::play(const GenTime & startTime)