r2602 - in trunk/src/target/OM-2007.2/applications: . openmoko-mediaplayer openmoko-mediaplayer/images openmoko-mediaplayer/src

abraxa at sita.openmoko.org abraxa at sita.openmoko.org
Thu Aug 2 03:55:03 CEST 2007


Author: abraxa
Date: 2007-08-02 03:54:44 +0200 (Thu, 02 Aug 2007)
New Revision: 2602

Added:
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/AUTHORS
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/COPYING
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/Makefile.am
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/NEWS
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/README
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/TODO
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/autogen.sh
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/configure.ac
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/Makefile.am
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/background.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white-p.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-ffwd.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-list.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-nexttrack.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-pause.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-play.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-prevtrack.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-repeat.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-rwd.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-shuffle.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-time.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-track.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-01.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-02.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-03.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-04.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-05.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-06.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-07.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-08.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-09.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-10.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-11.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-12.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--1.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--2.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--3.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-0.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-1.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-2.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-3.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-00.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-01.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-02.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-03.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-04.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-05.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-06.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-07.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-08.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-09.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-10.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider-bar.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider_btn.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.desktop
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.png
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/Makefile.am
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.h
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.h
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.h
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.h
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.c
   trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.h
Log:
Import of current media player development

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/AUTHORS
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/AUTHORS	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/AUTHORS	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,138 @@
+BMP - beep media player (C) GPL 2003-2005
+
+Authors alphabetically
+----------------------
+
+Artem Baguinski <artm at v2.nl>
+Edward Brocklesby <ejb at goth.net>
+Chong Kai Xiong <descender at phreaker.net>
+Milosz Derezynski <m.derezynski at arcor.de>
+David Lau <coder_sku at users.sourceforge.net>
+Ole Andre Vadla Ravnaas <oleavr at jblinux.net>
+Michiel Sikkes <michiel at eyesopened.nl>
+
+ClearSky skin by Will Reinhart <willsan at xepher.net>
+
+
+Patch Authors
+-------------
+
+Andrei Badea
+Peter Behroozi
+Bernard Blackham
+Oliver Blin
+David Le Brun
+Tomas Bzatek
+Liviu Danicel
+Jon Dowland
+Artur Frysiak
+Sebastian Kapfer
+Lukas Koberstein
+Dan Korostelev
+Oliver Lehmann
+Jolan Luff
+Mike Lundy
+Michael Marineau
+Tim-Philipp Muller
+Julien Portalier
+Andrew Ruder
+Olivier Samyn
+John Spray
+Takashi Iwai
+Martijn Vernooij
+Thierry Vignaud
+
+
+Translators
+-----------
+
+Brazilian Portuguese - Philipi Pinto <philipi at gmx.net>
+Breton               - Thierry Vignaud <tvignaud at mandrakesoft.com>
+Czech                - Jan Narovec <jnarovec at students.zcu.cz>
+Dutch                - Laurens Buhler <masterpe at xs4all.nl>
+German               - Matthias Debus <psic4t at netbands.de>
+Georgian             - George Machitidze <giomac at global-erty.net>
+Greek                - Kouzinopoulos Haris <haris at mpa.gr>
+                       Stavros Giannouris <stavrosg2002 at freemail.gr>
+Finnish              - Pauli Virtanen <pauli.virtanen at hut.fi>
+French               - David Le Brun <david at dyn-ns.net>
+Hindi                - Dhananjaya Sharma <dysxhi at yahoo.co.in>
+Hungarian            - Laszlo Dvornik <dvornik at gnome.hu>
+Italian              - Alessio D'Ascanio <otaku at fastwebnet.it>
+Japanese             - Takeshi Aihana <aihana at gnome.gr.jp>
+Korean               - DongCheon Park <dcpark at kaist.ac.kr>
+Lithuanian           - Rimas Kudelis <rq at akl.lt>
+Macedonian 	     - Arangel Angov <ufo at linux.net.mk>
+Polish               - Jacek Wolszczak <shutdownrunner at o2.pl>
+Romanian             - Liviu Danicel <liviu.danicel at spymac.com>
+Russian              - Pavlo Bohmat <bohm at ukr.net>
+                       Dan Korostelev <dan at ats.energo.ru>
+                       Vitaly Lipatov <lav at altlinux.ru>
+Simplified Chinese   - Chong Kai Xiong <descender at phreaker.net>
+Traditional Chinese  - Chao-Hsiung Liao <pesder.liao at msa.hinet.net>
+Slovak               - Pavel Kanzelsberger <kanzels at zmail.sk>
+Spanish              - Francisco Javier F. Serrador <serrador at cvs.gnome.org>
+Swedish              - Martin Persenius <martin at persenius.net>
+Ukrainian            - Mykola Lynnyk<definer at users.sf.net>
+Welsh                - Edward Brocklesby <ejb at goth.net>
+                       (Based on XMMS from Rhoslyn Prys <rhoslyn.prys at meddal.org.uk>)
+
+
+(please tell us if we left your name out)
+
+-
+
+Based on:
+
+XMMS - X Multimedia System (C)1998-2003
+
+       Main Programming: Peter Alm
+
+ Additional Programming: Håvard Kvålen
+                         Derrik Pates
+
+   With Additional Help: Sean Atkinson
+                         Jorn Baayen
+                         James M. Cape
+                         Anders Carlsson (effect plugins)
+                         Chun-Chung Chen (xfont patch)
+                         Tim Ferguson (joystick plugin)
+                         Ben Gertzfield
+                         Vesa Halttunen
+                         Logan Hanks
+                         Eric L. Hernes (FreeBSD patches)
+                         Ville Herva
+                         higway (MMX)
+                         Michael Hipp and others (MPG123 engine)
+                         Olle Hällnäs (compiling fixes)
+                         David Jacoby
+                         Osamu Kayasono (3DNow!)
+                         Lyle B Kempler
+                         J. Nick Koston (MikMod plugin)
+                         Aaron Lehmann
+                         Johan Levin (echo + stereo plugin)
+                         Eric Lindvall
+                         Colin Marquardt
+                         Willem Monsuwe
+                         John Riddoch (Solaris plugin)
+                         Josip Rodin
+                         Pablo Saratxaga (i18n)
+                         Carl van Schaik (pro logic plugin)
+                         Jörg Schuler
+                         Charles Sielski (irman plugin)
+                         Espen Skoglund
+                         Matthieu Sozeau (ALSA plugin)
+                         Kimura Takuhiro (3DNow!)
+                         Zinx Verituse
+                         Ryan Weaver (RPMs among other things)
+                         Chris Wilson
+                         Dave Yearke
+                         Stephan K. Zitz
+
+           Default skin: Leonard "Blayde" Tan
+                         Robin Sylvestre (Equalizer and Playlist)
+                         Thomas Nilsson (New titles, and cleanups)
+
+  Homepage and Graphics: Thomas Nilsson
+
+       Support and Docs: Olle Hällnäs


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/AUTHORS
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/COPYING
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/COPYING	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/COPYING	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/COPYING
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/Makefile.am	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/Makefile.am	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,12 @@
+AUTOMAKE_OPTIONS = foreign
+SUBDIRS = src images intl
+# po
+
+
+EXTRA_DIST = openmoko-mediaplayer.desktop openmoko-mediaplayer.png
+
+desktopdir = $(datadir)/applications/
+desktop_DATA = openmoko-mediaplayer.desktop
+
+pixmapsdir = $(datadir)/pixmaps/
+pixmaps_DATA = openmoko-mediaplayer.png


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/Makefile.am
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/NEWS
===================================================================


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/NEWS
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/README
===================================================================


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/README
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/TODO
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/TODO	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/TODO	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,18 @@
+
+UI:
+	Add repeat mode indicator (different button pixmaps)
+	
+Backend:
+	Use GConf
+	
+Issues:
+	How/where to store playlists? -> Single common path, omitting path chooser
+	How to adjust volume/panning?
+	Use EQ presets only or allow individual band adjustment?
+	How to adjust equalizer?
+
+Build process:
+	Add libspiff/libexpat/uriparser dependencies to Makefile.am
+
+Documentation:
+	Dependencies: libspiff->libexpat/uriparser


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/TODO
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/autogen.sh
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/autogen.sh	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/autogen.sh	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,4 @@
+#! /bin/sh
+autoreconf -v --install || exit 1
+./configure --enable-maintainer-mode "$@"
+


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/autogen.sh
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/configure.ac
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/configure.ac	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/configure.ac	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,59 @@
+AC_PREREQ(2.53)
+AC_INIT(openmoko-mediaplayer, 0.0.1, http://openmoko.org)
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR(src/main.c)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+AC_ISC_POSIX
+AC_PROG_CC
+AC_STDC_HEADERS
+AC_PROG_LIBTOOL
+
+AM_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.12.1])
+
+# Check for GTK/GLib/GThread/Pango, dbus, OpenMoko libs, gstreamer, expat, uriparser and XSPF
+
+PKG_CHECK_MODULES(GTK, [glib-2.0 >= 2.4.0 gtk+-2.0 >= 2.4.0 gthread-2.0 pango],,
+	AC_MSG_ERROR([*** Cannot find glib2/gtk2/gthread/pango ***]))
+
+PKG_CHECK_MODULES(DBUS, [dbus-glib-1 >= 0.23.4],,
+	AC_MSG_ERROR([*** Cannot find dbus-glib-1 ***]))
+
+#PKG_CHECK_MODULES(OPENMOKO, [openmoko-libs >= 0.0.1],,
+#	AC_MSG_ERROR([*** Required OpenMoko Libraries >= 0.0.1 not installed ***]))
+
+PKG_CHECK_MODULES(GSTREAMER, [gstreamer-0.10 >= 0.10],,
+	AC_MSG_ERROR([*** Cannot find gstreamer ***]))
+
+LIBS="-lexpat -L${prefix}/lib $LIBS"
+CFLAGS="-I${prefix}/include"
+AC_CHECK_LIB(expat, XML_Parse, [], [echo "Error: libexpat not found"; exit -1])
+
+LIBS="-luriparser $LIBS"
+AC_CHECK_LIB(uriparser, uriParseUriW, [], [echo "Error: liburiparser not found"; exit -1])
+
+LIBS="-lspiff $LIBS"
+AC_CHECK_LIB(spiff, spiff_parse, [], [echo "Error: XSPF library (libspiff) not found"; exit -1])
+
+
+
+LIBS="$GTK_LIBS $OPENMOKO_LIBS $GSTREAMER_LIBS $LIBS"
+CFLAGS="$OPENMOKO_CFLAGS $GSTREAMER_CFLAGS $CFLAGS"
+
+localedir=$datadir/locale
+AC_SUBST(localedir)
+
+OMP_DEFINES="-DDATA_DIR=\\\"$datadir/openmoko-mediaplayer\\\" -DLOCALEDIR=\\\"$localedir\\\""
+AC_SUBST(OMP_DEFINES)
+
+
+AC_CONFIG_FILES([
+    Makefile
+    src/Makefile
+    images/Makefile
+    po/Makefile.in
+    intl/Makefile
+])
+AC_OUTPUT


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/configure.ac
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/Makefile.am	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/Makefile.am	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,49 @@
+imagesdir = $(datadir)/openmoko-mediaplayer/images
+
+images_DATA = \
+	background.png \
+	btn-white.png \
+	btn-white-p.png \
+	ico-track.png \
+	ico-time.png \
+	ico-pause.png \
+	ico-play.png \
+	ico-ffwd.png \
+	ico-rwd.png \
+	ico-nexttrack.png \
+	ico-prevtrack.png \
+	ico-repeat.png \
+	ico-shuffle.png \
+	ico-list.png \
+	ind-music-eq-01.png \
+	ind-music-eq-02.png \
+	ind-music-eq-03.png \
+	ind-music-eq-04.png \
+	ind-music-eq-05.png \
+	ind-music-eq-06.png \
+	ind-music-eq-07.png \
+	ind-music-eq-08.png \
+	ind-music-eq-09.png \
+	ind-music-eq-10.png \
+	ind-music-eq-11.png \
+	ind-music-eq-12.png \
+	ind-music-pan-0.png \
+	ind-music-pan--1.png \
+	ind-music-pan-1.png \
+	ind-music-pan--2.png \
+	ind-music-pan-2.png \
+	ind-music-pan--3.png \
+	ind-music-pan-3.png \
+	ind-music-volume-00.png \
+	ind-music-volume-01.png \
+	ind-music-volume-02.png \
+	ind-music-volume-03.png \
+	ind-music-volume-04.png \
+	ind-music-volume-05.png \
+	ind-music-volume-06.png \
+	ind-music-volume-07.png \
+	ind-music-volume-08.png \
+	ind-music-volume-09.png \
+	ind-music-volume-10.png  
+
+EXTRA_DIST = $(images_DATA)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/Makefile.am
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/background.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/background.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white-p.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white-p.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/btn-white.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-ffwd.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-ffwd.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-list.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-list.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-nexttrack.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-nexttrack.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-pause.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-pause.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-play.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-play.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-prevtrack.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-prevtrack.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-repeat.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-repeat.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-rwd.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-rwd.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-shuffle.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-shuffle.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-time.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-time.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-track.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ico-track.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-01.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-01.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-02.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-02.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-03.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-03.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-04.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-04.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-05.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-05.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-06.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-06.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-07.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-07.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-08.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-08.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-09.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-09.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-10.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-10.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-11.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-11.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-12.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-eq-12.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--1.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--1.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--2.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--2.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--3.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan--3.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-0.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-0.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-1.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-1.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-2.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-2.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-3.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-pan-3.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-00.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-00.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-01.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-01.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-02.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-02.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-03.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-03.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-04.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-04.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-05.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-05.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-06.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-06.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-07.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-07.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-08.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-08.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-09.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-09.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-10.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/ind-music-volume-10.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider-bar.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider-bar.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider_btn.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/images/slider_btn.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.desktop
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.desktop	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.desktop	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=Media Player
+Comment=Play media
+Exec=openmoko-mediaplayer
+Icon=openmoko-mediaplayer
+MimeType=audio/x-scpls;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/x-wav;application/x-ogg;
+Categories=Application;AudioVideo;Player;
+Terminal=false
+Type=Application
+Encoding=UTF-8
+SingleInstance=true


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.desktop
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/openmoko-mediaplayer.png
___________________________________________________________________
Name: svn:executable
   + 
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/Makefile.am	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/Makefile.am	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,29 @@
+AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \
+              -DPKGDATADIR=\"$(pkgdatadir)\"
+
+#AM_CFLAGS = -Wall -pedantic -std=c99 @OPENMOKO_CFLAGS@
+AM_CFLAGS = -Wall -pedantic -std=c99
+
+bin_PROGRAMS = openmoko-mediaplayer
+
+openmoko_mediaplayer_LDADD = \
+        $(GTK_LIBS) \
+        $(DBUS_LIBS) \
+        $(OPENMOKO_LIBS)
+
+openmoko_mediaplayer_CFLAGS = \
+        $(GTK_CFLAGS) \
+        $(DBUS_CFLAGS) \
+        $(OPENMOKO_CFLAGS) \
+	$(OMP_DEFINES) \
+        -I$(top_srcdir) \
+        -I$(top_srcdir)/intl
+
+INCLUDES = $(openmoko_mediaplayer_CFLAGS)
+
+openmoko_mediaplayer_SOURCES = \
+        main.c main.h \
+	mainwin.c mainwin.h \
+	playlist.c playlist.h \
+	playback.c playback.h \
+	guitools.c guitools.h


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/Makefile.am
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.c	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.c	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,117 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file guitools.c
+ * Various helper functions to aid with GUI creation and handling
+ */
+
+#include "guitools.h"
+
+
+
+/**
+ * Loads an image from a file into a pixel buffer
+ */
+GdkPixbuf*
+pixbuf_new_from_file(const gchar* file_name)
+{
+	gchar* image_file_name;
+	GdkPixbuf* pixbuf = NULL;
+	GError* error = NULL;
+
+	image_file_name = g_strdup_printf("%s/%s", ui_image_path, file_name);
+
+	if(g_file_test(image_file_name, G_FILE_TEST_EXISTS))
+	{
+		pixbuf = gdk_pixbuf_new_from_file(image_file_name, &error);
+		if(!pixbuf)
+		{
+			g_print("File found but failed to load: %s\n", image_file_name);
+			g_error_free(error);
+		}
+	} else {
+		g_debug("Can't find %s\n", image_file_name);
+	}
+
+	g_free(image_file_name);
+	return pixbuf;
+}
+
+/**
+ * Creates a label with default properties, wraps it up in a GtkAlignment and returns the latter for direct use
+ * @param label Will be filled with a GtkLabel
+ * @param font_info The desired font to be used (e.g. "Times 10")
+ * @param xalign Horizontal alignment (0..1)
+ * @param yalign Vertical alignment (0..1)
+ * @param xscale Horizontal expansion (0..1)
+ * @param yscale Vertical expansion (0..1)
+ * @note See gtk_alignment_new() for further info
+ */
+GtkWidget*
+create_label(GtkWidget **label, gchar *font_info, gchar *color_desc,
+	gfloat xalign, gfloat yalign, gfloat xscale, gfloat yscale,
+	gint max_char_count)
+{
+	GdkColor color;
+	PangoFontDescription *font_desc;
+
+	GtkWidget *alignment = gtk_alignment_new(xalign, yalign, xscale, yscale);
+	*label = gtk_label_new(NULL);
+
+	font_desc = pango_font_description_from_string(font_info);
+	gtk_widget_modify_font(*label, font_desc);
+	pango_font_description_free(font_desc);
+	gtk_label_set_width_chars(GTK_LABEL(*label), max_char_count);
+	gtk_misc_set_alignment(GTK_MISC(*label), 0, 0.5);
+	gtk_label_set_ellipsize(GTK_LABEL(*label), PANGO_ELLIPSIZE_END);
+
+	gdk_color_parse(color_desc, &color);
+	gtk_widget_modify_fg(GTK_WIDGET(*label), GTK_STATE_NORMAL, &color);
+
+	gtk_container_add(GTK_CONTAINER(alignment), *label);
+
+	return alignment;
+}
+
+/**
+ * Loads an image from disk and adds it to a given container, returning a reference to the image as well
+ */
+void
+container_add_image_with_ref(GtkContainer *container, gchar *image_name, GtkWidget **image)
+{
+	gchar *image_file_name;
+
+	image_file_name = g_build_path("/", ui_image_path, image_name, NULL);
+	*image = gtk_image_new_from_file(image_file_name);
+	g_free(image_file_name);
+	gtk_container_add(GTK_CONTAINER(container), GTK_WIDGET(*image));
+}
+
+/**
+ * Loads an image from disk and adds it to a given container
+ */
+void
+container_add_image(GtkContainer *container, gchar *image_name)
+{
+	GtkWidget *image;
+	container_add_image_with_ref(container, image_name, &image);
+}


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.c
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.h	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.h	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,41 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file guitools.h
+ * Various helper functions to aid with GUI creation and handling
+ */
+
+#ifndef _GUITOOLS_H
+#define _GUITOOLS_H
+
+#include <gtk/gtk.h>
+
+#define RELATIVE_UI_IMAGE_PATH "/images"
+gchar *ui_image_path;				///< Absolute path to the UI pixmaps
+
+GdkPixbuf *pixbuf_new_from_file(const gchar* file_name);
+GtkWidget *create_label(GtkWidget **label, gchar *font_info, gchar *color_desc, gfloat xalign, gfloat yalign, gfloat xscale, gfloat yscale, gint max_char_count);
+void container_add_image(GtkContainer *container, gchar *image_name);
+void container_add_image_with_ref(GtkContainer *container, gchar *image_name, GtkWidget **image);
+
+
+#endif


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/guitools.h
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.c	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.c	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,403 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file main.c
+ * Main file
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gprintf.h>
+#include <gdk/gdk.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
+
+#include <spiff/spiff_c.h>
+
+#include "main.h"
+#include "guitools.h"
+#include "playlist.h"
+
+/// Determines how the segfault handler terminates the program
+//define HANDLE_SIGSEGV
+
+/// Enables GLib memory profiling when defined
+//define DEBUG_MEM_PROFILE
+
+
+/// The default configuration
+struct _omp_config omp_default_config =
+{
+	FALSE,
+	TRUE,
+	OMP_REPEAT_OFF,
+//	FALSE,
+	FALSE,
+	"%f",
+	0.0,
+	{0,0,0,0,0,0,0,0,0,0,0},
+	TRUE,
+	"",
+	"../../test.xspf",
+	0,
+	0
+};
+
+struct _omp_config *omp_config = NULL;			///< Global and persistent configuration data
+
+
+
+/*
+static void
+OMP_set_default_icon(void)
+{
+    //GdkPixbuf *icon;
+
+    //icon = gdk_pixbuf_new_from_xpm_data((const gchar **) OMP_player_icon);
+    //gtk_window_set_default_icon(icon);
+    //g_object_unref(icon);
+}
+
+void
+init_dbus()
+{
+    //added by lijiang
+    DBusConnection *bus;
+    DBusError error;
+
+    dbus_error_init(&error);
+    bus = dbus_bus_get(DBUS_BUS_SESSION, &error);
+    if(!bus)
+    {
+        g_print("Failed to connect to the D-Bus daemon: %s", error.message);
+	dbus_error_free(&error);
+	return;
+    }
+    dbus_connection_setup_with_g_main(bus, NULL);
+    dbus_bus_add_match(bus, "type='signal',interface='com.burtonini.dbus.Signal'", &error);
+    dbus_connection_add_filter(bus, signal_filter, mainwindow, NULL);
+    //added end
+
+}
+*/
+
+/**
+ * SIGSEGV signal handler
+ */
+static void
+handler_sigsegfault(int value)
+{
+	g_printerr(_("Received SIGSEGV\n"
+		"This could be a bug in the OpenMoko Media Player.\n\n"));
+
+#ifdef HANDLE_SIGSEGV
+	exit(EXIT_FAILURE);
+#else
+	abort();
+#endif
+}
+
+/**
+ * SIGUSR1 signal handler
+ * @todo Should bring currently active window to front - which isn't necessarily the main window
+ */
+static void
+handler_sigusr1(int value)
+{
+	// Bring main window to front
+	omp_main_window_show();
+
+	// Re-install handler
+	signal(SIGUSR1, handler_sigusr1);
+}
+
+/**
+ * Load configuration and restore player state from last session
+ */
+void
+omp_config_restore_state()
+{
+	// This mustn't be called more than once
+	g_assert(omp_config == NULL);
+
+	// Set default config
+	omp_config = g_new(struct _omp_config, 1);
+	g_memmove(omp_config, &omp_default_config, sizeof(struct _omp_config));
+
+	// Load config and last used playlist if set
+	omp_config_load();
+
+	if (omp_config->playlist_file[0])
+	{
+		omp_playlist_load(omp_config->playlist_file);
+	}
+
+	// Check whether playlist_position is valid
+	if (!omp_playlist_set_current_track(omp_config->playlist_position))
+	{
+		// Reset playlist state as it must have been modified since it was last loaded
+		omp_config->playlist_position = 0;
+		omp_config->track_position = 0;
+	} 
+
+	// Feed the track entity to the playback engine to obtain track information
+	omp_playlist_load_current_track();
+}
+
+/**
+ * Releases resources allocated for configuration data
+ */
+void
+omp_config_free()
+{
+	g_free(omp_config);
+}
+
+/**
+ * Saves the current configuration data to persistent storate
+ */
+void
+omp_config_save()
+{
+}
+
+/**
+ * Reads the configuration data from persistent storage
+ */
+void
+omp_config_load()
+{
+}
+
+/**
+ * Updates config with current player data and saves it to disk 
+ */
+void
+omp_config_update()
+{
+	omp_config->playlist_position = omp_playlist_current_track_id;
+
+	omp_config_save();
+}
+
+
+/**
+ * Tests for a lock file and returns the pid of any process already running
+ */
+pid_t
+test_lock(gchar *file_name)
+{
+	gint fd;
+	struct flock fl;
+
+	fd = open(file_name, O_WRONLY, S_IWUSR);
+
+	if (fd < 0)
+	{
+		if (errno == ENOENT)
+		{
+			return 0;
+		} else {
+			g_printerr("Lock file test failed!\n");
+			return -1;
+		}
+	}
+
+	fl.l_type = F_WRLCK;
+	fl.l_whence = SEEK_SET;
+	fl.l_start = 0;
+	fl.l_len = 0;
+
+	if (fcntl(fd, F_GETLK, &fl) < 0)
+	{
+		close(fd);
+		return -1;
+	}
+
+	close(fd);
+
+	return (fl.l_type == F_UNLCK) ? 0 : fl.l_pid;
+}
+
+/**
+ * Sets a lock file
+ */
+void
+set_lock(gchar *file_name)
+{
+	gint fd;
+	struct flock fl;
+
+	fd = open(file_name, O_WRONLY|O_CREAT,  S_IWUSR);
+	if (fd < 0)
+	{
+		g_printerr("Failed opening lock file\n");
+		return;
+	}
+
+	fl.l_type = F_WRLCK;
+	fl.l_whence = SEEK_SET;
+	fl.l_start = 0;
+	fl.l_len = 0;
+
+	if (fcntl(fd, F_SETLK, &fl) < 0)
+	{
+		g_printerr("Failed writing lock file\n");
+		close(fd);
+	}
+}
+
+/**
+ * Makes sure only one instance of the media player is running at a time
+ * @todo Single-instance mechanism needs to be improved
+ */
+void
+handle_locking()
+{
+	gchar *lock_file = "/tmp/mediaplayer.lock";
+	pid_t pid;
+
+	pid = test_lock(lock_file);
+	if (pid > 0)
+	{
+		g_printf(_("Already running an instance of the Media Player, bringing that to the front instead.\n"));
+		kill(pid, SIGUSR1);
+		return;
+	}
+
+	set_lock(lock_file);
+}
+
+/**
+ * If only I knew what this is
+ */
+gint
+main(int argc, char *argv[])
+{
+#ifdef DEBUG_MEM_PROFILE
+	g_mem_set_vtable(glib_mem_profiler_table);
+#endif
+
+	// Set l10n up early so we can print localized error messages
+	gtk_set_locale();
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	bind_textdomain_codeset(PACKAGE, "UTF-8");
+	textdomain(PACKAGE);
+
+	// Check for threads support and initialize them if available
+	g_thread_init(NULL);
+	if (!g_thread_supported())
+	{
+		g_printerr(_("Sorry, threads aren't supported on your platform.\n\n"
+			"If you're on a libc5 based linux system and installed Glib & GTK+ before you\n"
+			"installed LinuxThreads then you need to recompile Glib & GTK+.\n"));
+		exit(EXIT_FAILURE);
+	}
+
+	gdk_threads_init();
+	gdk_threads_enter();
+
+	// Initialize miscellaneous things needed for the remote control interface
+	g_random_set_seed(time(NULL));
+
+	// See if user wants a GUI or just remote control an already running instance
+	if (!gtk_init_check(&argc, &argv))
+	{
+		if (argc < 2)
+		{
+			/* GTK check failed, and no arguments passed to indicate
+				 that user is intending to only remote control a running
+				 session */
+			g_printerr(_("Unable to initialize GTK+, exiting. Maybe set a proper display?\n"));
+			exit(EXIT_FAILURE);
+		}
+
+		/// @todo Handle remote controlling here
+		exit(EXIT_SUCCESS);
+	}
+
+	// Make sure we have only one instance running
+	handle_locking();
+
+	// Initialize gstreamer, must be last in the chain of command line parameter processors
+
+	if (!gst_init_check(&argc, &argv))
+	{
+		g_printerr(_("Unable to initialize gstreamer, exiting.\n"
+			"As gstreamer also fails to initialize when encountering unknown "
+			"command line parameters you should check those as well.\n"));
+		exit(EXIT_FAILURE);
+	}
+
+	// Initialize various things necessary for the full player UI
+	ui_image_path = g_build_filename(DATA_DIR, RELATIVE_UI_IMAGE_PATH, NULL);
+
+	g_set_application_name(_("Media Player"));
+	gtk_window_set_default_icon_name("openmoko-mediaplayer");
+
+	// Set up signal handlers
+	signal(SIGSEGV, handler_sigsegfault);
+	signal(SIGUSR1, handler_sigusr1);
+
+	// Load config and restore playback state
+	omp_config_restore_state();
+
+	// Initialize playback, playlist and UI handling
+	omp_main_window_create();
+	omp_playback_init();
+	omp_playlist_init();
+	omp_main_connect_signals();
+	omp_main_update_track_info();
+	omp_main_window_show();
+
+	gtk_main();
+	gdk_threads_leave();
+
+	// Store and free configuration resources
+	omp_config_save();
+	omp_config_free();
+
+	// Free remaining resources
+	omp_playback_free();
+	omp_playlist_free();
+	gst_deinit();
+
+#ifdef DEBUG_MEM_PROFILE
+	g_mem_profile();
+#endif
+
+	return EXIT_SUCCESS;
+}


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.c
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.h	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.h	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,65 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file main.h
+ * Main file
+ */
+
+#ifndef _MAIN_H
+#define _MAIN_H
+
+/// Modes available for repetitive track playback
+enum omp_repeat_modes
+{
+	OMP_REPEAT_OFF,									///< Repeat off
+	OMP_REPEAT_CURRENT_ONCE,				///< Repeat current track once, then proceed with next track
+	OMP_REPEAT_CURRENT,							///< Repeat current track forever
+	OMP_REPEAT_PLAYLIST							///< Repeat playlist
+};
+
+/// Session-persistent configuration data
+struct _omp_config
+{
+	gboolean shuffle;								///< Shuffle on/off
+	gboolean resume_playback;				///< Resume playback on startup where it left off?
+	gint repeat_mode;								///< Repeat mode @see omp_repeat_modes
+//	gboolean auto_scroll;						///< Scroll title if it's too long?
+	gboolean convert_underscore;		///< Convert '_' to ' '?
+	gchar title_format[32];					///< Format string used for title display
+	gdouble equalizer_gain;					///< Pre-amplification value before audio stream is fed to equalizer [0.0..1.0]
+	gdouble equalizer_bands[11];		///< The gains for each of the equalizer bands [-1.0..1.0]
+	gboolean show_numbers_in_pl;		///< Show numbers in playlist?
+	gchar filesel_path[256];				///< Last path used in the file selection dialog
+//	gchar *playlist_path;						///< Last path used for the playlist selection dialog
+	gchar playlist_file[256];				///< Path and file name of current (=last used) playlist
+	gint playlist_position;					///< Position within the playlist
+	gint track_position;						///< Position to resume playback from within the last played track
+};
+
+extern struct _omp_config *omp_config;
+extern struct _omp_config omp_default_config;
+
+void omp_config_save();
+void omp_config_load();
+void omp_config_update();
+
+#endif


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/main.h
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.c	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.c	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,583 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file mainwin.c
+ * Main window handling
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include <gtk/gtk.h>
+
+#include "mainwin.h"
+#include "main.h"
+#include "guitools.h"
+#include "playlist.h"
+#include "playback.h"
+
+/// Contains all main window widgets that need to be changeable
+struct _main_widgets
+{
+	GtkWidget *title_label;
+	GtkWidget *artist_label;
+	GtkWidget *track_number_label;
+	GtkWidget *time_label;
+	GtkWidget *time_hscale;
+	GtkWidget *band_image[12];
+	GtkWidget *volume_image;
+	GtkWidget *volume_label;
+	GtkWidget *balance_image;
+	GtkWidget *play_pause_button;
+	GtkWidget *shuffle_button;
+	GtkWidget *repeat_button;
+	GtkWidget *playlist_button;
+} main_widgets;
+
+GtkWidget *omp_main_window = NULL;
+
+
+
+/**
+ * Terminate the entire program
+ */
+void
+omp_application_terminate()
+{
+	// Free resources
+	g_free(ui_image_path);
+
+	// Tell GTK to leave the message loop
+	gtk_main_quit();
+}
+
+/**
+ * Program termination event triggered by main window
+ */
+void
+omp_main_quit(GtkWidget* widget, gpointer data)
+{
+	omp_application_terminate();
+}
+
+/**
+ * Updates the UI volume display
+ * @param vol Volume to show, in percent
+ */
+void
+omp_change_vol_img(gint vol)
+{
+	// Sanity checks
+	if ( (vol < 0) || (vol > 100) )
+		g_printerr("Warning: volume passed to omp_change_vol_img() out of bounds\n");
+
+	gchar *image_file_name = g_strdup_printf("%s/ind-music-volume-%02d.png", ui_image_path, vol/10);
+	gtk_image_set_from_file(GTK_IMAGE(main_widgets.volume_image), image_file_name);
+
+	g_free(image_file_name);
+}
+
+/**
+ * Sets a desired EQ/visualization band to a new level
+ * @param pos Band to change (0..11)
+ * @param h Level to set (0..15, anything higher gets capped)
+ * @note The switch is supposed to make the levels pseudo-logarithmic?
+ */
+void
+omp_update_band(gint pos, gint level)
+{
+	// Sanity checks
+	g_return_if_fail( (pos < 0) && (pos > 11) );
+	g_return_if_fail(level > -1);
+
+	// Pseudo-logarithmize the value
+	gint value = 0;
+
+	switch (level)
+	{
+		case 0:
+		case 1:
+		case 2:
+			value = 1;
+			break;
+
+		case 3:
+		case 4:
+			value = 2;
+			break;
+
+		case 5:
+		case 6:
+			value = 3;
+			break;
+
+		case 7:
+		case 8:
+		case 9:
+		case 10:
+		case 11:
+		case 12:
+		case 13:
+		case 14:
+		case 15:
+			value = level-3;
+			break;
+
+		default:
+			value = 12;
+	}
+
+	// Determine file name of the new image to use and apply it
+	gchar *image_file_name = NULL;
+	image_file_name = g_strdup_printf("%s/ind-music-eq-%02d.png", ui_image_path, value);
+
+	gtk_image_set_from_file(GTK_IMAGE(main_widgets.band_image[pos]), image_file_name);
+//	gtk_widget_show(GTK_IMAGE(main_widgets.band_image[pos]));
+
+	g_free(image_file_name);
+}
+
+/**
+ * Set artist label [Mockup arrow #1 - upper line]
+ */
+void
+omp_set_artist(const gchar* artist)
+{
+	if (!artist)
+	{
+		gtk_label_set_text(GTK_LABEL(main_widgets.artist_label), "Unknown Artist");
+		return;
+	}
+
+	gtk_label_set_text(GTK_LABEL(main_widgets.artist_label), artist);
+}
+
+/**
+ * Set title label [Mockup arrow #1 - lower line]
+ */
+void
+omp_set_title(const gchar *title)
+{
+	if (!title)
+	{
+		gtk_label_set_text(GTK_LABEL(main_widgets.title_label), "Unknown Title");
+		return;
+	}
+
+	gtk_label_set_text(GTK_LABEL(main_widgets.title_label), title);
+}
+
+void
+omp_shuffle_button_callback(GtkWidget* widget, gpointer data)
+{
+/*    if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+    {
+	cfg.shuffle = TRUE;	    
+//	playlist_set_shuffle(TRUE);
+    }
+    else
+    {
+	cfg.shuffle= FALSE;
+//	playlist_set_shuffle(FALSE);
+    } */
+}
+
+void
+omp_repeat_button_callback(GtkWidget* widget, gpointer data)
+{
+    /*if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
+    {
+	cfg.repeat = TRUE;
+    }
+    else
+    {
+	cfg.repeat = FALSE;
+    }*/
+}
+
+void
+omp_playlist_button_callback(GtkWidget *sender, gpointer data)
+{
+	// ...
+}
+
+/**
+ * Event handler for the Play/Pause button
+ * @todo State change, etc
+ */
+void
+omp_main_button_play_pause_callback()
+{
+	omp_playback_play();
+}
+
+/**
+ * Creates a toggle button framed by a GtkAlignment
+ */
+GtkWidget*
+omp_toggle_button_create(gchar *image_name, gint pad_left, GCallback callback, GtkWidget **button)
+{
+	GtkWidget *image;
+	gchar *image_file_name;
+
+	GtkWidget *alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, pad_left, 0);
+
+	*button = gtk_toggle_button_new();
+	gtk_widget_set_size_request(GTK_WIDGET(*button), 66, 66);
+	gtk_widget_set_name(GTK_WIDGET(*button), "mokofingerbutton-white");
+	g_signal_connect(G_OBJECT(*button), "clicked", G_CALLBACK(callback), NULL);
+	GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(*button), GTK_CAN_FOCUS);
+	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(*button));
+
+	g_object_set(G_OBJECT(*button), "xalign", (gfloat)0.37, "yalign", (gfloat)0.37, NULL);
+
+	image_file_name = g_build_path("/", ui_image_path, image_name, NULL);
+	image = gtk_image_new_from_file(image_file_name);
+	g_free(image_file_name);
+	gtk_container_add(GTK_CONTAINER(*button), GTK_WIDGET(image));
+
+	return alignment;
+}
+
+/**
+ * Creates a button and returns it
+ */
+GtkWidget*
+omp_button_create(gchar *image_name, GCallback callback)
+{
+	GtkWidget *image, *button;
+	gchar *image_file_name;
+
+	button = gtk_button_new();
+	gtk_widget_set_size_request(GTK_WIDGET(button), 66, 66);
+	gtk_widget_set_name(GTK_WIDGET(button), "mokofingerbutton-white");
+	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(callback), NULL);
+	GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(button), GTK_CAN_FOCUS);
+
+	g_object_set(G_OBJECT(button), "xalign", (gfloat)0.37, "yalign", (gfloat)0.37, NULL);
+
+	image_file_name = g_build_path("/", ui_image_path, image_name, NULL);
+	image = gtk_image_new_from_file(image_file_name);
+	g_free(image_file_name);
+	gtk_container_add(GTK_CONTAINER(button), GTK_WIDGET(image));
+
+	return button;
+}
+
+/**
+ * Show the main window, create it first if necessary
+ */
+void
+omp_main_window_show()
+{
+	if (!omp_main_window)
+	{
+		omp_main_window_create();
+	}
+
+	gtk_widget_show(GTK_WIDGET(omp_main_window));
+}
+
+/**
+ * Hide the main window
+ */
+void
+omp_main_window_hide()
+{
+	gtk_widget_hide(GTK_WIDGET(omp_main_window));
+}
+
+/**
+ * Creates the main window's UI
+ */
+void
+omp_main_widgets_create(GtkContainer *destination)
+{
+	GtkWidget *alignment;
+	GtkWidget *mainvbox;
+	GtkWidget *background_vbox;
+	GtkWidget *upper_hbox, *middle_hbox, *lower_hbox, *controls_hbox;
+	GtkWidget *middle_right_vbox;
+	GtkWidget *image, *button;
+
+	gchar *image_file_name, *caption;
+	gint i;
+
+	// Add mainvbox to destination container
+	mainvbox = gtk_vbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(destination), GTK_WIDGET(mainvbox));
+
+	// Title label
+	alignment = create_label(&main_widgets.title_label, "Bitstream Vera Sans 24", "black", 0, 0, 1, 0, 18);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 18, 0, 50, 30);
+	gtk_label_set_text(GTK_LABEL(main_widgets.title_label), "No track available");
+	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	// Artist label
+	alignment = create_label(&main_widgets.artist_label, "Bitstream Vera Sans 14", "black", 0, 0, 1, 0, 30);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 50, 30);
+	gtk_label_set_text(GTK_LABEL(main_widgets.artist_label), "");
+	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	// --- --- --- --- --- Upper hbox --- --- --- --- ---
+
+	// Add upper_hbox to mainvbox for track number and time display
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 20, 0, 50, 30);
+	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	upper_hbox = gtk_hbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(upper_hbox));
+
+	// Track number icon
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 2, 0, 0, 15);
+	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	container_add_image(GTK_CONTAINER(alignment), "ico-track.png");
+
+	// Track number
+	alignment = create_label(&main_widgets.track_number_label, "Bitstream Vera Sans 14", "black", 0, 0, 0, 0, 12);
+	caption = g_strdup_printf(WIDGET_CAPTION_TRACK_NUM, 0, 0);
+	gtk_label_set_text(GTK_LABEL(main_widgets.track_number_label), caption);
+	g_free(caption);
+	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	// Time icon
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 2, 0, 48, 15);
+	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	container_add_image(GTK_CONTAINER(alignment), "ico-time.png");
+
+	// Time
+	alignment = create_label(&main_widgets.time_label, "Bitstream Vera Sans 14", "black", 0, 0, 0, 0, 12);
+	caption = g_strdup_printf(WIDGET_CAPTION_TRACK_TIME, 0, 0, 0, 0);
+	gtk_label_set_text(GTK_LABEL(main_widgets.time_label), caption);
+	g_free(caption);
+	gtk_box_pack_start(GTK_BOX(upper_hbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	// --- --- --- --- --- Slider --- --- --- --- ---
+
+	// Time hscale
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 5, 0, 48, 0);
+	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	main_widgets.time_hscale = gtk_hscale_new_with_range(0.0, 338.0, 1.0);
+	gtk_scale_set_draw_value(GTK_SCALE(main_widgets.time_hscale), FALSE);
+	GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(main_widgets.time_hscale), GTK_CAN_FOCUS);
+	gtk_widget_set_size_request(GTK_WIDGET(main_widgets.time_hscale), 338, 35);
+	gtk_range_set_value(GTK_RANGE(main_widgets.time_hscale), 0.0);
+//    g_signal_connect(G_OBJECT(time_hscale), "change_value",
+//		    G_CALLBACK(omp_main_set_time), NULL);
+	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(main_widgets.time_hscale));
+
+	// --- --- --- --- --- Middle hbox --- --- --- --- ---
+
+	// Add middle_hbox to mainvbox for the EQ/volume/balance widgets
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 41, 0, 70, 0);
+	gtk_box_pack_start(GTK_BOX(mainvbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+
+	middle_hbox = gtk_hbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(middle_hbox));
+
+	// EQ/Visualization bands
+	image_file_name = g_build_path("/", ui_image_path, "ind-music-eq-12.png", NULL);
+
+	for (i=0; i<12; i++)
+	{
+		alignment = gtk_alignment_new(0, 0, 0, 0);
+		gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 0, 0, 0, 0);
+		gtk_box_pack_start(GTK_BOX(middle_hbox), alignment, TRUE, TRUE, 0);
+		main_widgets.band_image[i] = gtk_image_new_from_file(image_file_name);
+		gtk_container_add(GTK_CONTAINER(alignment), GTK_WIDGET(main_widgets.band_image[i]));
+	}
+
+	g_free(image_file_name);
+
+	// Add vbox containing volume and balance controls
+	middle_right_vbox = gtk_vbox_new(FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(middle_hbox), GTK_WIDGET(middle_right_vbox), TRUE, TRUE, 0);
+
+	// Volume hbox
+	GtkWidget* volume_box = gtk_hbox_new(FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(middle_right_vbox), volume_box, TRUE, TRUE, 0);
+
+	// Volume image
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 4, 0, 25, 0);
+	gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-volume-00.png", &main_widgets.volume_image);
+
+	// Volume label
+	alignment = create_label(&main_widgets.volume_label, "Sans 14", "darkorange", 0, 0, 1, 0, 4);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 6, 0, 10, 0);
+	gtk_box_pack_start(GTK_BOX(volume_box), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	caption = g_strdup_printf(WIDGET_CAPTION_VOLUME, 0);
+	gtk_label_set_text(GTK_LABEL(main_widgets.volume_label), caption);
+	g_free(caption);
+
+	//  Balance image
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 10, 0, 35, 0);
+	gtk_box_pack_start(GTK_BOX(middle_right_vbox), GTK_WIDGET(alignment), TRUE, TRUE, 0);
+	container_add_image_with_ref(GTK_CONTAINER(alignment), "ind-music-pan-0.png", &main_widgets.balance_image);
+
+	// --- --- --- --- --- Lower hbox --- --- --- --- ---
+
+	// Add lower hbox containing the three rectangular buttons
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 25, 0, 0, 0);
+	gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
+	lower_hbox = gtk_hbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(alignment), lower_hbox);
+
+	// Shuffle toggle button
+	alignment = omp_toggle_button_create("ico-shuffle.png", 108, G_CALLBACK(omp_shuffle_button_callback), &main_widgets.shuffle_button);
+	gtk_box_pack_start(GTK_BOX(lower_hbox), alignment, TRUE, TRUE, 0);
+
+	// Repeat toggle button
+	alignment = omp_toggle_button_create("ico-repeat.png", 10, G_CALLBACK(omp_repeat_button_callback), &main_widgets.repeat_button);
+	gtk_box_pack_start(GTK_BOX(lower_hbox), alignment, TRUE, TRUE, 0);
+
+	// Playlist button
+	alignment = omp_toggle_button_create("ico-list.png", 10, G_CALLBACK(omp_playlist_button_callback), &main_widgets.playlist_button);
+	gtk_box_pack_start(GTK_BOX(lower_hbox), alignment, TRUE, TRUE, 0);
+
+	// --- --- --- --- --- Player controls --- --- --- --- --- ---
+
+	alignment = gtk_alignment_new(0, 0, 1, 0);
+	gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 40, 0, 0, 0);
+	gtk_box_pack_start(GTK_BOX(mainvbox), alignment, TRUE, TRUE, 0);
+
+	controls_hbox = gtk_hbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(alignment), controls_hbox);
+
+	gtk_box_set_homogeneous(GTK_BOX(controls_hbox), TRUE);
+
+	// Previous Track button
+	button = omp_button_create("ico-prevtrack.png", G_CALLBACK(omp_playlist_set_prev_track));
+	gtk_box_pack_start(GTK_BOX(controls_hbox), button, TRUE, TRUE, 0);
+	gtk_box_set_child_packing(GTK_BOX(controls_hbox), GTK_WIDGET(button), FALSE, FALSE, 0, GTK_PACK_START);
+
+	// Rewind button
+	button = omp_button_create("ico-rwd.png", G_CALLBACK(omp_shuffle_button_callback));
+	gtk_box_pack_start(GTK_BOX(controls_hbox), button, TRUE, TRUE, 0);
+	gtk_box_set_child_packing(GTK_BOX(controls_hbox), GTK_WIDGET(button), FALSE, FALSE, 0, GTK_PACK_START);
+
+	// Play/Pause button
+	button = omp_button_create("ico-play.png", G_CALLBACK(omp_main_button_play_pause_callback));
+	gtk_box_pack_start(GTK_BOX(controls_hbox), button, TRUE, TRUE, 0);
+	gtk_box_set_child_packing(GTK_BOX(controls_hbox), GTK_WIDGET(button), FALSE, FALSE, 0, GTK_PACK_START);
+
+	// Fast Forward button
+	button = omp_button_create("ico-ffwd.png", G_CALLBACK(omp_shuffle_button_callback));
+	gtk_box_pack_start(GTK_BOX(controls_hbox), button, TRUE, TRUE, 0);
+	gtk_box_set_child_packing(GTK_BOX(controls_hbox), GTK_WIDGET(button), FALSE, FALSE, 0, GTK_PACK_START);
+
+	// Next Track button
+	button = omp_button_create("ico-nexttrack.png", G_CALLBACK(omp_playlist_set_next_track));
+	gtk_box_pack_start(GTK_BOX(controls_hbox), button, TRUE, TRUE, 0);
+	gtk_box_set_child_packing(GTK_BOX(controls_hbox), GTK_WIDGET(button), FALSE, FALSE, 0, GTK_PACK_START);
+}
+
+/**
+ * Create the main window and all its UI elements
+ * @todo Make all widget positions and aligments relative
+ */
+void
+omp_main_window_create()
+{
+	GtkWidget *alignment, *bg_muxer;
+
+	// Sanity check
+	g_assert(omp_main_window == NULL);
+
+	bg_muxer = gtk_fixed_new();
+
+	// Create the main window
+	omp_main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	gtk_window_set_title(GTK_WINDOW(omp_main_window), _("Media Player"));
+	gtk_container_add(GTK_CONTAINER(omp_main_window), GTK_WIDGET(bg_muxer));
+	g_signal_connect(G_OBJECT(omp_main_window), "destroy", G_CALLBACK(omp_main_quit), NULL);
+
+	// Background image
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	container_add_image(GTK_CONTAINER(alignment), "background.png");
+	gtk_fixed_put(GTK_FIXED(bg_muxer), GTK_WIDGET(alignment), 15, 30);
+	
+	// Create all widgets
+	alignment = gtk_alignment_new(0, 0, 0, 0);
+	omp_main_widgets_create(GTK_CONTAINER(alignment));
+	gtk_fixed_put(GTK_FIXED(bg_muxer), GTK_WIDGET(alignment), 20, 47);
+
+	// Show everything but the window itself
+	gtk_widget_show_all(GTK_WIDGET(bg_muxer));
+
+	return;
+}
+
+/**
+ * Attaches the event handlers to the appropriate signals
+ * @note Can't be done in omp_main_window_create() because the signals need to be created first by the subsystems
+ */
+void
+omp_main_connect_signals()
+{
+	g_signal_connect(G_OBJECT(omp_main_window), OMP_EVENT_PREV_TRACK, G_CALLBACK(omp_main_update_track_info), NULL);
+	g_signal_connect(G_OBJECT(omp_main_window), OMP_EVENT_NEXT_TRACK, G_CALLBACK(omp_main_update_track_info), NULL);
+}
+
+
+/**
+ * Evaluates current track information and updates the config/UI if necessary
+ */
+void
+omp_main_update_track_info()
+{
+	static gint old_track_count = 0;
+	static gint old_track_id = 0;
+
+	gchar *text;
+
+	// Track id/track count changed?
+	if ( (omp_playlist_track_count != old_track_count) || (omp_playlist_current_track_id != old_track_id) )
+	{
+		old_track_count = omp_playlist_track_count;
+		old_track_id = omp_playlist_current_track_id;
+
+		// Update config
+		omp_config_update();
+
+		// Update UI
+		text = g_strdup_printf(WIDGET_CAPTION_TRACK_NUM, omp_playlist_current_track_id+1, omp_playlist_track_count);
+		gtk_label_set_text(GTK_LABEL(main_widgets.track_number_label), text);
+		g_free(text);
+	}
+
+
+}
+


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.c
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.h	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.h	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,47 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file mainwin.h
+ * Main window handling
+ */
+
+#ifndef _MAINWIN_H
+#define _MAINWIN_H
+
+#include <gtk/gtk.h>
+
+#define WIDGET_CAPTION_TRACK_TIME "%d:%.2d / %d:%.2d"
+#define WIDGET_CAPTION_TRACK_NUM "%.3d / %.3d"
+#define WIDGET_CAPTION_VOLUME "%d%%"
+
+extern GtkWidget *omp_main_window;
+
+void omp_application_terminate();
+
+void omp_main_window_show();
+void omp_main_window_hide();
+void omp_main_window_create();
+void omp_main_connect_signals();
+
+void omp_main_update_track_info();
+
+#endif


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/mainwin.h
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.c	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.c	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,157 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file playback.c
+ * Playback engine interface
+ */
+
+#include <gst/gst.h>
+
+#include "playback.h"
+#include "mainwin.h"
+
+GstElement *omp_gst_playbin = NULL;
+
+
+
+/**
+ * Initializes gstreamer by setting up pipe, message hooks and bins
+ */
+void
+omp_playback_init()
+{
+	GstBus *bus;
+
+	// Bail if everything is already set up
+	if (omp_gst_playbin)
+	{
+		return;
+	}
+
+	// Create the signals we'll emit
+	g_signal_new(OMP_EVENT_PLAYBACK_EOS, G_TYPE_OBJECT, 0, 0, 0, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL);
+
+	// Set up gstreamer pipe and bins
+	omp_gst_playbin = gst_element_factory_make("playbin", "play");
+
+	// Set up message hooks
+	bus = gst_pipeline_get_bus(GST_PIPELINE(omp_gst_playbin));
+
+	gst_bus_add_signal_watch(bus);
+	g_signal_connect(bus, "message::eos", 		G_CALLBACK(omp_gst_message_eos), NULL);
+	g_signal_connect(bus, "message::error", 	G_CALLBACK(omp_gst_message_error), NULL);
+	g_signal_connect(bus, "message::warning", G_CALLBACK(omp_gst_message_warning), NULL); 
+
+	gst_object_unref(bus);
+}
+
+/**
+ * Releases resources used for gstreamer handling
+ */
+void
+omp_playback_free()
+{
+	if (!omp_gst_playbin)
+	{
+		return;
+	}
+
+	gst_element_set_state(omp_gst_playbin, GST_STATE_NULL);
+	gst_object_unref(GST_OBJECT(omp_gst_playbin));
+}
+
+/**
+ * Attempts to load a track from an URI
+ */
+gboolean
+omp_playback_load_track_from_uri(gchar *uri)
+{
+	// Make sure we are all set
+	if (!omp_gst_playbin)
+	{
+		omp_playback_init();
+	}
+
+	// DEBUG
+	g_printf("Loading %s\n", uri);
+
+	g_object_set(G_OBJECT(omp_gst_playbin), "uri", uri, NULL);
+
+	gst_element_set_state(omp_gst_playbin, GST_STATE_PAUSED);
+}
+
+/**
+ * Starts playback of the current stream
+ */
+void
+omp_playback_play()
+{
+	// DEBUG
+	g_print("Starting playback\n");
+
+	gst_element_set_state(omp_gst_playbin, GST_STATE_PLAYING);
+}
+
+/**
+ * Handles gstreamer's end-of-stream notification
+ */
+static gboolean
+omp_gst_message_eos(GstBus *bus, GstMessage *message, gpointer data)
+{
+	// DEBUG
+	g_printf("End of stream reached.\n");
+
+	g_signal_emit_by_name(G_OBJECT(omp_main_window), OMP_EVENT_PLAYBACK_EOS);
+
+	return TRUE;
+}
+
+/**
+ * Handles gstreamer's error messages
+ */
+static gboolean
+omp_gst_message_error(GstBus *bus, GstMessage *message, gpointer data)
+{
+	GError *error;
+
+	gst_message_parse_error(message, &error, NULL);
+	g_printerr("gstreamer error: %s\n", error->message);
+	g_error_free(error);
+
+	return TRUE;
+}
+
+/**
+ * Handles gstreamer's warnings
+ */
+static gboolean
+omp_gst_message_warning(GstBus *bus, GstMessage *message, gpointer data)
+{
+	GError *error;
+
+	gst_message_parse_error(message, &error, NULL);
+	g_printerr("gstreamer warning: %s\n", error->message);
+	g_error_free(error);
+
+	return TRUE;
+}
+


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.c
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.h	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.h	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,45 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file playback.h
+ * Playback engine interface
+ */
+
+#ifndef _PLAYBACK_H
+#define _PLAYBACK_H
+
+#include <gst/gst.h>
+
+#define OMP_EVENT_PLAYBACK_EOS "playback_end_of_stream"
+
+void omp_playback_init();
+void omp_playback_free();
+
+gboolean omp_playback_load_track_from_uri(gchar *uri);
+
+void omp_playback_play();
+
+static gboolean omp_gst_message_eos(GstBus *bus, GstMessage *message, gpointer data);
+static gboolean omp_gst_message_error(GstBus *bus, GstMessage *message, gpointer data);
+static gboolean omp_gst_message_warning(GstBus *bus, GstMessage *message, gpointer data);
+
+#endif


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playback.h
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.c	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.c	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,343 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file playlist.c
+ * Playlist handling
+ */
+
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <glib-object.h>
+#include <spiff/spiff_c.h>
+
+#include "playlist.h"
+#include "main.h"
+#include "mainwin.h"
+#include "playback.h"
+
+struct spiff_list *omp_playlist = NULL;										///< Loaded playlist
+guint omp_playlist_track_count = 0;												///< Number of tracks stored within the current playlist
+
+struct spiff_track *omp_playlist_current_track = NULL;		///< Current track's data
+guint omp_playlist_current_track_id = -1;									///< Numerical id of the current track within the playlist
+
+/// This linked list holds all tracks that were played in this session, most recently played entry first
+GSList *omp_track_history = NULL;
+
+/// Single element for the track history
+struct omp_track_history_entry
+{
+	struct spiff_track *track;
+	guint track_id;
+};
+
+
+
+/**
+ * Initialize all things playlist
+ */
+void
+omp_playlist_init()
+{
+	// Hook up event handlers to the playback routines
+	g_signal_connect(G_OBJECT(omp_main_window), OMP_EVENT_PLAYBACK_EOS, G_CALLBACK(omp_playlist_process_eos_event), NULL);
+
+	// Create the signals we emit: no params, no return value
+	g_signal_new(OMP_EVENT_PREV_TRACK, G_TYPE_OBJECT, 0, 0, 0, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL);
+	g_signal_new(OMP_EVENT_NEXT_TRACK, G_TYPE_OBJECT, 0, 0, 0, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, NULL);
+}
+
+/**
+ * Frees resouces allocated for playlist handling
+ */
+void
+omp_playlist_free()
+{
+	// Free the track history's memory by deleting the first element until the list is empty
+	while (omp_track_history)
+	{
+		g_free(omp_track_history->data);
+		omp_track_history = g_slist_delete_link(omp_track_history, omp_track_history);
+	}
+
+	// Let XSPF clean up, too
+	if (omp_playlist)
+	{
+		spiff_free(omp_playlist);
+	}
+}
+
+/**
+ * Load playlist
+ * @todo Count playlist entries on load, trigger "playlist loaded" event to update UI
+ */
+void
+omp_playlist_load(gchar *playlist_file)
+{
+	if (omp_playlist)
+	{
+		spiff_free(omp_playlist);
+	}
+
+	// Update config unless target and source are the same
+	if (omp_config->playlist_file != playlist_file)
+	{
+		g_snprintf(omp_config->playlist_file, sizeof(omp_config->playlist_file), "%s", playlist_file);
+	}
+
+	// Load playlist
+	omp_playlist = spiff_parse(playlist_file);
+
+	if (!omp_playlist)
+	{
+		g_printerr("Could not load playlist: %s\n", playlist_file);
+	}
+}
+
+/**
+ * Tries to set the position within the playlist and indicates success/failure
+ * @param playlist_pos New position, counting starts at 0
+ */
+gboolean
+omp_playlist_set_current_track(gint playlist_pos)
+{
+	gboolean position_valid = FALSE;
+	struct spiff_track *track;
+	gint track_num = 0;
+
+	// DEBUG
+	g_printf("Setting current track to #%d\n", playlist_pos);
+
+	// Walk through the playlist and see if the new position is valid
+	for (track=omp_playlist->tracks; track!=NULL; track=track->next, track_num++)
+	{
+		if (track_num == playlist_pos)
+		{
+			omp_playlist_current_track		= track;
+			omp_playlist_current_track_id	= track_num;
+			position_valid = TRUE;
+		}
+	}
+
+	if (position_valid)
+	{
+		omp_playlist_track_count = track_num;
+	}
+
+	return position_valid;
+}
+
+/**
+ * Moves one track backwards in playlist
+ * @return TRUE if a new track is to be played, FALSE if current track didn't change
+ * @todo What to do in shuffle mode if track history is empty?
+ */
+gboolean
+omp_playlist_set_prev_track()
+{
+	struct omp_track_history_entry *history_entry;
+	struct spiff_track *track;
+	gboolean is_new_track = FALSE;
+
+	if (!omp_playlist_current_track)
+	{
+		return;
+	}
+
+	// Do we have tracks in the history to go back to?
+	if (omp_track_history)
+	{
+		history_entry = (struct omp_track_history_entry*)(omp_track_history->data);
+		omp_playlist_current_track		= history_entry->track;
+		omp_playlist_current_track_id	= history_entry->track_id;
+		
+		// Delete first entry from the list
+		g_free(history_entry);
+		omp_track_history = g_slist_delete_link(omp_track_history, omp_track_history);
+
+		is_new_track = TRUE;
+
+	} else {
+
+		// Is current track the first in the playlist?
+		// If not, find track previous to the current one
+		if (omp_playlist_current_track != omp_playlist->tracks)
+		{
+			track = omp_playlist->tracks;
+
+			while ( (track->next) && (track->next != omp_playlist_current_track) )
+			{
+				track = track->next;
+			}
+
+			// We only found the previous track if we're not at the end of the list
+			if (track->next)
+			{
+				omp_playlist_current_track		= track;
+				omp_playlist_current_track_id--;
+			}
+		}
+	}
+
+	if (is_new_track)
+	{
+		// Emit signal to update UI and the like
+		g_signal_emit_by_name(G_OBJECT(omp_main_window), OMP_EVENT_PREV_TRACK);
+	}
+
+	return is_new_track;
+}
+
+/**
+ * Moves one track forward in playlist
+ * @return TRUE if a new track is to be played, FALSE if current track didn't change
+ * @todo Shuffle mode, repeat
+ */
+gboolean
+omp_playlist_set_next_track()
+{
+	struct omp_track_history_entry *history_entry;
+	gboolean is_new_track = FALSE;
+
+	if (!omp_playlist_current_track)
+	{
+		return;
+	}
+
+	// Prepare the history entry - if we don't need it we'll just free it again
+	history_entry = g_new(struct omp_track_history_entry, 1);
+	history_entry->track = omp_playlist_current_track;
+	history_entry->track_id = omp_playlist_current_track_id;
+
+	// Do we have a track to play?
+	if (omp_playlist_current_track->next)
+	{
+		omp_playlist_current_track = omp_playlist_current_track->next;
+		omp_playlist_current_track_id++;
+
+		// Yes, we were able to find a new track to play
+		is_new_track = TRUE;
+	}
+
+	if (is_new_track)
+	{
+		// Add track to track history
+		omp_track_history = g_slist_prepend(omp_track_history, (gpointer)history_entry);
+
+		// Emit signal to update UI and the like
+		g_signal_emit_by_name(G_OBJECT(omp_main_window), OMP_EVENT_NEXT_TRACK);
+
+	} else {
+
+		// We're not making use of the history entry as the track didn't change
+		g_free(history_entry);
+	}
+
+	return is_new_track;
+}
+
+/**
+ * Signal handler that gets called whenever the current stream ends
+ */
+void omp_playlist_process_eos_event()
+{
+	if (omp_playlist_set_next_track())
+	{
+		if (omp_playlist_load_current_track())
+		{
+//			omp_playback_play();
+		}
+	}
+}
+
+/**
+ * Uses the URI(s) and metadata information of a track to locate the resource to play, then returns a playable URI
+ * @return URI of a playable resource
+ * @note If the URI of the found resource is not in the track's locations list already it is added and the playlist saved
+ * @todo Actually make this function do what it's supposed to do :)
+ */
+gchar*
+omp_playlist_resolve_track(struct spiff_track *track)
+{
+	if (!track)
+	{
+		g_printerr("Resolve request for an undefined track, returning null as URI.\n");
+		return NULL;
+	}
+
+	if (track->locations->value)
+	{
+		return(g_strdup(track->locations->value));
+	} else {
+		g_printerr("Resolve request for a track without a valid location, ignoring. Will be implemented later.\n");
+		return NULL;
+	}
+}
+
+/**
+ * Tries to resolve the current track and feed it to gstreamer
+ * @return FALSE if current track and all remaining tracks in playlist failed to load, TRUE otherwise
+ * @todo Will cause an infinite loop/stack overflow if playlist only consists of tracks that can't be played and player is in shuffle mode
+ */
+gboolean
+omp_playlist_load_current_track()
+{
+	gchar *track_uri;
+	gboolean track_loaded;
+
+	// Make sure we got something to handle
+	if (!omp_playlist_current_track)
+	{
+		return;
+	}
+
+	// Resolve playlist entry to make it available for playback
+	track_uri = omp_playlist_resolve_track(omp_playlist_current_track);
+
+	// Let gstreamer have its fun
+	if (track_uri)
+	{
+		track_loaded = omp_playback_load_track_from_uri(track_uri);
+		g_free(track_uri);
+		return TRUE;
+
+	} else {
+
+		track_loaded = FALSE;
+	}
+
+	if (!track_loaded)
+	{
+		// Track not available for playback - move on if possible by trying to
+		// play the next track until we succeed or reach the end of the playlist
+		while (omp_playlist_set_next_track())
+		{
+			if (omp_playlist_load_current_track())
+			{
+				return TRUE;
+			}
+		}
+	}
+
+	return FALSE;
+}
+


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.c
___________________________________________________________________
Name: svn:executable
   + 

Added: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.h
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.h	2007-08-01 23:20:22 UTC (rev 2601)
+++ trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.h	2007-08-02 01:54:44 UTC (rev 2602)
@@ -0,0 +1,57 @@
+/*
+ *  OpenMoko Media Player
+ *   http://openmoko.org/
+ *
+ *  Copyright (C) 2007 by the OpenMoko team
+ *
+ *  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.
+ */
+
+/**
+ * @file playlist.h
+ * Playlist handling
+ */
+
+#ifndef _PLAYLIST_H
+#define _PLAYLIST_H
+
+#include <spiff/spiff_c.h>
+
+#define OMP_EVENT_PREV_TRACK "prev_track"
+#define OMP_EVENT_NEXT_TRACK "next_track"
+
+
+extern struct _omp_playlist_events omp_playlist_events;
+
+
+extern struct spiff_list *omp_playlist;
+extern guint omp_playlist_track_count;
+
+extern struct spiff_track *omp_playlist_current_track;
+extern guint omp_playlist_current_track_id;
+
+void omp_playlist_init();
+void omp_playlist_free();
+void omp_playlist_load(gchar *playlist_file);
+
+gboolean omp_playlist_set_current_track(gint playlist_pos);
+gboolean omp_playlist_set_prev_track();
+gboolean omp_playlist_set_next_track();
+void omp_playlist_process_eos_event();
+
+gchar *omp_playlist_resolve_track(struct spiff_track *track);
+gboolean omp_playlist_load_current_track();
+
+#endif


Property changes on: trunk/src/target/OM-2007.2/applications/openmoko-mediaplayer/src/playlist.h
___________________________________________________________________
Name: svn:executable
   + 





More information about the commitlog mailing list