@node fileselector
@chapter Fileselector
If OCP is started without any command line arguments the fileselector will be
loaded. With this powerful tool you can browse through your modules and set
up playlists to be processed by the player. If you switch to the player the
selected files will be loaded and processed.

Files can be stored inside compressed archives to save space on the hard disk.
Those files are automatically unpacked to a temporary directory before
scanning or loading. If you have many modules you should use this feature, as
storing modules inside archives is totally transparent when using the fileselector.

@section Main screen
The fileselector splits into three main windows: directory list, playlist
and module information as shown in figure bellow.

@example

###### TITLE BAR #######
X:/PATH/
------------------------
                |  P
                |  l
 Directory list |  a
                |  y
                |  l
                |  i
                |  s
                |  t
------------------------
 Moduleinfo
      [Quickfind]

@end example


The path window shows the current
path and file mask. If you started OCP from the home directory you will get
the following: @file{file:/home/user/*} means
that the current directory is @file{/home/user} on your @file{file:} drive
and all files are shown (@file{*}). You can edit the path and the mask
by pressing @key{ALT}+@key{Enter} or @key{CTRL}+@key{Enter} depending on the UI
renderer in use. After editing the path press @key{Enter}
to change to the appropriate directory. You can edit the file mask to include
only some files.
@quotation
@file{file:/media/music/*.mod} will change to the @file{/media/music} directory
of filesystem and show all files ending with @file{.mod}. The default setting
should be the current directory with a file mask @file{*} to show all files.
@end quotation

The most important window is the directory list. Here you can see all files
in the current directory. If the extension is known to OCP the file information
will be shown in different colors depending on the file type. Files not known
to OCP will be shown in standard grey.

Leftmost side the file name provided by the operating system is shown.
The extension @file{.???} will specify the file type. The next column shows the
title of the file if the file type includes a title. In the third column the
number of channels is displayed. Finally rightmost the filesize is shown in
bytes. If the module is included in a ZIP archive the @emph{real} file size
is displayed.

Right to the directory list you can see the play list. All files listed in
this window will be played, after you change into the player. The order of
entries in this window determine the order in which files are loaded unless you
have enabled the @emph{random} option.

The window at the bottom is the module information. Many music formats can
store general information which is displayed here. If the file type does not
support those information you can edit the fields inside this window manually
and OCP will store the information for you.

Finally at the very bottom is the quick find feature, which lets you easily
find files in the current directory.

@section Usage of the fileselector
The directory list shows you all files in the current directory which fit to
the file mask set in the path window. Under the alphabetically sorted files
the directories and drives are shown.@footnote{@file{setup:} is a special drive
which lets you configure OCP without editing the @file{ocp.ini} file, see page @xref{specialdrive}.}

Use the @key{Up} and @key{Down} to browse through the files. If you
press @key{Enter} the selected file will be loaded and played with the player.
Pressing @key{Enter} while selecting a directory or drive will switch to the
selected item and the directory will be read. @key{Pgup}, @key{Pgdown},
@key{Home} and @key{End} will work as expected.

If a module is played and you are in the player @key{f} will beam you to
the fileselector. You can always leave the
fileselector by pressing @key{Esc} twice! If no module is playing the program
will exit, while you will get back to the player if a module is played in the
background.

Playlists are shown in the playlist window at the right side of the screen. The
currently selected file is appended to the playlist by pressing @key{Right}
or @key{Ins}. @key{Left} or @key{Del} will remove it again. You can
insert files multiple times into the playlist by pressing the appropriate
keys more than once. If you have files in the playlist exit the fileselector
by pressing @key{Esc}! This might seem confusing in the beginning, but you
will notice the logic very soon. In the player you start the next song in the
playlist by pressing @key{Enter}.

Normally you will start the fileselector from the player by pressing @key{f}.
The current module will continue playing in the background. After you have
selected a file you have to choices:
@itemize
@item
@key{Enter} will stop the currently played module and load the selected
one. Then you will get back to the player. Use this key if you want to play the
selected module immiediatly.
@item
@key{Esc} will change to the player. Then you can start the next songs
in the playlist by pressing @key{Enter}. If you have inserted files into the
playlist use this key to exit the fileselector.
@end itemize

All files in the current directory will be inserted into the playlist by
pressing @key{CTRL}+@key{Right} or @key{CTRL}+@key{Ins}. The
playlist will be deleted by pressing @key{CTRL}+@key{Left} or
@key{CTRL}+@key{Del}.

Although in the playlist window only the filename is shown, OCP stores the
complete path information. So you can insert files into the playlist from
totally different directories and drives. If files are inserted into the
playlist you can change to the playlist window by pressing @key{Tab}. Inside
the playlist window all keys have full functionality. So you can load the
selected module immiediatly by pressing @key{Enter} or remove the file from
the list by pressing @key{Left}. If you are in the playlist window
you can move the currently selected file by pressing @key{CTRL}+@key{Up}
and @key{CTRL}+@key{Down}. This will affect the order in which files
are processed. @key{CTRL}+@{@key{Pgup},@key{Pgdown},@key{Home},@key{End}@}
work as expected.

If many files are inside a directory selecting a module with the cursor keys can
be annoying, because it takes a long time to browse through the list. If you
know the filename you can start typing it on the keyboard. This enables the
quickfind feature. Characters already typed are shown in the quickfind window.
The current directory is searched for files matching the typed characters.
Often you don't have to type the complete filename, as it can be already
determined by the leading chars. The typed characters do not have to match the
filename exactly as small errors are neglected.

At the bottom of the screen the fileinformation window is located. If the
file includes any additional information it will be shown at the appropriate
fields. You can edit each entry manually.
@smallformat
All module information is read by
the fileselector once if it runs along this module the first time. The data
is stored in three files located in your home directory of OCP refered as the
@emph{module information cache}. If the fileselector scans a directory and finds
a module which has not been processed by the fileselector it may take some
minutes to read all file information out of the files and store them in the
module information cache.
@end smallformat

To switch to the module information window press @key{SHIFT}+@key{Tab}. You
can use the cursor keys to select the entries. After pressing @key{Enter}
the information can be edited. When pressing @key{Enter} again the changes
are stored in the module information cache. Note: @emph{Do not change the entry
type as the file could not be loaded properly when the wrong filetype
is entered! Normally you never have to change this entry, except for old
15 instruments amiga noisetracker modules!}

@section Advanced usage
The appearance and behaviour of the fileselector can be edited in the
@file{ocp.ini} (@pxref{configuration, ocp.ini}) file or by pressing @key{ALT}+@key{c}. Changes made to the
@file{ocp.ini} are permanently, while configuration applied with  @key{ALT}+@key{c}
is only valid while OCP is running.

Afer pressing @key{ALT}+@key{c} you can toggle 14 options with keys
@key{1}..@key{9}, @key{a}..@key{d}, @key{+} and @key{-}. If pressing @key{ALT-S}
the settings can be flushed into @file{ocp.ini}. The following list
will explain every option:
@multitable @columnfractions .1 .9
@item 1 @tab @emph{screen mode:} This is output-driver specific. Most common you
can adjust the font-size here between sizes like 4x4, 8x8 or 16x16.
@item 2 @tab @emph{scramble module list order:} if this options is enabled the
files inside the playlist will be played in random order. Otherwise the
order shown in the fileselector from top to bottom will be used.
@item 3 @tab @emph{remove modules from playlist when played:} normally you will
want this enabled as modules are only played once. If you disable this option
you playlist can be processed foreever.
@item 4 @tab @emph{loop modules:} if the music file ends it will start again. The
next file will be played after pressing @key{Enter}. If you turn off this
option the playlist will play all modules without any user interaction.
@item 5 @tab @emph{scan module information:} When entering a directory the files
are processed to gather module information which can be shown. If you disable
this option directories will be processed quicker.
@item 6 @tab @emph{scan module information files:} the module information cache
in the home directory of OCP will be read if this option is enabled. (currently
not implemented)
@item 7 @tab @emph{scan archive contents:} to save hard disk space you can store
your files inside archives like @file{ARJ} or @file{ZIP}. If the fileselector
finds an archive it will open it to scan for files.
@item 8 @tab @emph{scan module information in archives:} if modules are found
inside archives they will be decrunched to find any module information. This
option can take several minutes if many modules are stored in archives
@item 9 @tab @emph{save module information to disk:} toggles weather to save
gathered informations in the module information chache.
@item A @tab @emph{edit window:} If you don't want the module information window
at the bottom disable this option. The directory and playlist windows will
spawn over the complete screen.
@item B @tab @emph{module type colors:} different file types are shown in
different colors on the screen. When watched on monochrome monitors or laptops
you might want to disable this option.
@item C @tab @emph{module information display mode:} changes the contents of the
directory window. You can also use @key{ALT}+@key{tab} or @key{ALT}+@key{i}
inside the fileselector.
@item D @tab @emph{put archives:} Show archives, so they can be accessed like
directories. Normally this should be disabled if archives are scanned automatically.
@item +/- @tab @emph{framerate:} Adjust the target framerate.
@end multitable

You may want to change the entry @emph{type} in the module information window
if you have old amiga modules or a non-standard midi file. Very old Noise- and
SoundTracker modules only had 15 instruments and no file identification. So
the fileselector is not able to detect those files as valid modules and refuses
to play them. You have to select @file{M15} in the @emph{type} entry. If
the module does not differ between tempo and speed and is of the 15 instrument
type select @file{M15t}. Some ProTracker modules do not differ between tempo
and speed too. If you have one of those modules use @file{MODt}. A module
player for PC called DMP introduced a feature called panning. To enable this
(non-standard) feature select @file{MODd}. If you want to play midi files
with a second drum track on channel 16 use the @file{MIDd} option. Any other
file should be autodetected correctly.
@smallformat
If you have renamed a module
to a different extension (say @file{hello.mod} to @file{hello.s3m}) OCP
will refuse to play it, because the file type is wrong. You could correct this
by selecting the right file type in the module information as shown above. But
it is recommended to rename the file to the right extension instead of tweaking the
autodetetion of the player.
@end smallformat

The current playlist can be saved into the .PLS format by pressing
@key{ALT}+@key{p}. You have to type the filename without extension in the path
window. A standard extension @file{.PLS} is appended. The playlist can be
loaded just like any other module from the fileselector or at startup.

@anchor{specialdrive}
The drive @file{setup:} is a special device which can be used to change the
hardware configuration without leaving the player. If you access this drive
you will see two subdirectories.

In the @file{INPUTS} subdirectory you can choose the device which will be
used when sampling from external sources (when playing CD audio tracks or
starting OCP in sample mode). The @file{DEVICES} directory displays all
devices which where detected at startup. Normally you might want to change
this if you want to save the next file as a @file{.WAV} or @file{.MP2}
file to the harddisk.@footnote{See @xref{player, Using the diskwriter}.}


@section Reference
@multitable @columnfractions .35 .65
@item @key{a}..@key{z}
@tab quickfind
@item @key{ALT}+@key{a}
@tab write module information @file{.mdz} for directory
@item @key{ALT}+@key{b}
@tab mark module ``big''
@item @key{ALT}+@key{c}
@tab configure fileselector
@item @key{ALT}+@key{d}
@tab goto DOS
@item @key{ALT}+@key{i}
@tab change display mode for directory window
@item @key{ALT}+@key{k}
@tab delete file
@item @key{ALT}+@key{m}
@tab move file
@item @key{ALT}+@key{s}
@tab stop scanning module information
@item @key{ALT}+@key{w}
@tab write module information @file{.mdz} for selected file
@item @key{Up}, @key{Down}
@tab move cursor one entry up/down
@item @key{CTRL}+@{@key{Up}, @key{Down}@}
@tab move module up/down on playlis
@item @key{Right}, @key{Ins}
@tab add file to playlist
@item @key{Left}, @key{Del}
@tab remove file from playlist
@item @key{CTRL}+@{@key{Right}, @key{Ins}@}
@tab add all files to playlist
@item @key{CTRL}+@{@key{Left}, @key{Del}@}
@tab clear playlist
@item @key{Pgup}, @key{Pgdown}
@tab move cursor one page up/down
@item @key{CTRL}+@{@key{Pgup}, @key{Pgdown}@}
@tab move module one page up/down in playlist
@item @key{Home}, @key{End}
@tab move cursor to top/bottom of the list
@item @key{CTRL}+@{@key{Home}, @key{End}@}
@tab move module to top/bottom of playlist
@item @key{Enter}
@tab play selected file
@item
@tab change to directory/archive/drive
@item
@tab edit entry (in module info window)
@item @key{ALT}+@key{Enter}
@tab edit path window
@item @key{Tab}
@tab change between directory and playlist
@item @key{ALT}+@key{Tab}
@tab same as @key{ALT}+@key{i}
@item @key{SHIFT}+@key{Tab}
@tab change to module info window
@item @key{Esc}
@tab exit fileselector
@end multitable

Supported filetypes -- valid options for the @emph{type} entry in the module information window.
@multitable @columnfractions .1 .9
@item 669  @tab 669 Composer module
@item AMS  @tab Velvet Studio module
@item AY   @tab Ayley-library compatible
@item BPA  @tab Death Ralley archive
@item CDA  @tab compact disk CD audio track
@item DMF  @tab X Tracker module
@item HVL  @tab HivelyTracker / Abyss Highest Experience module
@item FLAC @tab FLAC
@item IT   @tab Impulse Tracker module
@item MDL  @tab Digi Tracker module
@item MID  @tab standard midi file
@item MIDd @tab standard midi file, channel 16 is a second drum track
@item MOD  @tab amiga ProTracker 1.1b module
@item MODt @tab amiga ProTracker 1.1b module, effect Fxx is tempo
@item MODd @tab amiga ProTracker 1.1b module with effect 8xx is panning
@item MODf @tab pc Fast Tracker II .mod file
@item M15  @tab amiga NoiseTracker module with 15 instruments (plays like ProTracker 1.1b)
@item M15t @tab amiga NoiseTracker module with 15 instruments, effect Fxx is tempo (plays like ProTracker 1.1b)
@item M31  @tab miga NoiseTracker module with 31 instruments
@item MPx  @tab MPEG audio format level 1-3
@item MTM  @tab Multi Tracker module
@item MXM  @tab Mxmplay module
@item OGG  @tab Ogg Vorbis sound stream
@item OKT  @tab Oktalyzer module
@item OPL  @tab Adplug-library compatible
@item PLS  @tab OCP playlist, works also with M3U and PLT playlist files
@item PTM  @tab Poly Tracker module
@item SID  @tab PSID SID file
@item STM  @tab Scream Tracker 2 module
@item S3M  @tab Scream Tracker 3 module
@item SID  @tab PSID sid file
@item UMX  @tab Unreal module file
@item ULT  @tab Ultra Tracker module
@item WAV  @tab Microsoft RIFF wave file
@item WOW  @tab WOW Tracker module
@item XM   @tab Fast Tracker 2 module
@item YM   @tab ST-Sound (YM files player library)
@end multitable
