This afternoon JP asked if Banshee should not fetch CD metadata through MusicBrainz if there wasn’t an available network connection; Nat and I also discussed related ideas a few months ago, and I felt like taking a few hours to diverge from the normal code base this evening, so it was perfect timing to implement a nice, simple piece of “functional candy.”

I ended up writing some quick NetworkManager C# “bindings” using dbus-sharp and the NetworkManager DBus API. They’re mostly complete: no dialup support and no wireless network creation support. The manager, device, and network objects are supported, with only a select few method implementations missing on each. Signals work, though I’m pretty pissed at System.Reflection.EventInfo.GetRaiseMethod() (see NetworkManager.Manager.InvokeEvent(string) for juicy details in Manager.cs).

For those interested in viewing the code or even using it in your C# programs, it is checked in.

In Banshee there is a new class, Banshee.Base.NetworkDetect, which has an event to notify other classes that a connection is either up or down, and has a basic Connected property. If NetworkManager can’t be found, it’s always assumed that a connection is available. There should probably be some kind of non-NetworkManager fall back, but it’s not really that important. If you have NetworkManager, great, if not, oh well.

This now means that, for example, if you started Banshee and you were offline, and then inserted an audio CD, Banshee would not attempt to fetch the metadata from MusicBrainz. However, you then connect and are online, and NetworkManager fires a signal, Banshee propagates it to the audio CD object, and it fetches metadata automagically. How cute.

WordPress database error: [Table './abockwordpress/wp_comments' is marked as crashed and last (automatic?) repair failed]
SELECT * FROM wp_comments WHERE comment_post_ID = '42' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply

Note: My Blog is actually not a technical support forum. Please use our wonderful Banshee community resources or just file a bug. I will delete comments that are really just bug reports unless they amuse me and I feel inclined to reply with wit or sarcasm. Also, be nice. I don't like flaming zealots.