Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plugin-GUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yehaojie
plugin-GUI
Commits
7a263209
Commit
7a263209
authored
11 years ago
by
jsiegle
Browse files
Options
Downloads
Patches
Plain Diff
Add reloadOnStartup flag
parent
4d85302a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Source/MainWindow.cpp
+21
-1
21 additions, 1 deletion
Source/MainWindow.cpp
Source/MainWindow.h
+5
-0
5 additions, 0 deletions
Source/MainWindow.h
Source/UI/UIComponent.cpp
+16
-0
16 additions, 0 deletions
Source/UI/UIComponent.cpp
Source/UI/UIComponent.h
+2
-1
2 additions, 1 deletion
Source/UI/UIComponent.h
with
44 additions
and
2 deletions
Source/MainWindow.cpp
+
21
−
1
View file @
7a263209
...
@@ -35,7 +35,7 @@ MainWindow::MainWindow()
...
@@ -35,7 +35,7 @@ MainWindow::MainWindow()
setResizable
(
true
,
// isResizable
setResizable
(
true
,
// isResizable
false
);
// useBottomCornerRisizer -- doesn't work very well
false
);
// useBottomCornerRisizer -- doesn't work very well
shouldReloadOnStartup
=
false
;
// Create ProcessorGraph and AudioComponent, and connect them.
// Create ProcessorGraph and AudioComponent, and connect them.
// Callbacks will be set by the play button in the control panel
// Callbacks will be set by the play button in the control panel
...
@@ -70,6 +70,17 @@ MainWindow::MainWindow()
...
@@ -70,6 +70,17 @@ MainWindow::MainWindow()
// Constraining the window's size doesn't seem to work:
// Constraining the window's size doesn't seem to work:
setResizeLimits
(
300
,
200
,
10000
,
10000
);
setResizeLimits
(
300
,
200
,
10000
,
10000
);
if
(
shouldReloadOnStartup
)
{
File
executable
=
File
::
getSpecialLocation
(
File
::
currentExecutableFile
);
File
executableDirectory
=
executable
.
getParentDirectory
();
File
file
=
executableDirectory
.
getChildFile
(
"lastConfig.xml"
);
ui
->
getEditorViewport
()
->
loadState
(
file
);
}
}
}
MainWindow
::~
MainWindow
()
MainWindow
::~
MainWindow
()
...
@@ -87,6 +98,12 @@ MainWindow::~MainWindow()
...
@@ -87,6 +98,12 @@ MainWindow::~MainWindow()
UIComponent
*
ui
=
(
UIComponent
*
)
getContentComponent
();
UIComponent
*
ui
=
(
UIComponent
*
)
getContentComponent
();
ui
->
disableDataViewport
();
ui
->
disableDataViewport
();
File
executable
=
File
::
getSpecialLocation
(
File
::
currentExecutableFile
);
File
executableDirectory
=
executable
.
getParentDirectory
();
File
file
=
executableDirectory
.
getChildFile
(
"lastConfig.xml"
);
ui
->
getEditorViewport
()
->
saveState
(
file
);
setMenuBar
(
0
);
setMenuBar
(
0
);
#if JUCE_MAC
#if JUCE_MAC
...
@@ -121,6 +138,7 @@ void MainWindow::saveWindowBounds()
...
@@ -121,6 +138,7 @@ void MainWindow::saveWindowBounds()
XmlElement
*
xml
=
new
XmlElement
(
"MAINWINDOW"
);
XmlElement
*
xml
=
new
XmlElement
(
"MAINWINDOW"
);
xml
->
setAttribute
(
"version"
,
JUCEApplication
::
getInstance
()
->
getApplicationVersion
());
xml
->
setAttribute
(
"version"
,
JUCEApplication
::
getInstance
()
->
getApplicationVersion
());
xml
->
setAttribute
(
"shouldReloadOnStartup"
,
shouldReloadOnStartup
);
XmlElement
*
bounds
=
new
XmlElement
(
"BOUNDS"
);
XmlElement
*
bounds
=
new
XmlElement
(
"BOUNDS"
);
bounds
->
setAttribute
(
"x"
,
getScreenX
());
bounds
->
setAttribute
(
"x"
,
getScreenX
());
...
@@ -183,6 +201,8 @@ void MainWindow::loadWindowBounds()
...
@@ -183,6 +201,8 @@ void MainWindow::loadWindowBounds()
String
description
;
String
description
;
shouldReloadOnStartup
=
xml
->
getBoolAttribute
(
"shouldReloadOnStartup"
,
false
);
forEachXmlChildElement
(
*
xml
,
e
)
forEachXmlChildElement
(
*
xml
,
e
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Source/MainWindow.h
+
5
−
0
View file @
7a263209
...
@@ -59,6 +59,9 @@ public:
...
@@ -59,6 +59,9 @@ public:
commands. */
commands. */
ApplicationCommandManager
commandManager
;
ApplicationCommandManager
commandManager
;
/** Determines whether the last used configuration reloads upon startup. */
bool
shouldReloadOnStartup
;
private:
private:
/** Saves the MainWindow's boundaries into the file "windowState.xml", located in the directory
/** Saves the MainWindow's boundaries into the file "windowState.xml", located in the directory
...
@@ -75,6 +78,8 @@ private:
...
@@ -75,6 +78,8 @@ private:
/** A pointer to the application's ProcessorGraph (owned by the MainWindow). */
/** A pointer to the application's ProcessorGraph (owned by the MainWindow). */
ScopedPointer
<
ProcessorGraph
>
processorGraph
;
ScopedPointer
<
ProcessorGraph
>
processorGraph
;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
MainWindow
)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
MainWindow
)
};
};
...
...
This diff is collapsed.
Click to expand it.
Source/UI/UIComponent.cpp
+
16
−
0
View file @
7a263209
...
@@ -300,6 +300,8 @@ PopupMenu UIComponent::getMenuForIndex(int menuIndex, const String& menuName)
...
@@ -300,6 +300,8 @@ PopupMenu UIComponent::getMenuForIndex(int menuIndex, const String& menuName)
{
{
menu
.
addCommandItem
(
commandManager
,
openConfiguration
);
menu
.
addCommandItem
(
commandManager
,
openConfiguration
);
menu
.
addCommandItem
(
commandManager
,
saveConfiguration
);
menu
.
addCommandItem
(
commandManager
,
saveConfiguration
);
menu
.
addSeparator
();
menu
.
addCommandItem
(
commandManager
,
reloadOnStartup
);
#if !JUCE_MAC
#if !JUCE_MAC
menu
.
addSeparator
();
menu
.
addSeparator
();
...
@@ -356,6 +358,7 @@ void UIComponent::getAllCommands(Array <CommandID>& commands)
...
@@ -356,6 +358,7 @@ void UIComponent::getAllCommands(Array <CommandID>& commands)
{
{
const
CommandID
ids
[]
=
{
openConfiguration
,
const
CommandID
ids
[]
=
{
openConfiguration
,
saveConfiguration
,
saveConfiguration
,
reloadOnStartup
,
undo
,
undo
,
redo
,
redo
,
copySignalChain
,
copySignalChain
,
...
@@ -388,7 +391,12 @@ void UIComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& re
...
@@ -388,7 +391,12 @@ void UIComponent::getCommandInfo(CommandID commandID, ApplicationCommandInfo& re
case
saveConfiguration
:
case
saveConfiguration
:
result
.
setInfo
(
"Save configuration"
,
"Save the current processor graph."
,
"General"
,
0
);
result
.
setInfo
(
"Save configuration"
,
"Save the current processor graph."
,
"General"
,
0
);
result
.
addDefaultKeypress
(
'S'
,
ModifierKeys
::
commandModifier
);
result
.
addDefaultKeypress
(
'S'
,
ModifierKeys
::
commandModifier
);
break
;
case
reloadOnStartup
:
result
.
setInfo
(
"Reload on startup"
,
"Load the last used configuration on startup."
,
"General"
,
0
);
result
.
setActive
(
!
acquisitionStarted
);
result
.
setActive
(
!
acquisitionStarted
);
result
.
setTicked
(
mainWindow
->
shouldReloadOnStartup
);
break
;
break
;
case
undo
:
case
undo
:
...
@@ -499,6 +507,14 @@ bool UIComponent::perform(const InvocationInfo& info)
...
@@ -499,6 +507,14 @@ bool UIComponent::perform(const InvocationInfo& info)
break
;
break
;
}
}
case
reloadOnStartup
:
{
mainWindow
->
shouldReloadOnStartup
=
!
mainWindow
->
shouldReloadOnStartup
;
}
break
;
case
clearSignalChain
:
case
clearSignalChain
:
{
{
getEditorViewport
()
->
clearSignalChain
();
getEditorViewport
()
->
clearSignalChain
();
...
...
This diff is collapsed.
Click to expand it.
Source/UI/UIComponent.h
+
2
−
1
View file @
7a263209
...
@@ -206,7 +206,8 @@ private:
...
@@ -206,7 +206,8 @@ private:
toggleSignalChain
=
0x2009
,
toggleSignalChain
=
0x2009
,
toggleFileInfo
=
0x2010
,
toggleFileInfo
=
0x2010
,
showHelp
=
0x2011
,
showHelp
=
0x2011
,
resizeWindow
=
0x2012
resizeWindow
=
0x2012
,
reloadOnStartup
=
0x2013
};
};
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
UIComponent
);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
UIComponent
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment