Package javazoom.jlgui.basicplayer

Examples of javazoom.jlgui.basicplayer.BasicPlayer


    /**
     * Instantiate low-level player.
     */
    public void loadJS()
    {
        BasicPlayer bplayer = new BasicPlayer();
        List mixers = bplayer.getMixers();
        if (mixers != null)
        {
            Iterator it = mixers.iterator();
            String mixer = config.getAudioDevice();
            boolean mixerFound = false;
            if ((mixer != null) && (mixer.length() > 0))
            {
                // Check if mixer is valid.
                while (it.hasNext())
                {
                    if (((String) it.next()).equals(mixer))
                    {
                        bplayer.setMixerName(mixer);
                        mixerFound = true;
                        break;
                    }
                }
            }
            if (mixerFound == false)
            {
                // Use first mixer available.
                it = mixers.iterator();
                if (it.hasNext())
                {
                    mixer = (String) it.next();
                    bplayer.setMixerName(mixer);
                }
            }
        }
        // Register the front-end to low-level player events.
        bplayer.addBasicPlayerListener(mp);
        // Adds controls for front-end to low-level player.
        mp.setController(bplayer);
    }
View Full Code Here


        out = System.out;
    }

    public void play(String filename) {
// Instantiate BasicPlayer.
        BasicPlayer player = new BasicPlayer();
// BasicPlayer is a BasicController.
        BasicController control = (BasicController) player;
// Register BasicPlayerTest to BasicPlayerListener events.
// It means that this object will be notified on BasicPlayer
// events such as : opened(...), progress(...), stateUpdated(...)
        player.addBasicPlayerListener(this);

        try { // Open file, or URL or Stream (shoutcast, icecast) to play.
            control.open(new File(filename));

// control.open(new URL("http://yourshoutcastserver.com:8000"));
View Full Code Here

        this.setIconImage(new ImageIcon(getClass().getResource("/com/img/icon.png")).getImage());
    }

    public void intro() {
        try {
            BasicPlayer player = new BasicPlayer();
            player.open(getClass().getResource("/com/img/intro.mp3"));
            player.play();
        } catch (BasicPlayerException ex) {
            ex.printStackTrace(System.err);
        }
    }
View Full Code Here

  private int _playerVolume;
 
  private boolean _isMuted;
 
  public JLayerEngine(int playerVolume) {
    _player = new BasicPlayer();
    _listener = new JLayerEngineListener(this);
    _player.addBasicPlayerListener(_listener);
   
    _playerVolume = playerVolume;
   
View Full Code Here

  private Map audioInfo;
  Thread playThread;
 
  public JPowerHourAudioPlayer()
  {
    player = new BasicPlayer();
    player.addBasicPlayerListener(this);
  }
View Full Code Here

    public static void main(String[] args)
    {
  try
  {
      LivaPlayerGUI livaPlayerGUI = new LivaPlayerGUI();
      BasicPlayer basicPlayer = new BasicPlayer();
      basicPlayer.addBasicPlayerListener(livaPlayerGUI);
      livaPlayerGUI.setController(basicPlayer);
      livaPlayerGUI.open();

  }
  catch (Exception e)
View Full Code Here

TOP

Related Classes of javazoom.jlgui.basicplayer.BasicPlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.