Alejandro Wainzinger

Inhalt abgleichen
My experiences in programming for or using [F]OSS and related software.
Aktualisiert: vor 4 Minuten 55 Sekunden

Media Devices Applet

October 7, 2008 - 06:00
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.
Kategorien: Planet Amarok

"Absence," Akademy and Devices

August 26, 2008 - 01:44
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!
Kategorien: Planet Amarok

MTP File Management and iPod Covers

July 27, 2008 - 16:05
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.


Kategorien: Planet Amarok

MTP Support Arrives

July 25, 2008 - 00:18


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

Kategorien: Planet Amarok

MTP Incoming and Ipod File Deletion Support

July 14, 2008 - 03:55
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.
Kategorien: Planet Amarok

Ipod File Transfer Support Arrives

July 9, 2008 - 11:08
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.

Details:
- 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.
Kategorien: Planet Amarok

Wanted: Portable Media Devices

July 7, 2008 - 22:46
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!
Kategorien: Planet Amarok

Ipod Collections Visible

June 27, 2008 - 06:49
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.
Kategorien: Planet Amarok

Getting Close to Displaying Collection

June 26, 2008 - 07:02
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.
Kategorien: Planet Amarok