📄 nullmusicplayer.java
字号:
/*
* Light And Shadow. A Persistent Universe based on Robert Jordan's Wheel of Time Books.
* Copyright (C) 2001-2002 WOTLAS Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package wotlas.libs.sound;
import java.util.Properties;
/** Null Music Player. Does Nothing.
*
* @author Aldiss
*/
public class NullMusicPlayer implements MusicPlayer {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** Constructor.
*/
public NullMusicPlayer() {
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To init the music player. The resource locator can be used to get a stream on
* a music file.
* @param props properties for init.
* @param resourceLocator to locate music resources.
*/
public void init( Properties props, MusicResourceLocator resourceLocator ) {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** Closes this music player.
*/
public void close() {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To play a music.
* @param musicName music file name in the music database.
* we'll search the file via the resourceLocator.
*/
public void playMusic( String musicName ) {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** Stops the current music.
*/
public void stopMusic() {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** Resume the current music or restarts the current music.
*/
public void resumeMusic() {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the music volume in [0, 100].
* @return the music volume.
*/
public short getMusicVolume() {
return 0;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set the music volume.
* @param volume new volume in [0,100]
*/
public void setMusicVolume(short musicVolume) {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** Tells if we want the player to play music or just ignore music 'play' requests.
* @return true if we must ignore music play requests
*/
public boolean getNoMusicState() {
return true;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To set/unset the "No Music" state option.
* @param noMusicState true if requests to play music must be ignored, false to play music
* when asked to.
*/
public void setNoMusicState( boolean noMusicState ) {}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
/** To get the name of this music player.
*/
public String getMusicPlayerName() {
return "No Music Player";
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -