Skip to content

Commit

Permalink
add Open Other > Animation
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed May 3, 2022
1 parent 471b825 commit 25a4187
Show file tree
Hide file tree
Showing 13 changed files with 823 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/build-shotcut-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function set_globals {

#####
# mlt
CONFIG[1]="cmake -GNinja -DCMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR -DCMAKE_PREFIX_PATH=$QTDIR -DGPL=ON -DGPL3=ON -DMOD_GDK=OFF -DMOD_SDL1=OFF $CMAKE_DEBUG_FLAG"
CONFIG[1]="cmake -GNinja -DCMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR -DCMAKE_PREFIX_PATH=$QTDIR -DGPL=ON -DGPL3=ON -DMOD_GLAXNIMATE=ON -DMOD_GDK=OFF -DMOD_SDL1=OFF $CMAKE_DEBUG_FLAG"
CFLAGS_[1]="-I$FINAL_INSTALL_DIR/include $ASAN_CFLAGS $CFLAGS"
LDFLAGS_[1]="-L$FINAL_INSTALL_DIR/lib $ASAN_LDFLAGS $LDFLAGS"

Expand Down Expand Up @@ -725,7 +725,7 @@ function get_subproject {
# No git repo
debug "No git repo, need to check out"
feedback_status "Cloning git sources for $1"
cmd git --no-pager clone --quiet $REPOLOC || die "Unable to git clone source for $1 from $REPOLOC"
cmd git --no-pager clone --quiet --recurse-submodules $REPOLOC || die "Unable to git clone source for $1 from $REPOLOC"
cmd cd $1 || die "Unable to change to directory $1"
cmd git checkout $REVISION || die "Unable to git checkout $REVISION"
fi
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-shotcut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ function set_globals {

#####
# mlt
CONFIG[1]="cmake -GNinja -DCMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR -DCMAKE_PREFIX_PATH=$QTDIR -DGPL=ON -DGPL3=ON -DMOD_GDK=OFF -DMOD_SDL1=OFF $CMAKE_DEBUG_FLAG"
CONFIG[1]="cmake -GNinja -DCMAKE_INSTALL_PREFIX=$FINAL_INSTALL_DIR -DCMAKE_PREFIX_PATH=$QTDIR -DGPL=ON -DGPL3=ON -DMOD_GLAXNIMATE=ON -DMOD_GDK=OFF -DMOD_SDL1=OFF $CMAKE_DEBUG_FLAG"
# Remember, if adding more of these, to update the post-configure check.
if test "1" = "$MLT_DISABLE_SOX" ; then
CONFIG[1]="${CONFIG[1]} -DMOD_SOX=OFF"
Expand Down Expand Up @@ -1241,7 +1241,7 @@ function get_subproject {
# No git repo
debug "No git repo, need to check out"
feedback_status "Cloning git sources for $1"
cmd git --no-pager clone $REPOLOC || die "Unable to git clone source for $1 from $REPOLOC"
cmd git --no-pager clone --quiet --recurse-submodules $REPOLOC || die "Unable to git clone source for $1 from $REPOLOC"
cmd cd $1 || die "Unable to change to directory $1"
cmd git checkout $REVISION || die "Unable to git checkout $REVISION"
fi
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ add_executable(shotcut WIN32 MACOSX_BUNDLE
qmltypes/qmlview.cpp qmltypes/qmlview.h
qmltypes/thumbnailprovider.cpp qmltypes/thumbnailprovider.h
qmltypes/timelineitems.cpp qmltypes/timelineitems.h
resources.qrc
scrubbar.cpp scrubbar.h
settings.cpp settings.h
sharedframe.cpp sharedframe.h
Expand Down Expand Up @@ -125,6 +126,8 @@ add_executable(shotcut WIN32 MACOSX_BUNDLE
widgets/frameratewidget.cpp widgets/frameratewidget.h
widgets/gdigrabwidget.cpp widgets/gdigrabwidget.h
widgets/gdigrabwidget.ui
widgets/glaxnimateproducerwidget.cpp widgets/glaxnimateproducerwidget.h
widgets/glaxnimateproducerwidget.ui
widgets/gltestwidget.cpp widgets/gltestwidget.h
widgets/imageproducerwidget.cpp widgets/imageproducerwidget.h
widgets/imageproducerwidget.ui
Expand Down
7 changes: 7 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "widgets/countproducerwidget.h"
#include "widgets/decklinkproducerwidget.h"
#include "widgets/directshowvideowidget.h"
#include "widgets/glaxnimateproducerwidget.h"
#include "widgets/isingwidget.h"
#include "widgets/jackproducerwidget.h"
#include "widgets/toneproducerwidget.h"
Expand Down Expand Up @@ -1033,6 +1034,8 @@ void MainWindow::setupOpenOtherMenu()
if (!Settings.playerGPU() && mltProducers->get_data("qtext") && mltFilters->get_data("dynamictext"))
otherMenu->addAction(tr("Text"), this, SLOT(onOpenOtherTriggered()))->setObjectName("text");
}
if (mltProducers->get_data("glaxnimate"))
otherMenu->addAction(tr("Animation"), this, SLOT(onOpenOtherTriggered()))->setObjectName("glaxnimate");
if (mltProducers->get_data("noise"))
otherMenu->addAction(tr("Noise"), this, SLOT(onOpenOtherTriggered()))->setObjectName("noise");
if (mltProducers->get_data("frei0r.ising0r"))
Expand Down Expand Up @@ -3423,6 +3426,8 @@ QWidget *MainWindow::loadProducerWidget(Mlt::Producer *producer)
w = new DecklinkProducerWidget(this);
else if (service == "color")
w = new ColorProducerWidget(this);
else if (service == "glaxnimate")
w = new GlaxnimateProducerWidget(this);
else if (service == "noise")
w = new NoiseWidget(this);
else if (service == "frei0r.ising0r")
Expand Down Expand Up @@ -4748,6 +4753,8 @@ void MainWindow::onOpenOtherTriggered()
onOpenOtherTriggered(new ColorProducerWidget(this));
else if (sender()->objectName() == "text")
onOpenOtherTriggered(new TextProducerWidget(this));
else if (sender()->objectName() == "glaxnimate")
onOpenOtherTriggered(new GlaxnimateProducerWidget(this));
else if (sender()->objectName() == "noise")
onOpenOtherTriggered(new NoiseWidget(this));
else if (sender()->objectName() == "ising0r")
Expand Down
1 change: 1 addition & 0 deletions src/mltcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ bool Controller::isFileProducer(Service *service) const
QString serviceName = service->get("mlt_service");
return (serviceName == "pixbuf" ||
serviceName == "qimage" ||
serviceName == "glaxnimate" ||
serviceName.startsWith("avformat") ||
serviceName.startsWith("timewarp"));
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/audiolevelstask.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2021 Meltytech, LLC
* Copyright (c) 2013-2022 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -61,7 +61,7 @@ void AudioLevelsTask::start(Mlt::Producer &producer, QObject *object, const QMod

QString serviceName = producer.get("mlt_service");
if (serviceName == "pixbuf" || serviceName == "qimage" || serviceName == "webvfx" ||
serviceName == "color" || serviceName.startsWith("frei0r") ||
serviceName == "color" || serviceName.startsWith("frei0r") || serviceName == "glaxnimate" ||
(serviceName.startsWith("avformat") && producer.get_int("audio_index") == -1)) {
return;
}
Expand Down
5 changes: 5 additions & 0 deletions src/resources.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>resources/glaxnimate.rawr</file>
</qresource>
</RCC>
115 changes: 115 additions & 0 deletions src/resources/glaxnimate.rawr
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"animation": {
"__type__": "MainComposition",
"animation": {
"__type__": "AnimationContainer",
"first_frame": 0,
"last_frame": 180
},
"fps": 60,
"group_color": "#00000000",
"height": 1080,
"locked": false,
"name": "FHD",
"shapes": [
{
"__type__": "Layer",
"animation": {
"__type__": "AnimationContainer",
"first_frame": 0,
"last_frame": 180
},
"group_color": "#00000000",
"locked": false,
"mask": {
"__type__": "MaskSettings",
"mask": false
},
"name": "Layer",
"opacity": {
"value": 1
},
"parent": null,
"render": true,
"shapes": [
],
"transform": {
"__type__": "Transform",
"anchor_point": {
"value": {
"x": 960,
"y": 540
}
},
"position": {
"value": {
"x": 960,
"y": 540
}
},
"rotation": {
"value": 0
},
"scale": {
"value": {
"x": 1,
"y": 1
}
}
},
"uuid": "86cecbdb-5208-4524-996d-4e97b73cf4b0",
"visible": true
}
],
"uuid": "a1707288-5426-48ab-b148-b3a6089377c2",
"visible": true,
"width": 1920
},
"assets": {
"__type__": "Assets",
"colors": {
"__type__": "NamedColorList",
"name": "",
"uuid": "5b0b6c5e-5d3f-4d8f-b17c-d5ad306f4303",
"values": [
]
},
"gradient_colors": {
"__type__": "GradientColorsList",
"name": "",
"uuid": "6f4baf7a-8ba0-4e9b-b705-039614059593",
"values": [
]
},
"gradients": {
"__type__": "GradientList",
"name": "",
"uuid": "dab347b8-d711-41e1-8a43-4f0aa7fa5569",
"values": [
]
},
"images": {
"__type__": "BitmapList",
"name": "",
"uuid": "507e47f5-387b-4fa8-b9b4-473991bb5186",
"values": [
]
},
"name": "",
"precompositions": {
"__type__": "PrecompositionList",
"name": "",
"uuid": "a49bc4d7-ea88-4d22-a69a-de7ce2b9e0e7",
"values": [
]
},
"uuid": "e003de29-5b3e-4e37-b4ae-062805bbede5"
},
"format": {
"format_version": 3,
"generator": "Glaxnimate",
"generator_version": "0.4.3-23-g6234cd9"
},
"metadata": {
}
}
10 changes: 10 additions & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,16 @@ void ShotcutSettings::setVideoInput(const QString &name)
settings.setValue("videoInput", name);
}

QString ShotcutSettings::glaxnimatePath() const
{
return settings.value("glaxnimatePath", "glaxnimate").toString();
}

void ShotcutSettings::setGlaxnimatePath(const QString &path)
{
settings.setValue("glaxnimatePath", path);
}

bool ShotcutSettings::proxyEnabled() const
{
return settings.value("proxy/enabled", false).toBool();
Expand Down
2 changes: 2 additions & 0 deletions src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ class ShotcutSettings : public QObject
void setAudioInput(const QString &name);
QString videoInput() const;
void setVideoInput(const QString &name);
QString glaxnimatePath() const;
void setGlaxnimatePath(const QString &path);

// proxy
bool proxyEnabled() const;
Expand Down
Loading

0 comments on commit 25a4187

Please sign in to comment.