~sladen/openbve/openbve2

« back to all changes in this revision

Viewing changes to Standard.Sound.Wav/Interfaces.cs

  • Committer: Paul Sladen
  • Author(s): Michelle Boucquemont
  • Date: 2010-03-17 04:04:44 UTC
  • Revision ID: git-v1:c9050dde4c55fe2b9c257080653cee1a07c91303
import openbve2.zip (2010-03-14)

You will find a settings.cfg file where you can configure a series of
options and also which route or object to load. The options are
explained briefly via the comments in the settings.cfg file itself.
Select any route or object you want, but mind the following limitations:

* Background images and fog are not yet supported. Only a background
  color will be shown.
* Animated objects are not yet supported. This includes signals. These
  objects are not shown at all.
* Glow is not yet supported. All objects using glow will always show at
  full intensity instead of fading in.
* The legacy visibility system (where objects are disposed of as soon as
  the CSV/RW block the object was placed in has been passed by the camera)
  is not yet supported, only the new 2D grid is.

In-game, you can use the arrow, the WASD and the PageUp and PageDown keys to move and rotate around. Hold down the shift, control or alt key for faster movement. There is no way for you to jump to specific "track positions" as the new program does not have something like them internally. Also, you cannot jump to stations in any way at the moment. The initial position of the camera is the first stop point, though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
using System;
2
 
using System.Text;
3
 
using OpenBveApi;
4
 
 
5
 
namespace Plugin {
6
 
 
7
 
        // host interface
8
 
        internal static class Interfaces {
9
 
                internal static IHost Host = null;
10
 
        }
11
 
        
12
 
        // plugin interface
13
 
        /// <summary>Exposes version 1.0 of the interface to be implemented by a plugin.</summary>
14
 
        public class Plugin : IPlugin10 {
15
 
 
16
 
 
17
 
                // --- general ---
18
 
                
19
 
                /// <summary>Is called when the plugin is loaded.</summary>
20
 
                /// <param name="hosts">A list of versions of the host interface as used for callbacks.</param>
21
 
                /// <returns>A boolean indicating whether the plugin was successfully loaded.</returns>
22
 
                /// <remarks>A plugin should make use of the smallest version the host interface provides as possible. If the plugin expects a certain version that is not supplied by the host application, this operation should return as unsuccessful.</remarks>
23
 
                public bool Load(IHost[] hosts) {
24
 
                        return true;
25
 
                }
26
 
                
27
 
                /// <summary>Is called when the plugin is unloaded.</summary>
28
 
                public void Unload() { }
29
 
                
30
 
                
31
 
                // --- textures ---
32
 
 
33
 
                /// <summary>Returns whether the plugin is capable of loading textures.</summary>
34
 
                /// <returns>A boolean indicating whether the plugin is capable of loading textures.</returns>
35
 
                public bool CanLoadTextures() {
36
 
                        return false;
37
 
                }
38
 
                
39
 
                /// <summary>Returns whether the plugin is capable of loading the specified texture.</summary>
40
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
41
 
                /// <param name="path">The absolute path of the file or folder where the texture is stored.</param>
42
 
                /// <param name="encoding">The suggested encoding in case the texture format does not mandate a specific encoding.</param>
43
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
44
 
                /// <returns>The priority at which the plugin supports loading the specified texture.</returns>
45
 
                public General.Priority CanLoadTexture(Path.PathType type, string path, Encoding encoding, object data) {
46
 
                        return General.Priority.NotCapable;
47
 
                }
48
 
                
49
 
                /// <summary>Loads a texture into an output parameter and returns the success of the operation.</summary>
50
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
51
 
                /// <param name="path">The absolute path of the file or folder where the texture is stored.</param>
52
 
                /// <param name="encoding">The suggested encoding in case the texture format does not mandate a specific encoding.</param>
53
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
54
 
                /// <param name="texture">Receives the texture.</param>
55
 
                /// <returns>The success of the operation.</returns>
56
 
                public General.Result LoadTexture(Path.PathType type, string path, Encoding encoding, object data, out Texture.TextureData texture) {
57
 
                        texture = null;
58
 
                        return General.Result.NotSupported;
59
 
                }
60
 
                
61
 
                
62
 
                // --- objects ---
63
 
                
64
 
                /// <summary>Returns whether the plugin is capable of loading objects.</summary>
65
 
                /// <returns>A boolean indicating whether the plugin is capable of loading objects.</returns>
66
 
                public bool CanLoadObjects() {
67
 
                        return false;
68
 
                }
69
 
                
70
 
                /// <summary>Returns whether the plugin is capable of loading the specified object.</summary>
71
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
72
 
                /// <param name="path">The absolute path of the file or folder where the object is stored.</param>
73
 
                /// <param name="encoding">The suggested encoding in case the object format does not mandate a specific encoding.</param>
74
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
75
 
                /// <returns>The priority at which the plugin supports loading the specified object.</returns>
76
 
                public General.Priority CanLoadObject(Path.PathType type, string path, Encoding encoding, object data) {
77
 
                        return General.Priority.NotCapable;
78
 
                }
79
 
                
80
 
                /// <summary>Loads an object into an output parameter and returns the success of the operation.</summary>
81
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
82
 
                /// <param name="path">The absolute path of the file or folder where the object is stored.</param>
83
 
                /// <param name="encoding">The suggested encoding in case the object format does not mandate a specific encoding.</param>
84
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
85
 
                /// <param name="obj">Receives the object.</param>
86
 
                /// <returns>The success of the operation.</returns>
87
 
                public General.Result LoadObject(Path.PathType type, string path, Encoding encoding, object data, out Geometry.GenericObject obj) {
88
 
                        obj = null;
89
 
                        return General.Result.NotSupported;
90
 
                }
91
 
                
92
 
                
93
 
                // --- sounds ---
94
 
                
95
 
                /// <summary>Returns whether the plugin is capable of loading sounds.</summary>
96
 
                /// <returns>A boolean indicating whether the plugin is capable of loading sounds.</returns>
97
 
                public bool CanLoadSounds() {
98
 
                        return true;
99
 
                }
100
 
                
101
 
                /// <summary>Returns whether the plugin is capable of loading the specified sound.</summary>
102
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
103
 
                /// <param name="path">The absolute path of the file or folder where the sound is stored.</param>
104
 
                /// <param name="encoding">The suggested encoding in case the sound format does not mandate a specific encoding.</param>
105
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
106
 
                /// <returns>The priority at which the plugin supports loading the specified sound.</returns>
107
 
                public General.Priority CanLoadSound(Path.PathType type, string path, Encoding encoding, object data) {
108
 
                        if (type != Path.PathType.File) {
109
 
                                return General.Priority.NotCapable;
110
 
                        } else {
111
 
                                if (string.Equals(System.IO.Path.GetExtension(path), ".wav", StringComparison.OrdinalIgnoreCase)) {
112
 
                                        return General.Priority.Normal;
113
 
                                } else {
114
 
                                        return General.Priority.NotCapable;
115
 
                                }
116
 
                        }
117
 
                }
118
 
                
119
 
                /// <summary>Loads a sound into an output parameter and returns the success of the operation.</summary>
120
 
                /// <param name="type">The type of the path, i.e. a file or a folder.</param>
121
 
                /// <param name="path">The absolute path of the file or folder where the sound is stored.</param>
122
 
                /// <param name="encoding">The suggested encoding in case the sound format does not mandate a specific encoding.</param>
123
 
                /// <param name="data">Optional data passed from another plugin. If you access this field, you must check the type before casting to that type.</param>
124
 
                /// <param name="sound">Receives the sound.</param>
125
 
                /// <returns>The success of the operation.</returns>
126
 
                public General.Result LoadSound(Path.PathType type, string path, Encoding encoding, object data, out Sound.SoundData sound) {
127
 
                        return WaveParser.LoadFromFile(path, out sound);
128
 
 
129
 
                }
130
 
 
131
 
        }
132
 
}
 
 
b'\\ No newline at end of file'