v1.2.39 experimental

This commit is contained in:
Robin Davies
2024-08-19 16:41:26 -04:00
parent 9d1f316ea3
commit 78bb9f5373
12 changed files with 131 additions and 255 deletions
+58 -55
View File
@@ -86,7 +86,7 @@ const pluginGridStyles = (theme: Theme) => createStyles({
justifyContent: "space-between",
paddingLeft: "24px",
paddingRight: "48px",
},
paper: {
position: "relative",
@@ -181,8 +181,7 @@ type PluginGridState = {
export const LoadPluginDialog =
withStyles(pluginGridStyles, { withTheme: true })(
class extends ResizeResponsiveComponent<PluginGridProps, PluginGridState>
{
class extends ResizeResponsiveComponent<PluginGridProps, PluginGridState> {
model: PiPedalModel;
searchInputRef: React.RefObject<HTMLInputElement>;
@@ -436,15 +435,15 @@ export const LoadPluginDialog =
if (uiPlugin.author_name !== "") {
if (uiPlugin.author_homepage !== "") {
return (<Fragment>
<div style={{flex: "0 1 auto"}}>
<div style={{ flex: "0 1 auto" }}>
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.name + ",\u00A0"}</Typography>
</div>
<div style={{flex: "0 1 auto"}}>
<div style={{ flex: "0 1 auto" }}>
<a href={uiPlugin.author_homepage} target="_blank" rel="noopener noreferrer" >
<Typography variant='body2' color="textSecondary" noWrap>{uiPlugin.author_name}</Typography>
</a>
</div>
<div style={{flex: "0 0 auto"}}>
<div style={{ flex: "0 0 auto" }}>
<Typography variant='body2' color="textSecondary" noWrap>{stereoIndicator}</Typography>
</div>
</Fragment>);
@@ -482,55 +481,59 @@ export const LoadPluginDialog =
}
getFilteredPlugins(searchString: string | null, filterType: PluginType | null, favoritesList: FavoritesList | null): UiPlugin[] {
if (searchString === null) {
searchString = this.state.search_string;
}
if (filterType === null) {
filterType = this.state.filterType;
}
if (favoritesList === null) {
favoritesList = this.state.favoritesList;
}
let plugins = this.model.ui_plugins.get();
let results: { score: number; plugin: UiPlugin }[] = [];
let searchFilter = new SearchFilter(searchString);
let rootClass = this.model.plugin_classes.get();
for (let i = 0; i < plugins.length; ++i) {
let plugin = plugins[i];
try {
if (filterType === PluginType.Plugin || rootClass.is_type_of(filterType, plugin.plugin_type)) {
let score: number = 0;
if (plugin.is_vst3) {
score = searchFilter.score(plugin.name, plugin.plugin_display_type, plugin.author_name, "vst3");
} else {
score = searchFilter.score(plugin.name, plugin.plugin_display_type, plugin.author_name);
}
if (score !== 0) {
if (favoritesList[plugin.uri]) {
score += 32768;
}
results.push({ score: score, plugin: plugin });
}
}
} catch (e)
{
alert("Bad plugin:" + (plugin?.name??"null") + " plugin type: " + (plugin?.plugin_type??"null"));
try {
if (searchString === null) {
searchString = this.state.search_string;
}
if (filterType === null) {
filterType = this.state.filterType;
}
if (favoritesList === null) {
favoritesList = this.state.favoritesList;
}
let plugins = this.model.ui_plugins.get();
let results: { score: number; plugin: UiPlugin }[] = [];
let searchFilter = new SearchFilter(searchString);
let rootClass = this.model.plugin_classes.get();
for (let i = 0; i < plugins.length; ++i) {
let plugin = plugins[i];
try {
if (filterType === PluginType.Plugin || rootClass.is_type_of(filterType, plugin.plugin_type)) {
let score: number = 0;
if (plugin.is_vst3) {
score = searchFilter.score(plugin.name, plugin.plugin_display_type, plugin.author_name, "vst3");
} else {
score = searchFilter.score(plugin.name, plugin.plugin_display_type, plugin.author_name);
}
if (score !== 0) {
if (favoritesList[plugin.uri]) {
score += 32768;
}
results.push({ score: score, plugin: plugin });
}
}
} catch (e: any) {
alert("Bad plugin:" + (plugin?.name ?? "null") + " plugin type: " + (plugin?.plugin_type ?? "null"
+ " " + e.toString()));
}
}
results.sort((left: { score: number; plugin: UiPlugin }, right: { score: number; plugin: UiPlugin }) => {
if (right.score < left.score) return -1;
if (right.score > left.score) return 1;
return left.plugin.name.localeCompare(right.plugin.name);
});
let t: UiPlugin[] = [];
for (let i = 0; i < results.length; ++i) {
t.push(results[i].plugin);
}
return t;
} catch (e: any) {
alert("getFilteredPlugins: " + e.toString());
throw e;
}
results.sort((left: { score: number; plugin: UiPlugin }, right: { score: number; plugin: UiPlugin }) => {
if (right.score < left.score) return -1;
if (right.score > left.score) return 1;
return left.plugin.name.localeCompare(right.plugin.name);
});
let t: UiPlugin[] = [];
for (let i = 0; i < results.length; ++i) {
t.push(results[i].plugin);
}
return t;
}
changedSearchString?: string = undefined;
@@ -841,10 +844,10 @@ export const LoadPluginDialog =
</IconButton>
</div>
</div>
<div className={classes.bottom} style={{height: 64}}>
<div className={classes.bottom} style={{ height: 64 }}>
<div style={{ flex: "1 1 1px" }} />
<div style={{ position: "relative", flex: "0 1 auto", display: "flex", alignItems: "center" }}>
<Button variant="dialogSecondary" onClick={this.handleCancel} style={{ height: 48 }} >Cancel</Button>
<Button variant="dialogSecondary" onClick={this.handleCancel} style={{ height: 48 }} >Cancel</Button>
<Button variant="dialogPrimary" onClick={this.handleOk} disabled={selectedPlugin === null} style={{ height: 48 }} >SELECT</Button>
</div>
</div>
+1 -1
View File
@@ -272,7 +272,7 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })(
<Switch
checked={this.state.enabled}
onChange={(e: any) => this.handleEnableChanged(e)}
color="secondary"
color="primary"
/>
)}
label="Enable"
+1 -1
View File
@@ -325,7 +325,7 @@ const WifiDirectConfigDialog = withStyles(styles, { withTheme: true })(
<Switch
checked={this.state.enabled}
onChange={(e: any) => this.handleEnableChanged(e)}
color="secondary"
color="primary"
/>
)}
label="Wi-Fi Direct Hotspot"
+4 -4
View File
@@ -44,7 +44,7 @@ const styles = (theme: Theme) => createStyles({
transition: theme.transitions.create(['opacity', 'background-color'], {
duration: theme.transitions.duration.shortest
}),
backgroundColor: theme.palette.secondary.main,
backgroundColor: theme.palette.primary.main,
opacity: theme.palette.mode === 'light' ? 0.38 : 0.3
}
@@ -155,7 +155,7 @@ const ZoomedUiControl = withStyles(styles, { withTheme: true })(
if (control.isOnOffSwitch()) {
// normal gray unchecked state.
return (
<Switch checked={value !== 0} color="secondary"
<Switch checked={value !== 0} color="primary"
onChange={(event) => {
this.onCheckChanged(event.target.checked);
}}
@@ -165,14 +165,14 @@ const ZoomedUiControl = withStyles(styles, { withTheme: true })(
if (control.isAbToggle()) {
// unchecked color is not gray.
return (
<Switch checked={value !== 0} color="secondary"
<Switch checked={value !== 0} color="primary"
onChange={(event) => {
this.onCheckChanged(event.target.checked);
}}
classes={{
track: this.props.classes.switchTrack
}}
style={{ color: this.props.theme.palette.secondary.main }}
style={{ color: this.props.theme.palette.primary.main }}
/>
);
} else {