D-Bus API

The D-Bus API is specified in org.kde.Kid3.xml. The Kid3 interface has the following methods:

Open file or folder

boolean openDirectory(path); 
string path;
 
path

path to file or folder

Returns true if OK.

Unload the tags of all files which are not modified or selected

unloadAllTags(); 
 

Save all modified files

boolean save(); 
 

Returns true if OK.

Get a detailed error message provided by some methods

string getErrorMessage(); 
 

Returns detailed error message.

Revert changes in the selected files

revert(); 
 

Start an automatic batch import

boolean batchImport(tagMask,  
 profileName); 
int32 tagMask;
string profileName;
 
tagMask

tag mask (bit 0 for tag 1, bit 1 for tag 2)

profileName

name of batch import profile to use

Import tags from a file

boolean importFromFile(tagMask,  
 path,  
 fmtIdx); 
int32 tagMask;
string path;
int32 fmtIdx;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

path

path of file

fmtIdx

index of format

Returns true if OK.

Import tags from other tags

importFromTags(tagMask,  
 source,  
 extraction); 
int32 tagMask;
string source;
string extraction;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

source

format to get source text from tags

extraction

regular expression with frame names and captures to extract from source text

Import tags from other tags on selected files

array importFromTagsToSelection(tagMask,  
 source,  
 extraction); 
int32 tagMask;
string source;
string extraction;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

source

format to get source text from tags

extraction

regular expression with frame names and captures to extract from source text

returnValues

extracted value for "%{__return}(.+)"

Download album cover art

downloadAlbumArt(url,  
 allFilesInDir); 
string url;
boolean allFilesInDir;
 
url

URL of picture file or album art resource

allFilesInDir

true to add the image to all files in the folder

Export tags to a file

boolean exportToFile(tagMask,  
 path,  
 fmtIdx); 
int32 tagMask;
string path;
int32 fmtIdx;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

path

path of file

fmtIdx

index of format

Returns true if OK.

Create a playlist

boolean createPlaylist(); 
 

Returns true if OK.

Get items of a playlist

array getPlaylistItems(path); 
string path;
 
path

path to playlist file

Returns list of absolute paths to playlist items.

Set items of a playlist

boolean setPlaylistItems(path,  
 items); 
string path;
array items;
 
path

path to playlist file

items

list of absolute paths to playlist items

Returns true if OK, false if not all items were found and added or saving failed.

Quit the application

quit(); 
 

Select all files

selectAll(); 
 

Deselect all files

deselectAll(); 
 

Set the first file as the current file

boolean firstFile(); 
 

Returns true if there is a first file.

Set the previous file as the current file

boolean previousFile(); 
 

Returns true if there is a previous file.

Set the next file as the current file

boolean nextFile(); 
 

Returns true if there is a next file.

Select the first file

boolean selectFirstFile(); 
 

Returns true if there is a first file.

Select the previous file

boolean selectPreviousFile(); 
 

Returns true if there is a previous file.

Select the next file

boolean selectNextFile(); 
 

Returns true if there is a next file.

Select the current file

boolean selectCurrentFile(); 
 

Returns true if there is a current file.

Expand or collapse the current file item if it is a folder

boolean expandDirectory(); 
 

A file list item is a folder if getFileName() returns a name with '/' as the last character.

Returns true if current file item is a folder.

Apply the file name format

applyFilenameFormat(); 
 

Apply the tag format

applyTagFormat(); 
 

Apply text encoding

applyTextEncoding(); 
 

Set the folder name from the tags

boolean setDirNameFromTag(tagMask,  
 format,  
 create); 
int32 tagMask;
string format;
boolean create;
 
tagMask

tag mask (bit 0 for tag 1, bit 1 for tag 2)

format

folder name format

create

true to create, false to rename

Returns true if OK, else the error message is available using getErrorMessage().

Set subsequent track numbers in the selected files

numberTracks(tagMask,  
 firstTrackNr); 
int32 tagMask;
int32 firstTrackNr;
 
tagMask

tag mask (bit 0 for tag 1, bit 1 for tag 2)

firstTrackNr

number to use for first file

Filter the files

filter(expression); 
string expression;
 
expression

filter expression

Convert ID3v2.3 tags to ID3v2.4

convertToId3v24(); 
 

Convert ID3v2.4 tags to ID3v2.3

convertToId3v23(); 
 

Returns true if OK.

Get path of folder

string getDirectoryName(); 
 

Returns absolute path of folder.

Get name of current file

string getFileName(); 
 

Returns true absolute file name, ends with "/" if it is a folder.

Set name of selected file

setFileName(name); 
string name;
 
name

file name

The file will be renamed when the folder is saved.

Set format to use when setting the filename from the tags

setFileNameFormat(format); 
string format;
 
format

file name format

Set the file names of the selected files from the tags

setFileNameFromTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Get value of frame

string getFrame(tagMask,  
 name); 
int32 tagMask;
string name;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

name

name of frame (e.g. "artist")

To get binary data like a picture, the name of a file to write can be added after the name, e.g. "Picture:/path/to/file". In the same way, synchronized lyrics can be exported, e.g. "SYLT:/path/to/file".

Returns value of frame.

Set value of frame

boolean setFrame(tagMask,  
 name,  
 value); 
int32 tagMask;
string name;
string value;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

name

name of frame (e.g. "artist")

value

value of frame

For tag 2 (tagMask 2), if no frame with name exists, a new frame is added, if value is empty, the frame is deleted. To add binary data like a picture, a file can be added after the name, e.g. "Picture:/path/to/file". "SYLT:/path/to/file" can be used to import synchronized lyrics.

Returns true if OK.

Get all frames of a tag

array of string getTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Returns list with alternating frame names and values.

Get technical information about file

array of string getInformation(); 
 

Properties are Format, Bitrate, Samplerate, Channels, Duration, Channel Mode, VBR, Tag 1, Tag 2. Properties which are not available are omitted.

Returns list with alternating property names and values.

Set tag from file name

setTagFromFileName(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Set tag from other tag

setTagFromOtherTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Copy tag

copyTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Paste tag

pasteTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Remove tag

removeTag(tagMask); 
int32 tagMask;
 
tagMask

tag bit (1 for tag 1, 2 for tag 2)

Reparse the configuration

reparseConfiguration(); 
 

Automated configuration changes are possible by modifying the configuration file and then reparsing the configuration.

Plays the selected files

playAudio();