diff --git a/rmapplugin/rmapplugin.cpp b/rmapplugin/rmapplugin.cpp --- a/rmapplugin/rmapplugin.cpp +++ b/rmapplugin/rmapplugin.cpp @@ -388,12 +388,8 @@ void rmapplugin::connectPythonWrapper() // TIMECODES connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimecode()), this->UI->starDundee, SLOT(sendOneTimecode()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendTimecodePeriodically()), - this->UI->starDundee, SLOT(sendTimecodePeriodically()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimePacketAndOneTimecode()), - this->UI->starDundee, SLOT(sendOneTimePacketAndOneTimecode()) ); - connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendOneTimePacketAndTimecodePeriodically()), - this->UI->starDundee, SLOT(sendOneTimePacketAndTimecodePeriodically()) ); + connect( (rmappluginPythonWrapper*)this->pyObject, SIGNAL(sig_sendTimecodePeriodically(unsigned char)), + this->UI->starDundee, SLOT(startSendingTimecodePeriodically(unsigned char)) ); } diff --git a/rmapplugin/rmappluginpythonwrapper.cpp b/rmapplugin/rmappluginpythonwrapper.cpp --- a/rmapplugin/rmappluginpythonwrapper.cpp +++ b/rmapplugin/rmappluginpythonwrapper.cpp @@ -158,8 +158,10 @@ void rmappluginPythonWrapper::sendOneTim emit sig_sendOneTimecode(); } -void rmappluginPythonWrapper::sendTimecodePeriodically() +void rmappluginPythonWrapper::sendTimecodePeriodically( unsigned int onOff ) { - emit sig_sendTimecodePeriodically(); + unsigned char newOnOff; + newOnOff = (unsigned char) onOff; + emit sig_sendTimecodePeriodically( newOnOff ); } diff --git a/rmapplugin/rmappluginpythonwrapper.h b/rmapplugin/rmappluginpythonwrapper.h --- a/rmapplugin/rmappluginpythonwrapper.h +++ b/rmapplugin/rmappluginpythonwrapper.h @@ -43,7 +43,7 @@ signals: //******************* // TIMECODE SIGNALS void sig_sendOneTimecode(); - void sig_sendTimecodePeriodically(); + void sig_sendTimecodePeriodically(unsigned char); public slots: QList ReadSPW(unsigned int size=0); @@ -67,7 +67,7 @@ public slots: //******************* // TIMECODE FUNCTIONS void sendOneTimecode(); - void sendTimecodePeriodically(); + void sendTimecodePeriodically(unsigned int onOff); }; diff --git a/rmapplugin/stardundee.cpp b/rmapplugin/stardundee.cpp --- a/rmapplugin/stardundee.cpp +++ b/rmapplugin/stardundee.cpp @@ -1045,6 +1045,7 @@ void StarDundee::sendTimecodePeriodicall flag_sendTimecodePeriodically = true; this->starDundeeSendTimecodePeriodically->setText("stop timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( false ); } else { @@ -1057,6 +1058,28 @@ void StarDundee::sendTimecodePeriodicall } } +void StarDundee::startSendingTimecodePeriodically(unsigned char onOff) +{ + if (onOff == 0) + { + if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 0, 0)) + emit sendMessage("Could not disable auto tick-in"); + + flag_sendTimecodePeriodically = false; + this->starDundeeSendTimecodePeriodically->setText("start timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( true ); + } + else + { + if (!USBSpaceWire_TC_EnableAutoTickIn(hDevice, 1, 1)) + emit sendMessage("Could not enable auto tick-in"); + + flag_sendTimecodePeriodically = true; + this->starDundeeSendTimecodePeriodically->setText("stop timecodes at 1 Hz"); + starDundeeSendOneTimePacketAndTimecodePeriodically->setEnabled( false ); + } +} + void StarDundee::sendUpdateTime(long time) { Packet_TC_LFR_UPDATE_TIME_t packet; diff --git a/rmapplugin/stardundee.h b/rmapplugin/stardundee.h --- a/rmapplugin/stardundee.h +++ b/rmapplugin/stardundee.h @@ -62,6 +62,7 @@ public slots: // TIMECODES void sendOneTimecode(); void sendTimecodePeriodically(); + void startSendingTimecodePeriodically( unsigned char onOff ); void sendOneTimePacketAndOneTimecode(); void sendOneTimePacketAndTimecodePeriodically(); void updateTimeToSend(long timeToSend);