From: Ed Rogalsky Date: Mon, 19 Nov 2012 21:12:25 +0000 (+0100) Subject: number of buttons expanded to 15. Contour shuttle pro v2 full support X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=778b2a473faa6c8b9fc966fc1b92d33d77056107;p=kdenlive number of buttons expanded to 15. Contour shuttle pro v2 full support issue: the fd is read in blocking mode. The thread is never shutdown properly and on some systems the program hangs on close. As workaround the thread is terminated --- diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp index 8446076e..1cde287f 100644 --- a/src/jogshuttle.cpp +++ b/src/jogshuttle.cpp @@ -203,7 +203,7 @@ JogShuttle::JogShuttle(QString device, QObject *parent) : JogShuttle::~JogShuttle() { - if (m_shuttleProcess.isRunning()) m_shuttleProcess.exit(); + stopDevice(); } void JogShuttle::initDevice(QString device) @@ -218,8 +218,19 @@ void JogShuttle::initDevice(QString device) void JogShuttle::stopDevice() { - if (m_shuttleProcess.isRunning()) + if (m_shuttleProcess.isRunning()) { + /* the read fd is in blocking mode => stop_me is broken at the moment */ m_shuttleProcess.stop_me = true; + m_shuttleProcess.exit(); + /* give the thread some time to shutdown */ + m_shuttleProcess.wait(100); + + /* if still running - do it in the hardcore way */ + if (m_shuttleProcess.isRunning()) { + m_shuttleProcess.terminate(); + kDebug() << "/// terminate jogshuttle process\n"; + } + } } void JogShuttle::customEvent(QEvent* e) diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 2c28d88f..f2523cc9 100644 --- a/src/jogshuttle.h +++ b/src/jogshuttle.h @@ -40,7 +40,7 @@ public: bool shuttlechange; unsigned short jogvalue; bool isWorking(); - bool stop_me; + volatile bool stop_me; QString m_device; private: diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 015149bc..adb12e58 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -137,6 +137,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map m_configShuttle.shuttledisabled->hide(); // Store the button pointers into an array for easier handling them in the other functions. + // TODO: impl enumerator or live with cut and paste :-))) m_shuttle_buttons.push_back(m_configShuttle.shuttle1); m_shuttle_buttons.push_back(m_configShuttle.shuttle2); m_shuttle_buttons.push_back(m_configShuttle.shuttle3); @@ -147,6 +148,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map m_shuttle_buttons.push_back(m_configShuttle.shuttle8); m_shuttle_buttons.push_back(m_configShuttle.shuttle9); m_shuttle_buttons.push_back(m_configShuttle.shuttle10); + m_shuttle_buttons.push_back(m_configShuttle.shuttle11); + m_shuttle_buttons.push_back(m_configShuttle.shuttle12); + m_shuttle_buttons.push_back(m_configShuttle.shuttle13); + m_shuttle_buttons.push_back(m_configShuttle.shuttle14); + m_shuttle_buttons.push_back(m_configShuttle.shuttle15); // populate the buttons with the current configuration. The items are sorted // according to the user-selected language, so they do not appear in random order. diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 78021b6c..ee580bce 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -676,6 +676,12 @@ MainWindow::~MainWindow() if (m_stopmotion) { delete m_stopmotion; } + +#ifdef USE_JOGSHUTTLE + if (m_jogProcess) + delete m_jogProcess; +#endif + m_effectStack->slotClipItemSelected(NULL); m_transitionConfig->slotTransitionItemSelected(NULL, 0, QPoint(), false); diff --git a/src/widgets/configjogshuttle_ui.ui b/src/widgets/configjogshuttle_ui.ui index 0fc35249..2b69f8c8 100644 --- a/src/widgets/configjogshuttle_ui.ui +++ b/src/widgets/configjogshuttle_ui.ui @@ -6,8 +6,8 @@ 0 0 - 327 - 393 + 299 + 548 @@ -40,6 +40,34 @@ Device configuration + + + + Button 12 + + + + + + + Button 14 + + + + + + + Button 13 + + + + + + + Button 11 + + + @@ -115,6 +143,9 @@ + + + @@ -122,9 +153,6 @@ - - - @@ -157,6 +185,28 @@ + + + + Button 15 + + + + + + + + + + + + + + + + + +