1/* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export class ImagesData { 17 id ?: number 18 src ?: Resource 19 name ?: Resource 20 vibratorFileL ?: string 21 vibratorFileM ?: string 22 vibratorFileH ?: string 23 audioName ?: string 24} 25 26export function getImageRacingList(): Array<ImagesData> { 27 let ImagesDataArray: Array<ImagesData> = [ 28 { 29 id: 0, 30 src: $r("app.media.Racing1"), 31 name: $r("app.string.display_racing_car_crash"), 32 vibratorFileL: "CarCrash_l.json", 33 vibratorFileM: "CarCrash_m.json", 34 vibratorFileH: "CarCrash_h.json", 35 audioName: "CarCrash.wav" 36 }, 37 { 38 id: 1, 39 src: $r("app.media.Racing2"), 40 name: $r("app.string.display_racing_ignite"), 41 vibratorFileL: "CarIgnite_l.json", 42 vibratorFileM: "CarIgnite_m.json", 43 vibratorFileH: "CarIgnite_h.json", 44 audioName: "CarIgnite.wav" 45 }, 46 { 47 id: 2, 48 src: $r("app.media.Racing3"), 49 name: $r("app.string.display_racing_skid"), 50 vibratorFileL: "CarSkid_l.json", 51 vibratorFileM: "CarSkid_m.json", 52 vibratorFileH: "CarSkid_h.json", 53 audioName: "CarSkid.wav" 54 }, 55 { 56 id: 3, 57 src: $r("app.media.Racing4"), 58 name: $r("app.string.display_racing_drifting_jet"), 59 vibratorFileL: "DriftingJet_l.json", 60 vibratorFileM: "DriftingJet_m.json", 61 vibratorFileH: "DriftingJet_h.json", 62 audioName: "DriftingJet.wav" 63 }, 64 { 65 id: 4, 66 src: $r("app.media.Racing5"), 67 name: $r("app.string.display_racing_jet_n2o"), 68 vibratorFileL: "JetN2O_l.json", 69 vibratorFileM: "JetN2O_m.json", 70 vibratorFileH: "JetN2O_h.json", 71 audioName: "JetN2O.wav" 72 }, 73 { 74 id: 5, 75 src: $r("app.media.Racing6"), 76 name: $r("app.string.display_racing_start"), 77 vibratorFileL: "RacingStart_l.json", 78 vibratorFileM: "RacingStart_m.json", 79 vibratorFileH: "RacingStart_h.json", 80 audioName: "RacingStart.wav" 81 }, 82 { 83 id: 6, 84 src: $r("app.media.Racing8"), 85 name: $r("app.string.display_racing_speed_up"), 86 vibratorFileL: "SpeedUp_l.json", 87 vibratorFileM: "SpeedUp_m.json", 88 vibratorFileH: "SpeedUp_h.json", 89 audioName: "SpeedUp.wav" 90 }, 91 ] 92 return ImagesDataArray; 93} 94 95export function getImageBattleList(): Array<ImagesData> { 96 let ImagesDataArray: Array<ImagesData> = [ 97 { 98 id: 0, 99 src: $r("app.media.Battle7"), 100 name: $r("app.string.display_battle_tumble"), 101 vibratorFileL: "Tumble_l.json", 102 vibratorFileM: "Tumble_m.json", 103 vibratorFileH: "Tumble_h.json", 104 audioName: "Tumble.wav" 105 }, 106 { 107 id: 1, 108 src: $r("app.media.Battle2"), 109 name: $r("app.string.display_battle_punch"), 110 vibratorFileL: "Punch_l.json", 111 vibratorFileM: "Punch_m.json", 112 vibratorFileH: "Punch_h.json", 113 audioName: "Punch.wav" 114 }, 115 { 116 id: 2, 117 src: $r("app.media.Battle3"), 118 name: $r("app.string.display_battle_kick"), 119 vibratorFileL: "Kick_l.json", 120 vibratorFileM: "Kick_m.json", 121 vibratorFileH: "Kick_h.json", 122 audioName: "Kick.wav" 123 }, 124 { 125 id: 3, 126 src: $r("app.media.Battle4"), 127 name: $r("app.string.display_battle_hurt"), 128 vibratorFileL: "Hurt_l.json", 129 vibratorFileM: "Hurt_m.json", 130 vibratorFileH: "Hurt_h.json", 131 audioName: "Hurt.wav" 132 }, 133 { 134 id: 4, 135 src: $r("app.media.Battle5"), 136 name: $r("app.string.display_battle_blast"), 137 vibratorFileL: "Blast_l.json", 138 vibratorFileM: "Blast_m.json", 139 vibratorFileH: "Blast_h.json", 140 audioName: "Blast.wav" 141 }, 142 { 143 id: 5, 144 src: $r("app.media.Battle6"), 145 name: $r("app.string.display_battle_bomb"), 146 vibratorFileL: "Bomb_l.json", 147 vibratorFileM: "Bomb_m.json", 148 vibratorFileH: "Bomb_h.json", 149 audioName: "Bomb.wav" 150 }, 151 ] 152 return ImagesDataArray; 153} 154 155export function getImageShootList(): Array<ImagesData> { 156 let ImagesDataArray: Array<ImagesData> = [ 157 { 158 id: 0, 159 src: $r("app.media.AK47"), 160 name: $r("app.string.display_shoot_AK47"), 161 vibratorFileL: "AK47_l.json", 162 vibratorFileM: "AK47_m.json", 163 vibratorFileH: "AK47_h.json", 164 audioName: "AK47.wav" 165 }, 166 { 167 id: 1, 168 src: $r("app.media.HK416"), 169 name: $r("app.string.display_shoot_HK416"), 170 vibratorFileL: "HK416_l.json", 171 vibratorFileM: "HK416_m.json", 172 vibratorFileH: "HK416_h.json", 173 audioName: "HK416.wav" 174 }, 175 { 176 id: 2, 177 src: $r("app.media.M4"), 178 name: $r("app.string.display_shoot_M4"), 179 vibratorFileL: "M4_l.json", 180 vibratorFileM: "M4_m.json", 181 vibratorFileH: "M4_h.json", 182 audioName: "M4.wav" 183 }, 184 { 185 id: 3, 186 src: $r("app.media.MP5"), 187 name: $r("app.string.display_shoot_MP5"), 188 vibratorFileL: "MP5_l.json", 189 vibratorFileM: "MP5_m.json", 190 vibratorFileH: "MP5_h.json", 191 audioName: "MP5.wav" 192 }, 193 { 194 id: 4, 195 src: $r("app.media.CZ75"), 196 name: $r("app.string.display_shoot_CZ75"), 197 vibratorFileL: "CZ75_l.json", 198 vibratorFileM: "CZ75_m.json", 199 vibratorFileH: "CZ75_h.json", 200 audioName: "CZ75.wav" 201 }, 202 { 203 id: 5, 204 src: $r("app.media.Winchester"), 205 name: $r("app.string.display_shoot_winchester"), 206 vibratorFileL: "Winchester_l.json", 207 vibratorFileM: "Winchester_m.json", 208 vibratorFileH: "Winchester_h.json", 209 audioName: "Winchester.wav" 210 }, 211 { 212 id: 6, 213 src: $r("app.media.Rifle"), 214 name: $r("app.string.display_shoot_rifle"), 215 vibratorFileL: "Rifle_l.json", 216 vibratorFileM: "Rifle_m.json", 217 vibratorFileH: "Rifle_h.json", 218 audioName: "Rifle.wav" 219 }, 220 { 221 id: 7, 222 src: $r("app.media.AssaultRifle"), 223 name: $r("app.string.display_shoot_assault_rifle"), 224 vibratorFileL: "AssaultRifle_l.json", 225 vibratorFileM: "AssaultRifle_m.json", 226 vibratorFileH: "AssaultRifle_h.json", 227 audioName: "AssaultRifle.wav" 228 }, 229 { 230 id: 8, 231 src: $r("app.media.HitSand"), 232 name: $r("app.string.display_shoot_hit_sand"), 233 vibratorFileL: "HitSand_l.json", 234 vibratorFileM: "HitSand_m.json", 235 vibratorFileH: "HitSand_h.json", 236 audioName: "HitSand.wav" 237 }, 238 { 239 id: 9, 240 src: $r("app.media.HitWater"), 241 name: $r("app.string.display_shoot_hit_water"), 242 vibratorFileL: "HitWater_l.json", 243 vibratorFileM: "HitWater_m.json", 244 vibratorFileH: "HitWater_h.json", 245 audioName: "HitWater.wav" 246 }, 247 { 248 id: 10, 249 src: $r("app.media.HitMetal"), 250 name: $r("app.string.display_shoot_hit_metal"), 251 vibratorFileL: "HitMetal_l.json", 252 vibratorFileM: "HitMetal_m.json", 253 vibratorFileH: "HitMetal_h.json", 254 audioName: "HitMetal.wav" 255 }, 256 { 257 id: 11, 258 src: $r("app.media.HitWood"), 259 name: $r("app.string.display_shoot_hit_wood"), 260 vibratorFileL: "HitWood_l.json", 261 vibratorFileM: "HitWood_m.json", 262 vibratorFileH: "HitWood_h.json", 263 audioName: "HitWood.wav" 264 }, 265 { 266 id: 12, 267 src: $r("app.media.HitGlass"), 268 name: $r("app.string.display_shoot_hit_glass"), 269 vibratorFileL: "HitGlass_l.json", 270 vibratorFileM: "HitGlass_m.json", 271 vibratorFileH: "HitGlass_h.json", 272 audioName: "HitGlass.wav" 273 }, 274 ] 275 return ImagesDataArray; 276} 277 278export function getImageInstrumentsList(): Array<ImagesData> { 279 let ImagesDataArray: Array<ImagesData> = [ 280 { 281 id: 0, 282 src: $r("app.media.Cymbals"), 283 name: $r("app.string.display_instrument_cymbals"), 284 vibratorFileL: "Cymbals_l.json", 285 vibratorFileM: "Cymbals_m.json", 286 vibratorFileH: "Cymbals_h.json", 287 audioName: "Cymbals.wav" 288 }, 289 { 290 id: 1, 291 src: $r("app.media.Cymbals2"), 292 name: $r("app.string.display_instrument_cymbals2"), 293 vibratorFileL: "Cymbals2_l.json", 294 vibratorFileM: "Cymbals2_m.json", 295 vibratorFileH: "Cymbals2_h.json", 296 audioName: "Cymbals2.wav" 297 }, 298 { 299 id: 2, 300 src: $r("app.media.KickDrum"), 301 name: $r("app.string.display_instrument_kick_drum"), 302 vibratorFileL: "KickDrum_l.json", 303 vibratorFileM: "KickDrum_m.json", 304 vibratorFileH: "KickDrum_h.json", 305 audioName: "KickDrum.wav" 306 }, 307 { 308 id: 3, 309 src: $r("app.media.KickDrum2"), 310 name: $r("app.string.display_instrument_kick_drum2"), 311 vibratorFileL: "KickDrum2_l.json", 312 vibratorFileM: "KickDrum2_m.json", 313 vibratorFileH: "KickDrum2_h.json", 314 audioName: "KickDrum2.wav" 315 }, 316 { 317 id: 4, 318 src: $r("app.media.Guitar"), 319 name: $r("app.string.display_instrument_guitar"), 320 vibratorFileL: "Guitar_l.json", 321 vibratorFileM: "Guitar_m.json", 322 vibratorFileH: "Guitar_h.json", 323 audioName: "Guitar.wav" 324 }, 325 { 326 id: 5, 327 src: $r("app.media.Tambourine"), 328 name: $r("app.string.display_instrument_tambourine"), 329 vibratorFileL: "Tambourine_l.json", 330 vibratorFileM: "Tambourine_m.json", 331 vibratorFileH: "Tambourine_h.json", 332 audioName: "Tambourine.wav" 333 }, 334 { 335 id: 6, 336 src: $r("app.media.Bell"), 337 name: $r("app.string.display_instrument_bell"), 338 vibratorFileL: "bell_l.json", 339 vibratorFileM: "bell_m.json", 340 vibratorFileH: "bell_h.json", 341 audioName: "bell.wav" 342 }, 343 { 344 id: 7, 345 src: $r("app.media.Claves"), 346 name: $r("app.string.display_instrument_claves"), 347 vibratorFileL: "Claves_l.json", 348 vibratorFileM: "Claves_m.json", 349 vibratorFileH: "Claves_h.json", 350 audioName: "Claves.wav" 351 }, 352 { 353 id: 8, 354 src: $r("app.media.Gong"), 355 name: $r("app.string.display_instrument_gong"), 356 vibratorFileL: "Gong_l.json", 357 vibratorFileM: "Gong_m.json", 358 vibratorFileH: "Gong_h.json", 359 audioName: "Gong.wav" 360 }, 361 { 362 id: 9, 363 src: $r("app.media.Triangle"), 364 name: $r("app.string.display_instrument_triangle"), 365 vibratorFileL: "triangle_l.json", 366 vibratorFileM: "triangle_m.json", 367 vibratorFileH: "triangle_h.json", 368 audioName: "triangle.wav" 369 }, 370 ] 371 return ImagesDataArray; 372} 373 374export function getImageRealisticList(): Array<ImagesData> { 375 let ImagesDataArray: Array<ImagesData> = [ 376 { 377 id: 0, 378 src: $r("app.media.Ice"), 379 name: $r("app.string.display_realistic_ice"), 380 vibratorFileL: "ice_l.json", 381 vibratorFileM: "ice_m.json", 382 vibratorFileH: "ice_h.json", 383 audioName: "ice.wav" 384 }, 385 { 386 id: 1, 387 src: $r("app.media.Keyboard"), 388 name: $r("app.string.display_realistic_keyboard"), 389 vibratorFileL: "Keyboard_l.json", 390 vibratorFileM: "Keyboard_m.json", 391 vibratorFileH: "Keyboard_h.json", 392 audioName: "Keyboard.wav" 393 }, 394 { 395 id: 2, 396 src: $r("app.media.Typewriter"), 397 name: $r("app.string.display_realistic_typewriter"), 398 vibratorFileL: "Typewriter_l.json", 399 vibratorFileM: "Typewriter_m.json", 400 vibratorFileH: "Typewriter_h.json", 401 audioName: "Typewriter.wav" 402 }, 403 { 404 id: 3, 405 src: $r("app.media.CoinDrop"), 406 name: $r("app.string.display_realistic_coin_drop"), 407 vibratorFileL: "CoinDrop_l.json", 408 vibratorFileM: "CoinDrop_m.json", 409 vibratorFileH: "CoinDrop_h.json", 410 audioName: "CoinDrop.wav" 411 }, 412 { 413 id: 4, 414 src: $r("app.media.Timer"), 415 name: $r("app.string.display_realistic_timer"), 416 vibratorFileL: "timer_l.json", 417 vibratorFileM: "timer_m.json", 418 vibratorFileH: "timer_h.json", 419 audioName: "timer.wav" 420 }, 421 { 422 id: 5, 423 src: $r("app.media.Walk"), 424 name: $r("app.string.display_realistic_walk"), 425 vibratorFileL: "Walk_l.json", 426 vibratorFileM: "Walk_m.json", 427 vibratorFileH: "Walk_h.json", 428 audioName: "Walk.wav" 429 }, 430 { 431 id: 6, 432 src: $r("app.media.camerashutter"), 433 name: $r("app.string.display_realistic_camerashutter"), 434 vibratorFileL: "camerashutter_l.json", 435 vibratorFileM: "camerashutter_m.json", 436 vibratorFileH: "camerashutter_h.json", 437 audioName: "camerashutter.wav" 438 }, 439 { 440 id: 7, 441 src: $r("app.media.camerashutter2"), 442 name: $r("app.string.display_realistic_camerashutter2"), 443 vibratorFileL: "camerashutter2_l.json", 444 vibratorFileM: "camerashutter2_m.json", 445 vibratorFileH: "camerashutter2_h.json", 446 audioName: "camerashutter2.wav" 447 }, 448 { 449 id: 8, 450 src: $r("app.media.Clock"), 451 name: $r("app.string.display_realistic_clock"), 452 vibratorFileL: "clock_l.json", 453 vibratorFileM: "clock_m.json", 454 vibratorFileH: "clock_h.json", 455 audioName: "clock.wav" 456 }, 457 { 458 id: 9, 459 src: $r("app.media.Water"), 460 name: $r("app.string.display_realistic_water"), 461 vibratorFileL: "Water_l.json", 462 vibratorFileM: "Water_m.json", 463 vibratorFileH: "Water_h.json", 464 audioName: "Water.wav" 465 }, 466 { 467 id: 10, 468 src: $r("app.media.heartbeat"), 469 name: $r("app.string.display_realistic_heartbeat"), 470 vibratorFileL: "heartbeat_l.json", 471 vibratorFileM: "heartbeat_m.json", 472 vibratorFileH: "heartbeat_h.json", 473 audioName: "heartbeat.wav" 474 }, 475 { 476 id: 11, 477 src: $r("app.media.Firework"), 478 name: $r("app.string.display_realistic_firework"), 479 vibratorFileL: "Firework_l.json", 480 vibratorFileM: "Firework_m.json", 481 vibratorFileH: "Firework_h.json", 482 audioName: "Firework.wav" 483 }, 484 { 485 id: 12, 486 src: $r("app.media.Picker"), 487 name: $r("app.string.display_realistic_picker"), 488 vibratorFileL: "Picker_l.json", 489 vibratorFileM: "Picker_m.json", 490 vibratorFileH: "Picker_h.json", 491 audioName: "Picker.wav" 492 }, 493 ] 494 return ImagesDataArray; 495} 496 497export function getImageFootstepList(): Array<ImagesData> { 498 let ImagesDataArray: Array<ImagesData> = [ 499 { 500 id: 0, 501 src: $r("app.media.Footstep1"), 502 name: $r("app.string.display_footstep_on_carpet"), 503 vibratorFileL: "OnCarpet_l.json", 504 vibratorFileM: "OnCarpet_m.json", 505 vibratorFileH: "OnCarpet_h.json", 506 audioName: "OnCarpet.wav" 507 }, 508 { 509 id: 1, 510 src: $r("app.media.Footstep2"), 511 name: $r("app.string.display_footstep_on_concrete"), 512 vibratorFileL: "OnConcrete_l.json", 513 vibratorFileM: "OnConcrete_m.json", 514 vibratorFileH: "OnConcrete_h.json", 515 audioName: "OnConcrete.wav" 516 }, 517 { 518 id: 2, 519 src: $r("app.media.Footstep3"), 520 name: $r("app.string.display_footstep_on_grass"), 521 vibratorFileL: "OnGrass_l.json", 522 vibratorFileM: "OnGrass_m.json", 523 vibratorFileH: "OnGrass_h.json", 524 audioName: "OnGrass.wav" 525 }, 526 { 527 id: 3, 528 src: $r("app.media.Footstep4"), 529 name: $r("app.string.display_footstep_on_board"), 530 vibratorFileL: "OnWood_l.json", 531 vibratorFileM: "OnWood_m.json", 532 vibratorFileH: "OnWood_h.json", 533 audioName: "OnWood.wav" 534 }, 535 { 536 id: 4, 537 src: $r("app.media.Footstep5"), 538 name: $r("app.string.display_footstep_on_gravel"), 539 vibratorFileL: "OnGravel_l.json", 540 vibratorFileM: "OnGravel_m.json", 541 vibratorFileH: "OnGravel_h.json", 542 audioName: "OnGravel.wav" 543 }, 544 { 545 id: 5, 546 src: $r("app.media.Footstep6"), 547 name: $r("app.string.display_footstep_on_mud"), 548 vibratorFileL: "OnMud_l.json", 549 vibratorFileM: "OnMud_m.json", 550 vibratorFileH: "OnMud_h.json", 551 audioName: "OnMud.wav" 552 }, 553 { 554 id: 6, 555 src: $r("app.media.Footstep7"), 556 name: $r("app.string.display_footstep_on_snow"), 557 vibratorFileL: "OnSnow_l.json", 558 vibratorFileM: "OnSnow_m.json", 559 vibratorFileH: "OnSnow_h.json", 560 audioName: "OnSnow.wav" 561 }, 562 ] 563 return ImagesDataArray; 564} 565 566export function getImageEnvironmentList(): Array<ImagesData> { 567 let ImagesDataArray: Array<ImagesData> = [ 568 { 569 id: 0, 570 src: $r("app.media.Rain"), 571 name: $r("app.string.display_environment_rain"), 572 vibratorFileL: "Rain_l.json", 573 vibratorFileM: "Rain_m.json", 574 vibratorFileH: "Rain_h.json", 575 audioName: "Rain.wav" 576 }, 577 { 578 id: 1, 579 src: $r("app.media.Snowdrift"), 580 name: $r("app.string.display_environment_snowdrift"), 581 vibratorFileL: "Snowdrift_l.json", 582 vibratorFileM: "Snowdrift_m.json", 583 vibratorFileH: "Snowdrift_h.json", 584 audioName: "Snowdrift.wav" 585 }, 586 { 587 id: 2, 588 src: $r("app.media.Campfire"), 589 name: $r("app.string.display_environment_campfire"), 590 vibratorFileL: "Campfire_l.json", 591 vibratorFileM: "Campfire_m.json", 592 vibratorFileH: "Campfire_h.json", 593 audioName: "Campfire.wav" 594 }, 595 { 596 id: 3, 597 src: $r("app.media.Creek"), 598 name: $r("app.string.display_environment_creek"), 599 vibratorFileL: "Creek_l.json", 600 vibratorFileM: "Creek_m.json", 601 vibratorFileH: "Creek_h.json", 602 audioName: "Creek.wav" 603 }, 604 { 605 id: 4, 606 src: $r("app.media.Wave"), 607 name: $r("app.string.display_environment_wave"), 608 vibratorFileL: "Wave_l.json", 609 vibratorFileM: "Wave_m.json", 610 vibratorFileH: "Wave_h.json", 611 audioName: "Wave.wav" 612 }, 613 { 614 id: 5, 615 src: $r("app.media.Wind"), 616 name: $r("app.string.display_environment_wind"), 617 vibratorFileL: "Wind_l.json", 618 vibratorFileM: "Wind_m.json", 619 vibratorFileH: "Wind_h.json", 620 audioName: "Wind.wav" 621 }, 622 { 623 id: 6, 624 src: $r("app.media.Thunder"), 625 name: $r("app.string.display_environment_thunder"), 626 vibratorFileL: "Thunder_l.json", 627 vibratorFileM: "Thunder_m.json", 628 vibratorFileH: "Thunder_h.json", 629 audioName: "Thunder.wav" 630 }, 631 ] 632 return ImagesDataArray; 633} 634 635export function getImageExerciseList(): Array<ImagesData> { 636 let ImagesDataArray: Array<ImagesData> = [ 637 { 638 id: 0, 639 src: $r("app.media.Badminton"), 640 name: $r("app.string.display_exercise_badminton"), 641 vibratorFileL: "Badminton_l.json", 642 vibratorFileM: "Badminton_m.json", 643 vibratorFileH: "Badminton_h.json", 644 audioName: "Badminton.wav" 645 }, 646 { 647 id: 1, 648 src: $r("app.media.Baseball"), 649 name: $r("app.string.display_exercise_baseball"), 650 vibratorFileL: "Baseball_l.json", 651 vibratorFileM: "Baseball_m.json", 652 vibratorFileH: "Baseball_h.json", 653 audioName: "Baseball.wav" 654 }, 655 { 656 id: 2, 657 src: $r("app.media.Basketball"), 658 name: $r("app.string.display_exercise_basketball"), 659 vibratorFileL: "Basketball_l.json", 660 vibratorFileM: "Basketball_m.json", 661 vibratorFileH: "Basketball_h.json", 662 audioName: "Basketball.wav" 663 }, 664 { 665 id: 3, 666 src: $r("app.media.Skating"), 667 name: $r("app.string.display_exercise_skating"), 668 vibratorFileL: "Skating_l.json", 669 vibratorFileM: "Skating_m.json", 670 vibratorFileH: "Skating_h.json", 671 audioName: "Skating.wav" 672 }, 673 { 674 id: 4, 675 src: $r("app.media.Skiing"), 676 name: $r("app.string.display_exercise_skiing"), 677 vibratorFileL: "Skiing_l.json", 678 vibratorFileM: "Skiing_m.json", 679 vibratorFileH: "Skiing_h.json", 680 audioName: "Skiing.wav" 681 }, 682 { 683 id: 5, 684 src: $r("app.media.TableTennis"), 685 name: $r("app.string.display_exercise_tabletennis"), 686 vibratorFileL: "TableTennis_l.json", 687 vibratorFileM: "TableTennis_m.json", 688 vibratorFileH: "TableTennis_h.json", 689 audioName: "TableTennis.wav" 690 }, 691 { 692 id: 6, 693 src: $r("app.media.Diving"), 694 name: $r("app.string.display_exercise_diving"), 695 vibratorFileL: "Diving_l.json", 696 vibratorFileM: "Diving_m.json", 697 vibratorFileH: "Diving_h.json", 698 audioName: "Diving.wav" 699 }, 700 ] 701 return ImagesDataArray; 702} 703 704export abstract class BaseDataSource<T> implements IDataSource { 705 private mDataSource: T[] = []; 706 707 constructor(dataList: T[]) { 708 this.mDataSource = dataList; 709 } 710 711 totalCount(): number { 712 return this.mDataSource === null ? 0 : this.mDataSource.length 713 } 714 715 getData(index: number): T | null { 716 return index >= 0 && index < this.totalCount() ? this.mDataSource[index] : null; 717 } 718 719 registerDataChangeListener(listener: DataChangeListener) { 720 } 721 722 unregisterDataChangeListener(listener: DataChangeListener) { 723 } 724} 725 726export class ImageDataSource extends BaseDataSource<ImagesData> { 727 constructor(students: ImagesData[]) { 728 super(students) 729 } 730} 731