Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
8937d07f
Commit
8937d07f
authored
Aug 24, 2010
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EffectsEngine: Respecting plugin path reference.
Won't work for windows right now.
parent
3250bf1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
src/EffectsEngine/EffectsEngine.cpp
src/EffectsEngine/EffectsEngine.cpp
+31
-4
src/EffectsEngine/EffectsEngine.h
src/EffectsEngine/EffectsEngine.h
+3
-1
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+6
-6
No files found.
src/EffectsEngine/EffectsEngine.cpp
View file @
8937d07f
...
...
@@ -71,12 +71,17 @@ EffectsEngine::loadEffect( const QString &fileName )
else
{
type
=
static_cast
<
Effect
::
Type
>
(
typeInt
);
if
(
m_effects
.
contains
(
name
)
==
true
)
{
delete
e
;
return
false
;
}
m_effects
[
name
]
=
e
;
emit
effectAdded
(
e
,
name
,
type
);
return
true
;
}
}
if
(
e
->
load
()
==
false
)
if
(
e
->
load
()
==
false
||
m_effects
.
contains
(
e
->
name
()
)
==
true
)
{
delete
e
;
return
false
;
...
...
@@ -94,11 +99,14 @@ void
EffectsEngine
::
browseDirectory
(
const
QString
&
path
)
{
QDir
dir
(
path
);
const
Q
String
List
&
files
=
dir
.
entryList
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
|
const
Q
FileInfo
List
&
files
=
dir
.
entry
Info
List
(
QDir
::
Files
|
QDir
::
NoDotAndDotDot
|
QDir
::
Readable
|
QDir
::
Executable
);
foreach
(
const
Q
String
&
file
,
files
)
foreach
(
const
Q
FileInfo
&
file
,
files
)
{
loadEffect
(
path
+
'/'
+
file
);
if
(
file
.
isDir
()
)
browseDirectory
(
file
.
absoluteFilePath
()
);
else
loadEffect
(
file
.
absoluteFilePath
()
);
}
}
...
...
@@ -213,3 +221,22 @@ EffectsEngine::initMixers( const MixerList &mixers, quint32 width, quint32 heigh
++
it
;
}
}
void
EffectsEngine
::
loadEffects
()
{
//FIXME: What should we do for windows ?!
//Refer to http://www.piksel.org/frei0r/1.2/spec/group__pluglocations.html
const
QString
paths
[
3
]
=
{
QString
(
QDir
::
homePath
()
+
"/.frei0r-1/lib/"
),
QString
(
"/usr/local/lib/frei0r-1/"
),
QString
(
"/usr/lib/frei0r-1/"
)
};
for
(
quint32
i
=
0
;
i
<
3
;
++
i
)
{
if
(
QFile
::
exists
(
paths
[
i
]
)
==
true
)
{
browseDirectory
(
paths
[
i
]
);
}
}
}
src/EffectsEngine/EffectsEngine.h
View file @
8937d07f
...
...
@@ -77,7 +77,7 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
Effect
*
effect
(
const
QString
&
name
);
bool
loadEffect
(
const
QString
&
fileName
);
void
browseDirectory
(
const
QString
&
path
);
void
loadEffects
(
);
//Filters methods:
static
void
applyFilters
(
const
FilterList
&
effects
,
...
...
@@ -93,7 +93,9 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
private:
EffectsEngine
();
~
EffectsEngine
();
void
browseDirectory
(
const
QString
&
path
);
private:
QHash
<
QString
,
Effect
*>
m_effects
;
QSettings
*
m_cache
;
QTime
*
m_time
;
...
...
src/Gui/MainWindow.cpp
View file @
8937d07f
...
...
@@ -446,7 +446,7 @@ MainWindow::initializeDockWidgets( void )
QT_TRANSLATE_NOOP
(
"DockWidgetManager"
,
"Effects List"
),
Qt
::
AllDockWidgetAreas
,
QDockWidget
::
AllDockWidgetFeatures
,
Qt
::
LeftDockWidgetArea
);
EffectsEngine
::
getInstance
()
->
browseDirectory
(
"/usr/lib/frei0r-1"
);
EffectsEngine
::
getInstance
()
->
loadEffects
(
);
m_renderer
=
new
WorkflowRenderer
();
m_renderer
->
initializeRenderer
();
...
...
@@ -638,7 +638,7 @@ MainWindow::renderVideoSettings( bool exportType )
if
(
exportType
)
outputFileName
=
VLMC_GET_STRING
(
"general/TempFolderLocation"
)
+
"/"
+
VLMC_PROJECT_GET_STRING
(
"general/ProjectName"
)
+
VLMC_PROJECT_GET_STRING
(
"general/ProjectName"
)
+
"-vlmc.mp4"
;
else
outputFileName
=
settings
->
outputFileName
();
...
...
@@ -666,23 +666,23 @@ MainWindow::on_actionShare_On_Internet_triggered()
if
(
!
renderVideoSettings
(
true
)
)
return
;
checkFolders
();
QString
fileName
=
VLMC_GET_STRING
(
"general/TempFolderLocation"
)
+
"/"
+
VLMC_PROJECT_GET_STRING
(
"general/ProjectName"
)
+
VLMC_PROJECT_GET_STRING
(
"general/ProjectName"
)
+
"-vlmc.mp4"
;
loadGlobalProxySettings
();
ShareOnInternet
*
shareVideo
=
new
ShareOnInternet
();
shareVideo
->
setVideoFile
(
fileName
);
if
(
shareVideo
->
exec
()
==
QDialog
::
Rejected
)
{
delete
shareVideo
;
return
;
}
delete
shareVideo
;
}
}
...
...
Write
Preview
Markdown
is supported
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