• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Would be delighted if someone could help me edit a program! just a little bit :)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there!

I occasionally use a JAVA-program called Superanalyzer to get some fun statistics on my iTunes-files. The program is free and not updated anymore.

I would really like to edit the program so it uses "Artist" instead of "Album Artist" in one chart and I have no idea how to do that!

I imagine that it wouldn't take to much time for someone who knows JAVA. Maybe I could pay with a albumgift or something on iTunes

Best regards
- Mattias
 
Sheriff
Posts: 4633
300
IntelliJ IDE Clojure Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt you'd find anyone here to do this work for you, but we can help you if you are intending to take it on as a project yourself.

But first, questions:
  • Does the project licence allow you to modify it?
  • Where can you get the source code? (not much to be done without that)
  •  
    Tim Cooke
    Sheriff
    Posts: 4633
    300
    IntelliJ IDE Clojure Java
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    .... and .... Welcome to the Ranch!
     
    Mattias Bjoernstroem
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Ok! Thank you for your answer!

    The source code was availible in the program package and licenced under GNU so I seem to be allowd to modify it.

    I got the source code, I got "Java Editor" on my Win XP Virtual box and I think I found the code were the magic happens. Were do I post my question?

    Thanks again for your help

    - Mattias
     
    Ranch Hand
    Posts: 122
    1
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Dear Mattias,


    I might help you since I am a Java programmer who is interested in doing something funny in Java.

    Ok, there are many questions, where to download the code application from, how to test it, etc.

    How can I test it if I don't have an iTunes player ? Is that possible ?



    Thanks.
     
    Mattias Bjoernstroem
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Great ludoviko azuaje! Thank you for putting your interest in to this

    Here you can download the source code:
    https://github.com/tombcz/super-analyzer/releases

    There is an option in Super Analyzer to "Analys Playlist" which means I can somehow send you an exported playlist (it's only a *xml-file, without the musicfiles) which you can try to analyse.

    I found this bit of code and the text in green does not seem to work on my iTunes:
    As I understand it Superanalyzer should use "Artist" instead of "Albumartist" if the album is a compilation but it does not work for me..

    does this "if (track.getAlbumArtist() != null " mean that Albumartist has to be nothing if it is a compilation?


    /****************************************************************************
    The Super Analyzer
    Copyright (C) 2009 Tom Bulatewicz, Nosleep Software

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    ***************************************************************************/

    package net.nosleep.superanalyzer.analysis;

    import java.util.*;

    import net.nosleep.superanalyzer.util.StringInt;

    /**
    * Describes a collection of artists. The keys are artist names and the values
    * are Artist objects.
    */
    class Artists extends Hashtable
    {

    Vector<StringInt> _mostPlayed;

    public Artists()
    {
    }

    public void finish()
    {
    _mostPlayed = Analysis.findMostPlayed(this);
    }

    public Vector<StringInt> getMostPlayed()
    {
    return _mostPlayed;
    }

    public void analyze(Track track)
    {
    // get the artist name
    String artistName = track.getArtist();

    // if there is an album artist, and it's not a compilation, use that
    // one. if we use the album artist for compilations, then users who set
    // the album artist to "Various Artists" will get all their compilations
    // grouped together as a single artist, which isn't good.
    if (track.getAlbumArtist() != null && track.getCompilation() == false)
    artistName = track.getAlbumArtist();

    // don't collect artist info if we don't know what artist it is
    if (artistName == null)
    return;

    // now see if that artist is in the hashtable yet
    Artist artist = (Artist) get(artistName);

    // if not in there, then create a new artist oject and put it in
    if (artist == null)
    {
    // create a new artist object
    artist = new Artist();
    // add the object to the hash table
    put(artistName, artist);
    }

    // add this track's stats to the artist object
    artist.analyze(track);
     
    Mattias Bjoernstroem
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I solved it! I deleted "Various artists" as "Albumartist" in all my compilations and then my problem disapeared! No need to edit the software

    Thank you anyway for you interest!

    Best regards
    - Mattias
     
    Marshal
    Posts: 64630
    225
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Mattias Bjoernstroem wrote: . . .
    does this "if (track.getAlbumArtist() != null " mean that Albumartist has to be nothing if it is a compilation?
    . . .

    No. It tests whether a value has been applied to whatever albumArtist is in the track object. If there is no value, then it will return null, and most uses of null will fail.

    You do realise the code you downloaded is by no means good quality? It looks like code from somebody who usually writes C and has been told there is a language called Java.
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!