Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
ad1081ba
Commit
ad1081ba
authored
Jun 20, 2017
by
Jean-Baptiste Mardelle
Browse files
Get rid of KdenliveSettings::current_profile() and try directly reusing the core method
parent
fca8319c
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/capture/mltdevicecapture.cpp
View file @
ad1081ba
...
...
@@ -51,7 +51,7 @@ MltDeviceCapture::MltDeviceCapture(QString profile, /*VideoSurface *surface, */
{
analyseAudio
=
KdenliveSettings
::
monitor_audio
();
if
(
profile
.
isEmpty
())
{
profile
=
KdenliveSettings
::
current_profile
();
//
profile = KdenliveSettings::current_profile();
}
buildConsumer
(
profile
);
connect
(
this
,
&
MltDeviceCapture
::
unblockPreview
,
this
,
&
MltDeviceCapture
::
slotPreparePreview
);
...
...
src/core.cpp
View file @
ad1081ba
...
...
@@ -268,14 +268,17 @@ std::unique_ptr<Mlt::Repository> &Core::getMltRepository()
std
::
unique_ptr
<
ProfileModel
>
&
Core
::
getCurrentProfile
()
const
{
// TODO store locally the profile and not in parameters
QString
profile
=
KdenliveSettings
::
current_profile
();
return
ProfileRepository
::
get
()
->
getProfile
(
profile
);
return
ProfileRepository
::
get
()
->
getProfile
(
m_currentProfile
);
}
bool
Core
::
setCurrentProfile
(
const
QString
&
profilePath
)
{
if
(
m_currentProfile
==
profilePath
)
{
// no change required
return
true
;
}
if
(
ProfileRepository
::
get
()
->
profileExists
(
profilePath
))
{
KdenliveSettings
::
setC
urrent
_p
rofile
(
profilePath
)
;
m_c
urrent
P
rofile
=
profilePath
;
// inform render widget
m_mainWindow
->
updateRenderWidgetProfile
();
return
true
;
...
...
src/core.h
View file @
ad1081ba
...
...
@@ -148,6 +148,8 @@ private:
ProducerQueue
*
m_producerQueue
;
Bin
*
m_binWidget
;
LibraryWidget
*
m_library
;
/** @brief Current project's profile path */
QString
m_currentProfile
;
std
::
unique_ptr
<
MltConnection
>
m_mltConnection
;
...
...
src/dialogs/kdenlivesettingsdialog.cpp
View file @
ad1081ba
...
...
@@ -25,6 +25,8 @@
#include
"profilesdialog.h"
#include
"project/dialogs/profilewidget.h"
#include
"renderer.h"
#include
"core.h"
#include
"profiles/profilemodel.hpp"
#include
"utils/KoIconUtils.h"
#ifdef USE_V4L
...
...
@@ -80,7 +82,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &map
m_configProject
.
profile_box
->
setLayout
(
vbox
);
m_configProject
.
profile_box
->
setTitle
(
i18n
(
"Select the default profile (preset)"
));
// Select profile
m_pw
->
loadProfile
(
KdenliveSettings
::
default_profile
().
isEmpty
()
?
KdenliveSettings
::
c
urrent
_p
rofile
()
:
KdenliveSettings
::
default_profile
());
m_pw
->
loadProfile
(
KdenliveSettings
::
default_profile
().
isEmpty
()
?
pCore
->
getC
urrent
P
rofile
()
->
path
()
:
KdenliveSettings
::
default_profile
());
connect
(
m_pw
,
&
ProfileWidget
::
profileChanged
,
this
,
&
KdenliveSettingsDialog
::
slotDialogModified
);
m_page8
->
setIcon
(
KoIconUtils
::
themedIcon
(
QStringLiteral
(
"project-defaults"
)));
connect
(
m_configProject
.
kcfg_generateproxy
,
&
QAbstractButton
::
toggled
,
m_configProject
.
kcfg_proxyminsize
,
&
QWidget
::
setEnabled
);
...
...
@@ -1436,7 +1438,7 @@ void KdenliveSettingsDialog::slotReloadBlackMagic()
void
KdenliveSettingsDialog
::
checkProfile
()
{
m_pw
->
loadProfile
(
KdenliveSettings
::
default_profile
().
isEmpty
()
?
KdenliveSettings
::
c
urrent
_p
rofile
()
:
KdenliveSettings
::
default_profile
());
m_pw
->
loadProfile
(
KdenliveSettings
::
default_profile
().
isEmpty
()
?
pCore
->
getC
urrent
P
rofile
()
->
path
()
:
KdenliveSettings
::
default_profile
());
}
void
KdenliveSettingsDialog
::
slotReloadShuttleDevices
()
...
...
@@ -1465,3 +1467,4 @@ void KdenliveSettingsDialog::slotReloadShuttleDevices()
QTimer
::
singleShot
(
200
,
this
,
SLOT
(
slotUpdateShuttleDevice
()));
#endif // USE_JOGSHUTTLE
}
src/doc/kthumb.cpp
View file @
ad1081ba
...
...
@@ -20,7 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"kthumb.h"
#include
"core.h"
#include
"kdenlivesettings.h"
#include
"profiles/profilemodel.hpp"
#include
<mlt++/Mlt.h>
...
...
@@ -39,7 +41,7 @@ QPixmap KThumb::getImage(const QUrl &url, int width, int height)
// static
QPixmap
KThumb
::
getImage
(
const
QUrl
&
url
,
int
frame
,
int
width
,
int
height
)
{
Mlt
::
Profile
profile
(
KdenliveSettings
::
c
urrent
_p
rofile
()
.
toUtf8
().
constData
()
);
Mlt
::
Profile
profile
=
pCore
->
getC
urrent
P
rofile
()
->
profile
(
);
if
(
height
==
-
1
)
{
height
=
width
*
profile
.
height
()
/
profile
.
width
();
}
...
...
src/kdenlivesettings.kcfg
View file @
ad1081ba
...
...
@@ -683,10 +683,6 @@
<label>
Default project format.
</label>
<default></default>
</entry>
<entry
name=
"current_profile"
type=
"String"
>
<label>
active project format.
</label>
<default></default>
</entry>
<entry
name=
"showdescriptioncolumn"
type=
"Bool"
>
<label>
Show descriptions in project tree view.
</label>
...
...
src/mainwindow.cpp
View file @
ad1081ba
...
...
@@ -211,7 +211,8 @@ void MainWindow::init()
m_commandStack
=
new
QUndoGroup
();
// If using a custom profile, make sure the file exists or fallback to default
if
(
KdenliveSettings
::
current_profile
().
startsWith
(
QLatin1Char
(
'/'
))
&&
!
QFile
::
exists
(
KdenliveSettings
::
current_profile
()))
{
QString
currentProfilePath
=
pCore
->
getCurrentProfile
()
->
path
();
if
(
currentProfilePath
.
startsWith
(
QLatin1Char
(
'/'
))
&&
!
QFile
::
exists
(
currentProfilePath
))
{
KMessageBox
::
sorry
(
this
,
i18n
(
"Cannot find your default profile, switching to ATSC 1080p 25"
));
pCore
->
setCurrentProfile
(
QStringLiteral
(
"atsc_1080p_25"
));
KdenliveSettings
::
setDefault_profile
(
QStringLiteral
(
"atsc_1080p_25"
));
...
...
src/mltcontroller/producerqueue.cpp
View file @
ad1081ba
...
...
@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include
"clipcontroller.h"
#include
"core.h"
#include
"dialogs/profilesdialog.h"
#include
"profiles/profilemodel.hpp"
#include
"doc/kthumb.h"
#include
"kdenlivesettings.h"
#include
"project/dialogs/slideshowclip.h"
...
...
@@ -324,7 +325,7 @@ void ProducerQueue::processFileProperties()
emit
switchProfile
(
clipProfile
,
info
.
clipId
,
info
.
xml
);
}
else
if
(
KdenliveSettings
::
default_profile
().
isEmpty
())
{
// Confirm default project format
KdenliveSettings
::
setDefault_profile
(
KdenliveSettings
::
c
urrent
_p
rofile
());
KdenliveSettings
::
setDefault_profile
(
pCore
->
getC
urrent
P
rofile
()
->
path
()
);
}
}
}
...
...
src/project/dialogs/projectsettings.cpp
View file @
ad1081ba
...
...
@@ -31,6 +31,7 @@
#include
"project/dialogs/profilewidget.h"
#include
"project/dialogs/temporarydata.h"
#include
"titler/titlewidget.h"
#include
"profiles/profilemodel.hpp"
#include
"utils/KoIconUtils.h"
#include
"kdenlive_debug.h"
...
...
@@ -89,7 +90,7 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap<QString, QString> metada
QString
currentProf
;
if
(
doc
)
{
currentProf
=
KdenliveSettings
::
c
urrent
_p
rofile
();
currentProf
=
pCore
->
getC
urrent
P
rofile
()
->
path
()
;
enable_proxy
->
setChecked
(
doc
->
getDocumentProperty
(
QStringLiteral
(
"enableproxy"
)).
toInt
()
!=
0
);
generate_proxy
->
setChecked
(
doc
->
getDocumentProperty
(
QStringLiteral
(
"generateproxy"
)).
toInt
()
!=
0
);
proxy_minsize
->
setValue
(
doc
->
getDocumentProperty
(
QStringLiteral
(
"proxyminsize"
)).
toInt
());
...
...
@@ -424,7 +425,7 @@ void ProjectSettings::accept()
}
}
}
if
(
!
m_savedProject
&&
selectedProfile
()
!=
KdenliveSettings
::
c
urrent
_p
rofile
())
{
if
(
!
m_savedProject
&&
selectedProfile
()
!=
pCore
->
getC
urrent
P
rofile
()
->
path
()
)
{
if
(
KMessageBox
::
warningContinueCancel
(
this
,
i18n
(
"Changing the profile of your project cannot be undone.
\n
It is recommended to save your project before attempting this operation "
"that might cause some corruption in transitions.
\n
Are you sure you want to proceed?"
),
...
...
src/project/jobs/meltjob.cpp
View file @
ad1081ba
...
...
@@ -21,6 +21,8 @@
#include
"meltjob.h"
#include
"doc/kdenlivedoc.h"
#include
"kdenlivesettings.h"
#include
"core.h"
#include
"profiles/profilemodel.hpp"
#include
<klocalizedstring.h>
...
...
@@ -98,7 +100,7 @@ void MeltJob::startJob()
setStatus
(
JobCrashed
);
return
;
}
Mlt
::
Profile
*
projectProfile
=
new
Mlt
::
Profile
(
KdenliveSettings
::
c
urrent
_p
rofile
()
.
toUtf8
().
constData
());
Mlt
::
Profile
*
projectProfile
=
new
Mlt
::
Profile
(
pCore
->
getC
urrent
P
rofile
()
->
profile
());
bool
producerProfile
=
m_extra
.
contains
(
QStringLiteral
(
"producer_profile"
));
if
(
producerProfile
)
{
m_profile
=
new
Mlt
::
Profile
;
...
...
src/project/projectmanager.cpp
View file @
ad1081ba
...
...
@@ -129,7 +129,7 @@ void ProjectManager::newFile(bool showProjectSettings, bool force)
m_fileRevert
->
setEnabled
(
false
);
QString
profileName
=
KdenliveSettings
::
default_profile
();
if
(
profileName
.
isEmpty
())
{
profileName
=
KdenliveSettings
::
c
urrent
_p
rofile
();
profileName
=
pCore
->
getC
urrent
P
rofile
()
->
path
()
;
}
QString
projectFolder
;
QMap
<
QString
,
QString
>
documentProperties
;
...
...
@@ -525,7 +525,7 @@ void ProjectManager::doOpenFile(const QUrl &url, KAutoSaveFile *stale)
m_notesPlugin
->
clear
();
KdenliveDoc
*
doc
=
new
KdenliveDoc
(
stale
?
QUrl
::
fromLocalFile
(
stale
->
fileName
())
:
url
,
QString
(),
pCore
->
window
()
->
m_commandStack
,
KdenliveSettings
::
default_profile
().
isEmpty
()
?
KdenliveSettings
::
c
urrent
_p
rofile
()
:
KdenliveSettings
::
default_profile
(),
QMap
<
QString
,
QString
>
(),
KdenliveSettings
::
default_profile
().
isEmpty
()
?
pCore
->
getC
urrent
P
rofile
()
->
path
()
:
KdenliveSettings
::
default_profile
(),
QMap
<
QString
,
QString
>
(),
QMap
<
QString
,
QString
>
(),
QPoint
(
KdenliveSettings
::
videotracks
(),
KdenliveSettings
::
audiotracks
()),
&
openBackup
,
pCore
->
window
());
if
(
stale
==
nullptr
)
{
stale
=
new
KAutoSaveFile
(
url
,
doc
);
...
...
src/scopes/colorscopes/waveform.cpp
View file @
ad1081ba
...
...
@@ -12,10 +12,12 @@
#include
"waveformgenerator.h"
// For reading out the project resolution
#include
"dialogs/profilesdialog.h"
#include
"kdenlivesettings.h"
#include
"core.h"
#include
"profiles/profilemodel.hpp"
#include
"klocalizedstring.h"
#include
<KSharedConfig>
#include
<KConfigGroup>
#include
<QPainter>
#include
<QPoint>
...
...
@@ -120,7 +122,7 @@ QImage Waveform::renderHUD(uint)
QPainter
davinci
(
&
hud
);
davinci
.
setPen
(
penLight
);
QMap
<
QString
,
QString
>
values
=
ProfilesDialog
::
getSettingsFromFile
(
KdenliveSettings
::
c
urrent
_p
rofile
());
QMap
<
QString
,
QString
>
values
=
ProfilesDialog
::
getSettingsFromFile
(
pCore
->
getC
urrent
P
rofile
()
->
path
()
);
// qCDebug(KDENLIVE_LOG) << values.value("width");
const
int
rightX
=
scopeRect
().
width
()
-
m_textWidth
.
width
()
+
3
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment