This topic covers the burn/recording options that appear on various places
in InfraRecorder, for example when you want to burn a custom compilation,
a disc image, or copy a disc.
Although these options are accessable in many different contexts, as
mentioned above, they are always presented in a similar way:
General Settings
On The Fly
When recording on the fly, the file system will be generated while recording,
which may increase the risk of write errors. If this option is turned off a
temporary disc image will first be created on the hard drive and then
recorded to the disc. The preferred setting is usually off; it should
generally be enabled only when you are low on disc space.
Verify the Disc After Writing
Enabling this option will cause InfraRecorder to perform a CRC
comparison between the files on your hard drive and the files on the newly
recorded disc, to make sure that all files have been written to the disc
without any problems.
Write Speed
Select the write speed to use when recording the disc. Selecting the
Maximum option will automatically select the highest speed that the
recorder is capable of.
Write Method
This option selects what method that you want to use when recording the
disc. Only the options that your recorder supports will be available in the
combo box.
Session-At-Once (SAO) often refered to as Disc-At-Once (DAO)
writes all of the data (including lead-in and lead-out) in one pass, not
allowing any interruptions in the data stream. Additional session/data
cannot be added at a later time. Please note that DVDs must be written using
this method.
Track-At-Once (TAO) writes each track independently, which requires
link blocks between two tracks. Older recorders often force a two second
pause (pregap) between two tracks, whereas newer recorders often can adjust
the amount of pregap data (see the option described below).
TAO with zero pregap uses the Track-At-Once method described above
and tries to set the pregap data length to zero, minimizing the number of
link blocks between the tracks.
Raw writing (raw96r) writes data in raw mode using 2352 byte
sectors plus 96 bytes of raw P-W subchannel data, resulting in a sector size
of 2448 bytes. This is the preferred raw writing mode, since it gives the
best control over the CD writing process.
Raw writing (raw16) writes data in raw mode using 2352 bytes
sectors plus 16 bytes of P-Q subchannel data, resulting in a sector size of
2368 bytes. If a recorder does not support the raw96r raw writing mode,
this is the preferred raw writing mode. This write method does not support
CD-Text.
Raw writing (raw96p) writes data in raw mode using 2352 byte
sectors plus 96 bytes of raw P-W subchannel data, resulting in a sector size
of 2448 bytes. This is the less preferred raw writing mode, mainly because
very few recorders support it and some of these recorders have bugs
in the firmware implementation. Don't use this method if your recorder
supports the raw96r or raw16 raw writing method.
Important: Please note that raw writing methods
requires significantly more CPU-time than the other write methods. If your
CPU is too slow you might get problems with buffer underruns.
Other Options
Activating the Simulation option will cause InfraRecorder to
perform the selected action but with the recorder's laser turned off. This
option is recommended if you are unsure if the operation will succeed or
not.
Buffer underrun protection is a feature in most newer recorders
which allows the writing process to continue even if a buffer underrun
error occurr. This feature often has different names by different vendors,
for example: Yamaha Lossless-Link, Sanyo BURN-Proof, Ricoh Just-Link, etc.
The Pad data tracks option will cause each data track to be
followed by 15 sectors containing zeros, and audio track data
to be padded to be a multiple of 2352 bytes. You might want to enable
this option is if your CD-reader has problems reading the last sectors of a
track or if you intend to use the disc on a Linux ISO-9660 filesystem with
the read ahead bug.
Disabling the Close the disc after writing option will cause the
last session (if using SAO mode) or track (if using a TAO mode) not to be
closed. This can be useful if you want to record a CD in
multiple steps.
Important: Creating a non-closed disc is not the
same as creating a multi-session disc.
The Allow overburning option allows you to write more than the
official size to a medium. Most blank media can hold more space
than the official size, as the official size of the lead-out area on
a disc is 90 seconds (6750 sectors) and a disc usually works with only 150
sectors of lead-out. All media may be overburned by at least 88
seconds (6600 sectors). Most recorders can do overburning only with the
SAO and raw write methods. Some recorders limit
overburning and limit a disc to certain
size. This problem may be circumvented by writing the CD in raw mode
, which gives the recorder no chance to find the medium size before
starting the recording process.
When the Swap audio byte order option is enabled, audio data is
assumed to be in byte-swapped (little-endian) order. Some types of recorders
for example from Yamaha, Sony and the new SCSI-3/MMC recorders require
audio data to be presented in little-endian order, while other recorders
require audio data to be presented in big-endian (network) byte order
normally used by the SCSI protocol. The byte order required by your
recorder will automatically be detected. The only time you may want to use
this option is if your data stream is in Intel (little-endian) order.
Ignore medium size can be enabled when you want to ignore the
known size of the medium. It should be used with extreme care. This option
implies overburning.
The Set the SCSI IMMED flag option will, as the name suggest set
the IMMED flag for certain SCSI commands. Setting the IMMED flag will
request the commands to return immediateley while the operation proceeds in
the background, making the bus usable for other devices and avoiding a
system freeze. This can be useful on broken systems with ATAPI hard disk and
CD/DVD-writer on the same bus or with SCSI systems that don't use
disconnect/reconnect. These systems will freeze while blanking or closing
a disc, or while the recorder is filling up a session to the minimum amount.
Please note that not all recorders support the IMMED flag.
Yamaha Audio Master Q. R. is a feature which is used to create
high quality audio discs that have less reading problems in Hi-Fi players.
It is implemented as a variant of the SAO write mode so it will only work
if you select the Session-At-Once (SAO) write method. This feature does not
work with all writing speeds and reduces the amount of data that can
be written to a disc, because the pits on the CD will be
larger than normal. If this feature is enabled, a 74 minute CD will have
the capacity of 63 minutes, and an 80 minute CD will have the capacity
reduced to 68 minutes. This feature also works with data discs.
The Forcespeed mode option forces the drive to use the selected
write speed no matter of the quality of the medium. Normally modern drives
know the highest possible speed for different media and may reduce the
speed in order to grant the best write quality. This option should be used
with caution, the recorder usually knows better which medium to write at
full speed.
The Plextor VariRec write mode allows the user to slightly adjust
the power of the laser. If configured properly this may reduce the jitter,
resulting in better sound quality and increased playability and
compatibility with existing CD-players. VariRec only works when the write
speed is set to four.
To access the InfraRecorder configuration, use the menu:
Options Configuration...
General Settings
The Check if autorun is enabled on each startup option specifies
whether you want InfraRecorder to check if autorun enabled on each startup
or not. It is recommended that autorun is turned of because leaving autorun
enabled causes Windows to poll the CD drive while recording, which might
damage your CD.
If you want InfraRecorder to remember the last active folder in the
Explorer View you should check the Remember the last active
folder option. You can also specify a folder on your own that will be
the default every time InfraRecorder starts.
The Temporary folder option lets you specify which folder that
should be used when temporarily storing files on your harddrive, for
example disc images. If your harddrive/partition (which stores the
temporary folder) is almost full it can be a good idea to use a temporary
folder on another drive.
Advanced Settings
If you want to enable the log feature of InfraRecorder, enable the
Enable program log option. This can be usefull when trying to locate a
possible bug/error in InfraRecorder. It's not recommended that you enable
log support if you do not intend to log a special event because InfraRecorder
requires more memory and CPU-time when the log support is enabled.
The Enable smoke effect option enables or disables the smoke effect
displayed during writing processes. The smoke effect requires Windows Vista
Aero to be enabled. If Aero is not enabled this option will have no effect.
The FIFO buffer size option lets you specify the size of the RAM
buffer that is used in addition to your recorders physical buffer. Icreasing
the buffer size may result in a more stable recording process. As a rule of
thumb, the FIFO size should be at least equal to the size of the pysical
buffer of the CD/DVD-Recorder and no more than half of the physical amount
of RAM available in the machine. If you often record discs on-the-fly, this
buffer should be large (for example 128 MiB) to prevent buffer underruns.
Language Settings
A list of available languages are displayed in the combo box. To change
language, simply select the language you want in the combo box, click the
OK-button and restart InfraRecorder. If your language is not available,
check the InfraRecorder website to see if a translation in your language
exists.
Shell Extension
The shell extension (when enabled) adds additional menu entries to the
shell context menu:
It adds the options to record disc images and InfraRecorder projects
just by right-clicking on them.
The shell extension can be customized to display the items in a submenu.
To display the context menu items in a submenu enable the Display
context menu items in a submenu option.
It can also be customized to not display icons on the menu items by
disabling the Display menu item icons option.
Register the Shell Extension
The shell extension does not work automatically with disc images and
InfraRecorder projects. When enabling the Enalbe InfraRecorder shell
extension, InfraRecorder tells Windows Explorer that it offer other
applications to use it's extended features.
To make Windows Explorer use the additional features supplied by the
InfraRecorder shell extension, the shell extension must be registered with
the file types that should be able to use the extra features.
There are a set of predefined file extensions available in the list. To
associate the InfraRecorder shell extension with a file type, just check
the item in the list view. You can add any additional file types to the
list by pressing the Add file extension button:
Copying an audio disc requires more steps than copying a data disc. First
you must save the audio tracks on your hard drive. To do so, open the
tracks dialog by:
Actions Manage Tracks...
The windows should look similar to this screenshot when you have selected
your source device and inserted an audio disc:
Now select the tracks you want to save (copy) by clicking and holding the
shift or control button. When you have selected the tracks press the
save tracks button:
You will now be prompted to select a target directory for the tracks.
Please go ahead and select a folder of your choice. When you have selected
a folder all the tracks that you have selected will be saved there (unless
any major read errors occured).
You next step is to create a new audio project and add the tracks you just
saved to it. Please read this
topic for more information.
================================================
FILE: doc/english/how_to_use/copy_data_disc.html
================================================
Copy Data Disc
How to Use?
Copy Data Disc
Please note that this page contains information on how to copy a data disc.
If you want to copy an audio disc (which is an entirely different process)
please see this topic.
When you want to copy a data disc you have two main options which is if you
want to copy the disc directly to another drive (for example from a
CD-reader to a CD-recorder) or to a disc image on your hard drive.
Copy to a Compact Disc
To copy a disc directly to another drive, use the menu:
Actions Copy Disc to a Compact Disc...
or the toolbar button:
Source
Select the source drive which contains the compact disc that you want to
make a copy of.
Target
Select the target drive which contains the empty compact disc that you want
to write the copy to. Please note that the target drive can not be the same
as the source drive.
On The Fly
Writing on the fly means that the data will be read from the
source drive and then directly written to the target (recorder) without any
buffering on your hard drive (only a relatively small memory buffer is
used). If your source drive would fail to read some sectors on the source
disc it might not be able to supply the target (recorder) with data fast
enough, resulting in write errors on the target disc. However most new
recorder offer some kind of buffer underrun protection technology that
should protect the targe disc if this event occurs.
When the On the fly option is disabled a temporary disc image will
first be created on your hard drive. The disc image will then be written to
the target drive. Using this option requires more free disc space on your
hard drive but is recommended in most cases.
Clone Disc
When this option is enabled all sub-channel data and the full TOC on the
source disc will also be copied to the target disc. This option must be
enabled when copying a mixed-mode disc, otherwise only the data track will
be copied. It's recommended that your record the target disc using the
raw96r write method. If that method is not supported by your recorder,
please try the raw16 write method.
To copy a disc to a disc image on the hard drive, use the menu:
Actions Copy Disc to a Disc Image...
Source
Select the source drive which contains the compact disc that you want to
make a copy of.
Image File
Select the location and name of the disc image. Please note that you will
approximateley need the same amount of size avaiable on your hard drive as
the compact disc contains.
If you have many any changes in your hardware configuration you probably
want to make InfraRecorder aware of the changes. To display the
InfraRecorder device configuration, use the menu:
Options Devices...
You will now see a list of devices that have been detected by InfraRecorder. If
you want to update the configuration, press the Rescan button. This will
cause InfraRecorder to perform a full system scan gather information about all
supported devices.
If you want InfraRecorder to silently validate the configuration everytime
you start it, enable the Silently validate the configuration at
startup option.
================================================
FILE: doc/english/how_to_use/disc_information.html
================================================
Disc Information
How to Use?
Disc Information
To view detailed information about a disc, please use the menu:
Actions Disc Information
<select the drive containing the disc that you're interested in>
Field Information
The Disc type field displays what type of disc that is inserted in
the drive. For example: CD-R, DVD+R DL.
The Book type field is only valid on DVD discs and displays of
what book type the DVD is.
The Region field displays what region encoding the DVD has. The
region number can be resolved into the following regions:
United States of America, Canada.
Europe, including France, Greece, Turkey, Egypt, Arabia, Japan and
South Africa.
Korea, Thailand, Vietnam, Borneo and Indonesia.
Australia and New Zealand, Mexico, the Caribbean, and South
America.
India, Africa, Russia and former USSR countries.
Peoples Republic of China.
Unused.
Airlines and cruise ships.
Expansion (often used as region free).
The Layers field displays the number of layers on the disc.
The Tracks field displays the number of tracks on the disc.
The Sessions field displays the number of sessions on the disc.
The Status field displays information about the disc and session
status as well as information on if the disc is erasable or not.
The Used space field displays the amount of used space on the
disc.
The Free space field displays the amount of free space on the
disc.
To erase a rewritable disc, you can either use the menu:
Actions Erase Rewritable Disc...
or the toolbar button:
Recorder
Please select the recorder that you want to use for erasing the disc.
Erase Method
Select one of the four erase methods to use. The Erase the entire disc
method will destroy all data on the disc. This operation may take
a long time. Using the Minimally erase the disc method will only
cause the table of contents (TOC), PMA and pregap to be erased. Basicly the
actual data is never erased from the disc (it will not be accessible),
the data will instead be overwritten when you write to the disc the next
time. This method is very fast can can often be done in about 10 seconds.
The Unclose last session method uncloses the last session (on a
closed multi-session disc) allowing more sessions to be added to the disc.
The last method Erase last session will simply just erase the last
session on the disc. This may take long or short time depending on the size
of the session.
Other Options
If the table of contents (TOC) for some reason has been damaged on a
disc, InfraRecorder will not erase the disc unless the Ignore illegal
TOC option is set.
Activating the Simulation option will cause InfraRecorder to
perform the selected action but with the recorder's laser turned off. This
option is recommended if you are unsure if the operation will succeed or
not.
================================================
FILE: doc/english/how_to_use/fixate_disc.html
================================================
Close Disc
How to Use?
Close Disc
A closed disc is a disc that is considered to be finished.
Normally a disc is automatically closed after recording data. This tool is
useful if data has been written but the disc for some reason hasn't been
closed. To close a disc, use the menu:
Actions Close Disc...
Recorder
Please select the recorder that contains the disc that you want to close.
Other Options
Activating the Simulation option will cause InfraRecorder to
perform the selected action but with the recorder's laser turned off. This
option is recommended if you are unsure if the operation will succeed or
not.
The Manage Tracks tool displays table of contents (TOC)
information about a certain disc. It does also offer tools to save and
verify selected tracks. To open the track manager, use the menu:
Actions Manage Tracks...
Select the tracks that you want to work with by clicking the mouse while
pressing the shift or control key. You can also use the keyboard arrows
to navigate and select in the track list.
When you save tracks to your hard drive you will be prompted to
select a target directory. The tracks will then automatically be saved
and named by their track number and type (Track 1.wav, Track 2.iso). To
save the selected tracks to you hard drive, press the save tracks
button:
To scan the selected tracks for errors, use the verify tracks button:
This topic covers the read options that appear on various places
in InfraRecorder, for example when you want to copy a disc either
to a disc image or to another disc.
Altough these options are accessable in many different contexts as
mentioned above, they are always presented in a similar way:
Read Settings
Ignore read errors
Enabling this option will cause the high level error checking not to abort
when errors are found in the data stream. The drive will also be switched
into a mode where it ignores read errors in data sectors that are a result
of uncorrectable ECC/EDC errors before reading.
Read all sub-channel data and the full TOC
When this option is enabled the disc will be read with all sub-channel
data and a full TOC. The full TOC data will be put into a file with
similar name to the specified image name but with the suffix
.toc.
Read speed
Select the speed to use when reading the disc. Selecting the
Maximum option will automatically select the highest speed that the
drive is capable of. Only MMC compliant drives will benefit from this
option. The speed of non MMC drives is not changed.
Using a lower speed may increase the readability of a disc.
There are several options that you may need to configure when adding a boot
image to your project.
Local Path
In this field you should specify the local path of the selected boot image.
The path is relative to the root folder of the disc. For example: /boot/
will create a folder called boot in the root that contains the file that
you have selected.
Emulation Type
This option lets your specify the type of emulation that should be used on
the "El Torino" boot disc. If the emulation type is set to Floppy,
the boot image must be exactly the size of a 1200, 1440 or 2880 KiB floppy.
If the emulation type is set to Harddisk, the boot image must
begin with a master boot record that contains a single partition. Using no
emulation will cause the system to load and execute the image without
performing any disc emulation.
Advanced Options
The Don't make image bootable option allows you to prevent the
disc from beeing marked as bootable. The system will provide an emulated
drive for the image, but will boot off a standard boot device.
Enabling the Write boot-info-table to the image option will cause
the boot image to be patched at offset 8 with a 54-byte table containing
information about the disc layout. If this option is enabled the local
boot image that you have specified will be patched, so make sure that you
have a backup of this file if it can't be easily regenerated.
The Boot load segment option allows you to specify the load
segment address (in hexadecimal) for no-emulation "El Torito" discs.
The Boot load size option allows you to specify the number
(in hexadecimal) of virtual (512-byte) sectors to load in no-emulation mode.
It's usually recommended to load the entire boot file. Some BIOSes may have
problems if this size is not a multiple of 4.
================================================
FILE: doc/english/how_to_use/working_with_projects/getting_started.html
================================================
Getting Started
How to Use?, Working with Projects
Getting Started
This topic will help you get started with your first custom CD project.
InfraRecorder currently supports three kinds of projects.
Data Disc
projects are used for creating discs that contains files and folders (using
the ISO9660 filesystem) that can be used on almost any computer. Data discs
does not hold as much data per sector as audio discs due to the fact that
data discs also stores addition error-check/correction data. As a result of
this, data discs can be recorded in higher speed without necessary loose
any quality/data. Data discs can be created in multiple steps, allowing
data to be added to existing CDs. See this
topic for more information on the subject.
Audio Disc projects are used for creating audio discs that will
play in any CD-player (and computer). Audio projects should normally be
recorded at lower write speeds than data projects because audio discs does
not contain any error-checking/correction data.
Mixed-Mode CD projects are used for creating discs that contains
one first data track which shares the features of a Data Disc
project followed by a number of audio tracks. A Mixed-Mode CD will
play in any CD-player, but the first (data) track will sound like noise.
The audio tracks will play as normal.
To create a new project, use the menu:
File New Project
<select the type of
project that you want to create>
To open an existing project, use the menu:
File Open Project...
or the toolbar button:
InfraRecorder projects can be recorded directly to a physical compact disc
or to a disc image. A disc image is a file stored on your computer that
contains all the file data that you have added to your project (with
exception for audio tracks in Mixed-Mode and Audio
projects). A disc image can be recorded at a later time. See
this topic for more information.
To record your project to a compact disc, you can use the menu:
Actions Burn Compilation
to a Compact Disc...
or the toolbar button:
A detailed description of the recording options can be in
this topic.
Environment
General
The Explorer View toolbar is used for navigating the explorer
view and for adding files that are selected in the explorer list view to
your project.
The Disc Layout toolbar is used for project navigation and
management.
File Management
The Edit menu is used for project file management:
The options available from the edit menu (above) are also avaiable for
faster access by right-clicking in the project view. For example if your
right-click on a folder this menu will appear:
If you add more data to your project than what the selected media can
contain, the space meter at the bottom of the view will turn red:
The space meter will turn orange if the amount of data added to the
project exceeds the offical size of the media but will probably fit on
the media if recorded with overburn
enabled:
You can change the space meter size to match the actual size of the blank
disc that you will record your project on. To do so, right click on the
space meter and select the apropriate media size.
File Management
Add Files
There are many different ways to add files to your project. You can use
drag and drop from the Explorer View and from Windows Exlporer.
You can also navigate the Explore View and select the files you
want to include in your project.
When you have selected the files you want, you can use the menu:
Edit Add
Selected
or the toolbar button in the Explorer View toolbar:
You can also use the Explorer View to nagivate to a folder and
quickly add all files and folder in that folder to your project.
To add all files and folder in the active Explorer View folder,
use the menu:
Edit Add
All
or the toolbar button in the Explorer View toolbar:
Remove Files
There are several ways of removing files and folders from your project. One
way is to press the delete key on your keyboard. You can also use the menu
or the toolbar button.
To remove files using the menu, do the following:
Edit Remove
you can also use the toolbar button in the Disc Layout toolbar:
Other Operations
To rename a file or folder, use the menu:
Edit Rename
or the toolbar button in the Disc Layout toolbar:
To add a new empty folder to your project, use the menu:
A multi-session disc is a disc that contains multiple sessions. A
multi-session disc can be recorded in multiple steps by recording one
session at a time.
Creating New Multi-Session Discs
Creating a new multi-session disc is easy. To create a new multi-session
disc, create a new data project:
File New Project
Data Disc
Open the project properties:
File Project Properties...
Select the ISO tab and change the Format to:
Mode 2 XA (multisession)
You can now add files and folder to you project as usual. See
this topic for more information on how
to work with projects.
Continue Multi-Session Discs
To add more data to an existing multi-session disc you must import the
existing session data into your project. To do so, use the menu:
Actions Import Session...
A window will popup which allows you to select a device and view how much
allocated and free space that is available on the disc. If the OK-button is
greyed it means that the disc can not be imported.
When you have selected the device which has the multi-session disc that you
want to import inserted. Press the OK-button and the data will be imported
into your project. The imported data can not be manipulated or removed
from the disc. All imported files and folders are displayed in grey
text.
When are done working with the new session and want to add the new data
to the disc, either use the menu:
This topic covers the project settings that are accessible from the menu:
File Project Properties...
General Settings
The only general setting that you are able to change is the disc label. The
default suggested label is based on the date and time of when the project
was created. Please note that the label applies to the same restrictions as
general file names in the project (see the ISO Settings section).
ISO Settings
Level
This option sets the ISO conformance level which basicly are different
levels of file name restrictions. There are three levels supported in
InfraRecorder:
Level 1 uses file names in the 8.3 format (eight characters with a
three-character extension), upper case letters, numbers and underscore.
The maximum directory depth is eight.
Level 2 allows file names to be up to 31 characters long.
Level 3 allows files to be fragmented (mainly to allow packet
writing, or incremental CD recording).
Level 4 does not really exist, but when selected the ISO-9660:1999
(which is ISO-9660 version 2) standard is used. This standard allows
file names to be up to 207 characters long and the directory structure
may be more than eight levels deep.
Character Set
Defines the character set used in the local file names included in the
project. InfraRecorder tries to automatically detect the character set
used on your system.
Format
This option specifies the format that should be used when writing your
project data to a disc. Mode 1 is normally used when creating
regular non multi-session discs while Mode 2 should be used when
creating multi-session discs. Mode 1 allows 2048 bytes of data per
sector, Mode 2 allows 2336 bytes of data per sector (A CD-ROM
sector is 2352 bytes large).
Other Options
The Use Joliet file name extension adds Joliet directory records
to the disc in addition to regular ISO9660 file names. The joliet extension
is commonly used on Windows systems and allows unicode file names with a
maximum length of 64 characters.
If you want to use even longer file names you can enable the Allow more
than 64 characters for Joliet names option. This is not fully
compatible with the Joliet specification but seems to work. The maximum
character length is extended to 103 characters.
The Include UDF support in the generated file system option is
self explanatory. UDF support is currently in alpha status, and for this
reason it's not possible to generate UDF only filesystems.
The Omit version number from ISO9660 file names option is self
explanatory.
Fields
This secion contains options to specify information about the people behind
the CD-project. The Publisher, Preparer, System
and Volume set fields should be edited directly, the other fields
often contains file names due to the limited character length of 36
characters.
Audio Settings
This secion allows you to create CD-Text information. CD-Text is a format
supported by some (many?) CD-players that allows track and artist
information to be displayed when the CD is playing. These options are
available in audio and mixed-mode projects.
Boot Settings
This section is only available on data projects and allows you to specify
up to 63 boot images that will be used to create an "El Torito" bootable
disc. To add a new boot image to the project, click the Add boot
image button:
Boot Catalog
This option specifies the path and filename of the boot catalog to be used
when making an "El Torito" bootable disc. The path name should be relative
to the root on the disc. The file will be inserted into the output tree and
not created in the source filesystem. Please make sure that the specified file
name does not conflict with an existing file.
InfraRecorder does not my disc devices, how do I solve this
problem? This is most likely a permission issue. By default InfraRecorder
uses an interface called SPTI to access disc devices. On Windows
2000, XP and 2003 systems administrator permissions are required in
order to use SPTI.
If you want to allow limited user accounts to access disc devices using
SPTI, please do the following when logged in as an administrator:
Navigate "Start" then "Run" in the Windows
start-menu.
Type "secpol.msc" without the quotes and press the OK
button.
Navigate "Local Policies" then "Security Options" in the
tree.
Change "Devices: Restrict CD-ROM access to locally logged-on
user only" item from "Disabled" to "Enabled.".
Please note that some versions of Windows (Windows XP home for example)
does not have "secpol.msc". If using such a system please do the
following instead (while logged in as an administrator):
Navigate "Start" then "Run" in the Windows
start-menu.
Type "regedit" without the quotes and press the OK
button.
Navigate "HKEY_LOCAL_MACHINE", "SOFTWARE", "Microsoft",
"Windows NT", "CurrentVersion" and finally "Winlogon" in the
tree
In the selected path, add a string value named
"allocatecdroms" with the value "1" (without the
quotes). If the string value already exist with the value
"0", simply change it to "1".
The InfraRecorder installer supports different options/parameters for
unattended installations. The following parameters can be passed to the
installer:
/S Runs the installer (or uninstaller) silently. All
options will be default unless overrided by another parameter to the
installer.
/LANGUAGE=<language> Selects the language that
InfraRecorder should use. For example:
"irsetup.exe /S /LANGUAGE=swedish" will install InfraRecorder
silently with the default language set to Swedish.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this
License. Each licensee is addressed as “you”. “Licensees” and
“recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a “modified version” of the
earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based
on the Program.
To “propagate” a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices”
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work
for making modifications to it. “Object code” means any non-source
form of a work.
A “Standard Interface” means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
“Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
“keep intact all notices”.
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
“aggregate” if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, “normally used” refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
“Installation Information” for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered “further
restrictions” within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, “control” includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To “grant” such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. “Knowingly relying” means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is “discriminatory” if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License “or any later version” applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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 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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: doc/english/infra_recorder/system_requirements.html
================================================
System Requirements
InfraRecorder
System Requirements
InfraRecorder has the following system requirements:
Windows 98 with Internet Explorer 5.0 or newer.
32 MiB RAM.
8.1 MiB of available hard disk space.
================================================
FILE: doc/english/infra_recorder/whats_new.html
================================================
What's New
InfraRecorder
What's New?
Version 0.53.0.0
Fixed write speed detection issue.
Fixed bug where maximum write speed would be used instead of the
selected one when burning DVDs.
Fixed bug in creation of UDF and ISO9660 file systems containing
many files and folders.
Relaxed ISO9660 duplicate file naming algorithm.
Added support for non-standard character sets in ISO9660 file
systems.
Various minor GUI changes.
The space meter will now automatically adjust if a blank DVD is
inserted.
Version 0.52.0.0
Fixed bug preventing reading and encoding audio tracks.
Fixed DVD-Video file sorting bug, preventing fully compatible DVD-Video
DVDs from being created.
Added sane error message when failing to create DVD-Video file
system.
Devices with drive letters A or B are now detected properly.
Fixed shortcut icons on Windows 7 64-bit.
Added support for reading discs (creating disc image) to a network
location.
Version 0.51.0.0
Fixed bug causing desktop icons to disappear on Windows 7.
Fixed bug causing InfraRecorder to crash when opening the burn dialog
on systems with no recorder(s) present.
Added support for burning files from UNC paths.
Various other bug fixes.
Increased maximum FIFO buffer size from 128 MiB to 800 MiB.
Added context menu to explorer tree view.
InfraRecorder will now flash on the task bar when an operation has
completed.
Added French translation of help file, thanks to Olivier Higelin!
Version 0.50.0.0
Relaxed default project ISO9660 settings.
Made progress dialogs resizable for easier reading.
Added wait cursors to time consuming operations.
Fixed bug causing failed operations to sometimes be reporeted as
successful.
Fixed bug causing an error when verifying discs containing single
character file or directory names.
Updated cdrtools to version 2.01.01a61.
Added support for displaying BluRay and HD-DVD capabilities.
Displayed OK button problem should now be gone.
Greatly improved device detection speed, devices are now always probed at
startup.
Fixed a bug preventing boot images from being removed from projects.
Updated InfraRecorder projects not to store file size information that
potentially could cause write errors.
Added safety net preventing non-recoverable read errors to affect
integrity of other files during recording operation.
Updated InfraRecorder to lock files on hard drive during file system
creation in order to avoid inconsistency errors.
Added support for importing data from file lists like M3U.
Added command line options for selecting default project and media
type.
Fixed a bug causing projects opened by association not to be loaded if
welcome screen was enabled.
Added support for using Ctrl+A in the track secion to select all
tracks.
The drive letter is now displayed with the name of all CD/DVD
devices.
Renamed disc fixation to disc closing.
Fixed bugs related to drive letter detection.
Version 0.46.2.0
Fixed a bug causing the disc file system creation process to hang on some
systems (for real this time).
Fixed a bug causing a custom temporary directory not to be used.
Fixed a start-up maximization bug.
Version 0.46.1.0
Fixed a bug causing the disc file system creation process to hang on some
systems.
Version 0.46.0.0
Minor bugfixes and updates.
Added support for recording multiple copies.
Added a welcome screen to the InfraRecorder main application and removed
the express application.
Solved a bug causing the OK button not to be enabled after erasing or
formatting a disc.
Moved all source code to GPL version 3.
Removed cdrtools binaries in favor of cdrkit binaries.
Improved device detection routines, there should not be any more problems
with wrongly detected drive letters.
Included an Indonesian translation, thanks to Andhika Padmawan!
Included a Chuvash translation, thanks to Vladimir Kozhevnikov!
Fixed a bug causing the express application and shell extension not to be
translated.
Updated the portable version of InfraRecorder to store its log files in
the program directory instead of in the the application data folder.
Version 0.45.0.0
Updated cdrtools to version 2.01.01a38.
Fixed a bug making InfraRecorder crash when trying to move a folder to
itself.
Fixed a bug causing the wrong folder to be opened when double-clicking in
the project list view when a project contained folders with identical
names.
Fixed a bug causing the focus not to be returned to the OK button in the
progress dialog after performing an operation.
Fixed icon rendering error on Windows XP and newer where display depth is
lower than 32-bits.
Changed the option to verify the device configuration at start up to be
enabled by default.
Added support for associating InfraRecorder with disc images.
Updated the some of the dialog windows to be minimizable and visible on
the task bar when launced by an external application (like irExpress).
Fixed a bug causing incorrect file names to be used when verifying
recorded discs.
Added functionallity to rename and remove files from imported sessions.
Added support for selecting which multi-session track to import.
When trying to record to a non-empty rewritable disc, InfraRecorder now
asks if the disc should be erased.
When performing an operation the progress is now also displayed in the
taskbar.
Reduced memory usage when dealing with projects.
Fixed a bug making it impossible to open saved projects containing no
files.
Included a Thai translation, thanks to Prasit Kaephukhieo!
Improved compatibility with the ISO9660 standard.
Added support for creating UDF-only file systems.
Added support for Unicode files names in Joliet extension and UDF file
system.
Added support for fragmented files in ISO9660 level 3. Files larger than
4 GiB can now be recorded to an ISO9660 file system.
Removed mkisofs and isoinfo dependencies.
Fixed some bugs related to importing disc sessions.
Added properties menu item when right-clicking on the project tree root
node.
Added proper flagging of hidden files in the disc file system.
Changed the default write method for multi-session projects to TAO.
Fixed a bug causing InfraRecorder to crash when renaming project files to
include slash or backslash characters.
Added the .img extension to the list of supported disc image extensions.
A few cosmetic changes.
Included an Arabic translation, thanks to Circoficus!
Included a Greek translation, thanks to . !
Version 0.44.1.0
Introduced alternate ways of fetching recorder write speeds. This solves
the "disabled OK button problem".
Added support for reloading laptop drives (drives that can not
automatically load themselves) before starting the disc verification
process.
Corrected a version display error in the log system.
Version 0.44.0.0
Added a warning message when disabling disc fixation since some users
believes that this will create a multi-session disc.
It's now possible to perform a disc copy using the same device as source
and target.
Updated drive speed detection routines, it should now detect correct
speeds depeding on the inserted media.
Improved the media removal/insertion auto detection routines.
Added support for switching through the controls of the main view using
the tab key.
Fixed a bug causing InfraRecorder to crash on Windows 9x systems when
changing folder in the explorer view.
Added menu items for selecting all files and inverting the file selection.
Fixed a bug causing negative progress to be displayed in some cases.
Updated InfraRecorder to correctly maximize on startup, if closed
maximized.
Added a website button to the about window.
Fixed a project file rename bug.
Made the toolbar customizable in several ways.
Improved project file handling, no duplicate files or folders are allowed.
The program configuration is now stored in the application data folder.
A new portable version of InfraRecorder has been created where data is
stored in the program folder.
Greatly improved drag and drop functionality.
Included a Norwegian translation, thanks to Karol Ptasinski!
Updated the help file with index and search capabilities.
Fixed a bug causing InfraRecorder to try to verify files that where
imported from previous sessions.
Fixed a bug causing the disc to be ejected (if requested) before starting
the disc verification process.
Fixed a bug causing incompatibility with Windows 9x systems due to a
function call to SHGetFolderPathA.
Version 0.43.1.0
Updated the cdrtools to version 2.01.01a26.
Included a Finnish translation, thanks to Rami Aalto!
Removed the error message related to ckEffects.exe.
Improved the erase feature with support for more recorders.
Fixed a bug causing the size and position of the main window not to be
remembered.
Fixed a bug causing the explorer view to turn white when double-clicking
on a folder in the explorer list view (Windows XP only).
Improved the program log functionality.
Fixed a bug making it impossible to import sessions from certain disc types.
Improved the explorer view performance. Expanding anything under "My Computer"
in the tree could on some systems result in a long delay because of slow
queries to floppy drives.
Version 0.43.0.0
Fixed a bug raising an exception when re-ordering audio tracks.
Added a smoke effect when writing to a disc (requires Windows Vista
Aero to be enabled).
Fixed a few bugs causing wrong disc information to be shown in the
disc information window.
Various adaptations for Windows Vista.
Added support for dropping files into the project tree view.
Completely rewritten disc erase/format code. Improved DVD±RW and
DVD-RAM support.
Included a Catalan translation, thanks to Josep Llus Amador Teruel!
Included a Galician translation, thanks to Xess Estvez!
Fixed a bug causing InfraRecorder to have invalid window coordinates
closed while minimized.
Included a Romanian translation, thanks to Nicolae Crefelean!
Removed the Visual C++ 8 DLL dependencies from the shell extension.
Included a Hungarian translation, thanks to Tibor Srkny!
Included a Hebrew translation, thanks to Shemesh!
Included a Danish translation, thanks to Patrick Fust!
Fixed a bug causing all internal SCSI commands not to be executed in
the x64 build of InfraRecorder.
Version 0.42.1.0
The MSI installer used for the x64 release now creates the
start-menu shortcuts in a subfolder.
Fixed a bug causing InfraRecorder to crash when cdrecord reported
recording on a track-number higher than the number of tracks to be
recorded.
Removed the Visual C++ 8 DLL dependencies from the irWave codec.
Fixed a bug causing stack corruption when using the irWMA codec.
Version 0.42.0.0
Available as 64-bit (x64) build.
Created a completely new Wave codec to remove the libsndfile
dependency and add support for the x64 compiler.
Modifed the translation system to allow translated controls to
automatically resize and move its neightbours when needed.
Various changes for Windows Vista compatibility.
Modified the WMA codec so it doesn't raise an error message when it
fails to load (if Windows Media Player not installed).
Included a Japanese translation, thanks to Nardog!
Fixed a bug causing DVD media to always be recorded at maximum
speed.
Included a Korean translation, thanks to Jung Jin-ho!
Included a Bulgarian translation, thanks to Iliyan Popov!
Separated data DVD from data CD projects.
Added support for omiting version numbers from ISO9660 file names.
Added support for using Rock Ridge extensions without using the Joliet
file name extension.
Fixed a bug causing the write speed not to be properly reported on some
recorders.
Added support for column sorting.
Added support for rearranging audio tracks by drag and drop.
Included a Serbian (Cyrillic and Latin) translation, thanks to ozzii!
Added support for automatically verifying a disc after it has been
recorded.
Made the labels on the progress dialog double buffered to avoid
flickering.
Fixed a bug causing the cp1250 code page not to be properly
detected on Czech systems.
Added support for creating DVD-Video projects.
Included a Slovak translation, thanks to Marek!
Fixed a bug causing problems when importing certain seasons from
multi-session discs.
Fixed a bug causing project UDF-settings not to be properly reset
when creating a new project.
Fixed a bug causing error messages not to be properly displayed when
recording custom projects on the fly.
Included a Chinese (Traditional) translation, thanks to Charlie!
Version 0.41.0.0
Fixed a bug causing the space meter to display inaccurate file
sizes on audio files in mixed-mode projects.
Due to limitations in the Microsoft Windows 9x Unicode Layer, a
non-unicode version of InfraRecorder is released separateley.
Added support for disabling the error message that occurs when a
codec fails to load.
Added support for generating DVD-Video compliant filesystems.
Added support for UDF.
Added support for creating bootable data discs.
Fixed a major bug preventing some projects from beeing properly
loaded.
Included a Bosnian translation, thanks to Asim Husanovic!
Added an option to change the detected write speed of a recorder.
Changed the recorder speed management to now allow a larger
number of write speeds below the maximum speed.
Added write method information to the advanced device details.
Fixed a bug causing a wrong character set to be detected on systems
using code page 1251.
Fixed a bug causing bogus unix file permissions to be set when
recording custom projects using the Joliet name extension.
Improved the project space meter.
Added support for recording custom projects on the fly.
Fixed a bug causing a temporary file not to be removed when
copying a disc.
Added support for disabling the unsupported character set error
message.
Fixed a bug causing the space meter tooltip to display the size
information in bytes instead of minutes when dealing with audio
projects.
Included a Slovenian translation, thanks to Frani iek!
Included a Ukrainian translation and manual, thanks to Serhij Dubyk!
The advanced device properties list now correctly displays
titletip when a feature description is to long to be fully
displayed.
Fixed a bug causing empty directories to be ignored when creating
and recording custom projects.
Fixed a bug causing files that has equal characters in the
file name to raise an error when creating a disc image.
Included a Portuguese (Brazilian) translation, thanks to der Silva!
Included a Chinese (Simplified) translation, thanks to DouDeHou!
Added more read options (ignore read errors, read
sub-channel data and TOC, read speed).
================================================
FILE: doc/english/infrarecorder.hhp
================================================
[OPTIONS]
Compatibility=1.1 or later
Compiled file=infrarecorder.chm
Contents file=infrarecorder.hhc
Default topic=infra_recorder\introduction.html
Display compile progress=No
Full-text search=Yes
Index file=infrarecorder.hhk
Language=0x409 English (United States)
Title=InfraRecorder Help
[INFOTYPES]
================================================
FILE: doc/english/style.css
================================================
body
{
font-weight: normal;
font-size: 11px;
margin: 0px;
color: #000000;
font-family: Verdana, Arial, Helvetica, sans-serif;
height: 100%;
background-color: #ffffff;
text-align: left
}
h1
{
font-size: 115%;
margin-top: 1em;
margin-bottom: .6em;
}
h2
{
font-size: 100%;
margin-top: 1em;
margin-bottom: .6em;
}
ul
{
list-style-type: disc;
margin-left: 1.9em;
margin-top: .6em;
margin-bottom: 0em;
}
ol
{
margin-left: 2.9em;
margin-top: .6em;
margin-bottom: 0em;
font-weight: bold;
}
ol span
{
font-weight: normal;
}
li
{
margin-bottom: .3em;
}
p,dl
{
margin-top: .6em;
margin-bottom: .6em;
}
hr
{
margin-top: .6em;
}
dd
{
padding-top: .2em;
margin-bottom: .6em;
margin-left: 0.8em;
}
#header
{
background: #ccccff;
border-bottom: 1px solid #9999ff;
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
}
#location
{
font-style: italic;
}
#topic
{
font-weight: bold;
}
#content
{
padding: 10px;
padding-left: 10px;
overflow: auto;
height: 100%;
}
================================================
FILE: doc/english/stylescript.js
================================================
window.onload = OnSize;
window.onresize = OnSize;
function OnSize()
{
var vHeader = document.all.item("header");
var vContent = document.all.item("content");
if (vContent ==null)
return;
if (vHeader != null)
{
document.all.content.style.overflow = "auto";
document.all.header.style.width = document.body.offsetWidth;
document.all.content.style.width = document.body.offsetWidth - 4;
document.all.content.style.top = document.all.header.offsetHeight;
if (document.body.offsetHeight > document.all.header.offsetHeight)
{
document.all.content.style.height = document.body.offsetHeight - document.all.header.offsetHeight - 3;
}
else
{
document.all.content.style.height = 0;
}
}
}
================================================
FILE: doc/french/Gpl-3.0-FR.txt
================================================
LICENCE PUBLIQUE GNRALE GNU
Version 3, du 29 juin 2007.
Copyright (C) 2007 Free Software Foundation, Inc.
Chacun est autoris copier et distribuer des copies conformes de ce document de licence, mais toute modification en est proscrite.
Traduction franaise par Philippe Verdy
, le 30 juin 2007.
_______________________________________________________________________
Avertissement important au sujet de cette traduction franaise.
_______________________________________________________________________
Ceci est une traduction en franais de la licence GNU General Public
License (GPL). Cette traduction est fournie ici dans lespoir quelle
facilitera sa comprhension, mais elle ne constitue pas une traduction
officielle ou approuve dun point de vue juridique.
La Free Software Foundation (FSF) ne publie pas cette traduction et ne
la pas approuve en tant que substitut valide au plan lgal pour la
licence authentique GNU General Public Licence. Cette traduction na
pas encore t passe en revue attentivement par un juriste et donc le
traducteur ne peut garantir avec certitude quelle reprsente avec
exactitude la signification lgale des termes de la licence authentique
GNU General Public License publie en anglais. Cette traduction
ntablit donc lgalement aucun des termes et conditions dutilisation
dun logiciel sous licence GNU GPL seul le texte original en anglais
le fait. Si vous souhaitez tre sr que les activits que vous projetez
seront autorises par la GNU General Public License, veuillez vous
rfrer sa seule version anglaise authentique.
La FSF vous recommande fermement de ne pas utiliser cette traduction en
tant que termes officiels pour vos propres programmes ; veuillez plutt
utiliser la version anglaise authentique telle que publie par la FSF.
Si vous choisissez dacheminer cette traduction en mme temps quun
Programme sous licence GNU GPL, cela ne vous dispense pas de lobligation
dacheminer en mme temps une copie de la licence authentique en anglais,
et de conserver dans la traduction cet avertissement important en
franais et son quivalent en anglais ci-dessous.
_______________________________________________________________________
Important Warning About This French Translation.
_______________________________________________________________________
This is a translation of the GNU General Public License (GPL) into
French. This translation is distributed in the hope that it will
facilitate understanding, but it is not an official or legally approved
translation.
The Free Software Foundation (FSF) is not the publisher of this
translation and has not approved it as a legal substitute for the
authentic GNU General Public License. The translation has not been
reviewed carefully by lawyers, and therefore the translator cannot be
sure that it exactly represents the legal meaning of the authentic GNU
General Public License published in English. This translation does not
legally state the terms and conditions of use of any Program licenced
under GNU GPL only the original English text of the GNU LGPL does
that. If you wish to be sure whether your planned activities are
permitted by the GNU General Public License, please refer to its sole
authentic English version.
The FSF strongly urges you not to use this translation as the official
distribution terms for your programs; instead, please use the authentic
English version published by the FSF. If you choose to convey this
translation along with a Program covered by the GPL Licence, this does
not remove your obligation to convey at the same time a copy of the
authentic GNU GPL License in English, and you must keep in this
translation this important warning in English and its equivalent in
French above.
_______________________________________________________________________
Prambule
La Licence Publique Gnrale GNU (GNU General Public License) est une
licence libre, en copyleft, destine aux uvres logicielles et
dautres types de travaux.
Les licences de la plupart des uvres logicielles et autres travaux de
pratique sont conues pour ter votre libert de partager et modifier
ces travaux. En contraste, la Licence Publique Gnrale GNU a pour but
de garantir votre libert de partager et changer toutes les versions
dun programme afin dassurer quil restera libre pour tous les
utilisateurs. Nous, la Free Software Foundation, utilisons la Licence
Publique Gnrale GNU pour la plupart de nos logiciels ; cela
sapplique aussi tout autre travail dit de cette faon par ses
auteurs. Vous pouvez, vous aussi, lappliquer vos propres programmes.
Quand nous parlons de logiciel libre (free), nous nous rfrons la
libert (freedom), pas au prix. Nos Licences Publiques Gnrales sont
conues pour assurer que vous ayez la libert de distribuer des copies
de logiciel libre (et le facturer si vous le souhaitez), que vous
receviez le code source ou pouviez lobtenir si vous le voulez, que
vous pouviez modifier le logiciel ou en utiliser toute partie dans de
nouveaux logiciels libres, et que vous sachiez que vous avez le droit
de faire tout ceci.
Pour protger vos droits, nous avons besoin dempcher que dautres
vous restreignent ces droits ou vous demande de leur abandonner ces
droits. En consquence, vous avez certaines responsabilits si vous
distribuez des copies dun tel programme ou si vous le modifiez :
les responsabilits de respecter la libert des autres.
Par exemple, si vous distribuez des copies dun tel programme, que ce
soit gratuit ou contre un paiement, vous devez accorder aux
Destinataires les mmes liberts que vous avez reues. Vous devez aussi
vous assurer queux aussi reoivent ou peuvent recevoir son code
source. Et vous devez leur montrer les termes de cette licence afin
quils connaissent leurs droits.
Les dveloppeurs qui utilisent la GPL GNU protgent vos droits en deux
tapes : (1) ils affirment leur droits dauteur (copyright) sur le
logiciel, et (2) vous accordent cette Licence qui vous donne la
permission lgale de le copier, le distribuer et/ou le modifier.
Pour la protection des dveloppeurs et auteurs, la GPL stipule
clairement quil ny a pas de garantie pour ce logiciel libre. Aux fins
la fois des utilisateurs et auteurs, la GPL require que les versions
modifies soient marques comme changes, afin que leurs problmes ne
soient pas attribus de faon errone aux auteurs des versions
prcdentes.
Certains dispositifs sont conus pour empcher laccs des utilisateurs
linstallation ou lexcution de versions modifies du logiciel
lintrieur de ces dispositifs, alors que les fabricants le peuvent.
Ceci est fondamentalement incompatible avec le but de protger la
libert des utilisateurs de modifier le logiciel. Laspect systmatique
de tels abus se produit dans le secteur des produits destins aux
utilisateurs individuels, ce qui est prcidment ce qui est le plus
inacceptable. Aussi, nous avons conu cette version de la GPL pour
prohiber cette pratique pour ces produits. Si de tels problmes
surviennent dans dautres domaines, nous nous tenons prt tendre
cette restriction ces domaines dans de futures versions de la GPL,
autant quil sera ncessaire pour protger la libert des utilisateurs.
Finalement, chaque programme est constamment menac par les brevets
logiciels. Les tats ne devraient pas autoriser de tels brevets
restreindre le dveloppement et lutilisation de logiciels libres sur
des ordinateurs dusage gnral ; mais dans ceux qui le font, nous
voulons spcialement viter le danger que les brevets appliqus un
programme libre puisse le rendre effectivement propritaire. Pour
empcher ceci, la GPL assure que les brevets ne peuvent tre utiliss
pour rendre le programme non-libre.
Les termes prcis et conditions concernant la copie, la distribution
et la modification suivent.
TERMES ET CONDITIONS
Article 0. Dfinitions.
Cette Licence se rfre la version 3 de la GNU General Public
License (le texte original en anglais).
Droit dAuteur signifie aussi les droits du copyright ou voisins
qui sappliquent dautres types de travaux, tels que ceux sur les
masques de semi-conducteurs.
Le Programme se rfre tout travail qui peut tre sujet au Droit
dAuteur (copyright) et dont les droits dutilisation sont concds
en vertu de cette Licence. Chacun des Licencis, qui cette Licence
est concde, est dsign par vous. Les Licencis et les
Destinataires peuvent tre des personnes physiques ou morales
(individus ou organisations).
Modifier un travail signifie en obtenir une copie et adapter tout
ou partie du travail dune faon ncessitant une autorisation dun
titulaire de Droit dAuteur, autre que celle permettant den produire
une copie conforme. Le travail rsultant est appel une version
modifie du prcdent travail, ou un travail bas sur le
prcdent travail.
Un Travail Couvert signifie soit le Programme non modifi soit un
travail bas sur le Programme.
Propager un travail signifie faire quoi que ce soit avec lui qui,
sans permission, vous rendrait directement ou indirectement responsable
dun dlit de contrefaon suivant les lois relatives au Droit dAuteur,
lexception de son excution sur un ordinateur ou de la modification
dune copie prive. La propagation inclue la copie, la distribution
(avec ou sans modification), la mise disposition envers le public, et
aussi d'autres activits dans certains pays.
Acheminer un travail signifie tout moyen de propagation de celui-ci
qui permet dautres parties de raliser ou recevoir des copies. La
simple interaction dun utilisateur travers un rseau informatique,
sans transfert effectif dune copie, ne constitue pas un acheminement.
Une interface utilisateur interactive affiche des Notices Lgales
Appropries quand elle comprend un dispositif convenable, bien
visible et vident qui (1) affiche une notice approprie sur les droits
dauteur et (2) informe lutilisateur quil ny a pas de garantie pour
le travail (sauf si des garanties ont t fournies hors du cadre de
cette Licence), que les licencis peuvent acheminer le travail sous
cette Licence, et comment voir une copie de cette Licence. Si
linterface prsente une liste de commandes utilisateur ou doptions,
tel quun menu, un lment vident dans la liste prsente remplit ce
critre.
Article 1. Code source.
Le code source dun travail signifie la forme prfre du travail
permettant ou facilitant les modifications de celui-ci. Le code
objet dun travail signifie toute forme du travail qui nen est pas
le code source.
Une Interface Standard signifie une interface qui est soit celle
dune norme officielle dfinie par un organisme de normalisation
reconnu ou, dans le cas des interfaces spcifies pour un langage de
programmation particulier, une interface largement utilise parmi les
dveloppeurs travaillant dans ce langage.
Les Bibliothques Systme dun travail excutable incluent tout ce
qui, en dehors du travail dans son ensemble, (a) est inclus dans la
forme usuelle de paquetage dun Composant Majeur mais ne fait pas
partie de ce Composant Majeur et (b) sert seulement permettre
lutilisation du travail avec ce Composant Majeur ou implmenter une
Interface Standard pour laquelle une implmentation est disponible au
public sous forme de code source ; un Composant Majeur signifie,
dans ce contexte, un composant majeur essentiel (noyau, systme de
fentrage, etc.) du systme dexploitation (le cas chant) dun
systme sur lequel le travail excutable fonctionne, ou bien un
compilateur utilis pour produire le code objet du travail, ou un
interprte de code objet utilis pour excuter celui-ci.
Le Source Correspondant dun travail sous forme de code objet
signifie lensemble des codes sources ncessaires pour gnrer,
installer et (dans le cas dun travail excutable) excuter le code
objet et modifier le travail, y compris les scripts pour contrler ces
activits. Cependant, cela ninclue pas les Bibliothques Systme du
travail, ni les outils dusage gnral ou les programmes libres
gnralement disponibles qui peuvent tre utiliss sans modification
pour achever ces activits mais ne sont pas partie de ce travail. Par
exemple le Source Correspondant inclut les fichiers de dfinition
dinterfaces associs aux fichiers sources du travail, et le code
source des bibliothques partages et des sous-routines lies
dynamiquement, pour lesquelles le travail est spcifiquement conu pour
les requrir via, par exemple, des communications de donnes ou
contrles de flux internes entre ces sous-programmes et dautres
parties du travail.
Le Source Correspondant na pas besoin dinclure tout ce que les
utilisateurs peuvent regnrer automatiquement partir dautres
parties du Source Correspondant.
Le Source Correspondant pour un travail sous forme de code source est
ce mme travail.
Article 2. Permissions de base.
Tous les droits accords suivant cette Licence le sont jusquau terme
des Droits dAuteur (copyright) sur le Programme, et sont
irrvocables pourvu que les conditions tablies soient remplies. Cette
Licence affirme explicitement votre permission illimite dexcuter le
Programme non modifi. La sortie produite par lexcution dun Travail
Couvert nest couverte par cette Licence que si cette sortie, tant
donn leur contenu, constitue un Travail Couvert. Cette Licence
reconnait vos propres droits dusage raisonnable (fair use en
lgislation des tats-Unis dAmrique) ou autres quivalents, tels
quils sont pourvus par la loi applicable sur le Droit dAuteur
(copyright).
Vous pouvez crer, excuter et propager sans condition des Travaux
Couverts que vous nacheminez pas, aussi longtemps que votre licence
demeure en vigueur. Vous pouvez acheminer des Travaux Couverts
dautres personnes dans le seul but de leur faire raliser des
modifications votre usage exclusif, ou pour quils vous fournissent
des facilits vous permettant dexcuter ces travaux, pourvu que vous
vous conformiez aux termes de cette Licence lors de lacheminement de
tout matriel dont vous ne contrlez pas le Droit dAuteur
(copyright). Ceux qui, ds lors, ralisent ou excutent pour vous les
Travaux Couverts ne doivent alors le faire quexclusivement pour votre
propre compte, sous votre direction et votre contrle, suivant des
termes qui leur interdisent de raliser, en dehors de leurs relations
avec vous, toute copie de votre matriel soumis au Droit dAuteur.
Lacheminement dans toutes les autres circonstances nest permis que
selon les conditions tablies ci-dessous. La concession de
sous-licences nest pas autoris ; larticle 10 rend cet usage non
ncessaire.
Article 3. Protection des droits lgaux des utilisateurs envers les
lois anti-contournement.
Aucun Travail Couvert ne doit tre vu comme faisant partie dune mesure
technologique effective selon toute loi applicable remplissant les
obligations prvues larticle 11 du trait international sur le droit
dauteur adopt lOMPI le 20 dcembre 1996, ou toutes lois similaires
qui prohibent ou restreignent le contournement de telles mesures.
Si vous acheminez un Travail Couvert, vous renoncez tout pouvoir lgal
dinterdire le contournement des mesures technologiques dans tous les
cas o un tel contournement serait effectu en exerant les droits
prvus dans cette Licence pour ce Travail Couvert, et vous dclarez
rejeter toute intention de limiter lopration ou la modification du
Travail, en tant que moyens de renforcer, lencontre des utilisateurs
de ce Travail, vos droits lgaux ou ceux de tierces parties dinterdire
le contournement des mesures technologiques.
Article 4. Acheminement des copies conformes.
Vous pouvez acheminer des copies conformes du code source du Programme
tel que vous lavez reu, sur nimporte quel support, pourvu que vous
publiiez scrupuleusement et de faon approprie sur chaque copie une
notice de Droit dAuteur approprie ; gardez intactes toutes les
notices tablissant que cette Licence et tous les termes additionnels non
permissifs ajouts en accord avec larticle 7 sappliquent ce code ;
et donnez chacun des Destinataires une copie de cette Licence en mme
temps que le Programme.
Vous pouvez facturer un prix quelconque, y compris gratuit, chacune
des copies que vous acheminez, et vous pouvez offrir une protection
additionnelle de support ou de garantie en change dun paiement.
Article 5. Acheminement des versions sources modifies.
Vous pouvez acheminer un travail bas sur le Programme, ou bien les
modifications pour le produire partir du Programme, sous la forme de
code source suivant les termes de larticle 4, pourvu que vous
satisfassiez aussi chacune des conditions requises suivantes :
a) Le travail doit comporter des notices videntes tablissant que
vous lavez modifi et donnant la date correspondante.
b) Le travail doit comporter des notices videntes tablissant quil
est dit selon cette Licence et les conditions ajoutes daprs
larticle 7. Cette obligation vient modifier lobligation de
larticle 4 de garder intactes toutes les notices.
c) Vous devez licencier le travail entier, comme un tout, suivant
cette Licence quiconque entre en possession dune copie. Cette
Licence sappliquera en consquence, avec les termes additionnels
applicables prvus par larticle 7, la totalit du travail et
chacune de ses parties, indpendamment de la faon dont ils sont
empaquets. Cette licence ne donne aucune permission de licencier
le travail dune autre faon, mais elle ninvalide pas une telle
permission si vous lavez reue sparment.
d) Si le travail a des interfaces utilisateurs interactives, chacune
doit afficher les Notices Lgales Appropries ; cependant si le
Programme a des interfaces qui naffichent pas les Notices Lgales
Appropries, votre travail na pas les modifier pour quelles
les affichent.
Une compilation dun Travail Couvert avec dautres travaux spars et
indpendants, qui ne sont pas par leur nature des extensions du Travail
Couvert, et qui ne sont pas combins avec lui de faon former un
programme plus large, dans ou sur un volume de stockage ou un support
de distribution, est appel un aggrgat si la compilation et son
Droit dAuteur rsultant ne sont pas utiliss pour limiter laccs ou
les droits lgaux des utilisateurs de la compilation en dea de ce que
permettent les travaux individuels. Linclusion dun Travail Couvert
dans un aggrgat ne cause pas lapplication de cette Licence aux
autres parties de laggrgat.
Article 6. Acheminement des formes non sources.
Vous pouvez acheminer sous forme de code objet un Travail Couvert
suivant les termes des articles 4 et 5, pourvu que vous acheminiez
galement suivant les termes de cette Licence le Source Correspondant
lisible par une machine, dune des faons suivantes :
a) Acheminer le code objet sur, ou inclus dans, un produit physique
(y compris un support de distribution physique), accompagn par le
Source Correspondant fix sur un support physique durable
habituellement utilis pour les changes de logiciels.
b) Acheminer le code objet sur, ou inclus dans, un produit physique
(y compris un support de distribution physique), accompagn dune
offre crite, valide pour au moins trois annes et valide pour
aussi longtemps que vous fournissez des pices de rechange ou un
support client pour ce modle de produit, afin de donner
quiconque possde le code objet soit (1) une copie du Source
Correspondant tout logiciel dans ce produit qui est couvert par
cette Licence, sur un support physique durable habituellement
utilis pour les changes de logiciels, pour un prix non suprieur
au cot raisonnable de la ralisation physique de lacheminement
de la source, ou soit (2) un accs permettant de copier le Source
Correspondant depuis un serveur rseau sans frais.
c) Acheminer des copies individuelles du code objet avec une copie de
loffre crite de fournir le Source Correspondant. Cette
alternative est permise seulement occasionellement et non
commercialement, et seulement si vous avez reu le code objet avec
une telle offre, en accord avec larticle 6 alina b.
d) Acheminer le code objet en offrant un accs depuis un emplacement
dsign (gratuit ou contre facturation) et offrir un accs
quivalent au Source Correspondant de la mme faon via le mme
emplacement et sans facturation supplmentaire. Vous navez pas
besoin dobliger les Destinataires copier le Source
Correspondant en mme temps que le code objet. Si lemplacement
pour copier le code objet est un serveur rseau, le Source
Correspondant peut tre sur un serveur diffrent (opr par vous
ou par un tiers) qui supporte des facilits quivalentes de
copie, pourvu que vous mainteniez des directions claires
proximit du code objet indiquant o trouver le Source
Correspondant. Indpendamment de quel serveur hberge le Source
Correspondant, vous restez oblig de vous assurer quil reste
disponible aussi longtemps que ncessaire pour satisfaire ces
obligations.
e) Acheminer le code objet en utilisant une transmission
dgal--gal, pourvu que vous informiez les autres participants
sur o le code objet et le Source Correspondant du travail sont
offerts sans frais au public gnral suivant larticle 6 alina d.
Une portion sparable du code objet, dont le code source est exclu
du Source Correspondant en tant que Bibliothque Systme, na pas
besoin dtre inclu dans lacheminement du travail sous forme de
code objet.
Un Produit Utilisateur est soit (1) un Produit de Consommation,
ce qui signifie toute proprit personnelle tangible normalement
utilise des fins personnelles, familiales ou relatives au foyer,
soit (2) toute chose conue ou vendue pour lincorporation dans un lieu
dhabitation. Pour dterminer si un produit constitue un Produit de
Consommation, les cas ambigus sont rsolus en fonction de la
couverture. Pour un produit particulier reu par un utilisateur
particulier, lexpression normalement utilise ci-avant se rfre
une utilisation typique ou lusage commun de produits de mme
catgorie, indpendamment du statut de cet utilisateur particulier ou
de la faon spcifique dont cet utilisateur particulier utilise
effectivement ou sattend lui-mme ou est attendu utiliser ce
produit. Un produit est un Produit de Consommation indpendamment du
fait que ce produit a ou na pas dutilisations substantielles
commerciales, industrielles ou hors Consommation, moins que de telles
utilisations reprsentent le seul mode significatif dutilisation du
produit.
Les Informations dInstallation dun Produit Utilisateur signifient
toutes les mthodes, procdures, cls dautorisation ou autres
informations requises pour installer et excuter des versions modifies
dun Travail Couvert dans ce Produit Utilisateur partir dune version
modifie de son Source Correspondant. Les informations qui suffisent
assurer la continuit de fonctionnement du code objet modifi ne
doivent en aucun cas tre empches ou interfres du seul fait quune
modification a t effectue.
Si vous acheminez le code objet dun Travail Couvert dans, ou avec, ou
spcifiquement pour lutilisation dans, un Produit Utilisateur et
lacheminement se produit en tant qulment dune transaction dans
laquelle le droit de possession et dutilisation du Produit
Utilisateur est transfr au Destinataire dfinitivement ou pour un
terme fix (indpendamment de la faon dont la transaction est
caractrise), le Source Correspondant achemin selon cet article-ci
doit tre accompagn des Informations dInstallation. Mais cette
obligation ne sapplique pas si ni vous ni aucune tierce partie ne
dtient la possibilit dintaller un code objet modifi sur le Produit
Utilisateur (par exemple, le travail a t install en mmoire morte).
Lobligation de fournir les Informations dInstallation ninclue pas
celle de continuer fournir un service de support, une garantie ou des
mises jour pour un travail qui a t modifi ou install par le
Destinataire, ou pour le Produit Utilisateur dans lequel il a t
modifi ou install. Laccs un rseau peut tre rejet quand la
modification elle-mme affecte matriellement et dfavorablement les
oprations du rseau ou viole les rgles et protocoles de communication
au travers du rseau.
Le Source Correspondant achemin et les Informations dInstallation
fournies, en accord avec cet article, doivent tre dans un format
publiquement document (et dont une implmentation est disponible
auprs du public sous forme de code source) et ne doit ncessiter
aucune cl ou mot de passe spcial pour le dpaquetage, la lecture ou
la copie.
Article 7. Termes additionnels.
Les permissions additionelles dsignent les termes qui
supplmentent ceux de cette Licence en mettant des exceptions lune
ou plusieurs de ses conditions. Les permissions additionnelles qui
sont applicables au Programme entier doivent tre traites comme si
elles taient incluent dans cette Licence, dans les limites de leur
validit suivant la loi applicable. Si des permissions additionnelles
sappliquent seulement une partie du Programme, cette partie peut
tre utilise sparment suivant ces permissions, mais le Programme
tout entier reste gouvern par cette Licence sans regard aux
permissions additionelles.
Quand vous acheminez une copie dun Travail Couvert, vous pouvez
votre convenance ter toute permission additionelle de cette copie, ou
de nimporte quelle partie de celui-ci. (Des permissions
additionnelles peuvent tre rdiges de faon requrir leur propre
suppression dans certains cas o vous modifiez le travail.) Vous
pouvez placer les permissions additionnelles sur le matriel achemin,
ajoutes par vous un Travail Couvert pour lequel vous avez ou pouvez
donner les permissions de Droit dAuteur (copyright) appropries.
Nonobstant toute autre clause de cette Licence, pour tout constituant
que vous ajoutez un Travail Couvert, vous pouvez (si autoris par les
titulaires de Droit dAuteur pour ce constituant) supplmenter les
termes de cette Licence avec des termes :
a) qui rejettent la garantie ou limitent la responsabilit de faon
diffrente des termes des articles 15 et 16 de cette Licence ; ou
b) qui requirent la prservation de notices lgales raisonnables
spcifies ou les attributions dauteur dans ce constituant ou
dans les Notices Lgales Appropries affiches par les travaux qui
le contiennent ; ou
c) qui prohibent la reprsentation incorrecte de lorigine de ce
constituant, ou qui requirent que les versions modifies dun tel
constituant soit marques par des moyens raisonnables comme
diffrentes de la version originale ; ou
d) qui limitent lusage but publicitaire des noms des concdants de
licence et des auteurs du constituant ; ou
e) qui refusent accorder des droits selon la lgislation relative
aux marques commerciales, pour lutilisation dans des noms
commerciaux, marques commerciales ou marques de services ; ou
f) qui requirent lindemnisation des concdants de licences et
auteurs du constituant par quiconque achemine ce constituant (ou
des versions modifies de celui-ci) en assumant contractuellement
la responsabilit envers le Destinataire, pour toute
responsabilit que ces engagements contractuels imposent
directement ces octroyants de licences et auteurs.
Tous les autres termes additionnels non permissifs sont considrs
comme des restrictions avances dans le sens de larticle 10. Si le
Programme tel que vous lavez reu, ou toute partie de celui-ci,
contient une notice tablissant quil est gouvern par cette Licence en
mme temps quun terme qui est une restriction avance, vous pouvez
ter ce terme. Si un document de licence contient une restriction
avance mais permet la reconcession de licence ou lacheminement
suivant cette Licence, vous pouvez ajouter un Travail Couvert
constituant gouvern par les termes de ce document de licence, pourvu
que la restriction avance ne survit pas un telle cession de licence
ou acheminement.
Si vous ajoutez des termes un Travail Couvert en accord avec cet
article, vous devez placer, dans les fichiers sources appropris, une
dclaration des termes additionnels qui sappliquent ces fichiers, ou
une notice indiquant o trouver les termes applicables.
Les termes additionnels, quils soient permissifs ou non permissifs,
peuvent tre tablis sous la forme dune licence crite sparment, ou
tablis comme des exceptions ; les obligations ci-dessus sappliquent
dans chacun de ces cas.
Article 8. Terminaison.
Vous ne pouvez ni propager ni modifier un Travail Couvert autrement que
suivant les termes de cette Licence. Toute autre tentative de le
propager ou le modifier est nulle et terminera automatiquement vos
droits selon cette Licence (y compris toute licence de brevet accorde
selon le troisime paragraphe de larticle 11).
Cependant, si vous cessez toute violation de cette Licence, alors votre
licence depuis un titulaire de Droit dAuteur (copyright) est
rinstaure (a) titre provisoire moins que et jusqu ce que le
titulaire de Droit dAuteur termine finalement et explicitement votre
licence, et (b) de faon permanente si le titulaire de Droit dAuteur
ne parvient pas vous notifier de la violation par quelque moyen
raisonnable dans les soixante (60) jours aprs la cessation.
De plus, votre licence depuis un titulaire particulier de Droit
dAuteur est rinstaure de faon permanente si ce titulaire vous
notifie de la violation par quelque moyen raisonnable, cest la
premire fois que vous avez reu une notification deviolation de cette
Licence (pour un travail quelconque) depuis ce titulaire de Droit
dAuteur, et vous rsolvez la violation dans les trente (30) jours qui
suivent votre rception de la notification.
La terminaison de vos droits suivant cette section ne terminera pas les
licences des parties qui ont reu des copies ou droits de votre part
suivant cette Licence. Si vos droits ont t termins et non
rinstaurs de faon permanente, vous ntes plus qualifi recevoir
de nouvelles licences pour les mmes constituants selon larticle 10.
Article 9. Acceptation non requise pour obtenir des copies.
Vous ntes pas oblig daccepter cette licence afin de recevoir ou
excuter une copie du Programme. La propagation asservie dun Travail
Couvert qui se produit simplement en consquence dune transmission
dgal--gal pour recevoir une copie ne ncessite pas lacceptation.
Cependant, rien dautre que cette Licence ne vous accorde la
permission de propager ou modifier un quelconque Travail Couvert. Ces
actions enfreignent le Droit dAuteur si vous nacceptez pas cette
Licence. Par consquent, en modifiant ou propageant un Travail Couvert,
vous indiquez votre acceptation de cette Licence pour agir ainsi.
Article 10. Cession automatique de Licence aux Destinataires et
intermdiaires.
Chaque fois que vous acheminez un Travail Couvert, le Destinataire
reoit automatiquement une licence depuis les concdants originaux,
pour excuter, modifier et propager ce travail, suivant les termes de
cette Licence. Vous ntes pas responsable du renforcement de la
conformation des tierces parties avec cette Licence.
Une transaction dentit dsigne une transaction qui transfre le
contrle dune organisation, ou de substantiellement tous ses actifs,
ou la subdivision dune organisation, ou la fusion de plusieurs
organisations. Si la propagation dun Travail Couvert rsulte dune
transaction dentit, chaque partie cette transaction qui reoit une
copie du travail reoit aussi les licences pour le travail que le
prdcesseur intress cette partie avait ou pourrait donner selon le
paragraphe prcdent, plus un droit de possession du Source
Correspondant de ce travail depuis le prdcesseur intress si ce
prdcesseur en dispose ou peut lobtenir par des efforts raisonnables.
Vous ne pouvez imposer aucune restriction avance dans lexercice des
droits accords ou affirms selon cette Licence. Par exemple, vous ne
pouvez imposer aucun paiement pour la licence, aucune royaltie, ni
aucune autre charge pour lexercice des droits accords selon cette
Licence ; et vous ne pouvez amorcer aucun litige judiciaire (y compris
une rclamation croise ou contre-rclamation dans un procs) sur
lallgation quune revendication de brevet est enfreinte par la
ralisation, lutilisation, la vente, loffre de vente, ou
limportation du Programme ou dune quelconque portion de celui-ci.
Article 11. Brevets.
Un contributeur est un titulaire de Droit dAuteur (copyright)
qui autorise lutilisation selon cette Licence du Programme ou du
travail sur lequel le Programme est bas. Le travail ainsi soumis
licence est appel la version contributive de ce contributeur.
Les revendications de brevet essentielles sont toutes les
revendications de brevets dtenues ou contrles par le contributeur,
quelles soient dj acquises par lui ou acquises subsquemment, qui
pourraient tre enfreintes de quelque manire, permises par cette
Licence, sur la ralisation, lutilisation ou la vente de la version
contributive de celui-ci. Aux fins de cette dfinition, le contrle
inclue le droit de concder des sous-licences de brevets dune manire
consistante, ncessaire et suffisante, avec les obligations de cette
Licence.
Chaque contributeur vous accorde une licence de brevet non exclusive,
mondiale et libre de toute royaltie, selon les revendications de brevet
essentielles, pour raliser, utiliser, vendre, offrir la vente,
importer et autrement excuter, modifier et propager les contenus de sa
version contributive.
Dans les trois paragraphes suivants, une licence de brevet dsigne
tous les accords ou engagements exprims, quel que soit le nom que vous
lui donnez, de ne pas mettre en vigueur un brevet (telle quune
permission explicite pour mettre en pratique un brevet, ou un accord
pour ne pas poursuivre un Destinataire pour cause de violation de
brevet). Accorder une telle licence de brevet une partie signifie
conclure un tel accord ou engagement ne pas faire appliquer le brevet
cette partie.
Si vous acheminez un Travail Couvert, dpendant en connaissance dune
licence de brevet, et si le Source Correspondant du travail nest pas
disponible quiconque copie, sans frais et suivant les termes de cette
Licence, travers un serveur rseau publiquement acessible ou tout
autre moyen immdiatement accessible, alors vous devez soit (1) rendre
la Source Correspondante ainsi disponible, soit (2) vous engager vous
priver pour vous-mme du bnfice de la licence de brevet pour ce
travail particulier, soit (3) vous engager, dune faon consistante
avec les obligations de cette Licence, tendre la licence de brevet
aux Destinataires de ce travail. Dpendant en connaissance signifie
que vous avez effectivement connaissance que, selon la licence de
brevet, votre acheminement du Travail Couvert dans un pays, ou
lutilisation du Travail Couvert par votre Destinataire dans un pays,
infreindrait un ou plusieurs brevets identifiables dans ce pays o vous
avez des raisons de penser quils sont valides.
Si, conformment ou en liaison avec une mme transaction ou un mme
arrangement, vous acheminez, ou propagez en procurant un acheminement
de, un Travail Couvert et accordez une licence de brevet lune des
parties recevant le Travail Couvert pour lui permettre dutiliser,
propager, modifier ou acheminer une copie spcifique du Travail
Couvert, alors votre accord est automatiquement tendu tous les
Destinataires du Travail Couvert et des travaux bass sur celui-ci.
Une licence de brevet est discriminatoire si, dans le champ de sa
couverture, elle ninclut pas un ou plusieurs des droits qui sont
spcifiquement accords selon cette Licence, ou en prohibe lexercice,
ou est conditionne par le non-exercice dun ou plusieurs de ces
droits. Vous ne pouvez pas acheminer un Travail Couvert si vous tes
partie un arrangement selon lequel une partie tierce exerant son
activit dans la distribution de logiciels et laquelle vous effectuez
un paiement fond sur ltendue de votre activit dacheminement du
travail, et selon lequel la partie tierce accorde, une quelconque
partie qui recevrait depuis vous le Travail Couvert, une licence de
brevet discriminatoire (a) en relation avec les copies du Travail
Couvert achemines par vous (ou les copies ralises partir de ces
copies), ou (b) avant tout destine et en relation avec des produits
spcifiques ou compilations contenant le Travail Couvert, moins que
vous ayez conclu cet arrangement ou que la licence de brevet ait t
accorde avant le 28 mars 2007.
Rien dans cette Licence ne devrait tre interprt comme devant exclure
ou limiter toute licence implicite ou dautres moyens de dfense une
infraction qui vous seraient autrement disponible selon la loi
applicable relative aux brevets.
Article 12. Non abandon de la libert des autres.
Si des conditions vous sont imposes (que ce soit par dcision
judiciaire, par un accord ou autrement) qui contredisent les conditions
de cette Licence, elles ne vous excusent pas des conditions de cette
Licence. Si vous ne pouvez pas acheminer un Travail Couvert de faon
satisfaire simultnment vos obligations suivant cette Licence et
toutes autres obligations pertinentes, alors en consquence vous ne
pouvez pas du tout lacheminer. Par exemple, si vous avez un accord sur
des termes qui vous obligent collecter pour le racheminement des
royalties depuis ceux qui vous acheminez le Programme, la seule faon
qui puisse vous permettre de satisfaire la fois ces termes et ceux
de cette Licence sera de vous abstenir entirement dacheminer le
Programme.
Article 13. Utilisation avec la Licence Gnrale Publique Affero GNU.
Nonobstant toute autre clause de cette Licence, vous avez la permission
de lier ou combiner tout Travail Couvert avec un travail plac sous la
version 3 de la Licence Gnrale Publique GNU Affero (GNU Affero
General Public License) en un seul travail combin, et dacheminer le
travail rsultant. Les termes de cette Licence continueront
sappliquer la partie formant un Travail Couvert, mais les
obligations spciales de la Licence Gnrale Publique GNU Affero,
article 13, concernant linteraction travers un rseau sappliqueront
la combinaison en tant que telle.
Article 14. Versions rvises de cette License.
La Free Software Foundation peut publier des versions rvises et/ou
nouvelles de la Licence Publique Gnrale GNU (GNU General Public
License) de temps en temps. De telles version nouvelles resteront
similaires dans lesprit avec la prsente version, mais peuvent
diffrer dans le dtail afin de traiter de nouveaux problmes ou
proccupations.
Chaque version reoit un numro de version distinctif. Si le Programme
indique quune version spcifique de la Licence Publique Gnrale GNU
ou toute version ultrieure (or any later version) sapplique
celui-ci, vous avez le choix de suivre soit les termes et conditions de
cette version numrote, soit ceux de nimporte quelle version publie
ultrieurement par la Free Software Foundation. Si le Programme
nindique pas une version spcifique de la Licence Publique Gnrale
GNU, vous pouvez choisir lune quelconque des versions qui ont t
publies par la Free Software Foundation.
Si le Programme spcifie quun intermdiaire peut dcider quelles
versions futures de la Licence Gnrale Publique GNU peut tre
utilise, la dclaration publique dacceptation dune version par cet
intermdiaire vous autorise choisir cette version pour le Programme.
Des versions ultrieures de la licence peuvent vous donner des
permissions additionelles ou diffrentes. Cependant aucune obligation
additionelle nest impose lun des auteurs ou titulaires de Droit
dAuteur du fait de votre choix de suivre une version ultrieure.
Article 15. Dclaration dabsence de garantie.
IL NY A AUCUNE GARANTIE POUR LE PROGRAMME, DANS LES LIMITES PERMISES
PAR LA LOI APPLICABLE. MOINS QUE CELA NE SOIT TABLI DIFFREMMENT PAR
CRIT, LES PROPRITAIRES DE DROITS ET/OU LES AUTRES PARTIES FOURNISSENT
LE PROGRAMME EN LTAT SANS GARANTIE DAUCUNE SORTE, QUELLE SOIT
EXPRIME OU IMPLICITE, CECI COMPRENANT, SANS SE LIMITER CELLES-CI,
LES GARANTIES IMPLICITES DE COMMERCIALISABILIT ET DADQUATION UN
OBJECTIF PARTICULIER. VOUS ASSUMEZ LE RISQUE ENTIER CONCERNANT LA
QUALIT ET LES PERFORMANCES DU PROGRAMME. DANS LVENTUALIT O LE
PROGRAMME SAVRERAIT DFECTUEUX, VOUS ASSUMEZ LES COTS DE TOUS LES
SERVICES, RPARATIONS OU CORRECTIONS NCESSAIRES.
Article 16. Limitation de responsabilit.
EN AUCUNE AUTRE CIRCONSTANCE QUE CELLES REQUISES PAR LA LOI APPLICABLE
OU ACCORDES PAR CRIT, UN TITULAIRE DE DROITS SUR LE PROGRAMME, OU
TOUT AUTRE PARTIE QUI MODIFIE OU ACHEMINE LE PROGRAMME COMME PERMIS
CI-DESSUS, NE PEUT TRE TENU POUR RESPONSABLE ENVERS VOUS POUR LES
DOMMAGES, INCLUANT TOUT DOMMAGE GNRAL, SPCIAL, ACCIDENTEL OU INDUIT
SURVENANT PAR SUITE DE LUTILISATION OU DE LINCAPACIT DUTILISER LE
PROGRAMME (Y COMPRIS, SANS SE LIMITER CELLES-CI, LA PERTE DE DONNES
OU LINEXACTITUDE DES DONNES RETOURNES OU LES PERTES SUBIES PAR VOUS
OU DES PARTIES TIERCES OU LINCAPACIT DU PROGRAMME FONCTIONNER AVEC
TOUT AUTRE PROGRAMME), MME SI UN TEL TITULAIRE OU TOUTE AUTRE PARTIE
A T AVIS DE LA POSSIBILIT DE TELS DOMMAGES.
Article 17. Interprtation des sections 15 et 16.
Si la dclaration dabsence de garantie et la limitation de
responsabilit fournies ci-dessus ne peuvent prendre effet localement
selon leurs termes, les cours de justice qui les examinent doivent
appliquer la lgislation locale qui approche au plus prs possible une
leve absolue de toute responsabilit civile lie au Programme, moins
quune garantie ou assumation de responsabilit accompagne une copie du
Programme en change dun paiement.
FIN DES TERMES ET CONDITIONS.
_______________________________________________________________________
Comment appliquer ces termes vos nouveaux programmes
Si vous dveloppez un nouveau programme et voulez quil soit le plus
possible utilisable par le public, la meilleure faon dy parvenir et
den faire un logiciel libre que chacun peut redistribuer et changer
suivant ces termes-ci.
Pour appliquer ces termes, attachez les notices suivantes au programme.
Il est plus sr de les attacher au dbut de chacun des fichiers sources
afin de transporter de faon la plus effective possible lexclusion de
garantie ; et chaque fichier devrait comporter au moins la ligne de
rservation de droit (copyright) et une indication permettant de savoir
o la notice complte peut tre trouve :
Copyright (C) Tous droits rservs.
Ce programme est un logiciel libre ; vous pouvez le redistribuer ou le
modifier suivant les termes de la GNU General Public License telle que
publie par la Free Software Foundation : soit la version 3 de cette
licence, soit ( votre gr) toute version ultrieure.
Ce programme est distribu dans lespoir quil vous sera utile, mais SANS
AUCUNE GARANTIE : sans mme la garantie implicite de COMMERCIALISABILIT
ni dADQUATION UN OBJECTIF PARTICULIER. Consultez la Licence Gnrale
Publique GNU pour plus de dtails.
Vous devriez avoir reu une copie de la Licence Gnrale Publique GNU avec
ce programme ; si ce nest pas le cas, consultez :
.
Ajoutez galement les informations permettant de vous contacter par
courrier lectronique ou postal.
Si le programme produit une interaction sur un terminal, faites lui
afficher une courte notice comme celle-ci lors de son dmarrage en mode
interactif :
Copyright (C)
Ce programme vient SANS ABSOLUMENT AUCUNE GARANTIE ; taper affiche g pour
les dtails. Ceci est un logiciel libre et vous tes invit le redistribuer
suivant certaines conditions ; taper affiche c pour les dtails.
Les commandes hypothtiques affiche g and affiche c devrait
afficher les parties appropries de la Licence Gnrale Publique. Bien
sr, les commandes de votre programme peuvent tre diffrentes ; pour
une interface graphique, vous pourriez utiliser une bote propos.
Vous devriez galement obtenir de votre employeur (si vous travaillez
en tant que programmeur) ou de votre cole un renoncement aux droits
de proprit pour ce programme, si ncessaire. Pour plus
dinformations ce sujet, et comment appliquer la GPL GNU, consultez
.
La Licence Gnrale Publique GNU ne permet pas dincorporer votre
programme dans des programmes propritaires. Si votre programme est une
bibliothque de sous-routines, vous pourriez considrer quil serait
plus utile de permettre de lier des applications propritaires avec la
bibliothque. Si cest ce que vous voulez faire, utilisez la Licence
Gnrale Publique Limite GNU au lieu de cette Licence ; mais dabord,
veuillez lire .
_______________________________________________________________________
================================================
FILE: doc/french/InfraRecorder.hhp
================================================
[OPTIONS]
Compatibility=1.1 or later
Compiled file=French.chm
Contents file=InfraRecorderFR.hhc
Default topic=infra_recorder\introduction.html
Display compile progress=No
Full text search stop list file=fr.stp
Full-text search=Yes
Index file=InfraRecorderFR.hhk
Language=0x809 English (United Kingdom)
Title=Aide InfraRecorder
[INFOTYPES]
================================================
FILE: doc/french/InfraRecorderFR.hhc
================================================
================================================
FILE: doc/french/fr.stp
================================================
alors
au
aucuns
aussi
autre
avant
avec
avoir
bon
car
ce
cela
ces
ceux
chaque
ci
comme
comment
dans
des
du
dedans
dehors
depuis
deux
devrait
doit
donc
dos
droite
dbut
elle
elles
en
encore
essai
est
et
eu
fait
faites
fois
font
force
haut
hors
ici
il
ils
je
juste
la
le
les
leur
l
ma
maintenant
mais
mes
mine
moins
mon
mot
mme
ni
nomms
notre
nous
nouveaux
ou
o
par
parce
parole
pas
personnes
peut
peu
pice
plupart
pour
pourquoi
quand
que
quel
quelle
quelles
quels
qui
sa
sans
ses
seulement
si
sien
son
sont
sous
soyez
sujet
sur
ta
tandis
tellement
tels
tes
ton
tous
tout
trop
trs
tu
valeur
voie
voient
vont
votre
vous
vu
a
taient
tat
tions
t
tre
================================================
FILE: doc/french/how_to_use/burn_image.html
================================================
Graver une image disque
Comment faire ?
Graver une image disque
Pour graver ou enregistrer une image disque, vous pouvez soit passer par le menu:
Actions Graver l'image...
ou par le bouton de la barre d'outils:
Il vous sera demand de slectionner l'image disque, sur votre disque dur, que vous souhaitez gravez.
Options
Une description dtaille des options disponible apparat dans cette section.
================================================
FILE: doc/french/how_to_use/burn_options.html
================================================
Options de gravure
Comment faire ?
Options de gravure
Cette section concerne les options de gravure
qui peuvent tre appeles de plusieurs endroit dans InfraRecorder. Par
exemple, lorsque vous souhaitez votre propre compilation, une image
disque ou faire une copie d'un disque.
Bien que ces options soient accessibles dans diffrents contextes, l'interface se prsente toujours de la mme manire :
Paramtres gnraux
A la vole
Lorsqu'on
grave la vole, tout le systme de fichiers sera gnr au moment de
la gravure, ce qui peut augmenter le risque d'erreur d'criture. Si
cette option est invalide, une image temporaire du disque sera gnre
sur le disque dur, puis enregistre sur le disque graver. Par dfaut,
cette option est invalide. Elle ne devrait tre valid que si vous
manquez d'espace sur votre disque dur.
Vrifier le disque aprs criture
En
validant cette option, InfraRecorder effectuera une comparaison CRC
entre les fichiers sources sur votre disque dur, et les fichiers cibles
qui se trouvent sur le disque qui vient d'tre grav afin de s'assurer
qu'aucune erreur d'criture ne s'est produite sur le disque.
Vitesse d'criture
Slectionne la vitesse de gravure sur le disque. En slectionnant l'option
Maximum, la vitesse la plus haute supporte par le disque ou la graveur sera utilise.
Mthode d'criture
Cette
option slectionne la mthode d'criture utilise lors de la gravure du
disque. Seules les mthodes supportes par votre graveur seront listes.
Session-At-Once (SAO)
appel aussi Disc-At-Once (DAO) , cette mthode crit toutes les
donnes (lead-in et lead-out inclus) en une seule passe. Sans autoriser
aucune interruption dans le flux de donnes. Aucune session ou donnes
ne peuvent tre ajoutes ultrieurement sur le disque. Notez que les
DVD doivent obligatoirement tre gravs suivant cette mthode.
Track-At-Once (TAO)
crit chaque piste indpendemment ce qui requiert des blocs de lien
entre deux pistes. Les anciens graveurs crent souvent une pause de
deux secondes entre les piste (appel pregap) alors que les graveurs
les plus rcents autorisent un ajustement de la dure du pregap (voir
l'option dcrite plus bas).
TAO pregap zro utilise
la mthode Track-At-Once dcrite plus haut en essayant de dfinir
une dure de pregap zro en rduisant au maximum le nombre de blocs
de lien entre deux pistes.
Ecriture directe (raw96r)
crit les donnes brutes en utilisant des secteurs de 2352 octets plus
96 octets du sous canal P-W crant ainsi des secteur de 2448 octets. Il
s'agit de la mthode la plus courante d'criture en direct car le
contrle de l'criture sur le CD est bien plus fiable.
Ecriture directe (raw16) crit
les donnes brutes en utilisant des secteurs de 2352 octets plus 16
octets du sous canal P-Q crant ainsi des secteur de 2368 octets. Cette
mthode sera utilis si un graveur ne supporte pas l'criture directe
(raw96r). Cette mthode d'criture ne prendra pas en charge les CD-Text.
Ecriture directe (raw96p)
crit les donnes brutes en utilisant des secteurs de 2352
octets plus 96 octets du sous canal P-W crant ainsi des secteur de
2448 octets. Cette mthode est viter dans la mesure o peu de
graveurs la supportent, et beaucoup de ces graveurs ont des bogues dans
leur firmware. N'utilisez pas cette mthode sir votre graveur supporte l'criture directe raw96r ou raw16.
Important:
Notez que l'criture directe a un besoin de puissance processeur bien
plus important que pour les autres mthodes. Si votre processeur est
trs lent, vous pouvez rencontrer des problmes perte de mmoire tampon
lors de la gravure.
Autres options
La validation de l'option Simulation
va faire en sorte que Infrarecorder va effectuer les oprations
demands mais avec le laser du graveur teint. Cette option est
recommend si vous souhaitez vous assurer que la gravure du projet se
droulera correctement ou pas.
Protection "Buffer underrun"
est une focntionnalit prsente sur les graveurs les plus rcents qui
autorise la poursuite de la gravure mme si la mmoire tampon du
graveur se vide compltement. Cette fonctionnalit peut avoir des noms
diffrents suivant les marques d'quipement avec par exemple: Yamaha
Lossless-Link, Sanyo BURN-Proof, Ricoh Just-Link, etc. Le nom le plus
communment rencontr pour cette fonctionnalit est BURN-Proof.
Si l'option Complte les donnes des pistes (Pad data tracks)
est valid, 15 secteurs nulls seront crit aprs chaque piste de
donnes ou audio. Cette option sera utilis dans le cas ou votre
lecteur as des difficults lire les derniers secteurs d'une piste.
Cette option est aussi utile dans le cas ou vous souhaitez utiliser le
disque avec un systme de fichier Linux ISO-9660 contenant un bogue dit
"read ahead".
Si vous invalidez l'option Finaliser le disque aprs criture,
la dernire session (si vous utilisez le mode SAO) ou la dernire piste
(dans le cas d'un mode TAO) ne sera pas ferme. Ceci peut s'avrer
utile si vous souhaitez graver un CD en plusieurs tapes.
Important: La cration d'un disque non finalis ne correspond pas la cration d'un disque multi-session.
L'option Autoriser l'overburning
permet de graver au dela de la taille officielle du mdia. Le fait est
que la plupart des mdias vierges peuvent supporter plus que leur
taille officielle, car la zone alloue au "lead-out" est de 90 secondes
(soit 6750 secteurs), et qu'un disque fonctionne avec seulement 150
secteurs affects au "lead-out". Les mdias peuvent ainsi tre
surchargs d'au moins 88 secondes (6600 secteurs). Le majorit des
graveur ne supporte l'overburning qu'en mode d'criture SAO ou raw.
Certains graveur ne vous autorisent pas non plus de surcharger le
disque comme vous le souhaiteriez, et peuvent limiter la taille du
disque. Ce problme peut cependant tre contourn en gravant en mode
raw, car dans ce cas, le graveur n'a aucune chance de connatre la
taille du disque avant le lancement de la gravure.
Lorsque l'option Echanger l'ordre des octets audio est valide, cela suppose que l'ordre des octets est invers (little endian). Certains
modle de graveurs de Yamaha ou Sony par exemple ainsi que les graveurs
utilisant les nouvelles interfaces SCSI-3/MMC on besoin d'un mode
d'adressage des donnes audio de type little-endian, alors que les
autres ont besoin que les donnes audio soit de type big-endian
(rseau) normalement utiliser par le protocole SCSI. L'ordre
d'adressage des donnes audio sera automatiquement dtect. La seule
condition qui ncessite de valider cette option sera dans le cas d'un
flux de donnes Intel (little-endian).
Ignorer la taille du mdia
peut tre valide si vous souhaitez passez outre la taille connue du
mdia. Cette option doit tre utilise avec prcaution. Cette option
implique un overburning.
L'option Positionner le drapeau "SCSI IMMED"
va imposer un retour immdiat d'une commande SCSI pendant que l'action
se droule en arrire plan. Le bus SCSI sera ainsi disponible pour les
autres priphriques qui s'y trouvent, ce qui vitera au systme de se
figer si le graveur ne rpond pas immdiatement. Ceci peut tre utile
sur des vieux systmes utilisant un disque dur ATAPI et un graveur sur
le mme bus, ou sur un systme SCSI qui ne supporte pas le mode
connect/dconnect. Ces systmes se figerons lors de l'effacement ou
la cloture d'un disque, ou lors du remplissage de la session avec la
quantit mini de donnes. Notez que tous les graveurs supportent le
drapeau IMMED.
Yamaha Audio Master Q. R. est une
fonctionnalit qui permet de crer des disques audio de haute qualit
avec moins de problmes de lecture dans les platines CD de salon. Sa
mise en oeuvre est une variante du mode d'criture SAO, c'est pourquoi
vous n'aurez accs cette option seulement si vous avez slectionn le
mode d'criture session-at-once. Cette option ne fonctionne pas
toutes les vitesses de gravure, et n'autorise la mme quantit de
donne qu'en mode standard cause du fait que le sillon de gravure
sera largi. Si cette option est valid, un CD de 74 minutes verra sa
capacit rduite 63 minutes et un CD de 80 minutes descendra 68
minutes. Cette fonctionnalit fonctionne galement avec les disques de
donnes.
L'option Forcespeed mode force le graveur
utiliser la vitesse slectionne sans se soucier de la qualit du
mdia. Normallement, le graveur est sens connatre la vitesse de
gravure maxi autorise en fonction du mdia, et peut rduire la vitesse
pour assurer la meilleure qualit de gravure. Utilisez cette option
avec prcaution et en connaissance de cause, car habituellement, le
graveur sait trs bien quel mdia peut tre grav pleine vitesse.
L'option Plextor VariRec write mode
autorise l'utilisateur un lger ajustement de la puissance du laser.
Si cette option est configur correctement, cela peut rduire le
jitter, ce qui donnera une meilleure qualit sonore, et diminuera les
risques d'incompatibilit avec votre lecteur de salon. VariRec ne
fonctionnne que si la vtesse de gravure est dfinie x4.
Pour accder aux options de InfraRecorder, utilisez le menu:
Options Configuration...
Paramtres gnraux
L'option Vrifier si "autorun" est actif chaque dmarrage va
interdire l'autorun lorsqu'un CD est insr dans le lecteur/graveur, et
que InfraRecorder est lanc. Il est recommand que l'autorun soit
inactif, sans quoi, Windows peut lancer des applications qui sont sur
le CD alors qu'une gravure est lanc. Ceci peut endommager le CD.
L'option Afficher l'cran de bienvenue au dmarrage
affiche l'cran qui vous permet de slectionner le projet que vous
souhaitez crer. Si cette option est invalide, le projet Cd de donnes
sera slectionn par dfaut.
Les options Associer InfraRecorder aux fichiers .irp, et Associer InfraRecorder avec les images disque
si elles sont valides, lancerons automatiquement InfraRecorder avec
ces fichiers lorsque vous double-cliquerez sur ce type de fichiers dans
l'explorateur Windows.
Si vous voulez que InfraRecorder se rappelle du dernier rpertoire utilis dans la vue explorateur, vous pouvez cocher Se souvenir du dernier dossier actif. Sinon, vous pouvez spcifier un dossier par dfaut utilis chaque dmarrage de InfraRecorder.
L'option Dossier Temporaire
vous permet de spcifier l'emplacement du dossier o seront stocker
tout les fichiers temporaires de l'application sur votre disque dur
comme les images disque par exemple. Si votre disque dur ou votre
partition sur laquelle vous stockez ces fichiers temporaires est
presque pleine, cela peut tre une bonne ide d'utiliser un autre
disque dur pour ce fichier temporaire.
Paramtres avancs
Si vous souhaitez activer la fonctionnalit de journalisation (log), cochez l'option Activer le log.
Ceci peut s'avrer utile si vous souhaitez pister un bogue ou une
erreur dans InfraRecorder. Il n'est cependant pas souhaitable de
laisser le log actif si vous ne souhaitez pas pister d'vnement
spcial, car le log ncessite plus de mmoire et de temps CPU.
L'option Activer l'effet de fume
valide ou invalide l'affichage d'une colonne de fume durant la
gravure. L'effet de fume ncessite l'activation de l'effet Aero dans
Windows Vista soit activ. Si Aero n'est pas activ, cette option
n'aura aucun effet.
L'option Taille du tampon FIFO
permet de chnager la quantit de mmoire RAM utilise pour le tampon en
plus de de la taille du buffer physique du graveur. Augmenter la taille
du tampon peu permettre d'avoir une gravure plus stable. En rgle
gnrale, la taille du FIFO ne doit pas tre infrieure la taille
physique du tampon du graveur, et ne doit pas tre suprieure la
moiti de la RAM installe sur votre PC. Si vous faites souvent des
gravures la vole, vous devez paramtrer une taille importante de
tampon FIFO (par exemple 128MiB) pour viter toute rupture (underrun)
des donnes lors de la gravure.
Paramtre de langue
Une liste des langues
disponible est affiche dans la bote de slection. Pour changer la
langue, slectionnez simplement la langue que vous souhaitez, cliquez
sur le bouton OK, et redmarrez InfraRecorder. Si la langue que vous
souhaitez n'est pas disponible, vrifiez sur le site InfraRecorder si votre langue existe.
Extension
L'extension shell (lorsque elle est active) ajoute une commande supplmentaire au menu contextuel de l'explorateur Windows :
Cela
rajoute l'option de graver une image dique, ou un projet InfraRecorder
juste en faisant un clic droit sur le fichier au sein de
l'explorateur.
L'extension shell peut tre personnalise pour ajouter les commandes dans un sous-menu. Pour cela, validez l'option Afficher les menus contextuels dans des sous-menus.
On
peut aussi personnaliser l'extension shell pour qu'elle n'affiche pas
les icnes dans les commandes du menu en invalidant l'option Afficher les icnes dans les menus.
Associer l'Extension Shell
L'extension
Shell n'est pas associ automatiquement avec les images disque, et les
projet InfraRecorder. Lorsqu'on valide l'option Activer l'extension InfraRecorder, InfraRecorder Informe l'explorateur Windows que d'autres applications peuvent faire appel ces fonctionnalits tendues.
Pour
permettre l'exlorateur Windows d'utiliser les fonctionnalits
tendues fournies par l'extension shell d'InfraRecorder, l'extension
shell doit tre associe avec des types de fichier susceptibles
d'utiliser ces fonctionnalits.
Il existe un jeu
prdfini d'extensions de fichiers disponible dans la liste. Pour
associer l'extension shell d'IInfraRecorder un type de fichier,
cochez le type de fichier disponible dans la liste. Vous pouvez
rajouter n'importe quel autre type de fichier la liste en cliquant
sur le bouton Ajouter une nouvelle extension de fichier la liste :
================================================
FILE: doc/french/how_to_use/copy_audio_disc.html
================================================
Copie de disques audios
Comment faire ?
Copie de disques audios
Copier un disque audio ncessite plus
d'tapes que pour une copie de disque de donnes. Vous devz d'abord
sauver les pistes audios sur votre disque dur. Pour cela, ouvrez la
boite de dialogue des pistes par le menu :
Actions Grer les pistes...
La
fentre devrait tre similaire l'aperu ci-dessous lorsque vous aurez
slectionn votre lecteur source et insr un disque audio :
Slectionnez
les piste que vous souhaitez sauvegarder (copier) en cliquant sur une
piste de dpart, puis une piste de fin en maintenant la touche MAJ
enfonc. Lorsque vos piste sont slectionnes, cliquez sur le bouton Enregistrer les pistes slectionnes sur le disque dur :
Il
vous sera demand de spcifier le rpertoire de destination pour
l'enregistrement des pistes. Slectionnez le rpertoire de votre choix.
Lorsque cela est fait, toutes les pistes que vous avez slectionnes
seront sauve l'emplacement spcifi (sauf en cas d'erreur de lecture
majeur du CD audio).
La
prochaine tape consiste crer un projet audio, et d'y ajouter les
pistes que vous venez de sauver sur votre disque dur. Pour plus
d'informations, consultez cette section.
================================================
FILE: doc/french/how_to_use/copy_data_disc.html
================================================
Copie de disques de donnes
Comment faire ?
Copie de disques de donnes
Veuillez noter que cette page contient des
informations sur la marche suivre pour copier une CD/DVD de donnes.
Si vous souhaitez copier un CD audio (ce qui est une procdure
compltement diffrente) rfrez-vous cette section.
Si vous souhaitez copier un disque de donnes, vous avez deux options qui sont : Voulez-vous
copier le disque vers un autre disque (par exemple d'un lecteur CD vers
un graveur CD) ou vers une image disque sur votre disque dur.
Copier vers un autre disque
Pour copier un disque directement, utilisez le menu :
Actions Copier le disque d'un disque compact...
ou le bouton de la barre d'outil :
Source
Slectionnez le lecteur contenant le CD/DVD que vous souhaitez copier.
Destination
Slectionnez
le graveur qui contient le CD/DVD vierge sur lequel sera grav la
copie. Si la destination est la mme que la source, vous ne pourrez pas
faire de copie la vole.
A la vole
L'criture la vole
signifie que les donnes seront lues du lecteur source et crites
directement sur le graveur de destination sans passer par un fichier
tampon sur votre disque dur (seule une petite quantit de mmoire
tampon sera alloue). Si votre lecteur source choue la lecture de
certains secteurs de votre disque source, il pourrait ne pas tre
capable d'alimenter assez rapidement le graveur de detination, ce qui
provoquerait des erreurs d'criture sur le disque de destination.
Cependant, la plupart des graveur rcent offre des protections de chute
du tampon 0 qui devrait protger le disque de destination si cela
devait se produire.
Si l'option A la vole est
invalide, une image temporaire du disque sera cre sur votre disque
dur. A l'issue de cette opration, l'image disque temporaire sera alors
grave sur le disque de destination. Cette opration ncessitera plus
d'espace disponible sur votre disque dur, mais sera plus scurisante
pour l'criture des donnes.
Cloner le disque
Lorsque
cette option est valide, tous les sous-canaux de donnes ainsi que la
table d'allocation complte (TOC) du disque source seront galement
copis sur le disque cible. Cette option doit tre valide si vous
copiez un disque en mode mixte, sans quoi, seule la piste de donnes
sera copi. Il est recommand de copier la destination en mode raw96r.
Si cette mthode n'est pas supporte par votre graveur, essayez de
spcifier une mthode d'criture raw16.
Options de lecture
Les options de lecture sont dcrites dans cette section.
Autres options
Les autres options sont dcrites dans cette section.
Copier vers une image disque
Pour copier un disque dans un fichier image sur votre disque dur, utilisez le menu :
Actions Copier le disque sur une image disque...
Source
Slectionnez le lecteur source qui contient le CD/DVD que vous souhaitez copier.
Fichier image
Spcifiez
l'emplacement et le nom du fichier image. Notez que la taille du
fichier qui sera crit sur le disque dur sera de la taille du CD/DVD
copier. Vous devez donc vous assurer qu'il y a assez de place sur votre
disque dur.
Options de lecture
Les options de lecture sont dcrites dans cette section.
================================================
FILE: doc/french/how_to_use/device_configuration.html
================================================
Configurer les priphriques
Comment faire ?
Configurer les priphriques
Si vous avez fait des modification sur
votre matriel, vous aurez probalbement en informer InfraRecorder.
Pour afficher la configuration des priphriques d'InfraRecorder,
utilisez le menu :
Options Matriel...
Vous
verrez alors la liste des priphriques qui ont t dtects par
InfraRecorder. Si vous voulez mettre jour la liste des priphrique,
cliquez sur le bouton Nouvelle recherche. Cela demandera InfraRecorder d'ffectuer une nouvelle recherche complte sur les priphriques supports sur votre machine.
================================================
FILE: doc/french/how_to_use/disc_information.html
================================================
Les informations du disque
Comment faire ?
Les informations du disque
Pour voir les informations dtailles d'un disque insr dans le lecteur/graveur de votre PC, utilisez le menu :
Actions Information sur le disque
<slectionnez le priphrique contenant le disque qui vous intresse>
Champs d'information
Le champ Type de disque affiche le type de disque insr comme par exemple: CD-R, DVD+R DL.
Le champ Type de mdia n'est valide qu'avec un DVD et affiche son "book type", c'est dire, le format physique du DVD (DVD-ROM, DVD-RAM, etc...)
Le champ Rgion affiche pour quelle rgion est encod le DVD. Les numros de rgions sont les suivants :
Etats unis, Canada.
Europe, ainsi que France, Grce, Turquie, Egypte, Arabie, Japon et Afrique du Sud.
Core, Thalande, Vietnam, Borno et Indonsie.
Australie et Nouvelle-Zlande, Mxique, les Caraibes et l'Amerique du Sud.
Inde, Afrique, Russie et pays d'ex URSS.
Rpublique Populaire de Chine.
Inutilis.
Compagnies ariennes et bateaux de croisires.
Etendue (cela correspond souvent un disque dzonn).
Le champ Couche affiche le nombre de couche sur un DVD.
Le champ Pistes affiche le nombre de piste prsentes sur le disque.
Le champ Sessions affiche le nombre de sessions prsentes sur le disque.
Le champ Statut affiche des informations sur le statut du disque et de ces sessions ainsi que l'information si le disque est effaable ou pas.
Le champ Espace utilis affiche la taille de l'espace utilis sur le disque.
Le champ Espace libre affiche la taille de l'espace disponible sur le disque.
================================================
FILE: doc/french/how_to_use/erase_disc.html
================================================
Effacer des disques r-inscriptibles
Comment faire ?
Effacer des disques r-inscriptibles
Pour effacer un disque rinscriptible, vous pouvez soit utiliser le menu :
Actions Effacer/Formatter un disque...
soit par le bouton de la barre d'outils :
Graveur
Slectionnez le graveur dans lequel se trouve le disque effacer.
Mthode d'effacement
Slectionnez une des quatre mthode d'effacement utiliser. La mthode Effacer tout le disque effacera toutes les donnes physiquement prsentes sur le disque. Cette mthode peut tre trs longue. En utilisant la mthode Effacer le disque en mode rapide,
seule la table d'allocation (TOC), PMA et le pregap seront effacs. Les
donnes effective ne sont pas effaces du disque (mais elle ne seront
plus accessible). Au lieu de cela, les donnes seront crases par les
donnes que vous crirez sur le disque la prochaine gravure. Cette
mthode est beaucoup plus rapide, car elle est effectue le plus
souvent en une dizaine de secondes. La mthode Annule la fermeture de la dernire session
annule la fermeture de la dernire session (sur un disque multi-session
finalis) permettant ainsi de rajouter des sessions sur le disque. La
dernire mthode Effacer la dernire session va simplement
effacer la dernire session enregistr sur le disque. Le temps
d'effacement de la dernire session dpendra de la taille de celle-ci.
Autres options
Si la table d'allocation (TOC) a t endommage sur le disque, InfraRecorder n'effacera pas le disque moins que l'option Ignorer le TOC illgal soit active.
Activer l'option Simulation
demandera InfraRecorder d'effectuer l'effacement avec le laser
teint. Cette opration est recommand si vous voulez savoir si
l'opration se droulera correctement ou pas.
================================================
FILE: doc/french/how_to_use/fixate_disc.html
================================================
Finaliser un disque
Comment faire ?
Finaliser un disque
Un disque finalis est un disque qu'on
peut considr termin. Normallement, un disque est automatiquement
finalis aprs l'criture des donnes. Cet outil est utile si les
donnes ont t crites mais n'ont, pour quelques raisons que ce soit,
pas t finalises. Pour finaliser un disque, utilisez le menu :
Actions Finaliser le disque...
Graveur
Slectionnez le graveur dans lequel se trouve le disque finaliser.
Autres options
Activer l'option Simulation demandera InfraRecorder
d'effectuer la finalisation avec le laser teint. Cette opration est
recommand si vous voulez savoir si l'opration se droulera
correctement ou pas.
================================================
FILE: doc/french/how_to_use/manage_tracks.html
================================================
Grer les pistes
Comment faire ?
Grer les pistes
L'outil Grer les pistes
affiche les informations de la table d'allocation (TOC) du disque
insr dans le lecteur/graveur. Il offre galement la possibilit de
vrifier et sauver les pistes slectionnes. Pour ouvrir le
gestionnaire de pistes, utilisez le menu :
Actions Grer les pistes...
Slectionnez
les piste dsires en cliquant dessus avec la souris en maintenant la
touche MAJ ou CTRL appuy. Vous pouvez galement utiliser les flches
du clavier et la touche MAJ pour slectionner les pistes dans la
liste.
Lorsque vous sauvgardez une piste sur votre
disque dur, vous aurez slectionner un dossier de sauvegarde. Les
pistes seront alors automatiquement sauves et nommes suivant leur
numro et type (Track 1.wav, Track 2.iso). Pour sauver les pistes
slectionnes sur votre disque dur, cliquez sur le bouton Enregistrer les pistes slectionnes sur le disque dur :
Pour rechercher des erreurs sur les pistes slectionnes, utilisez le bouton Rechercher des erreurs sur les pistes slectionnes :
Ci-dessous le rsultat aprs la vrification d'une piste de donnes :.
Vous pouvez galement effacer les pistes slectionnes si votre disque est rinscriptible ne cliquant sur le bouton Effacer les pistes slectionnes du disque :
================================================
FILE: doc/french/how_to_use/read_options.html
================================================
Options de lecture
Comment faire ?
Options de lecture
Cette section couvre les options de lecture qui
peuvent apparaitre plusieurs moment au sein d'InfraRecorder. Par
exemple, lorsque vous souhaitez un disque vers une image ou vers un
autre disque.
Bien que ces options puissent apparaitre dans diffrent contextes, elles se prsentent toujours de la mme manire :
Paramtres de lecture
Ignorer les erreurs de lecture
Valider
cette option fera en sorte de ne pas abandonner le process en cours si
une erreur de lecture de haut niveau est dtecte dans le flux de
donnes. Le lecteur/graveur sera galement plac dans un mode ou il
ignore toute erreur de lecture dans les secteur de donnes qui rsulte
d'un ECC/EDC incorrect.
Lire toutes les donnes sub-channel et toute la TOC
Lorsque
cette option est valide, le disque sera lu avec toute les donnes
sub-channel et toute la table d'allocation (TOC). Toutes les donnes de
la TOC seront places dans un fichier avec le mme nom que le fichier
image, mais avec le suffixe .toc.
Vitesse de lecture
Slectionnez la vitesse de lecture du disque. Slectionner l'option
Maximum va automatiquement slectionner la vitesse de lecture la plus haute supporte par le lecteur.
Dfinir une vitesse de lecture plus basse peut augmenter la lisibilit du disque.
================================================
FILE: doc/french/how_to_use/working_with_projects/add_boot_image.html
================================================
Ajouter une image de boot
Comment faire ?, Travail en projet.
Ajouter une image de boot
Plusieurs options peuvent tre dfinies lorsque vous ajoutez une image de boot votre projet.
Chemin local
Dans ce champs, vous devez spcifi le chemin local de l'image de boot slectionne.
Le chemin est relatif la racine du disque. Par exemple: /boot/
va crer un rpertoire appel boot la racine du disque qui contiendra le fichier slectionn.
Type d'mulation
Cette
option vous permet de choisir un type d'mulation pour un disque
bootable de type "El Torino". Si l'mulation choisie est de type disquette, la taille du fichier image de boot doit tre exactement la mme que celle d'une disquette de 1200, 1440 ou 2880 Ko.
Si l'mulation est de type disque dur,
l'image de boot doit imprativement commencer avec un MBR (Section de
boot principale du disque) qui contient une seule partition. Si aucune
mulation n'est dfinie, le systme chargera et executera l'image de
boot sans aucune mulation disque.
Options avances
L'option Faire une image non bootable
vous permet d'empcher de booter sur le CD/DVD. Le systme emulera un
disque partir l'image de boot sur le CD/DVD, mais bootera sur son
disque de boot standard.
Enabling the Write boot-info-table to the image option will cause
the boot image to be patched at offset 8 with a 54-byte table containing
information about the disc layout. If this option is enabled the local
boot image that you have specified will be patched, so make sure that you
have a backup of this file if it can't be easily regenerated.
Le champ Segment boot load vous
permet de dfinir une adresse de dmarrage (en hexadcimale) dans le
cas o aucune mulation pour les disques bootable "El Torito" discs.
Le champ Taille du boot load
vous permet de dfinir le nombre de secteurs virtuels (512 octets)
charger dans le cas o aucune mulation n'est dfinie. Il est
recommand de charger la totalit du fichier de boot. Certains BIOS sur
les cartes mre peuvent avoir des problmes si la taille du boot load
n'est pas un multiple de 4.
================================================
FILE: doc/french/how_to_use/working_with_projects/getting_started.html
================================================
Premier projet
Comment faire ?, Travail en projet.
Premier projet
Cette section va vous aider dmarrer avec votre premier projet CD/DVD de donne personnalises.
InfraRecorder supporte actuellement quatre types de projets.
Les projets CD/DVD de donnes
sont utiliss pour crer contenant des fichiers et des
rpertoires (en utilisant le systme de fichiers ISO9660) qui peut
tre exploit par presque tout ordinateur. Les disques de donnes ne
peuvent contenir autant de donnes que les disques audios par
secteurs car le systme de fichier stocke galement des donnes de
contrle
et de corrections d'erreur supplmentaires. De ce fait, les disques de
donnes peuvent tre gravs une vitesse plus leves sans perte de
donnes ou de qualit. Les disques de donnes peuvent tre gravs en
plusieurs fois, autorisant ainsi l'ajout de donnes sur un CD/DVD dj
grav. Rfrez-vous cette section
pour en savoir plus sur ce sujet.
Les projets CD Audio
sont utiliss pour crer des disque audios qui peuvent tre lu par
n'importe quelle platine CD de salon (ou d'ordinateur). Les CD audios
doivent normalement tre grav une vitesse plus lente que les CD de
donnes car ils ne contiennent pas d'informations de contrle ou de correction d'erreurs.
Les projets CD en mode mixte
sont utilis pour crer des CD qui contiennent des donnes sur leur
premire piste avec les mmes fonctionnalits qu'un CD de donnes,
suivi par des piste audios.Un CD mixte sera lu par n'importe
quelle platine de salon, mais la premire piste (celle des donnes) ne
sera que du bruit .
Les pistes audios seront joues normalement.
Les projets DVD vido
sont utiliss pour crer des DVD qui pourront tre lu sur une platine
DVD de salon. Des restrictions d'ordre matrielles peuvent cependant
empcher la platine de lire un DVD grav suivant le type de DVD grav
(+R, +RW, -R, -RW). Renseignez vous sur votre platine de salon avant de
graver un DVD vido.
Pour crer un nouveau projet, utilisez le menu:
Fichier Nouveau Projet
<slectionnez le type de projet que vous souhaitez crer>
Pour ouvrir un projet existant, utilisez le menu:
File Ouvrir un project...
ou le bouton de la barre d'outils:
Un
projet InfraRecorder peut tre directement grav sur un CD/DVD
physique, ou tre enregist dans un fichier image disque. Une image
disque est un fichier contenant toutes les donnes ajoutes au projet
(sauf les pistes audios dans le cas d'un projet audio ou projet mode mixte). Une image disque peut tre graves sur un CD/DVD plus tard. Voir cette section pour plus d'information.
Pour graver votre projet sur un CD/DVD, vous pouvez utiliser le menu:
Actions Graver la compilation
D'un disque compact...
ou le bouton de la barre d'outils:
Une description dtaille des options disponible apparat dans cette section.
Environment
General
La barre d'outil de la Vue Explorateur permet de naviguer dans la vue, et d'ajouter au projet les fichiers ou dossier slectionns dans la liste.
La barre d'outil de la vue Organisation du disque est utilise pour grer le projet et naviguer dans le projet.
Gestion des fichiers
Le menu Edition est utilis pour la gestion des fichiers du projet.
Les
options disponibles dans le menu d'dition (ci-dessus) peuvent tre
appel partir de la vue de l'explorateur par appel d'un menu
contextuel l'aide d'un clic droit dans la vue. Par exemple, si vous faites un clic droit sur un dossier, ce menu apparatra:
Si
vous ajoutez votre projet plus de donnes que le mdia slectionn ne
peut en contenir, l'indicateur d'espace en bas de la vue passera au
rouge:
L'indicateur
d'espace passera l'orange si la somme des donnes du projet excde la
taille officielle du mdia, mais pourront probablement tenir si
l'option Autoriser l'overburning
est active:
Vous
pouvez changer la taille de l'indicateur afin de correspondre au disque
vierge sur lequel vous allez graver votre projet. Pour cela, faites un
clic droit sur l'indicateur, et slectionnez le type de mdia appropri.
Gestion de fichiers
Ajout de fichiers
Il y a diffrents moyens d'ajouter des fichiers votre projet. Vous pouvez faire un glisser-dposer depuis la vue explorateur ou depuis l'explorateur Windows vers la vue organisation du disque.
Vous pouvez galement naviguer dans la vue explorateur et slectionner les fichiers que vous souhaitez ajouter votre projet.
Lorsque les fichiers dsirs sont slectionns, vous pouvez utiliser le menu:
Edition Ajouter
Slectionn
ou le bouton de la barre d'outil de la vue explorateur:
Vous pouvez galement naviguer dans la vue explorateur sur un dossier, et rapidement ajouter tous les dossiers et fichiers contenus dans ce dossier votre projet.
Pour ajouter tous les fichiers et dossiers dans la vue explorateur active, utilisez le menu:
Edition Ajouter
Tout
ou le bouton de la barre d'outil de la vue explorateur:
Supprimer des fichiers
Il
y a plusieurs faons de supprimer des fichiers et des dossiers de votre
projet. Une faon consiste slectionner les fichiers et dossiers dans
la vue organisation du disque et appuyer sur le touche "suppr" de votre clavier. Vous pouvez galement utiliser le menu ou le bouton de la barre d'outil:
Pour supprimer les fichiers slectionns en utilisant le menu:
Edition Supprimer
ou le bouton de la barre d'outil de la vue organisation du disque:
Autres oprations
Pour renommer un fichier ou un dossier slectionn, utilisez le menu:
Edition Renommer
ou le bouton de la barre d'outil de la vue organisation du disque:
Pour ajouter un dossier vide votre projet, utilisez le menu:
Edition Nouveau Dossier
ou le bouton de la barre d'outil de la vue organisation du disque:
Un disque multi-session est un disque contenant
de multiple gravures. Un disque multi-session peut tre graver en
plusieurs tapes en ne gravant qu'une session la fois.
Cration d'un nouveau disque multi-session
La cration d'un disque multi-session est simple. Tout d'abord, crez un nouveau projet de donnes:
Fichier Nouveau projet
CD(ou DVD) de donnes
Ouvrez les proprits du projet:
Fichier Proprits du projet...
Selectionnez l'onglet ISO, et changez le Format en:
Mode 2 XA (multi-session)
Vous pouvez prsent ajouter des fichiers et des dossiers votre projet normalement. Reportez-vous cette section pour plus d'informations sur la faon de travailler en projet.
Continuer un disque multi-session
Pour
ajouter des donnes un disque multi-session dj grav, vous devez
d'abord importer les sessions existantes sur le disque. Pour cela,
utilisez le menu:
Actions Importer une session...
Une
fentre vous permettant de slectionner le priphrique et de voir
l'espace allou et disponible sur le disque va s'ouvrir. Si le bouton
OK est gris, cela signifie que les sessions du disque prsent dans le
priphrique ne peuvent tre importes.
Lorsque vous avez
selectionn le priphrique contenant un disque multi-session
importer, cliquez sur le bouton OK, et toutes les donnes sur le disque
vont tre ajoutes votre projet. Les donnes importes ne peuvent
tre manipules ou retires du disque. Tous les fichiers et dossiers
imports apparaissent avec un texte gris.
Ds
que votre travail sur la nouvelle session est termin et que vous
souhaitez ajouter ces donnes au disque, vous pouvez soit utiliser le
menu:
Actions Graver la compilation
d'un disque compact...
soit le bouton de la barre d'outils:
Ce qu'il faut savoir de plus sur les disques multi-sessions
En
plus des donnes que vous allez graver, chaque session ncessite 13Mo
supplmentaire pour ces informations. Cela implique que la capacit
d'un disque va dpendre du nombre de session qui y sont stockes.
Certains
lecteurs de CD/DVD peuvent ne pas reconnaitre les sessions qui se
trouvent aprs la premire session d'un disque. Si cela se produit, on
peut retrouver ces informations en finalisant un disque. Mais on perd dans ce cas la possibilit d'ajouter de nouvelles sessions au disque.
================================================
FILE: doc/french/how_to_use/working_with_projects/project_settings.html
================================================
Paramtres projet
Comment faire ?, Travail en projet.
Paramtres projet
Cette section traite des paramtres du projet accessible par le menu:
Fichier Proprits du projet...
Paramtres gnraux
Le
seul paramtre gnral susceptible d'tre modifi est l'tiquette du
disque. L'tiquette soumise par dfaut est base sur la date et l'heure
de cration du projet. Notez que le nom de l'tiquette est soumis au
mme restriction que celui des fichiers du projet (voir la section Paramtres ISO ci-dessous).
Paramtres ISO
Niveau
Cette
option dfinit le niveau de conformit la norme ISO qui dfinit la
restriction sur le nom des fichier. Il y a trois niveau de restriction
grs par InfraRecorder:
Le niveau 1 utilise
des noms de fichier en format 8.3 (huit caractres avec trois
caractres pour l'extension), en majuscule, chiffres et caractre
soulign(underscore). Le nombre maximum de dossiers dans un chemin est
de huit.
Le niveau 2 autorise des noms de fichiers jusqu' 31 caractres.
Le niveau 3 autorise la fragmentation des fichiers (principalement pour l'criture par paquets, ou une gravure incrmentale).
Le
niveau 4 n'existe pas vraiment, mais lorsqu'il est slectionn, la
norme ISO-9660:1999 (qui est la norme ISO-9660 version 2) est
utilise. Cette norme autorise des noms de fichier jusqu' 207
caractres, et la profondeur des chemins peut tre suprieure huit.
Format
Cette option spcifie le format utilis lorsqu'on grave un projet de disque de donnes. Le Mode 1 is normally used when creating
regular non multi-session discs while Mode 2 should be used when
creating multi-session discs. Mode 1 allows 2048 bytes of data per
sector, Mode 2 allows 2336 bytes of data per sector (A CD-ROM
sector is 2352 bytes large).
Autres Options
L'option Utiliser les extensions de nom de fichier Joliet
ajoute des enregistrements de dossier Joliet dans le disque en plus du
standard de nom de fichier ISO9660. L'extension Joliet est communment
utilise sur les sytmes Windows, et permet des nom de fichier en
format unicode avec une longueur maximum de 64 caractres.
Si cependant, vous souhaitez utiliser des nom de fichiers plus longs, validez l'option Autoriser plus de 64 caractres pour les noms de fichier Joliet.
Mme si cela n'est pas pleinement compatible avec les spcifications
Joliet, cela fonctionne. Le nombre maximum de caractres est alors
tendu 103 caractres.
L'option Omettre les numros de version des fichiers ISO9660 est explicite.
Validez l'option Utilser les extensions Rock Ridge
afin de gnrer des enrgistrement SUSP et RR utilisant le protocole
Rock Ridge qui dcrit en dtail les fichiers du systme de fichiers
ISO9660.
Champs
Cette section contient des champs qui
permettent de saisir les informations sur les personnes qui ont cres
le projet du CD/DVD. Les champs Editeur, Preparateur, Systme et Ensemble de Volumes
peuvent diter directement, les autres champs contiennent souvent des
nom de fichiers, ce qui limite leur longueur 36 caractres.
Audio
Cette
section permet de crer des information CD-Text. Le CD-Text est un
format qui peut tre support par certain lecteur CD audio, et qui
permet d'afficher le nom de l'artiste et des chansons lorsque le disque
est en lecture. Ces option ne sont valable que dans les projets en mode
audio ou en mode mixte.
Boot
Cette section
n'est disponible que dans les projets de donnes, et vous permet de
spcifier jusqu' 63 images de boot qui pourront tre utilises pour
crer un CD/DVD bootable "El Torito". Pour ajouter une image de boot au
projet, cliquez sur le bouton Ajouter une nouvelle image de boot au projet :
InfraRecorder ne reconnait pas mon graveur. Comment puis-je rsoudre le problme ? Il
s'agit bien souvent d'un problme de permission. Par dfaut,
InfraRecorder utilise une interface appele SPTI pour accder aux
pripharique de gravure. Avec Windows 200, XP et 2003, une permission
administrateur est requise pour accder aux priphriques SPTI.
Si
vous souhaitez autoriser aux comptes restreints l'accs au
priphriques SPTI, vous devez procder comme suit en tant
administrateur :
A partir du menu "Dmarrer" appelez la commande "Executer".
Tapez la commande "secpol.msc" (sans les guillemets) et cliquez sur le bouton OK.
Naviguez dans "Stratgies locale" puis "Options de scurit".
Changez
la stratgie "Priphrique : ne permettre l'accs au CD-ROM qu'aux
utilisateurs connects localement" de "Dsactiv" en "Activ".
Notez
que certaines versions de Windows (comme Windows XP par exemple) n'ont
pas de gestionnaire de stratgie "secpol.msc". Dans ce cas, vous devrez
procder comme suit en tant qu'administrateur :
A partir du menu "Dmarrer" appelez la commande "Executer".
Tapez la commande "regedit" (sans les guillemets) et cliquez sur le bouton OK.
Naviguez au sein de l'arborescence "HKEY_LOCAL_MACHINE", "SOFTWARE", "Microsoft",
"Windows NT", "CurrentVersion" et "Winlogon"
Double
cliquez sur la valeur de type REG_SZ appele "allocatecdroms",
puis rentrez la valeur "1" (sans les guillemets). with the value "1"
(without the quotes). Si la valeur n'existe pas, vous pouvez la
crer en cliquant droit, et en suivant le menu "Nouveau>Valeur
chane" avec le nom "allocatecdroms", et la valeur "1".
================================================
FILE: doc/french/infra_recorder/feature_overview.html
================================================
Aperu des fonctionnalits
InfraRecorder
Aperu des fonctionnalits
Cette page liste les fonctions essentielles de InfraRecorder.
Fonctions principales
Cre
des projets de donnes personnelles, musique, et mixte puis les
stocker sur un mdia physique ou dans un fichier image.
Cre et enregistrer des images de disques.
Cre des copies directes de disques, la vole, ou en utilisant une image disque temporaire.
Efface des disques r-inscriptibles par le biais de quatre diffrentes mthodes.
Importe des donnes de sessions issues d'un disque multi-session et lui rajouter d'autre sessions.
Clture les disques (criture d'information en pilogue pour empcher toute rajout de donnes au disque).
Recherche des priphriques sur bus SCSI/IDE et collecte des informations dtailles sur leur capacits.
Affiche des informations disque dtailles.
Lit et sauvegarde des donnes et pistes audios dans des fichiers (wav. et .iso)
Balaye les pistes slectionnes la recherche d'erreur.
Environment
Interface moderne et paramtrable du type "explorateur Windows".
Glisser/dposer de fichiers d'une vue de l'explorateur Windows vers une vue projet.
Vues de projets diffrentes suivant le type de projet pour permettre l'utilisateur de travailler plus facilement.
??? Features a separate express application designed to guide the user to
the most essential tools as quick and easy as possible.
Une interface multilingue pour l'application principale, et l'extension du shell.
Integration dans l'explorateur
S'intgre l'explorateur et ajoute de nouvelles options au menu contextuel.
Grave les projets et images disque enregistrs.
Ouvre et dite un projet enregistr.
Pleinement paramtrable, les commandes peuvent s'afficher dans un sous-menu avec ou sans icnes.
L'extension shell peut tre associes avec n'importe quelle type d'extension dfinie par l'utilisateur.
Le logiciel d'installation (installeur)
de InfraRecorder support diffrentes options pour des
installations spcifiques. Les paramtres suivants peuvent tre passs
l'installeur:
/S Execute l'installeur
(ou dsinstalleur) en mode silencieux. Toutes les choix utilisateurs se
feront par dfaut moins de dfinir une option supplmentaire.
/LANGUAGE=<langue> Dfini la langue qui doit tre utilise par InfraRecorder. Par exemple:
"irsetup.exe /S /LANGUAGE=swedish" installera InfraRecorder en mode silencieux avec la langue Sudoise.
Copyright 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this
License. Each licensee is addressed as “you”. “Licensees” and
“recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a “modified version” of the
earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based
on the Program.
To “propagate” a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices”
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work
for making modifications to it. “Object code” means any non-source
form of a work.
A “Standard Interface” means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
“Major Component”, in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
“keep intact all notices”.
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
“aggregate” if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, “normally used” refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
“Installation Information” for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered “further
restrictions” within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, “control” includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To “grant” such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. “Knowingly relying” means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is “discriminatory” if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License “or any later version” applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state 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 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/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program 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, your program's commands
might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a “copyright disclaimer” for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: doc/french/infra_recorder/license_agreement_fr.html
================================================
Accord de licence
InfraRecorder
Accord de licence
LICENCE PUBLIQUE GNRALE GNU
Version 3, du 29 juin 2007
Copyright 2007 Free Software Foundation, Inc. <http://fsf.org/>
Chacun
est autoris copier et distribuer des copies conformes de ce document
de licence, mais toute modification en est proscrite.
Traduction franaise par Philippe Verdy, le 30 juin 2007.
Avertissement important au sujet de cette traduction franaise.
Ceci
est une traduction en franais de la licence “GNU General Public
License” (GPL). Cette traduction est fournie ici dans l’espoir qu’elle
facilitera sa comprhension, mais elle ne constitue pas une
traduction officielle ou approuve d’un point de vue juridique.
La
Free Software Foundation (FSF) ne publie pas cette traduction et ne l’a
pas approuve en tant que substitut valide au plan lgal pour la
licence authentique “GNU General Public Licence”. Cette traduction n’a
pas encore t passe en revue attentivement par un juriste et donc le
traducteur ne peut garantir avec certitude qu’elle reprsente avec
exactitude la signification lgale des termes de la licence authentique
“GNU General Public License” publie en anglais. Cette traduction
n’tablit donc lgalement aucun des termes et conditions d’utilisation
d’un logiciel sous licence GNU GPL — seul le texte original en anglais
le fait. Si vous souhaitez tre sr que les activits que vous projetez
seront autorises par la GNU General Public License, veuillez vous
rfrer sa seule version anglaise authentique.
La FSF vous
recommande fermement de ne pas utiliser cette traduction en tant que
termes officiels pour vos propres programmes ; veuillez plutt utiliser
la version anglaise authentique telle que publie par la FSF. Si
vous choisissez d’acheminer cette traduction en mme temps qu’un
Programme sous licence GNU GPL, cela ne vous dispense pas de
l’obligation d’acheminer en mme temps une copie de la licence
authentique en anglais, et de conserver dans la traduction cet
avertissement important en franais et son quivalent en anglais
ci-dessous.
Important Warning About This French Translation. This
is a translation of the GNU General Public License (GPL) into French.
This translation is distributed in the hope that it will facilitate
understanding, but it is not an official or legally approved
translation.
The
Free Software Foundation (FSF) is not the publisher of this translation
and has not approved it as a legal substitute for the authentic GNU
General Public License. The translation has not been reviewed carefully
by lawyers, and therefore the translator cannot be sure that it exactly
represents the legal meaning of the authentic GNU General Public
License published in English. This translation does not legally state
the terms and conditions of use of any Program licenced under GNU GPL —
only the original English text of the GNU LGPL does that. If you wish
to be sure whether your planned activities are permitted by the GNU
General Public License, please refer to its sole authentic English
version.
The
FSF strongly urges you not to use this translation as the official
distribution terms for your programs; instead, please use the authentic
English version published by the FSF. If you choose to convey this
translation along with a Program covered by the GPL Licence, this does
not remove your obligation to convey at the same time a copy of the
authentic GNU GPL License in English, and you must keep in this
translation this important warning in English and its equivalent in
French above.
Prambule
La
Licence Publique Gnrale GNU (“GNU General Public License”) est une
licence libre, en “copyleft”, destine aux œuvres logicielles et
d’autres types de travaux.
Les licences de la plupart des œuvres
logicielles et autres travaux de pratique sont conues pour ter votre
libert de partager et modifier ces travaux. En contraste, la
Licence Publique Gnrale GNU a pour but de garantir votre
libert de partager et changer toutes les versions d’un programme —
afin d’assurer qu’il restera libre pour tous les utilisateurs. Nous, la
Free Software Foundation, utilisons la Licence Publique Gnrale GNU
pour la plupart de nos logiciels ; cela s’applique aussi tout autre
travail dit de cette faon par ses auteurs. Vous pouvez, vous aussi, l’appliquer vos propres programmes.
Quand
nous parlons de logiciel libre (“free”), nous nous rfrons la
libert (“freedom”), pas au prix. Nos Licences Publiques Gnrales sont
conues pour assurer que vous ayez la libert de distribuer des copies
de logiciel libre (et le facturer si vous le souhaitez), que vous
receviez le code source ou pouviez l’obtenir si vous le voulez, que
vous pouviez modifier le logiciel ou en utiliser toute partie dans de
nouveaux logiciels libres, et que vous sachiez que vous avez le droit
de faire tout ceci.
Pour protger vos droits, nous avons besoin
d’empcher que d’autres vous restreignent ces droits ou vous demande de
leur abandonner ces droits. En consquence, vous avez certaines
responsabilits si vous distribuez des copies d’un tel programme ou si
vous le modifiez : les responsabilits de respecter la libert des
autres.
Par exemple, si vous distribuez des copies d’un tel
programme, que ce soit gratuit ou contre un paiement, vous devez
accorder aux Destinataires les mmes liberts que vous avez reues.
Vous devez aussi vous assurer qu’eux aussi reoivent ou peuvent
recevoir son code source. Et vous devez leur montrer les termes de
cette licence afin qu’ils connaissent leurs droits.
Les
dveloppeurs qui utilisent la GPL GNU protgent vos droits en deux
tapes : (1) ils affirment leur droits d’auteur (“copyright”) sur le
logiciel, et (2) vous accordent cette Licence qui vous donne la
permission lgale de le copier, le distribuer et/ou le modifier.
Pour
la protection des dveloppeurs et auteurs, la GPL stipule clairement
qu’il n’y a pas de garantie pour ce logiciel libre. Aux fins la fois
des utilisateurs et auteurs, la GPL require que les versions modifies
soient marques comme changes, afin que leurs problmes ne soient pas
attribus de faon errone aux auteurs des versions prcdentes.
Certains
dispositifs sont conus pour empcher l’accs des utilisateurs
l’installation ou l’excution de versions modifies du logiciel
l’intrieur de ces dispositifs, alors que les fabricants le peuvent.
Ceci est fondamentalement incompatible avec le but de protger la
libert des utilisateurs de modifier le logiciel. L’aspect systmatique
de tels abus se produit dans le secteur des produits destins aux
utilisateurs individuels, ce qui est prcidment ce qui est le plus
inacceptable. Aussi, nous avons conu cette version de la GPL pour
prohiber cette pratique pour ces produits. Si de tels problmes
surviennent dans d’autres domaines, nous nous tenons prt tendre
cette restriction ces domaines dans de futures versions de la GPL,
autant qu’il sera ncessaire pour protger la libert des utilisateurs.
Finalement,
chaque programme est constamment menac par les brevets logiciels. Les
tats ne devraient pas autoriser de tels brevets restreindre le
dveloppement et l’utilisation de logiciels libres sur des ordinateurs
d’usage gnral ; mais dans ceux qui le font, nous voulons spcialement
viter le danger que les brevets appliqus un programme libre puisse
le rendre effectivement propritaire. Pour empcher ceci, la GPL assure
que les brevets ne peuvent tre utiliss pour rendre le programme
non-libre.
Les termes prcis et conditions concernant la copie, la distribution et la modification suivent.
TERMES ET CONDITIONS
0. Definitions.
Cette Licence se rfre la version 3 de la “GNU General Public License” (le texte original en anglais).
Droit d’Auteur signifie aussi les droits du “copyright” ou voisins
qui s’appliquent d’autres types de travaux, tels que ceux sur les
masques de semi-conducteurs.
Le Programme se rfre tout
travail qui peut tre sujet au Droit d’Auteur (“copyright”) et dont les
droits d’utilisation sont concds en vertu de cette Licence. Chacun
des Licencis, qui cette Licence est concde, est dsign par
vous. Les Licencis et les Destinataires peuvent tre des
personnes physiques ou morales (individus ou organisations).
Modifier un travail signifie en obtenir une copie et adapter tout ou
partie du travail d’une faon ncessitant une autorisation d’un
titulaire de Droit d’Auteur, autre que celle permettant d’en produire
une copie conforme. Le travail rsultant est appel une version
modifie du prcdent travail, ou un travail bas sur le
prcdent travail.
Un Travail Couvert signifie soit le Programme non modifi soit un travail bas sur le Programme.
Propager un travail signifie faire quoi que ce soit avec lui qui,
sans permission, vous rendrait directement ou indirectement responsable
d’un dlit de contrefaon suivant les lois relatives au Droit d’Auteur,
l’exception de son excution sur un ordinateur ou de la modification
d’une copie prive. La propagation inclue la copie, la distribution
(avec ou sans modification), la mise disposition envers le public, et
aussi d'autres activits dans certains pays.
Acheminer un
travail signifie tout moyen de propagation de celui-ci qui permet
d’autres parties de raliser ou recevoir des copies. La simple
interaction d’un utilisateur travers un rseau informatique,
sans transfert effectif d’une copie, ne constitue pas un acheminement.
Une
interface utilisateur interactive affiche des Notices Lgales
Appropries quand elle comprend un dispositif convenable, bien
visible et vident qui (1) affiche une notice approprie sur les droits
d’auteur et (2) informe l’utilisateur qu’il n’y a pas de garantie pour
le travail (sauf si des garanties ont t fournies hors du cadre de
cette Licence), que les licencis peuvent acheminer le travail sous
cette Licence, et comment voir une copie de cette Licence. Si
l’interface prsente une liste de commandes utilisateur ou d’options,
tel qu’un menu, un lment vident dans la liste prsente remplit ce
critre.
1. Code source.
Le code source
d’un travail signifie la forme prfre du travail permettant ou
facilitant les modifications de celui-ci. Le code objet d’un
travail signifie toute forme du travail qui n’en est pas le code source.
Une
Interface Standard signifie une interface qui est soit celle d’une
norme officielle dfinie par un organisme de normalisation reconnu ou,
dans le cas des interfaces spcifies pour un langage de programmation
particulier, une interface largement utilise parmi les dveloppeurs
travaillant dans ce langage.
Les Bibliothques Systme d’un
travail excutable incluent tout ce qui, en dehors du travail dans son
ensemble, (a) est inclus dans la forme usuelle de paquetage d’un
Composant Majeur mais ne fait pas partie de ce Composant Majeur et (b)
sert seulement permettre l’utilisation du travail avec ce Composant
Majeur ou implmenter une Interface Standard pour laquelle une
implmentation est disponible au public sous forme de code source ; un
Composant Majeur signifie, dans ce contexte, un composant majeur
essentiel (noyau, systme de fentrage, etc.) du systme d’exploitation
(le cas chant) d’un systme sur lequel le travail excutable
fonctionne, ou bien un compilateur utilis pour produire le code objet
du travail, ou un interprte de code objet utilis pour excuter
celui-ci.
Le Source Correspondant d’un travail sous forme de
code objet signifie l’ensemble des codes sources ncessaires pour
gnrer, installer et (dans le cas d’un travail excutable) excuter le
code objet et modifier le travail, y compris les scripts pour contrler
ces activits. Cependant, cela n’inclue pas les Bibliothques Systme
du travail, ni les outils d’usage gnral ou les programmes libres
gnralement disponibles qui peuvent tre utiliss sans modification
pour achever ces activits mais ne sont pas partie de ce travail. Par
exemple le Source Correspondant inclut les fichiers de dfinition
d’interfaces associs aux fichiers sources du travail, et le code
source des bibliothques partages et des sous-routines lies dynamiquement,
pour lesquelles le travail est spcifiquement conu pour les requrir
via, par exemple, des communications de donnes ou contrles de flux
internes entre ces sous-programmes et d’autres parties du travail.
Le
Source Correspondant n’a pas besoin d’inclure tout ce que les
utilisateurs peuvent regnrer automatiquement partir d’autres
parties du Source Correspondant. Le Source Correspondant pour un travail sous forme de code source est ce mme travail.
2. Permissions de base.
Tous
les droits accords suivant cette Licence le sont jusqu’au terme des
Droits d’Auteur (“copyright”) sur le Programme, et sont irrvocables
pourvu que les conditions tablies soient remplies. Cette Licence
affirme explicitement votre permission illimite d’excuter le
Programme non modifi. La sortie produite par l’excution d’un Travail
Couvert n’est couverte par cette Licence que si cette sortie, tant
donn leur contenu, constitue un Travail Couvert. Cette Licence
reconnait vos propres droits d’usage raisonnable (“fair use” en lgislation
des tats-Unis d’Amrique) ou autres quivalents, tels qu’ils sont
pourvus par la loi applicable sur le Droit d’Auteur (“copyright”).
Vous
pouvez crer, excuter et propager sans condition des Travaux Couverts
que vous n’acheminez pas, aussi longtemps que votre licence demeure en
vigueur. Vous pouvez acheminer des Travaux Couverts d’autres
personnes dans le seul but de leur faire raliser des modifications
votre usage exclusif, ou pour qu’ils vous fournissent des facilits
vous permettant d’excuter ces travaux, pourvu que vous vous conformiez
aux termes de cette Licence lors de l’acheminement de tout matriel
dont vous ne contrlez pas le Droit d’Auteur (“copyright”). Ceux qui,
ds lors, ralisent ou excutent pour vous les Travaux Couverts ne
doivent alors le faire qu’exclusivement pour votre propre compte, sous
votre direction et votre contrle, suivant des termes qui leur
interdisent de raliser, en dehors de leurs relations avec vous, toute
copie de votre matriel soumis au Droit d’Auteur.
L’acheminement
dans toutes les autres circonstances n’est permis que selon les
conditions tablies ci-dessous. La concession de sous-licences n’est
pas autoris ; l’article 10 rend cet usage non ncessaire.
3. Protection des droits lgaux des utilisateurs envers les lois anti-contournement.
Aucun
Travail Couvert ne doit tre vu comme faisant partie d’une mesure
technologique effective selon toute loi applicable remplissant les
obligations prvues l’article 11 du trait international sur le droit
d’auteur adopt l’OMPI le 20 dcembre 1996, ou toutes lois similaires
qui prohibent ou restreignent le contournement de telles mesures.
Si
vous acheminez un Travail Couvert, vous renoncez tout pouvoir lgal
d’interdire le contournement des mesures technologiques dans tous les
cas o un tel contournement serait effectu en exerant les droits
prvus dans cette Licence pour ce Travail Couvert, et vous dclarez
rejeter toute intention de limiter l’opration ou la modification du
Travail, en tant que moyens de renforcer, l’encontre des utilisateurs
de ce Travail, vos droits lgaux ou ceux de tierces parties d’interdire
le contournement des mesures technologiques.
4. Acheminement des copies conformes.
Vous
pouvez acheminer des copies conformes du code source du Programme tel
que vous l’avez reu, sur n’importe quel support, pourvu que vous
publiiez scrupuleusement et de faon approprie sur chaque copie une
notice de Droit d’Auteur approprie ; gardez intactes toutes les
notices tablissant que cette Licence et tous les termes additionnels
non permissifs ajouts en accord avec l’article 7 s’appliquent ce
code ; et donnez chacun des Destinataires une copie de cette Licence
en mme temps que le Programme.
Vous pouvez facturer un prix
quelconque, y compris gratuit, chacune des copies que vous acheminez,
et vous pouvez offrir une protection additionnelle de support ou de
garantie en change d’un paiement.
5. Acheminement des versions sources modifies.
Vous pouvez acheminer un travail bas sur le Programme, ou bien les
modifications pour le produire partir du Programme, sous la forme de
code source suivant les termes de l’article 4, pourvu que voussatisfassiez aussi chacune des conditions requises suivantes :
a) Le travail doit comporter des notices videntes tablissant que vous l’avez modifi et donnant la date correspondante.
b) Le travail doit comporter des notices videntes tablissant
qu’il est dit selon cette Licence et les conditions ajoutes d’aprs
l’article 7. Cette obligation vient modifier l’obligation de l’article
4 de garder intactes toutes les notices. .
c) Vous devez licencier le travail entier, comme un tout, suivant
cette Licence quiconque entre en possession d’une copie. Cette
Licence s’appliquera en consquence, avec les termes additionnels
applicables prvus par l’article 7, la totalit du travail et chacune
de ses parties, indpendamment de la faon dont ils sont empaquets.
Cette licence ne donne aucune permission de licencier le travail d’une
autre faon, mais elle n’invalide pas une telle permission si vous
l’avez reue sparment.
d) Si le travail a des interfaces utilisateurs interactives,
chacune doit afficher les Notices Lgales Appropries ; cependant si le
Programme a des interfaces qui n’affichent pas les Notices Lgales
Appropries, votre travail n’a pas les modifier pour qu’elles les
affichent.
Une compilation d’un Travail Couvert avec d’autres travaux spars
et indpendants, qui ne sont pas par leur nature des extensions du
Travail Couvert, et qui ne sont pas combins avec lui de faon former
un programme plus large, dans ou sur un volume de stockage ou un
support de distribution, est appel un aggrgat si la compilation
et son Droit d’Auteur rsultant ne sont pas utiliss pour limiter
l’accs ou les droits lgaux des utilisateurs de la compilation en dea
de ce que permettent les travaux individuels. L’inclusion d’un Travail
Couvert dans un aggrgat ne cause pas l’application de cette Licence
aux autres parties de l’aggrgat.
6. Acheminement des formes non sources.
Vous pouvez acheminer sous forme de code objet un Travail Couvert
suivant les termes des articles 4 et 5, pourvu que vous acheminiez
galement suivant les termes de cette Licence le Source Correspondantlisible par une machine, d’une des faons suivantes :
a) Acheminer le code objet sur, ou inclus dans, un produit physique
(y compris un support de distribution physique), accompagn par le
Source Correspondant fix sur un support physique durable
habituellement utilis pour les changes de logiciels.
b) Acheminer le code objet sur, ou inclus dans, un produit physique
(y compris un support de distribution physique), accompagn d’une offre
crite, valide pour au moins trois annes et valide pour aussi
longtemps que vous fournissez des pices de rechange ou un support
client pour ce modle de produit, afin de donner quiconque possde le
code objet soit (1) une copie du Source Correspondant tout
logiciel dans ce produit qui est couvert par cette Licence, sur un
support physique durable habituellement utilis pour les changes
de logiciels, pour un prix non suprieur au cot raisonnable de la
ralisation physique de l’acheminement de la source, ou soit (2) un
accs permettant de copier le Source Correspondant depuis un serveur rseau sans frais.
c) Acheminer des copies individuelles du code objet avec une copie
de l’offre crite de fournir le Source Correspondant.
Cette alternative est permise seulement occasionellement et
non commercialement, et seulement si vous avez reu le code objet
avec une telle offre, en accord avec l’article 6 alina b.
d) Acheminer le code objet en offrant un accs depuis un
emplacement dsign (gratuit ou contre facturation) et offrir un accs
quivalent au Source Correspondant de la mme faon via le
mme emplacement et sans facturation supplmentaire. Vous n’avez
pas besoin d’obliger les Destinataires copier le
Source Correspondant en mme temps que le code objet. Si
l’emplacement pour copier le code objet est un serveur rseau, le
Source Correspondant peut tre sur un serveur diffrent (opr par
vous ou par un tiers) qui supporte des facilits quivalentes
de copie, pourvu que vous mainteniez des directions claires
proximit du code objet indiquant o trouver le
Source Correspondant. Indpendamment de quel serveur hberge le
Source Correspondant, vous restez oblig de vous assurer qu’il
reste disponible aussi longtemps que ncessaire pour satisfaire
ces obligations.
e) Acheminer le code objet en utilisant une
transmission d’gal--gal, pourvu que vous informiez les autres
participants sur o le code objet et le Source Correspondant du
travail sont offerts sans frais au public gnral suivant
l’article 6 alina d. Une portion sparable du code objet, dont le
code source est exclu du Source Correspondant en tant que
Bibliothque Systme, n’a pas besoin d’tre inclu dans
l’acheminement du travail sous forme de code objet.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
Un Produit Utilisateur est soit (1) un Produit de
Consommation, ce qui signifie toute proprit personnelle tangible
normalement utilise des fins personnelles, familiales ou relatives
au foyer, soit (2) toute chose conue ou vendue pour l’incorporation
dans un lieu d’habitation. Pour dterminer si un produit constitue un
Produit de Consommation, les cas ambigus sont rsolus en fonction de la
couverture. Pour un produit particulier reu par un utilisateur
particulier, l’expression normalement utilise ci-avant se rfre
une utilisation typique ou l’usage commun de produits de mme
catgorie, indpendamment du statut de cet utilisateur particulier ou
de la faon spcifique dont cet utilisateur particulier utilise
effectivement ou s’attend lui-mme ou est attendu utiliser ce
produit. Un produit est un Produit de Consommation indpendamment du
fait que ce produit a ou n’a pas d’utilisations substantielles
commerciales, industrielles ou hors Consommation, moins que de telles
utilisations reprsentent le seul mode significatif d’utilisation duproduit.
Les Informations d’Installation d’un Produit Utilisateur
signifient toutes les mthodes, procdures, cls d’autorisation ou
autres informations requises pour installer et excuter des versions
modifies d’un Travail Couvert dans ce Produit Utilisateur partir
d’une version modifie de son Source Correspondant. Les informations
qui suffisent assurer la continuit de fonctionnement du code objet
modifi ne doivent en aucun cas tre empches ou interfres du seul
fait qu’unemodification a t effectue.
Si vous acheminez le code objet d’un Travail Couvert dans, ou avec,
ou spcifiquement pour l’utilisation dans, un Produit Utilisateur et
l’acheminement se produit en tant qu’lment d’une transaction dans
laquelle le droit de possession et d’utilisation du Produit Utilisateur
est transfr au Destinataire dfinitivement ou pour un terme fix
(indpendamment de la faon dont la transaction est caractrise), le
Source Correspondant achemin selon cet article-ci doit tre accompagn
des Informations d’Installation. Mais cette obligation ne s’applique
pas si ni vous ni aucune tierce partie ne dtient la possibilit
d’intaller un code objet modifi sur le ProduitUtilisateur (par exemple, le travail a t install en mmoire morte).
L’obligation de fournir les Informations d’Installation n’inclue pas
celle de continuer fournir un service de support, une garantie ou des
mises jour pour un travail qui a t modifi ou install par le
Destinataire, ou pour le Produit Utilisateur dans lequel il a t
modifi ou install. L’accs un rseau peut tre rejet quand la
modification elle-mme affecte matriellement et dfavorablement les
oprations du rseau ou viole les rgles et protocoles de communication
au travers du rseau.
Le Source Correspondant achemin et les Informations d’Installation
fournies, en accord avec cet article, doivent tre dans un format
publiquement document (et dont une implmentation est disponible
auprs du public sous forme de code source) et ne doit ncessiter
aucune cl ou mot de passe spcial pour le dpaquetage, la lecture oula copie.
7. Termes additionnels.
Les permissions additionelles dsignent les termes qui
supplmentent ceux de cette Licence en mettant des exceptions l’une
ou plusieurs de ses conditions. Les permissions additionnelles qui sont
applicables au Programme entier doivent tre traites comme si elles
taient incluent dans cette Licence, dans les limites de leur validit
suivant la loi applicable. Si des permissions additionnelles
s’appliquent seulement une partie du Programme, cette partie peut
tre utilise sparment suivant ces permissions, mais le Programme
tout entier reste gouvern par cette Licence sans regard auxpermissions additionelles.
Quand vous acheminez une copie d’un Travail Couvert, vous pouvez
votre convenance ter toute permission additionelle de cette copie, ou
de n’importe quelle partie de celui-ci. (Des permissions additionnelles
peuvent tre rdiges de faon requrir leur propre suppression dans
certains cas o vous modifiez le travail.) Vous pouvez placer les
permissions additionnelles sur le matriel achemin, ajoutes par vous
un Travail Couvert pour lequel vous avez ou pouvezdonner les permissions de Droit d’Auteur (“copyright”) appropries.
Nonobstant toute autre clause de cette Licence, pour tout
constituant que vous ajoutez un Travail Couvert, vous pouvez (si
autoris par les titulaires de Droit d’Auteur pour ce constituant)
supplmenter lestermes de cette Licence avec des termes :
a) qui rejettent la garantie ou limitent la responsabilit de faon diffrente des termes des articles 15 et 16 de cette Licence ; ou
b) qui requirent la prservation de notices lgales
raisonnables spcifies ou les attributions d’auteur dans ce
constituant ou dans les Notices Lgales Appropries affiches par
les travaux qui le contiennent ; ou
c) qui prohibent la reprsentation incorrecte de l’origine de
ce constituant, ou qui requirent que les versions modifies d’un
tel constituant soit marques par des moyens raisonnables
comme diffrentes de la version originale ; ou
d) qui limitent l’usage but publicitaire des noms des concdants de licence et des auteurs du constituant ; ou
e) qui refusent accorder des droits selon la lgislation relative
aux marques commerciales, pour l’utilisation dans des noms commerciaux, marques commerciales ou arques de services ; ou
f) qui requirent l’indemnisation des concdants de licences
et auteurs du constituant par quiconque achemine ce constituant
(ou des versions modifies de celui-ci) en assumant
contractuellement la responsabilit envers le Destinataire, pour
toute responsabilit que ces engagements contractuels
imposent directement ces octroyants de licences et auteurs.
Tous les autres termes additionnels non permissifs sont considrs
comme des restrictions avances dans le sens de l’article 10. Si le
Programme tel que vous l’avez reu, ou toute partie de celui-ci,
contient une notice tablissant qu’il est gouvern par cette Licence en
mme temps qu’un terme qui est une restriction avance, vous pouvez
ter ce terme. Si un document de licence contient une restriction
avance mais permet la reconcession de licence ou l’acheminement
suivant cette Licence, vous pouvez ajouter un Travail Couvert
constituant gouvern par les termes de ce document de licence, pourvu
que la restriction avance ne survit pas un telle cession de licenceou acheminement.
Si vous ajoutez des termes un Travail Couvert en accord avec cet
article, vous devez placer, dans les fichiers sources appropris, une
dclaration des termes additionnels qui s’appliquent ces fichiers, ou
une notice indiquant o trouver les termes applicables.
Les termes additionnels, qu’ils soient permissifs ou non permissifs,
peuvent tre tablis sous la forme d’une licence crite sparment, ou
tablis comme des exceptions ; les obligations ci-dessus s’appliquentdans chacun de ces cas.
8. Terminaison.
Vous ne pouvez ni propager ni modifier un Travail Couvert autrement
que suivant les termes de cette Licence. Toute autre tentative de le
propager ou le modifier est nulle et terminera automatiquement vos
droits selon cette Licence (y compris toute licence de brevet accorde
selon le troisime paragraphe de l’article 11).
Cependant, si vous cessez toute violation de cette Licence, alors
votre licence depuis un titulaire de Droit d’Auteur (“copyright”) est
rinstaure (a) titre provisoire moins que et jusqu’ ce que le
titulaire de Droit d’Auteur termine finalement et explicitement votre
licence, et (b) de faon permanente si le titulaire de Droit d’Auteur
ne parvient pas vous notifier de la violation par quelque moyenraisonnable dans les soixante (60) jours aprs la cessation.
De plus, votre licence depuis un titulaire particulier de Droit
d’Auteur est rinstaure de faon permanente si ce titulaire vous
notifie de la violation par quelque moyen raisonnable, c’est la
premire fois que vous avez reu une notification deviolation de cette
Licence (pour un travail quelconque) depuis ce titulaire de Droit
d’Auteur, et vous rsolvez la violation dans les trente (30) jours quisuivent votre rception de la notification.
La terminaison de vos droits suivant cette section ne terminera pas
les licences des parties qui ont reu des copies ou droits de votre
part suivant cette Licence. Si vos droits ont t termins et non
rinstaurs de faon permanente, vous n’tes plus qualifi recevoirde nouvelles licences pour les mmes constituants selon l’article 10.
9. Acceptation non requise pour obtenir des copies.
Vous n’tes pas oblig d’accepter cette licence afin de recevoir ou
excuter une copie du Programme. La propagation asservie d’un Travail
Couvert qui se produit simplement en consquence d’une transmission
d’gal--gal pour recevoir une copie ne ncessite pas l’acceptation.
Cependant, rien d’autre que cette Licence ne vous accorde la permission
de propager ou modifier un quelconque Travail Couvert. Ces actions
enfreignent le Droit d’Auteur si vous n’acceptez pas cette Licence. Par
consquent, en modifiant ou propageant un Travail Couvert,vous indiquez votre acceptation de cette Licence pour agir ainsi.
10. Cession automatique de Licence aux Destinataires et intermdiaires.
Chaque fois que vous acheminez un Travail Couvert, le Destinataire
reoit automatiquement une licence depuis les concdants originaux,
pour excuter, modifier et propager ce travail, suivant les termes de
cette Licence. Vous n’tes pas responsable du renforcement de laconformation des tierces parties avec cette Licence.
Une transaction d’entit dsigne une transaction qui transfre
le contrle d’une organisation, ou de substantiellement tous ses
actifs, ou la subdivision d’une organisation, ou la fusion de plusieurs
organisations. Si la propagation d’un Travail Couvert rsulte d’une
transaction d’entit, chaque partie cette transaction qui reoit une
copie du travail reoit aussi les licences pour le travail que le
prdcesseur intress cette partie avait ou pourrait donner selon le
paragraphe prcdent, plus un droit de possession du Source
Correspondant de ce travail depuis le prdcesseur intress si ce
prdcesseur en dispose ou peut l’obtenir par des efforts raisonnables.
Vous ne pouvez imposer aucune restriction avance dans l’exercice
des droits accords ou affirms selon cette Licence. Par exemple, vous
ne pouvez imposer aucun paiement pour la licence, aucune royaltie, ni
aucune autre charge pour l’exercice des droits accords selon cette
Licence ; et vous ne pouvez amorcer aucun litige judiciaire (y compris
une rclamation croise ou contre-rclamation dans un procs) sur
l’allgation qu’une revendication de brevet est enfreinte par la
ralisation, l’utilisation, la vente, l’offre de vente, oul’importation du Programme ou d’une quelconque portion de celui-ci.
11. Brevets.
Un contributeur est un titulaire de Droit d’Auteur (“copyright”)
qui autorise l’utilisation selon cette Licence du Programme ou du
travail sur lequel le Programme est bas. Le travail ainsi soumis licence est appel la version contributive de ce contributeur.
Les revendications de brevet essentielles sont toutes les
revendications de brevets dtenues ou contrles par le contributeur,
qu’elles soient dj acquises par lui ou acquises subsquemment, qui
pourraient tre enfreintes de quelque manire, permises par cette
Licence, sur la ralisation, l’utilisation ou la vente de la version
contributive de celui-ci. Aux fins de cette dfinition, le contrle
inclue le droit de concder des sous-licences de brevets d’une manire
consistante, ncessaire et suffisante, avec les obligations de cette Licence.
Chaque contributeur vous accorde une licence de brevet non
exclusive, mondiale et libre de toute royaltie, selon les
revendications de brevet essentielles, pour raliser, utiliser, vendre,
offrir la vente, importer et autrement excuter, modifier et propager
les contenus de saversion contributive.
Dans les trois paragraphes suivants, une licence de brevet
dsigne tous les accords ou engagements exprims, quel que soit le nom
que vous lui donnez, de ne pas mettre en vigueur un brevet (telle
qu’une permission explicite pour mettre en pratique un brevet, ou un
accord pour ne pas poursuivre un Destinataire pour cause de violation
de brevet). Accorder une telle licence de brevet une partie
signifie conclure un tel accord ou engagement ne pas faire appliquer
le brevet cette partie.
Si vous acheminez un Travail Couvert, dpendant en connaissance
d’une licence de brevet, et si le Source Correspondant du travail n’est
pas disponible quiconque copie, sans frais et suivant les termes de
cette Licence, travers un serveur rseau publiquement acessible ou
tout autre moyen immdiatement accessible, alors vous devez soit (1)
rendre la Source Correspondante ainsi disponible, soit (2) vous
engager vous priver pour vous-mme du bnfice de la licence de
brevet pour ce travail particulier, soit (3) vous engager, d’une faon
consistante avec les obligations de cette Licence, tendre la licence
de brevet aux Destinataires de ce travail. Dpendant en connaissance
signifie que vous avez effectivement connaissance que, selon la
licence de brevet, votre acheminement du Travail Couvert dans un pays,
ou l’utilisation du Travail Couvert par votre Destinataire dans un
pays, enfreindrait un ou plusieurs brevets identifiables dans ce pays
o vous avez des raisons de penser qu’ils sont valides.
Si, conformment ou en liaison avec une mme transaction ou un
mme arrangement, vous acheminez, ou propagez en procurant un
acheminement de, un Travail Couvert et accordez une licence de brevet
l’une des parties recevant le Travail Couvert pour lui permettre
d’utiliser, propager, modifier ou acheminer une copie spcifique du
Travail Couvert, alors votre accord est automatiquement tendu tous
les Destinataires du Travail Couvert et des travaux bass sur celui-ci.
Une licence de brevet est discriminatoire si, dans le champ de
sa couverture, elle n’inclut pas un ou plusieurs des droits qui sont
spcifiquement accords selon cette Licence, ou en prohibe l’exercice,
ou est conditionne par le non-exercice d’un ou plusieurs de ces
droits. Vous ne pouvez pas acheminer un Travail Couvert si vous tes
partie un arrangement selon lequel une partie tierce exerant son
activit dans la distribution de logiciels et laquelle vous effectuez
un paiement fond sur l’tendue de votre activit d’acheminement du
travail, et selon lequel la partie tierce accorde, une quelconque
partie qui recevrait depuis vous le Travail Couvert, une licence de
brevet discriminatoire (a) en relation avec les copies du Travail
Couvert achemines par vous (ou les copies ralises partir de ces
copies), ou (b) avant tout destine et en relation avec des produits
spcifiques ou compilations contenant le Travail Couvert, moins que
vous ayez conclu cet arrangement ou que la licence de brevet ait taccorde avant le 28 mars 2007.
Rien dans cette Licence ne devrait tre interprt comme devant
exclure ou limiter toute licence implicite ou d’autres moyens de
dfense une infraction qui vous seraient autrement disponible selon
la loiapplicable relative aux brevets.
12. Non abandon de la libert des autres.
Si des conditions vous sont imposes (que ce soit par dcision
judiciaire, par un accord ou autrement) qui contredisent les conditions
de cette Licence, elles ne vous excusent pas des conditions de cette
Licence. Si vous ne pouvez pas acheminer un Travail Couvert de faon
satisfaire simultnment vos obligations suivant cette Licence et
toutes autres obligations pertinentes, alors en consquence vous ne
pouvez pas du tout l’acheminer. Par exemple, si vous avez un accord sur
des termes qui vous obligent collecter pour le racheminement des
royalties depuis ceux qui vous acheminez le Programme, la seule faon
qui puisse vous permettre de satisfaire la fois ces termes et ceux
de cette Licence sera de vous abstenir entirement d’acheminer leProgramme.
13. Utilisation avec la Licence Gnrale Publique Affero GNU.
Nonobstant toute autre clause de cette Licence, vous avez la
permission de lier ou combiner tout Travail Couvert avec un travail
plac sous la version 3 de la Licence Gnrale Publique GNU Affero
(“GNU Affero General Public License”) en un seul travail combin, et
d’acheminer le travail rsultant. Les termes de cette Licence
continueront s’appliquer la partie formant un Travail Couvert, mais
les obligations spciales de la Licence Gnrale Publique GNU Affero,
article 13, concernant l’interaction travers un rseau s’appliqueront
la combinaison en tant que telle.
14. Versions rvises de cette License.
La Free Software Foundation peut publier des versions rvises et/ou
nouvelles de la Licence Publique Gnrale GNU (“GNU General Public
License”) de temps en temps. De telles version nouvelles resteront
similaires dans l’esprit avec la prsente version, mais peuvent
diffrer dans le dtail afin de traiter de nouveaux problmes ouproccupations.
Chaque version reoit un numro de version distinctif. Si le
Programme indique qu’une version spcifique de la Licence Publique
Gnrale GNU ou toute version ultrieure (“or any later version”)
s’applique celui-ci, vous avez le choix de suivre soit les termes et
conditions de cette version numrote, soit ceux de n’importe quelle
version publie ultrieurement par la Free Software Foundation. Si le
Programme n’indique pas une version spcifique de la Licence Publique
Gnrale GNU, vous pouvez choisir l’une quelconque des versions qui ont
tpublies par la Free Software Foundation.
Si le Programme spcifie qu’un intermdiaire peut dcider quelles
versions futures de la Licence Gnrale Publique GNU peut tre
utilise, la dclaration publique d’acceptation d’une version par cetintermdiaire vous autorise choisir cette version pour le Programme.
Des versions ultrieures de la licence peuvent vous donner des
permissions additionelles ou diffrentes. Cependant aucune obligation
additionelle n’est impose l’un des auteurs ou titulaires de Droitd’Auteur du fait de votre choix de suivre une version ultrieure.
15. Dclaration d’absence de garantie.
IL N’Y A AUCUNE GARANTIE POUR LE PROGRAMME, DANS LES LIMITES PERMISES
PAR LA LOI APPLICABLE. MOINS QUE CELA NE SOIT TABLI DIFFREMMENT PAR
CRIT, LES PROPRITAIRES DE DROITS ET/OU LES AUTRES PARTIES FOURNISSENT
LE PROGRAMME EN L’TAT SANS GARANTIE D’AUCUNE SORTE, QU’ELLE SOIT
EXPRIME OU IMPLICITE, CECI COMPRENANT, SANS SE LIMITER CELLES-CI,
LES GARANTIES IMPLICITES DE COMMERCIALISABILIT ET D’ADQUATION UN
OBJECTIF PARTICULIER. VOUS ASSUMEZ LE RISQUE ENTIER CONCERNANT LA
QUALIT ET LES PERFORMANCES DU PROGRAMME. DANS L’VENTUALIT O LE
PROGRAMME S’AVRERAIT DFECTUEUX, VOUS ASSUMEZ LES COTS DE TOUS LESSERVICES, RPARATIONS OU CORRECTIONS NCESSAIRES.
16. Limitation de responsabilit.
EN AUCUNE AUTRE CIRCONSTANCE QUE CELLES REQUISES PAR LA LOI
APPLICABLE OU ACCORDES PAR CRIT, UN TITULAIRE DE DROITS SUR LE
PROGRAMME, OU TOUT AUTRE PARTIE QUI MODIFIE OU ACHEMINE LE PROGRAMME
COMME PERMIS CI-DESSUS, NE PEUT TRE TENU POUR RESPONSABLE ENVERS VOUS
POUR LES DOMMAGES, INCLUANT TOUT DOMMAGE GNRAL, SPCIAL, ACCIDENTEL
OU INDUIT SURVENANT PAR SUITE DE L’UTILISATION OU DE L’INCAPACIT
D’UTILISER LE PROGRAMME (Y COMPRIS, SANS SE LIMITER CELLES-CI, LA
PERTE DE DONNES OU L’INEXACTITUDE DES DONNES RETOURNES OU LES PERTES
SUBIES PAR VOUS OU DES PARTIES TIERCES OU L’INCAPACIT DU PROGRAMME
FONCTIONNER AVEC TOUT AUTRE PROGRAMME), MME SI UN TEL TITULAIRE OU
TOUTE AUTRE PARTIEA T AVIS DE LA POSSIBILIT DE TELS DOMMAGES.
17. Interprtation des sections 15 et 16.
Si la dclaration d’absence de garantie et la limitation de
responsabilit fournies ci-dessus ne peuvent prendre effet localement
selon leurs termes, les cours de justice qui les examinent doivent
appliquer la lgislation locale qui approche au plus prs possible une
leve absolue de toute responsabilit civile lie au Programme, moins
qu’une garantie ou assumation de responsabilit accompagne une copie du
Programme en change d’un paiement.
FIN DES TERMES ET CONDITIONS.
Comment appliquer ces termes vos nouveaux programmes
Si vous dveloppez un nouveau programme et voulez qu’il soit le plus
possible utilisable par le public, la meilleure faon d’y parvenir et
d’en faire un logiciel libre que chacun peut redistribuer et changersuivant ces termes-ci.
Pour appliquer ces termes, attachez les notices suivantes au
programme. Il est plus sr de les attacher au dbut de chacun des
fichiers sources afin de transporter de faon la plus effective
possible l’exclusion de garantie ; et chaque fichier devrait comporter
au moins la ligne de rservation de droit (“copyright”) et une
indication permettant de savoiro la notice complte peut tre trouve :
<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 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/>.
Ajoutez galement les informations permettant de vous contacter par courrier lectronique ou postal.
Si le programme produit une interaction sur un terminal, faites lui
afficher une courte notice comme celle-ci lors de son dmarrage en mode
interactif :
<program> Copyright (C) <year> <name of author>
This program 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.
Les commandes hypothtiques “affiche g” and “affiche c” devrait
afficher les parties appropries de la Licence Gnrale Publique. Bien
sr, les commandes de votre programme peuvent tre diffrentes ; pourune interface graphique, vous pourriez utiliser une bote propos.
Vous devriez galement obtenir de votre employeur (si vous
travaillez en tant que programmeur) ou de votre cole un renoncement
aux droits de proprit pour ce programme, si ncessaire. Pour plus
d’informations ce sujet, et comment appliquer la GPL GNU, consultez<http://www.gnu.org/licenses/>.
La Licence Gnrale Publique GNU ne permet pas d’incorporer votre
programme dans des programmes propritaires. Si votre programme est une
bibliothque de sous-routines, vous pourriez considrer qu’il serait
plus utile de permettre de lier des applications propritaires avec la
bibliothque. Si c’est ce que vous voulez faire, utilisez la Licence
Gnrale Publique Limite GNU au lieu de cette Licence ; mais d’abord,veuillez lire <http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: doc/french/infra_recorder/quick_start.html
================================================
Dmarrage rapide
La configuration requise pour InfraRecorder est la suivante:
Windows 98 avec Internet Explorer 5.0 ou plus rcent.
32 Mo de RAM.
8.1 Mo disponible sur le disque dur.
================================================
FILE: doc/french/infra_recorder/whats_new.html
================================================
Quoi de neuf
InfraRecorder
Quoi de neuf ?
Version 0.50.0.0
Relaxed default project ISO9660 settings.
Made progress dialogs resizable for easier reading.
Added wait cursors to time consuming operations.
Fixed bug causing failed operations to sometimes be reporeted as
successful.
Fixed bug causing an error when verifying discs containing single
character file or directory names.
Updated cdrtools to version 2.01.01a61.
Added support for displaying BluRay and HD-DVD capabilities.
Displayed OK button problem should now be gone.
Greatly improved device detection speed, devices are now always probed at
startup.
Fixed a bug preventing boot images from being removed from projects.
Updated InfraRecorder projects not to store file size information that
potentially could cause write errors.
Added safety net preventing non-recoverable read errors to affect
integrity of other files during recording operation.
Updated InfraRecorder to lock files on hard drive during file system
creation in order to avoid inconsistency errors.
Added support for importing data from file lists like M3U.
Added command line options for selecting default project and media
type.
Fixed a bug causing projects opened by association not to be loaded if
welcome screen was enabled.
Added support for using Ctrl+A in the track secion to select all
tracks.
The drive letter is now displayed with the name of all CD/DVD
devices.
Renamed disc fixation to disc closing.
Fixed bugs related to drive letter detection.
Version 0.46.2.0
Fixed a bug causing the disc file system creation process to hang on some
systems (for real this time).
Fixed a bug causing a custom temporary directory not to be used.
Fixed a start-up maximization bug.
Version 0.46.1.0
Fixed a bug causing the disc file system creation process to hang on some
systems.
Version 0.46.0.0
Minor bugfixes and updates.
Added support for recording multiple copies.
Added a welcome screen to the InfraRecorder main application and removed
the express application.
Solved a bug causing the OK button not to be enabled after erasing or
formatting a disc.
Moved all source code to GPL version 3.
Removed cdrtools binaries in favor of cdrkit binaries.
Improved device detection routines, there should not be any more problems
with wrongly detected drive letters.
Included an Indonesian translation, thanks to Andhika Padmawan!
Included a Chuvash translation, thanks to Vladimir Kozhevnikov!
Fixed a bug causing the express application and shell extension not to be
translated.
Updated the portable version of InfraRecorder to store its log files in
the program directory instead of in the the application data folder.
Version 0.45.0.0
Updated cdrtools to version 2.01.01a38.
Fixed a bug making InfraRecorder crash when trying to move a folder to
itself.
Fixed a bug causing the wrong folder to be opened when double-clicking in
the project list view when a project contained folders with identical
names.
Fixed a bug causing the focus not to be returned to the OK button in the
progress dialog after performing an operation.
Fixed icon rendering error on Windows XP and newer where display depth is
lower than 32-bits.
Changed the option to verify the device configuration at start up to be
enabled by default.
Added support for associating InfraRecorder with disc images.
Updated the some of the dialog windows to be minimizable and visible on
the task bar when launced by an external application (like irExpress).
Fixed a bug causing incorrect file names to be used when verifying
recorded discs.
Added functionallity to rename and remove files from imported sessions.
Added support for selecting which multi-session track to import.
When trying to record to a non-empty rewritable disc, InfraRecorder now
asks if the disc should be erased.
When performing an operation the progress is now also displayed in the
taskbar.
Reduced memory usage when dealing with projects.
Fixed a bug making it impossible to open saved projects containing no
files.
Included a Thai translation, thanks to Prasit Kaephukhieo!
Improved compatibility with the ISO9660 standard.
Added support for creating UDF-only file systems.
Added support for Unicode files names in Joliet extension and UDF file
system.
Added support for fragmented files in ISO9660 level 3. Files larger than
4 GiB can now be recorded to an ISO9660 file system.
Removed mkisofs and isoinfo dependencies.
Fixed some bugs related to importing disc sessions.
Added properties menu item when right-clicking on the project tree root
node.
Added proper flagging of hidden files in the disc file system.
Changed the default write method for multi-session projects to TAO.
Fixed a bug causing InfraRecorder to crash when renaming project files to
include slash or backslash characters.
Added the .img extension to the list of supported disc image extensions.
A few cosmetic changes.
Included an Arabic translation, thanks to Circoficus!
Included a Greek translation, thanks to . !
Version 0.44.1.0
Introduced alternate ways of fetching recorder write speeds. This solves
the "disabled OK button problem".
Added support for reloading laptop drives (drives that can not
automatically load themselves) before starting the disc verification
process.
Corrected a version display error in the log system.
Version 0.44.0.0
Added a warning message when disabling disc fixation since some users
believes that this will create a multi-session disc.
It's now possible to perform a disc copy using the same device as source
and target.
Updated drive speed detection routines, it should now detect correct
speeds depeding on the inserted media.
Improved the media removal/insertion auto detection routines.
Added support for switching through the controls of the main view using
the tab key.
Fixed a bug causing InfraRecorder to crash on Windows 9x systems when
changing folder in the explorer view.
Added menu items for selecting all files and inverting the file selection.
Fixed a bug causing negative progress to be displayed in some cases.
Updated InfraRecorder to correctly maximize on startup, if closed
maximized.
Added a website button to the about window.
Fixed a project file rename bug.
Made the toolbar customizable in several ways.
Improved project file handling, no duplicate files or folders are allowed.
The program configuration is now stored in the application data folder.
A new portable version of InfraRecorder has been created where data is
stored in the program folder.
Greatly improved drag and drop functionality.
Included a Norwegian translation, thanks to Karol Ptasinski!
Updated the help file with index and search capabilities.
Fixed a bug causing InfraRecorder to try to verify files that where
imported from previous sessions.
Fixed a bug causing the disc to be ejected (if requested) before starting
the disc verification process.
Fixed a bug causing incompatibility with Windows 9x systems due to a
function call to SHGetFolderPathA.
Version 0.43.1.0
Updated the cdrtools to version 2.01.01a26.
Included a Finnish translation, thanks to Rami Aalto!
Removed the error message related to ckEffects.exe.
Improved the erase feature with support for more recorders.
Fixed a bug causing the size and position of the main window not to be
remembered.
Fixed a bug causing the explorer view to turn white when double-clicking
on a folder in the explorer list view (Windows XP only).
Improved the program log functionality.
Fixed a bug making it impossible to import sessions from certain disc types.
Improved the explorer view performance. Expanding anything under "My Computer"
in the tree could on some systems result in a long delay because of slow
queries to floppy drives.
Version 0.43.0.0
Fixed a bug raising an exception when re-ordering audio tracks.
Added a smoke effect when writing to a disc (requires Windows Vista
Aero to be enabled).
Fixed a few bugs causing wrong disc information to be shown in the
disc information window.
Various adaptations for Windows Vista.
Added support for dropping files into the project tree view.
Completely rewritten disc erase/format code. Improved DVDRW and
DVD-RAM support.
Included a Catalan translation, thanks to Josep Llus Amador Teruel!
Included a Galician translation, thanks to Xess Estvez!
Fixed a bug causing InfraRecorder to have invalid window coordinates
closed while minimized.
Included a Romanian translation, thanks to Nicolae Crefelean!
Removed the Visual C++ 8 DLL dependencies from the shell extension.
Included a Hungarian translation, thanks to Tibor Srkny!
Included a Hebrew translation, thanks to Shemesh!
Included a Danish translation, thanks to Patrick Fust!
Fixed a bug causing all internal SCSI commands not to be executed in
the x64 build of InfraRecorder.
Version 0.42.1.0
The MSI installer used for the x64 release now creates the
start-menu shortcuts in a subfolder.
Fixed a bug causing InfraRecorder to crash when cdrecord reported
recording on a track-number higher than the number of tracks to be
recorded.
Removed the Visual C++ 8 DLL dependencies from the irWave codec.
Fixed a bug causing stack corruption when using the irWMA codec.
Version 0.42.0.0
Available as 64-bit (x64) build.
Created a completely new Wave codec to remove the libsndfile
dependency and add support for the x64 compiler.
Modifed the translation system to allow translated controls to
automatically resize and move its neightbours when needed.
Various changes for Windows Vista compatibility.
Modified the WMA codec so it doesn't raise an error message when it
fails to load (if Windows Media Player not installed).
Included a Japanese translation, thanks to Nardog!
Fixed a bug causing DVD media to always be recorded at maximum
speed.
Included a Korean translation, thanks to Jung Jin-ho!
Included a Bulgarian translation, thanks to Iliyan Popov!
Separated data DVD from data CD projects.
Added support for omiting version numbers from ISO9660 file names.
Added support for using Rock Ridge extensions without using the Joliet
file name extension.
Fixed a bug causing the write speed not to be properly reported on some
recorders.
Added support for column sorting.
Added support for rearranging audio tracks by drag and drop.
Included a Serbian (Cyrillic and Latin) translation, thanks to ozzii!
Added support for automatically verifying a disc after it has been
recorded.
Made the labels on the progress dialog double buffered to avoid
flickering.
Fixed a bug causing the cp1250 code page not to be properly
detected on Czech systems.
Added support for creating DVD-Video projects.
Included a Slovak translation, thanks to Marek!
Fixed a bug causing problems when importing certain seasons from
multi-session discs.
Fixed a bug causing project UDF-settings not to be properly reset
when creating a new project.
Fixed a bug causing error messages not to be properly displayed when
recording custom projects on the fly.
Included a Chinese (Traditional) translation, thanks to Charlie!
Version 0.41.0.0
Fixed a bug causing the space meter to display inaccurate file
sizes on audio files in mixed-mode projects.
Due to limitations in the Microsoft Windows 9x Unicode Layer, a
non-unicode version of InfraRecorder is released separateley.
Added support for disabling the error message that occurs when a
codec fails to load.
Added support for generating DVD-Video compliant filesystems.
Added support for UDF.
Added support for creating bootable data discs.
Fixed a major bug preventing some projects from beeing properly
loaded.
Included a Bosnian translation, thanks to Asim Husanovic!
Added an option to change the detected write speed of a recorder.
Changed the recorder speed management to now allow a larger
number of write speeds below the maximum speed.
Added write method information to the advanced device details.
Fixed a bug causing a wrong character set to be detected on systems
using code page 1251.
Fixed a bug causing bogus unix file permissions to be set when
recording custom projects using the Joliet name extension.
Improved the project space meter.
Added support for recording custom projects on the fly.
Fixed a bug causing a temporary file not to be removed when
copying a disc.
Added support for disabling the unsupported character set error
message.
Fixed a bug causing the space meter tooltip to display the size
information in bytes instead of minutes when dealing with audio
projects.
Included a Slovenian translation, thanks to Frani Žižek!
Included a Ukrainian translation and manual, thanks to Serhij Dubyk!
The advanced device properties list now correctly displays
titletip when a feature description is to long to be fully
displayed.
Fixed a bug causing empty directories to be ignored when creating
and recording custom projects.
Fixed a bug causing files that has equal characters in the
file name to raise an error when creating a disc image.
Included a Portuguese (Brazilian) translation, thanks to der Silva!
Included a Chinese (Simplified) translation, thanks to DouDeHou!
Added more read options (ignore read errors, read
sub-channel data and TOC, read speed).
Added support for ISO level 4 which among many thigs
allows directory nesting to be deeper than eight levels.
Version 0.40.0.0
Included a Czech translation, thanks to khagaroth!
Improved DVD-support (official cdrtools has DVD support
since version 2.01.01a09).
Simulation mode now works when recording to DVDs.
Support for blanking DVD+RW media (currently only with
Ricoh based drives).
The size and position of the main InfraRecorder window
is now remembered and restored each startup.
Included a Basque translation, thanks to David Garca-Abad!
Added support for encoding audio tracks to Ogg, WMA and
MP3 (separate package due to patent issue).
Fixed a bug causing the wrong tracks to be displayed
when scanning a disc for errors.
Added support for decoding MP3, Ogg and WMA audio.
Included a German manual, thanks to CE4!
Included an Italian translation, thanks to Lorenzo Festa!
Fixed bug with message boxes, they should now be modal.
Added support for translated manuals.
Changed the default simulation value to off.
Added an option for changing the temporary folder.
Added help documentation on how to make the InfraRecorder
installer perform unattended
installations.
The installer now adds an entry to Add/Remove Programs.
Added support for selecting installation language on unattended
installations.
Included a Russian translation and manual, thanks to Roman Starikh!
Included a German translation, thanks to Thomas Bigler!
Included a Polish translation, thanks to DJD!
Included a Turkish translation, thanks to Fatma Akarslan!
Included a Croatian translation, thanks to Tibor Keser!
Included a Dutch translation, thanks to Patrick!
Version 0.31.0.0
Included a Portuguese translation, thanks to Cesar Baptista!
Included a Spanish translation, thanks to Eduardo Leon!
Increased the height of all comboboxes in the GUI to prevent unnecessary
scrolling.
Fixed some GUI glitches causing black and purple backgrounds on some
graphics (only affected systems older than Windows XP).
Added a tooltip to the space meter which displays the project size.
Added support for pasting files from Windows Explorer into a project.
Fixed a bug allowing multiple sessions to imported to a project.
Version 0.30.0.83
Fixed a bug (static linking to UpdateLayeredWindow in user32.dll) causing
incompatibility with Windows 9x systems.
Version 0.30.0.82 (Beta 2)
Added DVD support by patching cdrecord (WARNING: Simulation mode is known
not to work when burning DVDs).
Included a French translation, thanks to Pierre-Jean Coudert!
Changed the default write method to SAO because of DVD compatibility.
Updated the installer with extra options and multi-language support.
Added a couple of new translateable strings for the progress log output.
Made some directory layout changes to the CVS.
================================================
FILE: doc/french/style.css
================================================
/* Generated by KompoZer */
body {
margin: 0px;
font-weight: normal;
font-size: 11px;
color: #000000;
font-family: Verdana,Arial,Helvetica,sans-serif;
height: 100%;
background-color: #ffffff;
text-align: left;
}
h1 {
font-size: 115%;
margin-top: 1em;
margin-bottom: 0.6em;
}
h2 {
font-size: 100%;
margin-top: 1em;
margin-bottom: 0.6em;
}
ul {
list-style-type: disc;
margin-left: 1.9em;
margin-top: 0.6em;
margin-bottom: 0em;
}
ol {
margin-left: 2.9em;
margin-top: 0.6em;
margin-bottom: 0em;
font-weight: bold;
}
ol span {
font-weight: normal;
}
li {
margin-bottom: 0.3em;
}
p, dl {
margin-top: 0.6em;
margin-bottom: 0.6em;
}
hr {
margin-top: 0.6em;
}
dd {
padding-top: 0.2em;
margin-bottom: 0.6em;
margin-left: 0.8em;
}
#header {
border-bottom: 1px solid #9999ff;
background: #ccccff none repeat scroll 0% 50%;
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
}
#location {
border-bottom: 1px solid #9999ff;
background: #ccccff none repeat scroll 0% 50%;
padding-top: 5px;
padding-left: 10px;
padding-bottom: 5px;
}
#topic {
font-weight: bold;
}
#content {
padding: 10px;
overflow: auto;
height: 100%;
}
#footer {
background: #ccccff none repeat scroll 0% 50%;
text-align: center;
position: absolute;
bottom: 3pt;
width: 100%;
}
================================================
FILE: doc/french/stylescript.js
================================================
window.onload = OnSize;
window.onresize = OnSize;
function OnSize()
{
var vHeader = document.all.item("header");
var vContent = document.all.item("content");
if (vContent ==null)
return;
if (vHeader != null)
{
document.all.content.style.overflow = "auto";
document.all.header.style.width = document.body.offsetWidth;
document.all.content.style.width = document.body.offsetWidth - 4;
document.all.content.style.top = document.all.header.offsetHeight;
if (document.body.offsetHeight > document.all.header.offsetHeight)
{
document.all.content.style.height = document.body.offsetHeight - document.all.header.offsetHeight - 3;
}
else
{
document.all.content.style.height = 0;
}
}
}
================================================
FILE: etc/codecs/readme.txt
================================================
InfraRecorder MP3 Encoder
-------------------------
This codec is distributed separateley because of patent issues. Personal and/or
commercial use of compiled versions of this codec requires a patent license in
some countries. Please check before using this codec.
To install this codec, simply copy the appropriate lame.irc file to the
InfraRecorder codecs directory. C:\Program Files\InfraRecorder\codecs by
default. If you have InfraRecorder running you need to restart it so the codec
can be loaded. This package contains two codecs, one for the 32-bit version of
InfraRecorder, and one for the 64-bit. To find out which version you should use
check the InfraRecorder about window.
This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions; please see the file
license.txt in the sourcecode package for more information.
================================================
FILE: etc/translations/install.txt
================================================
To install the translation, place the .irl file (and the .chm file for
translations that include a translated manual) in the InfraRecorder\Languages
directory. For example: C:\Program Files\InfraRecorder\Languages.
================================================
FILE: etc/translations/readme.txt
================================================
Thank you for your help translating InfraRecorder!
The file to be translated is named English.irl. Your translation should use the
same file extension and be placed in the "InfraRecorder\Languages" folder.
When you send me your translation, please include a translation of the
following ten strings (used by the setup program):
01: "InfraRecorder Core Files (required)"
02: "Start Menu Shortcuts"
03: "Desktop Shortcut"
04: "Quick Launch Shortcut"
05: "Language Files"
06: "The core files required to use InfraRecorder."
07: "Adds icons to your start menu for easy access."
08: "Adds an icon to your desktop."
09: "Adds an icon to your quick launch bar."
10: "Language files used for supporting different languages in InfraRecorder."
You may include any copyright comments in the beginning of the translation file
if you wish. For example:
; InfraRecorder Swedish Translation
; Version 0.44
: Date: November 7th 2007
; Contact: user@domain.com
; Size: 36 KiB
Please note that the section named [translation] not should be translated but
contain information about your translation. InfraRecorder 0.40 and newer will
support translated help files. If you have translated the help file it should
be specified in your translation so that InfraRecorder can find it. To do so,
just specify the location and name of the translated help file as value number
0x0004 in the translation section. The translated help file should be placed in
the same directory as the translation. Example:
[translation]
0x0001=Christian Kindahl
0x0002=November 7th 2007
0x0003=0.44
0x0004=Languages\Swedish.chm
The help file value (0x0004) is optional. If your translation does not include
a help file this value should not exist.
Send your translation to: christian dot kindahl at gmail dot com
================================================
FILE: license.rtf
================================================
{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\lang1033\f0\fs16 GNU GENERAL PUBLIC LICENSE\par
Version 3, 29 June 2007\par
\par
Copyright (C) 2007 Free Software Foundation, Inc. \par
Everyone is permitted to copy and distribute verbatim copies\par
of this license document, but changing it is not allowed.\par
\par
Preamble\par
\par
The GNU General Public License is a free, copyleft license for\par
software and other kinds of works.\par
\par
The licenses for most software and other practical works are designed\par
to take away your freedom to share and change the works. By contrast,\par
the GNU General Public License is intended to guarantee your freedom to\par
share and change all versions of a program--to make sure it remains free\par
software for all its users. We, the Free Software Foundation, use the\par
GNU General Public License for most of our software; it applies also to\par
any other work released this way by its authors. You can apply it to\par
your programs, too.\par
\par
When we speak of free software, we are referring to freedom, not\par
price. Our General Public Licenses are designed to make sure that you\par
have the freedom to distribute copies of free software (and charge for\par
them if you wish), that you receive source code or can get it if you\par
want it, that you can change the software or use pieces of it in new\par
free programs, and that you know you can do these things.\par
\par
To protect your rights, we need to prevent others from denying you\par
these rights or asking you to surrender the rights. Therefore, you have\par
certain responsibilities if you distribute copies of the software, or if\par
you modify it: responsibilities to respect the freedom of others.\par
\par
For example, if you distribute copies of such a program, whether\par
gratis or for a fee, you must pass on to the recipients the same\par
freedoms that you received. You must make sure that they, too, receive\par
or can get the source code. And you must show them these terms so they\par
know their rights.\par
\par
Developers that use the GNU GPL protect your rights with two steps:\par
(1) assert copyright on the software, and (2) offer you this License\par
giving you legal permission to copy, distribute and/or modify it.\par
\par
For the developers' and authors' protection, the GPL clearly explains\par
that there is no warranty for this free software. For both users' and\par
authors' sake, the GPL requires that modified versions be marked as\par
changed, so that their problems will not be attributed erroneously to\par
authors of previous versions.\par
\par
Some devices are designed to deny users access to install or run\par
modified versions of the software inside them, although the manufacturer\par
can do so. This is fundamentally incompatible with the aim of\par
protecting users' freedom to change the software. The systematic\par
pattern of such abuse occurs in the area of products for individuals to\par
use, which is precisely where it is most unacceptable. Therefore, we\par
have designed this version of the GPL to prohibit the practice for those\par
products. If such problems arise substantially in other domains, we\par
stand ready to extend this provision to those domains in future versions\par
of the GPL, as needed to protect the freedom of users.\par
\par
Finally, every program is threatened constantly by software patents.\par
States should not allow patents to restrict development and use of\par
software on general-purpose computers, but in those that do, we wish to\par
avoid the special danger that patents applied to a free program could\par
make it effectively proprietary. To prevent this, the GPL assures that\par
patents cannot be used to render the program non-free.\par
\par
The precise terms and conditions for copying, distribution and\par
modification follow.\par
\par
TERMS AND CONDITIONS\par
\par
0. Definitions.\par
\par
"This License" refers to version 3 of the GNU General Public License.\par
\par
"Copyright" also means copyright-like laws that apply to other kinds of\par
works, such as semiconductor masks.\par
\par
"The Program" refers to any copyrightable work licensed under this\par
License. Each licensee is addressed as "you". "Licensees" and\par
"recipients" may be individuals or organizations.\par
\par
To "modify" a work means to copy from or adapt all or part of the work\par
in a fashion requiring copyright permission, other than the making of an\par
exact copy. The resulting work is called a "modified version" of the\par
earlier work or a work "based on" the earlier work.\par
\par
A "covered work" means either the unmodified Program or a work based\par
on the Program.\par
\par
To "propagate" a work means to do anything with it that, without\par
permission, would make you directly or secondarily liable for\par
infringement under applicable copyright law, except executing it on a\par
computer or modifying a private copy. Propagation includes copying,\par
distribution (with or without modification), making available to the\par
public, and in some countries other activities as well.\par
\par
To "convey" a work means any kind of propagation that enables other\par
parties to make or receive copies. Mere interaction with a user through\par
a computer network, with no transfer of a copy, is not conveying.\par
\par
An interactive user interface displays "Appropriate Legal Notices"\par
to the extent that it includes a convenient and prominently visible\par
feature that (1) displays an appropriate copyright notice, and (2)\par
tells the user that there is no warranty for the work (except to the\par
extent that warranties are provided), that licensees may convey the\par
work under this License, and how to view a copy of this License. If\par
the interface presents a list of user commands or options, such as a\par
menu, a prominent item in the list meets this criterion.\par
\par
1. Source Code.\par
\par
The "source code" for a work means the preferred form of the work\par
for making modifications to it. "Object code" means any non-source\par
form of a work.\par
\par
A "Standard Interface" means an interface that either is an official\par
standard defined by a recognized standards body, or, in the case of\par
interfaces specified for a particular programming language, one that\par
is widely used among developers working in that language.\par
\par
The "System Libraries" of an executable work include anything, other\par
than the work as a whole, that (a) is included in the normal form of\par
packaging a Major Component, but which is not part of that Major\par
Component, and (b) serves only to enable use of the work with that\par
Major Component, or to implement a Standard Interface for which an\par
implementation is available to the public in source code form. A\par
"Major Component", in this context, means a major essential component\par
(kernel, window system, and so on) of the specific operating system\par
(if any) on which the executable work runs, or a compiler used to\par
produce the work, or an object code interpreter used to run it.\par
\par
The "Corresponding Source" for a work in object code form means all\par
the source code needed to generate, install, and (for an executable\par
work) run the object code and to modify the work, including scripts to\par
control those activities. However, it does not include the work's\par
System Libraries, or general-purpose tools or generally available free\par
programs which are used unmodified in performing those activities but\par
which are not part of the work. For example, Corresponding Source\par
includes interface definition files associated with source files for\par
the work, and the source code for shared libraries and dynamically\par
linked subprograms that the work is specifically designed to require,\par
such as by intimate data communication or control flow between those\par
subprograms and other parts of the work.\par
\par
The Corresponding Source need not include anything that users\par
can regenerate automatically from other parts of the Corresponding\par
Source.\par
\par
The Corresponding Source for a work in source code form is that\par
same work.\par
\par
2. Basic Permissions.\par
\par
All rights granted under this License are granted for the term of\par
copyright on the Program, and are irrevocable provided the stated\par
conditions are met. This License explicitly affirms your unlimited\par
permission to run the unmodified Program. The output from running a\par
covered work is covered by this License only if the output, given its\par
content, constitutes a covered work. This License acknowledges your\par
rights of fair use or other equivalent, as provided by copyright law.\par
\par
You may make, run and propagate covered works that you do not\par
convey, without conditions so long as your license otherwise remains\par
in force. You may convey covered works to others for the sole purpose\par
of having them make modifications exclusively for you, or provide you\par
with facilities for running those works, provided that you comply with\par
the terms of this License in conveying all material for which you do\par
not control copyright. Those thus making or running the covered works\par
for you must do so exclusively on your behalf, under your direction\par
and control, on terms that prohibit them from making any copies of\par
your copyrighted material outside their relationship with you.\par
\par
Conveying under any other circumstances is permitted solely under\par
the conditions stated below. Sublicensing is not allowed; section 10\par
makes it unnecessary.\par
\par
3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par
\par
No covered work shall be deemed part of an effective technological\par
measure under any applicable law fulfilling obligations under article\par
11 of the WIPO copyright treaty adopted on 20 December 1996, or\par
similar laws prohibiting or restricting circumvention of such\par
measures.\par
\par
When you convey a covered work, you waive any legal power to forbid\par
circumvention of technological measures to the extent such circumvention\par
is effected by exercising rights under this License with respect to\par
the covered work, and you disclaim any intention to limit operation or\par
modification of the work as a means of enforcing, against the work's\par
users, your or third parties' legal rights to forbid circumvention of\par
technological measures.\par
\par
4. Conveying Verbatim Copies.\par
\par
You may convey verbatim copies of the Program's source code as you\par
receive it, in any medium, provided that you conspicuously and\par
appropriately publish on each copy an appropriate copyright notice;\par
keep intact all notices stating that this License and any\par
non-permissive terms added in accord with section 7 apply to the code;\par
keep intact all notices of the absence of any warranty; and give all\par
recipients a copy of this License along with the Program.\par
\par
You may charge any price or no price for each copy that you convey,\par
and you may offer support or warranty protection for a fee.\par
\par
5. Conveying Modified Source Versions.\par
\par
You may convey a work based on the Program, or the modifications to\par
produce it from the Program, in the form of source code under the\par
terms of section 4, provided that you also meet all of these conditions:\par
\par
a) The work must carry prominent notices stating that you modified\par
it, and giving a relevant date.\par
\par
b) The work must carry prominent notices stating that it is\par
released under this License and any conditions added under section\par
7. This requirement modifies the requirement in section 4 to\par
"keep intact all notices".\par
\par
c) You must license the entire work, as a whole, under this\par
License to anyone who comes into possession of a copy. This\par
License will therefore apply, along with any applicable section 7\par
additional terms, to the whole of the work, and all its parts,\par
regardless of how they are packaged. This License gives no\par
permission to license the work in any other way, but it does not\par
invalidate such permission if you have separately received it.\par
\par
d) If the work has interactive user interfaces, each must display\par
Appropriate Legal Notices; however, if the Program has interactive\par
interfaces that do not display Appropriate Legal Notices, your\par
work need not make them do so.\par
\par
A compilation of a covered work with other separate and independent\par
works, which are not by their nature extensions of the covered work,\par
and which are not combined with it such as to form a larger program,\par
in or on a volume of a storage or distribution medium, is called an\par
"aggregate" if the compilation and its resulting copyright are not\par
used to limit the access or legal rights of the compilation's users\par
beyond what the individual works permit. Inclusion of a covered work\par
in an aggregate does not cause this License to apply to the other\par
parts of the aggregate.\par
\par
6. Conveying Non-Source Forms.\par
\par
You may convey a covered work in object code form under the terms\par
of sections 4 and 5, provided that you also convey the\par
machine-readable Corresponding Source under the terms of this License,\par
in one of these ways:\par
\par
a) Convey the object code in, or embodied in, a physical product\par
(including a physical distribution medium), accompanied by the\par
Corresponding Source fixed on a durable physical medium\par
customarily used for software interchange.\par
\par
b) Convey the object code in, or embodied in, a physical product\par
(including a physical distribution medium), accompanied by a\par
written offer, valid for at least three years and valid for as\par
long as you offer spare parts or customer support for that product\par
model, to give anyone who possesses the object code either (1) a\par
copy of the Corresponding Source for all the software in the\par
product that is covered by this License, on a durable physical\par
medium customarily used for software interchange, for a price no\par
more than your reasonable cost of physically performing this\par
conveying of source, or (2) access to copy the\par
Corresponding Source from a network server at no charge.\par
\par
c) Convey individual copies of the object code with a copy of the\par
written offer to provide the Corresponding Source. This\par
alternative is allowed only occasionally and noncommercially, and\par
only if you received the object code with such an offer, in accord\par
with subsection 6b.\par
\par
d) Convey the object code by offering access from a designated\par
place (gratis or for a charge), and offer equivalent access to the\par
Corresponding Source in the same way through the same place at no\par
further charge. You need not require recipients to copy the\par
Corresponding Source along with the object code. If the place to\par
copy the object code is a network server, the Corresponding Source\par
may be on a different server (operated by you or a third party)\par
that supports equivalent copying facilities, provided you maintain\par
clear directions next to the object code saying where to find the\par
Corresponding Source. Regardless of what server hosts the\par
Corresponding Source, you remain obligated to ensure that it is\par
available for as long as needed to satisfy these requirements.\par
\par
e) Convey the object code using peer-to-peer transmission, provided\par
you inform other peers where the object code and Corresponding\par
Source of the work are being offered to the general public at no\par
charge under subsection 6d.\par
\par
A separable portion of the object code, whose source code is excluded\par
from the Corresponding Source as a System Library, need not be\par
included in conveying the object code work.\par
\par
A "User Product" is either (1) a "consumer product", which means any\par
tangible personal property which is normally used for personal, family,\par
or household purposes, or (2) anything designed or sold for incorporation\par
into a dwelling. In determining whether a product is a consumer product,\par
doubtful cases shall be resolved in favor of coverage. For a particular\par
product received by a particular user, "normally used" refers to a\par
typical or common use of that class of product, regardless of the status\par
of the particular user or of the way in which the particular user\par
actually uses, or expects or is expected to use, the product. A product\par
is a consumer product regardless of whether the product has substantial\par
commercial, industrial or non-consumer uses, unless such uses represent\par
the only significant mode of use of the product.\par
\par
"Installation Information" for a User Product means any methods,\par
procedures, authorization keys, or other information required to install\par
and execute modified versions of a covered work in that User Product from\par
a modified version of its Corresponding Source. The information must\par
suffice to ensure that the continued functioning of the modified object\par
code is in no case prevented or interfered with solely because\par
modification has been made.\par
\par
If you convey an object code work under this section in, or with, or\par
specifically for use in, a User Product, and the conveying occurs as\par
part of a transaction in which the right of possession and use of the\par
User Product is transferred to the recipient in perpetuity or for a\par
fixed term (regardless of how the transaction is characterized), the\par
Corresponding Source conveyed under this section must be accompanied\par
by the Installation Information. But this requirement does not apply\par
if neither you nor any third party retains the ability to install\par
modified object code on the User Product (for example, the work has\par
been installed in ROM).\par
\par
The requirement to provide Installation Information does not include a\par
requirement to continue to provide support service, warranty, or updates\par
for a work that has been modified or installed by the recipient, or for\par
the User Product in which it has been modified or installed. Access to a\par
network may be denied when the modification itself materially and\par
adversely affects the operation of the network or violates the rules and\par
protocols for communication across the network.\par
\par
Corresponding Source conveyed, and Installation Information provided,\par
in accord with this section must be in a format that is publicly\par
documented (and with an implementation available to the public in\par
source code form), and must require no special password or key for\par
unpacking, reading or copying.\par
\par
7. Additional Terms.\par
\par
"Additional permissions" are terms that supplement the terms of this\par
License by making exceptions from one or more of its conditions.\par
Additional permissions that are applicable to the entire Program shall\par
be treated as though they were included in this License, to the extent\par
that they are valid under applicable law. If additional permissions\par
apply only to part of the Program, that part may be used separately\par
under those permissions, but the entire Program remains governed by\par
this License without regard to the additional permissions.\par
\par
When you convey a copy of a covered work, you may at your option\par
remove any additional permissions from that copy, or from any part of\par
it. (Additional permissions may be written to require their own\par
removal in certain cases when you modify the work.) You may place\par
additional permissions on material, added by you to a covered work,\par
for which you have or can give appropriate copyright permission.\par
\par
Notwithstanding any other provision of this License, for material you\par
add to a covered work, you may (if authorized by the copyright holders of\par
that material) supplement the terms of this License with terms:\par
\par
a) Disclaiming warranty or limiting liability differently from the\par
terms of sections 15 and 16 of this License; or\par
\par
b) Requiring preservation of specified reasonable legal notices or\par
author attributions in that material or in the Appropriate Legal\par
Notices displayed by works containing it; or\par
\par
c) Prohibiting misrepresentation of the origin of that material, or\par
requiring that modified versions of such material be marked in\par
reasonable ways as different from the original version; or\par
\par
d) Limiting the use for publicity purposes of names of licensors or\par
authors of the material; or\par
\par
e) Declining to grant rights under trademark law for use of some\par
trade names, trademarks, or service marks; or\par
\par
f) Requiring indemnification of licensors and authors of that\par
material by anyone who conveys the material (or modified versions of\par
it) with contractual assumptions of liability to the recipient, for\par
any liability that these contractual assumptions directly impose on\par
those licensors and authors.\par
\par
All other non-permissive additional terms are considered "further\par
restrictions" within the meaning of section 10. If the Program as you\par
received it, or any part of it, contains a notice stating that it is\par
governed by this License along with a term that is a further\par
restriction, you may remove that term. If a license document contains\par
a further restriction but permits relicensing or conveying under this\par
License, you may add to a covered work material governed by the terms\par
of that license document, provided that the further restriction does\par
not survive such relicensing or conveying.\par
\par
If you add terms to a covered work in accord with this section, you\par
must place, in the relevant source files, a statement of the\par
additional terms that apply to those files, or a notice indicating\par
where to find the applicable terms.\par
\par
Additional terms, permissive or non-permissive, may be stated in the\par
form of a separately written license, or stated as exceptions;\par
the above requirements apply either way.\par
\par
8. Termination.\par
\par
You may not propagate or modify a covered work except as expressly\par
provided under this License. Any attempt otherwise to propagate or\par
modify it is void, and will automatically terminate your rights under\par
this License (including any patent licenses granted under the third\par
paragraph of section 11).\par
\par
However, if you cease all violation of this License, then your\par
license from a particular copyright holder is reinstated (a)\par
provisionally, unless and until the copyright holder explicitly and\par
finally terminates your license, and (b) permanently, if the copyright\par
holder fails to notify you of the violation by some reasonable means\par
prior to 60 days after the cessation.\par
\par
Moreover, your license from a particular copyright holder is\par
reinstated permanently if the copyright holder notifies you of the\par
violation by some reasonable means, this is the first time you have\par
received notice of violation of this License (for any work) from that\par
copyright holder, and you cure the violation prior to 30 days after\par
your receipt of the notice.\par
\par
Termination of your rights under this section does not terminate the\par
licenses of parties who have received copies or rights from you under\par
this License. If your rights have been terminated and not permanently\par
reinstated, you do not qualify to receive new licenses for the same\par
material under section 10.\par
\par
9. Acceptance Not Required for Having Copies.\par
\par
You are not required to accept this License in order to receive or\par
run a copy of the Program. Ancillary propagation of a covered work\par
occurring solely as a consequence of using peer-to-peer transmission\par
to receive a copy likewise does not require acceptance. However,\par
nothing other than this License grants you permission to propagate or\par
modify any covered work. These actions infringe copyright if you do\par
not accept this License. Therefore, by modifying or propagating a\par
covered work, you indicate your acceptance of this License to do so.\par
\par
10. Automatic Licensing of Downstream Recipients.\par
\par
Each time you convey a covered work, the recipient automatically\par
receives a license from the original licensors, to run, modify and\par
propagate that work, subject to this License. You are not responsible\par
for enforcing compliance by third parties with this License.\par
\par
An "entity transaction" is a transaction transferring control of an\par
organization, or substantially all assets of one, or subdividing an\par
organization, or merging organizations. If propagation of a covered\par
work results from an entity transaction, each party to that\par
transaction who receives a copy of the work also receives whatever\par
licenses to the work the party's predecessor in interest had or could\par
give under the previous paragraph, plus a right to possession of the\par
Corresponding Source of the work from the predecessor in interest, if\par
the predecessor has it or can get it with reasonable efforts.\par
\par
You may not impose any further restrictions on the exercise of the\par
rights granted or affirmed under this License. For example, you may\par
not impose a license fee, royalty, or other charge for exercise of\par
rights granted under this License, and you may not initiate litigation\par
(including a cross-claim or counterclaim in a lawsuit) alleging that\par
any patent claim is infringed by making, using, selling, offering for\par
sale, or importing the Program or any portion of it.\par
\par
11. Patents.\par
\par
A "contributor" is a copyright holder who authorizes use under this\par
License of the Program or a work on which the Program is based. The\par
work thus licensed is called the contributor's "contributor version".\par
\par
A contributor's "essential patent claims" are all patent claims\par
owned or controlled by the contributor, whether already acquired or\par
hereafter acquired, that would be infringed by some manner, permitted\par
by this License, of making, using, or selling its contributor version,\par
but do not include claims that would be infringed only as a\par
consequence of further modification of the contributor version. For\par
purposes of this definition, "control" includes the right to grant\par
patent sublicenses in a manner consistent with the requirements of\par
this License.\par
\par
Each contributor grants you a non-exclusive, worldwide, royalty-free\par
patent license under the contributor's essential patent claims, to\par
make, use, sell, offer for sale, import and otherwise run, modify and\par
propagate the contents of its contributor version.\par
\par
In the following three paragraphs, a "patent license" is any express\par
agreement or commitment, however denominated, not to enforce a patent\par
(such as an express permission to practice a patent or covenant not to\par
sue for patent infringement). To "grant" such a patent license to a\par
party means to make such an agreement or commitment not to enforce a\par
patent against the party.\par
\par
If you convey a covered work, knowingly relying on a patent license,\par
and the Corresponding Source of the work is not available for anyone\par
to copy, free of charge and under the terms of this License, through a\par
publicly available network server or other readily accessible means,\par
then you must either (1) cause the Corresponding Source to be so\par
available, or (2) arrange to deprive yourself of the benefit of the\par
patent license for this particular work, or (3) arrange, in a manner\par
consistent with the requirements of this License, to extend the patent\par
license to downstream recipients. "Knowingly relying" means you have\par
actual knowledge that, but for the patent license, your conveying the\par
covered work in a country, or your recipient's use of the covered work\par
in a country, would infringe one or more identifiable patents in that\par
country that you have reason to believe are valid.\par
\par
If, pursuant to or in connection with a single transaction or\par
arrangement, you convey, or propagate by procuring conveyance of, a\par
covered work, and grant a patent license to some of the parties\par
receiving the covered work authorizing them to use, propagate, modify\par
or convey a specific copy of the covered work, then the patent license\par
you grant is automatically extended to all recipients of the covered\par
work and works based on it.\par
\par
A patent license is "discriminatory" if it does not include within\par
the scope of its coverage, prohibits the exercise of, or is\par
conditioned on the non-exercise of one or more of the rights that are\par
specifically granted under this License. You may not convey a covered\par
work if you are a party to an arrangement with a third party that is\par
in the business of distributing software, under which you make payment\par
to the third party based on the extent of your activity of conveying\par
the work, and under which the third party grants, to any of the\par
parties who would receive the covered work from you, a discriminatory\par
patent license (a) in connection with copies of the covered work\par
conveyed by you (or copies made from those copies), or (b) primarily\par
for and in connection with specific products or compilations that\par
contain the covered work, unless you entered into that arrangement,\par
or that patent license was granted, prior to 28 March 2007.\par
\par
Nothing in this License shall be construed as excluding or limiting\par
any implied license or other defenses to infringement that may\par
otherwise be available to you under applicable patent law.\par
\par
12. No Surrender of Others' Freedom.\par
\par
If conditions are imposed on you (whether by court order, agreement or\par
otherwise) that contradict the conditions of this License, they do not\par
excuse you from the conditions of this License. If you cannot convey a\par
covered work so as to satisfy simultaneously your obligations under this\par
License and any other pertinent obligations, then as a consequence you may\par
not convey it at all. For example, if you agree to terms that obligate you\par
to collect a royalty for further conveying from those to whom you convey\par
the Program, the only way you could satisfy both those terms and this\par
License would be to refrain entirely from conveying the Program.\par
\par
13. Use with the GNU Affero General Public License.\par
\par
Notwithstanding any other provision of this License, you have\par
permission to link or combine any covered work with a work licensed\par
under version 3 of the GNU Affero General Public License into a single\par
combined work, and to convey the resulting work. The terms of this\par
License will continue to apply to the part which is the covered work,\par
but the special requirements of the GNU Affero General Public License,\par
section 13, concerning interaction through a network will apply to the\par
combination as such.\par
\par
14. Revised Versions of this License.\par
\par
The Free Software Foundation may publish revised and/or new versions of\par
the GNU General Public License from time to time. Such new versions will\par
be similar in spirit to the present version, but may differ in detail to\par
address new problems or concerns.\par
\par
Each version is given a distinguishing version number. If the\par
Program specifies that a certain numbered version of the GNU General\par
Public License "or any later version" applies to it, you have the\par
option of following the terms and conditions either of that numbered\par
version or of any later version published by the Free Software\par
Foundation. If the Program does not specify a version number of the\par
GNU General Public License, you may choose any version ever published\par
by the Free Software Foundation.\par
\par
If the Program specifies that a proxy can decide which future\par
versions of the GNU General Public License can be used, that proxy's\par
public statement of acceptance of a version permanently authorizes you\par
to choose that version for the Program.\par
\par
Later license versions may give you additional or different\par
permissions. However, no additional obligations are imposed on any\par
author or copyright holder as a result of your choosing to follow a\par
later version.\par
\par
15. Disclaimer of Warranty.\par
\par
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\par
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\par
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY\par
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\par
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\par
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\par
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\par
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par
\par
16. Limitation of Liability.\par
\par
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\par
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\par
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\par
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\par
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\par
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\par
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\par
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\par
SUCH DAMAGES.\par
\par
17. Interpretation of Sections 15 and 16.\par
\par
If the disclaimer of warranty and limitation of liability provided\par
above cannot be given local legal effect according to their terms,\par
reviewing courts shall apply local law that most closely approximates\par
an absolute waiver of all civil liability in connection with the\par
Program, unless a warranty or assumption of liability accompanies a\par
copy of the Program in return for a fee.\par
\par
END OF TERMS AND CONDITIONS\par
\par
How to Apply These Terms to Your New Programs\par
\par
If you develop a new program, and you want it to be of the greatest\par
possible use to the public, the best way to achieve this is to make it\par
free software which everyone can redistribute and change under these terms.\par
\par
To do so, attach the following notices to the program. It is safest\par
to attach them to the start of each source file to most effectively\par
state the exclusion of warranty; and each file should have at least\par
the "copyright" line and a pointer to where the full notice is found.\par
\par
\par
Copyright (C) \par
\par
This program is free software: you can redistribute it and/or modify\par
it under the terms of the GNU General Public License as published by\par
the Free Software Foundation, either version 3 of the License, or\par
(at your option) any later version.\par
\par
This program is distributed in the hope that it will be useful,\par
but WITHOUT ANY WARRANTY; without even the implied warranty of\par
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\par
GNU General Public License for more details.\par
\par
You should have received a copy of the GNU General Public License\par
along with this program. If not, see .\par
\par
Also add information on how to contact you by electronic and paper mail.\par
\par
If the program does terminal interaction, make it output a short\par
notice like this when it starts in an interactive mode:\par
\par
Copyright (C) \par
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\par
This is free software, and you are welcome to redistribute it\par
under certain conditions; type `show c' for details.\par
\par
The hypothetical commands `show w' and `show c' should show the appropriate\par
parts of the General Public License. Of course, your program's commands\par
might be different; for a GUI interface, you would use an "about box".\par
\par
You should also get your employer (if you work as a programmer) or school,\par
if any, to sign a "copyright disclaimer" for the program, if necessary.\par
For more information on this, and how to apply and follow the GNU GPL, see\par
.\par
\par
The GNU General Public License does not permit incorporating your program\par
into proprietary programs. If your program is a subroutine library, you\par
may consider it more useful to permit linking proprietary applications with\par
the library. If this is what you want to do, use the GNU Lesser General\par
Public License instead of this License. But first, please read\par
.\par
\par
}
================================================
FILE: license.txt
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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 .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU 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 Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: makelinks.bat
================================================
@echo off
set path_w32d=%~dp0bin\win32\debug\
set path_w32r=%~dp0bin\win32\release\
set path_w32p=%~dp0bin\win32\releasep\
set path_x64d=%~dp0bin\x64\debug\
set path_x64r=%~dp0bin\x64\release\
set path_x64p=%~dp0bin\x64\releasep\
set path_trans_l=%~dp0etc\translations\software\
set path_trans_h=%~dp0etc\translations\help\
set path_cdrtools=%~dp0dep\cdrtools\
set path_sndfile=%~dp0dep\libsndfile\
set path_smoke=%~dp0dep\
set path_help=%~dp0doc\english\
rem make sure directories exists.
if not exist %path_w32d%codecs\ mkdir %path_w32d%codecs\
if not exist %path_w32r%codecs\ mkdir %path_w32r%codecs\
if not exist %path_w32p%codecs\ mkdir %path_w32p%codecs\
if not exist %path_x64d%codecs\ mkdir %path_x64d%codecs\
if not exist %path_x64r%codecs\ mkdir %path_x64r%codecs\
if not exist %path_x64p%codecs\ mkdir %path_x64p%codecs\
if not exist %path_w32d%languages\ mkdir %path_w32d%languages\
if not exist %path_w32r%languages\ mkdir %path_w32r%languages\
if not exist %path_w32p%languages\ mkdir %path_w32p%languages\
if not exist %path_x64d%languages\ mkdir %path_x64d%languages\
if not exist %path_x64r%languages\ mkdir %path_x64r%languages\
if not exist %path_x64p%languages\ mkdir %path_x64p%languages\
rem make symbolic links to cdrtools binaries.
if not exist %path_w32d%cdrtools mklink /D %path_w32d%cdrtools %path_cdrtools%
if not exist %path_w32r%cdrtools mklink /D %path_w32r%cdrtools %path_cdrtools%
if not exist %path_w32p%cdrtools mklink /D %path_w32p%cdrtools %path_cdrtools%
if not exist %path_x64d%cdrtools mklink /D %path_x64d%cdrtools %path_cdrtools%
if not exist %path_x64r%cdrtools mklink /D %path_x64r%cdrtools %path_cdrtools%
if not exist %path_x64p%cdrtools mklink /D %path_x64p%cdrtools %path_cdrtools%
rem make symbolic links to libsndfile libraries.
if not exist %path_w32d%codecs\libsndfile-1.dll mklink %path_w32d%codecs\libsndfile-1.dll %path_sndfile%win32\libsndfile-1.dll
if not exist %path_w32r%codecs\libsndfile-1.dll mklink %path_w32r%codecs\libsndfile-1.dll %path_sndfile%win32\libsndfile-1.dll
if not exist %path_w32p%codecs\libsndfile-1.dll mklink %path_w32p%codecs\libsndfile-1.dll %path_sndfile%win32\libsndfile-1.dll
if not exist %path_x64d%codecs\libsndfile-1.dll mklink %path_x64d%codecs\libsndfile-1.dll %path_sndfile%x64\libsndfile-1.dll
if not exist %path_x64r%codecs\libsndfile-1.dll mklink %path_x64r%codecs\libsndfile-1.dll %path_sndfile%x64\libsndfile-1.dll
if not exist %path_x64p%codecs\libsndfile-1.dll mklink %path_x64p%codecs\libsndfile-1.dll %path_sndfile%x64\libsndfile-1.dll
rem make symbolic links to smoke program.
if not exist %path_w32d%smoke.exe mklink %path_w32d%smoke.exe %path_smoke%smoke.exe
if not exist %path_w32r%smoke.exe mklink %path_w32r%smoke.exe %path_smoke%smoke.exe
if not exist %path_w32p%smoke.exe mklink %path_w32p%smoke.exe %path_smoke%smoke.exe
if not exist %path_x64d%smoke.exe mklink %path_x64d%smoke.exe %path_smoke%smoke.exe
if not exist %path_x64r%smoke.exe mklink %path_x64r%smoke.exe %path_smoke%smoke.exe
if not exist %path_x64p%smoke.exe mklink %path_x64p%smoke.exe %path_smoke%smoke.exe
rem make symbolic links to help file.
if not exist %path_w32d%infrarecorder.chm mklink %path_w32d%infrarecorder.chm %path_help%infrarecorder.chm
if not exist %path_w32r%infrarecorder.chm mklink %path_w32r%infrarecorder.chm %path_help%infrarecorder.chm
if not exist %path_w32p%infrarecorder.chm mklink %path_w32p%infrarecorder.chm %path_help%infrarecorder.chm
if not exist %path_x64d%infrarecorder.chm mklink %path_x64d%infrarecorder.chm %path_help%infrarecorder.chm
if not exist %path_x64r%infrarecorder.chm mklink %path_x64r%infrarecorder.chm %path_help%infrarecorder.chm
if not exist %path_x64p%infrarecorder.chm mklink %path_x64p%infrarecorder.chm %path_help%infrarecorder.chm
rem make symbolic links to translations.
if not exist %path_w32d%languages\albanian.irl mklink %path_w32d%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_w32d%languages\arabic.irl mklink %path_w32d%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_w32d%languages\armenian.irl mklink %path_w32d%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_w32d%languages\basque.irl mklink %path_w32d%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_w32d%languages\bosnian.irl mklink %path_w32d%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_w32d%languages\bulgarian.irl mklink %path_w32d%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_w32d%languages\catalan.irl mklink %path_w32d%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_w32d%languages\chinese-simplified.irl mklink %path_w32d%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_w32d%languages\chinese-traditional.irl mklink %path_w32d%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_w32d%languages\chuvash.irl mklink %path_w32d%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_w32d%languages\croatian.irl mklink %path_w32d%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_w32d%languages\czech.irl mklink %path_w32d%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_w32d%languages\danish.irl mklink %path_w32d%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_w32d%languages\dutch.irl mklink %path_w32d%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_w32d%languages\estonian.irl mklink %path_w32d%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_w32d%languages\farsi.irl mklink %path_w32d%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_w32d%languages\finnish.irl mklink %path_w32d%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_w32d%languages\french.irl mklink %path_w32d%languages\french.irl %path_trans_l%french.irl
if not exist %path_w32d%languages\galician.irl mklink %path_w32d%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_w32d%languages\german.irl mklink %path_w32d%languages\german.irl %path_trans_l%german.irl
if not exist %path_w32d%languages\georgian.irl mklink %path_w32d%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_w32d%languages\greek.irl mklink %path_w32d%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_w32d%languages\hebrew.irl mklink %path_w32d%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_w32d%languages\hungarian.irl mklink %path_w32d%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_w32d%languages\indonesian.irl mklink %path_w32d%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_w32d%languages\italian.irl mklink %path_w32d%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_w32d%languages\japanese.irl mklink %path_w32d%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_w32d%languages\korean.irl mklink %path_w32d%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_w32d%languages\latvian.irl mklink %path_w32d%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_w32d%languages\lithuanian.irl mklink %path_w32d%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_w32d%languages\macedonian.irl mklink %path_w32d%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_w32d%languages\norwegian.irl mklink %path_w32d%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_w32d%languages\polish.irl mklink %path_w32d%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_w32d%languages\portuguese.irl mklink %path_w32d%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_w32d%languages\portuguese-brazilian.irl mklink %path_w32d%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_w32d%languages\romanian.irl mklink %path_w32d%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_w32d%languages\russian.irl mklink %path_w32d%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_w32d%languages\serbian-cyrillic.irl mklink %path_w32d%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_w32d%languages\serbian-latin.irl mklink %path_w32d%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_w32d%languages\slovak.irl mklink %path_w32d%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_w32d%languages\slovenian.irl mklink %path_w32d%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_w32d%languages\spanish.irl mklink %path_w32d%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_w32d%languages\swedish.irl mklink %path_w32d%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_w32d%languages\thai.irl mklink %path_w32d%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_w32d%languages\turkish.irl mklink %path_w32d%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_w32d%languages\ukrainian.irl mklink %path_w32d%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_w32d%languages\valencian.irl mklink %path_w32d%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_w32d%languages\vietnamese.irl mklink %path_w32d%languages\vietnamese.irl %path_trans_l%vietnamese.irl
if not exist %path_w32r%languages\albanian.irl mklink %path_w32r%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_w32r%languages\arabic.irl mklink %path_w32r%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_w32r%languages\armenian.irl mklink %path_w32r%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_w32r%languages\basque.irl mklink %path_w32r%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_w32r%languages\bosnian.irl mklink %path_w32r%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_w32r%languages\bulgarian.irl mklink %path_w32r%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_w32r%languages\catalan.irl mklink %path_w32r%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_w32r%languages\chinese-simplified.irl mklink %path_w32r%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_w32r%languages\chinese-traditional.irl mklink %path_w32r%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_w32r%languages\chuvash.irl mklink %path_w32r%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_w32r%languages\croatian.irl mklink %path_w32r%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_w32r%languages\czech.irl mklink %path_w32r%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_w32r%languages\danish.irl mklink %path_w32r%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_w32r%languages\dutch.irl mklink %path_w32r%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_w32r%languages\estonian.irl mklink %path_w32r%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_w32r%languages\farsi.irl mklink %path_w32r%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_w32r%languages\finnish.irl mklink %path_w32r%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_w32r%languages\french.irl mklink %path_w32r%languages\french.irl %path_trans_l%french.irl
if not exist %path_w32r%languages\galician.irl mklink %path_w32r%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_w32r%languages\german.irl mklink %path_w32r%languages\german.irl %path_trans_l%german.irl
if not exist %path_w32r%languages\georgian.irl mklink %path_w32r%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_w32r%languages\greek.irl mklink %path_w32r%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_w32r%languages\hebrew.irl mklink %path_w32r%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_w32r%languages\hungarian.irl mklink %path_w32r%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_w32r%languages\indonesian.irl mklink %path_w32r%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_w32r%languages\italian.irl mklink %path_w32r%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_w32r%languages\japanese.irl mklink %path_w32r%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_w32r%languages\korean.irl mklink %path_w32r%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_w32r%languages\latvian.irl mklink %path_w32r%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_w32r%languages\lithuanian.irl mklink %path_w32r%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_w32r%languages\macedonian.irl mklink %path_w32r%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_w32r%languages\norwegian.irl mklink %path_w32r%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_w32r%languages\polish.irl mklink %path_w32r%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_w32r%languages\portuguese.irl mklink %path_w32r%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_w32r%languages\portuguese-brazilian.irl mklink %path_w32r%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_w32r%languages\romanian.irl mklink %path_w32r%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_w32r%languages\russian.irl mklink %path_w32r%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_w32r%languages\serbian-cyrillic.irl mklink %path_w32r%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_w32r%languages\serbian-latin.irl mklink %path_w32r%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_w32r%languages\slovak.irl mklink %path_w32r%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_w32r%languages\slovenian.irl mklink %path_w32r%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_w32r%languages\spanish.irl mklink %path_w32r%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_w32r%languages\swedish.irl mklink %path_w32r%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_w32r%languages\thai.irl mklink %path_w32r%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_w32r%languages\turkish.irl mklink %path_w32r%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_w32r%languages\ukrainian.irl mklink %path_w32r%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_w32r%languages\valencian.irl mklink %path_w32r%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_w32r%languages\vietnamese.irl mklink %path_w32r%languages\vietnamese.irl %path_trans_l%vietnamese.irl
if not exist %path_w32p%languages\albanian.irl mklink %path_w32p%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_w32p%languages\arabic.irl mklink %path_w32p%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_w32p%languages\armenian.irl mklink %path_w32p%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_w32p%languages\basque.irl mklink %path_w32p%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_w32p%languages\bosnian.irl mklink %path_w32p%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_w32p%languages\bulgarian.irl mklink %path_w32p%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_w32p%languages\catalan.irl mklink %path_w32p%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_w32p%languages\chinese-simplified.irl mklink %path_w32p%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_w32p%languages\chinese-traditional.irl mklink %path_w32p%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_w32p%languages\chuvash.irl mklink %path_w32p%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_w32p%languages\croatian.irl mklink %path_w32p%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_w32p%languages\czech.irl mklink %path_w32p%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_w32p%languages\danish.irl mklink %path_w32p%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_w32p%languages\dutch.irl mklink %path_w32p%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_w32p%languages\estonian.irl mklink %path_w32p%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_w32p%languages\farsi.irl mklink %path_w32p%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_w32p%languages\finnish.irl mklink %path_w32p%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_w32p%languages\french.irl mklink %path_w32p%languages\french.irl %path_trans_l%french.irl
if not exist %path_w32p%languages\galician.irl mklink %path_w32p%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_w32p%languages\german.irl mklink %path_w32p%languages\german.irl %path_trans_l%german.irl
if not exist %path_w32p%languages\georgian.irl mklink %path_w32p%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_w32p%languages\greek.irl mklink %path_w32p%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_w32p%languages\hebrew.irl mklink %path_w32p%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_w32p%languages\hungarian.irl mklink %path_w32p%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_w32p%languages\indonesian.irl mklink %path_w32p%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_w32p%languages\italian.irl mklink %path_w32p%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_w32p%languages\japanese.irl mklink %path_w32p%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_w32p%languages\korean.irl mklink %path_w32p%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_w32p%languages\latvian.irl mklink %path_w32p%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_w32p%languages\lithuanian.irl mklink %path_w32p%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_w32p%languages\macedonian.irl mklink %path_w32p%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_w32p%languages\norwegian.irl mklink %path_w32p%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_w32p%languages\polish.irl mklink %path_w32p%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_w32p%languages\portuguese.irl mklink %path_w32p%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_w32p%languages\portuguese-brazilian.irl mklink %path_w32p%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_w32p%languages\romanian.irl mklink %path_w32p%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_w32p%languages\russian.irl mklink %path_w32p%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_w32p%languages\serbian-cyrillic.irl mklink %path_w32p%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_w32p%languages\serbian-latin.irl mklink %path_w32p%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_w32p%languages\slovak.irl mklink %path_w32p%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_w32p%languages\slovenian.irl mklink %path_w32p%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_w32p%languages\spanish.irl mklink %path_w32p%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_w32p%languages\swedish.irl mklink %path_w32p%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_w32p%languages\thai.irl mklink %path_w32p%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_w32p%languages\turkish.irl mklink %path_w32p%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_w32p%languages\ukrainian.irl mklink %path_w32p%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_w32p%languages\valencian.irl mklink %path_w32p%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_w32p%languages\vietnamese.irl mklink %path_w32p%languages\vietnamese.irl %path_trans_l%vietnamese.irl
if not exist %path_x64d%languages\albanian.irl mklink %path_x64d%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_x64d%languages\arabic.irl mklink %path_x64d%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_x64d%languages\armenian.irl mklink %path_x64d%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_x64d%languages\basque.irl mklink %path_x64d%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_x64d%languages\bosnian.irl mklink %path_x64d%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_x64d%languages\bulgarian.irl mklink %path_x64d%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_x64d%languages\catalan.irl mklink %path_x64d%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_x64d%languages\chinese-simplified.irl mklink %path_x64d%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_x64d%languages\chinese-traditional.irl mklink %path_x64d%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_x64d%languages\chuvash.irl mklink %path_x64d%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_x64d%languages\croatian.irl mklink %path_x64d%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_x64d%languages\czech.irl mklink %path_x64d%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_x64d%languages\danish.irl mklink %path_x64d%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_x64d%languages\dutch.irl mklink %path_x64d%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_x64d%languages\estonian.irl mklink %path_x64d%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_x64d%languages\farsi.irl mklink %path_x64d%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_x64d%languages\finnish.irl mklink %path_x64d%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_x64d%languages\french.irl mklink %path_x64d%languages\french.irl %path_trans_l%french.irl
if not exist %path_x64d%languages\galician.irl mklink %path_x64d%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_x64d%languages\german.irl mklink %path_x64d%languages\german.irl %path_trans_l%german.irl
if not exist %path_x64d%languages\georgian.irl mklink %path_x64d%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_x64d%languages\greek.irl mklink %path_x64d%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_x64d%languages\hebrew.irl mklink %path_x64d%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_x64d%languages\hungarian.irl mklink %path_x64d%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_x64d%languages\indonesian.irl mklink %path_x64d%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_x64d%languages\italian.irl mklink %path_x64d%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_x64d%languages\japanese.irl mklink %path_x64d%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_x64d%languages\korean.irl mklink %path_x64d%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_x64d%languages\latvian.irl mklink %path_x64d%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_x64d%languages\lithuanian.irl mklink %path_x64d%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_x64d%languages\macedonian.irl mklink %path_x64d%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_x64d%languages\norwegian.irl mklink %path_x64d%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_x64d%languages\polish.irl mklink %path_x64d%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_x64d%languages\portuguese.irl mklink %path_x64d%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_x64d%languages\portuguese-brazilian.irl mklink %path_x64d%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_x64d%languages\romanian.irl mklink %path_x64d%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_x64d%languages\russian.irl mklink %path_x64d%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_x64d%languages\serbian-cyrillic.irl mklink %path_x64d%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_x64d%languages\serbian-latin.irl mklink %path_x64d%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_x64d%languages\slovak.irl mklink %path_x64d%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_x64d%languages\slovenian.irl mklink %path_x64d%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_x64d%languages\spanish.irl mklink %path_x64d%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_x64d%languages\swedish.irl mklink %path_x64d%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_x64d%languages\thai.irl mklink %path_x64d%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_x64d%languages\turkish.irl mklink %path_x64d%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_x64d%languages\ukrainian.irl mklink %path_x64d%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_x64d%languages\valencian.irl mklink %path_x64d%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_x64d%languages\vietnamese.irl mklink %path_x64d%languages\vietnamese.irl %path_trans_l%vietnamese.irl
if not exist %path_x64r%languages\albanian.irl mklink %path_x64r%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_x64r%languages\arabic.irl mklink %path_x64r%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_x64r%languages\armenian.irl mklink %path_x64r%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_x64r%languages\basque.irl mklink %path_x64r%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_x64r%languages\bosnian.irl mklink %path_x64r%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_x64r%languages\bulgarian.irl mklink %path_x64r%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_x64r%languages\catalan.irl mklink %path_x64r%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_x64r%languages\chinese-simplified.irl mklink %path_x64r%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_x64r%languages\chinese-traditional.irl mklink %path_x64r%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_x64r%languages\chuvash.irl mklink %path_x64r%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_x64r%languages\croatian.irl mklink %path_x64r%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_x64r%languages\czech.irl mklink %path_x64r%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_x64r%languages\danish.irl mklink %path_x64r%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_x64r%languages\dutch.irl mklink %path_x64r%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_x64r%languages\estonian.irl mklink %path_x64r%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_x64r%languages\farsi.irl mklink %path_x64r%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_x64r%languages\finnish.irl mklink %path_x64r%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_x64r%languages\french.irl mklink %path_x64r%languages\french.irl %path_trans_l%french.irl
if not exist %path_x64r%languages\galician.irl mklink %path_x64r%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_x64r%languages\german.irl mklink %path_x64r%languages\german.irl %path_trans_l%german.irl
if not exist %path_x64r%languages\georgian.irl mklink %path_x64r%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_x64r%languages\greek.irl mklink %path_x64r%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_x64r%languages\hebrew.irl mklink %path_x64r%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_x64r%languages\hungarian.irl mklink %path_x64r%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_x64r%languages\indonesian.irl mklink %path_x64r%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_x64r%languages\italian.irl mklink %path_x64r%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_x64r%languages\japanese.irl mklink %path_x64r%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_x64r%languages\korean.irl mklink %path_x64r%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_x64r%languages\latvian.irl mklink %path_x64r%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_x64r%languages\lithuanian.irl mklink %path_x64r%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_x64r%languages\macedonian.irl mklink %path_x64r%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_x64r%languages\norwegian.irl mklink %path_x64r%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_x64r%languages\polish.irl mklink %path_x64r%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_x64r%languages\portuguese.irl mklink %path_x64r%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_x64r%languages\portuguese-brazilian.irl mklink %path_x64r%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_x64r%languages\romanian.irl mklink %path_x64r%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_x64r%languages\russian.irl mklink %path_x64r%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_x64r%languages\serbian-cyrillic.irl mklink %path_x64r%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_x64r%languages\serbian-latin.irl mklink %path_x64r%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_x64r%languages\slovak.irl mklink %path_x64r%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_x64r%languages\slovenian.irl mklink %path_x64r%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_x64r%languages\spanish.irl mklink %path_x64r%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_x64r%languages\swedish.irl mklink %path_x64r%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_x64r%languages\thai.irl mklink %path_x64r%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_x64r%languages\turkish.irl mklink %path_x64r%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_x64r%languages\ukrainian.irl mklink %path_x64r%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_x64r%languages\valencian.irl mklink %path_x64r%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_x64r%languages\vietnamese.irl mklink %path_x64r%languages\vietnamese.irl %path_trans_l%vietnamese.irl
if not exist %path_x64p%languages\albanian.irl mklink %path_x64p%languages\albanian.irl %path_trans_l%albanian.irl
if not exist %path_x64p%languages\arabic.irl mklink %path_x64p%languages\arabic.irl %path_trans_l%arabic.irl
if not exist %path_x64p%languages\armenian.irl mklink %path_x64p%languages\armenian.irl %path_trans_l%armenian.irl
if not exist %path_x64p%languages\basque.irl mklink %path_x64p%languages\basque.irl %path_trans_l%basque.irl
if not exist %path_x64p%languages\bosnian.irl mklink %path_x64p%languages\bosnian.irl %path_trans_l%bosnian.irl
if not exist %path_x64p%languages\bulgarian.irl mklink %path_x64p%languages\bulgarian.irl %path_trans_l%bulgarian.irl
if not exist %path_x64p%languages\catalan.irl mklink %path_x64p%languages\catalan.irl %path_trans_l%catalan.irl
if not exist %path_x64p%languages\chinese-simplified.irl mklink %path_x64p%languages\chinese-simplified.irl %path_trans_l%chinese-simplified.irl
if not exist %path_x64p%languages\chinese-traditional.irl mklink %path_x64p%languages\chinese-traditional.irl %path_trans_l%chinese-traditional.irl
if not exist %path_x64p%languages\chuvash.irl mklink %path_x64p%languages\chuvash.irl %path_trans_l%chuvash.irl
if not exist %path_x64p%languages\croatian.irl mklink %path_x64p%languages\croatian.irl %path_trans_l%croatian.irl
if not exist %path_x64p%languages\czech.irl mklink %path_x64p%languages\czech.irl %path_trans_l%czech.irl
if not exist %path_x64p%languages\danish.irl mklink %path_x64p%languages\danish.irl %path_trans_l%danish.irl
if not exist %path_x64p%languages\dutch.irl mklink %path_x64p%languages\dutch.irl %path_trans_l%dutch.irl
if not exist %path_x64p%languages\estonian.irl mklink %path_x64p%languages\estonian.irl %path_trans_l%estonian.irl
if not exist %path_x64p%languages\farsi.irl mklink %path_x64p%languages\farsi.irl %path_trans_l%farsi.irl
if not exist %path_x64p%languages\finnish.irl mklink %path_x64p%languages\finnish.irl %path_trans_l%finnish.irl
if not exist %path_x64p%languages\french.irl mklink %path_x64p%languages\french.irl %path_trans_l%french.irl
if not exist %path_x64p%languages\galician.irl mklink %path_x64p%languages\galician.irl %path_trans_l%galician.irl
if not exist %path_x64p%languages\german.irl mklink %path_x64p%languages\german.irl %path_trans_l%german.irl
if not exist %path_x64p%languages\georgian.irl mklink %path_x64p%languages\georgian.irl %path_trans_l%georgian.irl
if not exist %path_x64p%languages\greek.irl mklink %path_x64p%languages\greek.irl %path_trans_l%greek.irl
if not exist %path_x64p%languages\hebrew.irl mklink %path_x64p%languages\hebrew.irl %path_trans_l%hebrew.irl
if not exist %path_x64p%languages\hungarian.irl mklink %path_x64p%languages\hungarian.irl %path_trans_l%hungarian.irl
if not exist %path_x64p%languages\indonesian.irl mklink %path_x64p%languages\indonesian.irl %path_trans_l%indonesian.irl
if not exist %path_x64p%languages\italian.irl mklink %path_x64p%languages\italian.irl %path_trans_l%italian.irl
if not exist %path_x64p%languages\japanese.irl mklink %path_x64p%languages\japanese.irl %path_trans_l%japanese.irl
if not exist %path_x64p%languages\korean.irl mklink %path_x64p%languages\korean.irl %path_trans_l%korean.irl
if not exist %path_x64p%languages\latvian.irl mklink %path_x64p%languages\latvian.irl %path_trans_l%latvian.irl
if not exist %path_x64p%languages\lithuanian.irl mklink %path_x64p%languages\lithuanian.irl %path_trans_l%lithuanian.irl
if not exist %path_x64p%languages\macedonian.irl mklink %path_x64p%languages\macedonian.irl %path_trans_l%macedonian.irl
if not exist %path_x64p%languages\norwegian.irl mklink %path_x64p%languages\norwegian.irl %path_trans_l%norwegian.irl
if not exist %path_x64p%languages\polish.irl mklink %path_x64p%languages\polish.irl %path_trans_l%polish.irl
if not exist %path_x64p%languages\portuguese.irl mklink %path_x64p%languages\portuguese.irl %path_trans_l%portuguese.irl
if not exist %path_x64p%languages\portuguese-brazilian.irl mklink %path_x64p%languages\portuguese-brazilian.irl %path_trans_l%portuguese-brazilian.irl
if not exist %path_x64p%languages\romanian.irl mklink %path_x64p%languages\romanian.irl %path_trans_l%romanian.irl
if not exist %path_x64p%languages\russian.irl mklink %path_x64p%languages\russian.irl %path_trans_l%russian.irl
if not exist %path_x64p%languages\serbian-cyrillic.irl mklink %path_x64p%languages\serbian-cyrillic.irl %path_trans_l%serbian-cyrillic.irl
if not exist %path_x64p%languages\serbian-latin.irl mklink %path_x64p%languages\serbian-latin.irl %path_trans_l%serbian-latin.irl
if not exist %path_x64p%languages\slovak.irl mklink %path_x64p%languages\slovak.irl %path_trans_l%slovak.irl
if not exist %path_x64p%languages\slovenian.irl mklink %path_x64p%languages\slovenian.irl %path_trans_l%slovenian.irl
if not exist %path_x64p%languages\spanish.irl mklink %path_x64p%languages\spanish.irl %path_trans_l%spanish.irl
if not exist %path_x64p%languages\swedish.irl mklink %path_x64p%languages\swedish.irl %path_trans_l%swedish.irl
if not exist %path_x64p%languages\thai.irl mklink %path_x64p%languages\thai.irl %path_trans_l%thai.irl
if not exist %path_x64p%languages\turkish.irl mklink %path_x64p%languages\turkish.irl %path_trans_l%turkish.irl
if not exist %path_x64p%languages\ukrainian.irl mklink %path_x64p%languages\ukrainian.irl %path_trans_l%ukrainian.irl
if not exist %path_x64p%languages\valencian.irl mklink %path_x64p%languages\valencian.irl %path_trans_l%valencian.irl
if not exist %path_x64p%languages\vietnamese.irl mklink %path_x64p%languages\vietnamese.irl %path_trans_l%vietnamese.irl
rem make symbolic links to translated help.
if not exist %path_w32d%languages\czech.chm mklink %path_w32d%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_w32d%languages\french.chm mklink %path_w32d%languages\french.chm %path_trans_h%french.chm
if not exist %path_w32d%languages\german.chm mklink %path_w32d%languages\german.chm %path_trans_h%german.chm
if not exist %path_w32d%languages\russian.chm mklink %path_w32d%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_w32d%languages\thai.chm mklink %path_w32d%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_w32d%languages\turkish.chm mklink %path_w32d%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_w32d%languages\ukrainian.chm mklink %path_w32d%languages\ukrainian.chm %path_trans_h%ukrainian.chm
if not exist %path_w32r%languages\czech.chm mklink %path_w32r%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_w32r%languages\french.chm mklink %path_w32r%languages\french.chm %path_trans_h%french.chm
if not exist %path_w32r%languages\german.chm mklink %path_w32r%languages\german.chm %path_trans_h%german.chm
if not exist %path_w32r%languages\russian.chm mklink %path_w32r%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_w32r%languages\thai.chm mklink %path_w32r%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_w32r%languages\turkish.chm mklink %path_w32r%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_w32r%languages\ukrainian.chm mklink %path_w32r%languages\ukrainian.chm %path_trans_h%ukrainian.chm
if not exist %path_w32p%languages\czech.chm mklink %path_w32p%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_w32p%languages\french.chm mklink %path_w32p%languages\french.chm %path_trans_h%french.chm
if not exist %path_w32p%languages\german.chm mklink %path_w32p%languages\german.chm %path_trans_h%german.chm
if not exist %path_w32p%languages\russian.chm mklink %path_w32p%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_w32p%languages\thai.chm mklink %path_w32p%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_w32p%languages\turkish.chm mklink %path_w32p%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_w32p%languages\ukrainian.chm mklink %path_w32p%languages\ukrainian.chm %path_trans_h%ukrainian.chm
if not exist %path_x64d%languages\czech.chm mklink %path_x64d%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_x64d%languages\french.chm mklink %path_x64d%languages\french.chm %path_trans_h%french.chm
if not exist %path_x64d%languages\german.chm mklink %path_x64d%languages\german.chm %path_trans_h%german.chm
if not exist %path_x64d%languages\russian.chm mklink %path_x64d%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_x64d%languages\thai.chm mklink %path_x64d%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_x64d%languages\turkish.chm mklink %path_x64d%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_x64d%languages\ukrainian.chm mklink %path_x64d%languages\ukrainian.chm %path_trans_h%ukrainian.chm
if not exist %path_x64r%languages\czech.chm mklink %path_x64r%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_x64r%languages\french.chm mklink %path_x64r%languages\french.chm %path_trans_h%french.chm
if not exist %path_x64r%languages\german.chm mklink %path_x64r%languages\german.chm %path_trans_h%german.chm
if not exist %path_x64r%languages\russian.chm mklink %path_x64r%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_x64r%languages\thai.chm mklink %path_x64r%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_x64r%languages\turkish.chm mklink %path_x64r%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_x64r%languages\ukrainian.chm mklink %path_x64r%languages\ukrainian.chm %path_trans_h%ukrainian.chm
if not exist %path_x64p%languages\czech.chm mklink %path_x64p%languages\czech.chm %path_trans_h%czech.chm
if not exist %path_x64p%languages\french.chm mklink %path_x64p%languages\french.chm %path_trans_h%french.chm
if not exist %path_x64p%languages\german.chm mklink %path_x64p%languages\german.chm %path_trans_h%german.chm
if not exist %path_x64p%languages\russian.chm mklink %path_x64p%languages\russian.chm %path_trans_h%russian.chm
if not exist %path_x64p%languages\thai.chm mklink %path_x64p%languages\thai.chm %path_trans_h%thai.chm
if not exist %path_x64p%languages\turkish.chm mklink %path_x64p%languages\turkish.chm %path_trans_h%turkish.chm
if not exist %path_x64p%languages\ukrainian.chm mklink %path_x64p%languages\ukrainian.chm %path_trans_h%ukrainian.chm
pause
================================================
FILE: readme.txt
================================================
InfraRecorder
Copyright (C) 2006-2012 Christian Kindahl, christian dot kindahl at gmail dot com
This program is licensed under GPL (version 3), please see the file
License.txt. Please note that the graphics used in InfraRecorder is not covered
by GPL, read the details further down in this document.
The InfraRecorder source code can be obtained from http://infrarecorder.org
In order to compile InfraRecorder you will need the following libraries:
1. WTL: http://wtl.sourceforge.net
2. ckCore, ckFileSystem and ckMMC: http://code.kindahl.com
3. libpng: http://www.libpng.org
InfraRecorder uses cdrtools, sources can be found at:
http://cdrecord.berlios.de/
InfraRecorder has been developed with Visual C++ 2005 Professional edition. It
is however possible to compile the sources with the free "Express" edition, but
you will need to separately obtain and install the ATL library headers. The
Microsoft Windows Server 2003 R2 Platform SDK (also free) was the last
Windows SDK version to ship with the ATL headers. The bundled ATL 3.0 is rather
old, but it is still supported by the latest WTL library.
The graphics used in InfraRecorder are NOT covered by GPL. The official
InfraRecorder logo (the logo used in official InfraRecorder binaries), and all
other graphics using it are licensed under the Creative Commons
Attribution-Noncommercial-No Derivative Works license
(http://creativecommons.org/licenses/by-nc-nd/3.0/) with one additional
condition:
* The work may not be used in derivative software or in the purpose of
promoting derivative software.
Apart from the graphics using the official InfraRecorder logo the above
license also applies to all graphics that are not derivative works of graphics
created by the Tango Desktop Project. Examples of this kind of graphics are the
button graphics used in the welcome screen.
The remaining graphics that are derivative work based on icons in the Tango
Desktop Project (http://tango.freedesktop.org) is available under the same
license as the Tango Desktop Project graphics. That is the Creative Commons
Attribution Share-Alike license
(http://creativecommons.org/licenses/by-sa/2.5/).
================================================
FILE: sign.bat
================================================
@echo off
set cert_file= %~dp0christian_kindahl.pfx
set /p cert_pass= < %~dp0christian_kindahl.psw
set cert_sats= "http://timestamp.comodoca.com/authenticode"
set path_w32r=%~dp0bin\win32\release\
set path_w32p=%~dp0bin\win32\releasep\
set path_x64r=%~dp0bin\x64\release\
set path_x64p=%~dp0bin\x64\releasep\
rem set path_dist=%~dp0dist\
set path_smoke_w32=%~dp0dep\smoke\win32\
set path_smoke_x64=%~dp0dep\smoke\x64\
set path_cdrtools=%~dp0dep\cdrtools\
set path_sndfile_w32=%~dp0dep\libsndfile\win32\
set path_sndfile_x64=%~dp0dep\libsndfile\x64\
if "%~1" NEQ "" goto single_file
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_smoke_w32%smoke.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_smoke_x64%smoke.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_sndfile_w32%libsndfile-1.dll
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_sndfile_x64%libsndfile-1.dll
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_cdrtools%cdda2wav.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_cdrtools%cdrecord.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_cdrtools%readcd.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_cdrtools%cygwin1.dll
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%infrarecorder.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%shell.dll
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%codecs\lame.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%codecs\sndfile.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%codecs\wave.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%codecs\wma.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32r%codecs\vorbis.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%infrarecorder.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%codecs\lame.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%codecs\sndfile.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%codecs\wave.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%codecs\wma.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_w32p%codecs\vorbis.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%infrarecorder.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%shell.dll
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%codecs\lame.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%codecs\sndfile.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%codecs\wave.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%codecs\wma.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64r%codecs\vorbis.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%infrarecorder.exe
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%codecs\lame.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%codecs\sndfile.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%codecs\wave.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%codecs\wma.irc
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_x64p%codecs\vorbis.irc
rem signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_dist%ir.exe
rem signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %path_dist%ir_x64.msi
goto end
:single_file
signtool sign /f %cert_file% /p %cert_pass% /t %cert_sats% %1
goto end
:end
pause
================================================
FILE: src/app/action_manager.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include "settings.hh"
#include "core.hh"
#include "core2.hh"
#include "core2_info.hh"
#include "infrarecorder.hh"
#include "burn_image_dlg.hh"
#include "copy_disc_dlg.hh"
#include "copy_image_dlg.hh"
#include "info_dlg.hh"
#include "tracks_dlg.hh"
#include "erase_dlg.hh"
#include "fixate_dlg.hh"
#include "progress_dlg.hh"
#include "simple_progress_dlg.hh"
#include "string_table.hh"
#include "lang_util.hh"
#include "project_manager.hh"
#include "scsi.hh"
#include "log_dlg.hh"
#include "action_manager.hh"
CActionManager g_ActionManager;
CActionManager::CActionManager()
{
}
CActionManager::~CActionManager()
{
}
static void RemoveTempTracks ( std::vector & TempTracks )
{
for ( std::vector ::iterator it = TempTracks.begin();
it != TempTracks.end();
++it )
{
const TCHAR * const elem = *it;
ckcore::File::remove(elem);
delete [] elem;
}
TempTracks.clear();
}
DWORD WINAPI CActionManager::BurnCompilationThread(LPVOID lpThreadParameter)
{
struct CLocalData
{
// The destructor frees these variables automatically.
ckcore::File ImageFile;
ckfilesystem::FileSet Files; // Files to burn.
std::vector TempTracks;
const TCHAR *pAudioText;
CLocalData(void)
: ImageFile(g_BurnImageSettings.m_bOnFly
? ckcore::Path() // 'ImageFile' variable not used.
: ckcore::File::temp(g_GlobalSettings.m_szTempPath,
ckT("InfraRecorder"))),
Files(g_ProjectSettings.m_iFileSystem == FILESYSTEM_DVDVIDEO),
pAudioText(NULL)
{}
~CLocalData(void)
{
if (!g_BurnImageSettings.m_bOnFly)
ImageFile.remove();
ckfilesystem::destroy_file_set(Files);
RemoveTempTracks(TempTracks);
// Remove the CD-Text file.
if (pAudioText != NULL)
ckcore::File::remove(pAudioText);
}
} LocalData;
int iProjectType = g_ProjectManager.GetProjectType();
eBurnResult result = BURNRESULT_INTERNALERROR;
// Make sure that the disc will not be ejected before beeing verified.
bool bEject = g_BurnImageSettings.m_bEject;
g_BurnImageSettings.m_bEject = false;
// Used for locating the files on the disc when verifying.
std::map FilePathMap;
switch (iProjectType)
{
case PROJECTTYPE_DATA:
g_TreeManager.GetPathList(LocalData.Files,g_TreeManager.GetRootNode());
break;
case PROJECTTYPE_MIXED:
g_TreeManager.GetPathList(LocalData.Files,g_ProjectManager.GetMixDataRootNode(),
lstrlen(g_ProjectManager.GetMixDataRootNode()->pItemData->GetFileName()) + 1);
break;
case PROJECTTYPE_AUDIO:
// Audio discs do not have files to burn.
break;
default:
ATLASSERT(false);
return 0;
};
if (iProjectType == PROJECTTYPE_DATA ||
iProjectType == PROJECTTYPE_MIXED)
{
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_PREPOPERATION));
g_pProgressDlg->SetDevice(_T(""));
g_pProgressDlg->set_status(lngGetString(STATUS_GATHER_FILE_INFO));
// Create a temporary disc image if not burning on the fly.
if (!g_BurnImageSettings.m_bOnFly)
{
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_CREATEIMAGE));
g_pProgressDlg->SetDevice(lngGetString(PROGRESS_IMAGEDEVICE));
g_pProgressDlg->set_status(lngGetString(STATUS_WRITEIMAGE));
g_pProgressDlg->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINDISCIMAGE));
const int iCreateImageResult = g_Core2.CreateImage(LocalData.ImageFile.name().c_str(),LocalData.Files,*g_pProgressDlg,
true,g_BurnImageSettings.m_bVerify ? &FilePathMap : NULL);
g_pProgressDlg->set_progress(100);
switch (iCreateImageResult)
{
case RESULT_OK:
g_pProgressDlg->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_CREATEIMAGE));
result = BURNRESULT_OK;
break;
case RESULT_CANCEL:
g_pProgressDlg->NotifyCompleted();
return 0;
case RESULT_FAIL:
g_pProgressDlg->set_status(lngGetString(PROGRESS_FAILED));
g_pProgressDlg->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_CREATEIMAGE));
g_pProgressDlg->NotifyCompleted();
return 0;
default:
ATLASSERT( false );
};
}
}
g_pProgressDlg->set_progress(0);
ckmmc::Device &Device = *g_BurnImageSettings.m_pRecorder;
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_BURNCOMPILATION));
g_pProgressDlg->SetDevice(Device);
std::vector AudioTracks;
// Decode any encoded tracks in audio and mixed-mode projects.
g_pProgressDlg->set_status(lngGetString(PROGRESS_DECODETRACKS));
switch (iProjectType)
{
case PROJECTTYPE_MIXED:
case PROJECTTYPE_AUDIO:
g_ProjectManager.GetAudioTracks(AudioTracks);
// Decode any audio tracks that might be encoded.
if (!g_ProjectManager.DecodeAudioTracks(AudioTracks,LocalData.TempTracks,g_pProgressDlg))
{
g_pProgressDlg->NotifyCompleted();
return 0;
}
break;
case PROJECTTYPE_DATA:
// No audio tracks to decode.
break;
default:
ATLASSERT( false );
}
// Start the burn process.
for (long i = 0; i < g_BurnImageSettings.m_lNumCopies; i++)
{
bool bLast = i == (g_BurnImageSettings.m_lNumCopies - 1);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
switch (iProjectType)
{
case PROJECTTYPE_DATA:
if (g_BurnImageSettings.m_bOnFly)
{
// Try to estimate the file system size before burning the compilation.
unsigned __int64 uiDataSize = 0;
g_pProgressDlg->set_status(lngGetString(PROGRESS_ESTIMAGESIZE));
const int iEstimateImageSizeRes = g_Core2.EstimateImageSize(LocalData.Files,*g_pProgressDlg,uiDataSize);
g_pProgressDlg->set_progress(100);
switch ( iEstimateImageSizeRes )
{
case RESULT_OK:
// Reset the status.
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
if (g_BurnImageSettings.m_bVerify || !bLast)
{
result = g_Core.BurnCompilationEx(Device,g_pProgressDlg,*g_pProgressDlg,LocalData.Files,
AudioTracks,NULL,g_ProjectSettings.m_iIsoFormat,uiDataSize);
}
else
{
const bool bBurnCompilationRes = g_Core.BurnCompilation(Device,g_pProgressDlg,*g_pProgressDlg,LocalData.Files,
AudioTracks,NULL,g_ProjectSettings.m_iIsoFormat,uiDataSize);
result = bBurnCompilationRes ? BURNRESULT_OK : BURNRESULT_INTERNALERROR;
}
break;
default:
ATLASSERT( false );
// Fall through
case RESULT_CANCEL:
case RESULT_FAIL:
g_pProgressDlg->notify(ckcore::Progress::ckERROR,lngGetString(ERROR_ESTIMAGESIZE));
result = BURNRESULT_INTERNALERROR;
break;
}
}
else
{
if (g_BurnImageSettings.m_bVerify || !bLast)
{
result = g_Core.BurnTracksEx(Device,g_pProgressDlg,LocalData.ImageFile.name().c_str(),
AudioTracks,NULL,g_ProjectSettings.m_iIsoFormat);
}
else
{
bool bBurnTracksRes = g_Core.BurnTracks(Device,g_pProgressDlg,LocalData.ImageFile.name().c_str(),
AudioTracks,NULL,g_ProjectSettings.m_iIsoFormat);
result = bBurnTracksRes ? BURNRESULT_OK : BURNRESULT_INTERNALERROR;
}
}
break;
case PROJECTTYPE_MIXED:
// Save CD-Text information.
if (AudioTracks.size() > 0)
{
// Check if any audio information has been edited.
if (g_TreeManager.HasExtraAudioData(g_ProjectManager.GetMixAudioRootNode()))
{
ckcore::File AudioTextFile = ckcore::File::temp(g_GlobalSettings.m_szTempPath,
ckT("InfraRecorder"));
if (g_ProjectManager.SaveCDText(AudioTextFile.name().c_str()))
LocalData.pAudioText = AudioTextFile.name().c_str();
else
lngMessageBox(HWND_DESKTOP,FAILURE_CREATECDTEXT,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
}
if (g_BurnImageSettings.m_bOnFly)
{
// Try to estimate the file system size before burning the compilation.
unsigned __int64 uiDataSize = 0;
g_pProgressDlg->set_status(lngGetString(PROGRESS_ESTIMAGESIZE));
const int iEstimateImageSizeRes = g_Core2.EstimateImageSize(LocalData.Files,*g_pProgressDlg,uiDataSize);
g_pProgressDlg->set_progress(100);
switch ( iEstimateImageSizeRes )
{
case RESULT_OK:
// Reset the status.
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
if (g_BurnImageSettings.m_bVerify || !bLast)
{
result = g_Core.BurnCompilationEx(Device,g_pProgressDlg,*g_pProgressDlg,LocalData.Files,
AudioTracks,LocalData.pAudioText,g_ProjectSettings.m_iIsoFormat,uiDataSize);
}
else
{
bool bBurnCompilationRes = g_Core.BurnCompilation(Device,g_pProgressDlg,*g_pProgressDlg,LocalData.Files,
AudioTracks,LocalData.pAudioText,g_ProjectSettings.m_iIsoFormat,uiDataSize);
result = bBurnCompilationRes ? BURNRESULT_OK : BURNRESULT_INTERNALERROR;
}
break;
default:
ATLASSERT( false );
// Fall through.
case RESULT_CANCEL:
case RESULT_FAIL:
g_pProgressDlg->notify(ckcore::Progress::ckERROR,lngGetString(ERROR_ESTIMAGESIZE));
result = BURNRESULT_INTERNALERROR;
break;
}
}
else
{
if (g_BurnImageSettings.m_bVerify || !bLast)
{
result = g_Core.BurnTracksEx(Device,g_pProgressDlg,LocalData.ImageFile.name().c_str(),
AudioTracks,LocalData.pAudioText,g_ProjectSettings.m_iIsoFormat);
}
else
{
bool bBurnTracksRes = g_Core.BurnTracks(Device,g_pProgressDlg,LocalData.ImageFile.name().c_str(),
AudioTracks,LocalData.pAudioText,g_ProjectSettings.m_iIsoFormat);
result = bBurnTracksRes ? BURNRESULT_OK : BURNRESULT_INTERNALERROR;
}
}
break;
case PROJECTTYPE_AUDIO:
// Save CD-Text information.
if (AudioTracks.size() > 0)
{
// Check if any audio information has been edited.
if (g_TreeManager.HasExtraAudioData(g_TreeManager.GetRootNode()))
{
ckcore::File AudioTextFile = ckcore::File::temp(g_GlobalSettings.m_szTempPath,
ckT("InfraRecorder"));
if (g_ProjectManager.SaveCDText(AudioTextFile.name().c_str()))
LocalData.pAudioText = AudioTextFile.name().c_str();
else
lngMessageBox(HWND_DESKTOP,FAILURE_CREATECDTEXT,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
}
if (bLast)
{
bool bBurnTracksRes = g_Core.BurnTracks(Device,g_pProgressDlg,NULL,
AudioTracks,LocalData.pAudioText,0);
result = bBurnTracksRes ? BURNRESULT_OK : BURNRESULT_INTERNALERROR;
}
else
{
result = g_Core.BurnTracksEx(Device,g_pProgressDlg,NULL,
AudioTracks,LocalData.pAudioText,0);
}
break;
default:
ATLASSERT( false );
};
// Handle the result.
switch ( result )
{
default:
ATLASSERT( false );
// Fall through
case BURNRESULT_INTERNALERROR:
case BURNRESULT_EXTERNALERROR:
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
return 0;
case BURNRESULT_OK:
break;
}
// The recording was successful. Verify the disc if requested.
if (g_BurnImageSettings.m_bVerify)
{
// We need to reload the drive media.
g_pProgressDlg->set_status(lngGetString(PROGRESS_RELOADMEDIA));
g_Core2.StartStopUnit(Device,CCore2::LOADMEDIA_EJECT,false);
if (!g_Core2.StartStopUnit(Device,CCore2::LOADMEDIA_LOAD,false))
lngMessageBox(*g_pProgressDlg,INFO_RELOAD,GENERAL_INFORMATION,MB_OK | MB_ICONINFORMATION);
// Set the device information.
g_pProgressDlg->SetDevice(Device);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
g_pProgressDlg->SetWindowText(lngGetString(STITLE_VERIFYDISC));
// Get the device drive letter.
TCHAR szDriveLetter[3];
szDriveLetter[0] = Device.address().device_[0];
szDriveLetter[1] = ':';
szDriveLetter[2] = '\0';
// Validate the project files.
g_ProjectManager.VerifyCompilation(g_pProgressDlg,szDriveLetter,FilePathMap);
// We're done.
g_pProgressDlg->set_progress(100);
g_pProgressDlg->set_status(lngGetString(PROGRESS_DONE));
g_pProgressDlg->NotifyCompleted();
}
// Eject the disc if requested.
if (bEject)
g_Core.EjectDisc(Device,false);
if (!bLast)
{
g_pProgressDlg->set_progress(0);
if (!g_pProgressDlg->RequestNextDisc())
{
g_pProgressDlg->NotifyCompleted();
break;
}
TCHAR szBuffer[128];
lsprintf(szBuffer,lngGetString(INFO_CREATECOPY),
i + 2,
g_BurnImageSettings.m_lNumCopies);
g_pProgressDlg->notify(ckcore::Progress::ckINFORMATION,szBuffer);
}
}
return 0;
}
DWORD WINAPI CActionManager::CreateImageThread(LPVOID lpThreadParameter)
{
TCHAR *szFileName = (TCHAR *)lpThreadParameter;
ckfilesystem::FileSet Files(g_ProjectSettings.m_iFileSystem == FILESYSTEM_DVDVIDEO);
try
{
switch (g_ProjectManager.GetProjectType())
{
case PROJECTTYPE_DATA:
g_TreeManager.GetPathList(Files,g_TreeManager.GetRootNode());
break;
case PROJECTTYPE_MIXED:
g_TreeManager.GetPathList(Files,g_ProjectManager.GetMixDataRootNode(),
lstrlen(g_ProjectManager.GetMixDataRootNode()->pItemData->GetFileName()) + 1);
break;
default:
ATLASSERT( false );
delete [] szFileName;
ckfilesystem::destroy_file_set(Files);
return 0;
};
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_CREATEIMAGE));
g_pProgressDlg->SetDevice(lngGetString(PROGRESS_IMAGEDEVICE));
g_pProgressDlg->set_status(lngGetString(STATUS_WRITEIMAGE));
g_pProgressDlg->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINDISCIMAGE));
int iResult = g_Core2.CreateImage(szFileName,Files,*g_pProgressDlg,true);
g_pProgressDlg->set_progress(100);
g_pProgressDlg->NotifyCompleted();
switch (iResult)
{
case RESULT_OK:
g_pProgressDlg->set_status(lngGetString(PROGRESS_DONE));
g_pProgressDlg->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_CREATEIMAGE));
break;
case RESULT_FAIL:
g_pProgressDlg->set_status(lngGetString(PROGRESS_FAILED));
g_pProgressDlg->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_CREATEIMAGE));
ckcore::File::remove(szFileName);
break;
case RESULT_CANCEL:
ckcore::File::remove(szFileName);
break;
default:
ATLASSERT( false );
}
}
catch ( ... )
{
delete [] szFileName;
ckfilesystem::destroy_file_set(Files);
throw;
}
delete [] szFileName;
ckfilesystem::destroy_file_set(Files);
return 0;
}
/**
Tries to erase the disc inserted in the specified recorder using a fast
method. The function will not let you know if it fails.
*/
void CActionManager::QuickErase(ckmmc::Device &Device)
{
// Get current profile.
ckmmc::Device::Profile Profile = Device.profile();
int iMode = g_EraseSettings.m_iMode;
bool bForce = g_EraseSettings.m_bForce;
bool bEject = g_EraseSettings.m_bEject;
bool bSimulate = g_EraseSettings.m_bSimulate;
switch (Profile)
{
case ckmmc::Device::ckPROFILE_DVDPLUSRW:
case ckmmc::Device::ckPROFILE_DVDPLUSRW_DL:
g_EraseSettings.m_iMode = CCore2::ERASE_FORMAT_QUICK;
break;
case ckmmc::Device::ckPROFILE_DVDRAM:
g_EraseSettings.m_iMode = CCore2::ERASE_FORMAT_FULL;
break;
//case ckmmc::Device::ckPROFILE_CDRW:
//case ckmmc::Device::ckPROFILE_DVDMINUSRW_RESTOV:
//case ckmmc::Device::ckPROFILE_DVDMINUSRW_SEQ:
default:
g_EraseSettings.m_iMode = CCore2::ERASE_BLANK_MINIMAL;
break;
}
g_EraseSettings.m_iMode = CCore2::ERASE_BLANK_MINIMAL;
g_EraseSettings.m_bForce = true;
g_EraseSettings.m_bEject = false;
g_EraseSettings.m_bSimulate = false;
g_EraseSettings.m_pRecorder = &Device;
g_EraseSettings.m_uiSpeed = 0xFFFFFFFF; // Maximum.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_ERASE));
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Set the device information.
g_pProgressDlg->SetDevice(Device);
// Create the new erase thread.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,EraseThread,new CEraseParam(false),0,&ulThreadID);
// Wait for the thread to finish.
while (true)
{
if (WaitForSingleObject(hThread,100) == WAIT_TIMEOUT)
{
ProcessMessages();
Sleep(100);
}
else
{
break;
}
}
::CloseHandle(hThread);
g_pProgressDlg->Reset();
g_pProgressDlg->AllowCancel(true);
// Restore settings.
g_EraseSettings.m_iMode = iMode;
g_EraseSettings.m_bForce = bForce;
g_EraseSettings.m_bEject = bEject;
g_EraseSettings.m_bSimulate = bSimulate;
}
/**
Depending on the media inserted into the disc this function will try to
determine if the media should be erased. This includes asking the user if
necessary.
*/
bool CActionManager::QuickEraseQuery(ckmmc::Device &Device,HWND hWndParent)
{
if (!g_ProjectSettings.m_bMultiSession)
{
CCore2Info Info;
CCore2DiscInfo DiscInfo;
if (Info.ReadDiscInformation(Device,&DiscInfo))
{
if (DiscInfo.m_ucDiscStatus != CCore2DiscInfo::DS_EMTPY &&
DiscInfo.m_ucFlags & CCore2DiscInfo::FLAG_ERASABLE)
{
if (lngMessageBox(hWndParent,MISC_ERASENONEMPTY,GENERAL_QUESTION,
MB_YESNO | MB_ICONQUESTION) == IDYES)
{
return true;
}
}
}
}
return false;
}
INT_PTR CActionManager::BurnCompilation(HWND hWndParent,bool bAppMode)
{
bool bAudioProject = g_ProjectManager.GetProjectType() == PROJECTTYPE_AUDIO;
// Display the burn image dialog.
CBurnImageDlg BurnImageDlg(lngGetString(MISC_BURNCOMPILATION),false,
!bAudioProject,!bAudioProject,bAppMode);
INT_PTR iResult = BurnImageDlg.DoModal();
if (iResult == IDOK)
{
// Check if we should erase the disc.
bool bErase = QuickEraseQuery(*g_BurnImageSettings.m_pRecorder,hWndParent);
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
if (bErase)
QuickErase(*g_BurnImageSettings.m_pRecorder);
// Create the new thread.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,BurnCompilationThread,this,0,&ulThreadID);
::CloseHandle(hThread);
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
INT_PTR CActionManager::CreateImage(HWND hWndParent,bool bAppMode)
{
WTL::CFileDialog FileDialog(false,_T("iso"),_T("Untitled"),OFN_EXPLORER | OFN_OVERWRITEPROMPT,
_T("Disc Images (*.iso)\0*.iso\0\0"),hWndParent);
INT_PTR iResult = FileDialog.DoModal();
if (iResult == IDOK)
{
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// WARNING: Heap allocation, this memory memory must be freed when the thread exit.
TCHAR *szFileName = new TCHAR[MAX_PATH];
lstrcpy(szFileName,FileDialog.m_szFileName);
// Create the new thread.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,CreateImageThread,szFileName,0,&ulThreadID);
::CloseHandle(hThread);
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
INT_PTR CActionManager::BurnImage(HWND hWndParent,bool bAppMode)
{
WTL::CFileDialog FileDialog(true,0,0,OFN_FILEMUSTEXIST | OFN_EXPLORER,
_T("Disc Images (*.iso, *.cue, *.img)\0*.iso;*.cue;*.img\0Raw Images (*.bin, *.raw)\0*.bin;*.raw\0All Files (*.*)\0*.*\0\0"),hWndParent);
INT_PTR iResult = FileDialog.DoModal();
if (iResult == IDOK)
iResult = BurnImageEx(hWndParent,bAppMode,FileDialog.m_szFileName);
return iResult;
}
INT_PTR CActionManager::BurnImageEx(HWND hWndParent,bool bAppMode,const TCHAR *szFilePath)
{
// Dialog title.
TCHAR szFileName[MAX_PATH];
lstrcpy(szFileName,szFilePath);
ExtractFileName(szFileName);
TCHAR szTitle[MAX_PATH];
lstrcpy(szTitle,lngGetString(MISC_BURN));
lstrcat(szTitle,szFileName);
// Look for a TOC file.
TCHAR szTOCFilePath[MAX_PATH];
lstrcpy(szTOCFilePath,szFilePath);
lstrcat(szTOCFilePath,_T(".toc"));
bool bImageHasTOC = false;
if (ckcore::File::exist(szTOCFilePath))
bImageHasTOC = true;
// Display the burn image dialog.
CBurnImageDlg BurnImageDlg(szTitle,bImageHasTOC,false,false,bAppMode);
INT_PTR iResult = BurnImageDlg.DoModal();
if (iResult == IDOK)
{
// Check if we should erase the disc.
bool bErase = QuickEraseQuery(*g_BurnImageSettings.m_pRecorder,hWndParent);
ckmmc::Device &Device = *g_BurnImageSettings.m_pRecorder;
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
//g_pProgressDlg->SetWindowText(lngGetString(STITLE_BURNIMAGE));
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Erase the disc if necessary.
if (bErase)
QuickErase(Device);
// Set the device information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_BURNIMAGE));
g_pProgressDlg->SetDevice(Device);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Begin burning the image.
if (!g_Core.BurnImage(Device,g_pProgressDlg,szFilePath,bImageHasTOC))
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
DWORD WINAPI CActionManager::CopyDiscOnFlyThread(LPVOID lpThreadParameter)
{
// Get device information.
ckmmc::Device &SrcDevice = *g_CopyDiscSettings.m_pSource;
ckmmc::Device &DstDevice = *g_CopyDiscSettings.m_pTarget;
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_COPYDISC));
g_pProgressDlg->SetDevice(DstDevice);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Start the operation.
if (!g_Core.CopyDisc(SrcDevice,DstDevice,g_pProgressDlg))
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
return 0;
}
return 0;
}
DWORD WINAPI CActionManager::CopyDiscThread(LPVOID lpThreadParameter)
{
ckcore::File ImageFile = ckcore::File::temp(g_GlobalSettings.m_szTempPath,
ckT("InfraRecorder"));
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_CREATEIMAGE));
g_pProgressDlg->SetDevice(lngGetString(PROGRESS_IMAGEDEVICE));
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Get device information.
ckmmc::Device &SrcDevice = *g_CopyDiscSettings.m_pSource;
// Override the read sub-channel data setting.
g_ReadSettings.m_bClone = g_CopyDiscSettings.m_bClone;
eBurnResult iResult = g_Core.ReadDiscEx(SrcDevice,g_pProgressDlg,ImageFile.name().c_str());
switch (iResult)
{
default:
ATLASSERT( false );
// Fall through
case BURNRESULT_INTERNALERROR:
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
// Remove any temporary files.
ImageFile.remove();
if (g_CopyDiscSettings.m_bClone)
{
ckcore::tstring TocName = ImageFile.name();
TocName += ckT(".toc");
ckcore::File::remove(TocName.c_str());
}
return 0;
case BURNRESULT_EXTERNALERROR:
// Remove any temporary files.
ImageFile.remove();
if (g_CopyDiscSettings.m_bClone)
{
ckcore::tstring TocName = ImageFile.name();
TocName += ckT(".toc");
ckcore::File::remove(TocName.c_str());
}
return 0;
case BURNRESULT_OK:
break;
}
// Ask the user to switch discs if the target is the same as the source.
if (g_CopyDiscSettings.m_pSource == g_CopyDiscSettings.m_pTarget)
{
g_Core2.StartStopUnit(SrcDevice,CCore2::LOADMEDIA_EJECT,true);
if (lngMessageBox(*g_pProgressDlg,INFO_INSERTBLANK,GENERAL_INFORMATION,
MB_OKCANCEL | MB_ICONINFORMATION) == IDCANCEL)
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
// Remove any temporary files.
ImageFile.remove();
if (g_CopyDiscSettings.m_bClone)
{
ckcore::tstring TocName = ImageFile.name();
TocName += ckT(".toc");
ckcore::File::remove(TocName.c_str());
}
return 0;
}
}
// Get device information.
ckmmc::Device &DstDevice = *g_CopyDiscSettings.m_pTarget;
// Set the status information.
g_pProgressDlg->SetWindowText(lngGetString(STITLE_BURNIMAGE));
g_pProgressDlg->SetDevice(DstDevice);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
if (!g_Core.BurnImageEx(DstDevice,g_pProgressDlg,ImageFile.name().c_str(),
g_CopyDiscSettings.m_bClone))
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
// Remove any temporary files.
ImageFile.remove();
if (g_CopyDiscSettings.m_bClone)
{
ckcore::tstring TocName = ImageFile.name();
TocName += ckT(".toc");
ckcore::File::remove(TocName.c_str());
}
return 0;
}
DWORD WINAPI CActionManager::EraseThread(LPVOID lpThreadParameter)
{
std::auto_ptr Param((CEraseParam *)lpThreadParameter);
// Get device information.
ckmmc::Device &Device = *g_EraseSettings.m_pRecorder;
bool bResult = g_Core2.EraseDisc(Device,g_pProgressDlg,g_EraseSettings.m_iMode,
g_EraseSettings.m_bForce,g_EraseSettings.m_bEject,g_EraseSettings.m_bSimulate,
g_EraseSettings.m_uiSpeed);
g_pProgressDlg->set_progress(100);
if (Param->m_bNotifyCompleted)
g_pProgressDlg->NotifyCompleted();
if (bResult)
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_DONE));
}
else
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_FAILED));
g_pProgressDlg->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_ERASE));
}
return true;
}
INT_PTR CActionManager::CopyDisc(HWND hWndParent,bool bAppMode)
{
// Display the information dialog.
if (g_GlobalSettings.m_bCopyWarning)
{
CInfoDlg InfoDlg(&g_GlobalSettings.m_bCopyWarning,lngGetString(INFO_COPYDISC));
if (InfoDlg.DoModal() == IDCANCEL)
return IDCANCEL;
}
// Display the burn image dialog.
CCopyDiscDlg CopyDiscDlg(bAppMode);
INT_PTR iResult = CopyDiscDlg.DoModal();
if (iResult == IDOK)
{
if (g_CopyDiscSettings.m_pSource == g_CopyDiscSettings.m_pTarget)
{
ckmmc::Device &Device = *g_CopyDiscSettings.m_pSource;
g_Core2.StartStopUnit(Device,CCore2::LOADMEDIA_EJECT,true);
if (lngMessageBox(hWndParent,INFO_INSERTSOURCE,GENERAL_INFORMATION,
MB_OKCANCEL | MB_ICONINFORMATION) == IDCANCEL)
{
return IDCANCEL;
}
}
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Create the new thread.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,g_CopyDiscSettings.m_bOnFly ? CopyDiscOnFlyThread : CopyDiscThread,NULL,0,&ulThreadID);
::CloseHandle(hThread);
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
/*
CActionManager::CopyImage
-------------------------
Performs the copy disc to a disc image action.
*/
INT_PTR CActionManager::CopyImage(HWND hWndParent,bool bAppMode)
{
// Display the copy image dialog.
CCopyImageDlg CopyImageDlg(bAppMode);
INT_PTR iResult = CopyImageDlg.DoModal();
if (iResult == IDOK)
{
ckmmc::Device &Device = *g_CopyDiscSettings.m_pSource;
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->SetWindowText(lngGetString(STITLE_CREATEIMAGE));
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Set the device information.
g_pProgressDlg->SetDevice(Device);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Begin reading the disc.
if (!g_Core.ReadDisc(Device,g_pProgressDlg,CopyImageDlg.GetFileName()))
{
g_pProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
INT_PTR CActionManager::ManageTracks(bool bAppMode)
{
CTracksDlg TracksDlg(bAppMode);
return TracksDlg.DoModal();
}
INT_PTR CActionManager::Erase(HWND hWndParent,bool bAppMode)
{
CEraseDlg EraseDlg(bAppMode);
INT_PTR iResult = EraseDlg.DoModal();
if (iResult == IDOK)
{
ckmmc::Device &Device = *g_EraseSettings.m_pRecorder;
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(bAppMode);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->SetWindowText(lngGetString(STITLE_ERASE));
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Set the device information.
g_pProgressDlg->SetDevice(Device);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Create the new thread.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,EraseThread,new CEraseParam(true),0,&ulThreadID);
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
::CloseHandle(hThread);
}
return iResult;
}
INT_PTR CActionManager::Fixate(HWND hWndParent,bool bAppMode)
{
CFixateDlg FixateDlg(bAppMode);
INT_PTR iResult = FixateDlg.DoModal();
if (iResult == IDOK)
{
ckmmc::Device &Device = *g_FixateSettings.m_pRecorder;
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// If we're in application mode we need to create a message loop since
// the progress window must run independently.
CMessageLoop MainLoop;
if (bAppMode)
_Module.AddMessageLoop(&MainLoop);
// Create and display the progress dialog.
g_pSimpleProgressDlg->SetAppMode(bAppMode);
if (!g_pSimpleProgressDlg->IsWindow())
g_pSimpleProgressDlg->Create(hWndParent);
g_pSimpleProgressDlg->ShowWindow(true);
g_pSimpleProgressDlg->SetWindowText(lngGetString(STITLE_FIXATE));
g_pSimpleProgressDlg->Reset();
g_pSimpleProgressDlg->AttachProcess(&g_Core);
g_pSimpleProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Set the device information.
g_pSimpleProgressDlg->SetDevice(Device);
g_pSimpleProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Begin erasing the disc.
if (!g_Core.FixateDisc(Device,g_pSimpleProgressDlg,
g_FixateSettings.m_bEject,
g_FixateSettings.m_bSimulate))
{
g_pSimpleProgressDlg->set_status(lngGetString(PROGRESS_CANCELED));
g_pSimpleProgressDlg->notify(ckcore::Progress::ckWARNING,lngGetString(PROGRESS_CANCELED));
g_pSimpleProgressDlg->NotifyCompleted();
lngMessageBox(HWND_DESKTOP,FAILURE_CDRTOOLS,GENERAL_ERROR,MB_OK | MB_ICONERROR);
}
// Run the message loop if we're in application mode.
if (bAppMode)
{
iResult = MainLoop.Run();
_Module.RemoveMessageLoop();
return iResult;
}
}
return iResult;
}
// For testing purposes only.
/*int CActionManager::VerifyCompilation(HWND hWndParent)
{
tDeviceInfo *pDeviceInfo = g_DeviceManager.GetDeviceInfo(g_BurnImageSettings.m_iRecorder);
tDeviceCap *pDeviceCap = g_DeviceManager.GetDeviceCap(g_BurnImageSettings.m_iRecorder);
tDeviceInfoEx *pDeviceInfoEx = g_DeviceManager.GetDeviceInfoEx(g_BurnImageSettings.m_iRecorder);
// Disable the parent window.
if (hWndParent != NULL)
::EnableWindow(hWndParent,false);
// Create and display the progress dialog.
g_pProgressDlg->SetAppMode(false);
if (!g_pProgressDlg->IsWindow())
g_pProgressDlg->Create(hWndParent);
g_pProgressDlg->ShowWindow(true);
g_pProgressDlg->SetWindowText(lngGetString(STITLE_BURNIMAGE));
g_pProgressDlg->Reset();
g_pProgressDlg->AttachProcess(&g_Core);
g_pProgressDlg->AttachHost(hWndParent);
ProcessMessages();
// Set the device information.
TCHAR szDeviceName[128];
g_DeviceManager.GetDeviceName(pDeviceInfo,szDeviceName);
g_pProgressDlg->SetDevice(szDeviceName);
g_pProgressDlg->set_status(lngGetString(PROGRESS_INIT));
// Get the device drive letter.
TCHAR szDriveLetter[3];
szDriveLetter[1] = ':';
szDriveLetter[2] = '\0';
bool bFoundDriveLetter = true;
if (!SCSIGetDriveLetter(2,1,0,szDriveLetter[0]))
{
// This is not water proof. External USB and FireWire devices will fail the above
// function call because USB and FireWire devices can't return an address on the
// requested form since the USB and FireWire bus can contain multiple devices.
// In a second attempt to locate the drive a search is performed by the device name.
// If two identical devices are connected (same revision) to the system there will
// be a conflict. Maybe I should solve this by using the ASPI driver?
if (!SCSIGetDriveLetter(pDeviceInfo->szVendor,pDeviceInfo->szIdentification,
pDeviceInfo->szRevision,szDriveLetter[0]))
{
bFoundDriveLetter = false;
}
}
if (bFoundDriveLetter)
{
// Validate the project files.
g_ProjectManager.VerifyCompilation(g_pProgressDlg,szDriveLetter);
}
else
{
// Add to progress dialog instead?
MessageBox(hWndParent,_T("InfraRecorder was unable to determine the drive letter of your recorder. The disc can not be verified."),lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
}
// We're done.
g_pProgressDlg->set_progress(100);
g_pProgressDlg->set_status(lngGetString(PROGRESS_DONE));
g_pProgressDlg->NotifyCompleted();
return 0;
}*/
================================================
FILE: src/app/action_manager.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
class CActionManager
{
private:
class CEraseParam
{
public:
bool m_bNotifyCompleted;
CEraseParam(bool bNotifyCompleted) : m_bNotifyCompleted(bNotifyCompleted) {}
};
static DWORD WINAPI BurnCompilationThread(LPVOID lpThreadParameter);
static DWORD WINAPI CreateImageThread(LPVOID lpThreadParameter);
static DWORD WINAPI CopyDiscOnFlyThread(LPVOID lpThreadParameter);
static DWORD WINAPI CopyDiscThread(LPVOID lpThreadParameter);
static DWORD WINAPI EraseThread(LPVOID lpThreadParameter);
void QuickErase(ckmmc::Device &Device);
bool QuickEraseQuery(ckmmc::Device &Device,HWND hWndParent);
public:
CActionManager();
~CActionManager();
INT_PTR BurnCompilation(HWND hWndParent,bool bAppMode);
INT_PTR CreateImage(HWND hWndParent,bool bAppMode);
INT_PTR BurnImage(HWND hWndParent,bool bAppMode);
INT_PTR BurnImageEx(HWND hWndParent,bool bAppMode,const TCHAR *szFilePath);
INT_PTR CopyDisc(HWND hWndParent,bool bAppMode);
INT_PTR CopyImage(HWND hWndParent,bool bAppMode);
INT_PTR ManageTracks(bool bAppMode);
INT_PTR Erase(HWND hWndParent,bool bAppMode);
INT_PTR Fixate(HWND hWndParent,bool bAppMode);
// For testing purposes only.
//int VerifyCompilation(HWND hWndParent);
};
extern CActionManager g_ActionManager;
================================================
FILE: src/app/advanced_progress.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "advanced_progress.hh"
void CAdvancedProgress::SetBuffer(int iPercent)
{
// Do nothing.
}
================================================
FILE: src/app/advanced_progress.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#define PROGRESS_STRINGBUFFER_SIZE 256
class CAdvancedProgress : public ckcore::Progress
{
protected:
// Should be used by inheritors when parsing the variable argument list passed
// to the AddLogEntry and SetStatus functions.
TCHAR m_szStringBuffer[PROGRESS_STRINGBUFFER_SIZE];
public:
// Called when the operation is complteted.
virtual void NotifyCompleted() = 0;
// Should be set to true when a real writing process is started.
virtual void SetRealMode(bool bRealMode) = 0;
// Not forced to be implemented by inheritor.
virtual void SetBuffer(int iPercent);
virtual void AllowReload() = 0;
virtual void AllowCancel(bool bAllow) = 0;
virtual bool RequestNextDisc() = 0;
// Starts the smoke effect.
virtual void StartSmoke() = 0;
};
================================================
FILE: src/app/atl_compat.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
inline ATL::CWindow GetParentWindow(const ATL::CWindow *pWnd)
{
// Version 3.0 of the ATL library does not have the CWindow::GetParent()
// overload that returns a CWindow object. Unfortunately, ATL 3.0 is the
// latest freely available version of the ATL library, it comes with the
// Microsoft Windows Server 2003 R2 Platform SDK. Supporting ATL 3.0 means
// you can compile InfraRecorder with Visual Studio 2005 Express, which is
// also free. WTL 8.0 also supports ATL 3.0 / Visual Studio 2005 Express,
// see the bundled readme file.
//
// The missing GetParent() overload is actually very handy, and this routine
// is a good workaround that works on both ATL 3.0 and the newer versions.
//
// An alternative to this routine would be to manually add the missing
// overload to the ATL 3.0 headers. This is however cumbersome for the casual
// developer who just wants to compile the project once. Modifying the
// standard headers may also cause compilation trouble in other projects or
// with other versions of Visual Studio.
#if _ATL_VER <= 0x0300
return ATL::CWindow(pWnd->GetParent());
#else
// Use the one that comes with ATL.
return pWnd->GetParent();
#endif
}
#if _ATL_VER <= 0x0300
#pragma comment(lib,"shell32")
#pragma comment(lib,"gdi32")
#pragma comment(lib,"comdlg32")
#endif
================================================
FILE: src/app/control/custom_button.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "resource.h"
#include "custom_button.hh"
CCustomButton::CCustomButton(unsigned short usCoverPng,int iCoverLeft,int iCoverRight) :
m_State(STATE_NORMAL),m_iCoverLeft(iCoverLeft),m_iCoverTop(iCoverRight)
{
// Load the images.
m_CoverImage.Open(usCoverPng);
m_NormalImage.Open(IDR_BUTTONNPNG);
m_FocusImage.Open(IDR_BUTTONFPNG);
m_HoverImage.Open(IDR_BUTTONHPNG);
m_HoverFocusImage.Open(IDR_BUTTONHFPNG);
}
CCustomButton::~CCustomButton()
{
}
LRESULT CCustomButton::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.hwndTrack = m_hWnd;
tme.dwFlags = TME_LEAVE;
tme.dwHoverTime = 10000;
bool bMouseHover = TrackMouseEvent(&tme) == TRUE;
if (bMouseHover && m_State == STATE_NORMAL)
{
m_State = STATE_HOT;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
return 0;
}
LRESULT CCustomButton::OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
m_State = STATE_NORMAL;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
return 0;
}
LRESULT CCustomButton::OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_State == STATE_HOT)
{
m_State = STATE_DOWN;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
return 0;
}
LRESULT CCustomButton::OnLButtonUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_State == STATE_DOWN)
{
m_State = STATE_HOT;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
return 0;
}
LRESULT CCustomButton::OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
return 0;
}
void CCustomButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDCHandle dc = lpDrawItemStruct->hDC;
RECT rcClient;
GetClientRect(&rcClient);
FillRect(dc,&rcClient,GetSysColorBrush(COLOR_WINDOW));
switch (m_State)
{
case STATE_NORMAL:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_FocusImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_NormalImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
case STATE_HOT:
case STATE_DOWN:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_HoverFocusImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_HoverImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
}
m_CoverImage.Draw(dc,m_iCoverLeft,m_iCoverTop,rcClient.right,rcClient.bottom);
ReleaseDC(dc);
}
================================================
FILE: src/app/control/custom_button.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include "png_file.hh"
class CCustomButton : public CWindowImpl,
public COwnerDraw
{
private:
enum eState
{
STATE_NORMAL,
STATE_HOT,
STATE_DOWN
};
eState m_State;
int m_iCoverLeft;
int m_iCoverTop;
CPngFile m_CoverImage;
CPngFile m_NormalImage;
CPngFile m_FocusImage;
CPngFile m_HoverImage;
CPngFile m_HoverFocusImage;
public:
DECLARE_WND_CLASS(_T("ckButton"));
CCustomButton(unsigned short usCoverPng,int iCoverLeft,int iCoverRight);
~CCustomButton();
BEGIN_MSG_MAP(CCustomButton)
MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WM_MOUSELEAVE,OnMouseLeave)
//MESSAGE_HANDLER(WM_LBUTTONDOWN,OnLButtonDown)
//MESSAGE_HANDLER(WM_LBUTTONUP,OnLButtonUp)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkgnd)
CHAIN_MSG_MAP_ALT(COwnerDraw,1)
END_MSG_MAP()
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
// For ownerdraw.
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};
================================================
FILE: src/app/control/custom_combo_box.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "custom_combo_box.hh"
/*
A custom combo box control that provides item icons to the left of the text.
The data property determines the icon index of an combo box item.
To get proper dimensions:
m_TrackCombo.SetItemHeight( 0,16);
m_TrackCombo.SetItemHeight(-1,16); // Static item.
*/
CCustomComboBox::CCustomComboBox() : m_hImageList(NULL),m_iImageList(0)
{
}
CCustomComboBox::~CCustomComboBox()
{
}
void CCustomComboBox::SetImageList(HIMAGELIST hImageList,int iImageList)
{
m_hImageList = hImageList;
m_iImageList = iImageList;
}
void CCustomComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDCHandle dc = lpDrawItemStruct->hDC;
RECT rcItem = lpDrawItemStruct->rcItem;
bool bSelected = (lpDrawItemStruct->itemState & ODS_SELECTED) != 0;
bool bFocused = (lpDrawItemStruct->itemState & ODS_FOCUS) != 0;
bool bDisabled = (lpDrawItemStruct->itemState & ODS_DISABLED) != 0;
int iBackgroundColor;
if (bDisabled)
iBackgroundColor = COLOR_BTNFACE;
else if (bSelected)
iBackgroundColor = COLOR_HIGHLIGHT;
else
iBackgroundColor = COLOR_WINDOW;
// Draw the background.
HBRUSH hBackground = ::GetSysColorBrush(iBackgroundColor);
dc.FillRect(&rcItem,hBackground);
// Draw icon.
if (!bDisabled && m_hImageList != NULL)
{
ImageList_Draw(m_hImageList,(int)lpDrawItemStruct->itemData,dc,
rcItem.left,
rcItem.top,ILD_TRANSPARENT);
rcItem.left += 16 + CUSTOMCOMBO_ICONSPACING;
}
// Draw the text.
HFONT hOldFont = (HFONT)dc.SelectFont(AtlGetDefaultGuiFont());
int iTextColor;
if (bDisabled)
iTextColor = COLOR_GRAYTEXT;
else if (bSelected)
iTextColor = COLOR_HIGHLIGHTTEXT;
else
iTextColor = COLOR_WINDOWTEXT;
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(::GetSysColor(iTextColor));
TCHAR szText[128];
if (GetLBTextLen(lpDrawItemStruct->itemID) >= (sizeof(szText) / sizeof(TCHAR) - 1))
{
TCHAR *szVarText = new TCHAR[GetLBTextLen(lpDrawItemStruct->itemID) + 1];
GetLBText(lpDrawItemStruct->itemID,szVarText);
dc.DrawText(szVarText,lstrlen(szVarText),&rcItem,DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS | DT_SINGLELINE);
delete [] szVarText;
}
else
{
GetLBText(lpDrawItemStruct->itemID,szText);
dc.DrawText(szText,lstrlen(szText),&rcItem,DT_LEFT | DT_VCENTER | DT_END_ELLIPSIS | DT_SINGLELINE);
}
if (bFocused)
dc.DrawFocusRect(&rcItem);
dc.SelectFont(hOldFont);
}
================================================
FILE: src/app/control/custom_combo_box.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#define CUSTOMCOMBO_ICONSPACING 1
class CCustomComboBox : public CWindowImpl,
public COwnerDraw
{
private:
HIMAGELIST m_hImageList;
int m_iImageList;
public:
DECLARE_WND_CLASS(_T("ckComboBox"));
CCustomComboBox();
~CCustomComboBox();
BEGIN_MSG_MAP(CCustomComboBox)
CHAIN_MSG_MAP_ALT(COwnerDraw,1)
END_MSG_MAP()
LRESULT OnChar(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
void SetImageList(HIMAGELIST hImageList,int iImageList);
// For ownerdraw.
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};
================================================
FILE: src/app/control/custom_container.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "custom_container.hh"
#include "settings.hh"
#include "ctrl_messages.hh"
#include "main_frm.hh"
CCustomContainer::CCustomContainer()
{
m_iHeaderHeight = 0;
m_hWndCustomDraw = NULL;
m_iControlID = -1;
}
CCustomContainer::~CCustomContainer()
{
}
void CCustomContainer::SetCustomDrawHandler(HWND hWndCustomDraw,int iID)
{
m_hWndCustomDraw = hWndCustomDraw;
m_iControlID = iID;
}
void CCustomContainer::SetClient(HWND hWndClient)
{
m_ClientWindow = hWndClient;
UpdateLayout();
}
void CCustomContainer::SetImageList(HIMAGELIST hImageList)
{
m_ToolBar.SetImageList(hImageList);
//m_ToolBar.SetButtonStructSize();
}
void CCustomContainer::UpdateLayout()
{
RECT rcClient;
GetClientRect(&rcClient);
UpdateLayout(rcClient.right,rcClient.bottom);
}
void CCustomContainer::UpdateLayout(int iWidth,int iHeight)
{
RECT rcHeader = { 0,0,iWidth,m_iHeaderHeight };
if (m_ClientWindow.m_hWnd != NULL)
m_ClientWindow.SetWindowPos(NULL,0,m_iHeaderHeight,iWidth,iHeight - m_iHeaderHeight,SWP_NOZORDER);
else
rcHeader.bottom = iHeight;
InvalidateRect(&rcHeader);
}
void CCustomContainer::AddToolBarSeparator()
{
TBBUTTON tbButton;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_SEP;
tbButton.iBitmap = 0;
tbButton.idCommand = 0;
tbButton.iString = 0;
tbButton.dwData = 0;
m_ToolBar.InsertButton(m_ToolBar.GetButtonCount(),&tbButton);
}
void CCustomContainer::AddToolBarButton(int iCommand,int iBitmap)
{
TBBUTTON tbButton;
tbButton.fsState = TBSTATE_ENABLED;
tbButton.fsStyle = TBSTYLE_BUTTON;
tbButton.iBitmap = iBitmap;
tbButton.idCommand = iCommand;
tbButton.iString = NULL;
tbButton.dwData = 0;
m_ToolBar.InsertButton(m_ToolBar.GetButtonCount(),&tbButton);
}
void CCustomContainer::UpdateToolBar()
{
// Update the toolbar position.
int iToolBarWidth = 0;
RECT rcButton;
for (int i = 0; i < m_ToolBar.GetButtonCount(); i++)
{
m_ToolBar.GetItemRect(i,&rcButton);
iToolBarWidth += rcButton.right - rcButton.left;
}
m_iHeaderHeight = HIWORD(m_ToolBar.GetButtonSize());
m_ToolBar.SetWindowPos(NULL,0,0,iToolBarWidth,m_iHeaderHeight,0);
}
void CCustomContainer::EnableToolbarButton(int iID,bool bEnable)
{
m_ToolBar.EnableButton(iID,bEnable);
}
LRESULT CCustomContainer::OnCreate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
RECT rcToolBar = { 0,0,100,100 };
m_ToolBar.Create(m_hWnd,rcToolBar,NULL,ATL_SIMPLE_TOOLBAR_PANE_STYLE,NULL);
m_ToolBar.SetButtonStructSize();
return 0;
}
LRESULT CCustomContainer::OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
UpdateLayout(GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam));
return 0;
}
LRESULT CCustomContainer::OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_ClientWindow.m_hWnd != NULL)
m_ClientWindow.SetFocus();
return 0;
}
LRESULT CCustomContainer::OnCommand(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// Redirect messages to the parent.
if (m_ToolBar.m_hWnd != NULL && (HWND)lParam == m_ToolBar.m_hWnd)
return ::SendMessage(GetParent(),WM_COMMAND,wParam,(LPARAM)m_hWnd);
bHandled = false;
return TRUE;
}
LRESULT CCustomContainer::OnGetIShellBrowser(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// This is very important, we need to redirect this message to the main frame that can return
// the correct IShellBrowser object. If we do not answer to this message the CreateViewObject
// function call will fail on Windows 98 systems for all other directories than the desktop.
bHandled = TRUE;
return ::SendMessage(*g_pMainFrame,WM_GETISHELLBROWSER,wParam,lParam);
}
LRESULT CCustomContainer::OnCustomDraw(int idCtrl,LPNMHDR pnmh,BOOL &bHandled)
{
if (m_hWndCustomDraw != NULL && idCtrl == m_iControlID)
return ::SendMessage(m_hWndCustomDraw,WM_CONTROLCUSTOMDRAW,0,(LPARAM)pnmh);
bHandled = false;
return CDRF_DODEFAULT;
}
LRESULT CCustomContainer::OnToolBarGetInfo(int idCtrl,LPNMHDR pNMH,BOOL &bHandled)
{
bHandled = true;
// The string ID is the same as the button ID.
LPTOOLTIPTEXT pTipText = (LPTOOLTIPTEXT)pNMH;
//pTipText->lpszText = MAKEINTRESOURCE(pTipText->hdr.idFrom);
// Try to load translated string.
if (g_LanguageSettings.m_pLngProcessor != NULL)
{
// Make sure that there is a hint translation section.
if (g_LanguageSettings.m_pLngProcessor->EnterSection(_T("hint")))
{
TCHAR *szStrValue;
if (g_LanguageSettings.m_pLngProcessor->GetValuePtr((unsigned long)pTipText->hdr.idFrom,szStrValue))
{
pTipText->lpszText = szStrValue;
return 0;
}
}
}
// I am not sure if I want the tool tips to be displayed on the toolbar.
// This method is also to slow.
/*TCHAR szBuffer[256];
LoadString(_Module.GetResourceInstance(),pTipText->hdr.idFrom,szBuffer,sizeof(szBuffer) / sizeof(TCHAR));
m_StatusBar.SetPaneText(ID_DEFAULT_PANE,szBuffer);*/
pTipText->lpszText = MAKEINTRESOURCE(pTipText->hdr.idFrom);
return 0;
}
int CCustomContainer::GetHeaderHeight()
{
return m_iHeaderHeight;
}
================================================
FILE: src/app/control/custom_container.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#ifndef WM_GETISHELLBROWSER
#define WM_GETISHELLBROWSER WM_USER + 7
#endif
class CCustomContainer : public CWindowImpl
{
private:
CToolBarCtrl m_ToolBar;
CWindow m_ClientWindow;
int m_iHeaderHeight;
// Handle to the control that should receivce custom draw messages.
HWND m_hWndCustomDraw;
int m_iControlID;
public:
static CWndClassInfo &GetWndClassInfo()
{
static CWndClassInfo wc =
{
{
sizeof(WNDCLASSEX),CS_DBLCLKS,
StartWindowProc,0,0,NULL,NULL,NULL,
GetSysColorBrush(COLOR_BTNFACE),NULL,
_T("ckCustomContainer"),NULL
},
NULL,NULL,IDC_ARROW,TRUE,0,_T("")
};
return wc;
}
CCustomContainer();
~CCustomContainer();
void SetCustomDrawHandler(HWND hWndCustomDraw,int iID);
BEGIN_MSG_MAP(CCustomContainer)
MESSAGE_HANDLER(WM_CREATE,OnCreate)
MESSAGE_HANDLER(WM_SIZE,OnSize)
MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus)
MESSAGE_HANDLER(WM_COMMAND,OnCommand)
MESSAGE_HANDLER(WM_GETISHELLBROWSER,OnGetIShellBrowser)
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW,OnCustomDraw)
NOTIFY_CODE_HANDLER(TTN_GETDISPINFO,OnToolBarGetInfo)
FORWARD_NOTIFICATIONS()
END_MSG_MAP()
LRESULT OnCreate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnCommand(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnCustomDraw(int idCtrl,LPNMHDR pnmh,BOOL &bHandled);
LRESULT OnGetIShellBrowser(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnToolBarGetInfo(int idCtrl,LPNMHDR pNMH,BOOL &bHandled);
void SetClient(HWND hWndClient);
void SetImageList(HIMAGELIST hImageList);
void UpdateLayout();
void UpdateLayout(int iWidth,int iHeight);
void AddToolBarSeparator();
void AddToolBarButton(int iCommand,int iBitmap);
void UpdateToolBar();
void EnableToolbarButton(int iID,bool bEnable);
int GetHeaderHeight();
};
================================================
FILE: src/app/control/custom_edit_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "custom_edit_ctrl.hh"
CCustomEditCtrl::CCustomEditCtrl()
{
}
CCustomEditCtrl::~CCustomEditCtrl()
{
}
/*
CCustomEditCtrl::OnChar
-----------------------
This edit control works like a regular edit control except that it does not
allow the | (pipe) character.
*/
LRESULT CCustomEditCtrl::OnChar(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
bHandled = wParam == '|';
return 0;
}
================================================
FILE: src/app/control/custom_edit_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
class CCustomEditCtrl : public CWindowImpl
{
public:
CCustomEditCtrl();
~CCustomEditCtrl();
BEGIN_MSG_MAP(CCustomEditCtrl)
MESSAGE_HANDLER(WM_CHAR,OnChar)
END_MSG_MAP()
LRESULT OnChar(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/control/custom_header_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "custom_header_ctrl.hh"
#include "project_manager.hh"
#include "tree_manager.hh"
CCustomHeaderCtrl::CCustomHeaderCtrl()
{
m_bSortUp = true;
m_iSortCol = 0;
}
void CCustomHeaderCtrl::SetSortColumn(unsigned int uiColIndex,bool bSortUp)
{
m_bSortUp = bSortUp;
m_iSortCol = uiColIndex;
HDITEM hdColumn;
hdColumn.mask = HDI_FORMAT;
GetItem(m_iSortCol,&hdColumn);
if (m_bSortUp)
{
hdColumn.fmt |= HDF_SORTUP;
hdColumn.fmt &= ~HDF_SORTDOWN;
}
else
{
hdColumn.fmt |= HDF_SORTDOWN;
hdColumn.fmt &= ~HDF_SORTUP;
}
SetItem(m_iSortCol,&hdColumn);
}
LRESULT CCustomHeaderCtrl::OnSetSortColumn(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
SetSortColumn((unsigned int)wParam,lParam == 0);
return 0;
}
void CCustomHeaderCtrl::ColumnClick(unsigned int uiColIndex)
{
if (m_iSortCol == uiColIndex)
{
// Set the new sort arrow.
SetSortColumn(uiColIndex,!m_bSortUp);
}
else
{
// Remove the sort arrow from the previous column.
HDITEM hdColumn;
hdColumn.mask = HDI_FORMAT;
GetItem(m_iSortCol,&hdColumn);
hdColumn.fmt &= ~(m_bSortUp ? HDF_SORTUP : HDF_SORTDOWN);
SetItem(m_iSortCol,&hdColumn);
// Set the new sort arrow.
SetSortColumn(uiColIndex,true);
}
// Do the sorting.
g_TreeManager.GetCurrentNode()->Sort(uiColIndex,m_bSortUp,g_ProjectManager.GetViewType() != PROJECTVIEWTYPE_DATA);
g_TreeManager.Refresh();
}
================================================
FILE: src/app/control/custom_header_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include "resource.h"
#include "ctrl_messages.hh"
#if (_WIN32_WINNT < 0x501)
#define HDF_SORTUP 0x0400
#define HDF_SORTDOWN 0x0200
#endif
class CCustomHeaderCtrl : public CWindowImpl
{
private:
bool m_bSortUp;
unsigned int m_iSortCol;
void SetSortColumn(unsigned int uiColIndex,bool bSortUp);
public:
CCustomHeaderCtrl();
BEGIN_MSG_MAP(CCustomHeaderCtrl)
MESSAGE_HANDLER(WM_CHC_SETSORTCOLUMN,OnSetSortColumn)
END_MSG_MAP()
LRESULT OnSetSortColumn(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
void ColumnClick(unsigned int uiColIndex);
};
================================================
FILE: src/app/control/custom_multi_button.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "resource.h"
#include "custom_multi_button.hh"
CCustomMultiButton::CCustomMultiButton(long lCtrlMainId,long lCtrlSub1Id,long lCtrlSub2Id,
unsigned short usCoverPng,int iCoverLeft,int iCoverRight) :
m_lCtrlMainId(lCtrlMainId),m_lCtrlSub1Id(lCtrlSub1Id),m_lCtrlSub2Id(lCtrlSub2Id),
m_State(STATE_NORMAL),m_iCoverLeft(iCoverLeft),m_iCoverTop(iCoverRight)
{
// Load the images.
m_CoverImage.Open(usCoverPng);
m_NormalImage.Open(IDR_MBUTTONNPNG);
m_FocusImage.Open(IDR_MBUTTONFPNG);
m_HoverImage.Open(IDR_MBUTTONHPNG);
m_HoverSub1Image.Open(IDR_MBUTTONHS1PNG);
m_HoverSub2Image.Open(IDR_MBUTTONHS2PNG);
m_HoverFocusImage.Open(IDR_MBUTTONFPNG);
m_HoverFocusSub1Image.Open(IDR_MBUTTONHFS1PNG);
m_HoverFocusSub2Image.Open(IDR_MBUTTONHFS2PNG);
}
CCustomMultiButton::~CCustomMultiButton()
{
}
LRESULT CCustomMultiButton::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.hwndTrack = m_hWnd;
tme.dwFlags = TME_LEAVE;
tme.dwHoverTime = 10000;
TrackMouseEvent(&tme);
int iPosX = GET_X_LPARAM(lParam);
int iPosY = GET_Y_LPARAM(lParam);
eState NewState;
if (iPosX < SPLITTER_X)
NewState = STATE_HOTMAIN;
else if (iPosY < SPLITTER_Y)
NewState = STATE_HOTSUB1;
else
NewState = STATE_HOTSUB2;
if (NewState != m_State)
{
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
m_State = NewState;
return 0;
}
LRESULT CCustomMultiButton::OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
m_State = STATE_NORMAL;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
return 0;
}
LRESULT CCustomMultiButton::OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_State == STATE_HOTMAIN ||
m_State == STATE_HOTSUB1 ||
m_State == STATE_HOTSUB2)
{
m_State = STATE_DOWN;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
return 0;
}
LRESULT CCustomMultiButton::OnLButtonUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_State == STATE_DOWN)
{
m_State = STATE_HOTMAIN;
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
// Take action.
int iPosX = GET_X_LPARAM(lParam);
int iPosY = GET_Y_LPARAM(lParam);
if (iPosX < SPLITTER_X)
::PostMessage(GetParent(),WM_COMMAND,m_lCtrlMainId,0);
else if (iPosY < SPLITTER_Y)
::PostMessage(GetParent(),WM_COMMAND,m_lCtrlSub1Id,0);
else
::PostMessage(GetParent(),WM_COMMAND,m_lCtrlSub2Id,0);
return 0;
}
LRESULT CCustomMultiButton::OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
return 0;
}
void CCustomMultiButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDCHandle dc = lpDrawItemStruct->hDC;
RECT rcClient;
GetClientRect(&rcClient);
FillRect(dc,&rcClient,GetSysColorBrush(COLOR_WINDOW));
switch (m_State)
{
case STATE_NORMAL:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_FocusImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_NormalImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
case STATE_HOTMAIN:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_HoverFocusImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_HoverImage.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
case STATE_HOTSUB1:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_HoverFocusSub1Image.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_HoverSub1Image.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
case STATE_HOTSUB2:
if (lpDrawItemStruct->itemState & ODS_FOCUS)
m_HoverFocusSub2Image.Draw(dc,0,0,rcClient.right,rcClient.bottom);
else
m_HoverSub2Image.Draw(dc,0,0,rcClient.right,rcClient.bottom);
break;
}
m_CoverImage.Draw(dc,m_iCoverLeft,m_iCoverTop,rcClient.right,rcClient.bottom);
ReleaseDC(dc);
}
================================================
FILE: src/app/control/custom_multi_button.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include "png_file.hh"
class CCustomMultiButton : public CWindowImpl,
public COwnerDraw
{
private:
enum eState
{
STATE_NORMAL,
STATE_HOTMAIN,
STATE_HOTSUB1,
STATE_HOTSUB2,
STATE_DOWN
};
enum
{
SPLITTER_X = 99,
SPLITTER_Y = 36
};
eState m_State;
long m_lCtrlMainId;
long m_lCtrlSub1Id;
long m_lCtrlSub2Id;
int m_iCoverLeft;
int m_iCoverTop;
CPngFile m_CoverImage;
CPngFile m_NormalImage;
CPngFile m_FocusImage;
CPngFile m_HoverImage;
CPngFile m_HoverSub1Image;
CPngFile m_HoverSub2Image;
CPngFile m_HoverFocusImage;
CPngFile m_HoverFocusSub1Image;
CPngFile m_HoverFocusSub2Image;
public:
DECLARE_WND_CLASS(_T("ckMultiButton"));
CCustomMultiButton(long lCtrlMainId,long lCtrlSub1Id,long lCtrlSub2Id,
unsigned short usCoverPng,int iCoverLeft,int iCoverRight);
~CCustomMultiButton();
BEGIN_MSG_MAP(CCustomMultiButton)
MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WM_MOUSELEAVE,OnMouseLeave)
MESSAGE_HANDLER(WM_LBUTTONDOWN,OnLButtonDown)
MESSAGE_HANDLER(WM_LBUTTONUP,OnLButtonUp)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkgnd)
CHAIN_MSG_MAP_ALT(COwnerDraw,1)
END_MSG_MAP()
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
// For ownerdraw.
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};
================================================
FILE: src/app/control/custom_toolbar_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "custom_toolbar_ctrl.hh"
#include "main_frm.hh"
CCustomToolBarCtrl::CCustomToolBarCtrl()
{
}
CCustomToolBarCtrl::~CCustomToolBarCtrl()
{
}
LRESULT CCustomToolBarCtrl::OnRButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
POINT ptCursor;
GetCursorPos(&ptCursor);
HMENU hToolBarsMenu = g_pMainFrame->GetToolBarsMenu();
// Force the popup menu items to update. This is needed since WTL seems to be lazy
// and only want to refresh the corresponding main menu items when needed.
CMainFrame::_AtlUpdateUIData UIData;
UIData.m_lpData = NULL;
UIData.m_wState = (WORD)g_pMainFrame->UIGetState(ID_VIEW_STANDARDTOOLBAR);
g_pMainFrame->UIUpdateMenuBarElement(ID_VIEW_STANDARDTOOLBAR,&UIData,hToolBarsMenu);
// Show the popup menu.
TrackPopupMenuEx(hToolBarsMenu,0,ptCursor.x,ptCursor.y,m_hWnd,NULL);
bHandled = false;
return 0;
}
LRESULT CCustomToolBarCtrl::OnLButtonDblClk(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// We don't want to display the original customize toolbar dialog when the
// toolbar is double-clicked on.
bHandled = true;
return 0;
}
================================================
FILE: src/app/control/custom_toolbar_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
class CCustomToolBarCtrl : public CWindowImpl
{
public:
DECLARE_WND_CLASS(_T("ckToolBar"));
CCustomToolBarCtrl();
~CCustomToolBarCtrl();
BEGIN_MSG_MAP(CCustomToolBarCtrl)
MESSAGE_HANDLER(WM_RBUTTONDOWN,OnRButtonDown)
MESSAGE_HANDLER(WM_LBUTTONDBLCLK,OnLButtonDblClk)
END_MSG_MAP()
LRESULT OnRButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonDblClk(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/control/double_buffered_static.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "double_buffered_static.hh"
CDoubleBufferedStatic::CDoubleBufferedStatic()
{
m_Text.reserve(DOUBLEBUFFEREDSTATIC_RESERVE_LENGTH);
}
CDoubleBufferedStatic::~CDoubleBufferedStatic()
{
}
void CDoubleBufferedStatic::SetWindowText(const TCHAR *szWindowText)
{
m_Text = szWindowText;
RedrawWindow();
}
LRESULT CDoubleBufferedStatic::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
CPaintDC dc(m_hWnd);
RECT rcClient;
GetClientRect(&rcClient);
// Setup double buffering.
HDC hMemDC = CreateCompatibleDC(dc);
HBITMAP hMemBitmap = CreateCompatibleBitmap(dc,rcClient.right,rcClient.bottom);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC,hMemBitmap);
// Draw the background.
FillRect(hMemDC,&rcClient,GetSysColorBrush(COLOR_BTNFACE));
// Draw the text.
HFONT hOldFont = (HFONT)SelectObject(hMemDC,AtlGetDefaultGuiFont());
::SetTextColor(hMemDC,GetSysColor(COLOR_BTNTEXT));
::SetBkColor(hMemDC,GetSysColor(COLOR_BTNFACE));
DrawText(hMemDC,m_Text.c_str(),(int)m_Text.length(),&rcClient,
DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE);
SelectObject(hMemDC,hOldFont);
BitBlt(dc,0,0,rcClient.right,rcClient.bottom,hMemDC,0,0,SRCCOPY);
SelectObject(hMemDC,hOldBitmap);
DeleteDC(hMemDC);
DeleteObject(hMemBitmap);
bHandled = true;
return 0;
}
LRESULT CDoubleBufferedStatic::OnEraseBkGnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
bHandled = true;
return 0;
}
================================================
FILE: src/app/control/double_buffered_static.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include
#define DOUBLEBUFFEREDSTATIC_RESERVE_LENGTH 256
class CDoubleBufferedStatic : public CWindowImpl
{
private:
tstring m_Text;
public:
CDoubleBufferedStatic();
~CDoubleBufferedStatic();
void SetWindowText(const TCHAR *szWindowText);
BEGIN_MSG_MAP(CDoubleBufferedStatic)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkGnd)
END_MSG_MAP()
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkGnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/control/drop_down_button.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "drop_down_button.hh"
CDropDownButton::CDropDownButton(unsigned int uiMenuID,bool bDrawArrow)
{
m_bDrawArrow = bDrawArrow;
// Menu.
m_hMenu = LoadMenu(_Module.GetResourceInstance(),MAKEINTRESOURCE(uiMenuID));
// Font used for the arrow (if unthemed only).
CFont apa;
CLogFont lf = AtlGetDefaultGuiFont();
lstrcpy(lf.lfFaceName,_T("Webdings"));
lf.lfCharSet = SYMBOL_CHARSET;
lf.lfHeight = 18;
m_hWebdingsFont = CreateFontIndirect(&lf);
// Theme data.
m_hTheme = NULL;
}
CDropDownButton::~CDropDownButton()
{
// Menu.
DestroyMenu(m_hMenu);
// Arrow font.
DeleteObject(m_hWebdingsFont);
// Unload theme data.
if (m_hTheme != NULL)
g_VisualStyles.CloseThemeData(m_hTheme);
}
HMENU CDropDownButton::GetMenu()
{
return m_hMenu;
}
BOOL CDropDownButton::SubclassWindow(HWND hWnd)
{
BOOL bResult = CWindowImpl::SubclassWindow(hWnd);
if (m_bDrawArrow)
{
SetButtonStyle(g_VisualStyles.IsAppThemed() ? BS_PUSHBUTTON : BS_OWNERDRAW);
// Load theme data.
if (g_VisualStyles.IsAppThemed())
m_hTheme = g_VisualStyles.OpenThemeData(m_hWnd,L"TOOLBAR");
}
return bResult;
}
void CDropDownButton::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
CDCHandle dc = lpDIS->hDC;
RECT rcItem = lpDIS->rcItem;
bool bEnabled = (lpDIS->itemState & ODS_DISABLED) == 0;
bool bFocused = (lpDIS->itemState & ODS_FOCUS) != 0;
// Draw the button.
RECT rcButton = rcItem;
if (bFocused)
{
dc.Draw3dRect(&rcButton,::GetSysColor(COLOR_3DDKSHADOW),::GetSysColor(COLOR_3DDKSHADOW));
::InflateRect(&rcButton,-1, -1);
}
unsigned int uiState = 0;
if (lpDIS->itemState & ODS_SELECTED)
{
uiState |= DFCS_PUSHED;
::OffsetRect(&rcItem,1,1);
}
if (!bEnabled)
uiState |= DFCS_INACTIVE;
::DrawFrameControl(dc,&rcButton,DFC_BUTTON,DFCS_BUTTONPUSH | uiState);
// Draw the text.
TCHAR szText[DROPDOWNBUTTON_MAX_TEXT_SIZE];
GetWindowText(szText,DROPDOWNBUTTON_MAX_TEXT_SIZE - 1);
HFONT hOldFont = dc.SelectFont(GetFont());
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(::GetSysColor(bEnabled ? COLOR_BTNTEXT : COLOR_GRAYTEXT));
if (!bEnabled)
{
RECT rcText = rcItem;
RECT rcBound = rcText;
dc.DrawText(szText,-1,&rcBound,DT_SINGLELINE | DT_LEFT | DT_TOP | DT_CALCRECT);
::OffsetRect(&rcText,(rcText.right - rcBound.right) / 2, (rcText.bottom - rcBound.bottom) / 2);
::DrawState(dc,NULL,NULL,(LPARAM)szText,0,rcText.left,rcText.top,rcText.right,rcText.bottom,DST_PREFIXTEXT | DSS_DISABLED);
}
else
{
RECT rcText = rcItem;
dc.DrawText(szText,-1,&rcText,DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}
// Draw the separator.
RECT rcSeparator = { rcItem.right - 22,rcItem.top + 5,rcItem.right - 20,rcItem.bottom - 5 };
dc.Draw3dRect(&rcSeparator,::GetSysColor(COLOR_BTNSHADOW),::GetSysColor(COLOR_BTNHIGHLIGHT));
dc.SelectFont(m_hWebdingsFont);
RECT rcArrow = { rcItem.right - 18,rcItem.top,rcItem.right,rcItem.bottom };
dc.DrawText(_T("\x36"),1,&rcArrow,DT_SINGLELINE | DT_LEFT | DT_VCENTER);
HBRUSH hOldBrush = dc.SelectBrush((HBRUSH)::GetStockObject(HOLLOW_BRUSH));
::InflateRect(&rcButton,-3,-3);
// Draw the focus rectangle.
if (bFocused)
dc.DrawFocusRect(&rcButton);
dc.SelectBrush(hOldBrush);
dc.SelectFont(hOldFont);
}
DWORD CDropDownButton::OnPrePaint(int idCtrl,LPNMCUSTOMDRAW lpNMCD)
{
return CDRF_NOTIFYPOSTPAINT;
}
DWORD CDropDownButton::OnPostPaint(int idCtrl,LPNMCUSTOMDRAW lpNMCD)
{
CDCHandle dc = lpNMCD->hdc;
RECT rcButton = lpNMCD->rc;
bool bEnabled = (lpNMCD->uItemState & (CDIS_DISABLED | CDIS_GRAYED)) == 0;
// Draw the separator
RECT rcSeparator = { rcButton.right - 21,rcButton.top + 4,rcButton.right - 19,rcButton.bottom - 4 };
g_VisualStyles.DrawThemeBackground(m_hTheme,dc,TP_SEPARATOR,TS_NORMAL,&rcSeparator,NULL);
// Draw the arrow.
RECT rcArrow = { rcButton.right - 22,rcButton.top,rcButton.right,rcButton.bottom };
g_VisualStyles.DrawThemeBackground(m_hTheme,dc, TP_SPLITBUTTONDROPDOWN,bEnabled ? TS_NORMAL : TS_DISABLED,&rcArrow,NULL);
return CDRF_DODEFAULT;
}
LRESULT CDropDownButton::OnClicked(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
RECT rcButton;
GetWindowRect(&rcButton);
int iID = TrackPopupMenuEx(GetSubMenu(m_hMenu,0),TPM_NONOTIFY | TPM_RETURNCMD,
rcButton.left,rcButton.bottom,m_hWnd,NULL);
::PostMessage(GetParent(),WM_COMMAND,iID,0);
bHandled = false;
return 0;
}
================================================
FILE: src/app/control/drop_down_button.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include // BEGIN_MSG_MAP_EX
#include "visual_styles.hh"
#define DROPDOWNBUTTON_MAX_TEXT_SIZE 64
class CDropDownButton : public CWindowImpl,
public COwnerDraw,
public CCustomDraw
{
private:
bool m_bDrawArrow;
HMENU m_hMenu;
HFONT m_hWebdingsFont;
HTHEME m_hTheme;
public:
CDropDownButton(unsigned int uiMenuID,bool bDrawArrow);
~CDropDownButton();
HMENU GetMenu();
BOOL SubclassWindow(HWND hWnd);
void DrawItem(LPDRAWITEMSTRUCT lpDIS);
DWORD OnPrePaint(int idCtrl,LPNMCUSTOMDRAW lpNMCD);
DWORD OnPostPaint(int idCtrl,LPNMCUSTOMDRAW lpNMCD);
#if _ATL_VER <= 0x0300
BEGIN_MSG_MAP_EX(CDropDownButton)
#else
BEGIN_MSG_MAP(CDropDownButton)
#endif
REFLECTED_COMMAND_CODE_HANDLER(BN_CLICKED,OnClicked)
CHAIN_MSG_MAP_ALT(COwnerDraw,1)
CHAIN_MSG_MAP_ALT(CCustomDraw,1)
END_MSG_MAP()
LRESULT OnClicked(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
};
================================================
FILE: src/app/control/gradient_static.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include "gradient_static.hh"
CGradientStatic::CGradientStatic(COLORREF TopColor) : m_TopColor(TopColor)
{
}
CGradientStatic::~CGradientStatic()
{
}
LRESULT CGradientStatic::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
LRESULT lResult = DefWindowProc(uMsg,wParam,lParam);
HDC hDC = GetWindowDC();
RECT rcClient;
GetClientRect(&rcClient);
DrawVertGradientRect(hDC,&rcClient,m_TopColor,GetSysColor(COLOR_BTNFACE));
ReleaseDC(hDC);
return lResult;
}
================================================
FILE: src/app/control/gradient_static.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
class CGradientStatic : public CWindowImpl
{
private:
COLORREF m_TopColor;
public:
CGradientStatic(COLORREF TopColor);
~CGradientStatic();
BEGIN_MSG_MAP(CGradientStatic)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
END_MSG_MAP()
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/control/label_container.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "label_container.hh"
#include
#include "ctrl_messages.hh"
#include "version.hh"
#include "visual_styles.hh"
#include "resource.h"
#include "ctrl_messages.hh"
CLabelContainer::CLabelContainer(bool bClosable)
{
m_iHeaderHeight = 0;
m_hBorderBrush = ::CreateSolidBrush(LABELCONTAINER_COLOR_BORDER);
m_szLabelText[0] = '\0';
m_hWndCustomDraw = NULL;
m_iControlID = -1;
// Button releated.
m_hCloseImageList = NULL;
m_hWndCloseHost = NULL;
if (bClosable)
InitializeImageList();
m_iButtonState = PANE_BUTTON_NORMAL;
m_bButtonDown = false;
}
CLabelContainer::~CLabelContainer()
{
if (m_hBorderBrush != NULL)
::DeleteObject(m_hBorderBrush);
// Destroy the image list.
if (m_hCloseImageList != NULL)
ImageList_Destroy(m_hCloseImageList);
}
void CLabelContainer::InitializeImageList()
{
HBITMAP hBitmap = LoadBitmap(_Module.GetResourceInstance(),MAKEINTRESOURCE(IDB_PANECLOSEBITMAP));
m_hCloseImageList = ImageList_Create(16,16,ILC_COLOR32 | ILC_MASK,0,4);
ImageList_AddMasked(m_hCloseImageList,hBitmap,RGB(255,0,255));
DeleteObject(hBitmap);
}
void CLabelContainer::SetCustomDrawHandler(HWND hWndCustomDraw,int iID)
{
m_hWndCustomDraw = hWndCustomDraw;
m_iControlID = iID;
}
void CLabelContainer::SetClient(HWND hWndClient)
{
m_ClientWindow = hWndClient;
UpdateLayout();
}
void CLabelContainer::SetCloseHost(HWND hWndCloseHost)
{
m_hWndCloseHost = hWndCloseHost;
}
void CLabelContainer::UpdateLayout()
{
RECT rcClient;
GetClientRect(&rcClient);
UpdateLayout(rcClient.right,rcClient.bottom);
}
void CLabelContainer::UpdateLayout(int iWidth,int iHeight)
{
RECT rcHeader = { 0,0,iWidth,m_iHeaderHeight };
if (m_ClientWindow.m_hWnd != NULL)
m_ClientWindow.SetWindowPos(NULL,0,m_iHeaderHeight,iWidth,iHeight - m_iHeaderHeight,SWP_NOZORDER);
else
rcHeader.bottom = iHeight;
InvalidateRect(&rcHeader);
}
LRESULT CLabelContainer::OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
UpdateLayout(GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam));
return 0;
}
LRESULT CLabelContainer::OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_ClientWindow.m_hWnd != NULL)
m_ClientWindow.SetFocus();
return 0;
}
LRESULT CLabelContainer::OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
return TRUE;
}
LRESULT CLabelContainer::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
RECT rcHeader;
GetClientRect(&rcHeader);
rcHeader.bottom = rcHeader.top + m_iHeaderHeight;
if (wParam != NULL)
{
HDC hDC = (HDC)wParam;
DrawBackground(hDC,&rcHeader);
DrawText(hDC,&rcHeader);
DrawButton(hDC,&rcHeader);
ReleaseDC(hDC);
}
else
{
CPaintDC dc(m_hWnd);
DrawBackground(dc.m_hDC,&rcHeader);
DrawText(dc.m_hDC,&rcHeader);
DrawButton(dc.m_hDC,&rcHeader);
ReleaseDC(dc);
}
return 0;
}
LRESULT CLabelContainer::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// Only deal with this event if the panel is closable.
if (m_hCloseImageList == NULL)
return 0;
POINT ptMouse = { GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) };
RECT rcButton,rcClient;
GetClientRect(&rcClient);
rcButton.top = rcClient.top + LABELCONTAINER_BUTTON_TOPSPACING;
rcButton.right = rcClient.right - LABELCONTAINER_BUTTON_RIGHTSPACING;
rcButton.bottom = rcButton.top + 16;
rcButton.left = rcButton.right - 16;
int iNewState;
if (::PtInRect(&rcButton,ptMouse))
{
SetCapture();
if (m_iButtonState != PANE_BUTTON_DOWN)
iNewState = PANE_BUTTON_HOVER;
else
iNewState = PANE_BUTTON_DOWN;
}
else
{
ReleaseCapture();
iNewState = PANE_BUTTON_NORMAL;
}
if (iNewState != m_iButtonState)
{
m_iButtonState = iNewState;
InvalidateRect(&rcButton);
}
return 0;
}
LRESULT CLabelContainer::OnMouseDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// Only deal with this event if the panel is closable.
if (m_hCloseImageList == NULL)
return 0;
POINT ptMouse = { GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) };
RECT rcButton,rcClient;
GetClientRect(&rcClient);
rcButton.top = rcClient.top + LABELCONTAINER_BUTTON_TOPSPACING;
rcButton.right = rcClient.right - LABELCONTAINER_BUTTON_RIGHTSPACING;
rcButton.bottom = rcButton.top + 16;
rcButton.left = rcButton.right - 16;
if (::PtInRect(&rcButton,ptMouse))
{
m_iButtonState = PANE_BUTTON_DOWN;
InvalidateRect(&rcButton);
}
return 0;
}
LRESULT CLabelContainer::OnMouseUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// Only deal with this event if the panel is closable.
if (m_hCloseImageList == NULL)
return 0;
POINT ptMouse = { GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) };
RECT rcButton,rcClient;
GetClientRect(&rcClient);
rcButton.top = rcClient.top + LABELCONTAINER_BUTTON_TOPSPACING;
rcButton.right = rcClient.right - LABELCONTAINER_BUTTON_RIGHTSPACING;
rcButton.bottom = rcButton.top + 16;
rcButton.left = rcButton.right - 16;
if (::PtInRect(&rcButton,ptMouse))
{
if (m_iButtonState == PANE_BUTTON_DOWN && m_hWndCloseHost != NULL)
::PostMessage(m_hWndCloseHost,WM_LABELCONTAINER_CLOSE,0,0);
m_iButtonState = PANE_BUTTON_HOVER;
InvalidateRect(&rcButton);
}
else
{
m_iButtonState = PANE_BUTTON_NORMAL;
InvalidateRect(&rcButton);
}
return 0;
}
LRESULT CLabelContainer::OnCustomDraw(int idCtrl,LPNMHDR pnmh,BOOL &bHandled)
{
if (m_hWndCustomDraw != NULL && idCtrl == m_iControlID)
return ::SendMessage(m_hWndCustomDraw,WM_CONTROLCUSTOMDRAW,0,(LPARAM)pnmh);
bHandled = false;
return CDRF_DODEFAULT;
}
void CLabelContainer::DrawText(CDCHandle dc,RECT *pHeaderRect)
{
HFONT hOldFont = NULL;
if (g_WinVer.m_ulMajorVersion == MAJOR_WINVISTA &&
g_WinVer.m_ulMinorVersion == MINOR_WINVISTA &&
g_VisualStyles.IsThemeActive())
{
hOldFont = (HFONT)SelectObject(dc,AtlGetDefaultGuiFont());
::SetBkMode(dc,TRANSPARENT);
::SetTextColor(dc,RGB(139,139,139));
}
else
{
HFONT hFont = AtlCreateBoldFont(AtlGetDefaultGuiFont());
hOldFont = (HFONT)SelectObject(dc,hFont);
::SetBkMode(dc,TRANSPARENT);
::SetTextColor(dc,::GetSysColor(COLOR_BTNFACE));
}
RECT rcText;
rcText.left = pHeaderRect->left + 3;
rcText.right = pHeaderRect->right;
rcText.top = pHeaderRect->top + LABELCONTAINER_BORDER_HEIGHT + 1;
rcText.bottom = pHeaderRect->bottom;
::DrawText(dc,m_szLabelText,lstrlen(m_szLabelText),&rcText,
DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE);
if (hOldFont != NULL)
SelectObject(dc,hOldFont);
}
void CLabelContainer::DrawBackground(CDCHandle dc,RECT *pHeaderRect)
{
RECT rcMisc;
rcMisc.left = pHeaderRect->left;
rcMisc.right = pHeaderRect->right;
// Bottom border.
rcMisc.top = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
rcMisc.bottom = pHeaderRect->bottom;
FillRect(dc,&rcMisc,GetSysColorBrush(COLOR_BTNFACE));
if (g_WinVer.m_ulMajorVersion == MAJOR_WINVISTA &&
g_WinVer.m_ulMinorVersion == MINOR_WINVISTA &&
g_VisualStyles.IsThemeActive())
{
// Gradient background.
rcMisc.top = pHeaderRect->top;
rcMisc.bottom = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
DrawHorGradientRect(dc.m_hDC,&rcMisc,LABELCONTAINER_COLOR_BACKGROUNDVISTA,GetSysColor(COLOR_BTNFACE));
}
else if (true)
{
// Gradient background.
rcMisc.top = pHeaderRect->top;
rcMisc.bottom = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
DrawHorGradientRect(dc.m_hDC,&rcMisc,LABELCONTAINER_COLOR_BACKGROUNDALT,GetSysColor(COLOR_BTNFACE));
}
else
{
// Gradient background.
rcMisc.left = LABELCONTAINER_BORDER_HEIGHT;
rcMisc.top = pHeaderRect->top + LABELCONTAINER_BORDER_HEIGHT;
rcMisc.bottom = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT - LABELCONTAINER_BORDER_HEIGHT;
DrawHorGradientRect(dc.m_hDC,&rcMisc,LABELCONTAINER_COLOR_BACKGROUND,GetSysColor(COLOR_BTNFACE));
// Border lines.
rcMisc.left = pHeaderRect->left;
rcMisc.top = pHeaderRect->top;
rcMisc.bottom = pHeaderRect->top + LABELCONTAINER_BORDER_HEIGHT;
DrawHorGradientRect(dc.m_hDC,&rcMisc,LABELCONTAINER_COLOR_BORDER,GetSysColor(COLOR_BTNFACE));
rcMisc.top = pHeaderRect->bottom - LABELCONTAINER_BORDER_HEIGHT - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
rcMisc.bottom = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
DrawHorGradientRect(dc.m_hDC,&rcMisc,LABELCONTAINER_COLOR_BORDER,GetSysColor(COLOR_BTNFACE));
rcMisc.top = pHeaderRect->top;
rcMisc.bottom = pHeaderRect->bottom - LABELCONTAINER_BOTTOMBORDER_HEIGHT;
rcMisc.right = pHeaderRect->left + LABELCONTAINER_BORDER_HEIGHT;
FillRect(dc,&rcMisc,m_hBorderBrush);
}
}
void CLabelContainer::DrawButton(CDCHandle dc,RECT *pHeaderRect)
{
if (m_hCloseImageList != NULL)
{
ImageList_Draw(m_hCloseImageList,m_iButtonState,dc,
pHeaderRect->right - 16 - LABELCONTAINER_BUTTON_RIGHTSPACING,
LABELCONTAINER_BUTTON_TOPSPACING,ILD_TRANSPARENT);
}
}
void CLabelContainer::SetHeaderHeight(int iHeight)
{
m_iHeaderHeight = iHeight;
}
void CLabelContainer::SetLabelText(const TCHAR *szText)
{
lstrcpy(m_szLabelText,szText);
}
================================================
FILE: src/app/control/label_container.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#define LABELCONTAINER_COLOR_BACKGROUND RGB(255,255,255)
#define LABELCONTAINER_COLOR_BORDER RGB(64,154,222)
#define LABELCONTAINER_COLOR_BACKGROUNDVISTA RGB(252,252,252)
#define LABELCONTAINER_COLOR_BACKGROUNDALT ::GetSysColor(COLOR_BTNSHADOW)
#define LABELCONTAINER_BOTTOMBORDER_HEIGHT 4
#define LABELCONTAINER_BORDER_HEIGHT 1
#define LABELCONTAINER_MAXTEXT 32
#define LABELCONTAINER_BUTTON_TOPSPACING 1
#define LABELCONTAINER_BUTTON_RIGHTSPACING 0
#define PANE_BUTTON_NORMAL 0
#define PANE_BUTTON_HOVER 1
#define PANE_BUTTON_DOWN 2
#define PANE_BUTTON_DISABLED 3
class CLabelContainer : public CWindowImpl
{
private:
CWindow m_ClientWindow;
int m_iHeaderHeight;
HBRUSH m_hBorderBrush;
TCHAR m_szLabelText[LABELCONTAINER_MAXTEXT];
// Button related.
HIMAGELIST m_hCloseImageList;
int m_iButtonState;
bool m_bButtonDown;
// Handle to the control that should receivce custom draw messages.
HWND m_hWndCustomDraw;
int m_iControlID;
// The host window that should receive the close message.
HWND m_hWndCloseHost;
void InitializeImageList();
void DrawText(CDCHandle dc,RECT *pHeaderRect);
void DrawBackground(CDCHandle dc,RECT *pHeaderRect);
void DrawButton(CDCHandle dc,RECT *pHeaderRect);
public:
static CWndClassInfo &GetWndClassInfo()
{
static CWndClassInfo wc =
{
{
sizeof(WNDCLASSEX),CS_DBLCLKS,
StartWindowProc,0,0,NULL,NULL,NULL,
GetSysColorBrush(COLOR_BTNFACE),NULL,
_T("ckLabelContainer"),NULL
},
NULL,NULL,IDC_ARROW,TRUE,0,_T("")
};
return wc;
}
CLabelContainer(bool bClosable = false);
~CLabelContainer();
BEGIN_MSG_MAP(CLabelContainer)
MESSAGE_HANDLER(WM_SIZE,OnSize)
MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkgnd)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WM_LBUTTONDOWN,OnMouseDown)
MESSAGE_HANDLER(WM_LBUTTONUP,OnMouseUp)
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW,OnCustomDraw)
FORWARD_NOTIFICATIONS()
END_MSG_MAP()
LRESULT OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseUp(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnCustomDraw(int idCtrl,LPNMHDR pnmh,BOOL &bHandled);
void SetCustomDrawHandler(HWND hWndCustomDraw,int iID);
void SetClient(HWND hWndClient);
void SetCloseHost(HWND hWndCloseHost);
void UpdateLayout();
void UpdateLayout(int iWidth,int iHeight);
void SetHeaderHeight(int iHeight);
void SetLabelText(const TCHAR *szText);
};
================================================
FILE: src/app/control/mini_html_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include "mini_html_ctrl.hh"
HBRUSH CMiniHtmlCtrl::m_hBackgroundBrush = NULL;
CMiniHtmlCtrl::CMiniHtmlCtrl()
{
m_pDocBuffer = NULL;
m_ulDocLength = 0;
//Load(_T("C:\\Users\\Christian Kindahl\\Desktop\\Active Projects\\InfraRecorder\\trunk\\Binary64\\Test.xml"));
// Create fonts.
m_hNormalFont = NULL;
m_hBoldFont = NULL;
m_hHeaderFont = NULL;
LOGFONT lf = { 0 };
if (::GetObject(AtlGetDefaultGuiFont(),sizeof(LOGFONT),&lf) == sizeof(LOGFONT))
{
lf.lfHeight = MINIHTML_FONTHEIGHT_NORMAL;
lstrcpy(lf.lfFaceName,_T("Verdana"));
m_hNormalFont = ::CreateFontIndirect(&lf);
}
if (m_hNormalFont == NULL)
m_hNormalFont = AtlGetDefaultGuiFont();
m_hBoldFont = AtlCreateBoldFont(m_hNormalFont);
lf.lfItalic = 1;
m_hItalicFont = ::CreateFontIndirect(&lf);
if (m_hItalicFont == NULL)
m_hItalicFont = m_hNormalFont;
lf.lfItalic = 0;
lf.lfHeight = MINIHTML_FONTHEIGHT_HEADER;
m_hHeaderFont = AtlCreateBoldFont(::CreateFontIndirect(&lf));
if (m_hHeaderFont == NULL)
m_hHeaderFont = m_hBoldFont;
// Create the background brush.
if (m_hBackgroundBrush == NULL)
m_hBackgroundBrush = ::CreateSolidBrush(MINIHTML_COLOR_BACKGROUND);
// Set default font widths to zer.
m_uiNormalSpaceWidth = 0;
m_uiBoldSpaceWidth = 0;
m_uiItalicSpaceWidth = 0;
m_uiHeaderSpaceWidth = 0;
}
CMiniHtmlCtrl::~CMiniHtmlCtrl()
{
// Close any opened document.
Close();
if (m_hNormalFont != AtlGetDefaultGuiFont())
::DeleteObject(m_hNormalFont);
if (m_hBoldFont != NULL)
::DeleteObject(m_hBoldFont);
if (m_hItalicFont != NULL)
::DeleteObject(m_hItalicFont);
if (m_hHeaderFont != NULL)
::DeleteObject(m_hHeaderFont);
// Delete the background brush.
if (m_hBackgroundBrush != NULL)
{
::DeleteObject(m_hBackgroundBrush);
m_hBackgroundBrush = NULL;
}
}
bool CMiniHtmlCtrl::Load(const TCHAR *szFileName)
{
Close();
ckcore::File File(szFileName);
if (!File.open(ckcore::File::ckOPEN_READ))
return false;
// Make sure that the file is not too large.
if (File.size() > 0xFFFFFFFF)
return false;
// If the application is in an unicode environment we need to check what
// byte-order us used.
unsigned short usBOM = 0;
if (File.read(&usBOM,2) == -1)
return false;
switch (usBOM)
{
// Currently the only supported byte-order.
case BOM_UTF32BE:
break;
case BOM_UTF8:
case BOM_UTF32LE:
case BOM_SCSU:
return false;
default:
// If no BOM is found the file pointer has to be re-moved to the beginning.
File.seek(0,ckcore::File::ckFILE_BEGIN);
break;
};
unsigned long ulFileSize = (unsigned long)File.size() - (unsigned long)File.tell();
m_ulDocLength = ulFileSize / sizeof(TCHAR);
m_pDocBuffer = new TCHAR[m_ulDocLength + 1];
if (File.read(m_pDocBuffer,ulFileSize) == -1)
return false;
m_pDocBuffer[m_ulDocLength] = '\0';
return ParseBuffer();
}
CMiniHtmlCtrl::eTagType CMiniHtmlCtrl::ParseTag(const TCHAR *szTag)
{
if (!lstrcmp(szTag,_T("h")) || !lstrcmp(szTag,_T("H")))
return TT_HEADER;
else if (!lstrcmp(szTag,_T("b")) || !lstrcmp(szTag,_T("B")))
return TT_BOLD;
else if (!lstrcmp(szTag,_T("i")) || !lstrcmp(szTag,_T("I")))
return TT_ITALIC;
else if (!lstrcmp(szTag,_T("br")) || !lstrcmp(szTag,_T("BR")))
return TT_BREAK;
return TT_UNKNOWN;
}
CMiniHtmlCtrl::eAtomAttr CMiniHtmlCtrl::TagToAttr(eTagType TagType)
{
switch (TagType)
{
case TT_BOLD:
return AA_BOLD;
case TT_ITALIC:
return AA_ITALIC;
case TT_HEADER:
return AA_HEADER;
}
return AA_NORMAL;
}
bool CMiniHtmlCtrl::ParseBuffer()
{
bool bInTag = false;
tstring Tag;
std::vector Tags;
Tags.push_back(TT_NORMAL);
int iWordStart = -1;
for (unsigned int i = 0; i < m_ulDocLength; i++)
{
// Ignore some characters.
if (m_pDocBuffer[i] == '\t' || m_pDocBuffer[i] == '\n' || m_pDocBuffer[i] == '\r')
{
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,i - iWordStart,
AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,i - iWordStart);
szTemp[i - iWordStart] = '\0';
::MessageBox(NULL,szTemp,_T(""),MB_OK);
iWordStart = -1;
}
continue;
}
if (bInTag)
{
if (m_pDocBuffer[i] == '>')
{
// Check if it's an ending tag.
if (Tag.c_str()[0] == '/')
{
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,
i - iWordStart - (unsigned int)Tag.size() - 1,AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,i - iWordStart - Tag.size() - 1);
szTemp[i - iWordStart - Tag.size() - 1] = '\0';
iWordStart = -1;
}
// Pop the tag stack if necessary.
if (Tags[Tags.size() - 1] == ParseTag(Tag.c_str() + 1))
Tags.pop_back();
Tag.erase();
}
else if (Tag[Tag.size() - 1] == '/') // Check if we have a self-terminating tag.
{
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,
i - iWordStart - (unsigned int)Tag.size() - 1,AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,i - iWordStart - Tag.size() - 1);
szTemp[i - iWordStart - Tag.size() - 1] = '\0';
iWordStart = -1;
}
Tag.resize(Tag.size() - 1);
eTagType CurTag = ParseTag(Tag.c_str());
switch (CurTag)
{
case TT_BREAK:
{
// Make sure that the break will be of correct height.
eAtomAttr BreakAttr = Tags.size() > 0 ? TagToAttr(Tags[Tags.size() - 1]) : AA_NORMAL;
m_Atoms.push_back(CAtom(NULL,NULL,AT_BREAK,BreakAttr));
}
break;
}
Tag.erase();
}
else
{
// We have found a new tag and not processed the last atom, process it.
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,
i - iWordStart - (unsigned int)Tag.size() - 1,AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,i - iWordStart - Tag.size() - 1);
szTemp[i - iWordStart - Tag.size() - 1] = '\0';
iWordStart = -1;
}
eTagType TagType = ParseTag(Tag.c_str());
Tags.push_back(TagType);
Tag.erase();
}
bInTag = false;
}
else
{
Tag.push_back(m_pDocBuffer[i]);
}
}
else
{
if (m_pDocBuffer[i] == '<')
{
bInTag = true;
}
else
{
if (m_pDocBuffer[i] == ' ')
{
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,i - iWordStart,
AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,i - iWordStart);
szTemp[i - iWordStart] = '\0';
iWordStart = -1;
}
}
else
{
if (iWordStart == -1)
iWordStart = i;
}
}
}
}
if (iWordStart != -1)
{
eTagType CurTag = Tags[Tags.size() - 1];
m_Atoms.push_back(CAtom(m_pDocBuffer + iWordStart,m_ulDocLength - iWordStart,
AT_TEXT,TagToAttr(CurTag)));
TCHAR szTemp[64];
lstrncpy(szTemp,m_pDocBuffer + iWordStart,m_ulDocLength - iWordStart);
szTemp[m_ulDocLength - iWordStart] = '\0';
}
return true;
}
void CMiniHtmlCtrl::Close()
{
if (m_pDocBuffer != NULL)
{
delete [] m_pDocBuffer;
m_pDocBuffer = NULL;
}
m_ulDocLength = 0;
}
HFONT CMiniHtmlCtrl::GetAtomFont(const CAtom *pAtom)
{
switch (pAtom->m_Attr)
{
case AA_HEADER:
return m_hHeaderFont;
case AA_BOLD:
return m_hBoldFont;
case AA_ITALIC:
return m_hItalicFont;
default:
return m_hNormalFont;
}
}
unsigned int CMiniHtmlCtrl::GetAtomWidth(const CAtom *pAtom)
{
if (pAtom->m_Type == AT_BREAK)
return 0;
// Draw the text.
HDC hDC = GetDC();
HFONT hOldFont = (HFONT)SelectObject(hDC,GetAtomFont(pAtom));
RECT rcText = { 0,0,0,0 };
DrawText(hDC,pAtom->m_szText,pAtom->m_uiTextLen,&rcText,DT_LEFT | DT_CALCRECT);
SelectObject(hDC,hOldFont);
return rcText.right;
}
unsigned int CMiniHtmlCtrl::GetAtomSpaceWidth(const CAtom *pAtom)
{
switch (pAtom->m_Attr)
{
case AA_HEADER:
if (m_uiHeaderSpaceWidth != 0)
return m_uiHeaderSpaceWidth;
break;
case AA_BOLD:
if (m_uiBoldSpaceWidth != 0)
return m_uiBoldSpaceWidth;
break;
case AA_ITALIC:
if (m_uiItalicSpaceWidth != 0)
return m_uiItalicSpaceWidth;
break;
default:
if (m_uiNormalSpaceWidth != 0)
return m_uiNormalSpaceWidth;
break;
}
HDC hDC = GetDC();
HFONT hOldFont = (HFONT)SelectObject(hDC,GetAtomFont(pAtom));
RECT rcText = { 0,0,0,0 };
DrawText(hDC,_T(" "),1,&rcText,DT_LEFT | DT_CALCRECT);
SelectObject(hDC,hOldFont);
switch (pAtom->m_Attr)
{
case AA_HEADER:
m_uiHeaderSpaceWidth = rcText.right;
break;
case AA_BOLD:
m_uiBoldSpaceWidth = rcText.right;
break;
case AA_ITALIC:
m_uiItalicSpaceWidth = rcText.right;
break;
default:
m_uiNormalSpaceWidth = rcText.right;
break;
}
return rcText.right;
}
unsigned int CMiniHtmlCtrl::GetAtomsTotalWidth(unsigned int uiFirstAtom,
unsigned int uiLastAtom)
{
unsigned int uiTotalWidth = 0;
for (unsigned int uiAtom = uiFirstAtom; uiAtom < uiLastAtom; uiAtom++)
{
// Safety precausion.
if (uiAtom >= m_Atoms.size())
break;
CAtom *pAtom = &m_Atoms[uiAtom];
if (pAtom->m_Type == AT_BREAK)
continue;
uiTotalWidth += pAtom->m_uiWidth;
if (uiAtom != uiFirstAtom)
uiTotalWidth += GetAtomSpaceWidth(pAtom);
}
return uiTotalWidth;
}
int CMiniHtmlCtrl::RenderText(CDCHandle dc,const RECT *pRect,const CAtom *pAtom)
{
// Draw the text.
HFONT hOldFont = (HFONT)SelectObject(dc,GetAtomFont(pAtom));
::SetBkMode(dc,TRANSPARENT);
::SetTextColor(dc,::GetSysColor(COLOR_WINDOWTEXT));
RECT rcText = *pRect;
::DrawText(dc,pAtom->m_szText,pAtom->m_uiTextLen,&rcText,DT_LEFT);
// Calculate text height.
int iTextHeight = DrawText(dc,pAtom->m_szText,pAtom->m_uiTextLen,&rcText,DT_LEFT | DT_CALCRECT);
if (hOldFont != NULL)
SelectObject(dc,hOldFont);
return iTextHeight;
}
int CMiniHtmlCtrl::RenderImage(CDCHandle dc,const RECT *pRect,const CAtom *pAtom)
{
return 0;
}
void CMiniHtmlCtrl::Render(CDCHandle dc)
{
RECT rcClient;
GetClientRect(&rcClient);
rcClient.right -= MINIHTML_HORIZONTAL_INDENT;
unsigned int uiAtom = 0;
unsigned int uiMaxHeight = 0,uiCurHeight = 0;
// Render all lines.
std::vector::const_iterator itLine;
for (itLine = m_LineWordCount.begin(); itLine != m_LineWordCount.end(); itLine++)
{
rcClient.left = MINIHTML_HORIZONTAL_INDENT;
uiMaxHeight = 0;
// Check if we should center the line.
if (uiAtom < m_Atoms.size() && m_Atoms[uiAtom].m_Attr == AA_HEADER)
{
rcClient.left = MINIHTML_HORIZONTAL_INDENT +
((rcClient.right - GetAtomsTotalWidth(uiAtom,uiAtom + *itLine)) >> 1);
}
// Render all words on the line.
for (unsigned int i = 0; i < *itLine; i++,uiAtom++)
{
// Safety precausion.
if (uiAtom >= m_Atoms.size())
break;
CAtom *pAtom = &m_Atoms[uiAtom];
if (pAtom->m_Type == AT_BREAK)
{
uiMaxHeight = pAtom->m_Attr == AA_HEADER ? MINIHTML_FONTHEIGHT_HEADER :
MINIHTML_FONTHEIGHT_NORMAL;
continue;
}
switch (pAtom->m_Type)
{
case AT_TEXT:
uiCurHeight = RenderText(dc,&rcClient,pAtom);
break;
case AT_IMAGE:
uiCurHeight = RenderImage(dc,&rcClient,pAtom);
break;
}
if (uiCurHeight > uiMaxHeight)
uiMaxHeight = uiCurHeight;
rcClient.left += pAtom->m_uiWidth + GetAtomSpaceWidth(pAtom);
}
rcClient.top += uiMaxHeight;
}
}
void CMiniHtmlCtrl::Layout(unsigned int uiWidth,unsigned int uiHeight)
{
if (uiWidth == 0)
return;
// Remove the indentation and border from the specified width immediately.
uiWidth -= (MINIHTML_HORIZONTAL_INDENT << 1) + (GetSystemMetrics(SM_CXEDGE) << 1);
m_LineWordCount.clear();
unsigned int uiLeft = 0,uiLine = 0;
unsigned int uiWordCount = 0;
unsigned int uiSpaceWidth = 0;
std::vector::iterator itAtom;
for (itAtom = m_Atoms.begin(); itAtom != m_Atoms.end(); itAtom++)
{
if (itAtom->m_Type == AT_BREAK)
{
itAtom->m_uiLine = uiLine++;
uiLeft = 0;
m_LineWordCount.push_back(uiWordCount + 1);
uiWordCount = 0;
continue;
}
// Calculate the width of a space character.
uiSpaceWidth = GetAtomSpaceWidth(&(*itAtom));
if (itAtom->m_uiWidth == 0)
itAtom->m_uiWidth = GetAtomWidth(&(*itAtom));
if ((uiLeft + itAtom->m_uiWidth) <= uiWidth)
{
itAtom->m_uiLine = uiLine;
if (uiLeft != 0)
uiLeft += uiSpaceWidth;
uiLeft += itAtom->m_uiWidth;
uiWordCount++;
}
else
{
itAtom->m_uiLine = ++uiLine;
uiLeft = itAtom->m_uiWidth;
m_LineWordCount.push_back(uiWordCount);
uiWordCount = 1;
}
}
if (uiLeft != 0)
{
m_LineWordCount.push_back(uiWordCount);
}
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
LRESULT CMiniHtmlCtrl::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (wParam != NULL)
{
HDC hDC = (HDC)wParam;
Render(hDC);
ReleaseDC(hDC);
}
else
{
CPaintDC dc(m_hWnd);
Render(dc.m_hDC);
ReleaseDC(dc);
}
return 0;
}
LRESULT CMiniHtmlCtrl::OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
unsigned int uiWidth = GET_X_LPARAM(lParam);
unsigned int uiHeight = GET_Y_LPARAM(lParam);
Layout(uiWidth,uiHeight);
return 0;
}
================================================
FILE: src/app/control/mini_html_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include
#define MINIHTML_HORIZONTAL_INDENT 3
#define MINIHTML_COLOR_BACKGROUND RGB(245,245,245)
#define MINIHTML_FONTHEIGHT_NORMAL 12
#define MINIHTML_FONTHEIGHT_HEADER 18
#define BOM_UTF8 0xEFBBBF
#define BOM_UTF32BE 0x0000FEFF
#define BOM_UTF32LE 0xFFFE0000
#define BOM_SCSU 0x0EFEFF
class CMiniHtmlCtrl : public CScrollWindowImpl
{
private:
enum eAtomType
{
AT_TEXT,
AT_IMAGE,
AT_BREAK
};
enum eAtomAttr
{
AA_NORMAL,
AA_BOLD,
AA_ITALIC,
AA_HEADER
};
enum eTagType
{
TT_UNKNOWN,
TT_NORMAL,
TT_BOLD,
TT_ITALIC,
TT_HEADER,
TT_BREAK
};
class CAtom
{
public:
TCHAR *m_szText;
unsigned int m_uiTextLen;
unsigned int m_uiWidth;
unsigned int m_uiLine;
CMiniHtmlCtrl::eAtomType m_Type;
CMiniHtmlCtrl::eAtomAttr m_Attr;
CAtom(TCHAR *szText,unsigned int uiTextLen,CMiniHtmlCtrl::eAtomType Type,
CMiniHtmlCtrl::eAtomAttr Attr)
{
m_szText = szText;
m_uiTextLen = uiTextLen;
m_uiWidth = 0;
m_uiLine = 0;
m_Type = Type;
m_Attr = Attr;
}
};
TCHAR *m_pDocBuffer;
unsigned long m_ulDocLength;
std::vector m_Atoms;
std::vector m_LineWordCount;
HFONT m_hNormalFont;
HFONT m_hBoldFont;
HFONT m_hItalicFont;
HFONT m_hHeaderFont;
unsigned int m_uiNormalSpaceWidth;
unsigned int m_uiBoldSpaceWidth;
unsigned int m_uiItalicSpaceWidth;
unsigned int m_uiHeaderSpaceWidth;
static HBRUSH m_hBackgroundBrush;
HFONT GetAtomFont(const CAtom *pAtom);
unsigned int GetAtomWidth(const CAtom *pAtom);
unsigned int GetAtomSpaceWidth(const CAtom *pAtom);
unsigned int GetAtomsTotalWidth(unsigned int uiFirstAtom,unsigned int uiLastAtom);
int RenderText(CDCHandle dc,const RECT *pRect,const CAtom *pAtom);
int RenderImage(CDCHandle dc,const RECT *pRect,const CAtom *pAtom);
void Render(CDCHandle dc);
void Layout(unsigned int uiWidth,unsigned int uiHeight);
eTagType ParseTag(const TCHAR *szTag);
eAtomAttr TagToAttr(eTagType TagType);
bool ParseBuffer();
public:
static CWndClassInfo &GetWndClassInfo()
{
static CWndClassInfo wc =
{
{
sizeof(WNDCLASSEX),CS_DBLCLKS,
StartWindowProc,0,0,NULL,NULL,NULL,
m_hBackgroundBrush,NULL,
_T("ckMiniHTML"),NULL
},
NULL,NULL,IDC_ARROW,TRUE,0,_T("")
};
return wc;
}
CMiniHtmlCtrl();
~CMiniHtmlCtrl();
bool Load(const TCHAR *szFileName);
void Close();
BEGIN_MSG_MAP(CMiniHtmlCtrl)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
MESSAGE_HANDLER(WM_SIZE,OnSize)
DEFAULT_REFLECTION_HANDLER()
CHAIN_MSG_MAP(CScrollWindowImpl)
END_MSG_MAP()
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/control/project_list_view_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "project_list_view_ctrl.hh"
#include "project_manager.hh"
#include "settings.hh"
#include "main_frm.hh"
#include "string_table.hh"
#include "project_drop_source.hh"
#include "project_data_object.hh"
/*
FIXME: For Windows XP and newer.
#ifndef LVM_SETSELECTEDCOLUMN
#define LVM_SETSELECTEDCOLUMN (LVM_FIRST + 140)
#endif
::SendMessage(m_hWnd,LVM_SETSELECTEDCOLUMN,0,0);
*/
CProjectListViewDropTarget::CProjectListViewDropTarget(CProjectListViewCtrl *pHost)
{
m_pHost = pHost;
}
bool CProjectListViewDropTarget::OnDragOver(POINTL ptCursor)
{
LVHITTESTINFO lvHit;
lvHit.pt.x = ptCursor.x;
lvHit.pt.y = ptCursor.y;
ScreenToClient(m_pHost->m_hWnd,&lvHit.pt);
// See we're dragging above a folder, in that case highlight it.
int iTarget = m_pHost->HitTest(&lvHit);
if (iTarget != -1 && (((CItemData *)m_pHost->GetItemData(iTarget))->ucFlags & PROJECTITEM_FLAG_ISFOLDER))
m_pHost->SelectDropTarget(iTarget);
else
m_pHost->SelectDropTarget(-1);
return true;
}
bool CProjectListViewDropTarget::OnDrop(POINTL ptCursor,IDataObject *pDataObject)
{
CWaitCursor WaitCursor; // This displays the hourglass cursor.
LVHITTESTINFO lvHit;
lvHit.pt.x = ptCursor.x;
lvHit.pt.y = ptCursor.y;
ScreenToClient(m_pHost->m_hWnd,&lvHit.pt);
CProjectNode *pTargetNode = NULL;
int iTarget = m_pHost->HitTest(&lvHit);
if (iTarget != -1 && (((CItemData *)m_pHost->GetItemData(iTarget))->ucFlags & PROJECTITEM_FLAG_ISFOLDER))
{
m_pHost->SelectDropTarget(-1);
pTargetNode = g_TreeManager.ResolveNode(g_TreeManager.GetCurrentNode(),
(CItemData *)m_pHost->GetItemData(iTarget));
}
// Handle the data.
HandleDropData(pDataObject,pTargetNode,ptCursor);
return true;
}
void CProjectListViewDropTarget::OnDragLeave()
{
m_pHost->SelectDropTarget(-1);
}
bool CProjectListViewDropTarget::HandleDropData(IDataObject *pDataObject,CProjectNode *pTargetNode,
POINTL ptCursor)
{
// Construct a FORMATETC object.
FORMATETC FormatEtc = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM StgMedium;
if (pDataObject->QueryGetData(&FormatEtc) == S_OK)
{
if (pDataObject->GetData(&FormatEtc,&StgMedium) == S_OK)
{
// Prepare a project file transaction.
CProjectManager::CFileTransaction Transaction;
HDROP hDrop = (HDROP)GlobalLock(StgMedium.hGlobal);
unsigned int uiNumFiles = DragQueryFile(hDrop,0xFFFFFFFF,NULL,NULL);
TCHAR szFullName[MAX_PATH];
for (unsigned int i = 0; i < uiNumFiles; i++)
{
// Add each file to the project.
if (DragQueryFile(hDrop,i,szFullName,MAX_PATH - 1))
Transaction.AddFile(szFullName,pTargetNode);
}
GlobalUnlock(StgMedium.hGlobal);
ReleaseStgMedium(&StgMedium);
}
}
else
{
// Move to another folder if possible, otherwise rearrange in the list.
if (pTargetNode != NULL)
{
FormatEtc.cfFormat = static_cast(m_uiClipFormat);
if (pDataObject->QueryGetData(&FormatEtc) == S_OK)
{
if (pDataObject->GetData(&FormatEtc,&StgMedium) == S_OK)
{
// Prepare a project file transaction.
CProjectManager::CFileTransaction Transaction;
CProjectDropData *pDropData = (CProjectDropData *)GlobalLock(StgMedium.hGlobal);
if (pDropData->m_pParent == NULL)
return true;
SIZE_T uiNumFiles = (GlobalSize(StgMedium.hGlobal) - sizeof(CProjectDropData)) / sizeof(CItemData *);
for (SIZE_T i = 0; i < uiNumFiles; i++)
{
CItemData *pItemData = pDropData->m_ppData[i];
Transaction.MoveFile(pDropData->m_pParent,pItemData,pTargetNode);
}
GlobalUnlock(StgMedium.hGlobal);
ReleaseStgMedium(&StgMedium);
}
}
}
else
{
/*
*/
// Determine the dropped item.
LVHITTESTINFO lvHit;
lvHit.pt.x = ptCursor.x;
lvHit.pt.y = ptCursor.y;
ScreenToClient(m_pHost->m_hWnd,&lvHit.pt);
ListView_HitTest(m_pHost->m_hWnd,&lvHit);
// Not inside the list view?
if (lvHit.iItem == -1)
return true;
// Make sure that we can't drop a file above a folder.
CItemData *pDropItemData = (CItemData *)m_pHost->GetItemData(lvHit.iItem);
while (pDropItemData->ucFlags & PROJECTITEM_FLAG_ISFOLDER)
pDropItemData = (CItemData *)m_pHost->GetItemData(++lvHit.iItem);
CProjectNode *pCurrentNode = g_TreeManager.GetCurrentNode();
// Locate the dropped item (wee need an iterator so we know where to insert
// the dropped files.
std::list ::iterator itFileObject;
for (itFileObject = pCurrentNode->m_Files.begin(); itFileObject !=
pCurrentNode->m_Files.end(); itFileObject++)
{
if (*itFileObject == pDropItemData)
break;
}
// Move the selected items.
int iItemIndex = -1;
iItemIndex = m_pHost->GetNextItem(iItemIndex,LVNI_SELECTED);
while (iItemIndex != -1)
{
// Move the internal item data pointer.
CItemData *pItemData = (CItemData *)m_pHost->GetItemData(iItemIndex);
pCurrentNode->m_Files.remove(pItemData);
pCurrentNode->m_Files.insert(itFileObject,pItemData);
// Move the actual list item.
LVITEM lvi = { 0 };
lvi.iItem = iItemIndex;
lvi.iSubItem = 0;
lvi.pszText = LPSTR_TEXTCALLBACK;
lvi.stateMask = static_cast(~LVIS_SELECTED);
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM | LVIF_STATE;
m_pHost->GetItem(&lvi);
lvi.iItem = lvHit.iItem;
// Re-insert the item.
int iResult = m_pHost->InsertItem(&lvi);
if (lvi.iItem < iItemIndex)
lvHit.iItem++;
if (iResult <= iItemIndex)
iItemIndex++;
// Delete the old item.
m_pHost->DeleteItem(iItemIndex);
iItemIndex = m_pHost->GetNextItem(-1,LVNI_SELECTED);
}
/*
*/
}
}
return true;
}
/*
*/
CProjectListViewCtrl::CProjectListViewCtrl()
{
m_hDragImageList = NULL;
// Drop target.
m_pDropTarget = new CProjectListViewDropTarget(this);
CoLockObjectExternal(m_pDropTarget,TRUE,FALSE);
}
CProjectListViewCtrl::~CProjectListViewCtrl()
{
// Drop target.
if (m_pDropTarget != NULL)
{
CoLockObjectExternal(m_pDropTarget,FALSE,TRUE);
m_pDropTarget->Release();
m_pDropTarget = NULL;
}
if (m_hDragImageList != NULL)
ImageList_Destroy(m_hDragImageList);
}
LRESULT CProjectListViewCtrl::OnKeyDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
LRESULT lResult = DefWindowProc(uMsg,wParam,lParam);
if (wParam == VK_RETURN)
{
if (GetSelectedCount() > 0)
{
// This is not safe, I know.
BOOL bDummy;
g_pMainFrame->OnPLVDblClk(IDC_PROJECTLISTVIEW,NULL,bDummy);
}
}
return lResult;
}
LRESULT CProjectListViewCtrl::OnDropFiles(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
CWaitCursor WaitCursor; // This displays the hourglass cursor.
HDROP hDrop = (HDROP)wParam;
POINT ptDrop;
TCHAR szFullName[MAX_PATH];
if (DragQueryPoint(hDrop,&ptDrop) > 0)
{
// Prepare a project file transaction.
CProjectManager::CFileTransaction Transaction;
unsigned int uiNumFiles = DragQueryFile(hDrop,0xFFFFFFFF,NULL,NULL);
for (unsigned int i = 0; i < uiNumFiles; i++)
{
if (DragQueryFile(hDrop,i,szFullName,MAX_PATH - 1))
Transaction.AddFile(szFullName);
}
}
DragFinish(hDrop);
bHandled = false;
return 0;
}
LRESULT CProjectListViewCtrl::OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
g_ProjectManager.ListSetActive();
g_ProjectManager.NotifyListSelChanged(GetSelectedCount());
bHandled = false;
return 0;
}
LRESULT CProjectListViewCtrl::OnCustomDraw(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
LPNMLVCUSTOMDRAW lpNMCustomDraw = (LPNMLVCUSTOMDRAW)lParam;
switch (lpNMCustomDraw->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
CItemData *pItemData = (CItemData *)lpNMCustomDraw->nmcd.lItemlParam;
if (pItemData->ucFlags & PROJECTITEM_FLAG_ISIMPORTED)
{
lpNMCustomDraw->clrText = PROJECTLISTVIEW_COLOR_IMPORTED;
return CDRF_NEWFONT;
}
if (pItemData->ucFlags & PROJECTITEM_FLAG_ISLOCKED)
{
lpNMCustomDraw->clrText = GetSysColor(COLOR_GRAYTEXT);
return CDRF_NEWFONT;
}
bHandled = false;
return CDRF_DODEFAULT;
}
bHandled = false;
return CDRF_DODEFAULT;
}
void CProjectListViewCtrl::BeginDrag(LPNMLISTVIEW pNMListView)
{
CProjectDropSource *pDropSource = new CProjectDropSource();
CProjectDataObject *pDataObject = new CProjectDataObject();
// Add all file names to the data object.
int iItemIndex = -1;
iItemIndex = GetNextItem(iItemIndex,LVNI_SELECTED);
while (iItemIndex != -1)
{
CItemData *pItemData = (CItemData *)GetItemData(iItemIndex);
pDataObject->AddFile(pItemData);
iItemIndex = GetNextItem(iItemIndex,LVNI_SELECTED);
}
pDataObject->SetParent(g_TreeManager.GetCurrentNode());
DWORD dwEffect = 0;
::DoDragDrop(pDataObject,pDropSource,DROPEFFECT_MOVE,&dwEffect);
pDropSource->Release();
pDataObject->Release();
}
void CProjectListViewCtrl::SetViewStyle(int iViewStyle)
{
unsigned long ulStyle = 0;
switch (iViewStyle)
{
case LISTVIEWSTYLE_LARGEICONS:
ulStyle = LVS_ICON;
break;
case LISTVIEWSTYLE_SMALLICONS:
ulStyle = LVS_SMALLICON;
break;
case LISTVIEWSTYLE_LIST:
ulStyle = LVS_LIST;
break;
case LISTVIEWSTYLE_DETAILS:
ulStyle = LVS_REPORT;
break;
};
unsigned long ulOldStyle = GetWindowLong(GWL_STYLE);
if ((ulOldStyle & LVS_TYPEMASK) != ulStyle)
{
unsigned long ulNewStyle = (ulOldStyle & ~LVS_TYPEMASK) | ulStyle;
SetWindowLong(GWL_STYLE,ulNewStyle);
}
}
LRESULT CProjectListViewCtrl::OnViewLargeIcons(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
g_DynamicSettings.m_iPrjListViewStyle = LISTVIEWSTYLE_LARGEICONS;
g_DynamicSettings.Apply();
return 0;
}
LRESULT CProjectListViewCtrl::OnViewSmallIcons(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
g_DynamicSettings.m_iPrjListViewStyle = LISTVIEWSTYLE_SMALLICONS;
g_DynamicSettings.Apply();
return 0;
}
LRESULT CProjectListViewCtrl::OnViewList(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
g_DynamicSettings.m_iPrjListViewStyle = LISTVIEWSTYLE_LIST;
g_DynamicSettings.Apply();
return 0;
}
LRESULT CProjectListViewCtrl::OnViewDetails(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
g_DynamicSettings.m_iPrjListViewStyle = LISTVIEWSTYLE_DETAILS;
g_DynamicSettings.Apply();
return 0;
}
LRESULT CProjectListViewCtrl::OnNewFolder(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled)
{
g_ProjectManager.ListAddNewFolder();
return 0;
}
/*
CProjectListViewCtrl::SelectDropTarget
--------------------------------------
Marks the specified item as drop target, if iDropItemIndex the drop target
items will be cleared but no new target selected.
*/
void CProjectListViewCtrl::SelectDropTarget(int iDropItemIndex)
{
// Move the selected items.
int iItemIndex = -1;
iItemIndex = GetNextItem(iItemIndex,LVNI_DROPHILITED);
while (iItemIndex != -1)
{
SetItemState(iItemIndex,0,LVNI_DROPHILITED);
iItemIndex = GetNextItem(-1,LVNI_DROPHILITED);
}
if (iDropItemIndex != -1)
SetItemState(iDropItemIndex,LVNI_DROPHILITED,LVNI_DROPHILITED);
}
void CProjectListViewCtrl::ForceRedraw()
{
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient,true);
}
================================================
FILE: src/app/control/project_list_view_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include "resource.h"
#include "ctrl_messages.hh"
#include "tree_manager.hh"
#include "project_drop_target_base.hh"
// Color of items flagged as imported.
#define PROJECTLISTVIEW_COLOR_IMPORTED RGB(92,53,102)
class CProjectListViewCtrl;
class CProjectListViewDropTarget : public CProjectDropTargetBase
{
private:
CProjectListViewCtrl *m_pHost;
bool HandleDropData(IDataObject *pDataObject,CProjectNode *pTargetNode,POINTL ptCursor);
public:
CProjectListViewDropTarget(CProjectListViewCtrl *pHost);
bool OnDragOver(POINTL ptCursor);
bool OnDrop(POINTL ptCursor,IDataObject *pDataObject);
void OnDragLeave();
};
class CProjectListViewCtrl : public CWindowImpl
{
private:
HIMAGELIST m_hDragImageList;
public:
CProjectListViewDropTarget *m_pDropTarget;
DECLARE_WND_CLASS(_T("ckProjectListViewCtrl"));
CProjectListViewCtrl();
~CProjectListViewCtrl();
void SetViewStyle(int iViewStyle);
void BeginDrag(LPNMLISTVIEW pNMListView);
BEGIN_MSG_MAP(CProjectListViewCtrl)
COMMAND_ID_HANDLER(ID_VIEW_LARGEICONS,OnViewLargeIcons)
COMMAND_ID_HANDLER(ID_VIEW_SMALLICONS,OnViewSmallIcons)
COMMAND_ID_HANDLER(ID_VIEW_LIST,OnViewList)
COMMAND_ID_HANDLER(ID_VIEW_DETAILS,OnViewDetails)
COMMAND_ID_HANDLER(ID_EDIT_NEWFOLDER,OnNewFolder)
MESSAGE_HANDLER(WM_KEYDOWN,OnKeyDown)
MESSAGE_HANDLER(WM_DROPFILES,OnDropFiles)
MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus)
MESSAGE_HANDLER(WM_CONTROLCUSTOMDRAW,OnCustomDraw)
END_MSG_MAP()
LRESULT OnKeyDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnDropFiles(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnCustomDraw(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnViewLargeIcons(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
LRESULT OnViewSmallIcons(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
LRESULT OnViewList(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
LRESULT OnViewDetails(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
LRESULT OnNewFolder(WORD wNotifyCode,WORD wID,HWND hWndCtl,BOOL &bHandled);
void ForceRedraw();
void SelectDropTarget(int iDropItemIndex);
};
================================================
FILE: src/app/control/project_tree_view_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "project_tree_view_ctrl.hh"
#include "project_manager.hh"
#include "project_data_object.hh"
#include "project_drop_source.hh"
CProjectTreeViewDropTarget::CProjectTreeViewDropTarget(CTreeViewCtrlEx *pHost)
{
m_pHost = pHost;
}
bool CProjectTreeViewDropTarget::OnDragOver(POINTL ptCursor)
{
TVHITTESTINFO tvHit;
tvHit.pt.x = ptCursor.x;
tvHit.pt.y = ptCursor.y;
ScreenToClient(m_pHost->m_hWnd,&tvHit.pt);
HTREEITEM hTarget = m_pHost->HitTest(&tvHit);
if (hTarget)
{
m_pHost->SelectDropTarget(hTarget);
return true;
}
m_pHost->SelectDropTarget(NULL);
return false;
}
bool CProjectTreeViewDropTarget::OnDrop(POINTL ptCursor,IDataObject *pDataObject)
{
CWaitCursor WaitCursor; // This displays the hourglass cursor.
TVHITTESTINFO tvHit;
tvHit.pt.x = ptCursor.x;
tvHit.pt.y = ptCursor.y;
ScreenToClient(m_pHost->m_hWnd,&tvHit.pt);
HTREEITEM hTarget = m_pHost->HitTest(&tvHit);
if (hTarget)
{
m_pHost->SelectDropTarget(NULL);
HandleDropData(pDataObject,(CProjectNode *)m_pHost->GetItemData(hTarget));
return true;
}
return false;
}
void CProjectTreeViewDropTarget::OnDragLeave()
{
m_pHost->SelectDropTarget(NULL);
}
bool CProjectTreeViewDropTarget::HandleDropData(IDataObject *pDataObject,CProjectNode *pTargetNode)
{
// Construct a FORMATETC object.
FORMATETC FormatEtc = { CF_HDROP, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM StgMedium;
if (pDataObject->QueryGetData(&FormatEtc) == S_OK)
{
if (pDataObject->GetData(&FormatEtc,&StgMedium) == S_OK)
{
// Prepare a project file transaction.
CProjectManager::CFileTransaction Transaction;
HDROP hDrop = (HDROP)GlobalLock(StgMedium.hGlobal);
unsigned int uiNumFiles = DragQueryFile(hDrop,0xFFFFFFFF,NULL,NULL);
TCHAR szFullName[MAX_PATH];
for (unsigned int i = 0; i < uiNumFiles; i++)
{
// Add each file to the project.
if (DragQueryFile(hDrop,i,szFullName,MAX_PATH - 1))
Transaction.AddFile(szFullName,pTargetNode);
}
GlobalUnlock(StgMedium.hGlobal);
ReleaseStgMedium(&StgMedium);
}
}
else
{
FormatEtc.cfFormat = static_cast(m_uiClipFormat);
if (pDataObject->QueryGetData(&FormatEtc) == S_OK)
{
if (pDataObject->GetData(&FormatEtc,&StgMedium) == S_OK)
{
// Prepare a project file transaction.
CProjectManager::CFileTransaction Transaction;
CProjectDropData *pDropData = (CProjectDropData *)GlobalLock(StgMedium.hGlobal);
if (pDropData->m_pParent == NULL)
return true;
SIZE_T uiNumFiles = (GlobalSize(StgMedium.hGlobal) - sizeof(CProjectDropData)) / sizeof(CItemData *);
for (SIZE_T i = 0; i < uiNumFiles; i++)
{
CItemData *pItemData = pDropData->m_ppData[i];
Transaction.MoveFile(pDropData->m_pParent,pItemData,pTargetNode);
}
GlobalUnlock(StgMedium.hGlobal);
ReleaseStgMedium(&StgMedium);
}
}
}
return true;
}
CProjectTreeViewCtrl::CProjectTreeViewCtrl()
{
m_pDropTarget = new CProjectTreeViewDropTarget(this);
CoLockObjectExternal(m_pDropTarget,TRUE,FALSE);
}
CProjectTreeViewCtrl::~CProjectTreeViewCtrl()
{
if (m_pDropTarget != NULL)
{
CoLockObjectExternal(m_pDropTarget,FALSE,TRUE);
m_pDropTarget->Release();
m_pDropTarget = NULL;
}
}
LRESULT CProjectTreeViewCtrl::OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
CProjectNode *pNode = (CProjectNode *)GetSelectedItem().GetData();
g_ProjectManager.TreeSetActive();
g_ProjectManager.NotifyTreeSelChanged(pNode);
bHandled = false;
return 0;
}
LRESULT CProjectTreeViewCtrl::OnCustomDraw(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
LPNMTVCUSTOMDRAW lpNMCustomDraw = (LPNMTVCUSTOMDRAW)lParam;
switch (lpNMCustomDraw->nmcd.dwDrawStage)
{
case CDDS_PREPAINT:
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT:
CProjectNode *pNode = (CProjectNode *)lpNMCustomDraw->nmcd.lItemlParam;
/*if (pNode == NULL || !(pNode->pItemData->ucFlags & PROJECTITEM_FLAG_ISLOCKED))
{
bHandled = false;
return CDRF_DODEFAULT;
}
lpNMCustomDraw->clrText = GetSysColor(COLOR_GRAYTEXT);
return CDRF_NEWFONT;*/
if (pNode != NULL && pNode->pItemData->ucFlags & PROJECTITEM_FLAG_ISIMPORTED)
{
lpNMCustomDraw->clrText = PROJECTTREEVIEW_COLOR_IMPORTED;
return CDRF_NEWFONT;
}
if (pNode != NULL && pNode->pItemData->ucFlags & PROJECTITEM_FLAG_ISLOCKED)
{
lpNMCustomDraw->clrText = GetSysColor(COLOR_GRAYTEXT);
return CDRF_NEWFONT;
}
bHandled = false;
return CDRF_DODEFAULT;
}
bHandled = false;
return CDRF_DODEFAULT;
}
void CProjectTreeViewCtrl::BeginDrag(LPNMTREEVIEW pNMTreeView)
{
if (((CProjectNode *)GetItemData(pNMTreeView->itemNew.hItem))->pItemData->ucFlags & PROJECTITEM_FLAG_ISPROJECTROOT)
return;
CProjectDropSource *pDropSource = new CProjectDropSource();
CProjectDataObject *pDataObject = new CProjectDataObject();
// Add all file names to the data object.
pDataObject->AddFile(((CProjectNode *)GetItemData(pNMTreeView->itemNew.hItem))->pItemData);
pDataObject->SetParent((CProjectNode *)GetItemData(GetParentItem(pNMTreeView->itemNew.hItem)));
DWORD dwEffect = 0;
::DoDragDrop(pDataObject,pDropSource,DROPEFFECT_MOVE,&dwEffect);
pDropSource->Release();
pDataObject->Release();
}
void CProjectTreeViewCtrl::ForceRedraw()
{
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient,true);
}
================================================
FILE: src/app/control/project_tree_view_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include "ctrl_messages.hh"
#include "tree_manager.hh"
#include "project_drop_target_base.hh"
#define PROJECTTREEVIEW_COLOR_IMPORTED RGB(92,53,102)
class CProjectTreeViewDropTarget : public CProjectDropTargetBase
{
private:
CTreeViewCtrlEx *m_pHost;
bool HandleDropData(IDataObject *pDataObject,CProjectNode *pTargetNode);
public:
CProjectTreeViewDropTarget(CTreeViewCtrlEx *pHost);
bool OnDragOver(POINTL ptCursor);
bool OnDrop(POINTL ptCursor,IDataObject *pDataObject);
void OnDragLeave();
};
class CProjectTreeViewCtrl : public CWindowImpl
{
public:
CProjectTreeViewDropTarget *m_pDropTarget;
DECLARE_WND_CLASS(_T("ckProjectTreeViewCtrl"));
CProjectTreeViewCtrl();
~CProjectTreeViewCtrl();
BEGIN_MSG_MAP(CProjectTreeViewCtrl)
MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus)
MESSAGE_HANDLER(WM_CONTROLCUSTOMDRAW,OnCustomDraw)
END_MSG_MAP()
LRESULT OnSetFocus(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnCustomDraw(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
void BeginDrag(LPNMTREEVIEW pNMTreeView);
void ForceRedraw();
};
================================================
FILE: src/app/control/shell_list_view_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "shell_list_view_ctrl.hh"
#include "ctrl_messages.hh"
#include "version.hh"
unsigned int CF_IDLIST = ::RegisterClipboardFormat(CFSTR_SHELLIDLIST);
CShellListViewCtrl::CShellListViewCtrl(HWND hWndParent,HWND hWndReceiver) : m_dwRef(0)
{
m_hWndParent = hWndParent;
m_hWnd = NULL;
if (hWndReceiver == NULL)
m_hWndReceiver = m_hWndParent;
else
m_hWndReceiver = hWndReceiver;
m_pParentShellFolder = NULL;
m_pShellView = NULL;
// Used when collecting item data.
m_hItemsMem = NULL;
m_pidl = NULL;
}
CShellListViewCtrl::~CShellListViewCtrl()
{
FreeMemberPointers();
// Make sure that no selection memory is still allocated.
if (m_hItemsMem != NULL)
EndGetItems();
}
HWND CShellListViewCtrl::GetListViewHandle()
{
if (!m_hWnd)
return NULL;
// Find the list view control.
HWND hWndListView = FindWindowEx(m_hWnd,NULL,WC_LISTVIEW,NULL);
if (!::IsWindowVisible(hWndListView))
{
hWndListView = FindWindowEx(m_hWnd,NULL,_T("ThumbnailVwExtWnd32"),NULL);
hWndListView = FindWindowEx(hWndListView,NULL,WC_LISTVIEW,NULL);
}
return hWndListView;
}
void CShellListViewCtrl::FreeMemberPointers()
{
if (m_pShellView)
{
m_pShellView->UIActivate(SVUIA_DEACTIVATE);
m_pShellView->DestroyViewWindow();
m_pShellView->Release();
}
if (m_pParentShellFolder)
m_pParentShellFolder->Release();
m_pShellView = NULL;
m_pParentShellFolder = NULL;
}
IShellFolder *CShellListViewCtrl::GetParentShellFolder()
{
return m_pParentShellFolder;
}
bool CShellListViewCtrl::IsFolder(LPCITEMIDLIST pidl,IShellFolder *psfParent)
{
ATLASSERT(NULL != psfParent);
if (!psfParent)
return false;
DWORD dwAttribs = SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_BROWSABLE;
HRESULT hResult = psfParent->GetAttributesOf(1,&pidl,&dwAttribs);
return ((S_OK == hResult &&
(dwAttribs & SFGAO_FOLDER) != 0 &&
((dwAttribs & SFGAO_FILESYSTEM) != 0 ||
(dwAttribs & SFGAO_FILESYSANCESTOR) != 0)) && !(dwAttribs & SFGAO_BROWSABLE));
}
bool CShellListViewCtrl::IsFolderLink(LPCITEMIDLIST pidl,LPITEMIDLIST *pOutPidl)
{
ATLASSERT(m_pParentShellFolder);
if (!m_pParentShellFolder)
return false;
// Is pidl a link?
DWORD dwAttribs = SFGAO_LINK;
m_pParentShellFolder->GetAttributesOf(1,&pidl,&dwAttribs);
if (!(dwAttribs & SFGAO_LINK))
return false;
// Get the link object.
IShellLink *pLink;
if (NOERROR != m_pParentShellFolder->GetUIObjectOf(m_hWnd,1,&pidl,IID_IShellLink,0,
(void**)&pLink))
{
return false;
}
// Get link target's pidl.
LPITEMIDLIST rPidl = NULL,pidlParent = NULL,pidlChild = NULL;
if (NOERROR == pLink->GetIDList(&rPidl))
{
IShellFolder *psf;
if (NOERROR == SHGetDesktopFolder(&psf))
{
// If pidl is complex (it probably is), split into parent/child pidls first.
if (m_PidlHelp.Split(rPidl,&pidlParent,&pidlChild))
{
IShellFolder *psf2;
if (NOERROR == psf->BindToObject(pidlParent,NULL,IID_IShellFolder,
reinterpret_cast(&psf2)))
{
if (!IsFolder(pidlChild,psf2))
m_PidlHelp.FreePidl(rPidl);
psf2->Release();
}
m_PidlHelp.FreePidl(pidlParent);
m_PidlHelp.FreePidl(pidlChild);
}
else if (!IsFolder(rPidl,psf))
{
m_PidlHelp.FreePidl(rPidl);
}
psf->Release();
}
}
pLink->Release();
if (rPidl)
{
if (pOutPidl)
*pOutPidl = rPidl;
else
m_PidlHelp.FreePidl(rPidl);
return true;
}
return false;
}
STDMETHODIMP CShellListViewCtrl::QueryInterface(REFIID iid,void **ppvObject)
{
if (ppvObject == NULL)
return E_POINTER;
*ppvObject = NULL;
if (iid == IID_IUnknown)
*ppvObject = (IUnknown *)(IShellBrowser *)this;
else if (iid == IID_IOleWindow)
*ppvObject = (IOleWindow *)this;
else if (iid == IID_IShellBrowser)
*ppvObject = (IShellBrowser *)this;
else if (iid == IID_ICommDlgBrowser)
*ppvObject = (ICommDlgBrowser *)this;
else
return E_NOINTERFACE;
((IUnknown *)(*ppvObject))->AddRef();
return S_OK;
}
STDMETHODIMP_(ULONG) CShellListViewCtrl::AddRef()
{
return ++m_dwRef;
}
STDMETHODIMP_(ULONG) CShellListViewCtrl::Release()
{
return --m_dwRef;
}
STDMETHODIMP CShellListViewCtrl::ContextSensitiveHelp(BOOL fEnterMode)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::GetWindow(HWND *lphwnd)
{
*lphwnd = m_hWndParent;
return S_OK;
}
STDMETHODIMP CShellListViewCtrl::IncludeObject(THIS_ struct IShellView *ppshv,
LPCITEMIDLIST pidl)
{
// TODO: Implement filtering support.
/*if (isISO(pidl))
return S_OK; // Show it.
return S_FALSE; // Hide it.*/
return S_OK;
}
STDMETHODIMP CShellListViewCtrl::OnDefaultCommand(THIS_ struct IShellView *ppshv)
{
CIDA *pData = BeginGetItems(true);
char *pcData = reinterpret_cast(pData) + pData->aoffset[1];
LPCITEMIDLIST pidl = (LPITEMIDLIST)pcData;
TCHAR szNewPathName[MAX_PATH];
if (!m_PidlHelp.GetPathName(m_pParentShellFolder,pidl,szNewPathName,MAX_PATH - 1))
return E_FAIL;
LPITEMIDLIST pidlTo = NULL;
// Check if we're dealing with a folder or a folder link.
if (IsFolder(pidl,m_pParentShellFolder))
{
// Notify the receiver that a new folder will be opened.
::SendMessage(m_hWndReceiver,WM_SLVC_CHANGEFOLDER,(WPARAM)pidl,(LPARAM)szNewPathName);
BrowseObject(pidl,SBSP_SAMEBROWSER | SBSP_RELATIVE);
}
else if (IsFolderLink(pidl,&pidlTo))
{
// Notify the receiver that we will open a shortcut. Shortcuts should be notified
// in a different way than regular folders since it will require a deeper search
// in the folder tree to find the new path.
m_PidlHelp.GetPathName(m_pParentShellFolder,pidlTo,szNewPathName,MAX_PATH - 1);
::SendMessage(m_hWndReceiver,WM_SLVC_CHANGEFOLDERLINK,(WPARAM)pidl,(LPARAM)szNewPathName);
BrowseObject(pidlTo,SBSP_SAMEBROWSER | SBSP_ABSOLUTE);
}
else
{
if (::SendMessage(m_hWndReceiver,WM_SLVC_FILECOMMAND,(WPARAM)pidl,(LPARAM)szNewPathName) == 1)
{
if (pidlTo)
m_PidlHelp.FreePidl(pidlTo);
EndGetItems();
return NOERROR;
}
EndGetItems();
return E_NOTIMPL;
}
if (pidlTo)
m_PidlHelp.FreePidl(pidlTo);
EndGetItems();
return NOERROR;
}
STDMETHODIMP CShellListViewCtrl::OnStateChange(THIS_ struct IShellView *ppshv,ULONG uChange)
{
// Handle selection, rename, focus etc.
return E_NOTIMPL;
}
WNDPROC CShellListViewCtrl::m_pOldWndProc = NULL;
LRESULT CALLBACK CShellListViewCtrl::WndProc(HWND hWnd,UINT Msg,
WPARAM wParam, LPARAM lParam)
{
//LRESULT lResult = m_pOldWndProc(hWnd,Msg,wParam,lParam);
LRESULT lResult = 0;
if (::IsWindowUnicode(hWnd))
lResult = ::CallWindowProcW(m_pOldWndProc,hWnd,Msg,wParam,lParam);
else
lResult = ::CallWindowProcA(m_pOldWndProc,hWnd,Msg,wParam,lParam);
// We need to redirect this message to the parent so later on the splitter
// that hosts this control will know that we have activated this window.
// Otherwise the splitter will not know that it should return the focus to
// this window if the focus is stolen by for example the menu.
if (Msg == WM_MOUSEACTIVATE)
::SendMessage(GetParent(hWnd),Msg,wParam,lParam);
return lResult;
}
STDMETHODIMP CShellListViewCtrl::BrowseObject(LPCITEMIDLIST pidl,UINT wFlags)
{
if (wFlags & SBSP_PARENT && !m_pidl)
return E_FAIL;
if (wFlags & SBSP_RELATIVE && !m_pParentShellFolder)
return E_FAIL;
IShellFolder *pShellFolder = m_pParentShellFolder;
LPITEMIDLIST pidlCopy = NULL;
HRESULT hr = E_FAIL;
// Get IShellFolder, FULLY QUALIFIED pidl. Check if we are dealing with the desktop.
if (pidl == NULL && !(wFlags & SBSP_PARENT))
{
FreeMemberPointers();
if (SUCCEEDED(SHGetDesktopFolder(&m_pParentShellFolder)))
hr = SHGetSpecialFolderLocation(m_hWndParent,CSIDL_DESKTOP,&pidlCopy);
}
else
{
if (wFlags & SBSP_RELATIVE)
{
// Browse child folder
pidlCopy = ILCombine(m_pidl,pidl);
hr = pShellFolder->BindToObject(pidl,NULL,IID_IShellFolder,
reinterpret_cast(&m_pParentShellFolder));
}
else
{
if (wFlags & SBSP_PARENT)
{
// Browse parent: pidlCopy = parent folder's PIDL.
if (!m_PidlHelp.Split(m_pidl,&pidlCopy,NULL))
return E_FAIL;
}
else
{
// Browse absolute PIDL: pidlCopy = clone(pidl).
pidlCopy = ILClone(pidl);
}
// Create IShellFolder for target PIDL through Desktop folder.
IShellFolder *pShellFolder2;
if (SUCCEEDED(hr = SHGetDesktopFolder(&pShellFolder2)))
{
if (SUCCEEDED(pShellFolder2->BindToObject(pidlCopy,NULL,
IID_IShellFolder, reinterpret_cast(&m_pParentShellFolder))))
{
pShellFolder2->Release();
}
else
{
m_pParentShellFolder = pShellFolder2;
}
}
}
}
if (FAILED(hr))
{
if (pidlCopy)
m_PidlHelp.FreePidl(pidlCopy);
if (m_pParentShellFolder)
m_pParentShellFolder->Release();
m_pParentShellFolder = pShellFolder;
return hr;
}
ATLASSERT(m_pParentShellFolder && pidlCopy);
if (!m_pParentShellFolder || !pidlCopy)
return E_FAIL;
// Use the IShellFolder to create a view window
FOLDERSETTINGS fs = { FVM_DETAILS,FWF_SNAPTOGRID/* | FWF_NOICONS*/ };
if (m_pShellView)
m_pShellView->GetCurrentInfo(&fs);
IShellView *pShellView = m_pShellView;
m_pShellView = NULL;
HWND hWndShellView = NULL;
if (SUCCEEDED(hr = m_pParentShellFolder->CreateViewObject(m_hWndParent,IID_IShellView,
reinterpret_cast(&m_pShellView))))
{
hr = m_pShellView->CreateViewWindow(pShellView,&fs,
static_cast(this),&CWindow::rcDefault,&hWndShellView);
}
if (FAILED(hr))
{
if (m_pShellView)
{
m_pShellView->UIActivate(SVUIA_DEACTIVATE);
m_pShellView->DestroyViewWindow();
m_pShellView->Release();
m_pShellView = pShellView;
}
m_PidlHelp.FreePidl(pidlCopy);
m_pParentShellFolder->Release();
m_pParentShellFolder = pShellFolder;
return hr;
}
// Restore the original windows procedure to the old window.
if (::IsWindow(m_hWnd) && m_pOldWndProc != NULL)
{
//::SetWindowLongPtr(m_hWnd,GWLP_WNDPROC,(LONG_PTR)m_pOldWndProc);
if (::IsWindowUnicode(m_hWnd))
::SetWindowLongPtrW(m_hWnd,GWLP_WNDPROC,(LONG_PTR)m_pOldWndProc);
else
::SetWindowLongPtrA(m_hWnd,GWLP_WNDPROC,(LONG_PTR)m_pOldWndProc);
}
m_hWnd = hWndShellView;
// Update the window to use our modified procedure.
//m_pOldWndProc = (WNDPROC)::GetWindowLongPtr(m_hWnd,GWLP_WNDPROC);
//::SetWindowLongPtr(m_hWnd,GWLP_WNDPROC,(LONG_PTR)WndProc);
if (::IsWindowUnicode(m_hWnd))
{
m_pOldWndProc = (WNDPROC)::GetWindowLongPtrW(m_hWnd,GWLP_WNDPROC);
::SetWindowLongPtrW(m_hWnd,GWLP_WNDPROC,(LONG_PTR)WndProc);
}
else
{
m_pOldWndProc = (WNDPROC)::GetWindowLongPtrA(m_hWnd,GWLP_WNDPROC);
::SetWindowLongPtrA(m_hWnd,GWLP_WNDPROC,(LONG_PTR)WndProc);
}
if (m_pidl)
m_PidlHelp.FreePidl(m_pidl);
m_pidl = pidlCopy;
if (pShellView != NULL)
{
pShellView->UIActivate(SVUIA_DEACTIVATE);
pShellView->DestroyViewWindow();
pShellView->Release();
}
if (pShellFolder)
pShellFolder->Release();
// Only set the focus to the new list view if the old shell list view instance
// had the focus.
bool bSetFocus = ::GetFocus() == GetListViewHandle();
// Notify the receiver.
::SendMessage(m_hWndReceiver,WM_SLVC_BROWSEOBJECT,0,(LPARAM)m_hWnd);
m_pShellView->UIActivate(bSetFocus ? SVUIA_ACTIVATE_FOCUS : SVUIA_ACTIVATE_NOFOCUS);
// Select first item in list view.
HWND hWndListView = FindWindowEx(m_hWnd,NULL,WC_LISTVIEW,NULL);
ListView_SetItemState(hWndListView,0,LVIS_FOCUSED | LVIS_SELECTED,0x000F);
::ShowWindow(hWndListView,SW_NORMAL);
// Update the combobox.
::SendMessage(m_hWndReceiver,WM_SLVC_DONEBROWSEOBJECT,0,(LPARAM)m_hWnd);
// Subclass the internal list view.
// UPDATE: Causes the list view to turn white when double-clicking on a
// folder in the explorer view.
/*if (hWndListView != NULL)
{
if (m_InternalListView.m_hWnd != NULL)
{
m_InternalListView.UnsubclassWindow();
}
m_InternalListView.SubclassWindow(hWndListView);
m_InternalListView.SetHost(m_pShellView);
// Force the WS_EX_CLIENTEDGE style on Windows Vista (which disables it by default).
if (g_WinVer.m_ulMajorVersion == MAJOR_WINVISTA)
m_InternalListView.ModifyStyleEx(0,WS_EX_CLIENTEDGE,SWP_FRAMECHANGED);
}*/
if (hWndListView != NULL)
{
// Force the WS_EX_CLIENTEDGE style on Windows Vista (which disables it by default).
if (g_WinVer.m_ulMajorVersion == MAJOR_WINVISTA)
{
unsigned long ulStyle = ::GetWindowLong(hWndListView,GWL_EXSTYLE);
::SetWindowLong(hWndListView,GWL_EXSTYLE,ulStyle | WS_EX_CLIENTEDGE);
::SetWindowPos(hWndListView,NULL,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE |
SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
}
}
return NOERROR;
}
STDMETHODIMP CShellListViewCtrl::EnableModelessSB(BOOL fEnable)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::GetControlWindow(UINT id,HWND *lphwnd)
{
if (lphwnd == NULL)
return E_POINTER;
/*if (FCW_STATUS == id)
{
*lphwnd = m_hWndStatusBar;
return S_OK;
}*/
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::GetViewStateStream(DWORD grfMode,LPSTREAM *ppStrm)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::InsertMenusSB(HMENU hmenuShared,
LPOLEMENUGROUPWIDTHS lpMenuWidths)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::OnViewWindowActive(struct IShellView *ppshv)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::QueryActiveShellView(struct IShellView **ppshv)
{
m_pShellView->AddRef();
*ppshv = m_pShellView;
return S_OK;
}
STDMETHODIMP CShellListViewCtrl::RemoveMenusSB(HMENU hmenuShared)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::SendControlMsg(UINT id,UINT uMsg,WPARAM wParam,
LPARAM lParam,LRESULT *pret)
{
if(pret == NULL)
return E_POINTER;
/*if (FCW_STATUS == id)
{
*pret = ::SendMessage(m_hWndStatusBar,uMsg,wParam,lParam);
return S_OK;
}*/
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::SetMenuSB(HMENU hmenuShared,HOLEMENU holemenuReserved,HWND hwndActiveObject)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::SetStatusTextSB(LPCOLESTR lpszStatusText)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::SetToolbarItems(LPTBBUTTON lpButtons,UINT nButtons,UINT uFlags)
{
return E_NOTIMPL;
}
STDMETHODIMP CShellListViewCtrl::TranslateAcceleratorSB(LPMSG lpmsg,WORD wID)
{
return S_OK;
}
bool CShellListViewCtrl::IsAtTop()
{
return m_pidl->mkid.cb < 1;
}
CIDA *CShellListViewCtrl::BeginGetItems(bool bSelected)
{
if (m_hItemsMem != NULL)
EndGetItems();
IDataObject *pSelection;
HRESULT hResult = m_pShellView->GetItemObject(bSelected ? SVGIO_SELECTION : SVGIO_ALLVIEW,
IID_IDataObject,(void **)&pSelection);
if (!SUCCEEDED(hResult))
return NULL;
// CFSTR_SHELLIDLIST
FORMATETC fetc;
fetc.cfFormat = static_cast(CF_IDLIST);
fetc.dwAspect = DVASPECT_CONTENT;
fetc.ptd = NULL;
fetc.lindex = -1;
fetc.tymed = TYMED_HGLOBAL;
hResult = pSelection->QueryGetData(&fetc);
if (!SUCCEEDED(hResult))
return NULL;
STGMEDIUM stm;
hResult = pSelection->GetData(&fetc,&stm);
if (!SUCCEEDED(hResult))
return NULL;
CIDA *pData = (CIDA *)GlobalLock(stm.hGlobal);
if (pData == NULL)
return NULL;
if (pData == NULL || pData->cidl < 1)
return NULL;
return pData;
}
void CShellListViewCtrl::EndGetItems()
{
GlobalUnlock(m_hItemsMem);
m_hItemsMem = NULL;
}
================================================
FILE: src/app/control/shell_list_view_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include "pidl_helper.hh"
class CShellListViewCtrl : public IShellBrowser, public ICommDlgBrowser
{
private:
// Internal list view class used for translating the default shell hot keys.
/*class CInternalListViewCtrl : public CWindowImpl,
public CMessageFilter
{
private:
IShellView *m_pHostShellView;
bool m_bRegistered;
public:
BEGIN_MSG_MAP(CInternalListViewCtrl)
MESSAGE_HANDLER(WM_SETFOCUS,OnShowWindow)
END_MSG_MAP()
CInternalListViewCtrl()
{
m_bRegistered = false;
}
virtual BOOL PreTranslateMessage(MSG *pMsg)
{
if (GetFocus() == m_hWnd)
{
if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST)
{
if (m_pHostShellView->TranslateAccelerator(pMsg) == S_OK)
return TRUE;
}
}
return FALSE;
}
LRESULT OnKeyDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST)
{
MSG Msg;
Msg.message = uMsg;
Msg.wParam = wParam;
Msg.lParam = lParam;
if (m_pHostShellView->TranslateAccelerator(&Msg) == S_OK)
{
bHandled = true;
return TRUE;
}
}
bHandled = false;
return 0;
}
LRESULT OnShowWindow(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (!m_bRegistered)
{
AddToMessageLoop();
m_bRegistered = true;
}
bHandled = false;
return 0;
}
void SetHost(IShellView *pHostShellView)
{
m_pHostShellView = pHostShellView;
}
void AddToMessageLoop()
{
CMessageLoop *pLoop = _Module.GetMessageLoop();
pLoop->AddMessageFilter(this);
}
void RemoveFromMessageLoop()
{
CMessageLoop *pLoop = _Module.GetMessageLoop();
pLoop->RemoveMessageFilter(this);
}
};
CInternalListViewCtrl m_InternalListView;*/
static WNDPROC m_pOldWndProc;
static LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam, LPARAM lParam);
DWORD m_dwRef;
HWND m_hWndParent;
HWND m_hWndReceiver;
HWND m_hWnd;
IShellFolder *m_pParentShellFolder;
IShellView *m_pShellView;
HGLOBAL m_hItemsMem;
CPidlHelper m_PidlHelp;
LPITEMIDLIST m_pidl;
void FreeMemberPointers();
bool IsFolder(LPCITEMIDLIST pidl,IShellFolder *psfParent);
bool IsFolderLink(LPCITEMIDLIST pidl,LPITEMIDLIST *pOutPidl);
//HWND GetListViewHandle();
public:
CShellListViewCtrl(HWND hWndParent,HWND hWndReceiver = NULL);
~CShellListViewCtrl();
HWND GetListViewHandle();
// IUnknown members.
STDMETHOD(QueryInterface)(REFIID iid,void **ppvObject);
STDMETHOD_(ULONG,AddRef)();
STDMETHOD_(ULONG,Release)();
// IOleWindow members.
STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
STDMETHOD(GetWindow)(HWND *lphwnd);
// ICommDlgBrowser members.
STDMETHOD(IncludeObject)(THIS_ struct IShellView *ppshv,LPCITEMIDLIST pidl);
STDMETHOD(OnDefaultCommand)(THIS_ struct IShellView *ppshv);
STDMETHOD(OnStateChange)(THIS_ struct IShellView *ppshv,ULONG uChange);
// IShellBrowser members (same as IOleInPlaceFrame).
STDMETHOD(BrowseObject)(LPCITEMIDLIST pidl,UINT wFlags);
STDMETHOD(EnableModelessSB)(BOOL fEnable);
STDMETHOD(GetControlWindow)(UINT id,HWND *lphwnd);
STDMETHOD(GetViewStateStream)(DWORD grfMode,LPSTREAM *ppStrm);
STDMETHOD(InsertMenusSB)(HMENU hmenuShared,LPOLEMENUGROUPWIDTHS lpMenuWidths);
STDMETHOD(OnViewWindowActive)(struct IShellView *ppshv);
STDMETHOD(QueryActiveShellView)(struct IShellView **ppshv);
STDMETHOD(RemoveMenusSB)(HMENU hmenuShared);
STDMETHOD(SendControlMsg)(UINT id,UINT uMsg,WPARAM wParam,LPARAM lParam,LRESULT *pret);
STDMETHOD(SetMenuSB)(HMENU hmenuShared,HOLEMENU holemenuReserved,HWND hwndActiveObject);
STDMETHOD(SetStatusTextSB)(LPCOLESTR lpszStatusText);
STDMETHOD(SetToolbarItems)(LPTBBUTTON lpButtons,UINT nButtons,UINT uFlags);
STDMETHOD(TranslateAcceleratorSB)(LPMSG lpmsg,WORD wID);
// Miscellaneous.
IShellFolder *GetParentShellFolder();
bool IsAtTop();
CIDA *BeginGetItems(bool bSelected);
void EndGetItems();
// Operators.
operator HWND ()
{
return m_hWnd;
}
};
================================================
FILE: src/app/control/space_meter.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include "string_table.hh"
#include "lang_util.hh"
#include "version.hh"
#include "space_meter.hh"
CSpaceMeter::CSpaceMeter()
: m_bIsUpdatePending( false )
{
m_iMeterPosition = 0;
m_iMeterSegmentSpacing = 0;
m_hProgressTheme = NULL;
m_iHorIndent = SPACEMETER_BARINDENT_THEMED;
// By default we use the size display mode.
m_iDisplayMode = SPACEMETER_DMSIZE;
// The default draw state is ofcourse normal.
m_iDrawState = SPACEMETER_DRAWSTATE_NORMAL;
m_uiAllocatedSize = 1;
m_uiDiscSize = 1;
m_uiMeterSize = 1;
for (unsigned int i = 0; i < SPACEMETER_METER_COUNT; i++)
lstrcpy(m_uiMeterSegments[i],_T("0 B"));
m_hBarBorderBrush = ::CreateSolidBrush(SPACEMETER_BORDERCOLOR);
m_hWarnBarBorderBrush = ::CreateSolidBrush(SPACEMETER_WARNBORDERCOLOR);
m_hFullBarBorderBrush = ::CreateSolidBrush(SPACEMETER_FULLBORDERCOLOR);
m_ToolTipText.reserve(256);
// Create and fill the popup menu.
m_hPopupMenu = CreatePopupMenu();
FillPopupMenu();
}
CSpaceMeter::~CSpaceMeter()
{
::DeleteObject(m_hBarBorderBrush);
::DeleteObject(m_hWarnBarBorderBrush);
::DeleteObject(m_hFullBarBorderBrush);
// Destroy the popup menu.
if (m_hPopupMenu != NULL)
DestroyMenu(m_hPopupMenu);
// Destroy the tooltip control.
if (m_ToolTip.IsWindow())
m_ToolTip.DestroyWindow();
// Close the progress theme data.
if (m_hProgressTheme != NULL)
g_VisualStyles.CloseThemeData(m_hProgressTheme);
}
void CSpaceMeter::FillPopupMenu()
{
// Remove the old items.
int iMenuItemCount = GetMenuItemCount(m_hPopupMenu);
for (int i = iMenuItemCount - 1; i >= 0; i--)
RemoveMenu(m_hPopupMenu,i,MF_BYPOSITION);
// Add new items (and on the same time convert them to radio items).
unsigned int uiMenuIndex = 0;
unsigned int uiCommand = SPACEMETER_POPUPMENU_IDBASE;
CMenuItemInfo mii;
mii.fMask = 0x100;
mii.fType = MFT_RADIOCHECK;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("DVD 7.96 GiB"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("DVD 4.38 GiB"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("99 min (870 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("90 min (791 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("80 min (703 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("74 min (650 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("24 min (210 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
InsertMenu(m_hPopupMenu,uiMenuIndex,MF_STRING | MF_BYPOSITION,uiCommand++,_T("21 min (185 MiB)"));
SetMenuItemInfo(m_hPopupMenu,uiMenuIndex,TRUE,&mii);
uiMenuIndex++;
}
void CSpaceMeter::DrawBar(HDC hDC,RECT *pClientRect)
{
int iBottom = pClientRect->bottom - SPACEMETER_BARINDENT_BOTTOM;
RECT rcBar = {
pClientRect->left + m_iHorIndent,
iBottom - SPACEMETER_BAR_HEIGHT,
pClientRect->right - m_iHorIndent,
iBottom
};
// Draw the meter.
DrawMeter(hDC,pClientRect,&rcBar);
// Draw a different meter on Windows Vista systems.
if (m_hProgressTheme == NULL)
{
switch (m_iDrawState)
{
case SPACEMETER_DRAWSTATE_NORMAL:
FillRect(hDC,&rcBar,m_hBarBorderBrush);
break;
case SPACEMETER_DRAWSTATE_WARN:
FillRect(hDC,&rcBar,m_hWarnBarBorderBrush);
break;
case SPACEMETER_DRAWSTATE_FULL:
FillRect(hDC,&rcBar,m_hFullBarBorderBrush);
break;
}
ContractRect(&rcBar,1);
// First we draw the free space.
rcBar.left += m_iMeterPosition;
switch (m_iDrawState)
{
case SPACEMETER_DRAWSTATE_NORMAL:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_BARCOLOR_FREETOP,SPACEMETER_BARCOLOR_FREEBOTTOM);
break;
case SPACEMETER_DRAWSTATE_WARN:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_WARNBARCOLOR_FREETOP,SPACEMETER_WARNBARCOLOR_FREEBOTTOM);
break;
case SPACEMETER_DRAWSTATE_FULL:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_FULLBARCOLOR_FREETOP,SPACEMETER_FULLBARCOLOR_FREEBOTTOM);
break;
}
// Next we draw the allocated space.
rcBar.left -= m_iMeterPosition;
rcBar.right = m_iMeterPosition + m_iHorIndent + 1;
switch (m_iDrawState)
{
case SPACEMETER_DRAWSTATE_NORMAL:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_BARCOLOR_TOP,SPACEMETER_BARCOLOR_BOTTOM);
break;
case SPACEMETER_DRAWSTATE_WARN:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_WARNBARCOLOR_TOP,SPACEMETER_WARNBARCOLOR_BOTTOM);
break;
case SPACEMETER_DRAWSTATE_FULL:
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_FULLBARCOLOR_TOP,SPACEMETER_FULLBARCOLOR_BOTTOM);
break;
}
}
else
{
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,11,2,&rcBar,NULL);
// Draw the allocated space.
//rcBar.left++;
rcBar.right = m_iMeterPosition + m_iHorIndent + 1;
switch (m_iDrawState)
{
case SPACEMETER_DRAWSTATE_NORMAL:
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,5,4,&rcBar,NULL);
break;
case SPACEMETER_DRAWSTATE_WARN:
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,5,3,&rcBar,NULL);
break;
case SPACEMETER_DRAWSTATE_FULL:
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,5,2,&rcBar,NULL);
break;
}
}
}
void CSpaceMeter::DrawFullBar(HDC hDC,RECT *pClientRect)
{
int iBottom = pClientRect->bottom - SPACEMETER_BARINDENT_BOTTOM;
RECT rcBar = {
pClientRect->left + m_iHorIndent,
iBottom - SPACEMETER_BAR_HEIGHT,
pClientRect->right - m_iHorIndent,
iBottom
};
// Draw the meter.
DrawMeter(hDC,pClientRect,&rcBar);
// Draw a different meter on Windows Vista systems.
if (m_hProgressTheme == NULL)
{
FillRect(hDC,&rcBar,m_hFullBarBorderBrush);
ContractRect(&rcBar,1);
// Draw the allocated space.
DrawVertGradientRect(hDC,&rcBar,SPACEMETER_FULLBARCOLOR_TOP,SPACEMETER_FULLBARCOLOR_BOTTOM);
}
else
{
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,11,2,&rcBar,NULL);
// Draw the allocated space.
g_VisualStyles.DrawThemeBackground(m_hProgressTheme,hDC,5,2,&rcBar,NULL);
}
}
void CSpaceMeter::DrawMeter(HDC hDC,RECT *pClientRect,RECT *pBarRect)
{
int iLineTop = pBarRect->bottom + SPACEMETER_METER_SPACING;
RECT rcLine = { 0, iLineTop, 0, iLineTop + SPACEMETER_METER_HEIGHT };
RECT rcText = { 0, iLineTop, pBarRect->right, pClientRect->bottom };
HFONT hOldFont = (HFONT)SelectObject(hDC,AtlGetDefaultGuiFont());
for (unsigned int i = 0; i < SPACEMETER_METER_COUNT; i++)
{
// Draw the line.
rcLine.left = pBarRect->left + i * m_iMeterSegmentSpacing;
rcLine.right = rcLine.left + 1;
::FillRect(hDC,&rcLine,::GetSysColorBrush(COLOR_WINDOWTEXT));
// Draw the text.
::SetBkMode(hDC,TRANSPARENT);
::SetTextColor(hDC,::GetSysColor(COLOR_WINDOWTEXT));
rcText.left = rcLine.left + SPACEMETER_METERTEXT_INDENT_LEFT;
DrawText(hDC,m_uiMeterSegments[i],lstrlen(m_uiMeterSegments[i]),&rcText,
DT_LEFT | DT_END_ELLIPSIS | DT_SINGLELINE);
}
SelectObject(hDC,hOldFont);
}
void CSpaceMeter::UpdateMeter(int iClientWidth)
{
int iMeterWidth = iClientWidth - m_iHorIndent - m_iHorIndent - 2;
m_iMeterSegmentSpacing = iMeterWidth / SPACEMETER_METER_COUNT;
unsigned __int64 uiAllocatedSize = min(m_uiAllocatedSize,m_uiMeterSize);
m_iMeterPosition = (int)(((float)uiAllocatedSize / m_uiMeterSize) * iMeterWidth);
}
void CSpaceMeter::UpdateToolTip()
{
TCHAR szBuffer[ 200 ]; // Must be bigger than szFormattedInt, see below.
const TCHAR *szUsed = lngGetString(SPACEMETER_USED);
const TCHAR *szFree = lngGetString(SPACEMETER_FREE);
unsigned __int64 uiFree = m_uiAllocatedSize > m_uiDiscSize ? 0 : m_uiDiscSize - m_uiAllocatedSize;
if (m_iDisplayMode == SPACEMETER_DMSIZE)
{
TCHAR szFormattedInt[ 160 ];
// Used.
m_ToolTipText = szUsed;
FormatBytes(szBuffer,m_uiAllocatedSize);
m_ToolTipText += szBuffer;
FormatInteger( m_uiAllocatedSize, szFormattedInt, _countof( szFormattedInt ) );
lsnprintf_s(szBuffer,64,_T(" (%s Bytes)\r\n"),szFormattedInt);
m_ToolTipText += szBuffer;
// Free.
m_ToolTipText += szFree;
FormatBytes(szBuffer,uiFree);
m_ToolTipText += szBuffer;
FormatInteger( uiFree, szFormattedInt, _countof( szFormattedInt ) );
lsnprintf_s(szBuffer,64,_T(" (%s Bytes)"),szFormattedInt);
m_ToolTipText += szBuffer;
}
else
{
// Used.
m_ToolTipText = szUsed;
lsnprintf_s(szBuffer,64,lngGetString(MISC_MINUTES),m_uiAllocatedSize/(1000 * 60));
m_ToolTipText += szBuffer;
m_ToolTipText += _T("\r\n");
// Free.
m_ToolTipText += szFree;
lsnprintf_s(szBuffer,64,lngGetString(MISC_MINUTES),uiFree/(1000 * 60));
m_ToolTipText += szBuffer;
}
}
void CSpaceMeter::SetDiscSize(unsigned int uiDiscSize)
{
for (unsigned int i = 0; i < SPACEMETER_POPUPMENU_COUNT; i++)
::CheckMenuItem(m_hPopupMenu,i,MF_BYPOSITION | MF_UNCHECKED);
switch (uiDiscSize)
{
case SPACEMETER_SIZE_DLDVD:
m_uiDiscSize = 8547991552;
::CheckMenuItem(m_hPopupMenu,0,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_DVD:
m_uiDiscSize = 4702989189;
::CheckMenuItem(m_hPopupMenu,1,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_870MB:
m_uiDiscSize = 912261120;
::CheckMenuItem(m_hPopupMenu,2,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_791MB:
m_uiDiscSize = 829423616;
::CheckMenuItem(m_hPopupMenu,3,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_703MB:
m_uiDiscSize = 737148928;
::CheckMenuItem(m_hPopupMenu,4,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_650MB:
m_uiDiscSize = 681574400;
::CheckMenuItem(m_hPopupMenu,5,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_210MB:
m_uiDiscSize = 220200960;
::CheckMenuItem(m_hPopupMenu,6,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_185MB:
m_uiDiscSize = 193986560;
::CheckMenuItem(m_hPopupMenu,7,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_1020MIN: // This is incorrect, I have not been able to find how many sectors a dual layer DVD can contain.
m_uiDiscSize = 1020 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,0,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_510MIN:
m_uiDiscSize = 510 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,1,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_99MIN:
m_uiDiscSize = 99 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,2,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_90MIN:
m_uiDiscSize = 90 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,3,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_80MIN:
m_uiDiscSize = 80 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,4,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_74MIN:
m_uiDiscSize = 74 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,5,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_24MIN:
m_uiDiscSize = 24 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,6,MF_BYPOSITION | MF_CHECKED);
break;
case SPACEMETER_SIZE_21MIN:
m_uiDiscSize = 21 * 1000 * 60;
::CheckMenuItem(m_hPopupMenu,7,MF_BYPOSITION | MF_CHECKED);
break;
}
unsigned __int64 uiSegmentSize = m_uiDiscSize / (SPACEMETER_METER_COUNT - 1);
unsigned __int64 uiCurSegment = 0;
if (m_iDisplayMode == SPACEMETER_DMSIZE)
{
for (unsigned int i = 0; i < SPACEMETER_METER_COUNT; i++)
{
// For segments larger than 1GB we allow two decimals (by using the standard FormatBytes function).
if (m_uiMeterSegments[i],uiCurSegment > 1024 * 1024 * 1024)
FormatBytes(m_uiMeterSegments[i],uiCurSegment);
else
FormatBytesEx(m_uiMeterSegments[i],uiCurSegment);
uiCurSegment += uiSegmentSize;
}
}
else
{
for (unsigned int i = 0; i < SPACEMETER_METER_COUNT; i++)
{
// Minutes.
lsnprintf_s(m_uiMeterSegments[i],SPACEMETER_METERTEXT_SIZE,_T("%d min"),uiCurSegment/(1000 * 60));
uiCurSegment += uiSegmentSize;
}
}
// The meter hold the disc size + one segment.
m_uiMeterSize = m_uiDiscSize + uiSegmentSize;
}
void CSpaceMeter::SetAllocatedSize(unsigned __int64 uiAllocatedSize)
{
m_uiAllocatedSize = uiAllocatedSize;
RequestDelayedUpdate();
}
void CSpaceMeter::IncreaseAllocatedSize(unsigned __int64 uiSize)
{
SetAllocatedSize(m_uiAllocatedSize + uiSize);
}
void CSpaceMeter::DecreaseAllocatedSize(unsigned __int64 uiSize)
{
SetAllocatedSize(m_uiAllocatedSize - uiSize);
}
void CSpaceMeter::RequestDelayedUpdate()
{
if ( m_bIsUpdatePending )
return;
ATLVERIFY( 0 != PostMessage( WMU_SPACE_METER_DELAYED_UPDATE, 0, 0 ) );
m_bIsUpdatePending = true;
}
LRESULT CSpaceMeter::OnDelayedUpdate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
ATLASSERT( uMsg == WMU_SPACE_METER_DELAYED_UPDATE );
ATLASSERT( wParam == 0 );
ATLASSERT( lParam == 0 );
m_bIsUpdatePending = false;
if (m_uiAllocatedSize > m_uiMeterSize)
m_iDrawState = SPACEMETER_DRAWSTATE_OUTOFSCOPE;
else if (m_uiAllocatedSize > m_uiDiscSize)
{
unsigned __int64 uiOverBurnAmount = m_iDisplayMode == SPACEMETER_DMSIZE ?
SPACEMETER_OVERBURNSIZE : SPACEMETER_OVERBURNLENGTH;
if (m_uiAllocatedSize < m_uiDiscSize + uiOverBurnAmount)
m_iDrawState = SPACEMETER_DRAWSTATE_WARN;
else
m_iDrawState = SPACEMETER_DRAWSTATE_FULL;
}
else
{
m_iDrawState = SPACEMETER_DRAWSTATE_NORMAL;
}
// Update the meter.
RECT rcClient;
GetClientRect(&rcClient);
UpdateMeter(rcClient.right);
// Finally update the tooltip text buffer.
UpdateToolTip();
// Trigger a repaint.
RECT rcSpaceMeter;
GetClientRect(&rcSpaceMeter);
InvalidateRect(&rcSpaceMeter,true);
bHandled = true;
return 0; // Return value unused.
}
unsigned __int64 CSpaceMeter::GetAllocatedSize()
{
return m_uiAllocatedSize;
}
void CSpaceMeter::SetDisplayMode(int iDisplayMode)
{
m_iDisplayMode = iDisplayMode;
}
void CSpaceMeter::Initialize()
{
// Create the tool tip.
m_ToolTip.Create(m_hWnd);
m_ToolTip.SetMaxTipWidth(200);
CToolInfo ti(0,m_hWnd,SPACEMETER_TOOLTIP_ID,NULL,LPSTR_TEXTCALLBACK);
m_ToolTip.AddTool(&ti);
m_ToolTip.Activate(true);
// Initialize the progress theme data.
if (g_WinVer.m_ulMajorVersion == MAJOR_WINVISTA &&
g_WinVer.m_ulMinorVersion == MINOR_WINVISTA)
{
m_hProgressTheme = g_VisualStyles.OpenThemeData(m_hWnd,L"PROGRESS");
}
}
LRESULT CSpaceMeter::OnCreate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
// If the application is themed, we use a different horizontal indentation.
if (!g_VisualStyles.IsThemeActive())
m_iHorIndent = SPACEMETER_BARINDENT_NORMAL;
return 0;
}
LRESULT CSpaceMeter::OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
LRESULT lResult = DefWindowProc(uMsg,wParam,lParam);
unsigned int uiWidth = LOWORD(lParam);
UpdateMeter(uiWidth);
// Update the tooltip region.
if (m_ToolTip.IsWindow())
{
RECT rcClient = { 0,0,uiWidth,HIWORD(lParam) };
m_ToolTip.SetToolRect(m_hWnd,SPACEMETER_TOOLTIP_ID,&rcClient);
}
return lResult;
}
LRESULT CSpaceMeter::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
CPaintDC dc(m_hWnd);
RECT rcClient;
GetClientRect(&rcClient);
HDC hMemDC;
HBITMAP hMemBitmap;
hMemDC = CreateCompatibleDC(dc);
hMemBitmap = CreateCompatibleBitmap(dc,rcClient.right,rcClient.bottom);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC,hMemBitmap);
// Draw the background.
FillRect(hMemDC,&rcClient,GetSysColorBrush(COLOR_BTNFACE));
// Draw the bar.
if (m_iDrawState == SPACEMETER_DRAWSTATE_OUTOFSCOPE)
DrawFullBar(hMemDC,&rcClient); // Just a faster draw method.
else
DrawBar(hMemDC,&rcClient);
BitBlt(dc,0,0,rcClient.right,rcClient.bottom,hMemDC,0,0,SRCCOPY);
SelectObject(hMemDC,hOldBitmap);
ReleaseDC(dc);
DeleteDC(hMemDC);
DeleteObject(hMemBitmap);
return 0;
}
LRESULT CSpaceMeter::OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
return true;
}
LRESULT CSpaceMeter::OnRButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
POINT CursorPos;
GetCursorPos(&CursorPos);
TrackPopupMenuEx(m_hPopupMenu,0,CursorPos.x,CursorPos.y,m_hWnd,NULL);
bHandled = false;
return 0;
}
LRESULT CSpaceMeter::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
if (m_ToolTip.IsWindow())
{
MSG Msg = { m_hWnd,uMsg,wParam,lParam };
m_ToolTip.RelayEvent(&Msg);
}
bHandled = false;
return 0;
}
LRESULT CSpaceMeter::OnGetDispInfo(int idCtrl,LPNMHDR pnmh,BOOL &bHandled)
{
// Make sure that the notification is about the control we care about.
if (pnmh->hwndFrom != m_ToolTip)
{
bHandled = FALSE;
return 0;
}
LPNMTTDISPINFO pNMTDI = (LPNMTTDISPINFO)pnmh;
pNMTDI->lpszText = const_cast(m_ToolTipText.c_str());
return 0;
}
LRESULT CSpaceMeter::OnPopupMenuClick(UINT uNotifyCode,int nID,CWindow wnd)
{
nID -= SPACEMETER_POPUPMENU_IDBASE;
if (m_iDisplayMode == SPACEMETER_DMSIZE)
SetDiscSize(nID);
else
SetDiscSize(nID + SPACEMETER_POPUPMENU_COUNT);
SetAllocatedSize(m_uiAllocatedSize);
return 0;
}
================================================
FILE: src/app/control/space_meter.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include // COMMAND_RANGE_HANDLER_EX
#include "visual_styles.hh"
#include "ctrl_messages.hh"
#define SPACEMETER_BAR_HEIGHT 10
#define SPACEMETER_BARINDENT_NORMAL 2
#define SPACEMETER_BARINDENT_THEMED 4
#define SPACEMETER_BARINDENT_BOTTOM 16
#define SPACEMETER_METER_SPACING 2
#define SPACEMETER_METER_HEIGHT 2
#define SPACEMETER_METER_COUNT 10
#define SPACEMETER_METERTEXT_SIZE 16
#define SPACEMETER_METERTEXT_INDENT_LEFT 4
/*
New Tango colors.
*/
// Normal colors.
#define SPACEMETER_BORDERCOLOR RGB(32,74,135)
#define SPACEMETER_BARCOLOR_FREETOP RGB(114,159,205)
#define SPACEMETER_BARCOLOR_FREEBOTTOM RGB(255,255,255)
#define SPACEMETER_BARCOLOR_TOP RGB(114,159,205)
#define SPACEMETER_BARCOLOR_BOTTOM RGB(52,101,164)
// Warning colors (when overburning will most probably work).
#define SPACEMETER_WARNBORDERCOLOR RGB(206,92,0)
#define SPACEMETER_WARNBARCOLOR_FREETOP RGB(252,175,62)
#define SPACEMETER_WARNBARCOLOR_FREEBOTTOM RGB(255,255,255)
#define SPACEMETER_WARNBARCOLOR_TOP RGB(252,175,62)
#define SPACEMETER_WARNBARCOLOR_BOTTOM RGB(245,121,0)
// Disc full colors.
#define SPACEMETER_FULLBORDERCOLOR RGB(164,0,0)
#define SPACEMETER_FULLBARCOLOR_FREETOP RGB(239,41,41)
#define SPACEMETER_FULLBARCOLOR_FREEBOTTOM RGB(255,255,255)
#define SPACEMETER_FULLBARCOLOR_TOP RGB(239,41,41)
#define SPACEMETER_FULLBARCOLOR_BOTTOM RGB(204,0,0)
// How many bytes is it safe to overburn.
#define SPACEMETER_OVERBURNSIZE 13516800 // 6600 * 2048 = 13 MiB.
#define SPACEMETER_OVERBURNLENGTH 88 * 1000 // 6600 sectors = 88 seconds.
#define SPACEMETER_DMSIZE 0
#define SPACEMETER_DMLENGTH 1
// Different draw states.
#define SPACEMETER_DRAWSTATE_NORMAL 0
#define SPACEMETER_DRAWSTATE_WARN 1
#define SPACEMETER_DRAWSTATE_FULL 2
#define SPACEMETER_DRAWSTATE_OUTOFSCOPE 3
// Disc sizes (that should be passed to SetDiscSize).
#define SPACEMETER_SIZE_DLDVD 0
#define SPACEMETER_SIZE_DVD 1
#define SPACEMETER_SIZE_870MB 2
#define SPACEMETER_SIZE_791MB 3
#define SPACEMETER_SIZE_703MB 4
#define SPACEMETER_SIZE_650MB 5
#define SPACEMETER_SIZE_210MB 6
#define SPACEMETER_SIZE_185MB 7
#define SPACEMETER_SIZE_1020MIN 8
#define SPACEMETER_SIZE_510MIN 9
#define SPACEMETER_SIZE_99MIN 10
#define SPACEMETER_SIZE_90MIN 11
#define SPACEMETER_SIZE_80MIN 12
#define SPACEMETER_SIZE_74MIN 13
#define SPACEMETER_SIZE_24MIN 14
#define SPACEMETER_SIZE_21MIN 15
// Specifies which ID the first recent menu item will have, the second will have + 1 and so on.
#define SPACEMETER_POPUPMENU_IDBASE 1000
#define SPACEMETER_POPUPMENU_COUNT 8
#define SPACEMETER_TOOLTIP_ID 1042
class CSpaceMeter : public CWindowImpl
{
private:
// These values are for rendering, they should never be altered manually.
int m_iMeterPosition;
int m_iMeterSegmentSpacing;
TCHAR m_uiMeterSegments[SPACEMETER_METER_COUNT][SPACEMETER_METERTEXT_SIZE];
HBRUSH m_hBarBorderBrush;
HBRUSH m_hWarnBarBorderBrush;
HBRUSH m_hFullBarBorderBrush;
// Used for drawing a Vista meter.
HTHEME m_hProgressTheme;
// Horizontal indentation in pixels.
int m_iHorIndent;
int m_iDisplayMode;
int m_iDrawState;
// The following values can be changed from the outside using public functions.
unsigned __int64 m_uiAllocatedSize;
unsigned __int64 m_uiDiscSize;
unsigned __int64 m_uiMeterSize; // How many bytes does the meter display.
// Tooltip.
CToolTipCtrl m_ToolTip;
ckcore::tstring m_ToolTipText;
// Popup menu.
HMENU m_hPopupMenu;
void FillPopupMenu();
void DrawBar(HDC hDC,RECT *pClientRect);
void DrawFullBar(HDC hDC,RECT *pClientRect);
void DrawMeter(HDC hDC,RECT *pClientRect,RECT *pBarRect);
void UpdateMeter(int iClientWidth);
void UpdateToolTip();
bool m_bIsUpdatePending;
public:
DECLARE_WND_CLASS(_T("ckSpaceMeter"));
CSpaceMeter();
~CSpaceMeter();
//void SetDiskSize(unsigned __int64 uiDiskSize);
void SetDiscSize(unsigned int uiDiscSize);
void SetAllocatedSize(unsigned __int64 uiAllocatedSize);
void IncreaseAllocatedSize(unsigned __int64 uiSize);
void DecreaseAllocatedSize(unsigned __int64 uiSize);
unsigned __int64 GetAllocatedSize();
void SetDisplayMode(int iDisplayMode);
void Initialize();
private:
#if _ATL_VER <= 0x0300
BEGIN_MSG_MAP_EX(CSpaceMeter)
#else
BEGIN_MSG_MAP(CSpaceMeter)
#endif
MESSAGE_HANDLER(WM_CREATE,OnCreate)
MESSAGE_HANDLER(WM_SIZE,OnSize)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkgnd)
MESSAGE_HANDLER(WM_RBUTTONDOWN,OnRButtonDown)
//MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WMU_SPACE_METER_DELAYED_UPDATE,OnDelayedUpdate)
MESSAGE_RANGE_HANDLER(WM_MOUSEFIRST,WM_MOUSELAST,OnMouseMove)
NOTIFY_CODE_HANDLER(TTN_GETDISPINFO,OnGetDispInfo)
COMMAND_RANGE_HANDLER_EX(SPACEMETER_POPUPMENU_IDBASE,SPACEMETER_POPUPMENU_IDBASE + SPACEMETER_POPUPMENU_COUNT - 1,OnPopupMenuClick)
END_MSG_MAP()
LRESULT OnCreate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnSize(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnRButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnDelayedUpdate(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnGetDispInfo(int idCtrl,LPNMHDR pnmh,BOOL &bHandled);
LRESULT OnPopupMenuClick(UINT uNotifyCode,int nID,CWindow wnd);
void RequestDelayedUpdate();
};
================================================
FILE: src/app/control/title_tip_list_view_ctrl.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "title_tip_list_view_ctrl.hh"
#include
/*
IMPORTANT: Requires host to chain the message loop.
*/
CTitleTipListViewCtrl::CTitleTipListViewCtrl()
{
m_iCurrentItem = -1;
m_bTrackingMouseLeave = false;
}
CTitleTipListViewCtrl::~CTitleTipListViewCtrl()
{
if (m_ToolTip.IsWindow())
m_ToolTip.DestroyWindow();
}
bool CTitleTipListViewCtrl::Initialize()
{
m_ToolTip.Create(NULL,CWindow::rcDefault,NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,WS_EX_TOPMOST);
if (!m_ToolTip.IsWindow())
return false;
// Fill the tool information structure.
::ZeroMemory(&m_ti,sizeof(m_ti));
m_ti.cbSize = sizeof(TOOLINFO);
m_ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
m_ti.hwnd = GetParent();
m_ti.hinst = _Module.GetResourceInstance();
m_ti.uId = (unsigned int)m_hWnd;
m_ti.lpszText = LPSTR_TEXTCALLBACK;
m_ToolTip.AddTool(&m_ti);
m_ToolTip.TrackActivate(&m_ti,FALSE);
return true;
}
LRESULT CTitleTipListViewCtrl::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
bHandled = false;
// Make sure that the control has been initialized.
if (!m_ToolTip.IsWindowEnabled())
return 0;
// Track the mouse to see when it leaves the list view.
if (!m_bTrackingMouseLeave)
{
TRACKMOUSEEVENT tme = { 0 };
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = m_hWnd;
TrackMouseEvent(&tme);
m_bTrackingMouseLeave = true;
}
POINT ptCursor = { GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) };
unsigned int uiFlags = 0;
int iItem = HitTest(ptCursor,&uiFlags);
// Check if whe're hovering above an item.
if (iItem != -1)
{
RECT rcItem;
GetItemRect(iItem,&rcItem,LVIR_SELECTBOUNDS);
RECT rcListView;
GetClientRect(&rcListView);
// Check if the item text is to long to be fully displayed.
if (rcItem.right >= rcListView.right)
{
// Is the tool tip already visible?
if (m_ToolTip.GetCurrentTool(NULL) != 0)
{
if (m_iCurrentItem != iItem)
{
m_iCurrentItem = iItem;
m_ToolTip.TrackActivate(&m_ti,TRUE);
}
ClientToScreen(&rcItem);
ClientToScreen(&ptCursor);
m_ToolTip.TrackPosition(rcItem.left,rcItem.top);
}
else
{
m_ToolTip.TrackActivate(&m_ti,TRUE);
m_iCurrentItem = iItem;
}
}
else
{
// Do not display the tool tip.
m_ToolTip.TrackActivate(&m_ti,FALSE);
}
}
else
{
// Do not display the tool tip.
m_ToolTip.TrackActivate(&m_ti,FALSE);
}
return 0;
}
LRESULT CTitleTipListViewCtrl::OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
m_bTrackingMouseLeave = false;
RECT rcListView;
GetClientRect(&rcListView);
ClientToScreen(&rcListView);
POINT ptCursor;
GetCursorPos(&ptCursor);
// Check if the cursor has left the list view control.
if (!PtInRect(&rcListView,ptCursor))
{
if (m_ToolTip.IsWindow())
m_ToolTip.TrackActivate(&m_ti,FALSE);
}
bHandled = false;
return 0;
}
LRESULT CTitleTipListViewCtrl::OnGetDispInfo(int idCtrl,LPNMHDR pnmh,BOOL &bHandled)
{
// Make sure that the notification is about the control we care about.
if (pnmh->hwndFrom != m_ToolTip)
{
bHandled = FALSE;
return 0;
}
// Copy the item title to the hint string buffer.
LPNMTTDISPINFO pNMTDI = (LPNMTTDISPINFO)pnmh;
GetItemText(m_iCurrentItem,0,pNMTDI->lpszText,80);
return 0;
}
================================================
FILE: src/app/control/title_tip_list_view_ctrl.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
class CTitleTipListViewCtrl : public CWindowImpl
{
private:
CToolTipCtrl m_ToolTip;
TOOLINFO m_ti;
bool m_bTrackingMouseLeave;
// The current item that's beeing hovered.
int m_iCurrentItem;
public:
DECLARE_WND_CLASS(_T("ckToolTipListViewCtrl"));
CTitleTipListViewCtrl();
~CTitleTipListViewCtrl();
bool Initialize();
BEGIN_MSG_MAP(CTitleTipListViewCtrl)
MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WM_MOUSELEAVE,OnMouseLeave)
NOTIFY_CODE_HANDLER(TTN_GETDISPINFO,OnGetDispInfo)
END_MSG_MAP()
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseLeave(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnGetDispInfo(int idCtrl,LPNMHDR pnmh,BOOL &bHandled);
};
================================================
FILE: src/app/control/welcome_pane.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include "resource.h"
#include "main_frm.hh"
#include "project_manager.hh"
#include "settings.hh"
#include "string_table.hh"
#include "lang_util.hh"
#include "action_manager.hh"
#include "welcome_pane.hh"
CWelcomePane::CStandardButton::CStandardButton(CWelcomePane *pParent,
unsigned short usImageId,
int iX,int iY,long lCtrlId) :
CButton(pParent,iX,iY),m_State(STATE_NORMAL),m_bFocus(false),m_lCtrlId(lCtrlId)
{
m_Image.Open(usImageId);
}
void CWelcomePane::CStandardButton::Draw(HDC hDC)
{
switch (m_State)
{
case STATE_NORMAL:
if (m_bFocus)
{
m_pParent->m_StandardFocusImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_StandardNormalImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
case STATE_HOT:
if (m_bFocus)
{
m_pParent->m_StandardHoverFocusImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_StandardHoverImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
}
m_Image.Draw(hDC,GetX() + 18,GetY() + 12,GetX() + 18 + BUTTON_WIDTH,GetY() + 12 + BUTTON_HEIGHT);
}
bool CWelcomePane::CStandardButton::HoverTest(int iX,int iY,bool &bChanged)
{
bool bHitX = iX > GetX() && iX < GetX() + BUTTON_WIDTH;
bool bHitY = iY > GetY() && iY < GetY() + BUTTON_HEIGHT;
if (bHitX && bHitY)
{
// Update status bar.
if (m_State != STATE_HOT)
m_pParent->SetStatusText(m_lCtrlId);
bChanged = m_State != STATE_HOT;
m_State = STATE_HOT;
return true;
}
bChanged = m_State != STATE_NORMAL;
m_State = STATE_NORMAL;
return false;
}
long CWelcomePane::CStandardButton::ClickTest(int iX,int iY)
{
bool bHitX = iX > GetX() && iX < GetX() + BUTTON_WIDTH;
bool bHitY = iY > GetY() && iY < GetY() + BUTTON_HEIGHT;
if (bHitX && bHitY)
return m_lCtrlId;
return -1;
}
CWelcomePane::CMultiButton::CMultiButton(CWelcomePane *pParent,
unsigned short usImageId,
int iX,int iY,
long lCtrlMainId,
long lCtrlSub1Id,
long lCtrlSub2Id) :
CButton(pParent,iX,iY),m_State(STATE_NORMAL),m_bFocus(false),
m_lCtrlMainId(lCtrlMainId),m_lCtrlSub1Id(lCtrlSub1Id),m_lCtrlSub2Id(lCtrlSub2Id)
{
m_Image.Open(usImageId);
}
void CWelcomePane::CMultiButton::Draw(HDC hDC)
{
switch (m_State)
{
case STATE_NORMAL:
if (m_bFocus)
{
m_pParent->m_MultiFocusImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_MultiNormalImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
case STATE_HOTMAIN:
if (m_bFocus)
{
m_pParent->m_MultiHoverFocusImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_MultiHoverImage.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
case STATE_HOTSUB1:
if (m_bFocus)
{
m_pParent->m_MultiHoverFocusSub1Image.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_MultiHoverSub1Image.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
case STATE_HOTSUB2:
if (m_bFocus)
{
m_pParent->m_MultiHoverFocusSub2Image.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
else
{
m_pParent->m_MultiHoverSub2Image.Draw(hDC,GetX(),GetY(),
GetX() + BUTTON_WIDTH,GetY() + BUTTON_HEIGHT);
}
break;
}
m_Image.Draw(hDC,GetX() + 15,GetY() + 12,GetX() + 18 + BUTTON_WIDTH,GetY() + 12 + BUTTON_HEIGHT);
}
bool CWelcomePane::CMultiButton::HoverTest(int iX,int iY,bool &bChanged)
{
bool bHitX = iX > GetX() && iX < GetX() + BUTTON_WIDTH;
bool bHitY = iY > GetY() && iY < GetY() + BUTTON_HEIGHT;
if (bHitX && bHitY)
{
int iSplitterX = GetX() + SPLITTER_X;
int iSplitterY = GetY() + SPLITTER_Y;
long lCtrlId;
eState NewState;
if (iX < iSplitterX)
{
lCtrlId = m_lCtrlMainId;
NewState = STATE_HOTMAIN;
}
else if (iY < iSplitterY)
{
lCtrlId = m_lCtrlSub1Id;
NewState = STATE_HOTSUB1;
}
else
{
lCtrlId = m_lCtrlSub2Id;
NewState = STATE_HOTSUB2;
}
// Update status bar.
if (NewState != m_State)
m_pParent->SetStatusText(lCtrlId);
bChanged = NewState != m_State;
m_State = NewState;
return true;
}
bChanged = m_State != STATE_NORMAL;
m_State = STATE_NORMAL;
return true;
}
long CWelcomePane::CMultiButton::ClickTest(int iX,int iY)
{
bool bHitX = iX > GetX() && iX < GetX() + BUTTON_WIDTH;
bool bHitY = iY > GetY() && iY < GetY() + BUTTON_HEIGHT;
if (bHitX && bHitY)
{
int iSplitterX = GetX() + SPLITTER_X;
int iSplitterY = GetY() + SPLITTER_Y;
if (iX < iSplitterX)
return m_lCtrlMainId;
else if (iY < iSplitterY)
return m_lCtrlSub1Id;
else
return m_lCtrlSub2Id;
}
return -1;
}
CWelcomePane::CWelcomePane()
{
//m_LogoImage.Open(_T("C:\\test.png"));
m_LogoImage.Open(IDR_WELCOMELOGOPNG);
// Load button images.
m_StandardNormalImage.Open(IDR_BUTTONNPNG);
m_StandardFocusImage.Open(IDR_BUTTONFPNG);
m_StandardHoverImage.Open(IDR_BUTTONHPNG);
m_StandardHoverFocusImage.Open(IDR_BUTTONHFPNG);
// Load multi button images.
m_MultiNormalImage.Open(IDR_MBUTTONNPNG);
m_MultiFocusImage.Open(IDR_MBUTTONFPNG);
m_MultiHoverImage.Open(IDR_MBUTTONHPNG);
m_MultiHoverSub1Image.Open(IDR_MBUTTONHS1PNG);
m_MultiHoverSub2Image.Open(IDR_MBUTTONHS2PNG);
m_MultiHoverFocusImage.Open(IDR_MBUTTONFPNG);
m_MultiHoverFocusSub1Image.Open(IDR_MBUTTONHFS1PNG);
m_MultiHoverFocusSub2Image.Open(IDR_MBUTTONHFS2PNG);
// Add buttons.
m_Buttons.push_back(new CMultiButton(this,IDR_WIZARDDATAPNG,
CButton::BUTTON_WIDTH * 0 + 10,10,
ID_NEWPROJECT_DATA,ID_NEWPROJECT_DATACD,ID_NEWPROJECT_DATADVD));
m_Buttons.push_back(new CStandardButton(this,IDR_WIZARDAUDIOPNG,
CButton::BUTTON_WIDTH * 1 + 10,10,
ID_NEWPROJECT_AUDIO));
m_Buttons.push_back(new CStandardButton(this,IDR_WIZARDVIDEOPNG,
CButton::BUTTON_WIDTH * 2 + 10,10,
ID_NEWPROJECT_DVDVIDEO));
m_Buttons.push_back(new CStandardButton(this,IDR_WIZARDWRITEPNG,
CButton::BUTTON_WIDTH * 0 + 10,CButton::BUTTON_HEIGHT + 10,
ID_ACTIONS_BURNIMAGE));
m_Buttons.push_back(new CStandardButton(this,IDR_WIZARDCOPYPNG,
CButton::BUTTON_WIDTH * 1 + 10,CButton::BUTTON_HEIGHT + 10,
ID_COPYDISC_COMPACTDISC));
m_Buttons.push_back(new CStandardButton(this,IDR_WIZARDREADPNG,
CButton::BUTTON_WIDTH * 2 + 10,CButton::BUTTON_HEIGHT + 10,
ID_COPYDISC_DISCIMAGE));
}
CWelcomePane::~CWelcomePane()
{
// Delete all buttons.
std::vector::iterator itButton;
for (itButton = m_Buttons.begin(); itButton != m_Buttons.end(); itButton++)
delete *itButton;
m_Buttons.clear();
}
void CWelcomePane::SetStatusText(long lCtrlId)
{
bool bSuccess = false;
if (g_LanguageSettings.m_pLngProcessor != NULL &&
g_LanguageSettings.m_pLngProcessor->EnterSection(_T("hint")))
{
TCHAR *szStrValue;
if (g_LanguageSettings.m_pLngProcessor->GetValuePtr(lCtrlId,szStrValue))
{
::SendMessage(g_pMainFrame->m_hWndStatusBar,SB_SETTEXT,0,(LPARAM)szStrValue);
bSuccess = true;
}
}
if (!bSuccess)
{
TCHAR szBuffer[256];
LoadString(_Module.GetResourceInstance(),lCtrlId,szBuffer,sizeof(szBuffer) / sizeof(TCHAR));
::SendMessage(g_pMainFrame->m_hWndStatusBar,SB_SETTEXT,0,(LPARAM)szBuffer);
}
}
LRESULT CWelcomePane::OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
PAINTSTRUCT ps;
HDC hDC = BeginPaint(&ps);
// Calculate client rectangle.
RECT rcClient;
GetClientRect(&rcClient);
// Center the buttons.
int iDrawWidth = CButton::BUTTON_WIDTH * 3 + 20;
int iDrawHeight = CButton::BUTTON_HEIGHT * 2 + 10;
int iOffsetX = (rcClient.right >> 1) - (iDrawWidth >> 1);
int iOffsetY = (rcClient.bottom >> 1) - (iDrawHeight >> 1);
std::vector::iterator itButton;
for (itButton = m_Buttons.begin(); itButton != m_Buttons.end(); itButton++)
(*itButton)->Offset(iOffsetX,iOffsetY);
// Use double-buffering.
HDC hMemDC = CreateCompatibleDC(hDC);
HBITMAP hMemBitmap = CreateCompatibleBitmap(hDC,rcClient.right - rcClient.left,
rcClient.bottom - rcClient.top);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC,hMemBitmap);
// Draw into the memory buffer.
FillRect(hMemDC,&rcClient,GetSysColorBrush(COLOR_WINDOW));
m_LogoImage.Draw(hMemDC,LOGO_INDENT_LEFT,LOGO_INDENT_TOP,rcClient.right,rcClient.bottom);
// Draw buttons.
//std::vector::iterator itButton;
for (itButton = m_Buttons.begin(); itButton != m_Buttons.end(); itButton++)
(*itButton)->Draw(hMemDC);
// Copy the memory buffer into the frame buffer.
BitBlt(hDC,0,0,rcClient.right,rcClient.bottom,hMemDC,0,0,SRCCOPY);
// Free memory buffer handles.
SelectObject(hMemDC,hOldBitmap);
DeleteObject(hMemBitmap);
DeleteDC(hMemDC);
EndPaint(&ps);
return 0;
}
LRESULT CWelcomePane::OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
return 0;
}
LRESULT CWelcomePane::OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
int iPosX = GET_X_LPARAM(lParam);
int iPosY = GET_Y_LPARAM(lParam);
bool bRedraw = false,bHasHit = false;
std::vector::iterator itButton;
for (itButton = m_Buttons.begin(); itButton != m_Buttons.end(); itButton++)
{
CWelcomePane::CButton *pButton = *itButton;
bool bChanged = false;
if (pButton->HoverTest(iPosX,iPosY,bChanged))
bHasHit = true;
if (bChanged)
bRedraw = true;
}
if (bRedraw)
{
RECT rcClient;
GetClientRect(&rcClient);
InvalidateRect(&rcClient);
}
if (!bHasHit)
::SetWindowText(g_pMainFrame->m_hWndStatusBar,_T(""));
return 0;
}
LRESULT CWelcomePane::OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled)
{
int iPosX = GET_X_LPARAM(lParam);
int iPosY = GET_Y_LPARAM(lParam);
std::vector::iterator itButton;
for (itButton = m_Buttons.begin(); itButton != m_Buttons.end(); itButton++)
{
CWelcomePane::CButton *pButton = *itButton;
long lAction = pButton->ClickTest(iPosX,iPosY);
switch (lAction)
{
case ID_NEWPROJECT_DATA:
g_pMainFrame->ShowWelcomePane(false);
break;
case ID_NEWPROJECT_DATACD:
g_pMainFrame->ShowWelcomePane(false);
g_ProjectManager.NewDataProject(SPACEMETER_SIZE_703MB);
break;
case ID_NEWPROJECT_DATADVD:
g_pMainFrame->ShowWelcomePane(false);
g_ProjectManager.NewDataProject(SPACEMETER_SIZE_DVD);
break;
case ID_NEWPROJECT_AUDIO:
g_pMainFrame->ShowWelcomePane(false);
g_ProjectManager.NewAudioProject(SPACEMETER_SIZE_80MIN);
break;
case ID_NEWPROJECT_DVDVIDEO:
g_pMainFrame->ShowWelcomePane(false);
g_ProjectManager.NewDataProject(SPACEMETER_SIZE_DVD);
g_ProjectSettings.m_iFileSystem = FILESYSTEM_DVDVIDEO;
break;
case ID_ACTIONS_BURNIMAGE:
g_ActionManager.BurnImage(*g_pMainFrame,false);
break;
case ID_COPYDISC_COMPACTDISC:
g_ActionManager.CopyDisc(*g_pMainFrame,false);
break;
case ID_COPYDISC_DISCIMAGE:
g_ActionManager.CopyImage(*g_pMainFrame,false);
break;
}
}
return 0;
}
================================================
FILE: src/app/control/welcome_pane.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include "png_file.hh"
#include "custom_button.hh"
#include "custom_multi_button.hh"
class CWelcomePane : public CWindowImpl
{
private:
enum
{
LOGO_INDENT_LEFT = 10,
LOGO_INDENT_TOP = 10
};
class CButton
{
public:
enum
{
BUTTON_WIDTH = 125,
BUTTON_HEIGHT = 72
};
private:
int m_iX;
int m_iY;
int m_iOffsetX;
int m_iOffsetY;
protected:
CWelcomePane *m_pParent;
public:
CButton(CWelcomePane *pParent,int iX,int iY) : m_pParent(pParent),m_iX(iX),m_iY(iY),m_iOffsetX(0),m_iOffsetY(0) {}
virtual ~CButton() {};
void Offset(int iOffsetX,int iOffsetY)
{
m_iOffsetX = iOffsetX;
m_iOffsetY = iOffsetY;
}
int GetX() { return m_iX + m_iOffsetX; }
int GetY() { return m_iY + m_iOffsetY; }
virtual void Draw(HDC hDC) = 0;
virtual bool HoverTest(int iX,int iY,bool &bChanged) = 0;
virtual long ClickTest(int iX,int iY) = 0;
};
class CStandardButton : public CButton
{
private:
enum eState
{
STATE_NORMAL,
STATE_HOT
};
bool m_bFocus;
long m_lCtrlId;
eState m_State;
CPngFile m_Image;
public:
CStandardButton(CWelcomePane *pParent,unsigned short usImageId,int iX,int iY,long lCtrlId);
void Draw(HDC hDC);
bool HoverTest(int iX,int iY,bool &bChanged);
long ClickTest(int iX,int iY);
};
class CMultiButton : public CButton
{
private:
enum
{
SPLITTER_X = 99,
SPLITTER_Y = 36
};
enum eState
{
STATE_NORMAL,
STATE_HOTMAIN,
STATE_HOTSUB1,
STATE_HOTSUB2
};
bool m_bFocus;
long m_lCtrlMainId;
long m_lCtrlSub1Id;
long m_lCtrlSub2Id;
eState m_State;
CPngFile m_Image;
public:
CMultiButton(CWelcomePane *pParent,unsigned short usImageId,int iX,int iY,
long lCtrlMainId,long lCtrlSub1Id,long lCtrlSub2Id);
void Draw(HDC hDC);
bool HoverTest(int iX,int iY,bool &bChanged);
long ClickTest(int iX,int iY);
};
std::vector m_Buttons;
CPngFile m_LogoImage;
CPngFile m_StandardNormalImage;
CPngFile m_StandardFocusImage;
CPngFile m_StandardHoverImage;
CPngFile m_StandardHoverFocusImage;
CPngFile m_MultiNormalImage;
CPngFile m_MultiFocusImage;
CPngFile m_MultiHoverImage;
CPngFile m_MultiHoverSub1Image;
CPngFile m_MultiHoverSub2Image;
CPngFile m_MultiHoverFocusImage;
CPngFile m_MultiHoverFocusSub1Image;
CPngFile m_MultiHoverFocusSub2Image;
void SetStatusText(long lCtrlId);
public:
CWelcomePane();
~CWelcomePane();
void Initialize();
BEGIN_MSG_MAP(CWelcomePane)
MESSAGE_HANDLER(WM_PAINT,OnPaint)
MESSAGE_HANDLER(WM_ERASEBKGND,OnEraseBkgnd)
MESSAGE_HANDLER(WM_MOUSEMOVE,OnMouseMove)
MESSAGE_HANDLER(WM_LBUTTONDOWN,OnLButtonDown)
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
LRESULT OnPaint(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnEraseBkgnd(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnMouseMove(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
LRESULT OnLButtonDown(UINT uMsg,WPARAM wParam,LPARAM lParam,BOOL &bHandled);
};
================================================
FILE: src/app/core/cd_text.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include "cd_text.hh"
void CCdText::InitCRC()
{
// Compute basis polynomials.
unsigned short usBasePoly[8];
usBasePoly[0] = CDTEXT_CRCPOLYNOMIAL;
for (int i = 1; i < 8; i++)
{
usBasePoly[i] = usBasePoly[i - 1] << 1;
if ((usBasePoly[i - 1] >> 15) & 1)
usBasePoly[i] ^= usBasePoly[0];
usBasePoly[i] &= 0x0ffff;
}
// Calculate the table entries.
for (int i = 0; i < 256; i++)
{
int iCurrent = i;
m_usCRCTable[i] = 0;
for (int j = 0; j < 8; j++)
{
if (iCurrent & 1)
m_usCRCTable[i] ^= usBasePoly[j];
iCurrent >>= 1;
}
}
}
unsigned short CCdText::CalcCRC(unsigned char *pBuffer,unsigned int uiLength)
{
unsigned short usCRC = 0;
for (int i = 0; i < (int)uiLength; i++)
usCRC = (usCRC << 8) ^ m_usCRCTable[(usCRC >> 8) ^ pBuffer[i]];
return usCRC;
}
CCdText::CCdText()
{
Reset();
// Initialize the CRC table.
InitCRC();
}
CCdText::~CCdText()
{
m_TrackNames.clear();
m_ArtistNames.clear();
}
void CCdText::Reset()
{
m_szAlbumName[0] = '\0';
m_szArtistName[0] = '\0';
m_uiBufferPos = 0;
m_szBuffer[0] = '\0';
m_TrackNames.clear();
m_ArtistNames.clear();
}
unsigned int CCdText::FindBufferEOS(unsigned int uiStart,unsigned int uiEnd)
{
for (unsigned int i = uiStart; i < uiEnd; i++)
{
if (m_szBuffer[i] == '\0')
return i;
}
return 0;
}
unsigned int CCdText::ReadPacket(ckcore::File &File,unsigned long ulPID,
unsigned long ulBlockInfo)
{
// If the buffer can't hold the data we abort.
if (m_uiBufferPos + 12 >= CDTEXT_MAXFIELDSIZE)
return 0;
// Not currently used.
/*unsigned char ucDBCC = (unsigned char)(ulBlockInfo & 0x80) >> 7;
unsigned char ucBlockNumber = (unsigned char)(ulBlockInfo & 0x70) >> 4;
unsigned char ucCharPos = (unsigned char)(ulBlockInfo & 0x0F);*/
if (File.read(m_szBuffer + m_uiBufferPos,12) == -1)
return false;
// Debug information.
char szTemp[25];
sprintf(szTemp,"%d, %d, %d",(int)(ulPID & 0xFF0000) >> 16,(int)(ulPID & 0xFF00) >> 8,(int)ulPID & 0xFF);
char szTemp2[13];
memcpy(szTemp2,m_szBuffer + m_uiBufferPos,12);
szTemp2[12] = '\0';
unsigned int uiEOS = FindBufferEOS(m_uiBufferPos,m_uiBufferPos + 12);
m_uiBufferPos += 12;
if (uiEOS == 0)
return 12;
switch (ulPID & 0xFF)
{
case PTI_NAMETITLE:
// If the second PID bytes is zero it's an album name, otherwise it's a track name.
if (((ulPID & 0xFF00) >> 8) == 0)
memcpy(m_szAlbumName,m_szBuffer,uiEOS + 1);
else
m_TrackNames.push_back(m_szBuffer);
break;
case PTI_NAMEPERFORMER:
if (((ulPID & 0xFF00) >> 8) == 0)
memcpy(m_szArtistName,m_szBuffer,uiEOS + 1);
else
m_ArtistNames.push_back(m_szBuffer);
break;
// We ignore all binary fields.
//case PTI_DISCID: // The specification is ambiguous and states that this type contains binary and character data.
//case PTI_GENREID: // The specification is ambiguous and states that this type contains binary and character data.
case PTI_TOCINFO:
case PTI_TOCINFO2:
case PTI_SIZEINFO:
MessageBox(NULL,_T(""),_T(""),MB_OK);
return 12;
default:
/*char szTemp[255];
memcpy(szTemp,m_szBuffer,uiEOS + 1);
MessageBoxA(NULL,szTemp,"default",MB_OK);*/
break;
};
// Skip all null characters.
while (m_szBuffer[uiEOS] == '\0')
uiEOS++;
m_uiBufferPos -= uiEOS;
memcpy(m_szBuffer,m_szBuffer + uiEOS,m_uiBufferPos);
return 12;
}
bool CCdText::ReadFile(const TCHAR *szFileName)
{
// Clear any previous data.
Reset();
ckcore::File File(szFileName);
if (!File.open(ckcore::File::ckOPEN_READ))
return false;
// Make sure that the file is not too large.
ckcore::tint64 iFileSize = File.size();
if (iFileSize > 0xFFFFFFFF)
return false;
unsigned int uiDataSize = (unsigned int)File.size();
// Try to find a signature.
unsigned long ulSignature = 0;
if (File.read(&ulSignature,4) == -1)
return false;
if (ulSignature == CDTEXT_SIGNATURE)
uiDataSize -= 4;
else
File.seek(0,ckcore::File::ckFILE_BEGIN);
unsigned int uiNumPackets = uiDataSize/18;
for (unsigned int i = 0; i < uiNumPackets; i++)
{
// Read header.
unsigned long ulHeader = 0;
if (File.read(&ulHeader,sizeof(unsigned long)) == -1)
return false;
// The first three bytes of the header is the Pack Type Indicator (PID),
// the last byte contain block information.
ReadPacket(File,ulHeader & 0xFFFFFF,(ulHeader & 0xFF000000) >> 24);
// Skip the CRC-field.
if (File.seek(2,ckcore::File::ckFILE_CURRENT) == -1)
return false;
}
return true;
}
unsigned int CCdText::WriteText(ckcore::File &File,unsigned char ucType,unsigned char ucPID2,
const char *szText,unsigned int uiCharPos)
{
unsigned char ucBuffer[18];
ucBuffer[0] = ucType;
ucBuffer[1] = ucPID2;
unsigned int uiCurrentPos = 0;
unsigned int uiCurrentLen = (unsigned int)strlen(szText) + 1; // We want to include the terminating null character.
// Copy any old data to the write-buffer.
if (m_uiBufferPos > 0)
{
ucBuffer[1] = m_ucPrevPID2;
memcpy(ucBuffer + 4,m_szBuffer,m_uiBufferPos);
}
// Write all full texts.
while (uiCurrentPos < uiCurrentLen)
{
int iByteCount = min(12 - m_uiBufferPos,uiCurrentLen - uiCurrentPos - m_uiBufferPos);
memcpy(ucBuffer + 4 + m_uiBufferPos,szText + uiCurrentPos,iByteCount);
// Flush.
if (iByteCount + m_uiBufferPos == 12)
{
ucBuffer[2] = m_ucBlockCount++;
ucBuffer[3] = uiCharPos + uiCurrentPos;
// CRC.
unsigned short usCRC = CalcCRC(ucBuffer,16);
usCRC ^= 0xFFFF;
ucBuffer[16] = static_cast((usCRC & 0xFF00) >> 8);
ucBuffer[17] = static_cast(usCRC & 0xFF);
// Write.
File.write(ucBuffer,18);
m_uiBufferPos = 0;
uiCurrentPos += iByteCount;
// If we have just written a block associated with the previous we can now
// safeley set the second PID to match the current string.
if (ucBuffer[1] == m_ucPrevPID2)
{
ucBuffer[1] = ucPID2;
uiCharPos = 0;
}
}
else
{
memcpy(m_szBuffer + m_uiBufferPos,szText + uiCurrentPos,iByteCount);
m_uiBufferPos += iByteCount;
break;
}
}
return uiCurrentPos;
}
void CCdText::FlushText(ckcore::File &File,unsigned char ucType,unsigned int uiCharPos)
{
// Is there anything to flush?
if (m_uiBufferPos > 0)
{
unsigned char ucBuffer[18];
ucBuffer[0] = ucType;
ucBuffer[1] = m_ucPrevPID2;
ucBuffer[2] = m_ucBlockCount++;
ucBuffer[3] = uiCharPos;
memcpy(ucBuffer + 4,m_szBuffer,m_uiBufferPos);
memset(ucBuffer + 4 + m_uiBufferPos,'\0',12 - m_uiBufferPos);
// CRC.
unsigned short usCRC = CalcCRC(ucBuffer,16);
usCRC ^= 0xFFFF;
ucBuffer[16] = static_cast((usCRC & 0xFF00) >> 8);
ucBuffer[17] = static_cast(usCRC & 0xFF);
// Flush.
File.write(ucBuffer,18);
m_uiBufferPos = 0;
}
}
bool CCdText::WriteFile(const TCHAR *szFileName)
{
ckcore::File File(szFileName);
if (!File.open(ckcore::File::ckOPEN_WRITE))
return false;
#ifdef CDTEXT_SAVESIGNATURE
// Write a signature.
unsigned long ulSignature = CDTEXT_SIGNATURE;
fs_write(&ulSignature,4,hFile);
#endif
// Reset the internal counters.
m_uiBufferPos = 0;
m_ucBlockCount = 0;
unsigned int uiCharPos = 0;
// Track title information.
if (m_szAlbumName[0] != '\0')
{
uiCharPos = WriteText(File,PTI_NAMETITLE,0,m_szAlbumName,uiCharPos);
m_ucPrevPID2 = 0;
}
for (unsigned int i = 0; i < m_TrackNames.size(); i++)
{
uiCharPos = WriteText(File,PTI_NAMETITLE,(unsigned char)i + 1,m_TrackNames[i].c_str(),uiCharPos);
m_ucPrevPID2 = i + 1;
}
FlushText(File,PTI_NAMETITLE,uiCharPos);
uiCharPos = 0;
// Track artist information.
if (m_szArtistName[0] != '\0')
{
uiCharPos = WriteText(File,PTI_NAMEPERFORMER,0,m_szArtistName,uiCharPos);
m_ucPrevPID2 = 0;
}
for (unsigned int i = 0; i < m_ArtistNames.size(); i++)
{
uiCharPos = WriteText(File,PTI_NAMEPERFORMER,(unsigned char)i + 1,m_ArtistNames[i].c_str(),uiCharPos);
m_ucPrevPID2 = i + 1;
}
FlushText(File,PTI_NAMEPERFORMER,uiCharPos);
uiCharPos = 0;
return true;
}
bool CCdText::WriteFileEx(const TCHAR *szFileName,const TCHAR *szAlbumName,
const TCHAR *szArtistName,std::vector &Tracks)
{
ckcore::File File(szFileName);
if (!File.open(ckcore::File::ckOPEN_WRITE))
return false;
#ifdef CDTEXT_SAVESIGNATURE
// Write a signature.
unsigned long ulSignature = CDTEXT_SIGNATURE;
if (File.write(&ulSignature,4) == -1)
return false;
#endif
// Reset the internal counters.
m_uiBufferPos = 0;
m_ucBlockCount = 0;
unsigned int uiCharPos = 0;
char szBuffer[CDTEXT_MAXFIELDSIZE];
// Track title information.
if (szAlbumName[0] != '\0')
{
UnicodeToAnsi(szBuffer,szAlbumName,sizeof(szBuffer));
uiCharPos = WriteText(File,PTI_NAMETITLE,0,szBuffer,uiCharPos);
m_ucPrevPID2 = 0;
}
for (unsigned int i = 0; i < Tracks.size(); i++)
{
UnicodeToAnsi(szBuffer,Tracks[i]->GetAudioData()->szTrackTitle,sizeof(szBuffer));
uiCharPos = WriteText(File,PTI_NAMETITLE,(unsigned char)i + 1,szBuffer,uiCharPos);
m_ucPrevPID2 = i + 1;
}
FlushText(File,PTI_NAMETITLE,uiCharPos);
uiCharPos = 0;
// Track artist information.
if (szArtistName[0] != '\0')
{
UnicodeToAnsi(szBuffer,szArtistName,sizeof(szBuffer));
uiCharPos = WriteText(File,PTI_NAMEPERFORMER,0,szBuffer,uiCharPos);
m_ucPrevPID2 = 0;
}
for (unsigned int i = 0; i < Tracks.size(); i++)
{
UnicodeToAnsi(szBuffer,Tracks[i]->GetAudioData()->szTrackArtist,sizeof(szBuffer));
uiCharPos = WriteText(File,PTI_NAMEPERFORMER,(unsigned char)i + 1,szBuffer,uiCharPos);
m_ucPrevPID2 = i + 1;
}
FlushText(File,PTI_NAMEPERFORMER,uiCharPos);
uiCharPos = 0;
return true;
}
================================================
FILE: src/app/core/cd_text.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include
#include "tree_manager.hh"
#define CDTEXT_SIGNATURE 0x2201
#define CDTEXT_MAXFIELDSIZE 160
//#define CDTEXT_CRCPOLYNOMIAL 0x8408
#define CDTEXT_CRCPOLYNOMIAL 0x1021
// Define if a 4 byte header should be stored in the beginning of each cd-text binary file.
//#define CDTEXT_SAVESIGNATURE
class CCdText
{
private:
unsigned short m_usCRCTable[256];
char m_szBuffer[CDTEXT_MAXFIELDSIZE];
unsigned int m_uiBufferPos;
unsigned char m_ucBlockCount;
unsigned char m_ucPrevPID2;
void Reset();
unsigned int FindBufferEOS(unsigned int uiStart,unsigned int uiEnd);
unsigned int ReadPacket(ckcore::File &File,unsigned long ulPID,unsigned long ulBlockInfo);
// CRC routines.
void InitCRC();
unsigned short CalcCRC(unsigned char *pBuffer,unsigned int uiLength);
// Write routines.
unsigned int WriteText(ckcore::File &File,unsigned char ucType,unsigned char ucPID2,
const char *szText,unsigned int uiCharPos);
void FlushText(ckcore::File &File,unsigned char ucType,unsigned int uiCharPos);
enum ePTI
{
PTI_NAMETITLE = 0x80,
PTI_NAMEPERFORMER = 0x81,
PTI_NAMEWRITER = 0x82,
PTI_NAMESONGWRITER = 0x83,
PTI_NAMEARRANGER = 0x84,
PTI_MESSAGEARTIST = 0x85,
PTI_DISCID = 0x86,
PTI_GENREID = 0x87,
PTI_TOCINFO = 0x88,
PTI_TOCINFO2 = 0x89,
PTI_RESERVED1 = 0x8A,
PTI_RESERVED2 = 0x8B,
PTI_RESERVED3 = 0x8C,
PTI_RESERVED4 = 0x8D,
PTI_UPCEAN = 0x8E,
PTI_SIZEINFO = 0x8F
};
public:
CCdText();
~CCdText();
char m_szAlbumName[CDTEXT_MAXFIELDSIZE];
char m_szArtistName[CDTEXT_MAXFIELDSIZE];
std::vector m_TrackNames;
std::vector m_ArtistNames;
bool ReadFile(const TCHAR *szFileName);
bool WriteFile(const TCHAR *szFileName);
bool WriteFileEx(const TCHAR *szFileName,const TCHAR *szAlbumName,
const TCHAR *szArtistName,std::vector &Tracks);
};
================================================
FILE: src/app/core/cdrtools_parse_strings.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#define CDRTOOLS_COPYRIGHT "Cdrecord-ProDVD-ProBD-Clone"
#define CDRTOOLS_COPYRIGHT_LENGTH 27
#define CDRTOOLS_SCSIBUS "scsibus"
#define CDRTOOLS_SCSIBUS_LENGTH 7
#ifdef CDRKIT
#define CDRTOOLS_ERROR "wodim: "
#define CDRTOOLS_ERROR_LENGTH 7
#define CDRTOOLS_ERROR3 "readom: "
#define CDRTOOLS_ERROR3_LENGTH 8
#define CDRTOOLS_ERROR4 "icedax: "
#define CDRTOOLS_ERROR4_LENGTH 8
#else
#define CDRTOOLS_ERROR "cdrecord: "
#define CDRTOOLS_ERROR_LENGTH 10
#define CDRTOOLS_ERROR3 "readcd: "
#define CDRTOOLS_ERROR3_LENGTH 8
#define CDRTOOLS_ERROR4 "cdda2wav: "
#define CDRTOOLS_ERROR4_LENGTH 10
#endif
#define CDRTOOLS_REMOVABLE "Removable "
#define CDRTOOLS_REMOVABLE_LENGTH 10
#define CDRTOOLS_TYPE_CDROM "CD-ROM"
#define CDRTOOLS_TYPE_CDROM_LENGTH 6
#define CDRTOOLS_TYPE_COMMUNICATION "Communication"
#define CDRTOOLS_TYPE_COMMUNICATION_LENGTH 13
#define CDRTOOLS_TYPE_DISC "Disk"
#define CDRTOOLS_TYPE_DISC_LENGTH 4
#define CDRTOOLS_TYPE_JUKEBOX "Juke Box"
#define CDRTOOLS_TYPE_JUKEBOX_LENGTH 8
#define CDRTOOLS_TYPE_OPTICALSTORAGE "Optical Storage"
#define CDRTOOLS_TYPE_OPTICALSTORAGE_LENGTH 15
#define CDRTOOLS_TYPE_PRINTER "Printer"
#define CDRTOOLS_TYPE_PRINTER_LENGTH 7
#define CDRTOOLS_TYPE_PROCESSOR "Processor"
#define CDRTOOLS_TYPE_PROCESSOR_LENGTH 9
#define CDRTOOLS_TYPE_SCANNER "Scanner"
#define CDRTOOLS_TYPE_SCANNER_LENGTH 7
#define CDRTOOLS_TYPE_TAPE "Tape"
#define CDRTOOLS_TYPE_TAPE_LENGTH 4
#define CDRTOOLS_TYPE_WORM "WORM"
#define CDRTOOLS_TYPE_WORM_LENGTH 4
#define CDRTOOLS_WRITEFLAGS "Driver flags :"
#define CDRTOOLS_WRITEFLAGS_LENGTH 16
#define CDRTOOLS_WRITEMODES "Supported modes:"
#define CDRTOOLS_WRITEMODES_LENGTH 16
#define CDRTOOLS_GRACEBEGIN "Last chance"
#define CDRTOOLS_GRACEBEGIN_LENGTH 11
#define CDRTOOLS_NOMEDIA "Cannot load media."
#define CDRTOOLS_NOMEDIA_LENGTH 18
#define CDRTOOLS_CYGWINPATH "/cygdrive/"
#define CDRTOOLS_CYGWINPATH_LENGTH 10
#define CDRTOOLS_NOSUPPORT "This drive or"
#define CDRTOOLS_NOSUPPORT_LENGTH 13
#define CDRTOOLS_BLANK "BLANK"
#define CDRTOOLS_BLANK_LENGTH 5
#define CDRTOOLS_STARTCDWRITE "Starting to write CD/DVD"
#define CDRTOOLS_STARTCDWRITE_LENGTH 24
#define CDRTOOLS_BLANKTIME "Blanking time:"
#define CDRTOOLS_BLANKTIME_LENGTH 14
#define CDRTOOLS_NODISC "No disk "
#define CDRTOOLS_NODISC_LENGTH 8
#define CDRTOOLS_BLANKERROR "Cannot blank"
#define CDRTOOLS_BLANKERROR_LENGTH 12
#define CDRTOOLS_BLANKUNSUP "Some drives do not"
#define CDRTOOLS_BLANKUNSUP_LENGTH 18
#define CDRTOOLS_BLANKRETRY "Try again"
#define CDRTOOLS_BLANKRETRY_LENGTH 9
#define CDRTOOLS_UNSUPPORTED "Unsupported "
#define CDRTOOLS_UNSUPPORTED_LENGTH 12
#define CDRTOOLS_SECTOR "sector"
#define CDRTOOLS_SECTOR_LENGTH 6
#define CDRTOOLS_VERSIONINFO "This version"
#define CDRTOOLS_VERSIONINFO_LENGTH 12
#define CDRTOOLS_DVDINFO "If you need"
#define CDRTOOLS_DVDINFO_LENGTH 11
#define CDRTOOLS_DVDGETINFO "Free test"
#define CDRTOOLS_DVDGETINFO_LENGTH 9
#define CDRTOOLS_STARTTRACK "Starting new track"
#define CDRTOOLS_STARTTRACK_LENGTH 18
#define CDRTOOLS_WRITEPREGAP "Writing pregap"
#define CDRTOOLS_WRITEPREGAP_LENGTH 14
#define CDRTOOLS_FILLFIFO "Waiting for reader"
#define CDRTOOLS_FILLFIFO_LENGTH 18
#define CDRTOOLS_WRITETIME "Writing time:"
#define CDRTOOLS_WRITETIME_LENGTH 14
#define CDRTOOLS_FIXATE "Fixating..."
#define CDRTOOLS_FIXATE_LENGTH 11
#define CDRTOOLS_FIXATETIME "Fixating time:"
#define CDRTOOLS_FIXATETIME_LENGTH 14
#define CDRTOOLS_WARNINGCAP "WARNING:"
#define CDRTOOLS_WARNINGCAP_LENGTH 8
#define CDRTOOLS_WRITEERROR "A write error"
#define CDRTOOLS_WRITEERROR_LENGTH 13
#define CDRTOOLS_FILENOTFOUND "No such file or directory."
#define CDRTOOLS_FILENOTFOUND_LENGTH 26
#define CDRTOOLS_TOTALTTSIZE "Total translation table"
#define CDRTOOLS_TOTALTTSIZE_LENGTH 23
#define CDRTOOLS_BADAUDIOCODING "Inappropriate audio"
#define CDRTOOLS_BADAUDIOCODING_LENGTH 19
#define CDRTOOLS_RELOADDRIVE "Re-load"
#define CDRTOOLS_RELOADDRIVE_LENGTH 7
#define CDRTOOLS_TOTALTIME "Time total: "
#define CDRTOOLS_TOTALTIME_LENGTH 12
#define CDRTOOLS_END "end: "
#define CDRTOOLS_END_LENGTH 5
#define CDRTOOLS_ADDRESS "addr: "
#define CDRTOOLS_ADDRESS_LENGTH 6
#define CDRTOOLS_IOERROR "Input/Output error. "
#define CDRTOOLS_IOERROR_LENGTH 20
#define CDRTOOLS_SECTORERROR "Error on sector"
#define CDRTOOLS_SECTORERROR_LENGTH 15
#define CDRTOOLS_RETRYSECTOR "Retrying from sector"
#define CDRTOOLS_RETRYSECTOR_LENGTH 20
#define CDRTOOLS_C2ERRORS "C2 errors "
#define CDRTOOLS_C2ERRORS_LENGTH 10
#define CDRTOOLS_PERCENTDONE "percent_done:"
#define CDRTOOLS_PERCENTDONE_LENGTH 13
#define CDRTOOLS_DEPPDIR "Directories too deep"
#define CDRTOOLS_DEEPDIR_LENGTH 20
#define CDRTOOLS_FOUNDDVDMEDIA "Found DVD"
#define CDRTOOLS_FOUNDDVDMEDIA_LENGTH 9
#define CDRTOOLS_OPENSESSION "Cannot open new sess"
#define CDRTOOLS_OPENSESSION_LENGTH 20
#define CDRTOOLS_DISCSPACEWARNING "Data may not fit on cur"
#define CDRTOOLS_DISCSPACEWARNING_LENGTH 23
#define CDRTOOLS_TURNINGBFON "Turning BURN"
#define CDRTOOLS_TURNINGBFON_LENGTH 12
#define CDRTOOLS_TOTALEXTENT "Total extent"
#define CDRTOOLS_TOTALEXTENT_LENGTH 12
#define CDRTOOLS_SIZEOFBOOT "Size of boot"
#define CDRTOOLS_SIZEOFBOOT_LENGTH 12
#define CDRTOOLS_ERRORLEADIN "Could not write Lead-in."
#define CDRTOOLS_ERRORLEADIN_LENGTH 24
#define CDRTOOLS_ERRORINITDRIVE "Cannot init drive"
#define CDRTOOLS_ERRORINITDRIVE_LENGTH 17
#define CDRTOOLS_DVDRWDUMMY "DVD+RW has no -du"
#define CDRTOOLS_DVDRWDUMMY_LENGTH 17
#define CDRTOOLS_FIFO "fifo"
#define CDRTOOLS_FIFO_LENGTH 4
================================================
FILE: src/app/core/core.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include "cdrtools_parse_strings.hh"
#include "string_table.hh"
#include "settings.hh"
#include "log_dlg.hh"
#include "lang_util.hh"
#include "version.hh"
#include "temp_manager.hh"
#include "device_util.hh"
#include "core2.hh"
#include "core.hh"
// FIXME: How come Windows 95 supports larger command lines than Windows 2000?
// Windows 2000 seems to be the only OS that is limited to MAX_PATH.
// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp
// http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
//
// Possible solution?
// http://blogs.msdn.com/oldnewthing/archive/2003/12/10/56028.aspx
// http://blogs.msdn.com/oldnewthing/archive/2003/12/11/56043.aspx
CCore g_Core;
CCore::CCore()
{
m_iMode = -1;
m_iStatusMode = SMODE_DEFAULT;
m_bGraceTimeDone = false;
m_bDummyMode = false;
m_bErrorPathMode = true;
m_uiCDRToolsPathLen = 0;
m_pProgress = NULL;
}
CCore::~CCore()
{
m_TrackSize.clear();
}
/*
CCore::Initialize
-----------------
Prepares the object. This function should be called in the beginning of all
cdrtools related functions.
*/
void CCore::Initialize(int iMode,CAdvancedProgress *pProgress)
{
m_iMode = iMode;
m_iStatusMode = SMODE_DEFAULT;
m_bGraceTimeDone = false;
m_bErrorPathMode = true; // By default we're looking for a cygwin path before error messages.
m_uiCDRToolsPathLen = lstrlen(g_GlobalSettings.m_szCDRToolsPathCyg);
m_pProgress = pProgress;
// Remove all previous track information.
m_TrackSize.clear();
m_uiCurrentTrack = 0;
m_lNumCopies = 1;
}
void CCore::Reinitialize()
{
m_bGraceTimeDone = false;
m_bErrorPathMode = true; // By default we're looking for a cygwin path before error messages.
m_uiCDRToolsPathLen = lstrlen(g_GlobalSettings.m_szCDRToolsPathCyg);
m_uiCurrentTrack = 0;
}
void CCore::CreateBatchFile(const char *szChangeDir,const char *szCommandLine,TCHAR *szBatchPath)
{
// FIXME: This is not very nice.
ckcore::File BatchFile = ckcore::File::temp(g_GlobalSettings.m_szTempPath,
ckT("InfraRecorder"));
lstrcpy(szBatchPath,BatchFile.name().c_str());
// Delete the generated temporary file since we need a batch file.
ckcore::File::remove(szBatchPath);
ChangeFileExt(szBatchPath,_T(".bat"));
CStringContainerA StringContainer;
if (szChangeDir != NULL)
StringContainer.m_szStrings.push_back(szChangeDir);
StringContainer.m_szStrings.push_back(szCommandLine);
StringContainer.SaveToFile(szBatchPath);
}
bool CCore::SafeLaunch(tstring &CommandLine,bool bWaitForProcess)
{
if (g_GlobalSettings.m_bLog)
g_pLogDlg->print_line(_T(" Command line to run: %s"),CommandLine.c_str());
if (m_lNumCopies > 0)
m_lNumCopies--;
m_LastCmdLine = CommandLine;
m_bLastWaitForProcess = bWaitForProcess;
// If the command line is longer than 260 characters we need to take special
// actions since all (only Windows 2000?) Windows versions older than XP are
// limited to MAX_PATH. Windows XP supports 32K character command lines.
if (CommandLine.length() > MAX_PATH - 1)
{
if (g_WinVer.m_ulMajorVersion < MAJOR_WINXP ||
(g_WinVer.m_ulMajorVersion == MAJOR_WINXP && g_WinVer.m_ulMinorVersion < MINOR_WINXP))
{
// Windows NT4 and 2000 supports 2048 character command lines, I am not
// sure if Windows 9x do. This needs to be checked.
if (CommandLine.length() > 2047)
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),2048);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
if (g_GlobalSettings.m_bLog)
g_pLogDlg->print_line(_T(" Warning: The command line is %d characters long. Trying to execute through shell."),CommandLine.length());
TCHAR szBatchPath[MAX_PATH];
char *szCommandLine = new char[CommandLine.length() + 1];
UnicodeToAnsi(szCommandLine,CommandLine.c_str(),(int)CommandLine.length() + 1);
// Create the batch file.
CreateBatchFile(NULL,szCommandLine,szBatchPath);
delete [] szCommandLine;
TCHAR szBatchCmdLine[MAX_PATH + 2];
lstrcpy(szBatchCmdLine,_T("\""));
lstrcat(szBatchCmdLine,szBatchPath);
lstrcat(szBatchCmdLine,_T("\""));
if (bWaitForProcess)
{
bool bResult = create(szBatchCmdLine);
ckcore::File::remove(szBatchPath);
if (bWaitForProcess)
wait();
return bResult;
}
else
{
g_TempManager.AddObject(szBatchPath);
bool bResult = create(szBatchCmdLine);
if (bWaitForProcess)
wait();
return bResult;
}
}
// Windows XP supports maximum 32768 characters.
else if (CommandLine.length() > 32767)
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),2048);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
}
bool bResult = create((TCHAR *)CommandLine.c_str());
if (bWaitForProcess)
wait();
return bResult;
}
bool CCore::Relaunch()
{
if (m_lNumCopies <= 0 || m_LastCmdLine.size() == 0)
return false;
if (!m_pProgress->RequestNextDisc())
return false;
// Launch the process from a separate thread since the current thread belongs
// to the previous process.
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,NextCopyThread,this,0,&ulThreadID);
if (hThread != NULL)
{
::CloseHandle(hThread);
return true;
}
return false;
}
bool CCore::CheckGraceTime(const char *szBuffer)
{
// If the message: Starting to write CD/DVD... is received we know that the
// grace count down time is about to start so we change the new line
// delimiter to '.' since the gracetime is updated using the '\b' character.
if (!strncmp(szBuffer,CDRTOOLS_STARTCDWRITE,CDRTOOLS_STARTCDWRITE_LENGTH))
{
// Sometimes the "Starting to write CD/DVD..." string will reappear after the
// grace time countdown. Because of that we only allow this delimiter change once.
if (!m_bGraceTimeDone)
add_block_delim('.');
return true;
}
else if (!strncmp(szBuffer,CDRTOOLS_GRACEBEGIN,CDRTOOLS_GRACEBEGIN_LENGTH))
{
m_iStatusMode = SMODE_GRACETIME;
char szMode[6]; // Can be "dummy" or "real".
int iTimer = 0;
sscanf(szBuffer,"Last chance to quit, starting %s write in %d seconds.",szMode,&iTimer);
m_bDummyMode = szMode[0] == 'd';
// Update the status.
m_pProgress->set_status(lngGetString(PROGRESS_GRACETIME),iTimer);
return true;
}
return false;
}
bool CCore::CheckProgress(const char *szBuffer)
{
if (!strncmp(szBuffer,CDRTOOLS_STARTTRACK,CDRTOOLS_STARTTRACK_LENGTH))
{
add_block_delim('.');
m_iStatusMode = SMODE_PREPROGRESS;
return true;
}
return false;
}
void CCore::ErrorOutputCDRECORD(const char *szBuffer)
{
if (m_pProgress != NULL)
{
if (!strncmp(szBuffer,CDRTOOLS_NOMEDIA,CDRTOOLS_NOMEDIA_LENGTH))
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_NOMEDIA));
else if (!strncmp(szBuffer,CDRTOOLS_BLANKERROR,CDRTOOLS_BLANKERROR_LENGTH))
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_ERASE));
else if (!strncmp(szBuffer,CDRTOOLS_BLANKUNSUP,CDRTOOLS_BLANKUNSUP_LENGTH))
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(INFO_UNSUPERASEMODE));
else if (!strncmp(szBuffer,CDRTOOLS_BLANKRETRY,CDRTOOLS_BLANKRETRY_LENGTH))
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(INFO_ERASERETRY));
else if (!strncmp(szBuffer,CDRTOOLS_NODISC,CDRTOOLS_NODISC_LENGTH))
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_NOMEDIA));
else if (!strncmp(szBuffer,CDRTOOLS_BADAUDIOCODING,CDRTOOLS_BADAUDIOCODING_LENGTH))
{
TCHAR szMessage[MAX_PATH + 128];
lstrcpy(szMessage,lngGetString(FAILURE_AUDIOCODING));
TCHAR szFileName[MAX_PATH + 3];
AnsiToUnicode(szFileName,szBuffer + CDRTOOLS_BADAUDIOCODING_LENGTH + 10,sizeof(szFileName) / sizeof(wchar_t));
lstrcat(szMessage,szFileName);
m_pProgress->notify(ckcore::Progress::ckERROR,szMessage);
}
else if (!strncmp(szBuffer,CDRTOOLS_UNSUPPORTED,CDRTOOLS_UNSUPPORTED_LENGTH))
{
char *pBuffer = (char *)szBuffer + 12;
if (!strncmp(pBuffer,CDRTOOLS_SECTOR,CDRTOOLS_SECTOR_LENGTH))
{
int iSectorSize = 0;
sscanf(pBuffer,"sector size %ld for %*[^\0]",&iSectorSize);
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_BADSECTORSIZE),iSectorSize);
}
}
else if (!strncmp(szBuffer,CDRTOOLS_WRITEERROR,CDRTOOLS_WRITEERROR_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_WRITE));
}
#ifndef CORE_DVD_SUPPORT
else if (!strncmp(szBuffer,CDRTOOLS_FOUNDDVDMEDIA,CDRTOOLS_FOUNDDVDMEDIA_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(FAILURE_DVDSUPPORT));
}
#endif
else if (!strncmp(szBuffer,CDRTOOLS_OPENSESSION,CDRTOOLS_OPENSESSION_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_OPENSESSION));
}
else if (!strncmp(szBuffer,CDRTOOLS_WARNINGCAP,CDRTOOLS_WARNINGCAP_LENGTH)) // "WARNING:" Prefix.
{
char *pBuffer = (char *)szBuffer + CDRTOOLS_WARNINGCAP_LENGTH + 1;
if (!strncmp(pBuffer,CDRTOOLS_DISCSPACEWARNING,CDRTOOLS_DISCSPACEWARNING_LENGTH))
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(WARNING_DISCSIZE));
}
else if (!strncmp(szBuffer,CDRTOOLS_ERRORLEADIN,CDRTOOLS_ERRORLEADIN_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_WRITELEADIN));
// When called from BurnTracks/BurnCompilation we need to flag the operation as failed.
m_bOperationRes = false;
}
else if (!strncmp(szBuffer,CDRTOOLS_ERRORINITDRIVE,CDRTOOLS_ERRORINITDRIVE_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_INITDRIVE));
// When called from BurnTracks/BurnCompilation we need to flag the operation as failed.
m_bOperationRes = false;
}
else if (!strncmp(szBuffer,CDRTOOLS_DVDRWDUMMY,CDRTOOLS_DVDRWDUMMY_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_DVDRWDUMMY));
// When called from BurnTracks/BurnCompilation we need to flag the operation as failed.
m_bOperationRes = false;
}
#ifdef CORE_IGNORE_ERRORINFOMESSAGES // Ingore error information messages.
else if (!strncmp(szBuffer,CDRTOOLS_VERSIONINFO,CDRTOOLS_VERSIONINFO_LENGTH))
return;
else if (!strncmp(szBuffer,CDRTOOLS_DVDINFO,CDRTOOLS_DVDINFO_LENGTH))
return;
else if (!strncmp(szBuffer,CDRTOOLS_DVDGETINFO,CDRTOOLS_DVDGETINFO_LENGTH))
return;
#endif
#ifdef CORE_PRINT_UNSUPERRORMESSAGES // Print unhandled messages from cdrecord to the log window.
#ifdef CORE_DVD_SUPPORT
else if (!strncmp(szBuffer,CDRTOOLS_FOUNDDVDMEDIA,CDRTOOLS_FOUNDDVDMEDIA_LENGTH))
return;
#endif
else if (!strncmp(szBuffer,CDRTOOLS_TURNINGBFON,CDRTOOLS_TURNINGBFON_LENGTH))
return;
else if (!strncmp(szBuffer,CDRTOOLS_FIFO,CDRTOOLS_FIFO_LENGTH))
return;
else
{
m_pProgress->notify(ckcore::Progress::ckEXTERNAL,
ckcore::string::ansi_to_auto<1024>(szBuffer).c_str());
}
#endif
}
}
void CCore::ErrorOutputREADCD(const char *szBuffer)
{
if (m_pProgress != NULL)
{
if (!strncmp(szBuffer,CDRTOOLS_IOERROR,CDRTOOLS_IOERROR_LENGTH))
{
char *pBuffer = (char *)szBuffer + CDRTOOLS_IOERROR_LENGTH;
if (!strncmp(pBuffer,CDRTOOLS_SECTORERROR,CDRTOOLS_SECTORERROR_LENGTH))
{
unsigned long ulSector = atoi(pBuffer + CDRTOOLS_SECTORERROR_LENGTH + 1);
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(ERROR_SECTOR),ulSector);
}
}
else if (!strncmp(szBuffer,CDRTOOLS_RETRYSECTOR,CDRTOOLS_RETRYSECTOR_LENGTH))
{
unsigned long ulSector = atoi(szBuffer + CDRTOOLS_RETRYSECTOR_LENGTH + 1);
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_READSOURCEDISC),ulSector);
}
#ifdef CORE_PRINT_UNSUPERRORMESSAGES
else
{
m_pProgress->notify(ckcore::Progress::ckEXTERNAL,
ckcore::string::ansi_to_auto<1024>(szBuffer).c_str());
}
#endif
}
}
void CCore::ErrorOutputCDDA2WAV(const char *szBuffer)
{
}
void CCore::EraseOutput(const char *szBuffer)
{
// Check if the media or command is not supported by the drive.
if (!strncmp(szBuffer,CDRTOOLS_NOSUPPORT,CDRTOOLS_NOSUPPORT_LENGTH))
{
char *pBuffer = (char *)szBuffer + 42;
if (!strncmp(pBuffer,CDRTOOLS_BLANK,CDRTOOLS_BLANK_LENGTH))
m_pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_UNSUPRW));
}
else if (CheckGraceTime(szBuffer))
{
return;
}
else if (!strncmp(szBuffer,CDRTOOLS_BLANKTIME,CDRTOOLS_BLANKTIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_ERASE));
}
else if (!strncmp(szBuffer,CDRTOOLS_RELOADDRIVE,CDRTOOLS_RELOADDRIVE_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(FAILURE_LOADDRIVE));
m_pProgress->set_status(lngGetString(ERROR_RELOADDRIVE));
// Enable the reload button.
m_pProgress->AllowReload();
}
}
void CCore::FixateOutput(const char *szBuffer)
{
if (CheckGraceTime(szBuffer))
{
return;
}
else if (!strncmp(szBuffer,CDRTOOLS_FIXATETIME,CDRTOOLS_FIXATETIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_FIXATE));
}
else if (!strncmp(szBuffer,CDRTOOLS_RELOADDRIVE,CDRTOOLS_RELOADDRIVE_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(FAILURE_LOADDRIVE));
m_pProgress->set_status(lngGetString(ERROR_RELOADDRIVE));
// Enable the reload button.
m_pProgress->AllowReload();
}
}
void CCore::BurnImageOutput(const char *szBuffer)
{
if (CheckGraceTime(szBuffer))
return;
if (CheckProgress(szBuffer))
return;
if (!strncmp(szBuffer,CDRTOOLS_WRITEPREGAP,CDRTOOLS_WRITEPREGAP_LENGTH))
{
int iTrack = 0;
long lPos = 0;
sscanf(szBuffer,"Writing pregap for track %d at %ld",&iTrack,&lPos);
TCHAR szStatus[64];
lsnprintf_s(szStatus,64,lngGetString(STATUS_WRITEPREGAP),iTrack,lPos);
m_pProgress->set_status(szStatus);
}
else if (!strncmp(szBuffer,CDRTOOLS_FILLFIFO,CDRTOOLS_FILLFIFO_LENGTH))
{
m_pProgress->set_status(lngGetString(STATUS_FILLBUFFER));
}
else if (!strncmp(szBuffer,CDRTOOLS_WRITETIME,CDRTOOLS_WRITETIME_LENGTH))
{
// Only display the error message if no error occured.
if (m_bOperationRes)
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_WRITE));
}
else if (!strncmp(szBuffer,CDRTOOLS_FIXATE,CDRTOOLS_FIXATE_LENGTH))
{
m_pProgress->set_status(lngGetString(STATUS_FIXATE));
}
else if (!strncmp(szBuffer,CDRTOOLS_FIXATETIME,CDRTOOLS_FIXATETIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_FIXATE));
}
else if (!strncmp(szBuffer,CDRTOOLS_WARNINGCAP,CDRTOOLS_WARNINGCAP_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(WARNING_FIXATE));
}
else if (!strncmp(szBuffer,CDRTOOLS_RELOADDRIVE,CDRTOOLS_RELOADDRIVE_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckWARNING,lngGetString(FAILURE_LOADDRIVE));
m_pProgress->set_status(lngGetString(ERROR_RELOADDRIVE));
// Enable the reload button.
m_pProgress->AllowReload();
}
}
void CCore::ReadDataTrackOutput(const char *szBuffer)
{
if (!strncmp(szBuffer,CDRTOOLS_END,CDRTOOLS_END_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINREADTRACK),m_TrackSize[1]);
m_pProgress->set_status(lngGetString(STATUS_READTRACK));
}
else if (!strncmp(szBuffer,CDRTOOLS_ADDRESS,CDRTOOLS_ADDRESS_LENGTH))
{
unsigned __int64 uiAddress = 0;
unsigned __int64 uiCount = 0;
if (sscanf(szBuffer,"addr: %8ld cnt: %ld",&uiAddress,&uiCount) == 2)
m_pProgress->set_progress((unsigned char)(((double)(uiAddress - m_TrackSize[0])/m_uiTotalSize) * 100));
}
else if (!strncmp(szBuffer,CDRTOOLS_TOTALTIME,CDRTOOLS_TOTALTIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_READTRACK),m_TrackSize[1]);
m_bOperationRes = true; // Success.
}
}
void CCore::ReadAudioTrackOutput(const char *szBuffer)
{
if (!strncmp(szBuffer,CDRTOOLS_PERCENTDONE,CDRTOOLS_PERCENTDONE_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINREADTRACK),m_uiTotalSize);
m_pProgress->set_status(lngGetString(STATUS_READTRACK));
m_iStatusMode = SMODE_AUDIOPROGRESS;
}
}
void CCore::ScanTrackOutput(const char *szBuffer)
{
if (!strncmp(szBuffer,CDRTOOLS_END,CDRTOOLS_END_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINSCANTRACK),m_TrackSize[1]);
m_pProgress->set_status(lngGetString(STATUS_SCANTRACK));
}
else if (!strncmp(szBuffer,CDRTOOLS_ADDRESS,CDRTOOLS_ADDRESS_LENGTH))
{
unsigned __int64 uiAddress = 0;
unsigned __int64 uiCount = 0;
if (sscanf(szBuffer,"addr: %8ld cnt: %ld",&uiAddress,&uiCount) == 2)
m_pProgress->set_progress((unsigned char)(((double)(uiAddress - m_TrackSize[0])/m_uiTotalSize) * 100));
}
else if (!strncmp(szBuffer,CDRTOOLS_TOTALTIME,CDRTOOLS_TOTALTIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_SCANTRACK),m_TrackSize[1]);
m_bOperationRes = true; // Success.
}
else if (!strncmp(szBuffer,CDRTOOLS_C2ERRORS,CDRTOOLS_C2ERRORS_LENGTH))
{
char *pBuffer = (char *)szBuffer + CDRTOOLS_C2ERRORS_LENGTH;
if (!strncmp(pBuffer,"total",5))
{
unsigned long ulBytes = 0;
unsigned long ulSectors = 0;
if (sscanf(pBuffer + 7,"%ld bytes in %d sectors on disk",&ulBytes,&ulSectors) == 2)
{
m_pProgress->notify(ulSectors > 0 ? ckcore::Progress::ckWARNING : ckcore::Progress::ckINFORMATION,
lngGetString(STATUS_C2TOTAL),ulBytes,ulBytes);
}
}
else if (!strncmp(pBuffer,"rate",4))
{
float fRate = (float)atof(pBuffer + 6);
m_pProgress->notify(fRate > 0 ? ckcore::Progress::ckWARNING : ckcore::Progress::ckINFORMATION,
lngGetString(STATUS_C2RATE),fRate);
}
}
}
void CCore::ReadDiscOutput(const char *szBuffer)
{
if (!strncmp(szBuffer,CDRTOOLS_END,CDRTOOLS_END_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINREADDISC));
m_pProgress->set_status(lngGetString(STATUS_READDISC));
// Update the total number of sectors to process.
m_uiTotalSize = atoi(szBuffer + CDRTOOLS_END_LENGTH);
// Prevent a crash if the above function fails.
if (m_uiTotalSize == 0)
m_uiTotalSize = 1;
}
else if (!strncmp(szBuffer,CDRTOOLS_ADDRESS,CDRTOOLS_ADDRESS_LENGTH))
{
unsigned __int64 uiAddress = 0;
unsigned __int64 uiCount = 0;
if (sscanf(szBuffer,"addr: %8ld cnt: %ld",&uiAddress,&uiCount) == 2)
m_pProgress->set_progress((unsigned char)(((double)uiAddress/m_uiTotalSize) * 100));
}
else if (!strncmp(szBuffer,CDRTOOLS_TOTALTIME,CDRTOOLS_TOTALTIME_LENGTH))
{
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_READDISC));
m_bOperationRes = true; // Success.
}
}
void CCore::event_output(const std::string &block)
{
// Write to the log.
if (g_GlobalSettings.m_bLog && m_iStatusMode == SMODE_DEFAULT)
{
g_pLogDlg->print(_T(" > "));
g_pLogDlg->print_line(ckcore::string::ansi_to_auto<1024>(block.c_str()).c_str());
}
// Always skip the copyright line.
if (!strncmp(block.c_str(),CDRTOOLS_COPYRIGHT,CDRTOOLS_COPYRIGHT_LENGTH))
return;
// Check for a cygwin path.
if (m_bErrorPathMode)
{
if (!strncmp(block.c_str(),CDRTOOLS_CYGWINPATH,CDRTOOLS_CYGWINPATH_LENGTH))
{
// An error message has been found.
if (!strncmp(block.c_str() + m_uiCDRToolsPathLen,CDRTOOLS_ERROR,CDRTOOLS_ERROR_LENGTH))
{
ErrorOutputCDRECORD(block.c_str() + m_uiCDRToolsPathLen + CDRTOOLS_ERROR_LENGTH);
return;
}
else if (!strncmp(block.c_str() + m_uiCDRToolsPathLen,CDRTOOLS_ERROR3,CDRTOOLS_ERROR3_LENGTH))
{
ErrorOutputREADCD(block.c_str() + m_uiCDRToolsPathLen + CDRTOOLS_ERROR3_LENGTH);
return;
}
else if (!strncmp(block.c_str() + m_uiCDRToolsPathLen,CDRTOOLS_ERROR4,CDRTOOLS_ERROR4_LENGTH))
{
ErrorOutputCDDA2WAV(block.c_str() + m_uiCDRToolsPathLen + CDRTOOLS_ERROR4_LENGTH);
return;
}
}
}
else
{
// An error message has been found.
if (!strncmp(block.c_str(),CDRTOOLS_ERROR,CDRTOOLS_ERROR_LENGTH))
{
ErrorOutputCDRECORD(block.c_str() + CDRTOOLS_ERROR_LENGTH);
return;
}
else if (!strncmp(block.c_str(),CDRTOOLS_ERROR3,CDRTOOLS_ERROR3_LENGTH))
{
ErrorOutputREADCD(block.c_str() + CDRTOOLS_ERROR3_LENGTH);
return;
}
else if (!strncmp(block.c_str(),CDRTOOLS_ERROR4,CDRTOOLS_ERROR4_LENGTH))
{
ErrorOutputCDDA2WAV(block.c_str() + CDRTOOLS_ERROR4_LENGTH);
return;
}
}
// If we are in grace time mode we only look for timer updates.
if (m_iStatusMode == SMODE_GRACETIME)
{
int iTimer = 0;
sscanf(block.c_str(),"\b\b\b\b\b\b\b\b\b\b\b\b\b%4d seconds",&iTimer);
// Update the status.
m_pProgress->set_status(lngGetString(PROGRESS_GRACETIME),iTimer);
// Leave grace time mode if the timer is 0.
if (iTimer == 0)
{
m_iStatusMode = SMODE_DEFAULT;
m_bGraceTimeDone = true;
// We reset the line delimiter to the new line character.
remove_block_delim('.');
// Add a new message to the progress window (and update its staus).
switch (m_iMode)
{
case MODE_ERASE:
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINERASE),
m_bDummyMode ? lngGetString(WRITEMODE_SIMULATION) : lngGetString(WRITEMODE_REAL));
m_pProgress->set_status(lngGetString(STATUS_ERASE));
break;
case MODE_FIXATE:
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINFIXATE),
m_bDummyMode ? lngGetString(WRITEMODE_SIMULATION) : lngGetString(WRITEMODE_REAL));
m_pProgress->set_status(lngGetString(STATUS_FIXATE));
break;
case MODE_BURNIMAGE:
case MODE_BURNIMAGEEX:
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINWRITE),
m_bDummyMode ? lngGetString(WRITEMODE_SIMULATION) : lngGetString(WRITEMODE_REAL));
m_pProgress->set_status(lngGetString(STATUS_WRITEDATA));
break;
};
// Start the smoke.
//if (!m_bDummyMode)
m_pProgress->StartSmoke();
m_pProgress->SetRealMode(true);
}
return;
}
else if (m_iStatusMode == SMODE_PREPROGRESS)
{
// Now we want to terminate the strings by the x (speed).
add_block_delim('x');
// Change the mode to progress mode.
m_iStatusMode = SMODE_PROGRESS;
// notify the status window that we're starting to write a new track.
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINTRACK),
m_uiCurrentTrack + 1);
return;
}
else if (m_iStatusMode == SMODE_PROGRESS)
{
// "Track 01: 1 of 473 MB written (fifo 100%) [buf 100%] 0.3x"
//int iTrack = 0;
int iBuffer = 0;
__int64 iWritten = 0;
float fSpeed = 0.0f;
char *pBuffer = (char *)block.c_str();
if (pBuffer[0] == '.')
*pBuffer++;
// Special parsing, cdrtools has a bad habit of only writing output that is
// not zero. This only affects the FIFO and buffer size. We know that the
// track number, written size (in MB) and the write speed is always included
// (cdrecord.c).
pBuffer += 6;
//iTrack = atoi(pBuffer);
// Skip the integer.
pBuffer = SkipInteger(pBuffer);
// Skip the ':' character.
*pBuffer++;
iWritten = _atoi64(pBuffer);
// Skip the integer.
pBuffer = SkipInteger(pBuffer);
// Skip trailing whitespace.
*pBuffer++;
// Look for total size (currently ignored).
if (!strncmp(pBuffer,"of ",3))
{
pBuffer += 3;
pBuffer = SkipInteger(pBuffer);
// Skip trailing whitespace.
*pBuffer++;
}
pBuffer += 11;
// Look for FIFO (currently ignored).
if (*pBuffer == '(')
{
pBuffer += 6;
pBuffer = SkipInteger(pBuffer);
// Skip the '%', ')' and whitespace character.
pBuffer += 3;
}
// Look for buffer.
if (*pBuffer == '[')
{
pBuffer += 5;
iBuffer = atoi(pBuffer);
pBuffer = SkipInteger(pBuffer);
// Skip the '%', ']' and whitespace character.
pBuffer += 3;
}
// Update: 2007-02-10. Skip BCAP information.
if (*pBuffer == '|')
pBuffer += 12;
// Write speed.
fSpeed = (float)atof(pBuffer);
// Update the status.
m_pProgress->set_status(lngGetString(STATUS_WRITE),m_uiCurrentTrack + 1,(int)m_TrackSize.size(),fSpeed);
m_pProgress->set_progress((unsigned char)(((double)(iWritten + m_uiProcessedSize)/m_uiTotalSize) * 100));
m_pProgress->SetBuffer(iBuffer);
// Check if we're done writing the track.
if (iWritten != 0 && iWritten == static_cast<__int64>(m_TrackSize[m_uiCurrentTrack]))
{
m_uiCurrentTrack++;
remove_block_delim('x');
// Leave the progress mode.
m_iStatusMode = SMODE_DEFAULT;
// Update the totoal processed size.
m_uiProcessedSize += iWritten;
}
return;
}
else if (m_iStatusMode == SMODE_AUDIOPROGRESS)
{
int iProgress = atoi(block.c_str());
m_pProgress->set_progress((unsigned char)iProgress);
if (iProgress == 100)
{
m_iStatusMode = SMODE_DEFAULT;
m_pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_READTRACK),m_uiTotalSize);
m_bOperationRes = true; // Success.
}
}
switch (m_iMode)
{
case MODE_EJECT:
break;
case MODE_ERASE:
EraseOutput(block.c_str());
break;
case MODE_FIXATE:
FixateOutput(block.c_str());
break;
case MODE_BURNIMAGE:
case MODE_BURNIMAGEEX:
BurnImageOutput(block.c_str());
break;
case MODE_READDATATRACK:
case MODE_READDATATRACKEX:
ReadDataTrackOutput(block.c_str());
break;
case MODE_READAUDIOTRACK:
case MODE_READAUDIOTRACKEX:
ReadAudioTrackOutput(block.c_str());
break;
case MODE_SCANTRACK:
case MODE_SCANTRACKEX:
ScanTrackOutput(block.c_str());
break;
case MODE_READDISC:
case MODE_READDISCEX:
ReadDiscOutput(block.c_str());
break;
};
}
void CCore::event_finished()
{
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::ProcessEnded"));
g_pLogDlg->print_line(_T(" Process exited with code: %d."),uiExitCode);
}
switch (m_iMode)
{
case MODE_EJECT:
break;
case MODE_ERASE:
case MODE_FIXATE:
//case MODE_BURNIMAGE:
case MODE_READDATATRACK:
case MODE_READAUDIOTRACK:
case MODE_SCANTRACK:
case MODE_READDISC:
m_pProgress->set_progress(100);
m_pProgress->set_status(lngGetString(uiExitCode == 0 ? PROGRESS_DONE : PROGRESS_FAILED));
m_pProgress->NotifyCompleted();
break;
case MODE_BURNIMAGE:
m_pProgress->set_progress(100);
m_pProgress->set_status(lngGetString(uiExitCode == 0 ? PROGRESS_DONE : PROGRESS_FAILED));
if (m_lNumCopies <= 0 || !Relaunch())
m_pProgress->NotifyCompleted();
break;
//case MODE_BURNIMAGEEX:
case MODE_READDATATRACKEX:
case MODE_READAUDIOTRACKEX:
case MODE_SCANTRACKEX:
case MODE_READDISCEX:
if (m_bOperationRes)
{
m_pProgress->set_progress(0);
}
else
{
m_pProgress->set_progress(100);
m_pProgress->set_status(lngGetString(uiExitCode == 0 ? PROGRESS_DONE : PROGRESS_FAILED));
m_pProgress->NotifyCompleted();
}
break;
case MODE_BURNIMAGEEX:
if (m_lNumCopies <= 0 || !Relaunch())
{
if (m_bOperationRes)
{
m_pProgress->set_progress(0);
}
else
{
m_pProgress->set_progress(100);
m_pProgress->set_status(lngGetString(uiExitCode == 0 ? PROGRESS_DONE : PROGRESS_FAILED));
m_pProgress->NotifyCompleted();
}
}
break;
};
}
bool CCore::EjectDisc(ckmmc::Device &Device,bool bWaitForProcess)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::EjectDisc"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
}
// Initialize this object.
Initialize(MODE_EJECT);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -eject dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::LoadDisc(ckmmc::Device &Device,bool bWaitForProcess)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::LoadDisc"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
}
// Initialize this object.
Initialize(MODE_EJECT);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -load dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::EraseDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,
int iMode,bool bForce,bool bEject,bool bSimulate)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::EraseDisc"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Mode = %d, Force = %d, Eject = %d, Simulate = %d."),
iMode,(int)bForce,(int)bEject,(int)bSimulate);
}
// Initialize this object.
Initialize(MODE_ERASE,pProgress);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -v -blank=");
switch (iMode)
{
case 0:
CommandLine += _T("all dev=");
break;
case 2:
CommandLine += _T("unclose dev=");
break;
case 3:
CommandLine += _T("session dev=");
break;
default:
CommandLine += _T("fast dev=");
break;
}
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" gracetime=%d"),g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
if (bForce)
CommandLine += _T(" -force");
if (Device.support(ckmmc::Device::ckDEVICE_EJECT) && bEject)
CommandLine += _T(" -eject");
if (Device.support(ckmmc::Device::ckDEVICE_TEST_WRITE) && bSimulate)
CommandLine += _T(" -dummy");
return SafeLaunch(CommandLine,false);
}
bool CCore::FixateDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,
bool bEject,bool bSimulate)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::FixateDisc"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Eject = %d, Simulate = %d."),
(int)bEject,(int)bSimulate);
}
// Initialize this object.
Initialize(MODE_FIXATE,pProgress);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -v -fix dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" gracetime=%d"),g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
if (Device.support(ckmmc::Device::ckDEVICE_EJECT) && bEject)
CommandLine += _T(" -eject");
if (Device.support(ckmmc::Device::ckDEVICE_TEST_WRITE) && bSimulate)
CommandLine += _T(" -dummy");
return SafeLaunch(CommandLine,false);
}
bool CCore::BurnImage(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bWaitForProcess,bool bCloneMode)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::BurnImage"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" File = %s."),szFileName);
g_pLogDlg->print_line(_T(" Eject = %d, Simulate = %d, BUP = %d, Pad tracks = %d, Close = %d, Overburn = %d, Swab = %d, Ignore size = %d, Immed = %d, Audio master = %d, Forcespeed = %d, VariRec (enabled) = %d, VariRec (value) = %d, Clone = %d."),
(int)g_BurnImageSettings.m_bEject,
(int)g_BurnImageSettings.m_bSimulate,
(int)g_BurnImageSettings.m_bBUP,
(int)g_BurnImageSettings.m_bPadTracks,
(int)g_BurnImageSettings.m_bFixate,
(int)g_BurnAdvancedSettings.m_bOverburn,
(int)g_BurnAdvancedSettings.m_bSwab,
(int)g_BurnAdvancedSettings.m_bIgnoreSize,
(int)g_BurnAdvancedSettings.m_bImmed,
(int)g_BurnAdvancedSettings.m_bAudioMaster,
(int)g_BurnAdvancedSettings.m_bForceSpeed,
(int)g_BurnAdvancedSettings.m_bVariRec,
g_BurnAdvancedSettings.m_iVariRec,
(int)bCloneMode);
}
// Initialize this object.
Initialize(MODE_BURNIMAGE,pProgress);
// For creating multiple copies.
m_lNumCopies = g_BurnImageSettings.m_lNumCopies;
// We need to specify the total size that we should record.
m_uiProcessedSize = 0;
m_uiTotalSize = ckcore::File::size(szFileName) / (1024 * 1024); // MB.
m_TrackSize.push_back(m_uiTotalSize);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -v dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
// Clone.
if (bCloneMode)
CommandLine += _T(" -clone");
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" gracetime=%d"),g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
// FIFO.
if (g_GlobalSettings.m_iFIFOSize != 4)
{
lsprintf(szBuffer,_T(" fs=%dm"),g_GlobalSettings.m_iFIFOSize);
CommandLine += szBuffer;
}
// Eject.
if (Device.support(ckmmc::Device::ckDEVICE_EJECT) &&
g_BurnImageSettings.m_bEject)
{
CommandLine += _T(" -eject");
}
// Simulation.
if (Device.support(ckmmc::Device::ckDEVICE_TEST_WRITE) &&
g_BurnImageSettings.m_bSimulate)
{
CommandLine += _T(" -dummy");
}
// Write method.
switch (g_BurnImageSettings.m_iWriteMethod)
{
case WRITEMETHOD_SAO:
CommandLine += _T(" -sao");
break;
case WRITEMETHOD_TAO:
CommandLine += _T(" -tao");
break;
case WRITEMETHOD_TAONOPREGAP:
CommandLine += _T(" -tao pregap=0");
break;
case WRITEMETHOD_RAW96R:
CommandLine += _T(" -raw96r");
break;
case WRITEMETHOD_RAW16:
CommandLine += _T(" -raw16");
break;
case WRITEMETHOD_RAW96P:
CommandLine += _T(" -raw96p");
break;
};
TCHAR szDriverOpts[128];
lstrcpy(szDriverOpts,_T(" driveropts="));
bool bUseDriverOpts = false;
// Buffer underrun protection.
if (Device.support(ckmmc::Device::ckDEVICE_BUP))
{
bUseDriverOpts = true;
if (g_BurnImageSettings.m_bBUP)
lstrcat(szDriverOpts,_T("burnfree,"));
else
lstrcat(szDriverOpts,_T("noburnfree,"));
}
// Audio master.
if (Device.support(ckmmc::Device::ckDEVICE_AUDIO_MASTER))
{
if (g_BurnAdvancedSettings.m_bAudioMaster)
{
lstrcat(szDriverOpts,_T("audiomaster,"));
bUseDriverOpts = true;
}
}
// Forcespeed.
if (Device.support(ckmmc::Device::ckDEVICE_FORCE_SPEED))
{
if (!g_BurnAdvancedSettings.m_bForceSpeed)
{
lstrcat(szDriverOpts,_T("noforcespeed,"));
bUseDriverOpts = true;
}
}
// VariRec.
if (Device.support(ckmmc::Device::ckDEVICE_VARIREC))
{
if (g_BurnAdvancedSettings.m_bVariRec)
{
TCHAR szVariRec[32];
lsprintf(szVariRec,_T("varirec=%d,"),g_BurnAdvancedSettings.m_iVariRec);
lstrcat(szDriverOpts,szVariRec);
bUseDriverOpts = true;
}
}
if (bUseDriverOpts)
{
szDriverOpts[lstrlen(szDriverOpts) - 1] = '\0';
CommandLine += szDriverOpts;
}
// Pad tracks.
if (g_BurnImageSettings.m_bPadTracks)
CommandLine += _T(" -pad");
// Fixate.
if (!g_BurnImageSettings.m_bFixate)
CommandLine += _T(" -nofix");
// Overburning.
if (g_BurnAdvancedSettings.m_bOverburn)
CommandLine += _T(" -overburn");
// Swap audio byte order. FIXME: Should possibly check for support before selecting.
if (g_BurnAdvancedSettings.m_bSwab)
CommandLine += _T(" -swab");
// Ignore size.
if (g_BurnAdvancedSettings.m_bIgnoreSize)
CommandLine += _T(" -ignsize");
// SCSI IMMED flag.
if (g_BurnAdvancedSettings.m_bImmed)
CommandLine += _T(" -immed");
// Speed.
if (g_BurnImageSettings.m_iWriteSpeed != -1)
{
lsprintf(szBuffer,_T(" speed=%d"),g_BurnImageSettings.m_iWriteSpeed);
CommandLine += szBuffer;
}
// File name.
TCHAR szCygwinFileName[MAX_PATH + 16];
GetCygwinFileName(szFileName,szCygwinFileName);
ckcore::Path FilePath(szFileName);
if (!ckcore::string::astrcmpi(FilePath.ext_name().c_str(),ckT("cue")))
{
CommandLine += _T(" cuefile=\"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
else // any other.
{
CommandLine += _T(" \"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::BurnTracks(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode,int iMode,bool bWaitForProcess)
{
// This function behaves different from almost all the others using
// m_bOperationRes. It actually assumes a successfull writing until proved
// otherwise.
m_bOperationRes = true;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::BurnTracks"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
if (szDataTrack != NULL)
g_pLogDlg->print_line(_T(" File = %s."),szDataTrack);
g_pLogDlg->print_line(_T(" Eject = %d, Simulate = %d, BUP = %d, Pad tracks = %d, Close = %d, Method = %d, Overburn = %d, Swab = %d, Ignore size = %d, Immed = %d, Audio master = %d, Forcespeed = %d, VariRec (enabled) = %d, VariRec (value) = %d, Mode = %d."),
(int)g_BurnImageSettings.m_bEject,
(int)g_BurnImageSettings.m_bSimulate,
(int)g_BurnImageSettings.m_bBUP,
(int)g_BurnImageSettings.m_bPadTracks,
(int)g_BurnImageSettings.m_bFixate,
g_BurnImageSettings.m_iWriteMethod,
(int)g_BurnAdvancedSettings.m_bOverburn,
(int)g_BurnAdvancedSettings.m_bSwab,
(int)g_BurnAdvancedSettings.m_bIgnoreSize,
(int)g_BurnAdvancedSettings.m_bImmed,
(int)g_BurnAdvancedSettings.m_bAudioMaster,
(int)g_BurnAdvancedSettings.m_bForceSpeed,
(int)g_BurnAdvancedSettings.m_bVariRec,
g_BurnAdvancedSettings.m_iVariRec,
iDataMode);
}
// Initialize this object.
Initialize(iMode,pProgress);
// We need to specify the total size that we should record.
m_uiProcessedSize = 0;
if (szDataTrack != NULL)
{
m_uiTotalSize = ckcore::File::size(szDataTrack) / (1024 * 1024); // MB.
m_TrackSize.push_back(m_uiTotalSize);
}
else
{
m_uiTotalSize = 0;
}
for (unsigned int i = 0; i < AudioTracks.size(); i++)
{
unsigned __int64 uiTrackSize = ckcore::File::size(AudioTracks[i]) / (1024 * 1024);
m_TrackSize.push_back(uiTrackSize);
m_uiTotalSize += uiTrackSize;
}
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -v dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" gracetime=%d"),g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
// FIFO.
if (g_GlobalSettings.m_iFIFOSize != 4)
{
lsprintf(szBuffer,_T(" fs=%dm"),g_GlobalSettings.m_iFIFOSize);
CommandLine += szBuffer;
}
// Eject.
if (Device.support(ckmmc::Device::ckDEVICE_EJECT) &&
g_BurnImageSettings.m_bEject)
{
CommandLine += _T(" -eject");
}
// Simulation.
if (Device.support(ckmmc::Device::ckDEVICE_TEST_WRITE) &&
g_BurnImageSettings.m_bSimulate)
{
CommandLine += _T(" -dummy");
}
// Write method.
switch (g_BurnImageSettings.m_iWriteMethod)
{
case WRITEMETHOD_SAO:
CommandLine += _T(" -sao");
break;
case WRITEMETHOD_TAO:
CommandLine += _T(" -tao");
break;
case WRITEMETHOD_TAONOPREGAP:
CommandLine += _T(" -tao pregap=0");
break;
case WRITEMETHOD_RAW96R:
CommandLine += _T(" -raw96r");
break;
case WRITEMETHOD_RAW16:
CommandLine += _T(" -raw16");
break;
case WRITEMETHOD_RAW96P:
CommandLine += _T(" -raw96p");
break;
};
TCHAR szDriverOpts[128];
lstrcpy(szDriverOpts,_T(" driveropts="));
bool bUseDriverOpts = false;
// Buffer underrun protection.
if (Device.support(ckmmc::Device::ckDEVICE_BUP))
{
bUseDriverOpts = true;
if (g_BurnImageSettings.m_bBUP)
lstrcat(szDriverOpts,_T("burnfree,"));
else
lstrcat(szDriverOpts,_T("noburnfree,"));
}
// Audio master.
if (Device.support(ckmmc::Device::ckDEVICE_AUDIO_MASTER))
{
if (g_BurnAdvancedSettings.m_bAudioMaster)
{
lstrcat(szDriverOpts,_T("audiomaster,"));
bUseDriverOpts = true;
}
}
// Forcespeed.
if (Device.support(ckmmc::Device::ckDEVICE_FORCE_SPEED))
{
if (!g_BurnAdvancedSettings.m_bForceSpeed)
{
lstrcat(szDriverOpts,_T("noforcespeed,"));
bUseDriverOpts = true;
}
}
// VariRec.
if (Device.support(ckmmc::Device::ckDEVICE_VARIREC))
{
if (g_BurnAdvancedSettings.m_bVariRec)
{
TCHAR szVariRec[32];
lsprintf(szVariRec,_T("varirec=%d,"),g_BurnAdvancedSettings.m_iVariRec);
lstrcat(szDriverOpts,szVariRec);
bUseDriverOpts = true;
}
}
if (bUseDriverOpts)
{
szDriverOpts[lstrlen(szDriverOpts) - 1] = '\0';
CommandLine += szDriverOpts;
}
// Pad tracks.
if (g_BurnImageSettings.m_bPadTracks)
CommandLine += _T(" -pad");
// Fixate.
if (!g_BurnImageSettings.m_bFixate)
CommandLine += _T(" -nofix");
// Overburning.
if (g_BurnAdvancedSettings.m_bOverburn)
CommandLine += _T(" -overburn");
// Swap audio byte order. // FIXME: Should probably check for support before selecting.
if (g_BurnAdvancedSettings.m_bSwab)
CommandLine += _T(" -swab");
// Ignore size.
if (g_BurnAdvancedSettings.m_bIgnoreSize)
CommandLine += _T(" -ignsize");
// SCSI IMMED flag.
if (g_BurnAdvancedSettings.m_bImmed)
CommandLine += _T(" -immed");
// Speed.
if (g_BurnImageSettings.m_iWriteSpeed != -1)
{
lsprintf(szBuffer,_T(" speed=%d"),g_BurnImageSettings.m_iWriteSpeed);
CommandLine += szBuffer;
}
// File name.
TCHAR szCygwinFileName[MAX_PATH + 16];
if (szDataTrack != NULL)
{
// Mode.
switch (iDataMode)
{
case 0: // Mode 1
CommandLine += _T(" -data");
break;
case 1: // Mode 2 XA (multisession)
CommandLine += _T(" -multi");
break;
};
GetCygwinFileName(szDataTrack,szCygwinFileName);
ckcore::Path FilePath(szDataTrack);
if (!ckcore::string::astrcmpi(FilePath.ext_name().c_str(),ckT("cue")))
{
CommandLine += _T(" cuefile=\"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
else // any other.
{
CommandLine += _T(" \"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
}
// Audio tracks.
if (AudioTracks.size() > 0)
CommandLine += _T(" -audio");
for (unsigned int i = 0; i < AudioTracks.size(); i++)
{
GetCygwinFileName(AudioTracks[i],szCygwinFileName);
CommandLine += _T(" \"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
// Audio text.
if (szAudioText != NULL)
{
CommandLine += _T(" textfile=\"");
CommandLine += szAudioText;
CommandLine += _T("\"");
}
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::BurnImage(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bCloneMode)
{
return BurnImage(Device,pProgress,szFileName,false,bCloneMode);
}
/*
CCore::BurnImageEx
------------------
Same as the function above except that it will not return untill the process
has ended.
*/
bool CCore::BurnImageEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bCloneMode)
{
return BurnImage(Device,pProgress,szFileName,true,bCloneMode);
}
bool CCore::BurnTracks(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode)
{
return BurnTracks(Device,pProgress,szDataTrack,AudioTracks,szAudioText,
iDataMode,MODE_BURNIMAGE,true);
}
/*
CCore::BurnTracksEx
-------------------
Works like CCore::BurnTracks but it does not end the progress when done. It
allows for more operations to be performed in the same progress window. It
also has extra return values.
*/
eBurnResult CCore::BurnTracksEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode)
{
if (!BurnTracks(Device,pProgress,szDataTrack,AudioTracks,szAudioText,
iDataMode,MODE_BURNIMAGEEX,true))
{
return BURNRESULT_INTERNALERROR;
}
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? RESULT_OK : RESULT_EXTERNALERROR;
}
/*
CCore::ReadDataTrack
--------------------
Reads a track from the CD and stores the raw binary content in the file
named szFileName.
*/
bool CCore::ReadDataTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector,
int iMode,bool bWaitForProcess)
{
m_bOperationRes = false;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::ReadDataTrack"));
g_pLogDlg->print_line(_T(" File = %s."),szFileName);
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Start = %d, End = %d."),ulStartSector,ulEndSector);
}
// Initialize this object.
Initialize(iMode,pProgress);
// We need to specify the end adresses (in sectors) that we should read.
m_uiProcessedSize = 0;
m_uiTotalSize = ulEndSector - ulStartSector; // Track length (in sectors).
m_TrackSize.push_back(ulStartSector); // Start address of the track.
m_TrackSize.push_back(uiTrackNumber);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_READAPP);
CommandLine += _T("\" dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
// Sector range.
TCHAR szBuffer[128];
lsprintf(szBuffer,_T(" sectors=%d-%d"),ulStartSector,ulEndSector);
CommandLine += szBuffer;
// File name.
CommandLine += _T(" f=\"");
CommandLine += szFileName;
CommandLine += _T("\"");
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::ReadDataTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector)
{
return ReadDataTrack(Device,pProgress,szFileName,uiTrackNumber,
ulStartSector,ulEndSector,MODE_READDATATRACK,true);
}
eBurnResult CCore::ReadDataTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector)
{
if (!ReadDataTrack(Device,pProgress,szFileName,uiTrackNumber,ulStartSector,
ulEndSector,MODE_READDATATRACKEX,true))
{
return BURNRESULT_INTERNALERROR;
}
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
}
/*
*/
bool CCore::ReadAudioTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,unsigned int uiTrackNumber,
int iMode,bool bWaitForProcess)
{
m_bOperationRes = false;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::ReadAudioTrack"));
g_pLogDlg->print_line(_T(" File = %s."),szFileName);
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
}
// Initialize this object.
Initialize(iMode,pProgress);
// Remember what track we are working with.
m_uiTotalSize = uiTrackNumber;
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_AUDIOAPP);
CommandLine += _T("\" -D ");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
// Miscellaneous.
CommandLine += _T(" -I generic_scsi -x -B -O wav -g -H");
// Track.
TCHAR szBuffer[128];
lsprintf(szBuffer,_T(" -t %d+%d"),uiTrackNumber,uiTrackNumber);
CommandLine += szBuffer;
// File name.
CommandLine += _T(" \"");
CommandLine += szFileName;
CommandLine += _T("\"");
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::ReadAudioTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,unsigned int uiTrackNumber)
{
return ReadAudioTrack(Device,pProgress,szFileName,uiTrackNumber,
MODE_READAUDIOTRACK,true);
}
eBurnResult CCore::ReadAudioTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber)
{
if (!ReadAudioTrack(Device,pProgress,szFileName,uiTrackNumber,
MODE_READAUDIOTRACKEX,true))
{
return BURNRESULT_INTERNALERROR;
}
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
}
/*
CCore::ScanTrack
----------------
Scans the selected track for CRC and C2 errors.
*/
bool CCore::ScanTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
unsigned int uiTrackNumber,unsigned long ulStartSector,
unsigned long ulEndSector,int iMode,bool bWaitForProcess)
{
m_bOperationRes = false;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::ScanTrack"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Start = %d, End = %d."),ulStartSector,ulEndSector);
}
// Initialize this object.
Initialize(iMode,pProgress);
// We need to specify the end adresses (in sectors) that we should read.
m_uiProcessedSize = 0;
m_uiTotalSize = ulEndSector - ulStartSector; // Track length (in sectors).
m_TrackSize.push_back(ulStartSector); // Start address of the track.
m_TrackSize.push_back(uiTrackNumber);
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_READAPP);
CommandLine += _T("\" -c2scan dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
// Sector range.
TCHAR szBuffer[128];
lsprintf(szBuffer,_T(" sectors=%d-%d"),ulStartSector,ulEndSector);
CommandLine += szBuffer;
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::ScanTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector)
{
return ScanTrack(Device,pProgress,uiTrackNumber,ulStartSector,ulEndSector,
MODE_SCANTRACK,true);
}
eBurnResult CCore::ScanTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector)
{
if (!ScanTrack(Device,pProgress,uiTrackNumber,ulStartSector,ulEndSector,
MODE_SCANTRACKEX,true))
{
return BURNRESULT_INTERNALERROR;
}
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
}
/*
CCore::CopyDisc
---------------
Performs an on-the-fly copy of a disc. This function is configured through the
g_BurnImageSettings, g_BurnAdvancedSettings and g_ReadSettings (m_bIgnoreErr
only) objects.
*/
bool CCore::CopyDisc(ckmmc::Device &SrcDevice,ckmmc::Device &DstDevice,
CAdvancedProgress *pProgress)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::CopyDisc"));
g_pLogDlg->print_line(_T(" Source: [%d,%d,%d] %s"),SrcDevice.address().bus_,
SrcDevice.address().target_,SrcDevice.address().lun_,
SrcDevice.name());
g_pLogDlg->print_line(_T(" Target: [%d,%d,%d] %s"),DstDevice.address().bus_,
DstDevice.address().target_,DstDevice.address().lun_,
DstDevice.name());
g_pLogDlg->print_line(_T(" Eject = %d, Simulate = %d, BUP = %d, Pad tracks = %d, Close = %d, Overburn = %d, Swab = %d, Ignore size = %d, Immed = %d, Audio master = %d, Forcespeed = %d, VariRec (enabled) = %d, VariRec (value) = %d, Ignore read errors = %d."),
(int)g_BurnImageSettings.m_bEject,
(int)g_BurnImageSettings.m_bSimulate,
(int)g_BurnImageSettings.m_bBUP,
(int)g_BurnImageSettings.m_bPadTracks,
(int)g_BurnImageSettings.m_bFixate,
(int)g_BurnAdvancedSettings.m_bOverburn,
(int)g_BurnAdvancedSettings.m_bSwab,
(int)g_BurnAdvancedSettings.m_bIgnoreSize,
(int)g_BurnAdvancedSettings.m_bImmed,
(int)g_BurnAdvancedSettings.m_bAudioMaster,
(int)g_BurnAdvancedSettings.m_bForceSpeed,
(int)g_BurnAdvancedSettings.m_bVariRec,
g_BurnAdvancedSettings.m_iVariRec,
(int)g_ReadSettings.m_bIgnoreErr);
}
// Initialize this object.
Initialize(MODE_BURNIMAGE,pProgress);
// Since this function uses a batch file for execution no cygwin paths are included in
// stderr messages.
m_bErrorPathMode = false;
// We need to specify the total size that we should record.
m_uiProcessedSize = 0;
m_uiTotalSize = g_CopyDiscSettings.m_uiSourceSize / (1024 * 1024); // MB.
m_TrackSize.push_back(m_uiTotalSize);
std::string CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = CORE_READAPP;
CommandLine += " -v dev=";
// Source device.
CommandLine += NDeviceUtil::GetDeviceAddrA(SrcDevice);
// Speed.
char szBuffer[64];
if (g_BurnImageSettings.m_iWriteSpeed != -1)
{
sprintf(szBuffer," speed=%d",g_BurnImageSettings.m_iWriteSpeed);
CommandLine += szBuffer;
}
// Ignore read errors.
if (g_ReadSettings.m_bIgnoreErr)
CommandLine += " -noerror -nocorr";
// Redirection.
CommandLine += " f=- 2> NUL: | ";
// Write app related.
CommandLine += CORE_WRITEAPP;
CommandLine += " -v dev=";
CommandLine += NDeviceUtil::GetDeviceAddrA(DstDevice);
sprintf(szBuffer," gracetime=%d",g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
// FIFO.
if (g_GlobalSettings.m_iFIFOSize != 4)
{
sprintf(szBuffer," fs=%dm",g_GlobalSettings.m_iFIFOSize);
CommandLine += szBuffer;
}
// Eject.
if (DstDevice.support(ckmmc::Device::ckDEVICE_EJECT) &&
g_BurnImageSettings.m_bEject)
{
CommandLine += " -eject";
}
// Simulation.
if (DstDevice.support(ckmmc::Device::ckDEVICE_TEST_WRITE) &&
g_BurnImageSettings.m_bSimulate)
{
CommandLine += " -dummy";
}
// Write method.
switch (g_BurnImageSettings.m_iWriteMethod)
{
case WRITEMETHOD_SAO:
CommandLine += " -sao";
break;
case WRITEMETHOD_TAO:
CommandLine += " -tao";
break;
case WRITEMETHOD_TAONOPREGAP:
CommandLine += " -tao pregap=0";
break;
case WRITEMETHOD_RAW96R:
CommandLine += " -raw96r";
break;
case WRITEMETHOD_RAW16:
CommandLine += " -raw16";
break;
case WRITEMETHOD_RAW96P:
CommandLine += " -raw96p";
break;
};
char szDriverOpts[128];
strcpy(szDriverOpts," driveropts=");
bool bUseDriverOpts = false;
// Buffer underrun protection.
if (DstDevice.support(ckmmc::Device::ckDEVICE_BUP))
{
bUseDriverOpts = true;
if (g_BurnImageSettings.m_bBUP)
strcat(szDriverOpts,"burnfree,");
else
strcat(szDriverOpts,"noburnfree,");
}
// Audio master.
if (DstDevice.support(ckmmc::Device::ckDEVICE_AUDIO_MASTER))
{
if (g_BurnAdvancedSettings.m_bAudioMaster)
{
strcat(szDriverOpts,"audiomaster,");
bUseDriverOpts = true;
}
}
// Forcespeed.
if (DstDevice.support(ckmmc::Device::ckDEVICE_FORCE_SPEED))
{
if (!g_BurnAdvancedSettings.m_bForceSpeed)
{
strcat(szDriverOpts,"noforcespeed,");
bUseDriverOpts = true;
}
}
// VariRec.
if (DstDevice.support(ckmmc::Device::ckDEVICE_VARIREC))
{
if (g_BurnAdvancedSettings.m_bVariRec)
{
char szVariRec[16];
sprintf(szVariRec,"varirec=%d,",g_BurnAdvancedSettings.m_iVariRec);
strcat(szDriverOpts,szVariRec);
bUseDriverOpts = true;
}
}
if (bUseDriverOpts)
{
szDriverOpts[strlen(szDriverOpts) - 1] = '\0';
CommandLine += szDriverOpts;
}
// Pad tracks.
if (g_BurnImageSettings.m_bPadTracks)
CommandLine += " -pad";
// Fixate.
if (!g_BurnImageSettings.m_bFixate)
CommandLine += " -nofix";
// Overburning.
if (g_BurnAdvancedSettings.m_bOverburn)
CommandLine += " -overburn";
// Swap audio byte order. // FIXME: Should probably check for support before selecting.
if (g_BurnAdvancedSettings.m_bSwab)
CommandLine += " -swab";
// Ignore size.
if (g_BurnAdvancedSettings.m_bIgnoreSize)
CommandLine += " -ignsize";
// SCSI IMMED flag.
if (g_BurnAdvancedSettings.m_bImmed)
CommandLine += " -immed";
// Redirection.
CommandLine += " -";
char szChangeDir[MAX_PATH + 3];
strcpy(szChangeDir,"cd ");
char szFolderPath[MAX_PATH];
UnicodeToAnsi(szFolderPath,g_GlobalSettings.m_szCDRToolsPath,sizeof(szFolderPath));
strcat(szChangeDir,szFolderPath);
if (CommandLine.length() > 2047)
{
// All versions below Windows XP only supports 2047 character command lines (using the shell).
if (g_WinVer.m_ulMajorVersion < MAJOR_WINXP ||
(g_WinVer.m_ulMajorVersion == MAJOR_WINXP && g_WinVer.m_ulMinorVersion < MINOR_WINXP))
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),2048);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
// Windows XP supports 8192 character command lines (using the shell).
else if (CommandLine.length() > 8191)
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),8192);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
}
// Create the batch file.
TCHAR szBatchPath[MAX_PATH];
CreateBatchFile(szChangeDir,CommandLine.c_str(),szBatchPath);
TCHAR szBatchCmdLine[MAX_PATH + 2];
lstrcpy(szBatchCmdLine,_T("\""));
lstrcat(szBatchCmdLine,szBatchPath);
lstrcat(szBatchCmdLine,_T("\""));
bool bResult = create(szBatchCmdLine);
wait();
ckcore::File::remove(szBatchPath);
return bResult;
}
/*
CCore::ReadDisc
---------------
Reads a disc to a disc image. This function is configured through the
g_ReadSettings object.
*/
bool CCore::ReadDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
int iMode,bool bWaitForProcess)
{
m_bOperationRes = false;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::ReadDisc"));
g_pLogDlg->print_line(_T(" File = %s."),szFileName);
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Ignore read errors = %d, Clone = %d, Speed = %d."),
(int)g_ReadSettings.m_bIgnoreErr,
(int)g_ReadSettings.m_bClone,
g_ReadSettings.m_iReadSpeed);
}
// Initialize this object.
Initialize(iMode,pProgress);
// We need to specify the end adresses (in sectors) that we should read.
m_uiProcessedSize = 0;
m_uiTotalSize = 0;
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_READAPP);
CommandLine += _T("\" dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
// Ignore read errors.
if (g_ReadSettings.m_bIgnoreErr)
CommandLine += _T(" -noerror -nocorr");
// Clone.
if (g_ReadSettings.m_bClone)
CommandLine += _T(" -clone");
// Speed.
if (g_ReadSettings.m_iReadSpeed != -1)
{
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" speed=%d"),g_ReadSettings.m_iReadSpeed); // FIXME: Is this CD or profile dependent speed?
}
// File name.
CommandLine += _T(" f=\"");
CommandLine += GetCygwinFileName(szFileName);
CommandLine += _T("\"");
return SafeLaunch(CommandLine,bWaitForProcess);
}
bool CCore::ReadDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName)
{
return ReadDisc(Device,pProgress,szFileName,MODE_READDISC,false);
}
eBurnResult CCore::ReadDiscEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName)
{
if (!ReadDisc(Device,pProgress,szFileName,MODE_READDISCEX,true))
return BURNRESULT_INTERNALERROR;
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
}
DWORD WINAPI CCore::CreateCompImageThread(LPVOID lpThreadParameter)
{
CCompImageParams *pParams = (CCompImageParams *)lpThreadParameter;
g_Core2.CreateImage(pParams->m_Process,pParams->m_Files,
pParams->m_Progress,false);
return 0;
}
DWORD WINAPI CCore::NextCopyThread(LPVOID lpThreadParameter)
{
CCore *pCore = (CCore *)lpThreadParameter;
pCore->Reinitialize();
pCore->m_uiProcessedSize = 0;
pCore->m_pProgress->set_progress(0);
TCHAR szBuffer[128];
lsprintf(szBuffer,lngGetString(INFO_CREATECOPY),
g_BurnImageSettings.m_lNumCopies - pCore->m_lNumCopies + 1,
g_BurnImageSettings.m_lNumCopies);
pCore->m_pProgress->notify(ckcore::Progress::ckINFORMATION,szBuffer);
pCore->SafeLaunch(pCore->m_LastCmdLine,pCore->m_bLastWaitForProcess);
return 0;
}
/*
CCore::BurnCompilation
----------------------
Burns a compilation on the fly to a disc. This function is configured through
the g_BurnImageSettings and g_ProjectSettings object.
*/
bool CCore::BurnCompilation(ckmmc::Device &Device,CAdvancedProgress *pProgress,
ckcore::Progress &Progress,const ckfilesystem::FileSet &Files,
std::vector &AudioTracks,const TCHAR *szAudioText,
int iDataMode,unsigned __int64 uiDataBytes,int iMode)
{
m_bOperationRes = true;
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore::BurnCompilation"));
g_pLogDlg->print_line(_T(" [%d,%d,%d] %s"),Device.address().bus_,
Device.address().target_,Device.address().lun_,
Device.name());
g_pLogDlg->print_line(_T(" Eject = %d, Simulate = %d, BUP = %d, Pad tracks = %d, Close = %d, Overburn = %d, Swab = %d, Ignore size = %d, Immed = %d, Audio master = %d, Forcespeed = %d, VariRec (enabled) = %d, VariRec (value) = %d, Data bytes %I64d."),
(int)g_BurnImageSettings.m_bEject,
(int)g_BurnImageSettings.m_bSimulate,
(int)g_BurnImageSettings.m_bBUP,
(int)g_BurnImageSettings.m_bPadTracks,
(int)g_BurnImageSettings.m_bFixate,
(int)g_BurnAdvancedSettings.m_bOverburn,
(int)g_BurnAdvancedSettings.m_bSwab,
(int)g_BurnAdvancedSettings.m_bIgnoreSize,
(int)g_BurnAdvancedSettings.m_bImmed,
(int)g_BurnAdvancedSettings.m_bAudioMaster,
(int)g_BurnAdvancedSettings.m_bForceSpeed,
(int)g_BurnAdvancedSettings.m_bVariRec,
g_BurnAdvancedSettings.m_iVariRec,
uiDataBytes);
}
// Initialize this object.
Initialize(iMode,pProgress);
// Since this function uses a batch file for execution no cygwin paths are included in
// stderr messages.
m_bErrorPathMode = false;
// We need to specify the total size that we should record.
m_uiProcessedSize = 0;
m_uiTotalSize = uiDataBytes / (1024 * 1024); // MiB.
m_TrackSize.push_back(m_uiTotalSize);
for (unsigned int i = 0; i < AudioTracks.size(); i++)
{
unsigned __int64 uiTrackSize = ckcore::File::size(AudioTracks[i]) / (1024 * 1024);
m_TrackSize.push_back(uiTrackSize);
m_uiTotalSize += uiTrackSize;
}
// Setup the command line.
tstring CommandLine;
CommandLine.reserve(MAX_PATH);
// Write application part of the command line.
CommandLine = _T("\"");
CommandLine += g_GlobalSettings.m_szCDRToolsPath;
CommandLine += _T(CORE_WRITEAPP);
CommandLine += _T("\" -v dev=");
CommandLine += NDeviceUtil::GetDeviceAddr(Device);
TCHAR szBuffer[64];
lsprintf(szBuffer,_T(" gracetime=%d"),g_GlobalSettings.m_iGraceTime);
CommandLine += szBuffer;
// FIFO.
if (g_GlobalSettings.m_iFIFOSize != 4)
{
lsprintf(szBuffer,_T(" fs=%dm"),g_GlobalSettings.m_iFIFOSize);
CommandLine += szBuffer;
}
// Eject.
if (Device.support(ckmmc::Device::ckDEVICE_EJECT) &&
g_BurnImageSettings.m_bEject)
{
CommandLine += _T(" -eject");
}
// Simulation.
if (Device.support(ckmmc::Device::ckDEVICE_TEST_WRITE) &&
g_BurnImageSettings.m_bSimulate)
{
CommandLine += _T(" -dummy");
}
// Write method.
switch (g_BurnImageSettings.m_iWriteMethod)
{
case WRITEMETHOD_SAO:
CommandLine += _T(" -sao");
// The SAO method needs to know the size of the file system beforehand (specified in sectors).
lsprintf(szBuffer,_T(" tsize=%I64ds"),uiDataBytes/2048);
CommandLine += szBuffer;
break;
case WRITEMETHOD_TAO:
CommandLine += _T(" -tao");
break;
case WRITEMETHOD_TAONOPREGAP:
CommandLine += _T(" -tao pregap=0");
break;
case WRITEMETHOD_RAW96R:
CommandLine += _T(" -raw96r");
break;
case WRITEMETHOD_RAW16:
CommandLine += _T(" -raw16");
break;
case WRITEMETHOD_RAW96P:
CommandLine += _T(" -raw96p");
break;
};
TCHAR szDriverOpts[128];
lstrcpy(szDriverOpts,_T(" driveropts="));
bool bUseDriverOpts = false;
// Buffer underrun protection.
if (Device.support(ckmmc::Device::ckDEVICE_BUP))
{
bUseDriverOpts = true;
if (g_BurnImageSettings.m_bBUP)
lstrcat(szDriverOpts,_T("burnfree,"));
else
lstrcat(szDriverOpts,_T("noburnfree,"));
}
// Audio master.
if (Device.support(ckmmc::Device::ckDEVICE_AUDIO_MASTER))
{
if (g_BurnAdvancedSettings.m_bAudioMaster)
{
lstrcat(szDriverOpts,_T("audiomaster,"));
bUseDriverOpts = true;
}
}
// Forcespeed.
if (Device.support(ckmmc::Device::ckDEVICE_FORCE_SPEED))
{
if (!g_BurnAdvancedSettings.m_bForceSpeed)
{
lstrcat(szDriverOpts,_T("noforcespeed,"));
bUseDriverOpts = true;
}
}
// VariRec.
if (Device.support(ckmmc::Device::ckDEVICE_VARIREC))
{
if (g_BurnAdvancedSettings.m_bVariRec)
{
TCHAR szVariRec[32];
lsprintf(szVariRec,_T("varirec=%d,"),g_BurnAdvancedSettings.m_iVariRec);
lstrcat(szDriverOpts,szVariRec);
bUseDriverOpts = true;
}
}
if (bUseDriverOpts)
{
szDriverOpts[lstrlen(szDriverOpts) - 1] = '\0';
CommandLine += szDriverOpts;
}
// Pad tracks.
if (g_BurnImageSettings.m_bPadTracks)
CommandLine += _T(" -pad");
// Fixate.
if (!g_BurnImageSettings.m_bFixate)
CommandLine += _T(" -nofix");
// Overburning.
if (g_BurnAdvancedSettings.m_bOverburn)
CommandLine += _T(" -overburn");
// Swap audio byte order. // FIXME: Should probably check for support before selecting.
if (g_BurnAdvancedSettings.m_bSwab)
CommandLine += _T(" -swab");
// Ignore size.
if (g_BurnAdvancedSettings.m_bIgnoreSize)
CommandLine += _T(" -ignsize");
// SCSI IMMED flag.
if (g_BurnAdvancedSettings.m_bImmed)
CommandLine += _T(" -immed");
// Speed.
if (g_BurnImageSettings.m_iWriteSpeed != -1)
{
lsprintf(szBuffer,_T(" speed=%d"),g_BurnImageSettings.m_iWriteSpeed);
CommandLine += szBuffer;
}
// Mode.
switch (iDataMode)
{
case 0: // Mode 1
CommandLine += _T(" -data -");
break;
case 1: // Mode 2 XA (multisession)
CommandLine += _T(" -multi -");
break;
};
// Audio tracks.
if (AudioTracks.size() > 0)
CommandLine += _T(" -audio");
TCHAR szCygwinFileName[MAX_PATH + 16];
for (unsigned int i = 0; i < AudioTracks.size(); i++)
{
GetCygwinFileName(AudioTracks[i],szCygwinFileName);
CommandLine += _T(" \"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
// Audio text.
if (szAudioText != NULL)
{
CommandLine += _T(" textfile=\"");
CommandLine += szCygwinFileName;
CommandLine += _T("\"");
}
if (CommandLine.length() > 2047)
{
// All versions below Windows XP only supports 2047 character command lines (using the shell).
if (g_WinVer.m_ulMajorVersion < MAJOR_WINXP ||
(g_WinVer.m_ulMajorVersion == MAJOR_WINXP && g_WinVer.m_ulMinorVersion < MINOR_WINXP))
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),2048);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
// Windows XP supports 8192 character command lines (using the shell).
else if (CommandLine.length() > 8191)
{
TCHAR szMessage[256];
lsnprintf_s(szMessage,256,lngGetString(ERROR_COMMANDLINE),8192);
MessageBox(HWND_DESKTOP,szMessage,lngGetString(GENERAL_ERROR),MB_OK | MB_ICONERROR);
return false;
}
}
// Create a separate thread for writing the file system to the process.
CCompImageParams CompImageParams(*this,Progress,Files);
unsigned long ulThreadID = 0;
HANDLE hThread = ::CreateThread(NULL,0,CreateCompImageThread,&CompImageParams,0,&ulThreadID);
::CloseHandle(hThread);
//return Launch((TCHAR *)CommandLine.c_str(),true);
return SafeLaunch(CommandLine,true);
}
bool CCore::BurnCompilation(ckmmc::Device &Device,CAdvancedProgress *pProgress,
ckcore::Progress &Progress,const ckfilesystem::FileSet &Files,
std::vector &AudioTracks,const TCHAR *szAudioText,
int iMode,unsigned __int64 uiDataBytes)
{
return BurnCompilation(Device,pProgress,Progress,Files,AudioTracks,
szAudioText,iMode,uiDataBytes,MODE_BURNIMAGE);
}
eBurnResult CCore::BurnCompilationEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
ckcore::Progress &Progress,const ckfilesystem::FileSet &Files,
std::vector &AudioTracks,const TCHAR *szAudioText,
int iMode,unsigned __int64 uiDataBytes)
{
if (!BurnCompilation(Device,pProgress,Progress,Files,AudioTracks,szAudioText,
iMode,uiDataBytes,MODE_BURNIMAGEEX))
{
return BURNRESULT_INTERNALERROR;
}
ckcore::tuint32 uiExitCode = 0;
exit_code(uiExitCode);
return uiExitCode == 0 ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
//return m_bOperationRes ? BURNRESULT_OK : BURNRESULT_EXTERNALERROR;
}
================================================
FILE: src/app/core/core.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include
#include
#include
#include
#include "advanced_progress.hh"
#define CORE_IGNORE_ERRORINFOMESSAGES // Should we ignore error information message (copyright etc.)?
#define CORE_PRINT_UNSUPERRORMESSAGES // Should we print unhandled/unsupported messages to the log window?
#define CORE_DVD_SUPPORT // Is DVD recording supported in this version?
enum eBurnResult
{
BURNRESULT_OK = 0,
BURNRESULT_INTERNALERROR = -1,
BURNRESULT_EXTERNALERROR = -2
};
#ifdef CDRKIT
#define CORE_WRITEAPP "wodim.exe"
#define CORE_READAPP "readom.exe"
#define CORE_AUDIOAPP "icedax.exe"
#else
#define CORE_WRITEAPP "cdrecord.exe"
#define CORE_READAPP "readcd.exe"
#define CORE_AUDIOAPP "cdda2wav.exe"
#endif
class CCore : public ckcore::Process
{
private:
int m_iMode;
int m_iStatusMode;
bool m_bGraceTimeDone;
bool m_bDummyMode;
bool m_bErrorPathMode; // Is set to true when we're expecting a cygwin path in the beginning of each error message.
bool m_bOperationRes;
unsigned __int64 m_uiProcessedSize;
unsigned __int64 m_uiTotalSize;
unsigned __int64 m_uiEstimatedSize; // Used when estimating file system size.
std::vector m_TrackSize;
unsigned int m_uiCurrentTrack;
// Holds the length of the path to the cdrtools directory (cygwin path).
// This is used to remove the cygwin path to cdrtools on every stderr message.
// It's important that the length is updated when the path changes.
unsigned int m_uiCDRToolsPathLen;
// Object that can receive messages while receiving output from a console
// application.
CAdvancedProgress *m_pProgress;
// Used for creating multiple copies (when recording a disc image).
long m_lNumCopies;
tstring m_LastCmdLine;
bool m_bLastWaitForProcess;
// Used when quering version information.
ckcore::tstring m_Version;
void Initialize(int iMode,CAdvancedProgress *pProgress = NULL);
void Reinitialize();
void CreateBatchFile(const char *szChangeDir,const char *szCommandLine,TCHAR *szBatchPath);
bool SafeLaunch(tstring &CommandLine,bool bWaitForProcess);
bool Relaunch();
bool CheckGraceTime(const char *szBuffer);
bool CheckProgress(const char *szBuffer);
void ErrorOutputCDRECORD(const char *szBuffer);
void ErrorOutputREADCD(const char *szBuffer);
void ErrorOutputCDDA2WAV(const char *szBuffer);
void EraseOutput(const char *szBuffer);
void FixateOutput(const char *szBuffer);
void BurnImageOutput(const char *szBuffer);
void ReadDataTrackOutput(const char *szBuffer);
void ReadAudioTrackOutput(const char *szBuffer);
void ScanTrackOutput(const char *szBuffer);
void ReadDiscOutput(const char *szBuffer);
void VersionOutput(const char *szBuffer);
// Inherited events.
void event_output(const std::string &block);
void event_finished();
// Thread functions.
class CCompImageParams // A pointer to a structure of this type should be passed as thead parameter for CreateCompImageThread.
{
public:
ckcore::Process &m_Process;
ckcore::Progress &m_Progress;
const ckfilesystem::FileSet &m_Files;
CCompImageParams(ckcore::Process &Process,ckcore::Progress &Progress,
const ckfilesystem::FileSet &Files) : m_Process(Process),
m_Progress(Progress),m_Files(Files)
{
}
};
static DWORD WINAPI CreateCompImageThread(LPVOID lpThreadParameter);
static DWORD WINAPI NextCopyThread(LPVOID lpThreadParameter);
bool BurnImage(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bWaitForProcess,bool bCloneMode);
bool BurnTracks(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode,int iMode,bool bWaitForProcess);
bool ReadDataTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber,unsigned long ulStartSector,unsigned long ulEndSector,
int iMode,bool bWaitForProcess);
bool ReadAudioTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber,int iMode,bool bWaitForProcess);
bool ScanTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector,int iMode,bool bWaitForProcess);
bool ReadDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
int iMode,bool bWaitForProcess);
bool BurnCompilation(ckmmc::Device &Device,CAdvancedProgress *pProgress,
ckcore::Progress &Progress,const ckfilesystem::FileSet &Files,
std::vector &AudioTracks,const TCHAR *szAudioText,int iDataMode,
unsigned __int64 uiDataBytes,int iMode);
enum eMode
{
MODE_EJECT = 0,
MODE_ERASE,
MODE_FIXATE,
MODE_BURNIMAGE,
MODE_BURNIMAGEEX,
MODE_READDATATRACK,
MODE_READDATATRACKEX,
MODE_READAUDIOTRACK,
MODE_READAUDIOTRACKEX,
MODE_SCANTRACK,
MODE_SCANTRACKEX,
MODE_READDISC,
MODE_READDISCEX,
MODE_VERSION
};
enum eStatusMode
{
SMODE_DEFAULT = 0,
SMODE_GRACETIME,
SMODE_PREPROGRESS,
SMODE_PROGRESS,
SMODE_AUDIOPROGRESS
};
public:
CCore();
~CCore();
bool EjectDisc(ckmmc::Device &Device,bool bWaitForProcess);
bool LoadDisc(ckmmc::Device &Device,bool bWaitForProcess);
bool EraseDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,
int iMode,bool bForce,bool bEject,bool bSimulate);
bool FixateDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,
bool bEject,bool bSimulate);
bool BurnImage(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bCloneMode);
bool BurnImageEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szFileName,bool bCloneMode);
bool BurnTracks(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode);
eBurnResult BurnTracksEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,
const TCHAR *szDataTrack,std::vector &AudioTracks,
const TCHAR *szAudioText,int iDataMode);
bool ReadDataTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber,unsigned long ulStartSector,unsigned long ulEndSector);
eBurnResult ReadDataTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber,unsigned long ulStartSector,unsigned long ulEndSector);
bool ReadAudioTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber);
eBurnResult ReadAudioTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName,
unsigned int uiTrackNumber);
bool ScanTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector);
eBurnResult ScanTrackEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,unsigned int uiTrackNumber,
unsigned long ulStartSector,unsigned long ulEndSector);
bool CopyDisc(ckmmc::Device &SrcDevice,ckmmc::Device &DstDevice,CAdvancedProgress *pProgress);
bool ReadDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName);
eBurnResult ReadDiscEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,const TCHAR *szFileName);
bool BurnCompilation(ckmmc::Device &Device,CAdvancedProgress *pProgress,
ckcore::Progress &Progress,const ckfilesystem::FileSet &Files,std::vector &AudioTracks,
const TCHAR *szAudioText,int iMode,unsigned __int64 uiDataBytes);
eBurnResult BurnCompilationEx(ckmmc::Device &Device,CAdvancedProgress *pProgress,ckcore::Progress &Progress,
const ckfilesystem::FileSet &Files,std::vector &AudioTracks,
const TCHAR *szAudioText,int iMode,unsigned __int64 uiDataBytes);
ckcore::tstring CdrtoolsVersion();
};
extern CCore g_Core;
================================================
FILE: src/app/core/core2.cc
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#include "stdafx.hh"
#include
#include
#include
#include
#include
#include "core2.hh"
#include "core2_Format.hh"
#include "core2_blank.hh"
#include "core2_util.hh"
#include "core2_info.hh"
#include "core2_read.hh"
#include "log_dlg.hh"
#include "settings.hh"
#include "string_table.hh"
#include "lang_util.hh"
CCore2 g_Core2;
CCore2::CCore2()
{
}
CCore2::~CCore2()
{
}
bool CCore2::HandleEvents(ckmmc::Device &Device,CAdvancedProgress *pProgress,
unsigned char &ucHandledEvents)
{
ucHandledEvents = 0;
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
// Handle events.
unsigned char ucEvents = 0xFF;
unsigned char ucEvent[8];
unsigned char ucStartCount = 0;
while (ucEvents)
{
ucCdb[0] = SCSI_GET_EVENT_STATUS_NOTIFICATION;
ucCdb[1] = 0x01; // Polled.
ucCdb[4] = ucEvents;
ucCdb[8] = sizeof(ucEvent);
ucCdb[9] = 0x00;
if (!Device.transport(ucCdb,10,ucEvent,sizeof(ucEvent),ckmmc::Device::ckTM_READ))
return false;
ucEvents = ucEvent[3];
if ((ucEvent[2] & 0x07) == 0 ||
(ucEvent[0] << 8 | ucEvent[1]) == 2 ||
(ucEvent[4] & 0x0F) == 0) // No Changes
return true;
unsigned int uiDescriptor = ucEvent[4] << 24 |
ucEvent[5] << 16 | ucEvent[6] << 8 | ucEvent[7];
switch (ucEvent[2] & 0x07)
{
case 0: // No reqeusted event classes are supported.
return true;
case 1: // Operational change request/notification.
ucHandledEvents |= 0x01;
break;
case 2: // Power management.
if ((uiDescriptor & 0xFF0000) != 0x01)
{
// For some reasons this code is not compatible with all recorders.
if (ucStartCount == 10)
{
g_pLogDlg->print_line(_T(" Warning: Unable to start the drive, aborting after %d retries."),ucStartCount);
return true;
}
g_pLogDlg->print_line(_T(" The drive is not in active state."));
if (!StartStopUnit(Device,LOADMEDIA_START,false))
{
if (pProgress != NULL)
pProgress->notify(ckcore::Progress::ckERROR,lngGetString(FAILURE_NOMEDIA));
return false;
}
g_pLogDlg->print_line(_T(" -> Started the disc to make it ready for access."));
ucStartCount++;
}
ucHandledEvents |= 0x02;
break;
case 3: // External request.
ucHandledEvents |= 0x04;
break;
case 4: // Media.
ucHandledEvents |= 0x08;
break;
case 5: // Multiple hosts.
ucHandledEvents |= 0x10;
break;
case 6: // Device busy.
ucHandledEvents |= 0x20;
break;
case 7: // Reserved.
ucHandledEvents |= 0x40;
break;
}
}
return true;
}
bool CCore2::WaitForUnit(ckmmc::Device &Device,CAdvancedProgress *pProgress)
{
// Initialize buffers.
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
unsigned char ucSense[24];
memset(ucSense,0,sizeof(ucSense));
// Prepare command.
ucCdb[0] = SCSI_TEST_UNIT_READY;
while (true)
{
Sleep(1000);
unsigned char ucResult;
if (!Device.transport_with_sense(ucCdb,6,NULL,0,ckmmc::Device::ckTM_READ,
ucSense,ucResult))
{
return false;
}
// Check if we're done.
if (ucResult == SCSISTAT_GOOD)
return true;
// Check for errors.
/*switch (ucSense[2] & 0x0F)
{
case SENSEKEY_MEDIUM_ERROR:
case SENSEKEY_HARDWARE_ERROR:
return false;
case SENSEKEY_NOT_READY:
break;
}*/
// See if we're formating a disc.
unsigned char ucCode = CheckSense(ucSense);
if (ucCode == SENSE_FORMATINPROGRESS ||
ucCode == SENSE_LONGWRITEINPROGRESS)
{
// Check if the operation has been cancelled.
if (pProgress != NULL && pProgress->cancelled())
{
// Stop the unit and unlock the media.
CloseTrackSession(Device,0,0,true);
LockMedia(Device,false);
return false;
}
// Update the progress.
if (pProgress != NULL)
{
// If the SKSV bit is set to zero we are done.
if (ucSense[15] & 0x80)
{
unsigned short usProgress = ((unsigned short)ucSense[16] << 8) | ucSense[17];
pProgress->set_progress((unsigned char)(usProgress * 100.0f / 0xFFFF));
}
else
{
pProgress->set_progress(100);
return true;
}
}
}
}
return true;
}
CCore2::eMediaChange CCore2::CheckMediaChange(ckmmc::Device &Device)
{
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
// Handle events.
unsigned char ucEvent[8];
ucCdb[0] = SCSI_GET_EVENT_STATUS_NOTIFICATION;
ucCdb[1] = 0x01; // Polled.
ucCdb[4] = 0x10;
ucCdb[8] = sizeof(ucEvent);
ucCdb[9] = 0x00;
if (!Device.transport(ucCdb,10,ucEvent,sizeof(ucEvent),
ckmmc::Device::ckTM_READ))
{
return MEDIACHANGE_NOCHANGE;
}
unsigned char ucEventCode = ucEvent[4] & 0x0F;
switch (ucEventCode)
{
case 1:
Device.refresh();
return MEDIACHANGE_EJECTREQUEST;
case 2:
Device.refresh();
return MEDIACHANGE_NEWMEDIA;
case 3:
Device.refresh();
return MEDIACHANGE_MEDIAREMOVAL;
case 4:
Device.refresh();
return MEDIACHANGE_MEDIACHANGED;
case 5:
Device.refresh();
return MEDIACHANGE_BGFORMAT_COMPLETED;
case 6:
Device.refresh();
return MEDIACHANGE_BGFORMAT_RESTARTED;
}
return MEDIACHANGE_NOCHANGE;
}
bool CCore2::LockMedia(ckmmc::Device &Device,bool bLock)
{
// Initialize buffers.
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
ucCdb[0] = SCSI_PREVENTALLOW_MEDIUM_REMOVAL;
ucCdb[4] = (unsigned char)bLock;
ucCdb[5] = 0x00;
if (!Device.transport(ucCdb,6,NULL,0,ckmmc::Device::ckTM_READ))
return false;
return true;
}
bool CCore2::StartStopUnit(ckmmc::Device &Device,eLoadMedia Action,bool bImmed)
{
// Initialize buffers.
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
unsigned char ucSense[24];
memset(ucSense,0,sizeof(ucSense));
ucCdb[0] = SCSI_START_STOP_UNIT;
ucCdb[1] = (unsigned char)bImmed;
ucCdb[4] = (unsigned char)Action;
ucCdb[5] = 0x00;
unsigned char ucResult = 0;
if (!Device.transport_with_sense(ucCdb,6,NULL,0,ckmmc::Device::ckTM_READ,
ucSense,ucResult))
{
return false;
}
if (ucResult != SCSISTAT_GOOD)
{
if ((ucSense[2] & 0x0F) == SENSEKEY_NOT_READY)
{
if (ucSense[12] == 0x3A)
{
switch (ucSense[13])
{
case 0x00: // MEDIUM NOT PRESENT
case 0x01: // MEDIUM NOT PRESENT TRAY CLOSED.
break;
case 0x02: // MEDIUM NOT PRESENT TRAY OPEN
if (Action != LOADMEDIA_LOAD)
{
g_pLogDlg->print_line(_T(" Warning: Unable to start media, trying to manually load it."));
return StartStopUnit(Device,LOADMEDIA_LOAD,bImmed);
}
break;
}
}
}
g_pLogDlg->print_line(_T(" Error: Could not start or stop the unit."));
// Dump CDB.
g_pLogDlg->print(_T(" CDB:\t"));
for (unsigned int i = 0; i < 6; i++)
{
if (i == 0)
g_pLogDlg->print(_T("0x%.2X"),ucCdb[i]);
else
g_pLogDlg->print(_T(",0x%.2X"),ucCdb[i]);
}
g_pLogDlg->print_line(_T(""));
// Dump sense information.
g_pLogDlg->print_line(_T(" Sense:\t0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X"),
ucSense[0],ucSense[1],ucSense[2],ucSense[3],
ucSense[4],ucSense[5],ucSense[6],ucSense[7]);
g_pLogDlg->print_line(_T(" \t0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X"),
ucSense[ 8],ucSense[ 9],ucSense[10],ucSense[11],
ucSense[12],ucSense[13],ucSense[14],ucSense[15]);
g_pLogDlg->print_line(_T(" \t0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X,0x%.2X"),
ucSense[16],ucSense[17],ucSense[18],ucSense[19],
ucSense[20],ucSense[21],ucSense[22],ucSense[23]);
return false;
}
return true;
}
bool CCore2::CloseTrackSession(ckmmc::Device &Device,unsigned char ucCloseFunction,
unsigned short usTrackNumber,bool bImmed)
{
if (ucCloseFunction > 0x07)
return false;
// Initialize buffers.
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
ucCdb[0] = SCSI_CLOSE_TRACK_SESSION;
ucCdb[1] = bImmed ? 0x01 : 0x00;
ucCdb[2] = ucCloseFunction & 0x07;
ucCdb[4] = static_cast(usTrackNumber >> 8);
ucCdb[5] = static_cast(usTrackNumber & 0xFF);
ucCdb[9] = 0x00;
if (!Device.transport(ucCdb,10,NULL,0,ckmmc::Device::ckTM_READ))
return false;
return true;
}
bool CCore2::SetDiscSpeeds(ckmmc::Device &Device,unsigned short usReadSpeed,
unsigned short usWriteSpeed)
{
// Initialize buffers.
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
ucCdb[ 0] = SCSI_SET_CD_SPEED;
ucCdb[ 2] = static_cast(usReadSpeed >> 8);
ucCdb[ 3] = static_cast(usReadSpeed & 0xFF);
ucCdb[ 4] = static_cast(usWriteSpeed >> 8);
ucCdb[ 5] = static_cast(usWriteSpeed & 0xFF);
ucCdb[11] = 0x08;
if (!Device.transport(ucCdb,12,NULL,0,ckmmc::Device::ckTM_READ))
return false;
return true;
}
/**
Updates mode page 5 of the specified device.
@param pDevice the device to update.
@param bTestWrite specifies wether the drive should test write or not.
@param WriteMode specifies the write mode to use for recording.
@param bSilent if true, the function will not output any error to the log if it failed.
@return true if the mode page was successfully updated, false otherwise.
*/
bool CCore2::UpdateModePage5(ckmmc::Device &Device,bool bTestWrite,
bool bSilent)
{
// Initialize buffers.
unsigned char ucBuffer[128];
memset(ucBuffer,0,sizeof(ucBuffer));
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
// Read the current code page information.
ucCdb[0] = SCSI_MODE_SENSE10;
ucCdb[2] = 0x05; // Default values and code page.
ucCdb[7] = sizeof(ucBuffer) >> 8; // Allocation length (MSB).
ucCdb[8] = sizeof(ucBuffer) & 0xFF; // Allocation length (LSB).
ucCdb[9] = 0x00;
if (!Device.transport(ucCdb,10,ucBuffer,sizeof(ucBuffer),
ckmmc::Device::ckTM_READ))
{
return false;
}
if ((ucBuffer[8] & 0x3F) != 0x05)
return false;
// Change the code page.
//ucBuffer[8 + 2] |= bTestWrite ? 0x10 : 0x00;
if (bTestWrite)
ucBuffer[8 + 2] |= 0x10;
else
ucBuffer[8 + 2] &= ~0x10;
// Send the updated code page.
unsigned short usFileListSize = (ucBuffer[0] << 8 | ucBuffer[1]) + 2;
memset(ucCdb,0,sizeof(ucCdb));
ucCdb[0] = SCSI_MODE_SELECT10;
ucCdb[1] = 0x10; // PF (not using vendor specified mode page).
ucCdb[7] = static_cast(usFileListSize >> 8);
ucCdb[8] = static_cast(usFileListSize & 0xFF);
ucCdb[9] = 0x00;
if (!bSilent)
{
if (!Device.transport(ucCdb,10,ucBuffer,usFileListSize,
ckmmc::Device::ckTM_WRITE))
{
return false;
}
}
else
{
unsigned char ucSense[24];
memset(ucSense,0,sizeof(ucSense));
unsigned char ucResult = 0;
if (!Device.transport_with_sense(ucCdb,10,ucBuffer,usFileListSize,
ckmmc::Device::ckTM_WRITE,ucSense,ucResult))
{
return false;
}
if (ucResult != SCSISTAT_GOOD)
return false;
}
return true;
}
bool CCore2::EraseDisc(ckmmc::Device &Device,CAdvancedProgress *pProgress,
int iMethod,bool bForce,bool bEject,bool bSimulate,
unsigned int uiSpeed)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore2::EraseDisc"));
TCHAR szParameters[128];
lsprintf(szParameters,_T(" Method = %d, Force = %d, Eject = %d, Simulate = %d."),
iMethod,(int)bForce,(int)bEject,(int)bSimulate);
g_pLogDlg->print_line(szParameters);
}
// Setup the progress dialog.
pProgress->AllowCancel(false);
pProgress->SetRealMode(!bSimulate);
// Turn test writing on if selected.
if (!UpdateModePage5(Device,bSimulate))
g_pLogDlg->print_line(_T(" Warning: Unable to update code page 0x05."));
// Disabled until these routines are concidered stable enough.
#if 0
// Lock the media.
if (!LockMedia(pDevice,true))
g_pLogDlg->print_line(_T(" Warning: Unable to lock device media."));
#endif
// Set write speed.
if (!SetDiscSpeeds(Device,0xFFFF,(unsigned short)uiSpeed))
g_pLogDlg->print_line(_T(" Warning: Unable to set disc erase speed."));
bool bResult = false;
switch (iMethod)
{
case ERASE_FORMAT_QUICK:
case ERASE_FORMAT_FULL:
{
CCore2Format Core2Format;
bResult = Core2Format.FormatUnit(Device,pProgress,iMethod == ERASE_FORMAT_FULL);
}
break;
case ERASE_BLANK_FULL:
case ERASE_BLANK_MINIMAL:
case ERASE_BLANK_UNCLOSE:
case ERASE_BLANK_SESSION:
{
CCore2Blank Core2Blank;
bResult = Core2Blank.Blank(Device,pProgress,iMethod,bForce,bSimulate);
}
break;
}
// Unlock the media.
if (!LockMedia(Device,false))
g_pLogDlg->print_line(_T(" Warning: Unable to unlock device media."));
// Eject the media (if requested).
if (bResult && bEject)
{
if (!StartStopUnit(Device,LOADMEDIA_EJECT,true))
g_pLogDlg->print_line(_T(" Warning: Unable to eject media."));
}
return bResult;
}
bool CCore2::ReadDataTrack(ckmmc::Device &Device,CAdvancedProgress *pProgress,
unsigned char ucTrackNumber,bool bIgnoreErr,const TCHAR *szFilePath)
{
// Initialize log.
if (g_GlobalSettings.m_bLog)
{
g_pLogDlg->print_line(_T("CCore2::ReadTrack"));
TCHAR szParameters[128];
lsprintf(szParameters,_T(" Track = %d."),ucTrackNumber);
g_pLogDlg->print_line(szParameters);
}
CCore2Info Info;
CCore2Read Read;
// Print the maximum read speed (for diagnostics purposes).
ckcore::tuint32 uiMaxReadSpeed = Device.property(ckmmc::Device::ckPROP_MAX_READ_SPD);
g_pLogDlg->print_line(_T(" Maximum read speed: %d KiB/s."),uiMaxReadSpeed);
if (!SetDiscSpeeds(Device,0xFFFF,0xFFFF))
g_pLogDlg->print_line(_T(" Warning: Unable to set the device read speed."));
unsigned char ucFirstTrackNumber = 0,ucLastTrackNumber = 0;
std::vector Tracks;
if (Info.ReadTOC(Device,ucFirstTrackNumber,ucLastTrackNumber,Tracks))
{
g_pLogDlg->print_line(_T(" First and last disc track number: %d, %d."),
ucFirstTrackNumber,ucLastTrackNumber);
// Validate the requested track number.
if (ucFirstTrackNumber > ucTrackNumber || ucLastTrackNumber < ucTrackNumber)
{
g_pLogDlg->print_line(_T(" Error: The requested track number is invalid."));
return false;
}
}
else
{
g_pLogDlg->print_line(_T(" Error: Unable to read TOC information to validate selected track."));
return false;
}
// Obtain track start address.
unsigned long ulTrackAddr = Tracks[ucTrackNumber - 1].m_ulTrackAddr;
CCore2TrackInfo TrackInfo;
if (!Info.ReadTrackInformation(Device,CCore2Info::TIT_LBA,ulTrackAddr,&TrackInfo))
{
g_pLogDlg->print_line(_T(" Error: Unable to read track information."));
return false;
}
unsigned long ulTrackSize = TrackInfo.m_ulTrackSize;
// Always assume a post-gap of 150 sectors. This may be a bad idea.
ulTrackSize -= 150;
g_pLogDlg->print_line(_T(" Track span: %d-%d."),ulTrackAddr,ulTrackAddr + ulTrackSize);
unsigned long ulMin = (ulTrackSize + 150)/(60*75);
unsigned long ulSec = (ulTrackSize + 150 - ulMin * 60 * 75)/75;
unsigned long ulFrame = ulTrackSize + 150 - ulMin * 60 * 75 - ulSec * 75;
g_pLogDlg->print_line(_T(" Track length: %02d:%02d:%02d"),ulMin,ulSec,ulFrame);
pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(PROGRESS_BEGINREADTRACK),ucTrackNumber);
pProgress->set_status(lngGetString(STATUS_READTRACK));
#ifdef DEBUG
g_pLogDlg->print_line(_T(" Tracks (start, length):"));
std::vector::const_iterator it;
for (it = Tracks.begin(); it != Tracks.end(); it++)
{
CCore2TrackInfo TrackInfo;
if (Info.ReadTrackInformation(Device,CCore2Info::TIT_LBA,(*it).m_ulTrackAddr,&TrackInfo))
{
unsigned long ulMin = (TrackInfo.m_ulTrackSize + 150)/(60*75);
unsigned long ulSec = (TrackInfo.m_ulTrackSize + 150 - ulMin * 60 * 75)/75;
unsigned long ulFrame = TrackInfo.m_ulTrackSize + 150 - ulMin * 60 * 75 - ulSec * 75;
g_pLogDlg->print_line(_T(" %d, %02d:%02d:%02d (%d)"),(*it).m_ulTrackAddr,ulMin,ulSec,ulFrame,TrackInfo.m_ulTrackSize);
}
}
#endif
ckcore::FileOutStream OutStream(szFilePath);
if (!OutStream.open())
{
g_pLogDlg->print_line(_T(" Error: Unable to open the output file: \"%s\"."),szFilePath);
return false;
}
Core2ReadFunction::CReadUserData ReadFunc(Device,&OutStream);
// Start reading the selected sectors from the disc.
bool bResult = Read.ReadData(Device,pProgress,&ReadFunc,ulTrackAddr,ulTrackSize,bIgnoreErr);
OutStream.close();
if (bResult)
pProgress->notify(ckcore::Progress::ckINFORMATION,lngGetString(SUCCESS_READTRACK),ucTrackNumber);
return bResult;
}
/*
CCore2::ReadFullTOC
-------------------
Reads the full TOC and saves the data into a cdrtools compatible file.
*/
bool CCore2::ReadFullTOC(ckmmc::Device &Device,const TCHAR *szFileName)
{
// Initialize buffers.
unsigned char ucBuffer[4 + 2048]; // It feels stupid to allocate this much memory when
// only 2 bytes of data is needed. The problem is that
// some drives (tested with TSSTCorp CD/DVDW SH-S183A SB00)
// returns more data then requested which may cause buffer
// overruns.
memset(ucBuffer,0,sizeof(ucBuffer));
unsigned char ucCdb[16];
memset(ucCdb,0,sizeof(ucCdb));
ucCdb[0] = SCSI_READ_TOC_PMA_ATIP;
ucCdb[2] = 0x02; // Full Q sub-code data.
ucCdb[7] = sizeof(ucBuffer) >> 8; // Allocation length (MSB).
ucCdb[8] = sizeof(ucBuffer) & 0xFF; // Allocation length (LSB).
ucCdb[9] = 0;
if (!Device.transport(ucCdb,10,ucBuffer,sizeof(ucBuffer),
ckmmc::Device::ckTM_READ))
{
return false;
}
// Save the data to the specified file name.
ckcore::File File(szFileName);
if (!File.open(ckcore::File::ckOPEN_WRITE))
{
g_pLogDlg->print_line(_T(" Error: Unable to open file \"%s\" for writing."),szFileName);
return false;
}
unsigned short usDataLen = ((unsigned short)ucBuffer[0] << 8) | ucBuffer[1];
if (File.write(ucBuffer,usDataLen + 2) == -1)
{
g_pLogDlg->print_line(_T(" Error: Unable to write to file \"%s\"."),szFileName);
return false;
}
return true;
}
int CCore2::CreateImage(ckcore::OutStream &OutStream,const ckfilesystem::FileSet &Files,
ckcore::Progress &Progress,bool bFailOnError,
std::map *pFilePathMap)
{
ckfilesystem::FileSystem::Type FileSysType;
switch (g_ProjectSettings.m_iFileSystem)
{
case FILESYSTEM_ISO:
FileSysType = g_ProjectSettings.m_bJoliet ?
ckfilesystem::FileSystem::TYPE_ISO_JOLIET :
ckfilesystem::FileSystem::TYPE_ISO;
break;
case FILESYSTEM_ISO_UDF:
FileSysType = g_ProjectSettings.m_bJoliet ?
ckfilesystem::FileSystem::TYPE_ISO_UDF_JOLIET :
ckfilesystem::FileSystem::TYPE_ISO_UDF;
break;
case FILESYSTEM_DVDVIDEO:
FileSysType = ckfilesystem::FileSystem::TYPE_DVDVIDEO;
break;
case FILESYSTEM_UDF:
FileSysType = ckfilesystem::FileSystem::TYPE_UDF;
break;
default:
ATLASSERT(false);
ckcore::throw_internal_error(_T(__FILE__),__LINE__);
}
ckfilesystem::Iso::InterchangeLevel InterchangeLevel;
switch (g_ProjectSettings.m_iIsoLevel)
{
case 0:
InterchangeLevel = ckfilesystem::Iso::LEVEL_1;
break;
case 1:
InterchangeLevel = ckfilesystem::Iso::LEVEL_2;
break;
case 2:
InterchangeLevel = ckfilesystem::Iso::LEVEL_3;
break;
case 3:
InterchangeLevel = ckfilesystem::Iso::ISO9660_1999;
break;
default:
ATLASSERT(false);
ckcore::throw_internal_error(_T(__FILE__),__LINE__);
}
ckfilesystem::CharacterSet CharacterSet = ckfilesystem::CHARSET_ISO;
switch (g_ProjectSettings.m_IsoCharSet)
{
case CProjectSettings::CHARSET_ISO:
CharacterSet = ckfilesystem::CHARSET_ISO;
break;
case CProjectSettings::CHARSET_DOS:
CharacterSet = ckfilesystem::CHARSET_DOS;
break;
case CProjectSettings::CHARSET_ASCII:
CharacterSet = ckfilesystem::CHARSET_ASCII;
break;
default:
assert(false);
break;
}
ckfilesystem::FileSystem FileSys(FileSysType,Files);
FileSys.set_long_joliet_names(g_ProjectSettings.m_bJolietLongNames);
FileSys.set_interchange_level(InterchangeLevel);
FileSys.set_char_set(CharacterSet);
FileSys.set_include_file_ver_info(!g_ProjectSettings.m_bOmitVerNum);
FileSys.set_relax_max_dir_level(g_ProjectSettings.m_bDeepDirs);
FileSys.set_volume_label(g_ProjectSettings.m_szLabel);
FileSys.set_text_fields(g_ProjectSettings.m_szSystem,
g_ProjectSettings.m_szVolumeSet,g_ProjectSettings.m_szPublisher,
g_ProjectSettings.m_szPreparer);
FileSys.set_file_fields(g_ProjectSettings.m_szCopyright,
g_ProjectSettings.m_szAbstract,g_ProjectSettings.m_szBibliographic);
std::list::const_iterator itBootImage;
for (itBootImage = g_ProjectSettings.m_BootImages.begin(); itBootImage !=
g_ProjectSettings.m_BootImages.end(); itBootImage++)
{
switch ((*itBootImage)->m_iEmulation)
{
case PROJECTBI_BOOTEMU_NONE:
FileSys.add_boot_image_no_emu((*itBootImage)->m_FullPath.c_str(),
!(*itBootImage)->m_bNoBoot,(*itBootImage)->m_uiLoadSegment,(*itBootImage)->m_uiLoadSize);
break;
case PROJECTBI_BOOTEMU_FLOPPY:
FileSys.add_boot_image_floppy((*itBootImage)->m_FullPath.c_str(),
!(*itBootImage)->m_bNoBoot);
break;
case PROJECTBI_BOOTEMU_HARDDISK:
FileSys.add_boot_image_hard_disk((*itBootImage)->m_FullPath.c_str(),
!(*itBootImage)->m_bNoBoot);
break;
}
}
unsigned long ulSectorOffset = 0;
if (g_ProjectSettings.m_bMultiSession)
ulSectorOffset = (unsigned long)g_ProjectSettings.m_uiNextWritableAddr;
ckfilesystem::FileSystemWriter FileSysWriter(*g_pLogDlg,FileSys,bFailOnError);
int iResult = FileSysWriter.write(OutStream,Progress,ulSectorOffset);
if (pFilePathMap != NULL)
FileSysWriter.file_path_map(*pFilePathMap);
return iResult;
}
/*
A wrapper method for the function above.
*/
int CCore2::CreateImage(const TCHAR *szFullPath,const ckfilesystem::FileSet &Files,
ckcore::Progress &Progress,bool bFailOnError,
std::map *pFilePathMap)
{
ckcore::FileOutStream FileStream(szFullPath);
if (!FileStream.open())
{
g_pLogDlg->print_line(_T(" Error: Unable to obtain file handle to \"%s\"."),szFullPath);
return RESULT_FAIL;
}
return CreateImage(FileStream,Files,Progress,bFailOnError,pFilePathMap);
}
int CCore2::EstimateImageSize(const ckfilesystem::FileSet &Files,ckcore::Progress &Progress,
unsigned __int64 &uiImageSize)
{
ckcore::NullStream OutStream;
int iResult = CreateImage(OutStream,Files,Progress,true);
uiImageSize = OutStream.written();
return iResult;
}
================================================
FILE: src/app/core/core2.hh
================================================
/*
* InfraRecorder - CD/DVD burning software
* Copyright (C) 2006-2012 Christian Kindahl
*
* 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 .
*/
#pragma once
#include
#include