Commits

Anonymous committed 53aa274

Initial import from mimms-2.0.1.tar.bz2

Comments (0)

Files changed (8)

+Original Author: Wesley J. Landaker <wjl@icecavern.net>
+Project Website: <https://savannah.nongnu.org/projects/mimms/>
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 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.
+2006-08-17 20:04  wjl
+
+	* mimms.cpp (tags: RELEASE_2_0_1): Incrementing version number.
+
+2006-08-17 20:03  wjl
+
+	* Makefile (tags: RELEASE_2_0_1), mimms.cpp: Fixed output logic for
+	  timeout message.
+
+2006-08-17 19:54  wjl
+
+	* mimms.cpp: Make the -t option work.
+
+2006-08-17 19:26  wjl
+
+	* CHANGELOG, Makefile, mimms.1 (tags: RELEASE_2_0_1), mimms.cpp:
+	  Fix manpage; no more buggy roff. ChangeLog is now autogenerated
+	  by the changelog make target.
+
+2006-06-05 02:11  wjl
+
+	* mimms.1: Fix capitalization in manpage.
+
+2006-06-05 01:55  wjl
+
+	* README (tags: RELEASE_2_0_1), mimms.1, mimms.cpp: Fix acronym
+	  expansion.
+
+2006-06-05 01:17  wjl
+
+	* Makefile (tags: RELEASE_2_0_0): Don't nuke the manpage in clean
+
+2006-06-05 01:17  wjl
+
+	* mimms.1 (tags: RELEASE_2_0_0): Fix to man page.
+
+2006-06-05 01:15  wjl
+
+	* Makefile, README (tags: RELEASE_2_0_0), mimms.1: More updates.
+
+2006-06-05 00:40  wjl
+
+	* Makefile, README, mimms.cpp (tags: RELEASE_2_0_0): Fix exit bug
+
+2006-06-05 00:37  wjl
+
+	* Makefile: Final updates(?)
+
+2006-06-05 00:35  wjl
+
+	* Makefile, README: Updated Makefile
+
+2006-06-05 00:24  wjl
+
+	* mimms.pro (tags: RELEASE_2_0_1, RELEASE_2_0_0): Build release
+	  versions.
+
+2006-06-05 00:22  wjl
+
+	* mimms.cpp: Fix typo.
+
+2006-06-05 00:22  wjl
+
+	* CHANGELOG (tags: RELEASE_2_0_0), README: Updates to README and
+	  CHANGELOG
+
+2006-06-05 00:14  wjl
+
+	* AUTHORS (tags: RELEASE_2_0_1, RELEASE_2_0_0), ChangeLog, DOCS,
+	  Makefile, README, mimms.1.txt2man, mimms.cpp, mimms.pro: New
+	  code.
+
+2006-06-04 23:47  wjl
+
+	* AUTHORS, COPYING (tags: RELEASE_2_0_1, RELEASE_2_0_0), Doxyfile,
+	  NEWS, THANKS, mimms.cpp, mmsurls: Cleaning up.
+
+2005-05-06 04:21  wjl
+
+	* ChangeLog: Code push from my SVN; added a start on doxygen
+	  documentation; added TUT testing framework for doing unit tests.
+
+2005-05-06 04:13  wjl
+
+	* Doxyfile: Code push from my SVN; added a start on doxygen
+	  documentation; added TUT testing framework for doing unit tests.
+
+2005-05-06 04:10  wjl
+
+	* mimms.cpp: Code push from my SVN; added a start on doxygen
+	  documentation; added TUT testing framework for doing unit tests.
+
+2005-04-29 01:59  wjl
+
+	* ChangeLog, Makefile, mimms.cpp: Fixed a few potential buffer
+	  overflows; trying to fix some segfaults.
+
+2005-04-29 01:11  wjl
+
+	* ChangeLog, mimms.1.txt2man, mimms.cpp: Added clobber option, with
+	  default of non-clobbering.
+
+2005-03-26 02:51  wjl
+
+	* ChangeLog, README, THANKS, mimms.cpp: Miscellanious minor
+	  internal code improvements.
+
+2004-10-22 14:43  wjl
+
+	* mimms.cpp: Non +cvs version.
+
+2004-10-22 14:42  wjl
+
+	* mimms.cpp: Updated version number.
+
+2004-10-22 14:37  wjl
+
+	* ChangeLog, mimms.cpp: Fix to get_data()
+
+2004-10-22 14:35  wjl
+
+	* THANKS: Updated THANKS.
+
+2004-10-22 14:33  wjl
+
+	* ChangeLog, DOCS, mimms.cpp: Various fixes, see ChangeLog.
+
+2004-10-22 14:18  wjl
+
+	* mimms.1.txt2man: Fixed weird unicode apostrophe appearing in
+	  manpage.
+
+2004-09-12 18:01  wjl
+
+	* mmsurls: Updated list of mmsurls
+
+2004-09-12 17:30  wjl
+
+	* mimms.cpp: Trying to use RCS $ for version.
+
+2004-09-12 17:29  wjl
+
+	* mimms.cpp: Version info now reflects date and time.
+
+2004-09-12 17:25  wjl
+
+	* mimms.cpp: Updated version for release.
+
+2004-09-12 17:24  wjl
+
+	* mimms.cpp: Updated version after tagging.
+
+2004-09-12 17:21  wjl
+
+	* AUTHORS, THANKS: Split AUTHORS to THANKS, since those people
+	  aren't authors, but still ought to be listed.
+
+2004-09-12 17:19  wjl
+
+	* AUTHORS, ChangeLog, mimms.cpp: Updated ChangeLog.
+
+2004-09-12 17:07  wjl
+
+	* mimms.cpp: Fixed always timing out.
+
+2004-09-11 20:42  wjl
+
+	* mimms.cpp: Added --version parameter.
+
+2004-09-11 19:46  wjl
+
+	* mimms.cpp (tags: RELEASE_0_0_7): Fixed time being in MINUTES not
+	  seconds.
+
+2004-09-11 19:37  wjl
+
+	* mimms.cpp: Fixed typo in mimms.cpp
+
+2004-09-11 19:33  wjl
+
+	* AUTHORS (tags: RELEASE_0_0_7), ChangeLog (tags: RELEASE_0_0_7),
+	  Makefile (tags: RELEASE_0_0_7), bswap.h, gettext.h, ltconfig,
+	  mimms.1, mimms.1.txt2man (tags: RELEASE_0_0_7), mimms.cpp:
+	  2004-09-11  Wesley J. Landaker <wjl@icecavern.net>
+
+		  * Converted command-line parsing to popt
+		  * Added -o, --output option for specifying output file
+		  * Added -t, --time option for limiting record time
+		  * Got rid of silly redundant bswap.h header
+		  * Now use txt2man to generate man page
+
+2004-08-30 19:39  wjl
+
+	* mimms.cpp: Added include of sys/socket.h so it would compile on
+	  some people's systems.
+
+2004-08-26 17:47  wjl
+
+	* AUTHORS, COPYING (tags: RELEASE_0_0_7), ChangeLog, Makefile, NEWS
+	  (tags: RELEASE_0_0_7), README (tags: RELEASE_0_0_7), bswap.h,
+	  gettext.h, ltconfig, mimms.1, mimms.cpp, mmsurls (tags:
+	  RELEASE_0_0_7): Initial release into Savannah CVS.
+
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+DESTDIR=
+
+QMAKE=qmake-qt4
+TXT2MAN=txt2man
+INSTALL=install
+
+all: build
+
+changelog:
+	cvs2cl --utc -P -t
+
+build: Makefile.qmake
+	$(MAKE) -f Makefile.qmake
+
+install: build
+	$(INSTALL) -m755 -D mimms   $(DESTDIR)/$(BINDIR)/mimms
+	$(INSTALL) -m644 -D mimms.1 $(DESTDIR)/$(MANDIR)/man1/mimms.1
+
+clean:
+	rm -f Makefile.qmake *.o mimms *~ 
+
+Makefile.qmake:
+	$(QMAKE) -o $@
+MiMMS 2.x - MiMMS isn't an MMS Message Sender.
+It's an MMS (e.g. mms://) stream downloader.
+
+MiMMS is a program designed to allow you to download streams using the MMS protocol
+and save them to your computer, as opposed to watching them live. Similar functionality
+is available in full media player suites such as Xine and MPlayer, but MiMMS is quick
+and easy to use, and for the time being, remains a useful program.
+
+Originally, MiMMS was forked directly from the last known version of mmsclient, which was
+for years unmaintained. MiMMS started with the following goals:
+
+  - Keep a working copy of "mmsclient" (now "MiMMS") maintained and working.
+  - Fix lots of the bugs that were in mmsclient
+  - Eventually extend the functionality of the program
+
+With the current 2.x series, MiMMS shares no code with mmsclient, and actually does all of
+it's MMS operations using libmms, a new library based off of the xine-improved mmsclient
+code, which is designed to allow multiple implementations of MMS clients without requiring
+a fragmented code base. At this point, MiMMS is freed from the details of the horrendous
+MMS protocol, and can focus on usability.
+
+Currently MiMMS has the following dependencies:
+
+  * libmms   (required) - <http://sourceforge.net/projects/libmms>
+  * Qt4 Core (required) - <http://www.trolltech.com/developer/downloads/qt/>
+  * wget     (optional) - <http://www.gnu.org/software/wget/>
+    - (necessary if you want to use http:// URLs to get e.g. ASX files)
+
+Of course, you also need any dependencies of the above software, as well as a more-or-less
+standard POSIX environment since we depend on make, install, etc. being available during build.
+.TH mimms 1 "2006-08-17" "MiMMS isn't an MMS Sender"
+.SH NAME
+mimms \- MMS (e.g. mms://) stream downloader
+.SH SYNOPSIS
+.BI "mimms [" options "] <" url "> [" output "]"
+.SH DESCRIPTION
+MiMMS is a program designed to allow you to download streams using the MMS protocol
+and save them to your computer, as opposed to watching them live. Similar functionality
+is available in full media player suites such as Xine and MPlayer, but MiMMS is quick
+and easy to use, and for the time being, remains a useful program.
+.SH OPTIONS
+.TP
+.B "-c, --clobber"
+Allow overwriting an existing file; by default, this is not allowed.
+.TP 
+.BI "-t, --time <" minutes ">"
+Record for the given number of minutes;
+by default, record until the end.
+.TP
+.B"-v, --verbose"
+Print verbose debug messages on stderr.
+.TP
+.B "-q, --quiet"
+Don't print status messages on stdout.
+.TP
+.B "-h, --help"
+Show this help message on stdout.
+.SH URL
+.TP
+.B mms (MMS)
+i.e. mms://<host>[:port]/<path>
+will try all supported methods.
+.TP
+.B mmst (MMS TCP)
+i.e. mmst://<host>[:port]/<path>
+will only try TCP method.
+.TP
+.B mmsu (MMS UDP)
+Not currently supported; (poorly suited
+for streaming downloads anyway).
+.TP
+.B mmsh (MMS HTTP)
+i.e. mmsh://<host>[:port]/<path>
+will only try HTTP method.
+.TP
+.B http (ASX HTTP)
+i.e. http://<host>[:port]/<path>[.asx]
+only the first supported URL is used.
+.TP
+.B - (stdin)
+i.e. look for an MMS URL on stdin;
+only the first supported URL is used.
+.SH OUTPUT
+.TP
+.B none
+Streams to file named based on the URL.
+.TP
+.B filename
+Streams to the given file.
+.TP
+.B - (stdout)
+Streams to stdout. (Implies 
+.B --quiet
+)
+.SH AUTHOR
+Wesley J. Landaker <wjl@icecavern.net>
+/*
+  Copyright 2006 Wesley J. Landaker <wjl@icecavern.net>
+
+  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+*/
+
+#include <QCoreApplication>
+#include <QString>
+#include <QStringList>
+#include <QTextStream>
+#include <QFile>
+#include <QRegExp>
+#include <QTime>
+#include <QPair>
+#include <QProcess>
+#include "mms.h"
+#include "mmsh.h"
+
+const char *MMS_VERSION = "2.0.1";
+
+class MiMMSOptions {
+public:
+  enum Scheme { MMS, MMST, MMSU, MMSH, HTTP, STDIN };
+  QString url;
+  Scheme  scheme;
+  QString output;
+  bool    stdout;
+  bool    clobber;
+  quint32 time;
+  bool    verbose;
+  bool    quiet;
+  bool    help;
+  bool    invalid;
+};
+
+class MiMMSApplication : public QCoreApplication {
+public:
+  MiMMSApplication(int argc, char **argv) : QCoreApplication(argc,argv) {
+    __parseArgs();
+
+    if (__options.verbose) {
+      qDebug("url        = '%s'", __options.url.toUtf8().data());
+      qDebug("scheme     = '%s'", 
+	     __options.scheme==MiMMSOptions::MMS?"MMS":
+	     __options.scheme==MiMMSOptions::MMST?"MMST":
+	     __options.scheme==MiMMSOptions::MMSU?"MMSU":
+	     __options.scheme==MiMMSOptions::MMSH?"MMSH":
+	     __options.scheme==MiMMSOptions::HTTP?"HTTP":
+	     __options.scheme==MiMMSOptions::STDIN?"STDIN":
+	     "UNKNOWN"
+	     );
+      qDebug("output     = '%s'", __options.output.toUtf8().data());
+      qDebug("stdout     = '%s'", __options.stdout?"true":"false");
+      qDebug("clobber    = '%s'", __options.clobber?"true":"false");
+      qDebug("time       = '%d'", __options.time);
+      qDebug("verbose    = '%s'", __options.verbose?"true":"false");
+      qDebug("quiet      = '%s'", __options.quiet?"true":"false");
+      qDebug("help       = '%s'", __options.help?"true":"false");
+      qDebug("invalid    = '%s'", __options.invalid?"true":"false");
+    }
+
+    if (__options.help) {
+      QTextStream out(stdout);
+      __printHelpMessage(out,0);
+    } else if (__options.invalid) {
+      QTextStream err(stderr);
+      __printHelpMessage(err,1);
+    }
+  }
+
+  const MiMMSOptions &options() { return __options; }
+
+private:
+  void __parseArgs() {
+    QStringList args = arguments();
+    bool literal_mode = false;
+
+    __options.stdout  = false;
+    __options.clobber = false;
+    __options.time    = 0;
+    __options.verbose = false;
+    __options.quiet   = false;
+    __options.help    = false;
+    __options.invalid = false;
+
+    if (args.size() < 2) __options.invalid = true;
+
+    for (int i=1; i<args.size(); ++i) {
+      if (!literal_mode && args[i] == "-c" || args[i] == "--clobber") {
+	__options.clobber = true;
+      } else if (!literal_mode && args[i] == "-t" || args[i] == "--time") {
+	bool ok = false;
+	if (i<args.size()-1) {
+	  __options.time = args[i+1].toUInt(&ok);
+	}
+	if (!ok) {
+	  qWarning("Invalid argument to %s: '%s'",
+		   args[i].toUtf8().data(),
+		   args.value(i+1).toUtf8().data());
+	  __options.invalid = true;
+	} else {
+	  ++i;
+	}
+      } else if (!literal_mode && args[i] == "-v" || args[i] == "--verbose") {
+	__options.verbose = true;
+      } else if (!literal_mode && args[i] == "-q" || args[i] == "--quiet") {
+	__options.quiet = true;
+      } else if (!literal_mode && args[i] == "-h" || args[i] == "--help") {
+	__options.help = true;
+      } else if (!literal_mode && args[i] == "--") {
+	literal_mode = true;
+      } else if (!literal_mode && args[i].contains(QRegExp("^-.+"))) {
+	qWarning("Invalid argument: '%s'", args[i].toUtf8().data());
+	__options.invalid = true;
+      } else {
+	if (__options.url.isEmpty()) {
+	  __options.url = args[i];
+	  if (__options.url == "-") {
+	    __options.scheme = MiMMSOptions::STDIN;
+	  } else {
+	    QRegExp rx("^([a-z]+)://");
+	    if (rx.indexIn(__options.url) == -1) {
+	      qWarning("Unparseable URL: '%s'", 
+		       __options.url.toUtf8().data());
+	      __options.invalid = true;
+	    } else {
+	      QString scheme = rx.cap(1);
+	      if (scheme == "mms") {
+		__options.scheme = MiMMSOptions::MMS;
+	      } else if (scheme == "mmst") {
+		__options.scheme = MiMMSOptions::MMST;
+	      } else if (scheme == "mmsu") {
+		qWarning("mmsu:// URL scheme not supported");
+		__options.scheme = MiMMSOptions::MMSU;
+		__options.invalid = true;
+	      } else if (scheme == "mmsh") {
+		__options.scheme = MiMMSOptions::MMSH;
+	      } else if (scheme == "http") {
+		__options.scheme = MiMMSOptions::HTTP;
+	      } else {
+		qWarning("Unsupported URL: '%s'",
+			 __options.url.toUtf8().data());
+		__options.invalid = true;
+	      }
+	    }
+	  }
+	} else if (__options.output.isEmpty()) {
+	  __options.output = args[i];
+	  if (__options.output == "-") {
+	    __options.quiet = true;
+	    __options.stdout = true;
+	  }
+	} else {
+	  qWarning("Too many arguments: '%s'", args[i].toUtf8().data());
+	  __options.invalid = true;
+	}
+      }
+    }
+  }
+
+  void __printHelpMessage(QTextStream &o, int exit_code) {
+    o << "MiMMS " << MMS_VERSION << " - MiMMS isn't an MMS Message Sender.\n"
+      << "It's an MMS (e.g. mms://) stream downloader.\n"
+      << "Usage: mimms [options] <url> [output]\n"
+      << "Options:\n"
+      << "  -c, --clobber          Allow overwriting an existing file;\n"
+      << "                           by default, this is not allowed.\n"
+      << "  -t, --time <minutes>   Record for the given number of minutes;\n"
+      << "                           by default, record until the end.\n"
+      << "  -v, --verbose          Print verbose debug messages on stderr.\n"
+      << "  -q, --quiet            Don't print status messages on stdout.\n"
+      << "  -h, --help             Show this help message on stdout.\n"
+      << "URL Argument:\n"
+      << "  mms  (MMS)             i.e. mms://<host>[:port]/<path>\n"
+      << "                           will try all supported methods.\n"
+      << "  mmst (MMS TCP)         i.e. mmst://<host>[:port]/<path>\n"
+      << "                           will only try TCP method.\n"
+      << "  mmsu (MMS UDP)         Not currently supported; (poorly suited\n"
+      << "                           for streaming downloads anyway).\n"
+      << "  mmsh (MMS HTTP)        i.e. mmsh://<host>[:port]/<path>\n"
+      << "                           will only try HTTP method.\n"
+      << "  http (ASX HTTP)        i.e. http://<host>[:port]/<path>[.asx]\n"
+      << "                           only the first supported URL is used.\n"
+      << "  -    (stdin)           i.e. look for an MMS URL on stdin;\n"
+      << "                           only the first supported URL is used.\n"
+      << "Output Argument:\n"
+      << "  none                   Streams to file named based on the URL.\n"
+      << "  filename               Streams to the given file.\n"
+      << "  -                      Streams to stdout. (Implies --quiet.)\n";
+      o.flush();
+      ::exit(exit_code);
+  }
+
+private:
+  MiMMSOptions __options;
+};
+
+QString bytes_to_string(double bytes) {
+  if (bytes < 1024) {
+    return QString().sprintf("%.2f B",bytes);
+  } else if (bytes < 1024.0*1024.0) {
+    return QString().sprintf("%.2f KiB",bytes/1024.0);
+  } else if (bytes < 1024.0*1024.0*1024.0) {
+    return QString().sprintf("%.2f MiB",bytes/(1024.0*1024.0));
+  } else {
+    return QString().sprintf("%.2f GiB",bytes/(1024.0*1024.0*1024.0));
+  }
+}
+
+QString seconds_to_string(double seconds) {
+  if (seconds < 60) {
+    return QString().sprintf("%.2f s",seconds);
+  } else if (seconds < 60.0*60.0) {
+    return QString().sprintf("%.2f min",seconds/60.0);
+  } else {
+    return QString().sprintf("%.2f hours",seconds/(60.0*60.0));
+  }
+}
+
+int main(int argc, char **argv) {
+  MiMMSApplication app(argc, argv);
+  QTextStream out(stdout);
+
+  QString url = app.options().url;
+  
+  mms_t *mms   = 0;
+  mmsh_t *mmsh = 0;
+  
+  if (app.options().scheme == MiMMSOptions::HTTP ||
+      app.options().scheme == MiMMSOptions::STDIN) {
+
+    if (!app.options().quiet && !app.options().stdout) {
+      out << "Searching for MMS URL...";
+      out.flush();
+    }
+
+    QString data;
+    if (app.options().scheme == MiMMSOptions::HTTP) {
+      if (app.options().verbose) {
+	qDebug("retreiving HTTP URL with wget");
+      }
+      QProcess wget;
+      QStringList args;
+      args << "wget" << "-O" << "-" << app.options().url;
+      wget.start("wget",args);
+      wget.waitForFinished();
+      if (app.options().verbose) {
+	qDebug("wget output: %s",qPrintable(QString(wget.readAllStandardError())));
+      }
+      data = wget.readAllStandardOutput();
+    } else {
+      if (app.options().verbose) {
+	qDebug("searching for URL in stdin data");
+      }
+      QTextStream in(stdin);
+      data = in.readAll();
+    }
+    QRegExp url_grabber("(?:^|[ \"'<]|\\s)(mms.?://[^\t\n\v\f\r \"'>]+)");
+    if (url_grabber.indexIn(data) != -1) {
+      url = url_grabber.cap(1).simplified();
+      if (app.options().verbose) {
+	qDebug("using grabbed mms url = %s",qPrintable(url));
+      }
+    }
+  }
+
+  QFile file;
+  if (app.options().output == "-") {
+    file.open(stdout,QFile::WriteOnly);
+  } else {
+    if (app.options().output.isEmpty()) {
+      file.setFileName("mimms.wmv");
+      QStringList url_parts = url.split("/");
+      if (!url_parts.last().isEmpty() && !url_parts.last().contains('?')) {
+	file.setFileName(url_parts.last());
+      }
+    } else {
+      file.setFileName(app.options().output);
+    }
+    if (file.exists() && !app.options().clobber) {
+      if (QFile("mimms.wmv").exists()) {
+	qFatal("File exists and clobber not set: '%s'",
+	       file.fileName().toUtf8().data());
+      } else {
+	qWarning("File exists and clobber not set: '%s'; using 'mimms.wmv'",
+		 file.fileName().toUtf8().data());
+      }
+      file.setFileName("mimms.wmv");
+    }
+  }
+
+  if (!app.options().quiet && !app.options().stdout) {
+    out << "\r                                                              ";
+    out << "\r<" << url << ">  =>  " << "'" << file.fileName() << "'" << endl;
+  }
+
+  if (!app.options().quiet && !app.options().stdout) {
+    out << "Connecting...";
+    out.flush();
+  }
+
+  if (app.options().scheme == MiMMSOptions::MMS || 
+      app.options().scheme == MiMMSOptions::MMST) {
+
+    if (app.options().verbose) {
+      qDebug("trying mmst transport");
+    }
+
+    mms = mms_connect(0,0,url.toUtf8().data(),128*1024);
+    
+    if (!mms && app.options().scheme == MiMMSOptions::MMST) {
+      qFatal("libmms connection error");
+    }
+
+  }
+
+  if (app.options().scheme == MiMMSOptions::MMSH || (!mms)) {
+    mmsh = mmsh_connect(0,0,url.toUtf8().data(),128*1024);
+    if (!mmsh) {
+      qFatal("libmms connection error");
+    }
+  }
+
+  if (app.options().verbose) {
+    qDebug("connected (mms=%p, mmsh=%p)",mms,mmsh);
+  }
+
+  quint32 stream_length;
+  stream_length = mms ? mms_get_length(mms) : mmsh_get_length(mmsh);
+
+  if (app.options().verbose) {
+    qDebug("mms[h]_get_length = %u", stream_length);
+  }
+
+  if (app.options().verbose) {
+    qDebug("Opening file '%s'", qPrintable(file.fileName()));
+  }
+  file.open(QFile::WriteOnly);
+
+  QDateTime endDateTime;
+  {
+    quint32 minutes = app.options().time;
+    if (minutes) {
+      endDateTime = QDateTime::currentDateTime();
+      while (minutes) {
+	if (minutes < (1<<24)) {
+	  endDateTime = endDateTime.addSecs(minutes*60);
+	  minutes = 0;
+	} else {
+	  endDateTime = endDateTime.addSecs((1<<24)*60);
+	  minutes -= 1<<24;
+	}
+      }
+      if (app.options().verbose) {
+	qDebug("now = %s",qPrintable(QDateTime::currentDateTime().toString()));
+	qDebug("end = %s",qPrintable(endDateTime.toString()));
+      }
+    }
+  }
+
+
+
+  const size_t buffer_size = 1000;
+  char *buffer = new char[buffer_size];
+  int bytes;
+  QTime duration;
+  unsigned long bytes_in_duration = 0;
+  QString status;
+
+  double bytes_per_second = 0;
+
+  duration.start();
+  while (mms 
+	 ? ((bytes = mms_read(0,mms,buffer,buffer_size)) > 0)
+	 : ((bytes = mmsh_read(0,mmsh,buffer,buffer_size)) > 0)
+	 ) {
+
+    if (endDateTime.isValid()) {
+      if (QDateTime::currentDateTime() > endDateTime) {
+	if (!app.options().quiet && !app.options().stdout) {
+	  qDebug("\rRecording time limit exceeded.");
+	  break;
+	}  
+      }
+    }
+
+    if (!app.options().quiet && !app.options().stdout) {
+      off_t pos = mms ? mms_get_current_pos(mms) : mmsh_get_current_pos(mmsh);
+
+      bytes_in_duration += bytes;
+
+      if (duration.elapsed() > 2500) {
+	int delta = duration.restart();
+	double bytes_received = pos;
+	double bytes_total    = stream_length;
+	bytes_per_second  += bytes_in_duration/(delta/1000.0);
+	bytes_per_second  /= 2.0;
+	double seconds_remaining = (bytes_total-bytes_received)/bytes_per_second;
+
+	bytes_in_duration = 0;
+
+	QString s_bytes_received    = bytes_to_string(bytes_received);
+	QString s_bytes_total       = bytes_to_string(bytes_total);
+	QString s_bytes_per_second  = bytes_to_string(bytes_per_second);
+	QString s_seconds_remaining = seconds_to_string(seconds_remaining);
+
+	out << "\r";
+	for (int i=0; i<status.size(); ++i) {
+	  out << " ";
+	}
+	
+	status.sprintf("%s / %s (%s/s, %s remaining)",
+		       qPrintable(s_bytes_received), 
+		       qPrintable(s_bytes_total),
+		       qPrintable(s_bytes_per_second), 
+		       qPrintable(s_seconds_remaining));
+
+	out << "\r" << status;
+	out.flush();
+      }
+
+    }
+    char *wptr = buffer;
+    int wbytes;
+    if (app.options().verbose) {
+      qDebug("writing to file");
+    }
+    while ((wbytes = file.write(wptr,bytes)) > 0) {
+      if (app.options().verbose) {
+	qDebug("%d bytes", wbytes);
+      }
+      bytes -= wbytes;
+      wptr  += wbytes;
+    }
+    if (wbytes == -1) {
+      qFatal("Write error");
+    }
+  }
+  if (bytes == -1) {
+    qFatal("Read error");
+  }
+
+  if (app.options().verbose) {
+    qDebug("closing file");
+  }
+  file.close();
+  delete buffer;
+
+  if (!app.options().quiet && !app.options().stdout) {
+    out << "\rStream download completed.\n";
+    out.flush();
+  }
+}
+######################################################################
+# Automatically generated by qmake (2.00a) Fri Apr 14 13:16:07 2006
+######################################################################
+
+TEMPLATE = app
+TARGET += 
+DEPENDPATH += .
+INCLUDEPATH += . libmms /usr/include/libmms /usr/include/glib-2.0 /usr/lib/glib-2.0/include
+CONFIG += release
+LIBS += -lmms
+QT -= gui
+
+# Input
+SOURCES += mimms.cpp
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.