dep: Add libcue

This commit is contained in:
Connor McLaughlin 2019-10-18 18:16:52 +10:00
parent c8bbd25f59
commit 52c16deba6
22 changed files with 7358 additions and 0 deletions

View file

@ -1,5 +1,6 @@
add_subdirectory(glad)
add_subdirectory(imgui)
add_subdirectory(libcue)
add_subdirectory(libsamplerate)
add_subdirectory(stb)

20
dep/libcue/CMakeLists.txt Normal file
View file

@ -0,0 +1,20 @@
set(SRCS
include/libcue/cd.h
include/libcue/cdtext.h
include/libcue/libcue.h
include/libcue/rem.h
include/libcue/time.h
src/cd.c
src/cdtext.c
src/cue_parser.c
src/cue_parser.h
src/cue_scanner.c
src/rem.c
src/time.c
)
add_library(libcue ${SRCS})
target_include_directories(libcue PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/libcue" "${CMAKE_CURRENT_SOURCE_DIR}/src")
target_include_directories(libcue INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
set_target_properties(libcue PROPERTIES LINKER_LANGUAGE C)

202
dep/libcue/ChangeLog Normal file
View file

@ -0,0 +1,202 @@
libcue (2.2.1)
[Ilya Lipnitskiy]
* cmake: Check for __attribute__ format
[Fabrice Fontaine]
* cmake: Don't check for C++ presence as libcue is C-only
[Thomas Petazzoni]
* cmake: Don't force SHARED when building the library
libcue (2.2.0)
[Tom M]
* cmake: Use GNUInstallDirs and don't hard-code install paths (PR #12)
[John Lindgren]
* cmake: Set RUNTIME to CMAKE_INSTALL_BINDIR (issue #13)
[Wolfgang Hotwagner]
* Fix memory corruption in cue_scanner.l (PR #15)
[John Fitzgerald]
* Use MAXINDEX instead of MAXTRACK when indexing INDEX entries
* Allow for 100 INDEX entries
* Replace fprintf(3) to stdout with printf(3)
[Ilya Lipnitskiy]
* pkgconfig: Use dynamic directories from GNUInstallDirs
* Port 99 track fix from cuetools and add a test case
libcue (2.1.0)
[Ilya Lipnitskiy]
* Add FLAC token support (issue #9)
* Clean up static vars in the parser to prevent double frees (issue #10)
libcue (2.0.1)
[Peter Lemenkov]
* Rename buffer to yy_buffer
[Ilya Lipnitskiy]
* Create the libcue/libcue.h symlink for compatibility
libcue (2.0.0)
[John Lindgren]
* Parse REM GENRE lines
[Svyatoslav Mishyn]
* Clean up time conversion functions
[Ilya Lipnitskiy]
* Add Travis-CI support
* Move exported function declarations to libcue.h. Change default
symbol visibility to hidden. Only export parsing and accessor
functions. Make functions more const-correct
* Add support for noncompliant CUEs produced by EAC
* Return -1 instead of 0 for unknown values
* Refactor CUE INDEX parsing to set pregap and previous track length
correctly
* Add tests for various CUE formats
* Move the project from automake to cmake
* Clean up the changelog
libcue (1.4.0)
[Avuton Olrich]
* He helped a lot to make compilation on win32 work (it still would break
without him). Finding the parallel build bug is also accredited to him.
Thanks!
[Jochen Keil]
* force make to *not* build things in parallel since this tends to mess things up
* update changelog
* set version number to 1.4.0 (libtool)
* update copyright
* fix compiler warning: input() defined but not used
* new flex behaviour: explicitly enable yylineno usage
* new automake macro name
* possible fix for compilation problems on win32
* update COPYING and corrected copyright notices in several source code files
* Update general COPYRIGHT notice as well as several file specific notifications
* update ChangeLog and NEWS
libcue (1.3.0)
[Jochen Keil]
* set version number to 1.3.0 (libtool)
* fix for invalid pointer
libcue (1.2.0)
[Jochen Keil]
* set version number to 1.2.0 (libtool)
* update comment on libtool versioning
* update copyright notifications
* switch copyright licence to 2-clause BSD
* update AUTHORS to reflect recent changes
* dump old README
* simple test program (not yet supported by autotools, needs flac lib
* autoheader/config.h support for parser buffer size
* update autotool build system
* update main interface/api file
* support for custom cue values hidden as rem comments
* add buffer size to config.h
* prevent the parser from memory leaking/replace strdup() with
fixed-size array and strncpy/implement yacc|bison macros for buffer
creation/deletion
* prevent the lexer from memory leaking/replace strdup() with
fixed-size array and strncpy
* cd_delete() and track_delete() methods
* support for cdtext filename
* major code clean up
* initial clean up for libcue
cuetools (1.3.1)
[Svend Sorensen]
* Applied most of Branden Robinson's Debian patch
(cuetools_1.3-2.diff.gz). This included many fixes and enhancements
to tools and manual pages. cuebreakpoints and cueconvert will exit if
they fail on any of the input files. cuebreakpoints, cueconvert, and
cuetools will exit with a nonzero return value if there was a failure
on an input file.
* Added version option to all tools.
* Single quoted string support has been removed. This was broken, and I am not
sure of any software that supports single quoted strings in cue or toc files.
cuetools (1.3)
[Svend Sorensen]
* Build system has been rewritten using automake/autoconf.
* Added append, prepend, and split pregap modes to cuebreakpoints.
* Fixed possible compilation error with Bison.
* All tools accept long options.
* Programs exit if --input-format or --output-format is an illegal value.
cuetools (1.2)
[Svend Sorensen]
* cuebreakpoints was not printing the last track breakpoint. This has been
fixed.
* cueprint now prints a zero-length string for undefined values. Flags, width,
and precision are applied to conversion characters which have no conversion.
* Added a tagging script, cuetag.sh, which uses cueprint, vorbiscomment, and
mp3info to tag Ogg Vorbis and MP3 files. This needs more testing and
documentation.
* Added a track selection flag to cueprint.
cuetools (1.1)
[Svend Sorensen]
* File formats documentation has been readded and updated (docs/formats.txt).
* ``CDTEXTFILE`` is now a recognized (but ignored) keyword.
* If only a disc or track template is specified on the command line, then only
the disc or track information is printed, respectively.
* cueprint now supports flags and width and precision values for template

693
dep/libcue/LICENSE Normal file
View file

@ -0,0 +1,693 @@
== IMPORTANT ==
There are two licences involved in this software.
The whole libcue project is released under GPLv2 due to its heritage
from cuetools. Some code was added independently from cuetools. These
files have a copyright notice and licensing information on their own.
All files that contain this note:
'Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen'
are taken from cuetools and are therefore under licence of GPLv2.
== IMPORTANT ==
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.
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.

30
dep/libcue/README.md Normal file
View file

@ -0,0 +1,30 @@
# Overview [![Build Status](https://travis-ci.org/lipnitsk/libcue.svg)](https://travis-ci.org/lipnitsk/libcue)
libcue provides an API for parsing and extracting data from [CUE sheets](https://en.wikipedia.org/wiki/Cue_sheet_%28computing%29).
libcue was originally forked from [cuetools](https://github.com/svend/cuetools) and then enhanced to add additional features.
Please refer to [libcue.h](https://github.com/lipnitsk/libcue/blob/master/libcue.h) for the API.
Some usage examples are also available in the test cases under [t/](https://github.com/lipnitsk/libcue/tree/master/t).
# Compiling
NOTE: Use `-DBUILD_SHARED_LIBS=ON` to build as a shared library.
```
mkdir bin
cd bin
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ../
make
make test
make install
```
# Contributing
One should note that while the CUE format is supported by various tools, such as media players or CD ripping tools, there is no single standard that strictly describes the CUE syntax.
libcue attempts to parse the most commonly known CUE layouts, but it does not claim to support every possible combination.
Therefore, if you would like to contribute to the library, please include a test case with your pull request to ensure that the functionality does not break in the future.

View file

@ -0,0 +1,64 @@
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
/* references: MMC-3 draft revsion - 10g */
#ifndef CD_H
#define CD_H
#include "libcue.h"
#include "cdtext.h"
#include "rem.h"
#define MAXTRACK 99 /* Red Book track limit (from 01 to 99) */
#define MAXINDEX 99 /* Red Book index limit (from 00 to 99) */
#define PARSER_BUFFER 1024 /* Parser buffer size */
/* return pointer to CD structure */
Cd *cd_init(void);
Track *track_init(void);
void track_delete(struct Track* track);
void cd_dump(Cd *cd);
/*
* Cd functions
*/
void cd_set_mode(Cd *cd, int mode);
void cd_set_catalog(Cd *cd, char *catalog);
void cd_set_cdtextfile(Cd *cd, char *cdtextfile);
/*
* add a new track to cd, increment number of tracks
* and return pointer to new track
*/
Track *cd_add_track(Cd *cd);
/*
* Track functions
*/
/* filename of data file */
void track_set_filename(Track *track, char *filename);
/* track start is starting position in data file */
void track_set_start(Track *track, long start);
/* track length is length of data file to use */
void track_set_length(Track *track, long length);
/* see enum TrackMode */
void track_set_mode(Track *track, int mode);
/* see enum TrackSubMode */
void track_set_sub_mode(Track *track, int sub_mode);
/* see enum TrackFlag */
void track_set_flag(Track *track, int flag);
void track_clear_flag(Track *track, int flag);
void track_set_zero_pre(Track *track, long length);
void track_set_zero_post(Track *track, long length);
void track_set_isrc(Track *track, char *isrc);
void track_set_index(Track *track, int i, long index);
#endif

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
/* references: MMC-3 draft revsion - 10g */
#ifndef CDTEXT_H
#define CDTEXT_H
#include "libcue.h"
enum PtiFormat {
FORMAT_CHAR, /* single or double byte character string */
FORMAT_BINARY /* binary data */
};
/* return a pointer to a new Cdtext */
Cdtext *cdtext_init(void);
/* release a Cdtext */
void cdtext_delete(Cdtext *cdtext);
/* returns non-zero if there are no CD-TEXT fields set, zero otherwise */
int cdtext_is_empty(Cdtext *cdtext);
/* set CD-TEXT field to value for PTI pti */
void cdtext_set(int pti, char *value, Cdtext *cdtext);
/*
* returns appropriate string for PTI pti
* if istrack is zero, UPC/EAN string will be returned for PTI_UPC_ISRC
* othwise ISRC string will be returned
*/
const char *cdtext_get_key(int pti, int istrack);
/*
* dump all cdtext info
* in human readable format (for debugging)
*/
void cdtext_dump(Cdtext *cdtext, int istrack);
#endif

View file

@ -0,0 +1,156 @@
/*
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
#ifndef LIBCUE_H
#define LIBCUE_H
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
// #define CUE_EXPORT __attribute__((visibility("default")))
#define CUE_EXPORT
/*
* disc modes
* DATA FORM OF MAIN DATA (5.29.2.8)
*/
enum DiscMode {
MODE_CD_DA, /* CD-DA */
MODE_CD_ROM, /* CD-ROM mode 1 */
MODE_CD_ROM_XA /* CD-ROM XA and CD-I */
};
/*
* track modes
* 5.29.2.8 DATA FORM OF MAIN DATA
* Table 350 - Data Block Type Codes
*/
enum TrackMode {
MODE_AUDIO, /* 2352 byte block length */
MODE_MODE1, /* 2048 byte block length */
MODE_MODE1_RAW, /* 2352 byte block length */
MODE_MODE2, /* 2336 byte block length */
MODE_MODE2_FORM1, /* 2048 byte block length */
MODE_MODE2_FORM2, /* 2324 byte block length */
MODE_MODE2_FORM_MIX, /* 2332 byte block length */
MODE_MODE2_RAW /* 2352 byte block length */
};
/*
* sub-channel mode
* 5.29.2.13 Data Form of Sub-channel
* NOTE: not sure if this applies to cue files
*/
enum TrackSubMode {
SUB_MODE_RW, /* RAW Data */
SUB_MODE_RW_RAW /* PACK DATA (written R-W */
};
/*
* track flags
* Q Sub-channel Control Field (4.2.3.3, 5.29.2.2)
*/
enum TrackFlag {
FLAG_NONE = 0x00, /* no flags set */
FLAG_PRE_EMPHASIS = 0x01, /* audio recorded with pre-emphasis */
FLAG_COPY_PERMITTED = 0x02, /* digital copy permitted */
FLAG_DATA = 0x04, /* data track */
FLAG_FOUR_CHANNEL = 0x08, /* 4 audio channels */
FLAG_SCMS = 0x10, /* SCMS (not Q Sub-ch.) (5.29.2.7) */
FLAG_ANY = 0xff /* any flags set */
};
enum DataType {
DATA_AUDIO,
DATA_DATA,
DATA_FIFO,
DATA_ZERO
};
/* cdtext pack type indicators */
enum Pti {
PTI_TITLE, /* title of album or track titles */
PTI_PERFORMER, /* name(s) of the performer(s) */
PTI_SONGWRITER, /* name(s) of the songwriter(s) */
PTI_COMPOSER, /* name(s) of the composer(s) */
PTI_ARRANGER, /* name(s) of the arranger(s) */
PTI_MESSAGE, /* message(s) from the content provider and/or artist */
PTI_DISC_ID, /* (binary) disc identification information */
PTI_GENRE, /* (binary) genre identification and genre information */
PTI_TOC_INFO1, /* (binary) table of contents information */
PTI_TOC_INFO2, /* (binary) second table of contents information */
PTI_RESERVED1, /* reserved */
PTI_RESERVED2, /* reserved */
PTI_RESERVED3, /* reserved */
PTI_RESERVED4, /* reserved for content provider only */
PTI_UPC_ISRC, /* UPC/EAN code of the album and ISRC code of each track */
PTI_SIZE_INFO, /* (binary) size information of the block */
PTI_END /* terminating PTI (for stepping through PTIs) */
};
enum RemType {
REM_DATE, /* date of cd/track */
REM_REPLAYGAIN_ALBUM_GAIN,
REM_REPLAYGAIN_ALBUM_PEAK,
REM_REPLAYGAIN_TRACK_GAIN,
REM_REPLAYGAIN_TRACK_PEAK,
REM_END /* terminating REM (for stepping through REMs) */
};
/* ADTs */
typedef struct Cd Cd;
typedef struct Track Track;
typedef struct Cdtext Cdtext;
typedef struct Rem Rem;
typedef enum Pti Pti;
typedef enum TrackFlag TrackFlag;
typedef enum RemType RemType;
CUE_EXPORT Cd* cue_parse_file(FILE*);
CUE_EXPORT Cd* cue_parse_string(const char*);
CUE_EXPORT void cd_delete(Cd* cd);
/* CD functions */
CUE_EXPORT enum DiscMode cd_get_mode(const Cd *cd);
CUE_EXPORT const char *cd_get_cdtextfile(const Cd *cd);
/*
* return number of tracks in cd
*/
CUE_EXPORT int cd_get_ntrack(const Cd *cd);
/* CDTEXT functions */
CUE_EXPORT Cdtext *cd_get_cdtext(const Cd *cd);
CUE_EXPORT Cdtext *track_get_cdtext(const Track *track);
CUE_EXPORT const char *cdtext_get(enum Pti pti, const Cdtext *cdtext);
CUE_EXPORT Rem* cd_get_rem(const Cd* cd);
CUE_EXPORT Rem* track_get_rem(const Track* track);
/**
* return pointer to value for rem comment
* @param unsigned int: enum of rem comment
*/
CUE_EXPORT const char* rem_get(unsigned int, Rem*);
/* Track functions */
CUE_EXPORT Track *cd_get_track(const Cd *cd, int i);
CUE_EXPORT const char *track_get_filename(const Track *track);
CUE_EXPORT long track_get_start(const Track *track);
CUE_EXPORT long track_get_length(const Track *track);
CUE_EXPORT enum TrackMode track_get_mode(const Track *track);
CUE_EXPORT enum TrackSubMode track_get_sub_mode(const Track *track);
CUE_EXPORT int track_is_set_flag(const Track *track, enum TrackFlag flag);
CUE_EXPORT long track_get_zero_pre(const Track *track);
CUE_EXPORT long track_get_zero_post(const Track *track);
CUE_EXPORT const char *track_get_isrc(const Track *track);
CUE_EXPORT long track_get_index(const Track *track, int i);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,63 @@
/*
* Copyright (c) 2009, 2010 Jochen Keil
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY Jochen Keil ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Jochen Keil BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef REM_H
#define REM_H
#include "libcue.h"
/**
* return new allocated rem struct
*/
Rem*
rem_new( void);
/**
* free rem struct
*/
void
rem_free( Rem*);
/**
* return true if allocated rem struct is empty
*/
int
rem_is_emtpy( Rem*);
/**
* set value of rem comment
* @param unsigned int: enum of rem comment
*/
void
rem_set( unsigned int,
char*,
Rem*);
/**
* dump all rem comments in human readable form
* @param bool: if track: true; else false
*/
void
rem_dump( Rem*);
#endif

View file

@ -0,0 +1,15 @@
/*
* time.h -- time declarations
*
* Copyright (C) 2004, 2005, 2006, 2007 Svend Sorensen
* For license terms, see the file COPYING in this distribution.
*/
#ifndef TIME_H
#define TIME_H
long time_msf_to_frame(int m, int s, int f);
void time_frame_to_msf(long frame, int *m, int *s, int *f);
char *time_frame_to_mmssff(long f);
#endif

377
dep/libcue/libcue.vcxproj Normal file
View file

@ -0,0 +1,377 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugFast|Win32">
<Configuration>DebugFast</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugFast|x64">
<Configuration>DebugFast</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseLTCG|Win32">
<Configuration>ReleaseLTCG</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseLTCG|x64">
<Configuration>ReleaseLTCG</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<None Include="src\cue_parser.y" />
<None Include="src\cue_scanner.l" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\cd.c" />
<ClCompile Include="src\cdtext.c" />
<ClCompile Include="src\cue_parser.c" />
<ClCompile Include="src\cue_scanner.c" />
<ClCompile Include="src\rem.c" />
<ClCompile Include="src\time.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\libcue\cd.h" />
<ClInclude Include="include\libcue\cdtext.h" />
<ClInclude Include="include\libcue\libcue.h" />
<ClInclude Include="include\libcue\rem.h" />
<ClInclude Include="include\libcue\time.h" />
<ClInclude Include="src\cue_parser.h" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6A4208ED-E3DC-41E1-81CD-F61025FC285A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>libcue</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'">
<IntDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</IntDir>
<TargetName>$(ProjectName)-$(Platform)-$(Configuration)</TargetName>
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)build\$(ProjectName)-$(Platform)-$(Configuration)\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib32-debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib32-debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugFast|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=1;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUGFAST;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<SupportJustMyCode>false</SupportJustMyCode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib64-debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<OmitFramePointers>true</OmitFramePointers>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTCG|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)include\libcue;$(ProjectDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WholeProgramOptimization>true</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<OmitFramePointers>true</OmitFramePointers>
<SDLCheck>false</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dep\lib64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="src\cue_parser.y" />
<None Include="src\cue_scanner.l" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\cue_scanner.c" />
<ClCompile Include="src\rem.c" />
<ClCompile Include="src\time.c" />
<ClCompile Include="src\cd.c" />
<ClCompile Include="src\cdtext.c" />
<ClCompile Include="src\cue_parser.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\cue_parser.h" />
<ClInclude Include="include\libcue\cdtext.h" />
<ClInclude Include="include\libcue\libcue.h" />
<ClInclude Include="include\libcue\rem.h" />
<ClInclude Include="include\libcue\time.h" />
<ClInclude Include="include\libcue\cd.h" />
</ItemGroup>
</Project>

414
dep/libcue/src/cd.c Normal file
View file

@ -0,0 +1,414 @@
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cd.h"
typedef struct Data Data;
struct Data {
int type; /* DataType */
char *name; /* data source name */
long start; /* start time for data */
long length; /* length of data */
};
struct Track {
Data zero_pre; /* pre-gap generated with zero data */
Data file; /* track data file */
Data zero_post; /* post-gap generated with zero data */
int mode; /* track mode */
int sub_mode; /* sub-channel mode */
int flags; /* flags */
char *isrc; /* IRSC Code (5.22.4) 12 bytes */
Cdtext *cdtext; /* CD-TEXT */
Rem* rem;
long index[MAXINDEX+1]; /* indexes (in frames) (5.29.2.5)
* relative to start of file */
};
struct Cd {
int mode; /* disc mode */
char *catalog; /* Media Catalog Number (5.22.3) */
char *cdtextfile; /* Filename of CDText File */
Cdtext *cdtext; /* CD-TEXT */
Rem* rem;
int ntrack; /* number of tracks in album */
Track *track[MAXTRACK]; /* array of tracks */
};
Cd *cd_init(void)
{
Cd *cd = NULL;
cd = malloc(sizeof(Cd));
if(NULL == cd) {
fprintf(stderr, "unable to create cd\n");
} else {
cd->mode = MODE_CD_DA;
cd->catalog = NULL;
cd->cdtextfile = NULL;
cd->cdtext = cdtext_init();
cd->rem = rem_new();
cd->ntrack = 0;
}
return cd;
}
void track_delete(struct Track* track)
{
if (track != NULL)
{
cdtext_delete(track_get_cdtext(track));
rem_free(track_get_rem(track));
free(track->isrc);
free(track->zero_pre.name);
free(track->zero_post.name);
free(track->file.name);
free(track);
}
}
void cd_delete(struct Cd* cd)
{
int i = 0;
if (cd != NULL)
{
free(cd->catalog);
free(cd->cdtextfile);
for (i = 0; i < cd->ntrack; i++)
track_delete(cd->track[i]);
cdtext_delete(cd_get_cdtext(cd));
rem_free(cd_get_rem(cd));
free(cd);
}
}
Track *track_init(void)
{
Track *track = NULL;
track = malloc(sizeof(Track));
if (NULL == track) {
fprintf(stderr, "unable to create track\n");
} else {
track->zero_pre.type = DATA_ZERO;
track->zero_pre.name = NULL;
track->zero_pre.start = -1;
track->zero_pre.length = -1;
track->file.type = DATA_AUDIO;
track->file.name = NULL;
track->file.start = -1;
track->file.length = -1;
track->zero_post.type = DATA_ZERO;
track->zero_post.name = NULL;
track->zero_post.start = -1;
track->zero_post.length = -1;
track->mode = MODE_AUDIO;
track->sub_mode = SUB_MODE_RW;
track->flags = FLAG_NONE;
track->isrc = NULL;
track->cdtext = cdtext_init();
track->rem = rem_new();
int i;
for (i=0; i<=MAXINDEX; i++)
track->index[i] = -1;
}
return track;
}
/*
* cd structure functions
*/
void cd_set_mode(Cd *cd, int mode)
{
cd->mode = mode;
}
enum DiscMode cd_get_mode(const Cd *cd)
{
return cd->mode;
}
void cd_set_catalog(Cd *cd, char *catalog)
{
if (cd->catalog)
free(cd->catalog);
cd->catalog = strdup(catalog);
}
void cd_set_cdtextfile(Cd *cd, char *cdtextfile)
{
if (cd->cdtextfile)
free(cd->cdtextfile);
cd->cdtextfile = strdup(cdtextfile);
}
const char *cd_get_cdtextfile(const Cd *cd)
{
return cd->cdtextfile;
}
Cdtext *cd_get_cdtext(const Cd *cd)
{
if (cd != NULL)
return cd->cdtext;
else
return NULL;
}
Rem*
cd_get_rem(const Cd* cd)
{
if (cd != NULL)
return cd->rem;
else
return NULL;
}
Track *cd_add_track(Cd *cd)
{
if (MAXTRACK > cd->ntrack)
cd->ntrack++;
else
fprintf(stderr, "too many tracks\n");
/* this will reinit last track if there were too many */
cd->track[cd->ntrack - 1] = track_init();
return cd->track[cd->ntrack - 1];
}
int cd_get_ntrack(const Cd *cd)
{
return cd->ntrack;
}
Track *cd_get_track(const Cd *cd, int i)
{
if ((0 < i) && (i <= cd->ntrack) && (cd != NULL))
return cd->track[i - 1];
else
return NULL;
}
/*
* track structure functions
*/
void track_set_filename(Track *track, char *filename)
{
if (track->file.name)
free(track->file.name);
track->file.name = strdup(filename);
}
const char *track_get_filename(const Track *track)
{
return track->file.name;
}
void track_set_start(Track *track, long start)
{
track->file.start = start;
}
long track_get_start(const Track *track)
{
return track->file.start;
}
void track_set_length(Track *track, long length)
{
track->file.length = length;
}
long track_get_length(const Track *track)
{
return track->file.length;
}
void track_set_mode(Track *track, int mode)
{
track->mode = mode;
}
enum TrackMode track_get_mode(const Track *track)
{
return track->mode;
}
void track_set_sub_mode(Track *track, int sub_mode)
{
track->sub_mode = sub_mode;
}
enum TrackSubMode track_get_sub_mode(const Track *track)
{
return track->sub_mode;
}
void track_set_flag(Track *track, int flag)
{
track->flags |= flag;
}
void track_clear_flag(Track *track, int flag)
{
track->flags &= ~flag;
}
int track_is_set_flag(const Track *track, enum TrackFlag flag)
{
return track->flags & flag;
}
void track_set_zero_pre(Track *track, long length)
{
track->zero_pre.length = length;
}
long track_get_zero_pre(const Track *track)
{
return track->zero_pre.length;
}
void track_set_zero_post(Track *track, long length)
{
track->zero_post.length = length;
}
long track_get_zero_post(const Track *track)
{
return track->zero_post.length;
}
void track_set_isrc(Track *track, char *isrc)
{
if (track->isrc)
free(track->isrc);
track->isrc = strdup(isrc);
}
const char *track_get_isrc(const Track *track)
{
return track->isrc;
}
Cdtext *track_get_cdtext(const Track *track)
{
if (track != NULL)
return track->cdtext;
else
return NULL;
}
Rem*
track_get_rem(const Track* track)
{
if (track != NULL)
return track->rem;
else
return NULL;
}
void track_set_index(Track *track, int i, long ind)
{
if (i > MAXINDEX) {
fprintf(stderr, "too many indexes\n");
return;
}
track->index[i] = ind;
}
long track_get_index(const Track *track, int i)
{
if ((0 <= i) && (i <= MAXINDEX))
return track->index[i];
return -1;
}
/*
* dump cd information
*/
static void cd_track_dump(Track *track)
{
int i;
printf("zero_pre: %ld\n", track->zero_pre.length);
printf("filename: %s\n", track->file.name);
printf("start: %ld\n", track->file.start);
printf("length: %ld\n", track->file.length);
printf("zero_post: %ld\n", track->zero_post.length);
printf("mode: %d\n", track->mode);
printf("sub_mode: %d\n", track->sub_mode);
printf("flags: 0x%x\n", track->flags);
printf("isrc: %s\n", track->isrc);
for (i = 0; i <= MAXINDEX; ++i)
if (track->index[i] != -1)
printf("index %d: %ld\n", i, track->index[i]);
if (NULL != track->cdtext) {
printf("cdtext:\n");
cdtext_dump(track->cdtext, 1);
}
if (track->rem != NULL)
{
printf("rem:\n");
rem_dump(track->rem);
}
}
void cd_dump(Cd *cd)
{
int i;
printf("Disc Info\n");
printf("mode: %d\n", cd->mode);
printf("catalog: %s\n", cd->catalog);
printf("cdtextfile: %s\n", cd->cdtextfile);
if (NULL != cd->cdtext) {
printf("cdtext:\n");
cdtext_dump(cd->cdtext, 0);
}
if (cd->rem != NULL)
{
printf("rem:\n");
rem_dump(cd->rem);
}
for (i = 0; i < cd->ntrack; ++i) {
printf("Track %d Info\n", i + 1);
cd_track_dump(cd->track[i]);
}
}

167
dep/libcue/src/cdtext.c Normal file
View file

@ -0,0 +1,167 @@
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cdtext.h"
struct Cdtext {
int pti;
int format;
char *value;
};
Cdtext *cdtext_init(void)
{
Cdtext *new_cdtext = NULL;
Cdtext cdtext[] = {
{PTI_TITLE, FORMAT_CHAR, NULL},
{PTI_PERFORMER, FORMAT_CHAR, NULL},
{PTI_SONGWRITER, FORMAT_CHAR, NULL},
{PTI_COMPOSER, FORMAT_CHAR, NULL},
{PTI_ARRANGER, FORMAT_CHAR, NULL},
{PTI_MESSAGE, FORMAT_CHAR, NULL},
{PTI_DISC_ID, FORMAT_BINARY, NULL},
{PTI_GENRE, FORMAT_BINARY, NULL},
{PTI_TOC_INFO1, FORMAT_BINARY, NULL},
{PTI_TOC_INFO2, FORMAT_BINARY, NULL},
{PTI_RESERVED1, FORMAT_CHAR, NULL},
{PTI_RESERVED2, FORMAT_CHAR, NULL},
{PTI_RESERVED3, FORMAT_CHAR, NULL},
{PTI_RESERVED4, FORMAT_CHAR, NULL},
{PTI_UPC_ISRC, FORMAT_CHAR, NULL},
{PTI_SIZE_INFO, FORMAT_BINARY, NULL},
{PTI_END, FORMAT_CHAR, NULL}
};
new_cdtext = (Cdtext *) calloc (sizeof (cdtext) / sizeof (Cdtext), sizeof (Cdtext));
if (NULL == new_cdtext)
fprintf (stderr, "problem allocating memory\n");
else
memcpy (new_cdtext, cdtext, sizeof(cdtext));
return new_cdtext;
}
void cdtext_delete(Cdtext *cdtext)
{
int i;
if (NULL != cdtext) {
for (i = 0; PTI_END != cdtext[i].pti; i++)
{
free (cdtext[i].value);
}
free (cdtext);
}
}
/* return 0 if there is no cdtext, returns non-zero otherwise */
int cdtext_is_empty(Cdtext *cdtext)
{
for (; PTI_END != cdtext->pti; cdtext++)
if (NULL != cdtext->value)
return -1;
return 0;
}
/* sets cdtext's pti entry to field */
void cdtext_set(int pti, char *value, Cdtext *cdtext)
{
if (NULL != value) /* don't pass NULL to strdup */
for (; PTI_END != cdtext->pti; cdtext++)
if (pti == cdtext->pti) {
free (cdtext->value);
cdtext->value = strdup (value);
}
}
/* returns value for pti, NULL if pti is not found */
const char *cdtext_get(enum Pti pti, const Cdtext *cdtext)
{
for (; PTI_END != cdtext->pti; cdtext++)
if (pti == cdtext->pti)
return cdtext->value;
return NULL;
}
const char *cdtext_get_key(int pti, int istrack)
{
const char *key = NULL;
switch (pti) {
case PTI_TITLE:
key = "TITLE";
break;
case PTI_PERFORMER:
key = "PERFORMER";
break;
case PTI_SONGWRITER:
key = "SONGWRITER";
break;
case PTI_COMPOSER:
key = "COMPOSER";
break;
case PTI_ARRANGER:
key = "ARRANGER";
break;
case PTI_MESSAGE:
key = "MESSAGE";
break;
case PTI_DISC_ID:
key = "DISC_ID";
break;
case PTI_GENRE:
key = "GENRE";
break;
case PTI_TOC_INFO1:
key = "TOC_INFO1";
break;
case PTI_TOC_INFO2:
key = "TOC_INFO1";
break;
case PTI_RESERVED1:
/* reserved */
break;
case PTI_RESERVED2:
/* reserved */
break;
case PTI_RESERVED3:
/* reserved */
break;
case PTI_RESERVED4:
/* reserved */
break;
case PTI_UPC_ISRC:
if (0 == istrack)
key = "UPC_EAN";
else
key = "ISRC";
break;
case PTI_SIZE_INFO:
key = "SIZE_INFO";
break;
}
return key;
}
void cdtext_dump(Cdtext *cdtext, int istrack)
{
int pti;
const char *value = NULL;
for (pti = 0; PTI_END != pti; pti++) {
if (NULL != (value = cdtext_get(pti, cdtext))) {
printf("%s: ", cdtext_get_key(pti, istrack));
printf("%s\n", value);
}
}
}

1842
dep/libcue/src/cue_parser.c Normal file

File diff suppressed because it is too large Load diff

126
dep/libcue/src/cue_parser.h Normal file
View file

@ -0,0 +1,126 @@
/* A Bison parser, made by GNU Bison 3.3.2. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
Inc.
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 3 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, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Undocumented macros, especially those whose name start with YY_,
are private implementation details. Do not rely on them. */
#ifndef YY_YY_CUE_PARSER_H_INCLUDED
# define YY_YY_CUE_PARSER_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
NUMBER = 258,
STRING = 259,
CATALOG = 260,
CDTEXTFILE = 261,
FFILE = 262,
BINARY = 263,
MOTOROLA = 264,
AIFF = 265,
WAVE = 266,
MP3 = 267,
FLAC = 268,
TRACK = 269,
AUDIO = 270,
MODE1_2048 = 271,
MODE1_2352 = 272,
MODE2_2336 = 273,
MODE2_2048 = 274,
MODE2_2342 = 275,
MODE2_2332 = 276,
MODE2_2352 = 277,
TRACK_ISRC = 278,
FLAGS = 279,
PRE = 280,
DCP = 281,
FOUR_CH = 282,
SCMS = 283,
PREGAP = 284,
INDEX = 285,
POSTGAP = 286,
TITLE = 287,
PERFORMER = 288,
SONGWRITER = 289,
COMPOSER = 290,
ARRANGER = 291,
MESSAGE = 292,
DISC_ID = 293,
GENRE = 294,
TOC_INFO1 = 295,
TOC_INFO2 = 296,
UPC_EAN = 297,
ISRC = 298,
SIZE_INFO = 299,
DATE = 300,
XXX_GENRE = 301,
REPLAYGAIN_ALBUM_GAIN = 302,
REPLAYGAIN_ALBUM_PEAK = 303,
REPLAYGAIN_TRACK_GAIN = 304,
REPLAYGAIN_TRACK_PEAK = 305
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 57 "cue_parser.y" /* yacc.c:1921 */
long ival;
char *sval;
#line 114 "cue_parser.h" /* yacc.c:1921 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_CUE_PARSER_H_INCLUDED */

374
dep/libcue/src/cue_parser.y Normal file
View file

@ -0,0 +1,374 @@
%{
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cd.h"
#include "time.h"
#ifdef YY_BUF_SIZE
#undef YY_BUF_SIZE
#endif
#define YY_BUF_SIZE 16384
#define YYDEBUG 1
char fnamebuf[PARSER_BUFFER];
/* debugging */
//int yydebug = 1;
extern int yylineno;
extern FILE* yyin;
static Cd *cd = NULL;
static Track *track = NULL;
static Track *prev_track = NULL;
static Cdtext *cdtext = NULL;
static Rem *rem = NULL;
static char *prev_filename = NULL; /* last file in or before last track */
static char *cur_filename = NULL; /* last file in the last track */
static char *new_filename = NULL; /* last file in this track */
/* lexer interface */
typedef struct yy_buffer_state* YY_BUFFER_STATE;
int yylex(void);
void yyerror(const char*);
YY_BUFFER_STATE yy_scan_string(const char*);
YY_BUFFER_STATE yy_create_buffer(FILE*, int);
void yy_switch_to_buffer(YY_BUFFER_STATE);
void yy_delete_buffer(YY_BUFFER_STATE);
/* parser interface */
int yyparse(void);
Cd *cue_parse_file(FILE *fp);
Cd *cue_parse_string(const char*);
%}
%start cuefile
%union {
long ival;
char *sval;
}
%token <ival> NUMBER
%token <sval> STRING
/* global (header) */
%token CATALOG
%token CDTEXTFILE
%token FFILE
%token BINARY
%token MOTOROLA
%token AIFF
%token WAVE
%token MP3
%token FLAC
/* track */
%token TRACK
%token <ival> AUDIO
%token <ival> MODE1_2048
%token <ival> MODE1_2352
%token <ival> MODE2_2336
%token <ival> MODE2_2048
%token <ival> MODE2_2342
%token <ival> MODE2_2332
%token <ival> MODE2_2352
/* ISRC is with CD_TEXT */
%token TRACK_ISRC
%token FLAGS
%token <ival> PRE
%token <ival> DCP
%token <ival> FOUR_CH
%token <ival> SCMS
%token PREGAP
%token INDEX
%token POSTGAP
/* CD-TEXT */
%token <ival> TITLE
%token <ival> PERFORMER
%token <ival> SONGWRITER
%token <ival> COMPOSER
%token <ival> ARRANGER
%token <ival> MESSAGE
%token <ival> DISC_ID
%token <ival> GENRE
%token <ival> TOC_INFO1
%token <ival> TOC_INFO2
%token <ival> UPC_EAN
%token <ival> ISRC
%token <ival> SIZE_INFO
%type <ival> track_mode
%type <ival> track_flag
%type <ival> time
%type <ival> cdtext_item
/* REM */
%type <ival> rem_item
%token <ival> DATE
%token <ival> XXX_GENRE /* parsed in REM but stored in CD-TEXT */
%token <ival> REPLAYGAIN_ALBUM_GAIN
%token <ival> REPLAYGAIN_ALBUM_PEAK
%token <ival> REPLAYGAIN_TRACK_GAIN
%token <ival> REPLAYGAIN_TRACK_PEAK
%%
cuefile
: new_cd global_statements track_list
;
new_cd
: /* empty */ {
cd = cd_init();
cdtext = cd_get_cdtext(cd);
rem = cd_get_rem(cd);
}
;
global_statements
: /* empty */
| global_statements global_statement
;
global_statement
: CATALOG STRING '\n' { cd_set_catalog(cd, $2); }
| CDTEXTFILE STRING '\n' { cd_set_cdtextfile(cd, $2); }
| cdtext
| rem
| track_data
| error '\n'
;
track_data
: FFILE STRING file_format '\n' {
if (NULL != new_filename) {
yyerror("too many files specified\n");
}
if (track && track_get_index(track, 1) == -1) {
track_set_filename (track, $2);
} else {
new_filename = strncpy(fnamebuf, $2, sizeof(fnamebuf));
new_filename[sizeof(fnamebuf) - 1] = '\0';
}
}
;
track_list
: track
| track_list track
;
track
: new_track track_def track_statements
;
file_format
: BINARY
| MOTOROLA
| AIFF
| WAVE
| MP3
| FLAC
;
new_track
: /*empty */ {
/* save previous track, to later set length */
prev_track = track;
track = cd_add_track(cd);
cdtext = track_get_cdtext(track);
rem = track_get_rem(track);
cur_filename = new_filename;
if (NULL != cur_filename)
prev_filename = cur_filename;
if (NULL == prev_filename)
yyerror("no file specified for track");
else
track_set_filename(track, prev_filename);
new_filename = NULL;
}
;
track_def
: TRACK NUMBER track_mode '\n' {
track_set_mode(track, $3);
}
;
track_mode
: AUDIO
| MODE1_2048
| MODE1_2352
| MODE2_2336
| MODE2_2048
| MODE2_2342
| MODE2_2332
| MODE2_2352
;
track_statements
: track_statement
| track_statements track_statement
;
track_statement
: cdtext
| rem
| FLAGS track_flags '\n'
| TRACK_ISRC STRING '\n' { track_set_isrc(track, $2); }
| PREGAP time '\n' { track_set_zero_pre(track, $2); }
| INDEX NUMBER time '\n' {
long prev_length;
/* Set previous track length if it has not been set */
if (NULL != prev_track && NULL == cur_filename
&& track_get_length (prev_track) == -1) {
/* track shares file with previous track */
prev_length = $3 - track_get_start(prev_track);
track_set_length(prev_track, prev_length);
}
if (1 == $2) {
/* INDEX 01 */
track_set_start(track, $3);
long idx00 = track_get_index (track, 0);
if (idx00 != -1 && $3 != 0)
track_set_zero_pre (track, $3 - idx00);
}
track_set_index (track, $2, $3);
}
| POSTGAP time '\n' { track_set_zero_post(track, $2); }
| track_data
| error '\n'
;
track_flags
: /* empty */
| track_flags track_flag { track_set_flag(track, $2); }
;
track_flag
: PRE
| DCP
| FOUR_CH
| SCMS
;
cdtext
: cdtext_item STRING '\n' { cdtext_set ($1, $2, cdtext); }
;
cdtext_item
: TITLE
| PERFORMER
| SONGWRITER
| COMPOSER
| ARRANGER
| MESSAGE
| DISC_ID
| GENRE
| TOC_INFO1
| TOC_INFO2
| UPC_EAN
| ISRC
| SIZE_INFO
;
time
: NUMBER
| NUMBER ':' NUMBER ':' NUMBER { $$ = time_msf_to_frame($1, $3, $5); }
;
rem
: rem_item STRING '\n' { rem_set($1, $2, rem); }
| XXX_GENRE STRING '\n' { cdtext_set($1, $2, cdtext); }
;
rem_item
: DATE
| REPLAYGAIN_ALBUM_GAIN
| REPLAYGAIN_ALBUM_PEAK
| REPLAYGAIN_TRACK_GAIN
| REPLAYGAIN_TRACK_PEAK
;
%%
/* lexer interface */
void yyerror (const char *s)
{
fprintf(stderr, "%d: %s\n", yylineno, s);
}
static void reset_static_vars()
{
cd = NULL;
track = NULL;
prev_track = NULL;
cdtext = NULL;
rem = NULL;
prev_filename = NULL;
cur_filename = NULL;
new_filename = NULL;
}
Cd *cue_parse_file(FILE *fp)
{
YY_BUFFER_STATE buffer = NULL;
yyin = fp;
buffer = yy_create_buffer(yyin, YY_BUF_SIZE);
yy_switch_to_buffer(buffer);
Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd;
else ret_cd = NULL;
yy_delete_buffer(buffer);
reset_static_vars();
return ret_cd;
}
Cd *cue_parse_string(const char* string)
{
YY_BUFFER_STATE buffer = NULL;
buffer = yy_scan_string(string);
Cd *ret_cd = NULL;
if (0 == yyparse()) ret_cd = cd;
else ret_cd = NULL;
yy_delete_buffer(buffer);
reset_static_vars();
return ret_cd;
}

2413
dep/libcue/src/cue_scanner.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,139 @@
%{
/*
* Copyright (c) 2004, 2005, 2006, 2007, Svend Sorensen
* Copyright (c) 2009, 2010 Jochen Keil
* For license terms, see the file COPYING in this distribution.
*/
#include <stdlib.h>
#include <string.h>
#include "cd.h"
#include "cue_parser.h"
char yy_buffer[PARSER_BUFFER];
int yylex(void);
%}
ws [ \t\r]
nonws [^ \t\r\n]
%option yylineno
%option noyywrap
%option noinput
%option nounput
%s NAME
%x REM
%x RPG
%x SKIP
%%
\'([^\']|\\\')*\' |
\"([^\"]|\\\")*\" {
yylval.sval = strncpy( yy_buffer,
++yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng) - 2] = '\0';
BEGIN(INITIAL);
return STRING;
}
<NAME>{nonws}+ {
yylval.sval = strncpy( yy_buffer,
yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0';
BEGIN(INITIAL);
return STRING;
}
CATALOG { BEGIN(NAME); return CATALOG; }
CDTEXTFILE { BEGIN(NAME); return CDTEXTFILE; }
FILE { BEGIN(NAME); return FFILE; }
BINARY { return BINARY; }
MOTOROLA { return MOTOROLA; }
AIFF { return AIFF; }
WAVE { return WAVE; }
MP3 { return MP3; }
FLAC { return FLAC; }
TRACK { return TRACK; }
AUDIO { yylval.ival = MODE_AUDIO; return AUDIO; }
MODE1\/2048 { yylval.ival = MODE_MODE1; return MODE1_2048; }
MODE1\/2352 { yylval.ival = MODE_MODE1_RAW; return MODE1_2352; }
MODE2\/2336 { yylval.ival = MODE_MODE2; return MODE2_2336; }
MODE2\/2048 { yylval.ival = MODE_MODE2_FORM1; return MODE2_2048; }
MODE2\/2342 { yylval.ival = MODE_MODE2_FORM2; return MODE2_2342; }
MODE2\/2332 { yylval.ival = MODE_MODE2_FORM_MIX; return MODE2_2332; }
MODE2\/2352 { yylval.ival = MODE_MODE2_RAW; return MODE2_2352; }
FLAGS { return FLAGS; }
PRE { yylval.ival = FLAG_PRE_EMPHASIS; return PRE; }
DCP { yylval.ival = FLAG_COPY_PERMITTED; return DCP; }
4CH { yylval.ival = FLAG_FOUR_CHANNEL; return FOUR_CH; }
SCMS { yylval.ival = FLAG_SCMS; return SCMS; }
PREGAP { return PREGAP; }
INDEX { return INDEX; }
POSTGAP { return POSTGAP; }
TITLE { BEGIN(NAME); yylval.ival = PTI_TITLE; return TITLE; }
PERFORMER { BEGIN(NAME); yylval.ival = PTI_PERFORMER; return PERFORMER; }
SONGWRITER { BEGIN(NAME); yylval.ival = PTI_SONGWRITER; return SONGWRITER; }
COMPOSER { BEGIN(NAME); yylval.ival = PTI_COMPOSER; return COMPOSER; }
ARRANGER { BEGIN(NAME); yylval.ival = PTI_ARRANGER; return ARRANGER; }
MESSAGE { BEGIN(NAME); yylval.ival = PTI_MESSAGE; return MESSAGE; }
DISC_ID { BEGIN(NAME); yylval.ival = PTI_DISC_ID; return DISC_ID; }
GENRE { BEGIN(NAME); yylval.ival = PTI_GENRE; return GENRE; }
TOC_INFO1 { BEGIN(NAME); yylval.ival = PTI_TOC_INFO1; return TOC_INFO1; }
TOC_INFO2 { BEGIN(NAME); yylval.ival = PTI_TOC_INFO2; return TOC_INFO2; }
UPC_EAN { BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return UPC_EAN; }
ISRC/{ws}+\" { BEGIN(NAME); yylval.ival = PTI_UPC_ISRC; return ISRC; }
SIZE_INFO { BEGIN(NAME); yylval.ival = PTI_SIZE_INFO; return SIZE_INFO; }
ISRC { BEGIN(NAME); return TRACK_ISRC; }
REM { BEGIN(REM); /* exclusive rules for special exceptions */ }
<REM>DATE { BEGIN(NAME); yylval.ival = REM_DATE; return DATE; }
<REM>GENRE { BEGIN(NAME); yylval.ival = PTI_GENRE; return XXX_GENRE; }
<REM>REPLAYGAIN_ALBUM_GAIN { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_GAIN;
return REPLAYGAIN_ALBUM_GAIN; }
<REM>REPLAYGAIN_ALBUM_PEAK { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_ALBUM_PEAK;
return REPLAYGAIN_ALBUM_PEAK; }
<REM>REPLAYGAIN_TRACK_GAIN { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_GAIN;
return REPLAYGAIN_TRACK_GAIN; }
<REM>REPLAYGAIN_TRACK_PEAK { BEGIN(RPG); yylval.ival = REM_REPLAYGAIN_TRACK_PEAK;
return REPLAYGAIN_TRACK_PEAK; }
<REM>{ws}+ { BEGIN(REM); }
<REM>. { BEGIN(REM); }
<REM>\n { BEGIN(INITIAL); }
<RPG>{nonws}+ {
yylval.sval = strncpy( yy_buffer,
yytext,
(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng));
yylval.sval[(yyleng > sizeof(yy_buffer) ? sizeof(yy_buffer) : yyleng)] = '\0';
BEGIN(SKIP);
return STRING;
}
<RPG>{ws}+ { BEGIN(RPG); }
<SKIP>.*\n { BEGIN(INITIAL); yylineno++; return '\n'; }
{ws}+ { /* ignore whitespace */ }
[[:digit:]]+ { yylval.ival = atoi(yytext); return NUMBER; }
: { return yytext[0]; }
^{ws}*\n { yylineno++; /* blank line */ }
\n { yylineno++; return '\n'; }
. { fprintf(stderr, "bad character '%c'\n", yytext[0]); }
%%

140
dep/libcue/src/rem.c Normal file
View file

@ -0,0 +1,140 @@
/*
* Copyright (c) 2009, 2010 Jochen Keil
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY Jochen Keil ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Jochen Keil BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rem.h"
struct Rem {
unsigned int cmt;
char *value;
};
Rem*
rem_new( void)
{
Rem* new_rem = NULL;
Rem rem[] = {
{REM_DATE, NULL},
{REM_REPLAYGAIN_ALBUM_GAIN, NULL},
{REM_REPLAYGAIN_ALBUM_PEAK, NULL},
{REM_REPLAYGAIN_TRACK_GAIN, NULL},
{REM_REPLAYGAIN_TRACK_PEAK, NULL},
{REM_END, NULL}
};
/* sizeof(rem) = number of elements in rem[] * sizeof(Rem) */
new_rem = (Rem*)calloc(sizeof(rem) / sizeof(Rem), sizeof(Rem));
if (new_rem == NULL)
fprintf(stderr, "rem_new(): problem allocating memory\n");
else
memcpy(new_rem, rem, sizeof(rem));
return new_rem;
}
void
rem_free( Rem* rem)
{
if (rem == NULL)
return;
Rem* ptr = rem;
do
{
free(ptr->value);
}
while ((++ptr)->cmt != REM_END);
free(rem);
}
int
rem_is_emtpy( Rem* rem)
{
if (rem == NULL)
return 1;
do
{
if (rem->value != NULL)
return 0;
} while ((++rem)->cmt != REM_END);
return 1;
}
void
rem_set( unsigned int cmt,
char* value,
Rem* rem)
{
if (rem == NULL || value == NULL)
return;
do
{
if (rem->cmt == cmt)
{
free(rem->value);
rem->value = strdup(value);
return;
}
} while ((++rem)->cmt != REM_END);
}
const char*
rem_get( RemType cmt,
Rem* rem)
{
if (rem == NULL)
return NULL;
do
{
if (rem->cmt == cmt)
{
if (rem->value != NULL)
return rem->value;
else
return NULL;
}
} while ((++rem)->cmt != REM_END);
return NULL;
}
void
rem_dump( Rem* rem)
{
if (rem == NULL)
return;
do
{
printf("REM %u: %s\n", rem->cmt, rem->value);
} while ((++rem)->cmt != REM_END);
}

36
dep/libcue/src/time.c Normal file
View file

@ -0,0 +1,36 @@
/*
* time.c -- time functions
*
* Copyright (C) 2004, 2005, 2006, 2007 Svend Sorensen
* For license terms, see the file COPYING in this distribution.
*/
#include "time.h"
#include <stdio.h>
#include <stdlib.h>
long time_msf_to_frame(int m, int s, int f)
{
return (m * 60 + s) * 75 + f;
}
void time_frame_to_msf(long frame, int *m, int *s, int *f)
{
*f = frame % 75; /* 0 <= frames <= 74 */
frame /= 75;
*s = frame % 60; /* 0 <= seconds <= 59 */
frame /= 60;
*m = frame; /* 0 <= minutes */
}
/* print frame in mm:ss:ff format */
char *time_frame_to_mmssff(long f)
{
static char msf[9];
int minutes, seconds, frames;
time_frame_to_msf(f, &minutes, &seconds, &frames);
sprintf(msf, "%02d:%02d:%02d", minutes, seconds, frames);
return msf;
}

View file

@ -21,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YBaseLib", "dep\YBaseLib\So
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stb", "dep\stb\stb.vcxproj", "{ED601289-AC1A-46B8-A8ED-17DB9EB73423}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcue", "dep\libcue\libcue.vcxproj", "{6A4208ED-E3DC-41E1-81CD-F61025FC285A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -161,6 +163,22 @@ Global
{ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x64.Build.0 = ReleaseLTCG|x64
{ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x86.ActiveCfg = ReleaseLTCG|Win32
{ED601289-AC1A-46B8-A8ED-17DB9EB73423}.ReleaseLTCG|x86.Build.0 = ReleaseLTCG|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x64.ActiveCfg = Debug|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x64.Build.0 = Debug|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x86.ActiveCfg = Debug|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Debug|x86.Build.0 = Debug|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x64.ActiveCfg = DebugFast|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x64.Build.0 = DebugFast|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x86.ActiveCfg = DebugFast|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.DebugFast|x86.Build.0 = DebugFast|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x64.ActiveCfg = Release|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x64.Build.0 = Release|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x86.ActiveCfg = Release|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.Release|x86.Build.0 = Release|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x64.ActiveCfg = ReleaseLTCG|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x64.Build.0 = ReleaseLTCG|x64
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x86.ActiveCfg = ReleaseLTCG|Win32
{6A4208ED-E3DC-41E1-81CD-F61025FC285A}.ReleaseLTCG|x86.Build.0 = ReleaseLTCG|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -171,6 +189,7 @@ Global
{2F2A2B7B-60B3-478C-921E-3633B3C45C3F} = {BA490C0E-497D-4634-A21E-E65012006385}
{B56CE698-7300-4FA5-9609-942F1D05C5A2} = {BA490C0E-497D-4634-A21E-E65012006385}
{ED601289-AC1A-46B8-A8ED-17DB9EB73423} = {BA490C0E-497D-4634-A21E-E65012006385}
{6A4208ED-E3DC-41E1-81CD-F61025FC285A} = {BA490C0E-497D-4634-A21E-E65012006385}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {26E40B32-7C1D-48D0-95F4-1A500E054028}