1 using System; 2 using Prism.Mvvm; 3 using TrainEditor2.Extensions; 4 5 namespace TrainEditor2.Models.Sounds 6 { 7 internal enum BrakeKey 8 { 9 [StringValue("Bc Release High", "ReleaseHigh")] 10 BcReleaseHigh, 11 12 [StringValue("Bc Release", "Release")] 13 BcRelease, 14 15 [StringValue("Bc Release Full", "ReleaseFull")] 16 BcReleaseFull, 17 18 [StringValue("Emergency")] 19 Emergency, 20 21 [StringValue("BP Decomp", "Application")] 22 BpDecomp 23 } 24 25 internal enum BrakeHandleKey 26 { 27 [StringValue("Apply")] 28 Apply, 29 30 [StringValue("ApplyFast")] 31 ApplyFast, 32 33 [StringValue("Release")] 34 Release, 35 36 [StringValue("ReleaseFast")] 37 ReleaseFast, 38 39 [StringValue("Min", "Minimum")] 40 Min, 41 42 [StringValue("Max", "Maximum")] 43 Max 44 } 45 46 internal enum BreakerKey 47 { 48 [StringValue("On")] 49 On, 50 51 [StringValue("Off")] 52 Off 53 } 54 55 internal enum BuzzerKey 56 { 57 [StringValue("Correct")] 58 Correct 59 } 60 61 internal enum CompressorKey 62 { 63 [StringValue("Attack", "Start")] 64 Attack, 65 66 [StringValue("Loop")] 67 Loop, 68 69 [StringValue("Release", "Stop", "End")] 70 Release 71 } 72 73 internal enum DoorKey 74 { 75 [StringValue("Open Left", "OpenLeft", "LeftOpen")] 76 OpenLeft, 77 78 [StringValue("Close Left", "CloseLeft", "LeftClose")] 79 CloseLeft, 80 81 [StringValue("Open Right", "OpenRight", "RightOpen")] 82 OpenRight, 83 84 [StringValue("Close Right", "CloseRight", "RightClose")] 85 CloseRight 86 } 87 88 internal enum HornKey 89 { 90 [StringValue("Start")] 91 Start, 92 93 [StringValue("Loop")] 94 Loop, 95 96 [StringValue("End", "Release", "Stop")] 97 End 98 } 99 100 internal enum MasterControllerKey 101 { 102 [StringValue("Up", "Increase")] 103 Up, 104 105 [StringValue("UpFast", "IncreaseFast")] 106 UpFast, 107 108 [StringValue("Down", "Decrease")] 109 Down, 110 111 [StringValue("DownFast", "DecreaseFast")] 112 DownFast, 113 114 [StringValue("Min", "Minimum")] 115 Min, 116 117 [StringValue("Max", "Maximum")] 118 Max 119 } 120 121 internal enum OthersKey 122 { 123 [StringValue("Noise")] 124 Noise, 125 126 [StringValue("Shoe")] 127 Shoe, 128 129 [StringValue("Halt")] 130 Halt 131 } 132 133 internal enum PilotLampKey 134 { 135 [StringValue("On")] 136 On, 137 138 [StringValue("Off")] 139 Off 140 } 141 142 internal enum RequestStopKey 143 { 144 [StringValue("Stop")] 145 Stop, 146 147 [StringValue("Pass")] 148 Pass, 149 150 [StringValue("Ignored")] 151 Ignored 152 } 153 154 internal enum ReverserKey 155 { 156 [StringValue("On")] 157 On, 158 159 [StringValue("Off")] 160 Off 161 } 162 163 internal enum SuspensionKey 164 { 165 [StringValue("Left")] 166 Left, 167 168 [StringValue("Right")] 169 Right 170 } 171 172 internal abstract class SoundElement : BindableBase, ICloneable 173 { 174 protected object key; 175 protected string filePath; 176 protected bool definedPosition; 177 protected double positionX; 178 protected double positionY; 179 protected double positionZ; 180 protected bool definedRadius; 181 protected double radius; 182 183 internal object Key 184 { 185 get 186 { 187 return key; 188 } 189 set 190 { 191 SetProperty(ref key, value); 192 } 193 } 194 195 internal string FilePath 196 { 197 get 198 { 199 return filePath; 200 } 201 set 202 { 203 SetProperty(ref filePath, value); 204 } 205 } 206 207 internal bool DefinedPosition 208 { 209 get 210 { 211 return definedPosition; 212 } 213 set 214 { 215 SetProperty(ref definedPosition, value); 216 } 217 } 218 219 internal double PositionX 220 { 221 get 222 { 223 return positionX; 224 } 225 set 226 { 227 SetProperty(ref positionX, value); 228 } 229 } 230 231 internal double PositionY 232 { 233 get 234 { 235 return positionY; 236 } 237 set 238 { 239 SetProperty(ref positionY, value); 240 } 241 } 242 243 internal double PositionZ 244 { 245 get 246 { 247 return positionZ; 248 } 249 set 250 { 251 SetProperty(ref positionZ, value); 252 } 253 } 254 255 internal bool DefinedRadius 256 { 257 get 258 { 259 return definedRadius; 260 } 261 set 262 { 263 SetProperty(ref definedRadius, value); 264 } 265 } 266 267 internal double Radius 268 { 269 get 270 { 271 return radius; 272 } 273 set 274 { 275 SetProperty(ref radius, value); 276 } 277 } 278 Clone()279 public object Clone() 280 { 281 return MemberwiseClone(); 282 } 283 } 284 285 internal abstract class SoundElement<T> : SoundElement 286 { 287 internal new T Key 288 { 289 get 290 { 291 return (T)key; 292 } 293 set 294 { 295 SetProperty(ref key, value); 296 } 297 } 298 SoundElement()299 internal SoundElement() 300 { 301 Key = default(T); 302 } 303 } 304 305 internal class RunElement : SoundElement<int> 306 { 307 } 308 309 internal class FlangeElement : SoundElement<int> 310 { 311 } 312 313 internal class MotorElement : SoundElement<int> 314 { 315 } 316 317 internal class FrontSwitchElement : SoundElement<int> 318 { 319 } 320 321 internal class RearSwitchElement : SoundElement<int> 322 { 323 } 324 325 internal class BrakeElement : SoundElement<BrakeKey> 326 { 327 } 328 329 internal class CompressorElement : SoundElement<CompressorKey> 330 { 331 } 332 333 internal class SuspensionElement : SoundElement<SuspensionKey> 334 { 335 } 336 337 internal class PrimaryHornElement : SoundElement<HornKey> 338 { 339 } 340 341 internal class SecondaryHornElement : SoundElement<HornKey> 342 { 343 } 344 345 internal class MusicHornElement : SoundElement<HornKey> 346 { 347 } 348 349 internal class DoorElement : SoundElement<DoorKey> 350 { 351 } 352 353 internal class AtsElement : SoundElement<int> 354 { 355 } 356 357 internal class BuzzerElement : SoundElement<BuzzerKey> 358 { 359 } 360 361 internal class PilotLampElement : SoundElement<PilotLampKey> 362 { 363 } 364 365 internal class BrakeHandleElement : SoundElement<BrakeHandleKey> 366 { 367 } 368 369 internal class MasterControllerElement : SoundElement<MasterControllerKey> 370 { 371 } 372 373 internal class ReverserElement : SoundElement<ReverserKey> 374 { 375 } 376 377 internal class BreakerElement : SoundElement<BreakerKey> 378 { 379 } 380 381 internal class RequestStopElement : SoundElement<RequestStopKey> 382 { 383 } 384 385 internal class TouchElement : SoundElement<int> 386 { 387 } 388 389 internal class OthersElement : SoundElement<OthersKey> 390 { 391 } 392 } 393