本文整理汇总了C++中mlt::Properties类的典型用法代码示例。如果您正苦于以下问题:C++ Properties类的具体用法?C++ Properties怎么用?C++ Properties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Properties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateProducer
void ClipController::updateProducer(const QString &id, Mlt::Producer* producer)
{
//TODO replace all track producers
Q_UNUSED(id)
Mlt::Properties passProperties;
// Keep track of necessary properties
QString proxy = producer->get("kdenlive:proxy");
if (proxy.length() > 2) {
// This is a proxy producer, read original url from kdenlive property
m_usesProxy = true;
}
else m_usesProxy = false;
passProperties.pass_list(*m_properties, getPassPropertiesList(m_usesProxy));
delete m_properties;
delete m_masterProducer;
m_masterProducer = producer;
m_properties = new Mlt::Properties(producer->get_properties());
// Pass properties from previous producer
m_properties->pass_list(passProperties, getPassPropertiesList(m_usesProxy));
if (!m_masterProducer->is_valid()) qDebug()<<"// WARNING, USING INVALID PRODUCER";
else {
// URL and name shoule not be updated otherwise when proxying a clip we cannot find back the original url
/*m_url = QUrl::fromLocalFile(m_masterProducer->get("resource"));
if (m_url.isValid()) {
m_name = m_url.fileName();
}
*/
}
}
示例2: open
void MainWindow::open(const QString& url, const Mlt::Properties* properties)
{
if (url.endsWith(".mlt") || url.endsWith(".xml")) {
// only check for a modified project when loading a project, not a simple producer
if (!continueModified())
return;
// close existing project
if (m_playlistDock->model()->playlist())
m_playlistDock->model()->close();
// let the new project change the profile
MLT.profile().set_explicit(false);
}
else if (!m_playlistDock->model()->playlist()) {
if (!continueModified())
return;
setCurrentFile("");
}
if (!MLT.open(url.toUtf8().constData())) {
Mlt::Properties* props = const_cast<Mlt::Properties*>(properties);
if (props && props->is_valid())
mlt_properties_inherit(MLT.producer()->get_properties(), props->get_properties());
open(MLT.producer());
m_recentDock->add(url.toUtf8().constData());
}
else {
ui->statusBar->showMessage(tr("Failed to open ") + url, STATUS_TIMEOUT_MS);
}
}
示例3: getPreset
Mlt::Properties* DecklinkProducerWidget::getPreset() const
{
Mlt::Properties* p = new Mlt::Properties;
p->set("card", ui->deviceCombo->currentIndex());
p->set("profile", ui->profileCombo->currentIndex());
return p;
}
示例4: getPreset
Mlt::Properties* IsingWidget::getPreset() const
{
Mlt::Properties* p = new Mlt::Properties;
p->set(kParamTemperature, ui->tempSpinner->text().toLatin1().constData());
p->set(kParamBorderGrowth, ui->borderGrowthSpinner->text().toLatin1().constData());
p->set(kParamSpontaneous, ui->spontGrowthSpinner->text().toLatin1().constData());
return p;
}
示例5: loadPreset
void AlsaWidget::loadPreset(Mlt::Properties& p)
{
QString s(p.get("resource"));
int i = s.indexOf(':');
if (i > -1)
ui->lineEdit->setText(s.mid(i + 1));
if (p.get("channels"))
ui->alsaChannelsSpinBox->setValue(p.get_int("channels"));
}
示例6: loadPreset
void PlasmaWidget::loadPreset(Mlt::Properties& p)
{
ui->speed1Spinner->setValue(p.get_double(kParamSpeed1));
ui->speed2Spinner->setValue(p.get_double(kParamSpeed2));
ui->speed3Spinner->setValue(p.get_double(kParamSpeed3));
ui->speed4Spinner->setValue(p.get_double(kParamSpeed4));
ui->move1Spinner->setValue(p.get_double(kParamMove1));
ui->move2Spinner->setValue(p.get_double(kParamMove2));
}
示例7: QString
QMap <QString, QString> ClipController::getPropertiesFromPrefix(const QString &prefix, bool withPrefix)
{
Mlt::Properties subProperties;
subProperties.pass_values(*m_properties, prefix.toUtf8().constData());
QMap <QString,QString> subclipsData;
for (int i = 0; i < subProperties.count(); i++) {
subclipsData.insert(withPrefix ? QString(prefix + subProperties.get_name(i)) : subProperties.get_name(i), subProperties.get(i));
}
return subclipsData;
}
示例8: getPreset
Mlt::Properties* PlasmaWidget::getPreset() const
{
Mlt::Properties* p = new Mlt::Properties;
p->set(kParamSpeed1, ui->speed1Spinner->text().toAscii().constData());
p->set(kParamSpeed2, ui->speed2Spinner->text().toAscii().constData());
p->set(kParamSpeed3, ui->speed3Spinner->text().toAscii().constData());
p->set(kParamSpeed4, ui->speed4Spinner->text().toAscii().constData());
p->set(kParamMove1, ui->move1Spinner->text().toAscii().constData());
p->set(kParamMove2, ui->move2Spinner->text().toAscii().constData());
return p;
}
示例9: getPreset
Mlt::Properties CountProducerWidget::getPreset() const
{
Mlt::Properties p;
p.set("direction", currentDirection().toLatin1().constData());
p.set("style", currentStyle().toLatin1().constData());
p.set("sound", currentSound().toLatin1().constData());
p.set("background", currentBackground().toLatin1().constData());
p.set("drop", ui->dropCheckBox->isChecked());
setLength(&p, ui->durationSpinBox->value());
return p;
}
示例10: getPreset
Mlt::Properties AlsaWidget::getPreset() const
{
Mlt::Properties p;
QString s("alsa:%1");
if (ui->lineEdit->text().isEmpty())
s = s.arg("default");
else
s = s.arg(ui->lineEdit->text());
p.set("resource", s.toUtf8().constData());
p.set("channels", ui->alsaChannelsSpinBox->value());
return p;
}
示例11: saveDocumentProperties
void BinController::saveDocumentProperties(const QMap <QString, QString> props, const QMap <double, QString> guidesData)
{
// Clear previous properites
Mlt::Properties playlistProps(m_binPlaylist->get_properties());
Mlt::Properties docProperties;
docProperties.pass_values(playlistProps, "kdenlive:docproperties.");
for (int i = 0; i < docProperties.count(); i++) {
QString propName = QStringLiteral("kdenlive:docproperties.") + docProperties.get_name(i);
playlistProps.set(propName.toUtf8().constData(), (char *)NULL);
}
// Clear previous guides
Mlt::Properties guideProperties;
guideProperties.pass_values(playlistProps, "kdenlive:guide.");
for (int i = 0; i < guideProperties.count(); i++) {
QString propName = QStringLiteral("kdenlive:guide.") + guideProperties.get_name(i);
playlistProps.set(propName.toUtf8().constData(), (char *)NULL);
}
QMapIterator<QString, QString> i(props);
while (i.hasNext()) {
i.next();
playlistProps.set(("kdenlive:docproperties." + i.key()).toUtf8().constData(), i.value().toUtf8().constData());
}
// Append guides
QMapIterator<double, QString> g(guidesData);
QLocale locale;
while (g.hasNext()) {
g.next();
QString propertyName = "kdenlive:guide." + locale.toString(g.key());
playlistProps.set(propertyName.toUtf8().constData(), g.value().toUtf8().constData());
}
}
示例12: cloneProperties
void TransitionHandler::cloneProperties(Mlt::Properties &dest, Mlt::Properties &source)
{
int count = source.count();
int i = 0;
for ( i = 0; i < count; i ++ )
{
char *value = source.get(i);
if ( value != NULL )
{
char *name = source.get_name( i );
if (name != NULL && name[0] != '_') dest.set(name, value);
}
}
}
示例13: ensureHasUuid
QUuid Controller::ensureHasUuid(Mlt::Properties& properties) const
{
if (properties.get(kUuidProperty)) {
return uuid(properties);
} else {
QUuid newUid = QUuid::createUuid();
setUuid(properties, newUid);
return newUid;
}
}
示例14: c
EncodeDock::EncodeDock(QWidget *parent) :
QDockWidget(parent),
ui(new Ui::EncodeDock),
m_presets(Mlt::Repository::presets()),
m_immediateJob(0),
m_profiles(Mlt::Profile::list())
{
LOG_DEBUG() << "begin";
ui->setupUi(this);
ui->stopCaptureButton->hide();
ui->videoCodecThreadsSpinner->setMaximum(QThread::idealThreadCount());
if (QThread::idealThreadCount() < 3)
ui->parallelCheckbox->setHidden(true);
toggleViewAction()->setIcon(windowIcon());
connect(ui->videoBitrateCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(on_videoBufferDurationChanged()));
connect(ui->videoBufferSizeSpinner, SIGNAL(valueChanged(double)), this, SLOT(on_videoBufferDurationChanged()));
m_presetsModel.setSourceModel(new QStandardItemModel(this));
m_presetsModel.setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->presetsTree->setModel(&m_presetsModel);
loadPresets();
// populate the combos
Mlt::Consumer c(MLT.profile(), "avformat");
c.set("f", "list");
c.set("acodec", "list");
c.set("vcodec", "list");
c.start();
c.stop();
Mlt::Properties* p = new Mlt::Properties(c.get_data("f"));
ui->formatCombo->blockSignals(true);
for (int i = 0; i < p->count(); i++)
ui->formatCombo->addItem(p->get(i));
delete p;
ui->formatCombo->model()->sort(0);
ui->formatCombo->insertItem(0, tr("Automatic from extension"));
ui->formatCombo->blockSignals(false);
p = new Mlt::Properties(c.get_data("acodec"));
for (int i = 0; i < p->count(); i++)
ui->audioCodecCombo->addItem(p->get(i));
delete p;
ui->audioCodecCombo->model()->sort(0);
ui->audioCodecCombo->insertItem(0, tr("Default for format"));
p = new Mlt::Properties(c.get_data("vcodec"));
for (int i = 0; i < p->count(); i++)
ui->videoCodecCombo->addItem(p->get(i));
delete p;
ui->videoCodecCombo->model()->sort(0);
ui->videoCodecCombo->insertItem(0, tr("Default for format"));
on_resetButton_clicked();
LOG_DEBUG() << "end";
}
示例15:
Mlt::Properties Video4LinuxWidget::getPreset() const
{
Mlt::Properties p;
p.set("device", ui->v4lLineEdit->text().toLatin1().constData());
p.set("width", ui->v4lWidthSpinBox->value());
p.set("height", ui->v4lHeightSpinBox->value());
p.set("framerate", ui->v4lFramerateSpinBox->value());
p.set("standard", ui->v4lStandardCombo->currentText().toLatin1().constData());
p.set("channel", ui->v4lChannelSpinBox->value());
p.set("audio_ix", ui->v4lAudioComboBox->currentIndex());
return p;
}