Package net.charliemeyer.jpowerhour

Examples of net.charliemeyer.jpowerhour.JPowerHourInterlude


  {
    try
    {
      for(int i = 0; i < JPowerHourInterlude.getDefaultInterludeCount(); i++)
      {
        model.addElement(new JPowerHourInterlude(i));
      }
    }
    catch(BasicPlayerException bpe)
    {
      bpe.printStackTrace();
View Full Code Here


    if(retval == JFileChooser.APPROVE_OPTION)
    {
      File f = chooser.getSelectedFile();
      try
      {
        JPowerHourInterlude i = new JPowerHourInterlude(f);
        if(i.getArtist().equals("") && i.getTitle().equals(""))
        {
          i.setArtist(i.getSongFile().getName());
        }
        model.addElement(i);
      }
      catch (BasicPlayerException e)
      {
View Full Code Here

  private void handlePlayAction() {
    int selected = list.getSelectedIndex();
    if(selected != -1)
    {
      JPowerHourInterlude i = (JPowerHourInterlude) model.get(selected);
      try
      {
        i.playSong();
      }
      catch (BasicPlayerException e)
      {
        String message = "Could not get the audio device. Please try closing all other programs that may be using the audio device";
        JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
View Full Code Here

        root.addContent(songsElement);
       
        Element interludesElement = new Element("interludes");
        for(int i = 0; i < interludes.size(); i++)
        {
          JPowerHourInterlude interlude = interludes.get(i);
         
          Element interludeElement = new Element("jPowerHourInterlude");
         
          interludeElement.setAttribute("index", i+"");
          interludeElement.setAttribute("default",interlude.isDefault()+"");
          if(interlude.isDefault())
          {
            interludeElement.setAttribute("defaultNumber", interlude.getDefaultNumber()+"");
          }
          else
          {
            try
            {
          interludeElement.setAttribute("path", interlude.getSongFile().getCanonicalPath());
        }
            catch (IOException e)
            {
          e.printStackTrace();
        }
View Full Code Here

          int index = interludeElement.getAttribute("index").getIntValue();
          boolean def = interludeElement.getAttribute("default").getBooleanValue();
          if(def)
          {
            int defaultNumber = interludeElement.getAttribute("defaultNumber").getIntValue();
            JPowerHourInterlude interlude;
        try
        {
          interlude = new JPowerHourInterlude(defaultNumber);
          interludes.add(interlude);
        }
        catch (BasicPlayerException e)
        {
          e.printStackTrace();
        }
           
          }
          else
          {
            File file = new File(interludeElement.getAttribute("path").getValue());
             
              if(!file.exists())
              {
                String message = "Interlude "+file.getName()+" does not exist, removing from playlist";
                try
                {
                  JOptionPane.showMessageDialog(null, message, "Error", JOptionPane.ERROR_MESSAGE);
                }
                catch(HeadlessException he)
                {
                  System.err.println(message);
                }
              }
              else
              {
                try
                {
              JPowerHourInterlude interlude = new JPowerHourInterlude(file);
              interludes.add(index, interlude);
            }
                catch (BasicPlayerException e)
                {
              e.printStackTrace();
View Full Code Here

TOP

Related Classes of net.charliemeyer.jpowerhour.JPowerHourInterlude

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.