*
* @param parent parent QWidget
*/
- KoSliderCombo(QWidget *parent = 0);
+ explicit KoSliderCombo(QWidget *parent = 0);
/**
* Destructor
// Video 4 Linux device detection
for (int i = 0; i < 10; ++i) {
- QString path = "/dev/video" + QString::number(i);
+ QString path = QLatin1String("/dev/video") + QString::number(i);
if (QFile::exists(path)) {
QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path);
if (!deviceInfo.isEmpty()) {
QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
QMap<QString, int> action_pos;
foreach (const QString& action_id, actions_map) {
- // This loop find out at what index is the string that would map to the action_id.
- for (int i = 0; i < action_names.size(); ++i) {
- if (mappable_actions[action_names[i]] == action_id) {
- action_pos[action_id] = i;
- break;
- }
- }
+ // This loop find out at what index is the string that would map to the action_id.
+ for (int i = 0; i < action_names.size(); ++i) {
+ if (mappable_actions[action_names.at(i)] == action_id) {
+ action_pos[action_id] = i;
+ break;
+ }
+ }
}
int i = 0;
foreach (KComboBox* button, m_shuttle_buttons) {
- button->addItems(action_names);
- connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
- ++i;
- if (i < actions_map.size())
- button->setCurrentIndex(action_pos[actions_map[i]]);
+ button->addItems(action_names);
+ connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
+ ++i;
+ if (i < actions_map.size())
+ button->setCurrentIndex(action_pos[actions_map[i]]);
}
#else /* ! USE_JOGSHUTTLE */
m_configShuttle.kcfg_enableshuttle->hide();
Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
// No blackmagic card found
- m_configSdl.kcfg_external_display->setEnabled(false);
+ m_configSdl.kcfg_external_display->setEnabled(false);
}
double dvgrabVersion = 0;
QTextStream stream(&file);
QString line = stream.readLine();
QString deviceId;
- while (!line.isNull()) {
+ while (!line.isNull()) {
if (line.contains("playback")) {
deviceId = line.section(':', 0, 0);
m_configSdl.kcfg_audio_device->addItem(line.section(':', 1, 1), "plughw:" + QString::number(deviceId.section('-', 0, 0).toInt()) + ',' + QString::number(deviceId.section('-', 1, 1).toInt()));
void KdenliveSettingsDialog::slotCheckShuttle(int state)
{
#ifdef USE_JOGSHUTTLE
- m_configShuttle.config_group->setEnabled(state);
+ m_configShuttle.config_group->setEnabled(state);
if (m_configShuttle.shuttledevicelist->count() == 0) {
// parse devices
QString baseName = "/dev/input/event";
#ifdef USE_JOGSHUTTLE
// revert jog shuttle device
if (m_configShuttle.shuttledevicelist->count() > 0) {
- for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); ++i) {
- if (m_configShuttle.shuttledevicelist->itemData(i) == KdenliveSettings::shuttledevice()) {
- m_configShuttle.shuttledevicelist->setCurrentIndex(i);
- break;
- }
- }
+ for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); ++i) {
+ if (m_configShuttle.shuttledevicelist->itemData(i) == KdenliveSettings::shuttledevice()) {
+ m_configShuttle.shuttledevicelist->setCurrentIndex(i);
+ break;
+ }
+ }
}
// Revert jog shuttle buttons
QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
QMap<QString, int> action_pos;
foreach (const QString& action_id, actions_map) {
- // This loop find out at what index is the string that would map to the action_id.
- for (int i = 0; i < action_names.size(); ++i) {
- if (m_mappable_actions[action_names[i]] == action_id) {
- action_pos[action_id] = i;
- break;
- }
- }
+ // This loop find out at what index is the string that would map to the action_id.
+ for (int i = 0; i < action_names.size(); ++i) {
+ if (m_mappable_actions[action_names[i]] == action_id) {
+ action_pos[action_id] = i;
+ break;
+ }
+ }
}
int i = 0;
foreach (KComboBox* button, m_shuttle_buttons) {
- ++i;
- if (i < actions_map.size())
- button->setCurrentIndex(action_pos[actions_map[i]]);
+ ++i;
+ if (i < actions_map.size())
+ button->setCurrentIndex(action_pos[actions_map[i]]);
}
#endif /* USE_JOGSHUTTLE */
}
bool updateCapturePath = false;
/*if (m_configShuttle.shuttledevicelist->count() > 0) {
- QString device = m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString();
- if (device != KdenliveSettings::shuttledevice()) KdenliveSettings::setShuttledevice(device);
+ QString device = m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString();
+ if (device != KdenliveSettings::shuttledevice()) KdenliveSettings::setShuttledevice(device);
}*/
if (m_configEnv.kcfg_capturetoprojectfolder->isChecked() != KdenliveSettings::capturetoprojectfolder()) {
KdenliveSettings::setGrab_parameters(data.section(';', 0, 0));
KdenliveSettings::setGrab_extension(data.section(';', 1, 1));
}
-
+
// decklink
data = m_configCapture.kcfg_decklink_profile->itemData(m_configCapture.kcfg_decklink_profile->currentIndex()).toString();
if (!data.isEmpty() && (data.section(';', 0, 0) != KdenliveSettings::decklink_parameters() || data.section(';', 1, 1) != KdenliveSettings::decklink_extension())) {
QString maps = JogShuttleConfig::actionMap(actions);
//fprintf(stderr, "Shuttle config: %s\n", JogShuttleConfig::actionMap(actions).toAscii().constData());
if (KdenliveSettings::shuttlebuttons() != maps)
- KdenliveSettings::setShuttlebuttons(maps);
+ KdenliveSettings::setShuttlebuttons(maps);
#endif
KConfigDialog::settingsChangedSlot();
QString data = m_configTranscode.profile_parameters->toPlainText();
data.append(" %1." + m_configTranscode.profile_extension->text());
data.append(';');
- if (!m_configTranscode.profile_description->text().isEmpty())
+ if (!m_configTranscode.profile_description->text().isEmpty())
data.append(m_configTranscode.profile_description->text());
if (m_configTranscode.profile_audioonly->isChecked()) data.append(";audio");
item->setData(Qt::UserRole, data);
{
int type = 0;
if (currentPage() == m_page4) {
- type = m_configCapture.tabWidget->currentIndex();
+ type = m_configCapture.tabWidget->currentIndex();
}
QPointer<EncodingProfilesDialog> d = new EncodingProfilesDialog(type);
d->exec();
Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice, true);
if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device), true) {
// No blackmagic card found
- m_configSdl.kcfg_external_display->setEnabled(false);
+ m_configSdl.kcfg_external_display->setEnabled(false);
}
m_configSdl.kcfg_external_display->setEnabled(KdenliveSettings::decklink_device_found());
}
#include <QHeaderView>
-KeyframeEdit::KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent) :
- QWidget(parent),
- m_min(minFrame),
- m_max(maxFrame),
- m_timecode(tc)
+KeyframeEdit::KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, const Timecode &tc, int activeKeyframe, QWidget* parent) :
+ QWidget(parent),
+ m_min(minFrame),
+ m_max(maxFrame),
+ m_timecode(tc)
{
setupUi(this);
if (m_max == -1) {
keyframe_list->setHorizontalHeaderItem(columnId, new QTableWidgetItem(paramName));
DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0,
- m_params.at(columnId).attribute("min").toDouble(), m_params.at(columnId).attribute("max").toDouble(),
- m_params.at(columnId).attribute("default").toDouble(), comment, columnId, m_params.at(columnId).attribute("suffix"), m_params.at(columnId).attribute("decimals").toInt(), this);
+ m_params.at(columnId).attribute("min").toDouble(), m_params.at(columnId).attribute("max").toDouble(),
+ m_params.at(columnId).attribute("default").toDouble(), comment, columnId, m_params.at(columnId).attribute("suffix"), m_params.at(columnId).attribute("decimals").toInt(), this);
connect(doubleparam, SIGNAL(valueChanged(double)), this, SLOT(slotAdjustKeyframeValue(double)));
connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
connect(doubleparam, SIGNAL(setInTimeline(int)), this, SLOT(slotUpdateVisibleParameter(int)));
for (int col = 0; col < keyframe_list->horizontalHeader()->count(); col++) {
item = keyframe_list->item(row, col);
- if (!item) continue;
+ if (!item) continue;
int v = item->text().toInt();
if (v >= m_params.at(col).attribute("max").toInt())
item->setText(m_params.at(col).attribute("max"));
int KeyframeEdit::getPos(int row)
{
if (!keyframe_list->verticalHeaderItem(row))
- return 0;
+ return 0;
if (KdenliveSettings::frametimecode())
return keyframe_list->verticalHeaderItem(row)->text().toInt();
else
void KeyframeEdit::slotUpdateVisibleParameter(int id, bool update)
{
for (int i = 0; i < m_params.count(); ++i) {
- m_params[i].setAttribute("intimeline", (i == id ? "1" : "0"));
+ m_params[i].setAttribute("intimeline", (i == id ? "1" : "0"));
}
for (int col = 0; col < keyframe_list->columnCount(); col++) {
DoubleParameterWidget *doubleparam = static_cast <DoubleParameterWidget*>(m_slidersLayout->itemAtPosition(col, 0)->widget());
{
Q_OBJECT
public:
- KeyItemDelegate(int min, int max, QAbstractItemView* parent = 0): QItemDelegate(parent), m_min(min), m_max(max) {
+ KeyItemDelegate(int min, int max, QAbstractItemView* parent = 0)
+ : QItemDelegate(parent), m_min(min), m_max(max) {
}
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const {
{
Q_OBJECT
public:
- explicit KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent = 0);
+ explicit KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, const Timecode &tc, int activeKeyframe, QWidget* parent = 0);
virtual ~KeyframeEdit();
virtual void addParameter(QDomElement e, int activeKeyframe = -1);
const QString getValue(const QString &name);
#define SEEK_INACTIVE (-1)
KeyframeHelper::KeyframeHelper(QWidget *parent) :
- QWidget(parent)
- , frameLength(1)
- , m_geom(NULL)
- , m_position(0)
- , m_scale(0)
- , m_movingKeyframe(false)
- , m_movingItem()
- , m_lineHeight(9)
- , m_drag(false)
- , m_hoverKeyframe(-1)
- , m_seekPosition(SEEK_INACTIVE)
+ QWidget(parent)
+ , frameLength(1)
+ , m_geom(NULL)
+ , m_position(0)
+ , m_scale(0)
+ , m_movingKeyframe(false)
+ , m_movingItem()
+ , m_lineHeight(9)
+ , m_drag(false)
+ , m_hoverKeyframe(-1)
+ , m_seekPosition(SEEK_INACTIVE)
{
setFont(KGlobalSettings::toolBarFont());
setMouseTracking(true);
{
m_hoverKeyframe = -1;
if (event->button() != Qt::LeftButton) {
- QWidget::mousePressEvent(event);
- return;
+ QWidget::mousePressEvent(event);
+ return;
}
int xPos = event->x() - margin;
if (m_geom != NULL && (event->y() < m_lineHeight)) {
}
for (int i = 0; i < m_extraGeometries.count(); ++i) {
if (m_extraGeometries.at(i)->next_key(item, mousePos) == 0) {
- Mlt::GeometryItem *item2 = new Mlt::GeometryItem();
+ Mlt::GeometryItem *item2 = new Mlt::GeometryItem();
item2->x(item.x());
item2->frame(item.frame());
m_extraMovingItems.append(item2);
}
}
if (event->y() >= m_lineHeight && event->y() < height()) {
- int seekRequest = xPos / m_scale;
- m_drag = true;
- if (seekRequest != m_position) {
- m_seekPosition = seekRequest;
- emit requestSeek(m_seekPosition);
- update();
- }
+ int seekRequest = xPos / m_scale;
+ m_drag = true;
+ if (seekRequest != m_position) {
+ m_seekPosition = seekRequest;
+ emit requestSeek(m_seekPosition);
+ update();
+ }
}
}
update();
}
event->accept();
- return;
+ return;
}
if (m_movingKeyframe) {
if (!m_dragStart.isNull()) {
// draw pointer
if (m_seekPosition != SEEK_INACTIVE) {
- p.fillRect(margin + m_seekPosition * m_scale - 1, 0, 3, height(), palette().dark());
+ p.fillRect(margin + m_seekPosition * m_scale - 1, 0, 3, height(), palette().dark());
}
QPolygon pa(3);
const int cursor = margin + m_position * m_scale;
{
if (pos == m_position || m_geom == NULL) return;
if (pos == m_seekPosition) {
- m_seekPosition = SEEK_INACTIVE;
+ m_seekPosition = SEEK_INACTIVE;
}
m_position = pos;
update();
return getImage(url, 0, width, height);
}
-void KThumb::extractImage(QList <int>frames)
+void KThumb::extractImage(const QList<int> &frames)
{
if (!KdenliveSettings::videothumbnails() || m_producer == NULL) return;
m_clipManager->slotRequestThumbs(m_id, frames);
frame->set("rescale.interp", "nearest");
frame->set("deinterlace_method", "onefield");
frame->set("top_field_first", -1 );
- QImage p = getFrame(frame, frameWidth, displayWidth, height);
+ const QImage p = getFrame(frame, frameWidth, displayWidth, height);
delete frame;
return p;
}
}
//static
-uint KThumb::imageVariance(QImage image )
+uint KThumb::imageVariance(const QImage &image )
{
uint delta = 0;
uint avg = 0;
}
#if KDE_IS_VERSION(4,5,0)
-void KThumb::queryIntraThumbs(QList <int> missingFrames)
+void KThumb::queryIntraThumbs(const QList <int> &missingFrames)
{
foreach (int i, missingFrames) {
if (!m_intraFramesQueue.contains(i)) m_intraFramesQueue.append(i);
bool hasProducer() const;
void clearProducer();
void updateThumbUrl(const QString &hash);
- void extractImage(QList <int> frames);
+ void extractImage(const QList<int> &frames);
QImage extractImage(int frame, int width, int height);
#if KDE_IS_VERSION(4,5,0)
/** @brief Request thumbnails for the frame range. */
- void queryIntraThumbs(QList <int> missingFrames);
+ void queryIntraThumbs(const QList <int> &missingFrames);
/** @brief Query cached thumbnail. */
QImage findCachedThumb(const QString &path);
#endif
/** @brief Calculates image variance, useful to know if a thumbnail is interesting.
* @return an integer between 0 and 100. 0 means no variance, eg. black image while bigger values mean contrasted image
* */
- static uint imageVariance(QImage image);
+ static uint imageVariance(const QImage &image);
private slots:
#if KDE_IS_VERSION(4,5,0)