Examples of Music


Examples of aspect.audio.Music

    public static Music loadMusic(File file) {
        try {
            return loadMusic(getStream(file));
        } catch (IOException ex) {
            Logger.getLogger(Resources.class.getName()).log(Level.SEVERE, null, ex);
            return new Music();
        }
    }

Examples of aspect.audio.Music

            return new Music();
        }
    }

    public static Music loadMusic(InputStream source) {
        return new Music(source);
    }

Examples of aspect.audio.Music

    public static Music loadMusic(String name, File file) {
        if (MUSIC.containsKey(name)) {
            return MUSIC.get(name);
        }

        Music mus = loadMusic(file);
        addMusic(name, mus);
        return mus;
    }

Examples of aspect.audio.Music

    public static Music loadMusic(String name, InputStream source) {
        if (MUSIC.containsKey(name)) {
            return MUSIC.get(name);
        }

        Music mus = loadMusic(source);
        addMusic(name, mus);
        return mus;
    }

Examples of br.com.caelum.vraptor.musicjungle.model.Music

    }
 
  @Path("/musics/download/{m.id}")
  @Get
  public Download download(Music m){
    Music music = musicDao.load(m);
    File file = musics.getFile(music);
    String contentType = "audio/mpeg";
        String filename = music.getTitle() + ".mp3";

        return new FileDownload(file, contentType, filename);
  }

Examples of br.com.caelum.vraptor.musicjungle.model.Music

    }
 
  @Path("/musics/download/{m.id}")
  @Get
  public Download download(Music m) throws FileNotFoundException {
    Music music = musicDao.load(m);
    File file = musics.getFile(music);
    String contentType = "audio/mpeg";
    String filename = music.getTitle() + ".mp3";

    return new FileDownload(file, contentType, filename);
  }

Examples of client.ws.milanas.helpers.beans.Music

     * Parsers a response to "ItemLookup" operation from Amazon.
     * Returns the data of a music (CD).
     */
    public Item getItemContent(Document doc)
    {
        Music music = new Music();
        CustomerReview review = null;
        Offer offer = null;
        NodeList nodes, kids1, kids2, kids3 = null;
        Node node, kid1, kid2, kid3 = null;
        int i, j, k, x = 0;
       
        nodes = doc.getElementsByTagName("ASIN");
        for(i = 0; i < nodes.getLength(); i++)
        {
            if(nodes.item(i).getParentNode().getNodeName().equals("Item"))
            {
                music.setAsin(nodes.item(i).getTextContent());
            }
        }
        nodes = doc.getElementsByTagName("DetailPageURL");
        if(nodes.getLength() > 0)
        {
            music.setUrl(nodes.item(0).getTextContent());
        }
        nodes = doc.getElementsByTagName("SalesRank");
        if(nodes.getLength() > 0)
        {
            music.setSalesRank(nodes.item(0).getTextContent());
        }
        nodes = doc.getElementsByTagName("URL");
        for(i = 0; i < nodes.getLength(); i++)
        {
            if(nodes.item(i).getParentNode().getNodeName().equals("LargeImage"))
            {
                music.setImage(nodes.item(i).getTextContent());
            }
        }
        nodes = doc.getElementsByTagName("ItemAttributes");
        if(nodes.getLength() > 0)
        {
            node = nodes.item(0);
            kids1 = node.getChildNodes();
            for(i = 0; i < kids1.getLength(); i++)
            {
                kid1 = kids1.item(i);
                if(kid1.getNodeName().equals("Author"))
                {
                    music.addArtist(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Creator"))
                {
                    music.addArtist(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("EAN"))
                {
                    music.setEan(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("ListPrice"))
                {
                    kids2 = kid1.getChildNodes();
                    for(j = 0; j < kids2.getLength(); j++)
                    {
                        kid2 = kids2.item(j);
                        if(kid2.getNodeName().equals("FormattedPrice"))
                        {
                            music.setPrice(kid2.getTextContent());
                        }
                    }
                }
                if(kid1.getNodeName().equals("ReleaseDate"))
                {
                    music.setPublicationDate(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Publisher"))
                {
                    music.setPublisher(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Studio"))
                {
                    music.setStudio(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Title"))
                {
                    music.setTitle(kid1.getTextContent());
                }
            }
        }
        nodes = doc.getElementsByTagName("EditorialReview");
        if(nodes.getLength() > 0)
        {
            node = nodes.item(0);
            kids1 = node.getChildNodes();
            for(i = 0; i < kids1.getLength(); i++)
            {
                kid1 = kids1.item(i);
                if(kid1.getNodeName().equals("Content"))
                {
                    music.setSummary(kid1.getTextContent());
                }
            }
        }
        nodes = doc.getElementsByTagName("AverageRating");
        if(nodes.getLength() > 0)
        {
            music.setAverageRating(nodes.item(0).getTextContent());
        }
        nodes = doc.getElementsByTagName("Review");
        for(i = 0; i < nodes.getLength(); i++)
        {
            review = new CustomerReview();
            node = nodes.item(i);
            kids1 = node.getChildNodes();
            for(j = 0; j < kids1.getLength(); j++)
            {
                kid1 = kids1.item(j);
                if(kid1.getNodeName().equals("ASIN"))
                {
                    review.setAsin(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Rating"))
                {
                    review.setRating(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("HelpfulVotes"))
                {
                    review.setReviewVotes(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Reviewer"))
                {
                    kids2 = kid1.getChildNodes();
                    for(k = 0; k < kids2.getLength(); k++)
                    {
                        kid2 = kids2.item(k);
                        if(kid2.getNodeName().equals("CustomerId"))
                        {
                           
                            review.setCustomerId(kid2.getTextContent());
                        }
                        if(kid2.getNodeName().equals("Name"))
                        {
                            review.setCustomerName(kid2.getTextContent());
                        }
                        if(kid2.getNodeName().equals("Nickname"))
                        {
                            review.setCustomerNick(kid2.getTextContent());
                        }
                        if(kid2.getNodeName().equals("Location"))
                        {
                            review.setCustomerLocation(kid2.getTextContent());
                        }
                    }
                }
                if(kid1.getNodeName().equals("Date"))
                {
                    review.setDate(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Summary"))
                {
                    review.setSummary(kid1.getTextContent());
                }
                if(kid1.getNodeName().equals("Content"))
                {
                    review.setContent(kid1.getTextContent());
                }
            }
            music.addReview(review);
        }
       
        nodes = doc.getElementsByTagName("Offer");
        for(i = 0; i < nodes.getLength(); i++)
        {
            offer = new Offer();
            node = nodes.item(i);
            kids1 = node.getChildNodes();
            for(j = 0; j < kids1.getLength(); j++)
            {
                kid1 = kids1.item(j);
                if(kid1.getNodeName().equals("OfferAttributes"))
                {
                    kids2 = kid1.getChildNodes();
                    for(k = 0; k < kids2.getLength(); k++)
                    {
                        kid2 = kids2.item(k);
                        if(kid2.getNodeName().equals("Condition"))
                        {
                            offer.setCondition(kid2.getTextContent());
                        }
                    }
                }
                if(kid1.getNodeName().equals("OfferListing"))
                {
                    kids2 = kid1.getChildNodes();
                    for(k = 0; k < kids2.getLength(); k++)
                    {
                        kid2 = kids2.item(k);
                        if(kid2.getNodeName().equals("OfferListingId"))
                        {
                            offer.setId(kid2.getTextContent());
                        }
                        if(kid2.getNodeName().equals("Price"))
                        {
                            kids3 = kid2.getChildNodes();
                            for(x = 0; x < kids3.getLength(); x++)
                            {
                                kid3 = kids3.item(x);
                                if(kid3.getNodeName().equals("FormattedPrice"))
                                {
                                    offer.setPrice(kid3.getTextContent());
                                }
                            }
                        }
                    }
                }
            }
            music.addOffer(offer);
        }
        return music;
    }

Examples of client.ws.milanas.helpers.beans.Music

    {
        super(frameTitle, parent, indexTab, messages);
        double imgHeight, imgWidth, imgProp = 0.0;
        int iniPosition, i, y, x = 0;
        int fontSize = 32;
        Music music = (Music) item;
        Font titleFont = new Font("SansSerif", Font.BOLD, fontSize);
        Font labelsFont = new Font("SansSerif", Font.BOLD, 12);
        Font urlFont = null;
        Map fontAttrs = null;       
        ArrayList<String> artists = null;
        String art = new String();
        String aux = null;
        ArrayList<CustomerReview> reviews = null;
        ArrayList<Offer> offers = null;
               
        JDesktopPane panel = new JDesktopPane();
        JScrollPane scroll = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        Container content = getContentPane();
       
        JLabel title = new JLabel(music.getTitle());
        title.setFont(titleFont);
        title.setSize((int) title.getPreferredSize().getWidth(), (int) title.getPreferredSize().getHeight());
        while(title.getSize().getWidth() > (width - 17))
        {
            fontSize--;
            titleFont = new Font("SansSerif", Font.BOLD, fontSize);
            title.setFont(titleFont);
            title.setSize((int) title.getPreferredSize().getWidth(), (int) title.getPreferredSize().getHeight());
        }
        iniPosition = (int) (((width - 17) - title.getSize().getWidth()) / 2);
        title.setLocation(iniPosition, 0);
        panel.add(title);
       
        JLabel imgLabel = new JLabel();
        ImageIcon image = null;
        Image img = null;
        try
        {
            URL imgUrl = new URL(music.getImage());
            image = new ImageIcon(new URL(music.getImage()));
        }
        catch(MalformedURLException mue)
        {
            image = new ImageIcon("");
        }
        img = image.getImage();
        imgHeight = img.getHeight(image.getImageObserver());
        imgWidth = img.getWidth(image.getImageObserver());
        imgProp = imgHeight/imgWidth;
        if(imgHeight > 300)
        {
            imgHeight = 300;
            imgWidth = imgHeight / imgProp;
        }
        if(imgWidth > 300)
        {
            imgWidth = 300;
            imgHeight = imgWidth * imgProp;
        }
        img = img.getScaledInstance((int) imgWidth, (int) imgHeight, Image.SCALE_SMOOTH);
        image.setImage(img);
        imgLabel.setIcon(image);
        imgLabel.setSize((int) imgWidth, (int) imgHeight);
        y = (int) title.getPreferredSize().getHeight() + 10;
        imgLabel.setLocation(10, y);
        panel.add(imgLabel);
       
        x = (int) imgLabel.getSize().getWidth() + 200;       
        asin = new JLabel(music.getAsin());
        asin.setSize((int) asin.getPreferredSize().getWidth(), 30);
        asin.setLocation(x, y);
        panel.add(asin);
        JLabel price = new JLabel(music.getPrice());
        price.setSize((int) price.getPreferredSize().getWidth(), 30);
        price.setLocation(x, y + 30);
        panel.add(price);
        JLabel sales = new JLabel(music.getSalesRank());
        sales.setSize((int) sales.getPreferredSize().getWidth(), 30);
        sales.setLocation(x, y + 30 * 2);
        panel.add(sales);
        JLabel average = null;
        if(music.getAverageRating().equals(""))
        {
            average = new JLabel(music.getAverageRating());
        }
        else
        {
            formatter.applyPattern(messages.getString("content.rating"));
            Object[] messageArguments = {music.getAverageRating()};
            average = new JLabel(formatter.format(messageArguments));
        }
        average.setSize((int) average.getPreferredSize().getWidth(), 30);
        average.setLocation(x, y + 30 * 3);
        panel.add(average);
        JLabel ean = new JLabel(music.getEan());
        ean.setSize((int) ean.getPreferredSize().getWidth(), 30);
        ean.setLocation(x, y + 30 * 4);
        panel.add(ean);
        artists = music.getArtists();
        int line = 1;
        art = "<html>";
        for(i = 0; i < artists.size(); i++)
        {
            if((i % 2) == 0 && !art.equals("<html>"))
            {
                art = art + "<br/>";
                line++;
            }
            if(i  != artists.size() - 1)
            {
                art = art + artists.get(i) + ", ";
            }
            else
            {
                art = art + artists.get(i);
            }
        }
        art = art + "</html>";
        JLabel artist = new JLabel(art);
        artist.setSize((int) artist.getPreferredSize().getWidth(), (int) artist.getPreferredSize().getHeight() + 30);
        artist.setLocation(x, y + 30 * 5);
        panel.add(artist);
        JLabel studio = new JLabel(music.getStudio());
        studio.setSize((int) studio.getPreferredSize().getWidth(), 30);
        studio.setLocation(x, y + 30 * 5 + (int) artist.getSize().getHeight());
        panel.add(studio);
        JLabel publisher = new JLabel(music.getPublisher());
        publisher.setSize((int) publisher.getPreferredSize().getWidth(), 30);
        publisher.setLocation(x, y + 30 * 6 + (int) artist.getSize().getHeight());
        panel.add(publisher);
        JLabel pubDate = new JLabel(music.getPublicationDate());
        pubDate.setSize((int) pubDate.getPreferredSize().getWidth(), 30);
        pubDate.setLocation(x, y + 30 * 7 + (int) artist.getSize().getHeight());
        panel.add(pubDate);
        JTextPane sum = new JTextPane();
        aux = music.getSummary();
        aux = aux.replaceAll("<P>", "\n\n").replaceAll("<BR>", "\n").replaceAll("<.*>", "");
        sum.setText(aux);
        sum.setEditable(false);
        sum.setSize(width - (x + 50), 100);
        sum.setPreferredSize(new Dimension(width - (x + 50), 100));
        sum.setOpaque(true);
        JScrollPane sumScroll = new JScrollPane(sum, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        sumScroll.setLocation(x, y + 30 * 8 + (int) artist.getSize().getHeight());
        sumScroll.setSize(width - (x + 50), 110);
        sumScroll.setPreferredSize(new Dimension(width - (x + 50), 110));
        sumScroll.setBorder(BorderFactory.createLineBorder(Color.WHITE, 0));
        panel.add(sumScroll);
       
       
        x = (int) imgLabel.getSize().getWidth() + 50;
        JLabel asinLab = new JLabel(messages.getString("label.music.id"));
        asinLab.setFont(labelsFont);
        asinLab.setSize(150, 30);
        asinLab.setLocation(x, y);
        panel.add(asinLab);
        JLabel priceLab = new JLabel(messages.getString("label.price"));
        priceLab.setFont(labelsFont);
        priceLab.setSize(150, 30);
        priceLab.setLocation(x, y + 30);
        panel.add(priceLab);
        JLabel salesLab = new JLabel(messages.getString("label.rank"));
        salesLab.setFont(labelsFont);
        salesLab.setSize(150, 30);
        salesLab.setLocation(x, y + 30 * 2);
        panel.add(salesLab);
        JLabel averageLab = new JLabel(messages.getString("label.rating"));
        averageLab.setFont(labelsFont);
        averageLab.setSize(150, 30);
        averageLab.setLocation(x, y + 30 * 3);
        panel.add(averageLab);
        JLabel eanLab = new JLabel(messages.getString("label.ean"));
        eanLab.setFont(labelsFont);
        eanLab.setSize(150, 30);
        eanLab.setLocation(x, y + 30 * 4);
        panel.add(eanLab);
        JLabel artistLab = new JLabel(messages.getString("label.artist"));
        artistLab.setFont(labelsFont);
        artistLab.setSize(150, 30);
        artistLab.setLocation(x, y + 30 * 5);
        panel.add(artistLab);
        JLabel studioLab = new JLabel(messages.getString("label.studio"));
        studioLab.setFont(labelsFont);
        studioLab.setSize(150, 30);
        studioLab.setLocation(x, y + 30 * 5 + (int) artist.getSize().getHeight());
        panel.add(studioLab);
        JLabel publisherLab = new JLabel(messages.getString("label.publisher"));
        publisherLab.setFont(labelsFont);
        publisherLab.setSize(150, 30);
        publisherLab.setLocation(x, y + 30 * 6 + (int) artist.getSize().getHeight());
        panel.add(publisherLab);
        JLabel pubDateLab = new JLabel(messages.getString("label.pub.date"));
        pubDateLab.setFont(labelsFont);
        pubDateLab.setSize(150, 30);
        pubDateLab.setLocation(x, y + 30 * 7 + (int) artist.getSize().getHeight());
        panel.add(pubDateLab);
        JLabel sumLab = new JLabel(messages.getString("label.summary"));
        sumLab.setFont(labelsFont);
        sumLab.setSize(150, 30);
        sumLab.setLocation(x, y + 30 * 8 + (int) artist.getSize().getHeight());
        panel.add(sumLab);
       
       
        x = (int) imgLabel.getSize().getWidth() + 200;
        y = y + (30 * 10 + (int) artist.getSize().getHeight()) + 110;
       
        reviews = music.getReviews();
        offers = music.getOffers();
       
        if(reviews.size() > 0 || offers.size() > 0)
        {
            JLabel infoLab = new JLabel(messages.getString("label.info"));
            infoLab.setSize((int) infoLab.getPreferredSize().getWidth(), 30);
            infoLab.setLocation(10, y);
            panel.add(infoLab);
        }
       
        y = y + 30;
       
        if(reviews.size() > 0)
        {
            JDesktopPane reviewsPanel = getReviewsPanel(reviews, width, messages, formatter);
            reviewsPanel.setLocation(0, y);
            panel.add(reviewsPanel);
            y = y + (int) reviewsPanel.getSize().getHeight() + 30;
        }
       
        if(offers.size() > 0)
        {
            JDesktopPane offersPanel = getOffersPanel(offers, width, messages);
            offersPanel.setLocation(0, y);
            panel.add(offersPanel);
            y = y + (int) offersPanel.getSize().getHeight() + 30;
        }
       
        JLabel urlLab = new JLabel(messages.getString("label.info.music.url"));
        urlLab.setSize((int) urlLab.getPreferredSize().getWidth(), 30);
        urlLab.setLocation(10, y);
        panel.add(urlLab);
        //url = new JLabel(music.getUrl());
        JLabel url = new JLabel(messages.getString("label.music.url"));
        urlString = music.getUrl();
        urlFont = url.getFont();
        fontAttrs = urlFont.getAttributes();
        fontAttrs.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
        fontAttrs.put(TextAttribute.FOREGROUND, Color.BLUE);
        urlFont = urlFont.deriveFont(fontAttrs);

Examples of com.badlogic.gdx.audio.Music

                String name = e.getAttribute("name");
                String entityPath = e.getAttribute("path");
                switch (type) {
                    case "music": {
                        FileHandle f = new FileHandle(new File(entityPath));
                        Music m = Gdx.audio.newMusic(f);
                        m_musicList.put(name, m);
                        break;
                    }
                    case "sound": {
                        FileHandle f = new FileHandle(new File(entityPath));

Examples of com.badlogic.gdx.audio.Music

    music = Gdx.audio.newMusic(file);
  }

  @Override
  public Music loadSync (AssetManager manager, String fileName, FileHandle file, MusicParameter parameter) {
    Music music = this.music;
    this.music = null;
    return music;
  }
TOP
Copyright © 2018 www.massapi.com. 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.