Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
21
Issues
21
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLMC
Commits
5b2f557d
Commit
5b2f557d
authored
Feb 20, 2010
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preferences are now created first, and used later.
parent
5b091082
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
97 additions
and
117 deletions
+97
-117
src/Commands/KeyboardShortcutHelper.cpp
src/Commands/KeyboardShortcutHelper.cpp
+1
-1
src/Configuration/SettingsManager.cpp
src/Configuration/SettingsManager.cpp
+21
-29
src/Configuration/SettingsManager.h
src/Configuration/SettingsManager.h
+7
-1
src/Gui/LanguagePreferences.cpp
src/Gui/LanguagePreferences.cpp
+2
-5
src/Gui/MainWindow.cpp
src/Gui/MainWindow.cpp
+50
-19
src/Gui/MainWindow.h
src/Gui/MainWindow.h
+1
-0
src/Gui/settings/AudioProjectPreferences.cpp
src/Gui/settings/AudioProjectPreferences.cpp
+1
-2
src/Gui/settings/KeyboardShortcut.cpp
src/Gui/settings/KeyboardShortcut.cpp
+1
-1
src/Gui/settings/ProjectPreferences.cpp
src/Gui/settings/ProjectPreferences.cpp
+1
-4
src/Gui/settings/VLMCPreferences.cpp
src/Gui/settings/VLMCPreferences.cpp
+0
-10
src/Gui/settings/VideoProjectPreferences.cpp
src/Gui/settings/VideoProjectPreferences.cpp
+4
-9
src/Gui/timeline/TracksRuler.cpp
src/Gui/timeline/TracksRuler.cpp
+1
-1
src/Gui/wizard/GeneralPage.cpp
src/Gui/wizard/GeneralPage.cpp
+1
-1
src/Project/ProjectManager.cpp
src/Project/ProjectManager.cpp
+6
-0
src/main.cpp
src/main.cpp
+0
-34
No files found.
src/Commands/KeyboardShortcutHelper.cpp
View file @
5b2f557d
...
...
@@ -14,7 +14,7 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* pa
QString
set
=
VLMC_GET_STRING
(
name
);
setKey
(
QKeySequence
(
set
)
);
}
SettingsManager
::
getInstance
()
->
watchValue
(
"keyboard/"
+
name
,
this
,
SettingsManager
::
getInstance
()
->
watchValue
(
name
,
this
,
SLOT
(
shortcutUpdated
(
const
QVariant
&
)
),
SettingsManager
::
Vlmc
);
}
...
...
src/Configuration/SettingsManager.cpp
View file @
5b2f557d
...
...
@@ -43,7 +43,11 @@ SettingsManager::setValue( const QString &key,
m_xmlSettings
[
key
]
->
set
(
value
);
else
if
(
type
==
Vlmc
&&
m_classicSettings
.
contains
(
key
)
==
true
)
m_classicSettings
[
key
]
->
set
(
value
);
qWarning
()
<<
"Setting"
<<
key
<<
"does not exist."
;
else
{
Q_ASSERT_X
(
false
,
__FILE__
,
"set value without a created variable"
);
qWarning
()
<<
"Setting"
<<
key
<<
"does not exist."
;
}
return
;
}
...
...
@@ -67,13 +71,16 @@ SettingsManager::setImmediateValue( const QString &key,
{
settMap
->
value
(
key
)
->
set
(
value
);
}
qWarning
()
<<
"Setting"
<<
key
<<
"does not exist."
;
else
{
Q_ASSERT_X
(
false
,
__FILE__
,
"set immediate value without a created variable"
);
qWarning
()
<<
"Setting"
<<
key
<<
"does not exist."
;
}
return
;
}
SettingValue
*
SettingsManager
::
value
(
const
QString
&
key
,
const
QVariant
&
defaultValue
,
SettingsManager
::
Type
type
)
{
QReadLocker
rl
(
&
m_rwLock
);
...
...
@@ -88,6 +95,7 @@ SettingsManager::value( const QString &key,
if
(
m_classicSettings
.
contains
(
key
)
)
return
m_classicSettings
.
value
(
key
);
}
Q_ASSERT_X
(
false
,
__FILE__
,
"get value without a created variable"
);
qWarning
()
<<
"Setting"
<<
key
<<
"does not exist."
;
return
NULL
;
}
...
...
@@ -97,6 +105,8 @@ SettingsManager::group( const QString &groupName, SettingsManager::Type type )
{
QHash
<
QString
,
QVariant
>
ret
;
QReadLocker
rl
(
&
m_rwLock
);
QString
grp
=
groupName
+
'/'
;
if
(
type
==
Project
)
{
SettingHash
::
const_iterator
it
=
m_xmlSettings
.
begin
();
...
...
@@ -104,9 +114,8 @@ SettingsManager::group( const QString &groupName, SettingsManager::Type type )
for
(
;
it
!=
ed
;
++
it
)
{
if
(
it
.
key
().
contains
(
QRegExp
(
"^"
+
groupName
+
"/"
)
)
)
ret
.
insert
(
it
.
key
().
right
(
it
.
key
().
size
()
-
it
.
key
().
indexOf
(
"/"
)
-
1
),
it
.
value
()
->
get
()
);
if
(
it
.
key
().
startsWith
(
grp
)
)
ret
.
insert
(
it
.
key
(),
it
.
value
()
->
get
()
);
}
}
else
if
(
type
==
Vlmc
)
...
...
@@ -116,28 +125,9 @@ SettingsManager::group( const QString &groupName, SettingsManager::Type type )
for
(
;
it
!=
ed
;
++
it
)
{
if
(
it
.
key
().
contains
(
QRegExp
(
QString
(
"^"
).
append
(
groupName
).
append
(
"/"
)
)
)
)
if
(
it
.
key
().
startsWith
(
grp
)
)
{
ret
.
insert
(
it
.
key
().
right
(
it
.
key
().
size
()
-
it
.
key
().
indexOf
(
"/"
)
-
1
),
it
.
value
()
->
get
()
);
}
}
QSettings
sett
;
QStringList
keys
=
sett
.
allKeys
();
foreach
(
QString
key
,
keys
)
{
QString
match
(
"^"
);
match
.
append
(
groupName
).
append
(
"/"
);
QRegExp
exp
(
match
);
if
(
key
.
contains
(
exp
)
)
{
ret
.
insert
(
key
.
right
(
key
.
size
()
-
key
.
indexOf
(
"/"
)
-
1
),
sett
.
value
(
key
)
);
//FIXME !
// if ( !m_classicSettings.contains( key ) )
// m_classicSettings.insert( key, new SettingValue( sett.value( key ) ) );
ret
.
insert
(
it
.
key
(),
it
.
value
()
->
get
()
);
}
}
}
...
...
@@ -168,7 +158,7 @@ SettingsManager::watchValue( const QString &key,
return
true
;
}
}
Q_ASSERT_X
(
false
,
__FILE__
,
"watching value without a created variable"
);
return
false
;
}
...
...
@@ -294,7 +284,9 @@ SettingsManager::createVar( const QString &key, const QVariant &defaultValue,
if
(
type
==
Vlmc
&&
m_classicSettings
.
contains
(
key
)
==
false
)
m_classicSettings
.
insert
(
key
,
new
SettingValue
(
defaultValue
,
desc
)
);
else
if
(
type
==
Project
&&
m_xmlSettings
.
contains
(
key
)
==
false
)
m_classicSettings
.
insert
(
key
,
new
SettingValue
(
defaultValue
,
desc
)
);
m_xmlSettings
.
insert
(
key
,
new
SettingValue
(
defaultValue
,
desc
)
);
else
Q_ASSERT_X
(
false
,
__FILE__
,
"creating an already created variable"
);
}
void
...
...
src/Configuration/SettingsManager.h
View file @
5b2f557d
...
...
@@ -45,6 +45,13 @@ class QDomDocument;
#define VLMC_GET_DOUBLE( key ) SettingsManager::getInstance()->value( key )->get().toDouble()
#define VLMC_GET_BOOL( key ) SettingsManager::getInstance()->value( key )->get().toBool()
#define VLMC_PROJECT_GET_STRING( key ) SettingsManager::getInstance()->value( key, SettingsManager::Project )->get().toString()
#define VLMC_PROJECT_GET_INT( key ) SettingsManager::getInstance()->value( key, SettingsManager::Project )->get().toInt()
#define VLMC_PROJECT_GET_UINT( key ) SettingsManager::getInstance()->value( key, SettingsManager::Project )->get().toUInt()
#define VLMC_PROJECT_GET_DOUBLE( key ) SettingsManager::getInstance()->value( key, SettingsManager::Project )->get().toDouble()
#define VLMC_PROJECT_GET_BOOL( key ) SettingsManager::getInstance()->value( key, SettingsManager::Project )->get().toBool()
#define VLMC_CREATE_PROJECT_VAR( key, defaultValue, desc ) \
SettingsManager::getInstance()->createVar( key, defaultValue, QObject::tr(desc), \
SettingsManager::Project );
...
...
@@ -71,7 +78,6 @@ class SettingsManager : public QObject, public Singleton<SettingsManager>
const
QVariant
&
value
,
SettingsManager
::
Type
=
Vlmc
);
SettingValue
*
value
(
const
QString
&
key
,
const
QVariant
&
defaultValue
=
QVariant
(),
SettingsManager
::
Type
type
=
Vlmc
);
QHash
<
QString
,
QVariant
>
group
(
const
QString
&
groupName
,
SettingsManager
::
Type
type
=
Vlmc
);
...
...
src/Gui/LanguagePreferences.cpp
View file @
5b2f557d
...
...
@@ -73,16 +73,13 @@ LanguagePreferences::LanguagePreferences( QWidget *parent )
// Sort the combobox
m_ui
.
comboBoxLanguage
->
model
()
->
sort
(
0
);
VLMC_CREATE_PREFERENCE
(
"global/VLMCLang"
,
"en_US"
,
"The VLMC's UI language"
);
}
LanguagePreferences
::~
LanguagePreferences
()
{}
void
LanguagePreferences
::
load
()
{
SettingsManager
*
setMan
=
SettingsManager
::
getInstance
();
QVariant
lang
=
setMan
->
value
(
"global/VLMCLang"
,
"en_US"
,
m_type
)
->
get
();
QString
lang
=
VLMC_GET_STRING
(
"global/VLMCLang"
);
int
idx
=
m_ui
.
comboBoxLanguage
->
findData
(
lang
);
if
(
idx
!=
-
1
)
...
...
@@ -95,7 +92,7 @@ void LanguagePreferences::save()
SettingsManager
*
setMan
=
SettingsManager
::
getInstance
();
QVariant
lang
=
m_ui
.
comboBoxLanguage
->
itemData
(
m_ui
.
comboBoxLanguage
->
currentIndex
()
);
setMan
->
setImmediateValue
(
"VLMCLang"
,
lang
,
m_type
);
setMan
->
setImmediateValue
(
"
global/
VLMCLang"
,
lang
,
m_type
);
changeLang
(
lang
.
toString
()
);
}
...
...
src/Gui/MainWindow.cpp
View file @
5b2f557d
...
...
@@ -77,11 +77,17 @@ MainWindow::MainWindow( QWidget *parent ) :
qRegisterMetaType
<
QVariant
>
(
"QVariant"
);
//We only install message handler here cause it uses configuration.
VlmcDebug
::
getInstance
()
->
setup
();
//
VlmcDebug::getInstance()->setup();
//VLC Instance:
LibVLCpp
::
Instance
::
getInstance
(
this
);
//Preferences
initVlmcPreferences
();
//Creating the project manager first (so it can create all the project variables)
ProjectManager
::
getInstance
();
// GUI
DockWidgetManager
::
instance
(
this
)
->
setMainWindow
(
this
);
createGlobalPreferences
();
...
...
@@ -163,6 +169,31 @@ void MainWindow::changeEvent( QEvent *e )
}
}
void
MainWindow
::
initVlmcPreferences
()
{
VLMC_CREATE_PREFERENCE
(
"keyboard/defaultmode"
,
"n"
,
"Select mode"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/cutmode"
,
"x"
,
"Cut mode"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/mediapreview"
,
"Ctrl+Return"
,
"Media preview"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/renderpreview"
,
"Space"
,
"Render preview"
);
//A bit nasty, but we better use what Qt's providing as default shortcut
VLMC_CREATE_PREFERENCE
(
"keyboard/undo"
,
QKeySequence
(
QKeySequence
::
Undo
).
toString
().
toLocal8Bit
(),
"Undo"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/redo"
,
QKeySequence
(
QKeySequence
::
Redo
).
toString
().
toLocal8Bit
(),
"Redo"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/help"
,
QKeySequence
(
QKeySequence
::
HelpContents
).
toString
().
toLocal8Bit
(),
"Help"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/quit"
,
"Ctrl+Q"
,
"Quit"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/preferences"
,
"Alt+P"
,
"Preferences"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/fullscreen"
,
"F"
,
"Fullscreen"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/newproject"
,
QKeySequence
(
QKeySequence
::
New
).
toString
().
toLocal8Bit
(),
"New project"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/openproject"
,
QKeySequence
(
QKeySequence
::
Open
).
toString
().
toLocal8Bit
(),
"Open a project"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/save"
,
QKeySequence
(
QKeySequence
::
Save
).
toString
().
toLocal8Bit
(),
"Save"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/saveas"
,
"Ctrl+Shift+S"
,
"Save as"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/closeproject"
,
QKeySequence
(
QKeySequence
::
Close
).
toString
().
toLocal8Bit
(),
"Close the project"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/importmedia"
,
"Ctrl+I"
,
"Import media"
);
VLMC_CREATE_PREFERENCE
(
"keyboard/renderproject"
,
"Ctrl+R"
,
"Render the project"
);
VLMC_CREATE_PREFERENCE
(
"global/VLMCLang"
,
"en_US"
,
"The VLMC's UI language"
);
}
void
MainWindow
::
setupLibrary
()
{
//GUI part :
...
...
@@ -229,8 +260,8 @@ void MainWindow::createStatusBar()
mouseTool
->
setChecked
(
true
);
//Shortcut part:
KeyboardShortcutHelper
*
defaultModeShortcut
=
new
KeyboardShortcutHelper
(
"
Default
mode"
,
this
);
KeyboardShortcutHelper
*
cutModeShortcut
=
new
KeyboardShortcutHelper
(
"
Cut
mode"
,
this
);
KeyboardShortcutHelper
*
defaultModeShortcut
=
new
KeyboardShortcutHelper
(
"
keyboard/default
mode"
,
this
);
KeyboardShortcutHelper
*
cutModeShortcut
=
new
KeyboardShortcutHelper
(
"
keyboard/cut
mode"
,
this
);
connect
(
defaultModeShortcut
,
SIGNAL
(
activated
()
),
mouseTool
,
SLOT
(
click
()
)
);
connect
(
cutModeShortcut
,
SIGNAL
(
activated
()
),
splitTool
,
SLOT
(
click
()
)
);
...
...
@@ -287,7 +318,7 @@ void MainWindow::initializeDockWidgets( void )
Qt
::
AllDockWidgetAreas
,
QDockWidget
::
AllDockWidgetFeatures
,
Qt
::
TopDockWidgetArea
);
KeyboardShortcutHelper
*
clipShortcut
=
new
KeyboardShortcutHelper
(
"
Launch media
preview"
,
this
);
KeyboardShortcutHelper
*
clipShortcut
=
new
KeyboardShortcutHelper
(
"
keyboard/media
preview"
,
this
);
connect
(
clipShortcut
,
SIGNAL
(
activated
()
),
m_clipPreview
,
SLOT
(
on_pushButtonPlay_clicked
()
)
);
m_projectPreview
=
new
PreviewWidget
(
m_renderer
,
this
);
...
...
@@ -296,7 +327,7 @@ void MainWindow::initializeDockWidgets( void )
Qt
::
AllDockWidgetAreas
,
QDockWidget
::
AllDockWidgetFeatures
,
Qt
::
TopDockWidgetArea
);
KeyboardShortcutHelper
*
renderShortcut
=
new
KeyboardShortcutHelper
(
"
Start render
preview"
,
this
);
KeyboardShortcutHelper
*
renderShortcut
=
new
KeyboardShortcutHelper
(
"
keyboard/render
preview"
,
this
);
connect
(
renderShortcut
,
SIGNAL
(
activated
()
),
m_projectPreview
,
SLOT
(
on_pushButtonPlay_clicked
()
)
);
QDockWidget
*
dock
=
dockManager
->
addDockedWidget
(
UndoStack
::
getInstance
(
this
),
...
...
@@ -479,26 +510,26 @@ void MainWindow::on_actionRedo_triggered()
}
#define INIT_SHORTCUT( instName, shortcutName, actionInstance ) \
QString instName = VLMC_GET_STRING(
"keyboard/"
shortcutName ); \
QString instName = VLMC_GET_STRING( shortcutName ); \
KeyboardShortcutHelper* helper##instName = new KeyboardShortcutHelper( shortcutName, this, true ); \
connect( helper##instName, SIGNAL( changed( const QString&, const QString&) ), this, SLOT( keyboardShortcutChanged(const QString&, const QString&)) ); \
m_ui.actionInstance->setShortcut( instName );
void
MainWindow
::
initializeMenuKeyboardShortcut
()
{
INIT_SHORTCUT
(
help
,
"
H
elp"
,
actionHelp
);
INIT_SHORTCUT
(
quit
,
"
Q
uit"
,
actionQuit
);
INIT_SHORTCUT
(
preferences
,
"
P
references"
,
actionPreferences
);
INIT_SHORTCUT
(
fullscreen
,
"
F
ullscreen"
,
actionFullscreen
);
INIT_SHORTCUT
(
newProject
,
"
New
project"
,
actionNew_Project
);
INIT_SHORTCUT
(
openProject
,
"
Open
project"
,
actionLoad_Project
);
INIT_SHORTCUT
(
save
,
"
S
ave"
,
actionSave
);
INIT_SHORTCUT
(
saveAs
,
"
Save
as"
,
actionSave_As
);
INIT_SHORTCUT
(
closeProject
,
"
Close
project"
,
actionClose_Project
);
INIT_SHORTCUT
(
importProject
,
"
Import
media"
,
actionImport
);
INIT_SHORTCUT
(
renderProject
,
"
Render
project"
,
actionRender
);
INIT_SHORTCUT
(
undo
,
"
U
ndo"
,
actionUndo
);
INIT_SHORTCUT
(
redo
,
"
R
edo"
,
actionRedo
);
INIT_SHORTCUT
(
help
,
"
keyboard/h
elp"
,
actionHelp
);
INIT_SHORTCUT
(
quit
,
"
keyboard/q
uit"
,
actionQuit
);
INIT_SHORTCUT
(
preferences
,
"
keyboard/p
references"
,
actionPreferences
);
INIT_SHORTCUT
(
fullscreen
,
"
keyboard/f
ullscreen"
,
actionFullscreen
);
INIT_SHORTCUT
(
newProject
,
"
keyboard/new
project"
,
actionNew_Project
);
INIT_SHORTCUT
(
openProject
,
"
keyboard/open
project"
,
actionLoad_Project
);
INIT_SHORTCUT
(
save
,
"
keyboard/s
ave"
,
actionSave
);
INIT_SHORTCUT
(
saveAs
,
"
keyboard/save
as"
,
actionSave_As
);
INIT_SHORTCUT
(
closeProject
,
"
keyboard/close
project"
,
actionClose_Project
);
INIT_SHORTCUT
(
importProject
,
"
keyboard/import
media"
,
actionImport
);
INIT_SHORTCUT
(
renderProject
,
"
keyboard/render
project"
,
actionRender
);
INIT_SHORTCUT
(
undo
,
"
keyboard/u
ndo"
,
actionUndo
);
INIT_SHORTCUT
(
redo
,
"
keyboard/r
edo"
,
actionRedo
);
}
#undef INIT_SHORTCUT
...
...
src/Gui/MainWindow.h
View file @
5b2f557d
...
...
@@ -66,6 +66,7 @@ private:
void
createGlobalPreferences
();
void
createProjectPreferences
();
void
initializeMenuKeyboardShortcut
();
void
initVlmcPreferences
();
#ifdef WITH_CRASHBUTTON
void
setupCrashTester
();
#endif
...
...
src/Gui/settings/AudioProjectPreferences.cpp
View file @
5b2f557d
...
...
@@ -29,14 +29,13 @@ AudioProjectPreferences::AudioProjectPreferences( QWidget *parent )
m_type
(
SettingsManager
::
Project
)
{
m_ui
.
setupUi
(
this
);
VLMC_CREATE_PROJECT_VAR
(
"project/AudioSampleRate"
,
0
,
"The project audio samplerate"
);
}
AudioProjectPreferences
::~
AudioProjectPreferences
()
{
}
void
AudioProjectPreferences
::
load
()
{
int
sampleRate
=
VLMC_GET_INT
(
"project/AudioSampleRate"
);
int
sampleRate
=
VLMC_
PROJECT_
GET_INT
(
"project/AudioSampleRate"
);
m_ui
.
SampleRate
->
setValue
(
sampleRate
);
return
;
}
...
...
src/Gui/settings/KeyboardShortcut.cpp
View file @
5b2f557d
...
...
@@ -62,5 +62,5 @@ void KeyboardShortcut::save()
void
KeyboardShortcut
::
shortcutUpdated
(
const
QString
&
name
,
const
QString
&
value
)
{
SettingsManager
::
getInstance
()
->
setImmediateValue
(
"keyboard/"
+
name
,
value
,
m_type
);
SettingsManager
::
getInstance
()
->
setImmediateValue
(
name
,
value
,
m_type
);
}
src/Gui/settings/ProjectPreferences.cpp
View file @
5b2f557d
...
...
@@ -33,16 +33,13 @@ ProjectPreferences::ProjectPreferences( QWidget* parent )
m_type
(
SettingsManager
::
Project
)
{
m_ui
.
setupUi
(
this
);
VLMC_CREATE_PROJECT_VAR
(
"project/ProjectName"
,
ProjectManager
::
unSavedProject
,
"The project name"
);
}
ProjectPreferences
::~
ProjectPreferences
()
{
}
void
ProjectPreferences
::
load
()
{
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
QString
Name
=
VLMC_GET_STRING
(
"project/ProjectName"
);
QString
Name
=
VLMC_PROJECT_GET_STRING
(
"project/ProjectName"
);
m_ui
.
ProjectNameLineEdit
->
setText
(
Name
);
}
...
...
src/Gui/settings/VLMCPreferences.cpp
View file @
5b2f557d
...
...
@@ -53,15 +53,9 @@ void VLMCPreferences::setAutomaticSaveLabelVisiblity( bool visible )
void
VLMCPreferences
::
load
()
{
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
QString
outputFPS
=
VLMC_GET_STRING
(
"global/VLMCOutputFPS"
);
QString
tracksNb
=
VLMC_GET_STRING
(
"global/VLMCTracksNb"
);
bool
autoSave
=
VLMC_GET_BOOL
(
"global/AutomaticBackup"
);
QString
autoSaveInterval
=
VLMC_GET_STRING
(
"global/AutomaticBackupInterval"
);
m_ui
.
outputFPS
->
setText
(
outputFPS
);
m_ui
.
tracksNb
->
setText
(
tracksNb
);
m_ui
.
automaticSave
->
setChecked
(
autoSave
);
m_ui
.
automaticSaveInterval
->
setText
(
autoSaveInterval
);
setAutomaticSaveLabelVisiblity
(
autoSave
);
...
...
@@ -70,13 +64,9 @@ void VLMCPreferences::load()
void
VLMCPreferences
::
save
()
{
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
QVariant
outputFPS
(
m_ui
.
outputFPS
->
text
()
);
QVariant
tracksNb
(
m_ui
.
tracksNb
->
text
()
);
QVariant
autoSave
(
m_ui
.
automaticSave
->
isChecked
()
);
QVariant
autoSaveInterval
(
m_ui
.
automaticSaveInterval
->
text
()
);
settMan
->
setImmediateValue
(
"global/VLMCOutPutFPS"
,
outputFPS
,
m_type
);
settMan
->
setImmediateValue
(
"global/VLMCTracksNb"
,
tracksNb
,
m_type
);
settMan
->
setImmediateValue
(
"global/AutomaticBackup"
,
autoSave
,
m_type
);
settMan
->
setImmediateValue
(
"global/AutomaticBackupInterval"
,
autoSaveInterval
,
m_type
);
}
...
...
src/Gui/settings/VideoProjectPreferences.cpp
View file @
5b2f557d
...
...
@@ -30,21 +30,16 @@ VideoProjectPreferences::VideoProjectPreferences( QWidget *parent )
m_type
(
SettingsManager
::
Project
)
{
m_ui
.
setupUi
(
this
);
VLMC_CREATE_PROJECT_VAR
(
"project/VideoProjectWidth"
,
480
,
"The project video width"
);
VLMC_CREATE_PROJECT_VAR
(
"project/VideoProjectHeight"
,
300
,
"The project video height"
);
VLMC_CREATE_PROJECT_VAR
(
"global/VLMCOutputFPS"
,
30
,
"The project output FPS"
);
}
VideoProjectPreferences
::~
VideoProjectPreferences
()
{
}
void
VideoProjectPreferences
::
load
()
{
SettingsManager
*
setMan
=
SettingsManager
::
getInstance
();
int
projectWidth
=
VLMC_GET_INT
(
"project/VideoProjectWidth"
);
int
projectHeight
=
VLMC_GET_INT
(
"project/VideoProjectHeight"
);
int
projectWidth
=
VLMC_PROJECT_GET_INT
(
"project/VideoProjectWidth"
);
int
projectHeight
=
VLMC_PROJECT_GET_INT
(
"project/VideoProjectHeight"
);
//FIXME: fps is a double value
int
projectFps
=
VLMC_GET_INT
(
"global/VLMCOutputFPS"
);
int
projectFps
=
VLMC_
PROJECT_
GET_INT
(
"global/VLMCOutputFPS"
);
m_ui
.
FPSSpinBox
->
setValue
(
projectFps
);
m_ui
.
HeightSpinBox
->
setValue
(
projectHeight
);
...
...
@@ -58,7 +53,7 @@ void VideoProjectPreferences::save()
QVariant
projectHeight
(
m_ui
.
HeightSpinBox
->
value
()
);
QVariant
projectWidth
(
m_ui
.
WidthSpinBox
->
value
()
);
settMan
->
setImmediateValue
(
"
project/VideoProjec
tFPS"
,
projectFps
,
m_type
);
settMan
->
setImmediateValue
(
"
global/VLMCOutpu
tFPS"
,
projectFps
,
m_type
);
settMan
->
setImmediateValue
(
"project/VideoProjectHeight"
,
projectHeight
,
m_type
);
settMan
->
setImmediateValue
(
"project/VideoProjectWidth"
,
projectWidth
,
m_type
);
return
;
...
...
src/Gui/timeline/TracksRuler.cpp
View file @
5b2f557d
...
...
@@ -37,7 +37,7 @@ TracksRuler::TracksRuler( TracksView* tracksView, QWidget* parent )
//TODO We should really get that from the
// workflow and not directly from the settings.
m_fps
=
qRound
(
VLMC_GET_DOUBLE
(
"global/VLMCOutputFPS"
)
);
m_fps
=
qRound
(
VLMC_
PROJECT_
GET_DOUBLE
(
"global/VLMCOutputFPS"
)
);
m_factor
=
1
;
m_scale
=
3
;
...
...
src/Gui/wizard/GeneralPage.cpp
View file @
5b2f557d
...
...
@@ -54,7 +54,7 @@ void GeneralPage::initializePage()
ui
.
lineEditName
->
setText
(
projectName
);
//fetching the global workspace path
QString
workspacePath
=
VLMC_GET_STRING
(
"global/VLMCWorkspace"
);
QString
workspacePath
=
VLMC_
PROJECT_
GET_STRING
(
"global/VLMCWorkspace"
);
ui
.
lineEditWorkspace
->
setText
(
workspacePath
);
updateProjectLocation
();
...
...
src/Project/ProjectManager.cpp
View file @
5b2f557d
...
...
@@ -74,6 +74,12 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
connect
(
this
,
SIGNAL
(
projectClosed
()
),
Library
::
getInstance
(),
SLOT
(
clear
()
)
);
connect
(
this
,
SIGNAL
(
projectClosed
()
),
MainWorkflow
::
getInstance
(),
SLOT
(
clear
()
)
);
VLMC_CREATE_PROJECT_VAR
(
"global/VLMCOutputFPS"
,
29.97
,
"Output video FPS"
);
VLMC_CREATE_PROJECT_VAR
(
"project/VideoProjectWidth"
,
480
,
"The project video width"
);
VLMC_CREATE_PROJECT_VAR
(
"project/VideoProjectHeight"
,
300
,
"The project video height"
);
VLMC_CREATE_PROJECT_VAR
(
"project/AudioSampleRate"
,
0
,
"The project audio samplerate"
);
VLMC_CREATE_PROJECT_VAR
(
"global/VLMCWorkspace"
,
""
,
"The place where all project's videos will be stored"
);
VLMC_CREATE_PROJECT_VAR
(
"project/ProjectName"
,
unNamedProject
,
"The project name"
);
SettingsManager
::
getInstance
()
->
watchValue
(
"project/ProjectName"
,
this
,
SLOT
(
projectNameChanged
(
QVariant
)
),
...
...
src/main.cpp
View file @
5b2f557d
...
...
@@ -44,38 +44,6 @@
#define EXPAND( x ) #x
#define STRINGIFY( x ) EXPAND( x )
#define ADD_SHORTCUT(NAME, KEYS) \
key = QString("keyboard/").append( QObject::tr( NAME ) ); \
settMan->setImmediateValue( key, QVariant( QObject::tr( KEYS ) ), \
SettingsManager::Vlmc )
static
void
initShorcuts
()
{
QString
key
;
SettingsManager
*
settMan
=
SettingsManager
::
getInstance
();
ADD_SHORTCUT
(
"Default mode"
,
"n"
);
ADD_SHORTCUT
(
"Cut mode"
,
"x"
);
ADD_SHORTCUT
(
"Launch media preview"
,
"Ctrl+Return"
);
ADD_SHORTCUT
(
"Start render preview"
,
"Space"
);
//A bit nasty, but we better use what Qt's providing as default shortcut
ADD_SHORTCUT
(
"Undo"
,
QKeySequence
(
QKeySequence
::
Undo
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Redo"
,
QKeySequence
(
QKeySequence
::
Redo
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Help"
,
QKeySequence
(
QKeySequence
::
HelpContents
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Quit"
,
"Ctrl+Q"
);
ADD_SHORTCUT
(
"Preferences"
,
"Alt+P"
);
ADD_SHORTCUT
(
"Fullscreen"
,
"F"
);
ADD_SHORTCUT
(
"New project"
,
QKeySequence
(
QKeySequence
::
New
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Open project"
,
QKeySequence
(
QKeySequence
::
Open
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Save"
,
QKeySequence
(
QKeySequence
::
Save
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Save as"
,
"Ctrl+Shift+S"
);
ADD_SHORTCUT
(
"Close project"
,
QKeySequence
(
QKeySequence
::
Close
).
toString
().
toLocal8Bit
()
);
ADD_SHORTCUT
(
"Import media"
,
"Ctrl+I"
);
ADD_SHORTCUT
(
"Render project"
,
"Ctrl+R"
);
return
;
}
#undef ADD_SHORTCUT
/**
* VLMC Entry point
* \brief this is the VLMC entry point
...
...
@@ -130,8 +98,6 @@ VLMCmain( int argc, char **argv )
p
.
setColor
(
QPalette
::
LinkVisited
,
QColor
(
177
,
202
,
0
,
255
)
);
app
.
setPalette
(
p
);
initShorcuts
();
MainWindow
w
;
QSettings
s
;
s
.
setValue
(
"VlmcVersion"
,
STRINGIFY
(
VLMC_VERSION
)
);
...
...
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