Skip to content

Commit

Permalink
release: v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ArTiSTiX committed Jan 5, 2024
1 parent bd1caee commit a43eb88
Show file tree
Hide file tree
Showing 10 changed files with 123 additions and 8 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.7.0 (2024-01-05)

## Features
- **ChordDictionary**: added a new module for displaying all available chords
- **PianoKeyboard**: added target notes (for future use & dictionary)
- **ChordDisplay**: detect on release option
- **ChordDisplay**: added chord link to dictionary
- **Layout**: added a bottom bar with key signature and latency

## Fixes
- **Notation**: adapt centering when single stave
- **CircleOfFifths**: dominant sector not correclty detected


# 1.6.2 (2023-12-19)

## Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "midi-jar",
"version": "1.6.2",
"version": "1.7.0",
"description": "A MIDI tool box for displaying chords and notes, routing devices, and more",
"main": "./src/main/main.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "midi-jar",
"version": "1.6.2",
"version": "1.7.0",
"description": "A MIDI tool box for displaying chords and notes, routing devices, and more",
"license": "MIT",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/main/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ipcMain.on('app:window:getState', (event) => {

onWindowStateChange((state?: WindowState) => {
if (state) {
sendToAll('app:window:state', state);
sendToAll('app:window:state', getWindowState());
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/main/store/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const defaults: StoreType = {
height: null,
maximized: false,
alwaysOnTop: false,
changelogDismissed: true,
changelogDismissed: '100.0.0', // hack: ensure changelog does not blink at startup
updateDismissed: null,
path: '/',
},
Expand Down
43 changes: 43 additions & 0 deletions src/main/store/legacy-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,46 @@ export type v1_6_0_ChordDisplaySettings = {
displayIntervals: boolean;
keyboard: v1_6_0_KeyboardSettings;
};

export type v1_6_0_Settings = {
general: v1_0_0_GeneralSettings;
server: v1_0_0_ServerSettings;
chordDisplay: v1_6_0_ChordDisplaySettings[];
chordQuiz: v1_5_0_ChordQuizSettings;
circleOfFifths: v1_2_0_CircleOfFifthsSettings;
notation: v1_2_0_NotationSettings;
};

/* v1.7.0 - added chord dictionary, fix changelog dismissed */
export type v1_7_0_ChordDisplaySettings = Omit<v1_6_0_ChordDisplaySettings, 'chordNotation'> & {
detectOnRelease: boolean;
chordNotation: 'long' | 'short' | 'symbol' | 'preferred';
};

export type v1_7_0_ChordQuizSettings = Omit<v1_5_0_ChordQuizSettings, 'chordNotation'> & {
chordNotation: 'long' | 'short' | 'symbol' | 'preferred';
};

export type v1_7_0_ChordDictionarySettings = {
interactive: 'detect' | 'play';
hideDisabled: boolean;
filterInKey: boolean;
groupBy: 'none' | 'quality' | 'intervals';
defaultNotation: 'long' | 'short' | 'symbol';
disabled: string[];
aliases: Array<[key: string, value: string]>;
};

export type v1_7_0_WindowState = v1_5_1_WindowState & {
changelogDismissed: string | null;
};

export type v1_7_0_Settings = {
general: v1_0_0_GeneralSettings;
server: v1_0_0_ServerSettings;
chordDisplay: v1_7_0_ChordDisplaySettings[];
chordQuiz: v1_7_0_ChordQuizSettings;
chordDictionary: v1_7_0_ChordDictionarySettings;
circleOfFifths: v1_2_0_CircleOfFifthsSettings;
notation: v1_2_0_NotationSettings;
};
37 changes: 37 additions & 0 deletions src/main/store/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import {
v1_5_1_WindowState,
v1_6_0_ChordDisplaySettings,
v1_6_0_KeyboardSettings,
v1_6_0_Settings,
v1_7_0_ChordDisplaySettings,
v1_7_0_Settings,
} from './legacy-types';

const migrations: Migrations<StoreType> = {
Expand Down Expand Up @@ -312,6 +315,40 @@ const migrations: Migrations<StoreType> = {

store.set('settings.chordDisplay', newChordDisplay);
},
'1.7.0': (store: Conf<StoreType>) => {
store.set('version', '1.7.0');
store.set('windowState.changelogDismissed', null);

const settings = store.get('settings') as unknown as v1_6_0_Settings;

const newSettings: v1_7_0_Settings = {
...settings,
chordDisplay: settings.chordDisplay.map(
(chordDisplaySettings): v1_7_0_ChordDisplaySettings => ({
...chordDisplaySettings,
detectOnRelease: true,
chordNotation: 'preferred',
})
),
chordQuiz: {
...settings.chordQuiz,
chordNotation: 'preferred',
},
chordDictionary: {
interactive: 'play',
hideDisabled: false,
filterInKey: false,
groupBy: 'none',
defaultNotation: settings.chordDisplay[0]
? settings.chordDisplay[0].chordNotation
: 'short',
disabled: [],
aliases: [['maj', '']],
},
};

store.set('settings', newSettings);
},
};

export default migrations;
5 changes: 4 additions & 1 deletion src/main/types/WindowState.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
"type": "boolean"
},
"changelogDismissed": {
"type": "boolean"
"type": [
"null",
"string"
]
},
"height": {
"type": [
Expand Down
2 changes: 1 addition & 1 deletion src/main/types/WindowState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export type WindowState = {
height: number | null;
maximized: boolean;
alwaysOnTop: boolean;
changelogDismissed: boolean;
changelogDismissed: string | null;
updateDismissed: string | null;
path: string;
};
22 changes: 20 additions & 2 deletions src/main/windowState.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { screen, BrowserWindow, Rectangle } from 'electron';
import { lt, lte } from 'semver';

import { store, defaults } from './store';
import { WindowState } from './types/WindowState';
import { getURLHash } from './util';

import packageJson from '../../package.json';

export const DEFAULT_WINDOW_WIDTH = 1024;
export const DEFAULT_WINDOW_HEIGHT = 768;
export const DEFAULT_WINDOW_MIN_WIDTH = 480;
Expand All @@ -18,7 +22,21 @@ function isWindowInDisplay(wB: Rectangle, dB: Rectangle) {
}

export function getWindowState() {
return store.get('windowState') ?? defaults.windowState;
const storedWindowState = store.get('windowState') ?? defaults.windowState;

return {
...storedWindowState,
updateDismissed:
!storedWindowState.updateDismissed ||
lte(storedWindowState.updateDismissed, packageJson.version)
? null
: storedWindowState.updateDismissed,
changelogDismissed:
!storedWindowState.changelogDismissed ||
lt(storedWindowState.changelogDismissed, packageJson.version)
? null
: storedWindowState.changelogDismissed,
};
}

export function getWindowBoundsOnDisplay() {
Expand Down Expand Up @@ -56,7 +74,7 @@ export function saveWindowState(window: BrowserWindow) {
}

export function dismissChangelog() {
return store.set('windowState.changelogDismissed', true);
return store.set('windowState.changelogDismissed', packageJson.version);
}

export function dismissUpdate(version: string) {
Expand Down

0 comments on commit a43eb88

Please sign in to comment.