Skip to content

Commit

Permalink
Fixed Widget / Sweep can play in opposite phase / Update nuget.csv / …
Browse files Browse the repository at this point in the history
…Update custom.aprof
  • Loading branch information
kurema committed Aug 31, 2023
1 parent 5088c4b commit 9802257
Show file tree
Hide file tree
Showing 12 changed files with 528 additions and 563 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ public class AppWidget : AppWidgetProvider

public override void OnUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds)
{
var me = new ComponentName(context, Java.Lang.Class.FromType(typeof(AppWidget)).Name);

appWidgetManager.UpdateAppWidget(me, BuildRemoteViews(context, appWidgetIds));
//https://developer.android.com/guide/topics/appwidgets
//var me = new ComponentName(context, Java.Lang.Class.FromType(typeof(AppWidget)).Name);
foreach (var appWidgetId in appWidgetIds)
{
appWidgetManager.UpdateAppWidget(appWidgetId, BuildRemoteViews(context, appWidgetIds));
}

//base.OnUpdate(context, appWidgetManager, appWidgetIds);
}
Expand All @@ -50,12 +53,10 @@ public override async void OnReceive(Context context, Intent intent)
{
base.OnReceive(context, intent);

await PlayTileService.PlayDummyAudioIfRequired();

switch (intent.Action)
{
case ACTION_SELECTED:
await Manager.Tts.SpeakLeftRight();
await PlayTileService.PlayLeftRightSound();
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ static async Task<(Java.Util.Locale, string)> GetLocalizedTextLocalAsync(Storage

private static async Task SpeakWordInEnglish(string text, TextToSpeechOptions options)
{
var op = new TextToSpeechOptions(options);
op.Locale = TextToSpeechImplementation.GetLocaleFromJavaLocale(Java.Util.Locale.English);
var op = new TextToSpeechOptions(options)
{
Locale = TextToSpeechImplementation.GetLocaleFromJavaLocale(Java.Util.Locale.English)
};
await Content.SpeakAsync(new (string Text, Dependency.TextToSpeechOptions Options)[] { (text, op) });
}

Expand All @@ -107,8 +109,10 @@ public static async Task SpeakLeftRight()
textLeft = string.IsNullOrWhiteSpace(textLeftOr) ? textLeft : textLeftOr;
textRight = string.IsNullOrWhiteSpace(textRightOr) ? textRight : textRightOr;
option.Locale = TextToSpeechImplementation.GetLocaleFromJavaLocale(locale);
var optionLeft = new TextToSpeechOptions(option);
optionLeft.Pan = -option.Pan;
var optionLeft = new TextToSpeechOptions(option)
{
Pan = -option.Pan
};
if (textLeft.Equals("Left", StringComparison.InvariantCultureIgnoreCase) && (await Content.GetLocalesAsync()).Any(a => a.Language == "English")) goto English;
await Content.SpeakAsync(new (string Text, Dependency.TextToSpeechOptions Options)[] { (textLeft, optionLeft), (textRight, option) });
return;
Expand All @@ -117,8 +121,10 @@ public static async Task SpeakLeftRight()
English:;
{
option.Locale = TextToSpeechImplementation.GetLocaleFromJavaLocale(Java.Util.Locale.English);
var optionLeft = new TextToSpeechOptions(option);
optionLeft.Pan = -option.Pan;
var optionLeft = new TextToSpeechOptions(option)
{
Pan = -option.Pan
};
await Content.SpeakAsync(new (string Text, Dependency.TextToSpeechOptions Options)[] { ("Left", optionLeft), ("Right", option) });
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ public static IAudioTest AudioTest
public override async void OnClick()
{
base.OnClick();

Storages.StatusBarManagerStorage.IsTileAdded = true;
await PlayLeftRightSound();
}

public static async System.Threading.Tasks.Task PlayLeftRightSound()
{
if (Storages.ConfigStorage.TileForceBeep.Value)
{
var audioTest = AudioTest;
Expand All @@ -80,26 +83,6 @@ public override async void OnClick()
amplifications = new[] { 0, Math.Max(Math.Min(1, 1 - (t - duration * 3) / easing), 0) };
return (amplifications[channel] * Math.Sin(2.0 * Math.PI * freqR * (t - duration * 2)), false);
}
//if (sample < actualSampleRate * Math.Floor(duration * freqL * 2) / freqL / 2)
//{
// amplifications = new[] { 1, 0 };
// return (amplifications[channel] * Math.Sin(2.0 * Math.PI * freqL * t), false);
//}
//else if (sample < duration * actualSampleRate * 2)
//{
// return (0, false);
//}
//else if (sample < actualSampleRate * (duration * 2 + Math.Floor(duration * freqR * 2) / freqR / 2))
//{
// amplifications = new[] { 0, 1 };
// return (amplifications[channel] * Math.Sin(2.0 * Math.PI * freqR * (t - duration * 2)), false);
//}
//else
//{
// var temp = Math.Sin(2.0 * Math.PI * freqR * (t - duration * 2));
// return (0, false);
//}
}, duration * 3 + easing, sample);
await System.Threading.Tasks.Task.Run(() => { try { audioTest.Play(); } catch { } });
}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#TYPE NuGet.PackageManagement.PowerShellCmdlets.PowerShellInstalledPackage
"ProjectName","Id","Versions","AsyncLazyVersions","Version","AllVersions","LicenseUrl"
"EarphoneLeftAndRight","Octokit","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","0.51.0","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight","Xamarin.Essentials","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","1.7.3","False","https://aka.ms/deprecateLicenseUrl"
"EarphoneLeftAndRight","NETStandard.Library","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","2.0.3","False","https://github.com/dotnet/standard/blob/master/LICENSE.TXT"
"EarphoneLeftAndRight","CsvHelper","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","27.2.1","False","https://licenses.nuget.org/MS-PL%20OR%20Apache-2.0"
"EarphoneLeftAndRight","Xamarin.Forms","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","5.0.0.2401","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight.Android","Xamarin.AndroidX.Lifecycle.LiveData","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","2.4.1.1","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight.Android","Xamarin.Forms","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","5.0.0.2401","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight.Android","Xamarin.Essentials","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","1.7.3","False","https://aka.ms/deprecateLicenseUrl"
"EarphoneLeftAndRight.Android","Xamarin.Google.UserMessagingPlatform","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","2.0.0","False","https://licenses.nuget.org/MIT%20AND%20Apache-2.0"
"EarphoneLeftAndRight.Android","Xamarin.GooglePlayServices.Ads","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","120.4.0","False","https://go.microsoft.com/fwlink/?linkid=865373"
"EarphoneLeftAndRight.Android","Xamarin.AndroidX.Lifecycle.LiveData","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","2.6.1.3","False","https://licenses.nuget.org/MIT%20AND%20Apache-2.0"
"EarphoneLeftAndRight.Android","Xamarin.Forms","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","5.0.0.2612","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight.Android","Xamarin.Essentials","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","1.8.0","False","https://aka.ms/deprecateLicenseUrl"
"EarphoneLeftAndRight.Android","Xamarin.Google.UserMessagingPlatform","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","2.0.0.5","False","https://licenses.nuget.org/MIT%20AND%20Apache-2.0"
"EarphoneLeftAndRight.Android","Xamarin.GooglePlayServices.Ads","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","122.1.0.2","False","https://go.microsoft.com/fwlink/?linkid=865373"
"EarphoneLeftAndRight","Xamarin.Essentials","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","1.8.0","False","https://aka.ms/deprecateLicenseUrl"
"EarphoneLeftAndRight","Octokit","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","7.1.0","False","https://licenses.nuget.org/MIT"
"EarphoneLeftAndRight","CsvHelper","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","30.0.1","False","https://licenses.nuget.org/MS-PL%20OR%20Apache-2.0"
"EarphoneLeftAndRight","Xamarin.Forms","System.Linq.Enumerable+<TakeIterator>d__25`1[NuGet.Versioning.NuGetVersion]","NuGet.Versioning.NuGetVersion[]","5.0.0.2612","False","https://licenses.nuget.org/MIT"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
「nugetパッケージマネージャ」→「パッケージマネージャコンソール」

```ps
Get-Package | Export-Csv -path nuget.csv
```
Loading

0 comments on commit 9802257

Please sign in to comment.