Skip to content

Commit 8978a24

Browse files
committed
Launch debug console on Windows by default
Change default value of reload on startup to true
1 parent c1976d5 commit 8978a24

2 files changed

Lines changed: 14 additions & 16 deletions

File tree

Source/Main.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,21 +65,20 @@ class OpenEphysApplication : public JUCEApplication
6565

6666
#ifdef WIN32
6767
//glWinInit();
68-
69-
int consoleArg = parameters.indexOf("--console", true);
70-
if (consoleArg != -1)
68+
if (AllocConsole())
7169
{
72-
parameters.remove(consoleArg);
73-
if (AllocConsole())
74-
{
75-
freopen("CONOUT$","w",stdout);
76-
freopen("CONOUT$","w",stderr);
77-
console_out = std::ofstream("CONOUT$");
78-
std::cout.rdbuf(console_out.rdbuf());
79-
std::cerr.rdbuf(console_out.rdbuf());
80-
SetConsoleTitle("Debug Console");
81-
std::cout << "Debug console..." << std::endl;
82-
}
70+
freopen("CONOUT$","w",stdout);
71+
freopen("CONOUT$","w",stderr);
72+
console_out = std::ofstream("CONOUT$");
73+
std::cout.rdbuf(console_out.rdbuf());
74+
std::cerr.rdbuf(console_out.rdbuf());
75+
SMALL_RECT windowSize = {0, 0, 85 - 1, 35 - 1};
76+
COORD bufferSize = { 85 , 9999 };
77+
HANDLE wHnd = GetStdHandle(STD_OUTPUT_HANDLE);
78+
SetConsoleTitle("[Open Ephys] Debug Console");
79+
SetConsoleWindowInfo(wHnd, true, &windowSize);
80+
SetConsoleScreenBufferSize(wHnd, bufferSize);
81+
std::cout << "Debug console..." << std::endl;
8382
}
8483

8584
#endif

Source/MainWindow.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
setResizable(true, // isResizable
3838
false); // useBottomCornerRisizer -- doesn't work very well
3939

40-
shouldReloadOnStartup = false;
40+
shouldReloadOnStartup = true;
4141

4242
// Create ProcessorGraph and AudioComponent, and connect them.
4343
// Callbacks will be set by the play button in the control panel
@@ -85,7 +85,6 @@
8585
{
8686
if(compareConfigFiles(lastConfig, recoveryConfig))
8787
{
88-
std::cout << "Loading last config.\n" << std::endl;
8988
ui->getEditorViewport()->loadState(lastConfig);
9089
}
9190
else

0 commit comments

Comments
 (0)