Skip to content

Commit

Permalink
fix nil pointer bugs, other cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vizicist committed Dec 15, 2023
1 parent 40c4594 commit 37ba1ba
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 206 deletions.
2 changes: 1 addition & 1 deletion build/windows/palette_win_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Source: "ship\ffgl\*"; DestDir: "{app}\ffgl"; Flags: ignoreversion recursesubdir
Source: "ship\data\*"; DestDir: "{commoncf64}\{#MyAppName}\data"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
; Source: "ship\data_surge\*"; DestDir: "{commoncf64}\{#MyAppName}\data_surge"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
; Source: "ship\data_moldover\*"; DestDir: "{commoncf64}\{#MyAppName}\data_moldover"; Flags: comparetimestamp ignoreversion recursesubdirs createallsubdirs
Source: "logs_readme.txt"; DestDir: "{commoncf64}\{#MyAppName}\logs"; DestName: "readme.txt"; Flags: ignoreversion
Source: "logs_readme.txt"; DestDir: "{commoncf64}\{#MyAppName}\data\logs"; DestName: "readme.txt"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; This specifies the Visual C++ Windows Runtime Redistributable to install, it's put in {app}\bin to help debug things.
Expand Down
4 changes: 2 additions & 2 deletions cmd/palette/palette.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func main() {

func usage() string {
return `Invalid usage, expecting:
palette start [ monitor, engine, gui, bidule, resolume, mmtt ]
palette kill [ all, monitor, engine, gui, bidule, resolume, mmtt]
palette start [ {processname} ]
palette stop [ {processname}]
palette status
palette version
palette logs [ archive, clear ]
Expand Down
1 change: 0 additions & 1 deletion data/config/paramdefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@
"global.midithru": {"valuetype":"bool", "min":"false", "max":"true", "init":"false", "comment":"#" },
"global.midithrusynth": {"valuetype":"string", "min":"synth", "max":"synth", "init":"default", "comment":"#" },
"global.midisetexternalscale": {"valuetype":"bool", "min":"false", "max":"true", "init":"false", "comment":"#" },
"global.morphdefault": {"valuetype":"string", "min":"morphtype", "max":"morphtype", "init":"quadrants", "comment":"#" },
"global.mmtt_xexpand": {"valuetype": "float", "min": "0.5", "max": "2.0", "init": "1.25", "comment": "#" },
"global.mmtt_yexpand": {"valuetype": "float", "min": "0.5", "max": "2.0", "init": "1.25", "comment": "#" },
"global.mmtt_zexpand": {"valuetype": "float", "min": "0.5", "max": "10.0", "init": "4.0", "comment": "#" },
Expand Down
5 changes: 4 additions & 1 deletion doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ The instructions below assume that you have:
<br>`C:\Program Files\Git\usr\bin`
<br>`C:\Program Files\Git\mingw64\bin`

- Install the redistributable support for X64 (the filename is vc_redist_x64.exe) from this page:
https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170

- All VST plugins should be put in `%CommonProgramFiles%\VST2` (for VST 2 plugins) and `%CommonProgramFiles%\VST3` (for VST 3 plugins).

- After installing and starting Bidule, use Edit->Preferences->Plugins to set the VST plugin directory to
Expand Down Expand Up @@ -58,5 +61,5 @@ The instructions below assume that you have:
- You're now ready to start using the Palette, as described
<a href="https://github.com/vizicist/palette/blob/main/doc/starting_and_using.md">here</a>

- If there are any issues, log files can be found in `%CommonProgramFiles%\Palette\logs`,
- If there are any issues, log files can be found in `%CommonProgramFiles%\Palette\data\logs`,
with `engine.log` being the most important one. Feel free to email me@timthompson with questions or suggestions for improving this documentation.
35 changes: 22 additions & 13 deletions ffgl/source/lib/nosuch/NosuchDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,34 @@ RealNosuchDebugInit() {
dMutex = CreateMutex(NULL, FALSE, NULL);
DebugInitialized = TRUE;

char* pValue;
size_t len;

NosuchDebugLogPath = "c:\\windows\\temp\\ffgl.log";// last resort

errno_t err = _dupenv_s( &pValue, &len, "CommonProgramFiles" );
if( err == 0 && pValue != NULL )
{
NosuchDebugLogPath = std::string( pValue ) + "\\Palette\\logs\\ffgl.log";
free( pValue );
char* value;
errno_t err;
size_t len;

err = _dupenv_s( &value, &len, "PALETTE_DATA_PATH" );
if ( err == 0 && value != NULL ) {
NosuchDebugLogPath = std::string( value ) + "\\logs\\ffgl.log";
free( value );
} else {
// Otherwise it's in %CommonProgramFiles%
err = _dupenv_s( &value, &len, "CommonProgramFiles" );
if( err == 0 && value != NULL ) {
// %CommonProgramFiles% is defined
NosuchDebugLogPath = std::string( value ) + "\\Palette\\data\\logs\\ffgl.log";
}
}

NosuchDebug( "NosuchDebugInit: debuglevel=%d log=%s\n", NosuchDebugLevel, NosuchDebugLogPath.c_str() );
NosuchDebug( "NosuchDebugInit: DebugCursor=%d Param=%d API=%d\n", NosuchDebugCursor , NosuchDebugParam, NosuchDebugAPI);
NosuchDebug( "NosuchDebugInit: Level=%d Cursor=%d Param=%d API=%d\n", NosuchDebugLevel, NosuchDebugCursor , NosuchDebugParam, NosuchDebugAPI);

err = _dupenv_s( &pValue, &len, "PALETTE" );
if( err || pValue == NULL )
err = _dupenv_s( &value, &len, "PALETTE" );
if( err || value == NULL )
{
NosuchDebug( "No value for PALETTE!?\n" );
NosuchDebug( "No value for PALETTE environment variable!?\n" );
}
if (value != NULL) {
free( value );
}


Expand Down
4 changes: 4 additions & 0 deletions ffgl/source/lib/palette/LayerParams_types.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DEFINE_TYPES(resolumepath);
DEFINE_TYPES(plugins);
DEFINE_TYPES(log);
DEFINE_TYPES(pitchset);
Expand Down Expand Up @@ -31,6 +32,9 @@ DEFINE_TYPES(midiport);
void
LayerParams_InitializeTypes() {

LayerParams_resolumepathTypes.push_back("C:/Program Files/Resolume Avenue/Avenue.exe");
LayerParams_resolumepathTypes.push_back("C:/Program Files/Resolume Arena/Arena.exe");

LayerParams_pluginsTypes.push_back("");
LayerParams_pluginsTypes.push_back("quadpro");

Expand Down
1 change: 1 addition & 0 deletions ffgl/source/lib/palette/LayerParams_typesdeclare.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DECLARE_TYPES(resolumepath);
DECLARE_TYPES(plugins);
DECLARE_TYPES(log);
DECLARE_TYPES(pitchset);
Expand Down
2 changes: 1 addition & 1 deletion kit/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func InitEngine() {
LogIfError(err)
TheAttractManager.SetAttractEnabled(enabled)

CheckAutorestartProcesses()
// CheckAutorestartProcesses()

nats, err := GetParamBool("global.nats")
LogIfError(err)
Expand Down
2 changes: 1 addition & 1 deletion kit/midiio.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package kit

import (
"fmt"
"runtime/debug"
"strings"
"sync"
"runtime/debug"

midi "gitlab.com/gomidi/midi/v2"
"gitlab.com/gomidi/midi/v2/drivers"
Expand Down
Loading

0 comments on commit 37ba1ba

Please sign in to comment.