C development based on the full command-line audio player

cmus is a powerful built-in file manager audio music player. With its ncurses-based command-line interface, you can browse your music library and play music from a playlist or queue, it was all in the command line.

Installation on Linux cmus

首先,你需要按照如下建议设置并安装cmus。

在Ubuntu, Debian 或者Linux Mint中:

    $ sudo apt-get install cmus 

在Fedora上,首先启用RPM Fusion仓库,接着运行:

    $ sudo yum install cmus 

在CentOS上,首先启用Repoforge仓库,接着运行:

    $ sudo yum install cmus 

在Archlinux上:

    $ sudo pacman -S cmus 

安装完之后,在命令行下如下输入就可运行cums:

    $ cmus 

Import music files to cmus

第一件要做的事情是导入你的音乐文件到你的库中。这个过程可以看出两个事情:快捷方式受到了vim的命令模式的启发;还有cmus运行的很快。我已经在20秒之内成功地导入了超过1000首歌!而在iTunes或者其他任何图形音乐库软件下试一下导入,我想你会有足够的时间来做一份花生酱三明治 :>。

要在cmus下面导入音乐,输入下面的像vim一样的命令。

    :a /path/to/your/music/folder

在我的Xubuntu上,我这么做:

    :a /home/adrien/Music/

接下来这个目录下所有的音乐文件会立马按照艺术家或者专辑的方式排列显示。

Getting Started

Before you start, you might want to keep in mind some basic shortcuts to start playing your music. This is the only drawback of cmus. Unless you change them, otherwise the default shortcut is not intuitive, and you have to learn them. in short:

x 播放或重播音乐
c 暂停
b 播放下一首音乐
z 播放前一首音乐
s 激活随机播放

After remember, we are ready to begin!

Basic use

cmus interface composed of seven interface, you can press the appropriate number key to access. For example, the start page is a tree interface, you can access at any time by pressing the "1." This interface may be used intuitively: keys to navigate up and down the left side of the panel located on the artist, album, press the space can see a particular artist, using the tab key to switch to the right panel to select a song, and finally by under the Enter key to play music.

As you can see, the bottom shows the name of the artist, album, and title of the song being played, as well as time and volume.

The second interface with just a display similar to the first, shows a list of songs arranged by artist.

However, a third more useful interface, which shows the current playlist. To add a song in the tree view or list view, enter 'y' as long as the selected songs. When you create a perfect song list, use the following command to save down the line.

    :save /path/to/playlist

用下面命令加载:

    :load /path/to/playlist

The fourth screen shows the queue. A little different queues and playlists that once a song is played according to the queue, after the player will be removed from the queue. Make a song added to the queue, just add it to a playlist same, but use a shortcut: "e"

The fifth interface is also very useful, it is a lightweight file browser. When you find a song in your computer without having added to the library when useful. Navigation is very standard: using the up or down keys, the Enter key is used to enter or select a file folder.

第六界面是一个库过滤器,用来动态创建播放列表。如它听上去的那样,过滤器会遍历你的库,并且只显示符合相关规则定义的音乐。之后我会描述如何定义你自己的过滤器,但是cmus已经自带了一些。要试一下,只要使用:

    :filter [name of the filter]

比如:

    :filter classical

除了带有"Classical"标签的音乐,它会隐藏你库中所有的其它音乐。

![](https://img2018.cnblogs.com/blog/1724569/201911/1724569-20191113204022857-1569563636.png)

最后但同样重要的,第七个界面是设置。在这里,你可以定义你的快捷方式和命令。我会在下一部分给你一些例子。

![](https://img2018.cnblogs.com/blog/1724569/201911/1724569-20191113204036355-1322517453.png)

## 高级用法 

As committed as you are now more familiar with the interface, and I will give you some tips to enhance your experience.

To search for anything in the interface, as long as the same as a shortcut to vim

/[keyword]

and also:

n

The next place to search for keywords.

You want to create a filter, use the syntax:

:fset [name of the new filter]=[expression]

For example, you can find all the old rock music:

:fset oldies=genre="Rock"&date<1970

To learn more about the expression that you can use, I suggest you read the documentation carefully and existing filters.

To re-play all the music (no filter), use the following command:

:set replaygain=1

To change the shortcut to a different key, to enter the settings interface and identify existing binding expression. For example, I want to play a shortcut from the "x" changed to "w", I will turn the following line:

common  x       player-play

Then press the Enter, and into the following expression

:bind -f common w player-play

Overall, I really like cmus. It also has many skills not mentioned in this blog entry, so you are ready, you should carefully read the man to help manual. In short, cmus is a fast, easy to learn, good software will not tamper with your files. If you like the idea of managing your music library from the command line, but has not yet become a big fan of cmus, I suggest you first try some alternatives, such as the MOC and PyTone, they are also great.
`` `

Guess you like

Origin www.cnblogs.com/7haoyu/p/11853014.html