|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.qotsa.jni.controller.WinampController
public class WinampController
This class is a wrapper to call JNI functions to send Message to Winamp Window.
Field Summary | |
---|---|
static int |
CURRENTTIME
Constant used as parameter in getTime() method Value = 0 |
static int |
ISNOTPLAYING
Constant used as return in getTime() Value = -1 |
static int |
PAUSED
Constant used as return in getStatus() method Value = 3 |
static int |
PLAYING
Constant used as return in getStatus() method Value = 1 |
static int |
STOPPED
Constant used as return in getStatus() method Value = 0 |
static int |
TIMELENGTH
Constant used as parameter in getTime() method Value = 1 |
Constructor Summary | |
---|---|
WinampController()
|
Method Summary | |
---|---|
static void |
appendToPlayList(java.lang.String filename)
Append a File into the List. |
static void |
clearPlayList()
Clear Winamp's internal playlist. |
static void |
decreaseVolume()
Decrease Volume a little bit. |
static void |
decreaseVolumePercent(int percent)
Decrease Volume. |
static void |
exit()
Exit Winamp. |
static void |
fwd5Secs()
Fowards 5 seconds on the current song. |
static void |
fwdTracks(int n)
Fowards n Tracks in Play List. |
static java.lang.String |
getFileNameInList(int pos)
Get Current Track FileName. |
static java.lang.String |
getFileNamePlaying()
Get File Name Playing In Winamp. |
static int |
getListPos()
Get Current List Pos. |
static int |
getPlayListLength()
Return the PlayListLength. |
static int |
getStatus()
Get Winamp Status. |
static int |
getTime(int mode)
Get Song Time. |
static java.lang.String |
getTitle()
Get Current Track Title. |
static void |
increaseVolume()
Increase Volume a little bit. |
static void |
increaseVolumePercent(int percent)
Increase Volume. |
static boolean |
isRepeatStatusOn()
Verify if Repeat is On. |
static boolean |
isShuffleStatusOn()
Verify if Shuffle is On. |
static void |
nextTrack()
Go to Next Track in the play list. |
static void |
pause()
Pause Winamp. |
static void |
play()
Play current file in Winamp. |
static void |
previousTrack()
Go to Previous Track in the play list. |
static void |
refreshPlayListCache()
Flush the playlist cache buffer. |
static void |
restart()
Restarts Winamp. |
static void |
resume()
Resume current file in Winamp. |
static void |
rew5Secs()
Rewinds 5 seconds on the current song. |
static void |
rewTracks(int n)
Rewinds n Tracks in Play List. |
static void |
run()
Verify if Winamp is started and if not started, starts it. |
static void |
setPlaylistPosition(int pos)
Go to a Specified Position in the List. |
static void |
setRepeatStatusOn(boolean mode)
Turn on Repeat. |
static void |
setShuffleStatusOn(boolean mode)
Turn on Shuffle. |
static void |
setVolume(int pos)
Adjust Volume. |
static void |
stop()
Stop current file in Winamp. |
static int |
writePlayListToFile()
Write a Playlist in winampDirInstallation\\Winamp.m3u. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ISNOTPLAYING
public static final int CURRENTTIME
public static final int TIMELENGTH
public static final int STOPPED
public static final int PLAYING
public static final int PAUSED
Constructor Detail |
---|
public WinampController()
Method Detail |
---|
public static void run() throws java.lang.Exception
java.lang.Exception
- When the key HKEY_LOCAL_MACHINE\Software\Clients\Media\Winamp\shell\open\command
is not found in the register. This key is used to find Winamp Directory installation to execute it.public static void exit() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void play() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void stop() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void resume() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void pause() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void previousTrack() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void nextTrack() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void fwd5Secs() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void rew5Secs() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void increaseVolume() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void decreaseVolume() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void increaseVolumePercent(int percent) throws InvalidHandle, InvalidParameter
percent
- Percent to Increase Volume.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If percent not between 0 and 100public static void decreaseVolumePercent(int percent) throws InvalidHandle, InvalidParameter
percent
- Percent to Decrease Volume.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If percent not between 0 and 100public static void setVolume(int pos) throws InvalidHandle, InvalidParameter
pos
- Position to Set Volume.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If pos not between 0 and 255public static void restart() throws InvalidHandle, java.lang.Exception
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
java.lang.Exception
- When failed to restart Winamp.public static void setPlaylistPosition(int pos) throws InvalidHandle, InvalidParameter
pos
- Position.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If pos is negative or greater than List Length.public static void clearPlayList() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void refreshPlayListCache() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static int getPlayListLength() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static int writePlayListToFile() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static boolean isShuffleStatusOn() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static boolean isRepeatStatusOn() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void setRepeatStatusOn(boolean mode) throws InvalidHandle
mode
- True - Turn on Repeat ; False - Turn off Repeat.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void setShuffleStatusOn(boolean mode) throws InvalidHandle
mode
- True - Turn on Shuffle ; False - Turn off Shuffle.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static void appendToPlayList(java.lang.String filename) throws InvalidHandle, InvalidParameter
filename
- FileName to Append in the list.
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If the filename is an invalid path.public static int getStatus() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static int getListPos() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static java.lang.String getTitle() throws InvalidHandle
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)public static java.lang.String getFileNameInList(int pos) throws InvalidHandle, InvalidParameter
pos
- Track Position in the Current PlayList
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- If pos is negative or greater than List Lengthpublic static int getTime(int mode) throws InvalidHandle, InvalidParameter
mode
- CURRENTTIME - Currently Time in Milliseconds
TIMELENGHT - Song Time Length in seconds
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- if parameter is not CURRENTTIME or TIMELENGTH.public static void fwdTracks(int n) throws InvalidParameter, InvalidHandle
n
- Number of Tracks to Foward
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- if n is negative or Zero.public static void rewTracks(int n) throws InvalidParameter, InvalidHandle
n
- Number of Tracks to Rewind
InvalidHandle
- When the Winamp Windows is not handle(in most case, it means that winamp is not running)
InvalidParameter
- if n is negative or Zero.public static java.lang.String getFileNamePlaying() throws InvalidHandle
InvalidHandle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |