Skip to content

Commit 137b5b1

Browse files
authored
Merge pull request #13 from samunohito/develop
v0.1.71-beta
2 parents 6ac2897 + b6aeb43 commit 137b5b1

File tree

67 files changed

+1562
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1562
-702
lines changed

.git-pr-release-template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<%= ENV['APP_VERSION'] %>
2+
<% pull_requests.each do |pr| -%>
3+
<%= pr.to_checklist_item %>
4+
<% end -%>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: create a release pull request
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request:
7+
types: [ closed ]
8+
branches:
9+
- develop
10+
11+
env:
12+
pathOfVersioning: ${{ github.workspace }}/SimpleVolumeMixer
13+
14+
jobs:
15+
create-release-pr:
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
- name: checkout this solution
20+
uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
23+
24+
- id: nbgv
25+
run: |
26+
VERSION=`nbgv get-version -p ${{ env.pathOfVersioning }} -v NuGetPackageVersion`
27+
echo "::set-output name=version::$VERSION"
28+
29+
- name: create a release pull request
30+
uses: bakunyo/git-pr-release-action@281e1fe424fac01f3992542266805e4202a22fe0
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GIT_PR_RELEASE_BRANCH_PRODUCTION: master
34+
GIT_PR_RELEASE_BRANCH_STAGING: develop
35+
GIT_PR_RELEASE_LABELS: release
36+
APP_VERSION: v${{ steps.nbgv.outputs.version }}
37+
GIT_PR_RELEASE_TEMPLATE: .git-pr-release-template

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515

1616
jobs:
1717
build-artifact:
18+
if: github.event.pull_request.merged == true
1819
runs-on: windows-2019
1920
outputs:
2021
artifactName: ${{ steps.vars.outputs.artifactName }}
@@ -79,10 +80,10 @@ jobs:
7980
- id: vars
8081
shell: bash
8182
run: |
82-
if [[ "${{ needs.build-artifact.outputs.prereleaseVersionNoLeadingHyphen }}" = "beta" -o "${{ needs.build-artifact.outputs.prereleaseVersionNoLeadingHyphen }}" = "alpha" ]]; then
83-
echo "::set-output name=isPrerelease::true";
83+
if [ "${{ needs.build-artifact.outputs.prereleaseVersionNoLeadingHyphen }}" = "beta" ] || [ "${{ needs.build-artifact.outputs.prereleaseVersionNoLeadingHyphen }}" = "alpha" ]; then
84+
echo "::set-output name=isPrerelease::true"
8485
else
85-
echo "::set-output name=isPrerelease::false";
86+
echo "::set-output name=isPrerelease::false"
8687
fi;
8788
8889
- id: create-release
@@ -99,6 +100,7 @@ jobs:
99100
run: |
100101
echo "::set-output name=uploadUrl::${{ steps.create-release.outputs.upload_url }}"
101102
103+
102104
upload-release:
103105
runs-on: ubuntu-latest
104106
needs: [ create-release, build-artifact ]

.idea/.idea.SimpleVolumeMixer/.idea/misc.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
1-
using Reactive.Bindings;
1+
using System.Collections.ObjectModel;
2+
using Reactive.Bindings;
23
using SimpleVolumeMixer.Core.Helper.CoreAudio;
34
using SimpleVolumeMixer.Core.Helper.CoreAudio.Types;
45

56
namespace SimpleVolumeMixer.Core.Contracts.Models.Repository;
67

78
public interface ICoreAudioRepository
89
{
9-
ReadOnlyReactiveCollection<AudioDeviceAccessor> AudioDevices { get; }
10+
/// <summary>
11+
/// 現在使用可能な<see cref="AudioDeviceAccessor"/>の一覧を取得する。
12+
/// 読み取り専用であり、このオブジェクトからデバイスの増減を行うことは出来ない。
13+
/// デバイスの増減は<see cref="AudioDeviceAccessorManager.CollectAudioEndpoints"/>によりCoreAudioAPIからデバイス一覧を取り直すか、
14+
/// <see cref="AudioDeviceAccessorManager"/>がCoreAudioAPIからの通知を受け、その結果デバイスが追加されるかに限る。
15+
/// </summary>
16+
ReadOnlyObservableCollection<AudioDeviceAccessor> AudioDevices { get; }
17+
18+
/// <summary>
19+
/// <see cref="RoleType.Communications"/>ロールのデバイスを取得する。
20+
/// インスタンスは<see cref="AudioDevices"/>から<see cref="RoleType.Communications"/>ロールを持つ物を検索して取得できる値と同一である。
21+
/// </summary>
1022
IReadOnlyReactiveProperty<AudioDeviceAccessor?> CommunicationRoleDevice { get; }
23+
24+
/// <summary>
25+
/// <see cref="RoleType.Multimedia"/>ロールのデバイスを取得する。
26+
/// インスタンスは<see cref="AudioDevices"/>から<see cref="RoleType.Multimedia"/>ロールを持つ物を検索して取得できる値と同一である。
27+
/// </summary>
1128
IReadOnlyReactiveProperty<AudioDeviceAccessor?> MultimediaRoleDevice { get; }
29+
30+
/// <summary>
31+
/// 引数のデバイスと<see cref="DataFlowType"/>のデバイスに対し、<see cref="RoleType"/>のロールを割り当てる。
32+
/// </summary>
33+
/// <param name="accessor"></param>
34+
/// <param name="dataFlowType"></param>
35+
/// <param name="roleType"></param>
1236
void SetDefaultDevice(AudioDeviceAccessor accessor, DataFlowType dataFlowType, RoleType roleType);
1337
}

SimpleVolumeMixer/Core/Helper/Component/DisposableComponent.cs

Lines changed: 0 additions & 72 deletions
This file was deleted.

SimpleVolumeMixer/Core/Helper/Component/IDisposableComponent.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using System.ComponentModel;
2+
using SimpleVolumeMixer.Core.Helper.Component.Types;
3+
4+
namespace SimpleVolumeMixer.Core.Helper.Component;
5+
6+
/// <summary>
7+
/// Provides an interface to a function that monitors certain values at regular intervals.
8+
/// </summary>
9+
public interface IPollingMonitor : INotifyPropertyChanged
10+
{
11+
/// <summary>
12+
/// Occurs when the result of polling by this interface differs from the previous value.
13+
/// </summary>
14+
/// <seealso cref="INotifyPropertyChanged.PropertyChanged"/>
15+
new event PropertyChangedEventHandler? PropertyChanged;
16+
17+
/// <summary>
18+
/// Holds the latest value obtained during polling.
19+
/// If the value is rewritten by the polling process, the <see cref="PropertyChanged"/> event is fired.
20+
/// </summary>
21+
object Value { get; }
22+
23+
/// <summary>
24+
/// Gets or sets the interval for polling. The interval can be set in milliseconds.
25+
/// See the enum definition for detailed seconds.
26+
/// If <see cref="PollingMonitorIntervalType.Manual"/> is set,
27+
/// no polling is performed and the value is updated only when the <see cref="Refresh()"/> method is called externally.
28+
/// If this property is changed while the polling process is running,
29+
/// the polling process execution interval is adjusted; if <see cref="PollingMonitorIntervalType.Manual"/> is set, the polling process is stopped.
30+
/// </summary>
31+
/// <seealso cref="PollingMonitorIntervalType"/>
32+
PollingMonitorIntervalType IntervalType { get; set; }
33+
34+
/// <summary>
35+
/// Start polling. However, this method only starts the process and does not block the thread.
36+
/// If this method is called when <see cref="IntervalType"/> is set to <see cref="PollingMonitorIntervalType.Manual"/> or when a polling operation is already running,
37+
/// no new polling operation will be started and nothing will happen.
38+
/// </summary>
39+
void Start();
40+
41+
/// <summary>
42+
/// Stops polling, even if called when polling is not running,
43+
/// including when <see cref="IntervalType"/> is <see cref="PollingMonitorIntervalType.Manual"/>, no exception is made.
44+
/// </summary>
45+
void Stop();
46+
47+
/// <summary>
48+
/// The process of obtaining the latest value of the polling process is implemented.
49+
/// When the value is updated, the <see cref="Value"/> property is rewritten and the fact that the value has been updated is notified externally by <see cref="INotifyPropertyChanged.PropertyChanged"/>.
50+
/// </summary>
51+
/// <seealso cref="PropertyChanged"/>
52+
/// <seealso cref="INotifyPropertyChanged.PropertyChanged"/>
53+
void Refresh();
54+
}
55+
56+
/// <summary>
57+
/// An interface that applies a generic to the <see cref="IPollingMonitor.Value"/> property of the <see cref="IPollingMonitor"/> interface.
58+
/// </summary>
59+
/// <typeparam name="T"></typeparam>
60+
public interface IPollingMonitor<T> : IPollingMonitor
61+
{
62+
/// <summary>
63+
/// It has the same functionality as the inherited source, the only difference being that the type is generic.
64+
/// See the documentation of the inherited source for detailed functionality.
65+
/// </summary>
66+
/// <seealso cref="IPollingMonitor.Value"/>
67+
new T Value { get; }
68+
}

SimpleVolumeMixer/Core/Helper/Component/IPropertyMonitor.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

SimpleVolumeMixer/Core/Helper/Component/KeyValueInstanceManager.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
using System;
22
using System.Collections.Generic;
3+
using DisposableComponents;
34

45
namespace SimpleVolumeMixer.Core.Helper.Component;
56

7+
/// <summary>
8+
/// This component is used to ensure that the TK and TV values are always 1-1.
9+
/// The key must implement <see cref="IDisposableComponent"/> so that the value can also be destroyed when the key is destroyed.
10+
/// </summary>
11+
/// <typeparam name="TK">Key value type</typeparam>
12+
/// <typeparam name="TV">Type corresponding to TK</typeparam>
613
public class KeyValueInstanceManager<TK, TV> : DisposableComponent where TK : IDisposableComponent
714
{
815
private readonly object _gate = new();
916
private readonly IDictionary<TK, TV> _instances;
1017
private readonly Func<TK, TV> _factory;
1118

19+
/// <summary>
20+
/// ctor
21+
/// </summary>
22+
/// <param name="factory">Function to generate the value corresponding to a key</param>
1223
public KeyValueInstanceManager(Func<TK, TV> factory)
1324
{
1425
_instances = new Dictionary<TK, TV>();
1526
_factory = factory;
1627
}
1728

29+
/// <summary>
30+
/// If the value corresponding to the key already exists, return that value; if not, create and return a new value.
31+
/// </summary>
32+
/// <param name="key"></param>
33+
/// <returns></returns>
1834
public TV Obtain(TK key)
1935
{
2036
lock (_gate)
@@ -33,6 +49,11 @@ public TV Obtain(TK key)
3349
}
3450
}
3551

52+
/// <summary>
53+
/// Process to erase the value from this instance when the key is destroyed.
54+
/// </summary>
55+
/// <param name="sender"></param>
56+
/// <param name="e"></param>
3657
private void KeyOnDisposed(object? sender, EventArgs e)
3758
{
3859
if (sender == null)

0 commit comments

Comments
 (0)