Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ソング: ループ範囲を設定できるようにする #2281

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
89695e8
ループを試行する
romot-co Oct 1, 2024
728b3b8
ループエリアの基本的な動作
romot-co Oct 1, 2024
c954ae0
ルーラーのズーム修正
romot-co Oct 2, 2024
f03c07f
ループ範囲が0の場合はループ無効にする
romot-co Oct 2, 2024
1e001bc
ループ範囲を任意のところから開始
romot-co Oct 2, 2024
c93b1ba
singing.tsとaudioRendering.tsを変更
sigprogramming Oct 2, 2024
7903a0a
フィールドを移動
sigprogramming Oct 4, 2024
b346832
Merge pull request #1 from sigprogramming/loop
romot-co Oct 5, 2024
7193bc7
ループ有効・無効切り替え
romot-co Oct 5, 2024
eb14753
ループボタンを調性
romot-co Oct 7, 2024
ddeeaf2
ループ無効時も範囲は設定できるようにする
romot-co Oct 15, 2024
3af7ab2
クリックでON/OFFするおよびループ設定後に再生ヘッドを開始位置に移動する
romot-co Oct 16, 2024
cdd4bea
ループマスクエリアの表示問題を修正する
romot-co Oct 17, 2024
f594378
動作および表示調整
romot-co Oct 18, 2024
e9a9800
動作およびCSS調整
romot-co Oct 18, 2024
950d115
ループエリアの見た目調整
romot-co Oct 19, 2024
a357cea
ループはデフォルトでオフ
romot-co Oct 19, 2024
5266acb
ループ削除と追加メニュー(仕掛かり)
romot-co Oct 21, 2024
aa36df8
Merge remote-tracking branch 'origin/main' into feature/2224_add_loop
romot-co Oct 22, 2024
b1bfd40
ループボタンで初期ループを作成
romot-co Oct 22, 2024
88f2762
(スナップショットを更新)
github-actions[bot] Oct 22, 2024
334908e
リファクタリングおよび処理の最適化(RequestAnimationFrameの利用など)
romot-co Oct 24, 2024
35340f4
コンフリクト解消
romot-co Oct 24, 2024
82b2557
Merge branch 'feature/2224_add_loop' of https://github.com/romot-co/v…
romot-co Oct 24, 2024
918eb32
クリック時の初期位置の誤りを修正
romot-co Oct 24, 2024
dad6414
サイズ調整
romot-co Oct 25, 2024
3e86177
ループ作成の動作を適切にする
romot-co Oct 25, 2024
c0b9e63
サイズ調整
romot-co Oct 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Sing/ScoreSequencer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,7 @@ const contextMenuData = computed<ContextMenuItemData[]>(() => {
.score-sequencer {
backface-visibility: hidden;
display: grid;
grid-template-rows: 40px 1fr;
grid-template-rows: 48px 1fr;
grid-template-columns: 48px 1fr;
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/Sing/SequencerGrid/Container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
:sequencerZoomY
:sequencerSnapType
:numMeasures
:isLoopEnabled
:loopStartTick
:loopEndTick
/>
</template>

<script setup lang="ts">
import { computed } from "vue";
import Presentation from "./Presentation.vue";
import { useStore } from "@/store";
import { useLoopControl } from "@/composables/useLoopControl";

defineOptions({
name: "SequencerGrid",
Expand All @@ -26,4 +30,5 @@ const sequencerZoomX = computed(() => store.state.sequencerZoomX);
const sequencerZoomY = computed(() => store.state.sequencerZoomY);
const sequencerSnapType = computed(() => store.state.sequencerSnapType);
const numMeasures = computed(() => store.getters.SEQUENCER_NUM_MEASURES);
const { isLoopEnabled, loopStartTick, loopEndTick } = useLoopControl();
</script>
45 changes: 45 additions & 0 deletions src/components/Sing/SequencerGrid/Presentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,27 @@
:y2="gridHeight"
class="sequencer-grid-measure-line"
/>
<!-- ループエリア外を暗くする -->
<g v-if="isLoopEnabled && loopStartTick !== loopEndTick">
<!-- 左側 -->
<rect
x="0"
y="0"
:width="loopStartX"
:height="gridHeight"
class="sequencer-grid-loop-mask"
pointer-events="none"
/>
<!-- 右側 -->
<rect
:x="loopEndX"
y="0"
:width="gridWidth - loopEndX"
:height="gridHeight"
class="sequencer-grid-loop-mask"
pointer-events="none"
/>
</g>
</svg>
</template>

Expand All @@ -99,6 +120,9 @@ const props = defineProps<{
sequencerZoomY: number;
sequencerSnapType: number;
numMeasures: number;
isLoopEnabled: boolean;
loopStartTick: number;
loopEndTick: number;
}>();

const gridCellTicks = computed(() => {
Expand Down Expand Up @@ -169,6 +193,13 @@ const snapLinePositions = computed(() => {
return (currentTick / measureTicks) * measureWidth.value;
});
});
// ループのX座標を計算
const loopStartX = computed(() => {
return tickToBaseX(props.loopStartTick, props.tpqn) * props.sequencerZoomX;
});
const loopEndX = computed(() => {
return tickToBaseX(props.loopEndTick, props.tpqn) * props.sequencerZoomX;
});
</script>

<style scoped lang="scss">
Expand Down Expand Up @@ -222,6 +253,20 @@ const snapLinePositions = computed(() => {
stroke-width: 1px;
}

.sequencer-grid-loop-mask {
position: relative;
fill: var(--scheme-color-scrim);
pointer-events: none;
}

:root[is-dark-theme="false"] .sequencer-grid-loop-mask {
opacity: 0.05;
}

:root[is-dark-theme="true"] .sequencer-grid-loop-mask {
opacity: 0.24;
}

.edit-pitch {
.sequencer-grid-vertical-line {
stroke: transparent;
Expand Down
Loading
Loading