# Multimedia library

## Overview

The multimedia library is the central place for accessing, storing and organizing all your multimedia in &kplayer;. When you first install and run the program, the library is initially not shown. Use one of the following ways to show it:

- Select Settings Show Library or press &Ctrl;L.

- Select any of the available choices from the Library Go submenu.

- Right click the playlist drop down box on the playlist toolbar and select the Edit command from the popup menu.

The library consists of several sections that have different purpose. You can see and open the sections in the tree view on the left side of the library window.

- Now Playing section contains the current playlist, including all of its subfolders.

- Recent section contains the most recently played items and playlists.

- Playlists section stores the playlists that you create and allows you to manage them.

- Collection section contains the multimedia collection and allows you to manage it.

- Devices section contains multimedia devices that are present on your system and the multimedia available on them.

- Root Directory section allows you to access multimedia stored anywhere on your file system.

- Home Directory section allows you to access multimedia stored in your home directory and its subdirectories.

Selecting a folder in the tree view opens its contents in the list view on the right side of the library window. The list view shows the name of each multimedia item along with an icon depicting the kind of the item. Also, many of the items can have additional information displayed in separate columns. Most of that information is hidden by default, but you can choose the columns that you want to show from the Columns submenu of the Library menu and the library popup menu.

Depending on the items present in the currently displayed folder, the available columns may include Length, Frequency, Type, Demuxer, Video size, Video codec, Video bit rate, Frame rate, Audio codec, Audio bit rate, Sample rate, Channels, Track, Title, Album, Artist, Year, Genre, Path, External subtitles and other information. The configuration chapter has details on how you can customize the list view.

You can edit some of the fields, like Name, Track, Title, Album, Artist, Year and Genre, by choosing the name of the field from the Edit submenu of the Library menu or the library popup menu. To edit the Name field, choose the Rename command instead or press the F2 key. Type or paste in the new value of the field, and then press &Enter; to apply the changes, or or &Shift; to apply the changes and edit the next or the previous field, or Down Arrow or Up Arrow to apply the changes and edit the same field of the next or previous item that can have that field.

## Playlist folders

Folders in the Now Playing, Recent and Playlists section are known as playlist folders. When you open a playlist folder, the list view lets you expand its subfolders inside the same view, so that you have access to the entire contents of the selected folder. When you open a folder in another section, the list view will show the contents of that folder only, including the subfolders, and to access the contents of a subfolder, you can execute or drill down to the subfolder to open it.

The multimedia library allows you to create an unlimited number of subfolders in a playlist folder or in a folder in the Collection section, and the subfolders can be nested to an unlimited number of levels.

## Ordering and sorting

You can arrange the contents of playlist folders in any order, by dragging items with the &LMB; and dropping them in a new place, or by using the Move Up and Move Down commands from the Library menu or the library popup menu.

Folders in other sections do not have this ability, but they let you sort their contents by any column, by left clicking the column header. To sort items in the reverse order, click the column header again. If you click the column header in a playlist folder, the folder and any expanded subfolders are likewise sorted by that column, while collapsed folders retain the custom order of items if they had it.

The sorting column and direction (ascending or descending) is shared by all folders in the library, except playlist folders where you put items in a custom order as described above. So if you sort files in a directory by their time length, and then go to a folder in the Collection section for example, its contents will also be sorted by their time length.

Subfolders are always listed before other items in folders that are not playlist folders, while in playlist folders subfolders are listed after other items unless you change the order manually and arrange the contents differently. As a result, when you play a playlist, the contents of a playlist folder will be played before the contents of its subfolders, again unless you set a custom order of items in that playlist folder.

## Managing multimedia

If you have some multimedia files on your computer, you can put them into the Collection and on the Playlists, by dragging files or directories from the Home Directory or Root Directory section or from &konqueror; File Manager and dropping them into the folder of your choice. Or you can select the files and directories in the multimedia library and use the commands on the Add to submenus of the Library menu and the library popup menu.

Another way of adding multimedia to the library is by using the Add Files... command, which uses the standard &kde; file dialog, or the Add URL... command, which lets you paste in the path to a local file or directory or the URL of a remote file or stream. Both commands are on the Library menu and the library popup menu. You can also drag a link from &konqueror; Web Browser and drop it into the library.

There are four commands that put multimedia on the current playlist that is shown in the Now Playing section of the library and in the playlist drop down box on the playlist toolbar. Again, all of them are on the Library menu and the library popup menu.

- Play command clears the current playlist, puts the selected items on it and starts playing them.

- Play Next command clears the current playlist, puts the selected items on it, and if &kplayer; is playing something, plays the new items after the currently playing item finishes playing.

- Queue command adds the selected items to the end of the current playlist.

- Queue Next command adds the selected items to the end of the current playlist, and makes them next items in the playing queue. If &kplayer; is playing something, it will play the new items after the currently playing item finishes playing, else it will play them when you choose Player Next or click the Next on the playlist toolbar.

The Play, Play next, Queue, Queue next, Add to collection, Add to playlists and Add to new playlist commands are also available in &konqueror; File Manager. Select the files and directories you want to add to the multimedia library, right click to open the popup menu and select an action from the menu or from the Actions submenu.

When you drag and drop items and folders within the same section, &kplayer; will move them to the new location. If you want to copy them instead, hold the &Ctrl; key while dragging and dropping. To move multimedia to another section instead of copying it, hold the &Shift; key while dragging and dropping. To remove items and folders from the library, select them and choose the Remove command from the Library menu or the library popup menu or press the Delete key. This will only work in collection and playlist folders, since &kplayer; never deletes multimedia files or directories from your file system.

## Linked folders

Adding a directory to a collection or playlist folder in the multimedia library creates a subfolder that is linked to that directory, so that when you put new multimedia into the directory or any of its subdirectories, it will show up in the folder or the corresponding subfolder automatically, or if you remove some files from the directory, &kplayer; will remove them from the library as well. Similarly, when you put a collection folder on a playlist, the new playlist folder is linked to the collection folder, and when you play a playlist, the new folders in the Now Playing and Recent sections are linked to the playlist folder.

For example, if you take a directory full of MP3 files and add it to the Collection section of the multimedia library, then take the collection folder and put it on a playlist, then play the playlist, and then go back and put some more MP3s into the directory, &kplayer; will see them and automatically add them to the collection, the playlist and the current playlist, and play them along with the other MP3s.

If you play a playlist and then change the order of items in a folder in that playlist, the order of items on the current playlist will also change. The new order will be reflected in the Now Playing section and in the playlist drop down box on the playlist toolbar.

To open the origin folder of a linked folder, select the linked folder in the multimedia library and choose Go To Origin from the Library menu or the library popup menu.

When you add more items or remove existing items to a linked folder, it will break the link, and the folder will no longer be updated when there are changes in the origin folder. The folder icon will change to reflect that. When you change the order of items in a folder in the Now Playing section that is linked to another folder in the Playlists section, the order of items in the two folders will be different, but the current playlist will still get updated items from the playlist folder.

To copy the folder contents instead of creating a link, hold the &Ctrl; key while dragging and dropping the folder into the new location. However, the copy process may take a while if the folder contains a lot of multimedia, and of course the new folder will not be updated when the original one changes, so this is not recommended.

## Now Playing section

This section contains the current playlist as a tree of folders and multimedia items in them. Any changes you make here are going to be reflected in the playlist drop down box on the playlist toolbar, which displays the current playlist as a flat list of multimedia items in the actual order they are going to be played or have been played.

See the Playlist micro-HOWTO for details about the current playlist in &kplayer;.

## Recent section

This section contains the recently played multimedia items and playlists. If you select several items and tell &kplayer; to play or queue them, they are added to this section as one folder. If you only play one item, &kplayer; will add it as a single item to this list. The item or folder will also show up on the Play Recent submenu of the File menu and several right click popup menus.

The configuration chapter describes settings that affect this section.

## Playlists section

This is where you create and manage your playlists. The playlists can of course have any number of subfolders to any depth. The playlists will show up on the Play List submenu of the File menu and several popup menus and on the Add to submenus of the Library menu and the library popup menu.

See the Playlist micro-HOWTO for more information.

## Collection section

This section is the central place where you can store, access and manage your entire multimedia collection, including local files and directories and remote URLs.

## Devices section

This section shows the disk and tuner devices found on your system and the multimedia available on them. &kplayer; automatically finds and adds devices to this section, and also automatically detects any disks you insert into your disk drives, and displays titles or tracks available on them and channels available on the tuner devices. The devices, channels, disks, titles and tracks are also available as submenus on the File menu and several popup menus for easy access.

See the Devices micro-HOWTO for a detailed description of this &kplayer; feature.

## Directory sections

These sections let you access multimedia stored on your local file system. They only show multimedia files, so if your videos or music don't show up here, you need to make sure their media types are set up under either `audio` or `video` in the File Associations configuration in &kcontrolcenter; or &konqueror;.

&kplayer; never changes or deletes any multimedia files or directories on your system, so these sections are mostly useful for finding your multimedia and putting it in the Collection, on Playlists or on the current playlist.