File: PlayerModel.java

package info (click to toggle)
freetts 1.2.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 65,244 kB
  • sloc: java: 21,305; xml: 1,340; sh: 969; lisp: 587; ansic: 241; makefile: 25; awk: 11
file content (269 lines) | stat: -rw-r--r-- 6,013 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/**
 * Copyright 2001 Sun Microsystems, Inc.
 * 
 * See the file "license.terms" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL 
 * WARRANTIES.
 */
import javax.swing.ListModel;
import javax.speech.synthesis.SynthesizerModeDesc;

/**
 * Defines the data model used by the GUI of the <code>Player</code>.
 * Defines ways to control volume, speaking rate, pitch and range, etc..
 * Also gives you information such as the list of <code>Synthesizers</code>, 
 * list of <code>Voices</code>, the play list, etc., that the user interface
 * will need. Also allows you to get and play different types of
 * <code>Playable</code> objects.
 */
public interface PlayerModel {

    /**
     * Performs text-to-speech on the given Playable.
     *
     * @param Playable the Playable to perform text-to-speech
     */
    public void play(Playable Playable);


    /**
     * Performs text-to-speech on the object at the given index of
     * the play list.
     *
     * @param index the index of the Playable object on the play list
     */
    public void play(int index);


    /**
     * Returns true if the player is paused.
     *
     * @return <code>true</code> if the player is paused,
     *         <code>false</code> otherwise
     */
    public boolean isPaused();

    
    /**
     * Pauses the player.
     */
    public void pause();
    

    /**
     * Resumes the player.
     */
    public void resume();
        

    /**
     * Stops the player if it is playing.
     */
    public void stop();


    /**
     * Cancels the currently playing item.
     */
    public void cancel();


    /**
     * Sets whether the Monitor is visible.
     *
     * @param visible true to set it to visible
     */
    public void setMonitorVisible(boolean visible);


    /**
     * Tells whether the monitor is visible.
     *
     * @return true if the monitor is visible, false otherwise
     */
    public boolean isMonitorVisible();


    /**
     * Creates the list of synthesizers.
     */
    public void createSynthesizers();
     

    /**
     * Returns the monitor of the synthesizer at the given index.
     *
     * @param index the position of the synthesizer in the synthesizer list
     *
     * @return the monitor of the specified synthesizer
     */
    public Monitor getMonitor(int index);


    /**
     * Returns the monitor of the current synthesizer.
     *
     * @return the monitor of the current synthesizer
     */
    public Monitor getMonitor();


    /**
     * Sets the current monitor.
     *
     * @param monitor the current monitor
     */
    public void setMonitor(Monitor monitor);


    /**
     * Sets the Synthesizer at the given index to use
     *
     * @param index index of the synthesizer in the list
     */
    public void setSynthesizer(int index);

    
    /**
     * Sets the Voice at the given index to use.
     *
     * @param index the index of the voice in the list
     */
    public void setVoice(int index);

        
    /**
     * Sets the list of voices using the given Synthesizer mode description.
     *
     * @param modeDesc the synthesizer mode description
     */
    public void setVoiceList(SynthesizerModeDesc modeDesc);


    /**
     * Returns the volume.
     *
     * @return the volume, or -1 if unknown, or an error occurred
     */
    public float getVolume();

    
    /**
     * Sets the volume.
     *
     * @param volume set the volume of the synthesizer
     *
     * @return true if new volume is set; false otherwise
     */
    public boolean setVolume(float volume);


    /**
     * Returns the speaking rate.
     *
     * @return the speaking rate, or -1 if unknown or an error occurred
     */
    public float getSpeakingRate();

    
    /**
     * Sets the speaking rate in the number of words per minute.
     *
     * @param wordsPerMin the speaking rate
     *
     * @return true if new speaking rate is set; false otherwise
     */
    public boolean setSpeakingRate(float wordsPerMin);


    /**
     * Returns the baseline pitch for the current synthesis voice.
     *
     * @return the baseline pitch for the current synthesis voice
     */
    public float getPitch();


    /**
     * Sets the baseline pitch for the current synthesis voice.
     *
     * @param pitch the baseline pitch
     *
     * @return true if new pitch is set; false otherwise
     */
    public boolean setPitch(float pitch);

    
    /**
     * Returns the pitch range for the current synthesis voice.
     *
     * @return the pitch range for the current synthesis voice
     */
    public float getRange();


    /**
     * Sets the pitch range for the current synthesis voice.
     *
     * @param range the pitch range
     *
     * @return true if new range is set; false otherwise
     */
    public boolean setRange(float range);

         
    /**
     * Returns the play list.
     *
     * @return the play list
     */
    public ListModel getPlayList();


    /**
     * Returns the list of voices of the current synthesizer
     *
     * @return the list of voices
     */
    public ListModel getVoiceList();

    
    /**
     * Returns the list synthesizers.
     *
     * @return the synthesizer list
     */
    public ListModel getSynthesizerList();
    

    /**
     * Returns the Playable object at the given index of the play list.
     *
     * @param index the index of the Playable object on the play list
     *
     * @return the Playable object
     */
    public Object getPlayableAt(int index);


    /**
     * Adds the given Playable object to the end of the play list.
     *
     * @param Playable the Playable object to add
     */
    public void addPlayable(Playable Playable);


    /**
     * Removes the Playable at the given position from the list
     *
     * @param index the index of the Playable to remove
     */
    public void removePlayableAt(int index);


    /**
     * Closes the PlayerModel
     */
    public void close();
}