Device View programming

Jamie Faris farisj at gmail.com
Sat Dec 15 02:59:26 UTC 2007


On Dec 13, 2007 11:47 PM, Nathaniel Grocott <ngrocott at gmail.com> wrote:
> I like the view of the tracks on the ipod, but would like to have genre in
> the Device View tree. I've looked at some source code files and see the
> functions
>
> IpodMediaItem
>     *getArtist( const QString &artist );
>
> IpodMediaItem
>     *getAlbum( const QString &artist, const QString &album );
>
> IpodMediaItem
>    *getTrack( const QString &artist, const QString &album,
>                                     const QString &title,
>                                     int discNumber = -1, int trackNumber =
> -1 );
>         IpodMediaItem    *getTrack( const Itdb_Track *itrack );
>
> from the files ipodmediadevice.h and ipodmediadevice.cpp .
>
> Although I have not come to comprehend them, I wonder if  a getGenre could
> be added. So it might start like:
>
> IpodMediaItem
> *getGenre( const QString &genre );
>
> IpodMediaItem
>      *getArtist( const QString &genre, const QString &artist );
>
>  IpodMediaItem
>      *getAlbum( const QString &genre, const QString &artist, const QString
> &album );
>
>  IpodMediaItem
>     *getTrack( const QString &genre, const QString &artist, const QString
> &album,
>                                      const QString &title,
>                                      int discNumber = -1, int trackNumber =
> -1 );
>          IpodMediaItem    *getTrack( const Itdb_Track *itrack );
>
> What I'm thinking seems almost too easy.  Can a function be added to search
> for genres, and then build the Device View tree starting from genre.
>
> I've only started to look at some of the source code yesterday. It looks
> very organized, but I'm sure I'm going to find my self stumped somewhere.
> Such may be the case when deciding how to search for genres on the ipod.
> Also if Amarok's source code is not clear, is there a simplified algorithm
> model I could look at to understand how the Device  View is built. Further,
> are any ipod programming specification available.
>

You would be best to do this kind of work for Amarok 2, since media
devices will probably change a fair amount.  They'll likely show up in
the collection browser so you can do group by Genre or whatever you
want.  Have a look here to get started with building 2.0:

http://amarok.kde.org/wiki/2.0_Development_HowTo

If you feel so inclined you can definitely work on porting the ipod plugin.

If you want to get it working now for 1.4 it should be possible and
you are on the right track.  Just be aware that whatever work you do
might be tossed out in a few months time (if it even gets into svn).
It may also need some fairly disruptive changes if a lot of the code
relies on the list view being organised by artist.



More information about the Amarok mailing list