Tuesday, November 4, 2008

Delete Multiple Files

Again, school keeps me busy and away from solving issues, but here's the most recent thing I've been working on.

(Yes, the dialog isn't at all final, I just put it there as a placeholder)

A few collections like the MP3Tunes service, and the local collection, are actually able to delete tracks already! They just... have no GUI to make it all happen. Devices like iPods and MTP devices can delete too, but only one track at a time (far from optimal). So I'm working to bring this ability to all collections alike. Actually getting this working isn't too hard, but making the code nice, understandable and maintainable is a bit of a trick. Luckily I've got a pretty good idea now of how I want it done.

Beta 3 is out =D but still so much left to be done on my end:
- fix MTP track playing, so that the next track properly loads/plays
- add orphaned/stale track checking for iPods
- enhance the Media Devices Applet, and add interface to root item of TreeView for connect/disconnect
- fix cover-related things on iPods (and _possibly_ implement it for MTP devices, by popoular request)

The list goes on, but that's already enough. More manpower for any of these jobs is MORE than welcome. Do apply =)

Monday, October 6, 2008

Media Devices Applet

To control connection/disconnection of media devices, along with advanced functionality such as the stale-and-orphaned feature for iPods in Amarok 1.4, some kind of GUI is needed. One of the discussed long-term ideas is to add functionality into the root item of a treeview, which has its merits in terms of simplicity. However, imagine that you plug in your device, and want to connect to it. The collection would have to be present in a kind of dormant state in the collection browser until you hit connect in the root item. This could work, but it's admittedly odd to have a "dead" collection sitting around.

Since modifying the root item of a treeview was beyond my current knowledge, I wanted to play with plasma a bit, and it gave me more leeway, both in terms of creativity and space, I decided, at least for now, on a Media Devices applet. Some of you may have seen the ghost of this thing in svn and wondered what the dickens it is, so I'll explain to you its current functionality first, and then some of my visions for it.

This first screenshot shows the applet blank since nothing is plugged in (eventually I want it to say "no devices"). Then, for instance, you plug in your iPod (and for now, mount it outside of Amarok) and bam!

Notice a row has been added for the iPod, representing an icon for what the device is, a connect button, a disconnect button, and its mount point. Then you click the connect button and...

You guessed it, it connects (notice the iPod collection on the left). After this, you can work with it like usual, or click the disconnect button and the collection will poof away back to things as you see them in the 2nd screenshot, allowing you to eject the iPod.

The Obvious:

- This is what I would call alpha. Yes, the icons are a bit inappropriate and admittedly borrowed, but I'm sure I can get someone magnificent to create beautiful specialized icons later on (*wink wink*)
- There are still advanced features missing (like showing battery % etc.), but again, this can come later without much trouble once the base concept gets off the ground
- Usability! How will people know to go open the media devices applet the first time they try out Amarok with their device? I'm thinking to have the applet open itself on detecting a compatible device for the first time and getting focus to get the user's attention

The Vision:

So back to the stale and orphaned concept. In 1.4, you had to look at orphaned/stale tracks along with your "normal" tracks in the media browser. Now, you could have a scrollable list each of the stale and orphaned tracks, with the same functionality as before, but now it's not in your way! You can continue to browse through your iPod tracks and the orphaned/stale tracks at the same time.

The conclusion:

Well this all sounds quite well and dandy, but if I have a good idea of how this is going to work, and basic functionality for connect/disconnect is already implemented on my personal box, why don't I commit and get all the rest of the bells and whistles going? The same lame excuse: life is busy. Also I'd like to commit it in a slightly prettier more usable form with less of the obvious bugs in there.

That said, if anyone out there wants to help out with this, let me know, and I can even guide you through the code to get you going. For now though, I'll chug away at it in my spare hours.

Monday, August 25, 2008

"Absence," Akademy and Devices

So I apparently haven't blogged in a month. Sorry about that, it's not that I have nothing to say, just that I'm usually busy doing that I don't really take the time to talk about it. That said, I'll still keep this short as I myself like to read short blurbs from people who aren't well-known.

Akademy. Awesome. Of course I got to meet a good amount of the Amarok people I often talk to, which was the highlight of the trip for me really. It's one thing to discuss over IRC, and quite another to have breakfast together, chat about things non-Amarok as well as Amarok in person, and in general hang out. I also got to meet a lot of other people, like Will Stephenson who donated an MTP device for development (who I met while waiting in the waffles line) [p.s. thank you so much again for it].

Most exciting stuff non-Amarok: Gallium3D... just wow, that's all I can say. Step was pretty awesome too, though my physics is really bad. Marble is exciting stuff, but in Openstreetmap there remains much to be mapped so it may be a while before it becomes truly amazing. There's more, but these are the ones that stuck out most in my mind right now.

So, Media Device Status Report. As you can see, I haven't blogged so obviously nothing has happened. Lies. MTP playing off the device is now supported, a bunch of random bugs have been fixed, and an applet is under way to deal with configuration etc. of devices. Don't worry, this is only for connect/disconnect and options and whatnot, the configuration of devices will still be almost entirely automated. I'm trying to figure out a way to make it more obvious that for media devices you need only plug in your device essentially, for it to just work. I think that I'll try to push for the Media Devices applet to be one of the initial defaults loaded, and it'll show a text like "plug in media device to play from it" or something.

Why have I been so slow at coding? The truth is I've been held in Guantanamo for the last couple of weeks. And.... again, lies. No, between random life, then Akademy in Belgium (which I spent most of my time bugfixing and socializing), and now I'm in Japan where it's hard to stay on the computer too long, I haven't been that able to. But I'll be back in the USA Sept. 2, so starting then things should pick up a bit more hopefully.

On that note, cheers from Japan!

Sunday, July 27, 2008

MTP File Management and iPod Covers

So MTP file management (copying/deleting) has gotten implemented, and works well on all 3 devices I tested on. Still a lot of polishing left to do as far as interface goes, and some threading to not stall Amarok at key points, and it should be good to go. One thing I'm having issues with is copying files directly from an MTP to an iPod and vice versa, but will investigate this later as this is a bit more advanced.

So, I had a bit of an epic struggle with a few things over the last day or so. See, libgpod can only retrieve covers in the form of GdkPixbuf structs, but so as to not force the GdkPixbuf dependency on people, they return it as a gpointer which you can then choose to cast if you want to use GdkPixbuf. Sounds great, right? No problem...

... except for having CMake pull in the dependency. So as it turns out, there's no built-in module for gdk-pixbuf library. So, I decided to create my own as I did with libgpod, except when I pulled it in, a certain function wasn't present. Odd... hm. Well as it turns out, this function is only present in the gdk-pixbuf library that resides in gtk. Great! There's a CMake module for GTK, all should be fine this time, yes? No. The GTK module in CMake pulls in GTK1, and gdk-pixbuf is in GTK2. So I end up modifying the gdk-pixbuf module I made before, learning lots about CMake along the way, and finally get it compiling.

Long story short for the next part, the README in libgpod didn't really work for me for setting up SysInfo for my iPod, and I accidentally tripped on a feature from the old Amarok which set it up right, after I modified some permissions. Wonderful, yeah?

Wrong! Turns out that iTunes and libgpod handle covers in two different ways, and so I have to cater to both of them. This turned out to be a bit of a pain, but at last, I finally got a size-distorted but correct solution:

The m-flo cover was set by me using libgpod via Amarok, and the ManĂ¡ cover was set by iTunes. I'm going to fine-tune the sizes later, and all should be peaches and cream.

That's all for now. One note though about the interface, which right now is either non-existent or bad: likely going to be making an applet which does all the fun stuff that A1 did for media devices, including: connect/disconnect, % free space, possibly a queue, and if supported, even % battery level! That however, is a ways away from coming true, but do stay tuned.

Thursday, July 24, 2008

MTP Support Arrives

Caption: 2 MTP devices connected, and songs playing from iPod

This is a bit overdue, but initial support for MTP devices has arrived. To use it, you require limbtp >= 0.3.0 installed on the system, and a device supported by libmtp of course.

Part of the reason this took so long is that I'm starting to notice a lot of potentially reusable code, and will probably soon refactor to reflect this. MTP devices are strange beasts, because their filesystem can't be directly accessed. As a result, Amarok 1 and Windows Media Player et al can only do file management of tracks on these devices, not actually play directly off of them. I'm going to be working on an idea that allows playing off of them to be possible, because let's face it, A2 is an audio player, not just a file manager.

Thanks again to everyone who donated MTP devices to the Amarok group. You're the ones who make this possible. Support is still pretty basic, so please don't file bugs on this yet, but be ready to at some point in the semi-near future.

Edit: Snapshot of 3 Mentioned Devices

Sunday, July 13, 2008

MTP Incoming and Ipod File Deletion Support

First off, thanks to everyone who has responded to the request for devices so far, and those to come! Sorry if the replies to the e-mails take a bit, but I'm probably working on Amarok ironically enough. Some of the devices offered have already been sent, and soon we'll see the first signs of MTP support on Amarok 2 =D . To get this question out of the way, _yes_, of course we're going with libmtp 0.3, it just makes sense to. Look forward to this MTP users, and thanks again to all donors of devices!

Summary of Ipod News:

- You can now delete files one at a time from the iPod
- You can now "edit" tags, although changes won't save yet (implementing next)

After fighting for a while with how to create a custom "remove" button, users now have access to deleting files on the ipod! ... one at a time, hah, looks like I have to do some more magic before you can do it with multiple files at once. Also, the icon for "remove" doesn't seem to make sense, and I'm fixing this soon too. Why there isn't a built-in capability to remove from a collection when there's built-in support for it in CollectionLocation? Probably nobody got around to it yet. If nobody does it after this summer, I'll implement it so that people don't have to go through this again, haha.

Turns out that because pre-made actions are in the CollectionTreeView, they can do all sorts of magic like... know which items are selected, so that they can work with multiple things at once. I'll have to look into this next.

Anyway, editing ipod tags will no longer crash your Amarok, and they'll even update in the view!... but not in the ipod's database, so a restart of Amarok will clear those changes, don't be fooled! It won't be too hard to port over tags support I'm sure. Er.. wait, I've said "it shouldn't be too hard to..." way too many times already, and I'm always surprised when it turns out to be a pita, haha.

The rest of the stuff I mentioned in previous posts has not yet been dealt with. No need to ask about the progress, it'll get here fairly soon. I've tried to concentrate on core features (tag editing, file management) for now. Yes, album covers and podcasts are wonderful, and they're soon to be here.

Wednesday, July 9, 2008

Ipod File Transfer Support Arrives

After an all-nighter porting over file-related code and some hours trying to make it work with CollectionLocation, we have the first signs of file transfer to ipod support available.

- AA format not yet supported due to some Audible strangeness
- Copying might seem slow right now (as in, takes 3-5 seconds to copy about 12 tracks), but I will fix this pretty soon as I know the cause

How to copy to iPod?
1.) Have iPod plugged in and mounted
2.) In Amarok, an iPod collection should show
3.) Either right-click an artist/album/track from another collection (e.g. local collection), or drag into the middle area to bring up the PUD. Hover over Copy to Collection, and select your Ipod.
4.) The tracks should then be being added. Expand your ipod collection to confirm that the tracks have been added and are able to be added to the playlist and played.
5.) Confirm that the songs can be played from the iPod itself

Forthcoming but not yet here:
- Album Cover support
- Podcast support
- Tag editing support
- Playlist support
- Pretty interface for file transfers &c.

Also, there's a "hang on exit" bug right now, but don't be afraid to "killall -9 amarok," as it won't affect your iPod. Sorry for the inconvenience, I'm tracking that one down fairly soon too.

Monday, July 7, 2008

Wanted: Portable Media Devices

So iPod support should be pretty well set by this next weekend, and the next thing on my list is support for MTP devices.

So, what's an MTP device? MTP = Media Transfer Protocol, a protocol Microsoft came up with for media devices. Examples of devices that use it? Pretty much every Creative Zen, iRiver, Samsung and Sandisk media device you can think of, which is why the support for these devices is so important.

But I'm at an impasse, since I don't actually _have_ any of these devices. The lack of devices is actually a pretty common issue for the Amarok project, which is where we come to you =). If you have access to a media device which you can donate for development , please let the Amarok team know at: amarok-device-donation@emailgoeshere.com. A list of devices that the project is looking for is available here. This will ensure that the people with these devices are happy people when Amarok 2 rolls around. Of particular urgency to the 2.0 release is the need for an MTP device (see list of MTP devices: here) Any of those devices will be a great help.

And, once I have one of those devices in hand and support starts rolling out, I ask anyone who has an MTP device to check out a copy of Amarok 2 from your friendly neighborhood svn server to help me test things out and make support be _good_ (see: here)

Lastly, thanks in advance to all of you!

Thursday, June 26, 2008

Ipod Collections Visible

As predicted would be done by today, Ipod collections are now visible in Amarok 2 if an iPod is plugged in at Amarok 2 loadtime. I'll add signal/slot stuff so that you can plug in later at a later time. Songs are playable, but track information edit attempts crash amarok, and it's hanging on exit probably due to some voodoo static_cast that I'm using. Instead of the 30-90 seconds of Amarok 1.4 freezing loading my ipod, this takes less than 1 second and freezes nothing. Anyway, screenshots:

As you can see, UTF8 support is there, although there's some funky business with Album grouping atm but I'll get to that. There's a long series of known bugs right now, so please don't bother me just yet with them as they're mostly obvious ones =p

This is a big milestone for me, as I can start to see that what I'm doing is quite possible. Still a long road ahead, but we're on our way.

Getting Close to Displaying Collection

Back! A week of finals and a week of vacation later, here I am.

Set back by that, and git-svn losing my code, I'm still on a fairly good track. I don't think anyone really gets how dense the legacy Ipod code is except for Max, but it's a beast. In the end I won't be needing most of it, but it's hard to tell before checking it all.

I've gotten an itdb (itunes database struct) to read the ipod and parse the songlist just now, though I'm still at a loss for figuring out when to initialize or not, or even why we need initialize, but I'll get to that later. The bottom line is, that it's just a matter of using this info to fill in the Meta data and get a collection displaying! =D

Nikolaj recommended that I set up a separate MediaBrowser KVBox-based singlecollectiontreeview thing for testing, which I'm not all too sure how to do, but I'll just rip some code out of the servicebrowser probably. For my own purposes, I'll keep it in the collection view for a bit longer.

Hopefully my next blog will show a screenshot of an IpodCollection being displayed.

Sunday, June 8, 2008

MediaDevice vs. MediaDeviceCollection

So I'm running into a wall at the moment. The code for recognizing a device, initializing it, and doing any kind of transaction with it, is already there in MediaDevice, its subclasses, and MediaBrowser.

The idea of creating a MediaDeviceCollection was to benefit from a unified way of fetching and displaying information about a given group of music files. The MediaBrowser does more than this, and deals with specific media device interactions (like connect, disconnect, device-specific actions). So why bother using a collection here at all?

Tuesday, June 3, 2008

A week later... not much done...

A combination of school/life/compile issues have meant that I haven't done a lot. I added libgpod as an optional package to Amarok, and started to play around using the MediaDeviceCache in the MediaDeviceCollection but still haven't figured out how to get it to be run by Amarok automatically like Daap, so still a ways to go before I get something semi-functional.

I've decided I'm probably tossing out a lot of the old media device code, as it's being superceded by Meta and Collection stuff, and I have a feeling the ipod-specific code will be going away as well (that file is a nightmare =p ). The MediaBrowser was a good idea, but its code almost makes me want to cry, yet I'm still trying to figure out what to do on that.

But all that needs to be done now is a simple collection showing songs so I have something real to begin with.

After next week school ends, and more hacking can begin! =D

Monday, May 26, 2008

First Day of Coding

Finally got my environment set up a few days ago, turns out Qt was compiled with some very strange flags and it was having a ripple effect on kdelibs. I was gone last weekend in Berkeley and had some school stuff to catch up on, but I did get a bit started at least.

I started looking into collections, and I ripped off the Daap directory, ripped out the Daap references and replaced it with MediaDevice and now I have a new toy to play with =). There's a lot of things that aren't commented on too much, like Observer in MetaBase, but I'm sure it'll make sense with a bit more time. Other than that, making a collection seems pretty straightforward (albeit involved).

I'm trying to find a balance between studying the MediaDevice code and Collection code since I'll have to end up using both, but since I'm going to be using both in related ways there doesn't seem to be a way around this. Either way, I hope I get my first real commit sometime next week (this week is going to be a bit involved with schoolwork as well).

Saturday, May 17, 2008

New Laptop

My cell phone camera doesn't take great shots, but this'll do. First is of the laptop itself, running Firefox on KDE 4. Second of the fingerprint scanner.


Lenovo Thinkpad T61p
Kubuntu 8.04 Hardy Heron KDE 4 Remix
Intel Core 2 Duo 2.5 GHz 6144kb cache (each core) 800 MHz FSB
160 GB 7200 RPM Hard Drive
nVidia Quadro FX 570M 256MB
2 Gb PC-5700 667 MHz
Fingerprint Reader


Despite Windows Vista's best attempts to stop me from shrinking the partition, I did it anyway, though I guess I'll have to "recover" Vista later, when I feel like a masochist and want to run Windows. That aside, Kubuntu works like a charm, so I'm pretty satisfied. Only regret is that I don't have enough time right now to do anything for Amarok, thanks again to school. Hope to have free time starting Tuesday.

Thursday, May 15, 2008

Media Device Support for Amarok 2 in Google's Summer of Code

It looks like I'll be the one bringing media devices back for the next major version of Amarok.

Looks awesome so far right?  Well there's still a lot missing, and media device support is part of that.  My job is going to be adding iPod, MTP, and generic device support.  Over the next many many weeks, I'm going to try to keep track of what I'm doing here, but I don't promise anything too exciting non-technically speaking =p

Status Report:

I've looked into the MediaDeviceCache stuff that interfaces with Solid, KDE 4's backend for hardware recognition, and it's amazingly simple.  Solid code is beautiful and easy to read, I like =).

I started looking into MediaDevicePluginManager but haven't gotten too deep into it yet.

One of the ultimate goals of this project is to implement a Collection class, tentatively called MediaDeviceCollection, which will let songs on a media device get all the advantages of any other Collection, and I believe a few more that are specific to media devices (e.g. sync'ing of music, artwork).  I haven't made progress there yet because I'm still working on the previous stuff, but it's on the backburner.  Hopefully I'll have a more concrete idea of how that'll work after some more discussion with other devs.

In other news, my laptop has arrived!  So I'll spend a good part of this weekend setting it up for development.

Wednesday, February 20, 2008

KDE4 on Gentoo

After weeks of trying to get to setting up a KDE4 development environment for Amarok, success is finally at my door =D. First Kubuntu and kdesvn-build needing every dependency imaginable and building issues, then Gentoo and the broken qt-4.4 ebuilds, but a combination of kdesvn-build and manually building Amarok has finally granted me my dream.

For a higher quality version, download from here(note: .ogv file) : http://www.filesend.net/download.php?f=03f4722730dfa9115d143701fd0d3db1

For an avi version (lesser quality a bit) :

Monday, February 18, 2008

KDE4 on OS X 10.4

(From left to right: Konqueror, KPatience, KStars)

So it turns out KDE4 isn't just being ported to Windows, but Mac as well (universal binaries, both PPC and x86).  It runs slow for now, and a lot of stuff doesn't work, but the games and education programs work alright.  Very exciting stuff.  Soon as Konqueror and Amarok 2 start working properly it'll be a happy day for OS X users, or... not.  The new Konqueror will be using Webkit (Safari's engine, which itself is based on KHTML, Konqueror's current engine), and iTunes will likely run faster than Amarok.  But at least tech demos can be done natively... all the easier to then lure people to an FOSS system =)

Firefox's Gecko vs. KHTML and Webkit

Firefox has a large user and developer base which has led to its wide circulation and varied plugins, but some things are hurting.  The Gecko rendering engine pales in comparison to Konqueror's KHTML and Safari's Webkit.  The same pages take up to about 3x as long to render in Gecko.  While KHTML has issues rendering Google-related things such as Gmail and Google documents, Webkit shows no such failure and will become Konqueror's new engine soon.  Plugins aside, once Konqueror from KDE 4 becomes a standard, the developer community around it should expand and Firefox will begin to see a big run for its money.

On Macintosh OS 10.4, Firefox not only takes roughly 5-10x as long to load as Safari but eats up resources substantially.  At one point, when not loading any videos and with 4 tabs open, Firefox was eating 40-60% of cpu time and my fans were blaring.  One minute after closing it, the machine's responsiveness picked up and the fans slowed to a near halt.
On Gentoo, Konqueror also loads significantly faster than Firefox, and Firefox is there also a proc/memory hog.

Recently I tested Firefox 3 beta on Kubuntu Hardy and I have to say, it's not getting any faster and actually I can notice a further slowdown.  If Mozilla doesn't do something soon, it might find itself losing favor in the community.

Saturday, February 16, 2008

Kubuntu PPC

After some painstaking efforts, I got Kubuntu running on my PPC Powerbook G4 a few months ago, and recently upgraded to Hardy. After 7.04 or so, Ubuntu stopped officially supporting the PPC platform and it really is starting to show. Configuration and installation issues aside, the computer runs hot, the fans are always blaring, and the speed is remarkably slow. These are probably the result of the kernel using non-specific drivers, the lack of a PPC nVidia driver that isn't terrible, and generic configuration without any real testing.

I don't really like OS X, but given that I can't get an x86-based laptop any time soon, I was hoping to run Linux on PPC but it seems I'm barking up the wrong tree. Gentoo is out of the question given the struggle this poor old processor goes through compiling the smallest of things. Linux is a good alternative, but perhaps the PPC world isn't a good place to be.