//# 5 errors, 364 messages
//#
/*
    //#DllSource.java:1:1: class: com.dmdirc.addons.mediasource_windows.DllSource
    //#DllSource.java:1:1: method: com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.mediasource_windows;

import com.dmdirc.addons.nowplaying.MediaSource;
import com.dmdirc.addons.nowplaying.MediaSourceState;

/**
 * Uses WindowsMediaSourcePlugin to retrieve now playing info.
 *
 * @author Shane
 */
public class DllSource implements MediaSource {
	/** Player name */
	private final String playerName;
	
	/** Use getArtistTitle */
	private final boolean useArtistTitle;
		
	
	/**
	 * Instantiates the media source.
	 *
	 * @param playerName Name of Player and DLL
	 */
	public DllSource(final String playerName) {
		this(playerName, false);
    //#DllSource.java:47: method: void com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource(String)
    //#input(void com.dmdirc.addons.mediasource_windows.DllSource(String)): playerName
    //#input(void com.dmdirc.addons.mediasource_windows.DllSource(String)): this
    //#output(void com.dmdirc.addons.mediasource_windows.DllSource(String)): this.playerName
    //#output(void com.dmdirc.addons.mediasource_windows.DllSource(String)): this.useArtistTitle
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String)): this.playerName == playerName
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String)): init'ed(this.playerName)
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String)): this.useArtistTitle == 0
	}
    //#DllSource.java:48: end of method: void com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource(String)
	
	/**
	 * Instantiates the media source.
	 *
	 * @param playerName Name of Player and DLL
	 * @param useArtistTitle True if getArtistTitle should be parsed rather than
	 *                       using getArtist() and getTitle()
	 */
	public DllSource(final String playerName, final boolean useArtistTitle) {
    //#DllSource.java:57: method: void com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource(String, bool)
    //#input(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): playerName
    //#input(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): this
    //#input(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): useArtistTitle
    //#output(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): this.playerName
    //#output(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): this.useArtistTitle
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): this.playerName == playerName
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): init'ed(this.playerName)
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): this.useArtistTitle == useArtistTitle
    //#post(void com.dmdirc.addons.mediasource_windows.DllSource(String, bool)): init'ed(this.useArtistTitle)
		this.playerName = playerName;
		this.useArtistTitle = useArtistTitle;
	}
    //#DllSource.java:60: end of method: void com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource(String, bool)
	
	/** {@inheritDoc} */
    @Override
	public String getAppName() {
		return playerName;
    //#DllSource.java:65: method: String com.dmdirc.addons.mediasource_windows.DllSource.getAppName()
    //#input(String getAppName()): this
    //#input(String getAppName()): this.playerName
    //#output(String getAppName()): return_value
    //#post(String getAppName()): return_value == this.playerName
    //#post(String getAppName()): init'ed(return_value)
    //#DllSource.java:65: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getAppName()
	}
	
	/**
	 * Get the "goodoutput" from GetMediaInfo for the given command
	 *
	 * @param command Command to run
	 * @return "Good" Output
	 */
	private String getOutput(final String command) {
		return WindowsMediaSourcePlugin.getOutput(playerName, command).getGoodOutput();
    //#DllSource.java:75: method: String com.dmdirc.addons.mediasource_windows.DllSource.getOutput(String)
    //#input(String getOutput(String)): "GetMediaInfo.exe"._tainted
    //#input(String getOutput(String)): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getOutput(String)): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getOutput(String)): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getOutput(String)): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getOutput(String)): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getOutput(String)): command
    //#input(String getOutput(String)): this
    //#input(String getOutput(String)): this.playerName
    //#output(String getOutput(String)): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getOutput(String)): return_value
    //#new obj(String getOutput(String)): java.lang.StringBuffer:toString(...)
    //#presumption(String getOutput(String)): getOutput(...).__Tag == com/dmdirc/addons/mediasource_windows/MediaInfoOutput
    //#post(String getOutput(String)): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getOutput(String)): init'ed(return_value)
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getOutput(String)): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getOutput(String)): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getOutput(String)): Effects-of-calling:java.lang.StringBuffer:toString
    //#DllSource.java:75: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getOutput(String)
	}
	
	/** {@inheritDoc} */
	@Override
	public MediaSourceState getState() {
		final MediaInfoOutput result = WindowsMediaSourcePlugin.getOutput(playerName, "getPlayState");
    //#DllSource.java:81: method: MediaSourceState com.dmdirc.addons.mediasource_windows.DllSource.getState()
    //#DllSource.java:81: Warning: unused assignment in callee
    //#    Unused assignment to (java.lang.StringBuffer:toString(...)._tainted) in getOutput
    //#    severity: LOW
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: MediaSourceState getState()
    //#input(MediaSourceState getState()): "GetMediaInfo.exe"._tainted
    //#input(MediaSourceState getState()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(MediaSourceState getState()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(MediaSourceState getState()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(MediaSourceState getState()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(MediaSourceState getState()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(MediaSourceState getState()): com/dmdirc/addons/nowplaying/MediaSourceState.CLOSED
    //#input(MediaSourceState getState()): com/dmdirc/addons/nowplaying/MediaSourceState.NOTKNOWN
    //#input(MediaSourceState getState()): com/dmdirc/addons/nowplaying/MediaSourceState.PAUSED
    //#input(MediaSourceState getState()): com/dmdirc/addons/nowplaying/MediaSourceState.PLAYING
    //#input(MediaSourceState getState()): com/dmdirc/addons/nowplaying/MediaSourceState.STOPPED
    //#input(MediaSourceState getState()): this
    //#input(MediaSourceState getState()): this.playerName
    //#output(MediaSourceState getState()): return_value
    //#presumption(MediaSourceState getState()): result.__Tag == com/dmdirc/addons/mediasource_windows/MediaInfoOutput
    //#presumption(MediaSourceState getState()): result.output != null
    //#post(MediaSourceState getState()): return_value in Addr_Set{&com.dmdirc.addons.nowplaying.MediaSourceState__static_init.new MediaSourceState(MediaSourceState__static_init#1),&com.dmdirc.addons.nowplaying.MediaSourceState__static_init.new MediaSourceState(MediaSourceState__static_init#5),&com.dmdirc.addons.nowplaying.MediaSourceState__static_init.new MediaSourceState(MediaSourceState__static_init#3),&com.dmdirc.addons.nowplaying.MediaSourceState__static_init.new MediaSourceState(MediaSourceState__static_init#4),&com.dmdirc.addons.nowplaying.MediaSourceState__static_init.new MediaSourceState(MediaSourceState__static_init#2)}
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(MediaSourceState getState()): Effects-of-calling:java.lang.StringBuffer:toString
    //#test_vector(MediaSourceState getState()): java.lang.String:equalsIgnoreCase(...)@85: {0}, {1}
    //#test_vector(MediaSourceState getState()): java.lang.String:equalsIgnoreCase(...)@87: {0}, {1}
    //#test_vector(MediaSourceState getState()): java.lang.String:equalsIgnoreCase(...)@89: {0}, {1}
    //#test_vector(MediaSourceState getState()): result.exitCode: {-2_147_483_648..-1, 1..4_294_967_295}, {0}
		
		if (result.getExitCode() == 0) {
			final String output = result.getGoodOutput();
			if (output.equalsIgnoreCase("stopped")) {
				return MediaSourceState.STOPPED;
			} else if (output.equalsIgnoreCase("playing")) {
				return MediaSourceState.PLAYING;
			} else if (output.equalsIgnoreCase("paused")) {
				return MediaSourceState.PAUSED;
			} else {
				return MediaSourceState.NOTKNOWN;
			}
		} else {
			return MediaSourceState.CLOSED;
    //#DllSource.java:95: end of method: MediaSourceState com.dmdirc.addons.mediasource_windows.DllSource.getState()
		}
	}
	
	/** {@inheritDoc} */
    @Override
	public String getArtist() {
		if (useArtistTitle) {
    //#DllSource.java:102: method: String com.dmdirc.addons.mediasource_windows.DllSource.getArtist()
    //#input(String getArtist()): ""._tainted
    //#input(String getArtist()): "Error executing GetMediaInfo.exe"._tainted
    //#input(String getArtist()): "GetMediaInfo.exe"._tainted
    //#input(String getArtist()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getArtist()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getArtist()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getArtist()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getArtist()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getArtist()): this
    //#input(String getArtist()): this.playerName
    //#input(String getArtist()): this.useArtistTitle
    //#output(String getArtist()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getArtist()): return_value
    //#new obj(String getArtist()): java.lang.StringBuffer:toString(...)
    //#presumption(String getArtist()): getOutput(...)@103 init'ed
    //#post(String getArtist()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getArtist()): possibly_updated(return_value)
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getArtist()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getArtist()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getArtist()): Effects-of-calling:java.lang.StringBuffer:toString
    //#test_vector(String getArtist()): this.useArtistTitle: {0}, {1}
			return getOutput("getArtistTitle").split("\\s-\\s", 2)[0];
    //#DllSource.java:103: ?null dereference
    //#    getOutput(...) != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getArtist()
    //#    basic block: bb_2
    //#    assertion: getOutput(...) != null
    //#    VN: getOutput(...)
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
    //#DllSource.java:103: ?use of default init
    //#    init'ed(java/lang/String:split(...).length)
    //#    severity: LOW
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getArtist()
    //#    basic block: bb_2
    //#    assertion: init'ed(java/lang/String:split(...).length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
    //#DllSource.java:103: ?use of default init
    //#    init'ed(java/lang/String:split(...)[0])
    //#    severity: SUPPRESSED
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getArtist()
    //#    basic block: bb_2
    //#    assertion: init'ed(java/lang/String:split(...)[0])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
		} else {
			return getOutput("getArtist");
    //#DllSource.java:105: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getArtist()
		}
	}
	
	/** {@inheritDoc} */
    @Override
	public String getTitle() {
		if (useArtistTitle) {
    //#DllSource.java:112: method: String com.dmdirc.addons.mediasource_windows.DllSource.getTitle()
    //#input(String getTitle()): ""._tainted
    //#input(String getTitle()): "Error executing GetMediaInfo.exe"._tainted
    //#input(String getTitle()): "GetMediaInfo.exe"._tainted
    //#input(String getTitle()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getTitle()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getTitle()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getTitle()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getTitle()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getTitle()): this
    //#input(String getTitle()): this.playerName
    //#input(String getTitle()): this.useArtistTitle
    //#output(String getTitle()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getTitle()): return_value
    //#new obj(String getTitle()): java.lang.StringBuffer:toString(...)
    //#presumption(String getTitle()): getOutput(...)@113 init'ed
    //#post(String getTitle()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getTitle()): init'ed(return_value)
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getTitle()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getTitle()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getTitle()): Effects-of-calling:java.lang.StringBuffer:toString
    //#test_vector(String getTitle()): this.useArtistTitle: {0}, {1}
			String bits[] = getOutput("getArtistTitle").split("\\s-\\s", 2);
    //#DllSource.java:113: ?null dereference
    //#    getOutput(...) != null
    //#    severity: MEDIUM
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getTitle()
    //#    basic block: bb_2
    //#    assertion: getOutput(...) != null
    //#    VN: getOutput(...)
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad
			return (bits.length > 1) ? bits[1] : "";
    //#DllSource.java:114: ?use of default init
    //#    init'ed(bits.length)
    //#    severity: LOW
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getTitle()
    //#    basic block: bb_2
    //#    assertion: init'ed(bits.length)
    //#    VN: undefined
    //#    Expected: {-Inf..+Inf}
    //#    Bad: {Invalid}
    //#    Attribs:  Int  Bad only invalid
		} else {
			return getOutput("getTitle");
    //#DllSource.java:116: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getTitle()
		}
	}
	
	/** {@inheritDoc} */
    @Override
	public String getAlbum() {
		return getOutput("getAlbum");
    //#DllSource.java:123: method: String com.dmdirc.addons.mediasource_windows.DllSource.getAlbum()
    //#input(String getAlbum()): "GetMediaInfo.exe"._tainted
    //#input(String getAlbum()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getAlbum()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getAlbum()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getAlbum()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getAlbum()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getAlbum()): this
    //#input(String getAlbum()): this.playerName
    //#output(String getAlbum()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getAlbum()): return_value
    //#new obj(String getAlbum()): java.lang.StringBuffer:toString(...)
    //#post(String getAlbum()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getAlbum()): init'ed(return_value)
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getAlbum()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getAlbum()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getAlbum()): Effects-of-calling:java.lang.StringBuffer:toString
    //#DllSource.java:123: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getAlbum()
	}
	
	/**
	 * Get the duration in seconds as a string.
	 *
	 * @param secondsInput to get duration for
	 * @return Duration as a string
	 */
	private String duration(final long secondsInput) {
		final StringBuilder result = new StringBuilder();
    //#DllSource.java:133: method: String com.dmdirc.addons.mediasource_windows.DllSource.duration(long)
    //#input(String duration(long)): ":"._tainted
    //#input(String duration(long)): secondsInput
    //#output(String duration(long)): java.lang.StringBuilder:toString(...)._tainted
    //#output(String duration(long)): return_value
    //#new obj(String duration(long)): java.lang.StringBuilder:toString(...)
    //#post(String duration(long)): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String duration(long)): return_value == &java.lang.StringBuilder:toString(...)
    //#test_vector(String duration(long)): secondsInput: {-9_223_372_036_854_775_808..3_599}, {3_600..18_446_744_073_709_551_615}
    //#test_vector(String duration(long)): secondsInput/3_600: {-2_562_047_788_015_215..0}, {1..5_124_095_576_030_431}
    //#test_vector(String duration(long)): secondsInput/60: {-153_722_867_280_912_930..59}, {60..307_445_734_561_825_860}
		final long hours = (secondsInput / 3600);
		final long minutes = (secondsInput / 60 % 60);
		final long seconds = (secondsInput % 60);
		
		if (hours > 0) { result.append(hours+":"); }
		result.append(String.format("%0,2d:%0,2d",minutes,seconds));
		
		return result.toString();
    //#DllSource.java:141: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.duration(long)
	}
	
	/** {@inheritDoc} */
    @Override
	public String getLength() {
		try {
			final int seconds = Integer.parseInt(getOutput("getLength"));
    //#DllSource.java:148: method: String com.dmdirc.addons.mediasource_windows.DllSource.getLength()
    //#DllSource.java:148: Warning: unused assignment in callee
    //#    Unused assignment to (java.lang.StringBuffer:toString(...)._tainted) in getOutput
    //#    severity: LOW
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getLength()
    //#input(String getLength()): ":"._tainted
    //#input(String getLength()): "GetMediaInfo.exe"._tainted
    //#input(String getLength()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getLength()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getLength()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getLength()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getLength()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getLength()): this
    //#input(String getLength()): this.playerName
    //#output(String getLength()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getLength()): return_value
    //#new obj(String getLength()): java.lang.StringBuilder:toString(...)
    //#post(String getLength()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getLength()): return_value in Addr_Set{&java.lang.StringBuilder:toString(...),&"Unknown"}
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Long:valueOf
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.String:format
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getLength()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getLength()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getLength()): Effects-of-calling:java.lang.StringBuffer:toString
			return duration(seconds);
		} catch (NumberFormatException nfe) { }
		return "Unknown";
    //#DllSource.java:151: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getLength()
	}
	
	/** {@inheritDoc} */
    @Override
	public String getTime() {
		try {
			final int seconds = Integer.parseInt(getOutput("getTime"));
    //#DllSource.java:158: method: String com.dmdirc.addons.mediasource_windows.DllSource.getTime()
    //#DllSource.java:158: Warning: unused assignment in callee
    //#    Unused assignment to (java.lang.StringBuffer:toString(...)._tainted) in getOutput
    //#    severity: LOW
    //#    class: com.dmdirc.addons.mediasource_windows.DllSource
    //#    method: String getTime()
    //#input(String getTime()): ":"._tainted
    //#input(String getTime()): "GetMediaInfo.exe"._tainted
    //#input(String getTime()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getTime()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getTime()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getTime()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getTime()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getTime()): this
    //#input(String getTime()): this.playerName
    //#output(String getTime()): java.lang.StringBuilder:toString(...)._tainted
    //#output(String getTime()): return_value
    //#new obj(String getTime()): java.lang.StringBuilder:toString(...)
    //#post(String getTime()): java.lang.StringBuilder:toString(...)._tainted == 0
    //#post(String getTime()): return_value in Addr_Set{&java.lang.StringBuilder:toString(...),&"Unknown"}
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Long:valueOf
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.String:format
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getTime()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getTime()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getTime()): Effects-of-calling:java.lang.StringBuffer:toString
			return duration(seconds);
		} catch (NumberFormatException nfe) { }
		return "Unknown";
    //#DllSource.java:161: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getTime()
	}
	
	/** {@inheritDoc} */
    @Override
	public String getFormat() {
		return getOutput("getFormat");
    //#DllSource.java:167: method: String com.dmdirc.addons.mediasource_windows.DllSource.getFormat()
    //#input(String getFormat()): "GetMediaInfo.exe"._tainted
    //#input(String getFormat()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getFormat()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getFormat()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getFormat()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getFormat()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getFormat()): this
    //#input(String getFormat()): this.playerName
    //#output(String getFormat()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getFormat()): return_value
    //#new obj(String getFormat()): java.lang.StringBuffer:toString(...)
    //#post(String getFormat()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getFormat()): init'ed(return_value)
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getFormat()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getFormat()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getFormat()): Effects-of-calling:java.lang.StringBuffer:toString
    //#DllSource.java:167: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getFormat()
	}
	
	/** {@inheritDoc} */
    @Override
	public String getBitrate() {
		return getOutput("getBitrate");
    //#DllSource.java:173: method: String com.dmdirc.addons.mediasource_windows.DllSource.getBitrate()
    //#input(String getBitrate()): "GetMediaInfo.exe"._tainted
    //#input(String getBitrate()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[com/dmdirc/addons/mediasource_windows/MediaInfoOutput]
    //#input(String getBitrate()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Descendant_Table[others]
    //#input(String getBitrate()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getExitCode()I
    //#input(String getBitrate()): com/dmdirc/addons/mediasource_windows/MediaInfoOutput.__Dispatch_Table.getGoodOutput()Ljava/lang/String;
    //#input(String getBitrate()): com/dmdirc/addons/mediasource_windows/WindowsMediaSourcePlugin.filesDir
    //#input(String getBitrate()): this
    //#input(String getBitrate()): this.playerName
    //#output(String getBitrate()): java.lang.StringBuffer:toString(...)._tainted
    //#output(String getBitrate()): return_value
    //#new obj(String getBitrate()): java.lang.StringBuffer:toString(...)
    //#post(String getBitrate()): java.lang.StringBuffer:toString(...)._tainted == 0
    //#post(String getBitrate()): init'ed(return_value)
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Runtime:getRuntime
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Runtime:exec
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.StringBuffer
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Process:getErrorStream
    //#unanalyzed(String getBitrate()): Effects-of-calling:com.dmdirc.installer.StreamReader
    //#unanalyzed(String getBitrate()): Effects-of-calling:com.dmdirc.installer.StreamReader:start
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Process:getInputStream
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Process:waitFor
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.Process:exitValue
    //#unanalyzed(String getBitrate()): Effects-of-calling:java.lang.StringBuffer:toString
    //#DllSource.java:173: end of method: String com.dmdirc.addons.mediasource_windows.DllSource.getBitrate()
	}
}
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Descendant_Table[com/dmdirc/addons/mediasource_windows/DllSource]
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.duration(J)Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getAlbum()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getAppName()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getArtist()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getBitrate()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getFormat()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getLength()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getOutput(Ljava/lang/String;)Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getState()Lcom/dmdirc/addons/nowplaying/MediaSourceState;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getTime()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#output(com.dmdirc.addons.mediasource_windows.DllSource__static_init): com/dmdirc/addons/nowplaying/MediaSource.__Descendant_Table[com/dmdirc/addons/mediasource_windows/DllSource]
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Descendant_Table[com/dmdirc/addons/mediasource_windows/DllSource] == &__Dispatch_Table
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): com/dmdirc/addons/nowplaying/MediaSource.__Descendant_Table[com/dmdirc/addons/mediasource_windows/DllSource] == &__Dispatch_Table
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.duration(J)Ljava/lang/String; == &duration
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getAlbum()Ljava/lang/String; == &getAlbum
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getAppName()Ljava/lang/String; == &getAppName
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getArtist()Ljava/lang/String; == &getArtist
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getBitrate()Ljava/lang/String; == &getBitrate
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getFormat()Ljava/lang/String; == &getFormat
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getLength()Ljava/lang/String; == &getLength
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getOutput(Ljava/lang/String;)Ljava/lang/String; == &getOutput
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getState()Lcom/dmdirc/addons/nowplaying/MediaSourceState; == &getState
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getTime()Ljava/lang/String; == &getTime
    //#post(com.dmdirc.addons.mediasource_windows.DllSource__static_init): __Dispatch_Table.getTitle()Ljava/lang/String; == &getTitle
    //#DllSource.java:: end of method: com.dmdirc.addons.mediasource_windows.DllSource.com.dmdirc.addons.mediasource_windows.DllSource__static_init
    //#DllSource.java:: end of class: com.dmdirc.addons.mediasource_windows.DllSource
