@@ -7,7 +7,7 @@ import { createRef, type JSX } from "preact";
77
88import { Publisher } from "../../../core/Publisher.js" ;
99import type { RealTime } from "../../../core/ScoreBookDataModel.js" ;
10- import type { ITimeParamsView } from "../../../core/types/general.js" ;
10+ import type { ITimeParams } from "../../../core/types/general.js" ;
1111import type { UndoManager } from "../../../core/UndoManager.js" ;
1212import type { ArrangementPlayer } from "../../../player/ArrangementPlayer.js" ;
1313import type { ScoreBookUiServices } from "../../../player/types.js" ;
@@ -74,7 +74,7 @@ export class ArrangementViewer extends UIComponent<IArrangementViewerProps, IArr
7474 }
7575
7676 public override componentDidMount ( ) : void {
77- const { arrangementPlayer, services } = this . props ;
77+ const { arrangementPlayer } = this . props ;
7878 const { autoFollowIsOn } = this . state ;
7979
8080 setTimeout ( this . handleResize , 0 ) ;
@@ -85,10 +85,10 @@ export class ArrangementViewer extends UIComponent<IArrangementViewerProps, IArr
8585
8686 // If desired, turn on auto-follow like so.
8787 if ( autoFollowIsOn ) {
88- services . animationEngine . connect ( this . autoFollow ) ;
88+ arrangementPlayer . animationEngine . connect ( this . autoFollow ) ;
8989 } else {
9090 // Otherwise, set up the subscription which will turn it on again.
91- this . addSubscription ( services . animationEngine , this . animationEngineSubscription ) ;
91+ this . addSubscription ( arrangementPlayer . animationEngine , this . animationEngineSubscription ) ;
9292 }
9393
9494 this . updateScrollShadows ( ) ;
@@ -102,10 +102,10 @@ export class ArrangementViewer extends UIComponent<IArrangementViewerProps, IArr
102102 public override componentWillUnmount ( ) : void {
103103 super . componentWillUnmount ( ) ;
104104
105- const { services } = this . props ;
105+ const { arrangementPlayer } = this . props ;
106106
107107 this . resizeObserver . disconnect ( ) ;
108- services . animationEngine . disconnect ( this . autoFollow ) ;
108+ arrangementPlayer . animationEngine . disconnect ( this . autoFollow ) ;
109109 }
110110
111111 public override render ( ) : JSX . Element {
@@ -195,7 +195,7 @@ export class ArrangementViewer extends UIComponent<IArrangementViewerProps, IArr
195195 * @param timeParams The time params of the arrangement.
196196 * @returns The width of the entire note line in pt.
197197 */
198- private getNoteLineMinWidth = ( timeParams : ITimeParamsView ) : number => {
198+ private getNoteLineMinWidth = ( timeParams : Readonly < ITimeParams > ) : number => {
199199 const widthFromNotes = baseNoteWidth * timeParams . timings . length ;
200200 const extraWidthBetweenBars = ( timeParams . length - 1 ) * 4 ;
201201
@@ -304,8 +304,9 @@ export class ArrangementViewer extends UIComponent<IArrangementViewerProps, IArr
304304 } ;
305305
306306 private animationEngineSubscription = ( ) => {
307- const { services } = this . props ;
308- if ( services . animationEngine . state === "playing" ) {
307+ const { arrangementPlayer } = this . props ;
308+
309+ if ( arrangementPlayer . animationEngine . state === "playing" ) {
309310 this . setState ( { autoFollowIsOn : true } ) ;
310311 }
311312 } ;
0 commit comments